Agent Skill · cast

summarize-cwl

Validate and normalize a CWL Workflow tree, then emit a lightweight structured summary for downstream Galaxy translation.

← All cast skills · Source mold →

Install with Claude Code

/plugin marketplace add galaxyproject/foundry
/plugin install foundry-skills@galaxy-workflow-foundry

Then invoke as:

/foundry-skills:summarize-cwl

Install with Codex

codex plugin marketplace add galaxyproject/foundry
codex plugin add foundry-skills@galaxy-workflow-foundry

Then select with /skills or invoke explicitly as:

$summarize-cwl

Skill Bundle

/ packaged cast
attached files
13
upfront
5
on demand
8
cast rev
n/a
validated
0

Produces: 1 artifact.

Artifact Contract

/ skill handoff

Produces

summary-cwl

Structured summary of a CWL Workflow + CommandLineTool tree: inputs, outputs, scatter, conditionals, requirements.

jsonsummary-cwl.json[[summary-cwl]]
Raw artifact contract
{
  "id": "summary-cwl",
  "kind": "json",
  "default_filename": "summary-cwl.json",
  "schema": "[[summary-cwl]]",
  "description": "Structured summary of a CWL Workflow + CommandLineTool tree: inputs, outputs, scatter, conditionals, requirements."
}

Attached Files

/ runtime references

Load upfront

cli-tool

cwl-utils

packaged

Normalize the CWL workflow (cwl-normalizer) into a single JSON document for extraction.

upfront runtime verbatim hypothesis deterministic 1.2 KB
bundle
references/cli/cwl-utils.md
source
content/cli/cwl-utils/index.md
Preview md
---
type: cli-tool
tool: cwl-utils
origin: pypi
package: cwl-utils
invoke: cwl-normalizer
invoke_fallback: "uvx --from cwl-utils cwl-normalizer"
availability_check: "cwl-normalizer --help"
docs_url: "https://github.com/common-workflow-language/cwl-utils"
tags:
  - cli/cwl-utils
status: draft
created: 2026-05-10
revised: 2026-05-10
revision: 1
summary: "CWL document utilities. summarize-cwl uses cwl-normalizer to gather references and upgrade to v1.2 JSON."
---

# cwl-utils

Maintained Python utilities for working with CWL documents. The Foundry's primary entry point is `cwl-normalizer`, which produces a single JSON document with referenced subdocuments gathered and CWL upgraded to v1.2 — the preferred extraction surface for summarize-cwl.

## Install

`uvx --from cwl-utils cwl-normalizer ...` runs a non-default bin in an ephemeral env. `uv tool install cwl-utils` exposes the package's bins on PATH.

Fallback without uv: `pip install cwl-utils`.

## Notes

- The package ships several bins (cwl-normalizer, cwl-graph-split, cwl-docker-extract, ...); the Foundry currently uses cwl-normalizer.
- Normalization is the preferred handoff because it pulls in referenced documents and rewrites references — downstream Molds extract from regular JSON.
cli-tool

cwltool

packaged

Validate the CWL entrypoint before normalization.

upfront runtime verbatim hypothesis deterministic 1.1 KB
bundle
references/cli/cwltool.md
source
content/cli/cwltool/index.md
Preview md
---
type: cli-tool
tool: cwltool
origin: pypi
package: cwltool
invoke: cwltool
invoke_fallback: "uvx cwltool"
availability_check: "cwltool --version"
docs_url: "https://cwltool.readthedocs.io/"
tags:
  - cli/cwltool
status: draft
created: 2026-05-10
revised: 2026-05-10
revision: 1
summary: "Reference CWL runner and validator. Used by summarize-cwl for entrypoint validation."
---

# cwltool

Reference implementation of the Common Workflow Language standard. The Foundry uses it for entrypoint validation (`cwltool --validate`) before normalization; runtime execution is out of scope for current Molds.

## Install

`uvx cwltool` runs cwltool in an ephemeral environment without a project venv. For repeat use, `uv tool install cwltool` puts the binary on PATH.

Fallback without uv: `pip install cwltool` (in a venv).

## Notes

- Validation is structural, not behavioral. A workflow that validates may still fail under execution.
- The Foundry pairs `cwltool --validate` with `cwl-utils cwl-normalizer` for downstream extraction — the normalized JSON is the preferred surface.
cli-tool

foundry

packaged

Schema-check summary-cwl.json before returning it from the skill.

upfront runtime verbatim cast-validated deterministic 907 B
bundle
references/cli/foundry.md
source
content/cli/foundry/index.md
Preview md
---
type: cli-tool
tool: foundry
origin: npm
package: "@galaxy-foundry/foundry"
invoke: foundry
invoke_fallback: "npx --package @galaxy-foundry/foundry foundry"
availability_check: "foundry --help"
docs_url: "https://github.com/galaxyproject/foundry/blob/main/packages/foundry/README.md"
tags:
  - cli/foundry
status: draft
created: 2026-05-11
revised: 2026-05-11
revision: 1
summary: "Foundry CLI: bundles all Mold IO validators and a summarize-nextflow subcommand."
---

# foundry

Unified Foundry CLI. Subcommands cover every Mold IO validator plus a `summarize-nextflow` wrapper around the standalone `@galaxy-foundry/summarize-nextflow` package. Per-subcommand synopsis, args, and options are rendered from `@galaxy-foundry/foundry/meta`.

## Install

`npx --package @galaxy-foundry/foundry foundry <subcommand>` runs without a global install. For repeat use, `npm install -g @galaxy-foundry/foundry`.
research

component-cwl-workflow-anatomy

packaged

Use CWL's native workflow, step, tool, scatter, conditional, and requirement structure without copying the heavier Nextflow inference pipeline.

upfront runtime verbatim hypothesis deterministic 5.4 KB
bundle
references/notes/component-cwl-workflow-anatomy.md
source
content/research/component-cwl-workflow-anatomy/index.md
Preview md
---
type: research
title: "CWL workflow anatomy"
tags:
  - source/cwl
status: draft
created: 2026-05-10
revised: 2026-05-10
revision: 1
related_notes:
  - "[[summary-cwl]]"
  - "[[cwl-v1.2-schemas]]"
  - "[[galaxy-collection-semantics]]"
related_molds:
  - "[[summarize-cwl]]"
  - "[[cwl-summary-to-galaxy-interface]]"
  - "[[cwl-summary-to-galaxy-data-flow]]"
  - "[[cwl-summary-to-galaxy-template]]"
sources:
  - "https://www.commonwl.org/v1.2/Workflow.html"
  - "https://cwltool.readthedocs.io/en/stable/"
  - "https://github.com/common-workflow-language/cwl-utils#normalize-a-cwl-document"
  - "https://pypi.org/project/cwl-utils/"
  - "https://github.com/common-workflow-language/cwldep"
summary: "CWL structure relevant to summarize-cwl: normalized documents, steps, scatter, conditionals, requirements, and dependency handling."
---

# CWL Workflow Anatomy

CWL is a structured workflow language, not a pipeline framework that must be inferred from ecosystem conventions. The `summarize-cwl` Mold should therefore start from CWL's own validated object model and avoid recreating the heavy Nextflow extraction stack.

## Normalization Posture

Use `cwltool --validate` as the first gate. If validation fails, the summary should emit provenance plus validation diagnostics and stop before producing downstream-looking graph claims.

Use `cwl-normalizer` from `cwl-utils` as the default normalization surface. The cwl-utils README describes it as producing JSON CWL documents with dependencies packed together, upgrading to CWL v1.2 as needed, and optionally refactoring CWL expressions into separate steps. This is the right handoff for `summarize-cwl`: structured enough for extraction, still source-faithful, and not a Galaxy design.

Use `cwl-utils` for structured extraction when implementin
...
schema

summary-cwl

packaged

Validate the emitted CWL summary JSON and provide downstream consumers the output contract.

upfront both verbatim cast-validated deterministic 19.3 KB
bundle
references/schemas/summary-cwl.schema.json
source
package://@galaxy-foundry/foundry#summaryCwlSchema
Preview json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://galaxyproject.org/foundry/schemas/summary-cwl.schema.json",
  "$comment": "Canonical source: packages/foundry/src/schemas/summary-cwl/summary-cwl.schema.json in galaxyproject/foundry. Mold frontmatter cites this schema via [[summary-cwl]] wiki-links; the cast pipeline imports the `summaryCwlSchema` runtime export and serializes it into cast bundles.",
  "title": "CWL Workflow Summary",
  "description": "Structured per-source summary emitted by the summarize-cwl Mold. CWL is already a typed workflow language, so this schema records validated and normalized workflow/tool structure rather than inferred pipeline semantics.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "summary_version",
    "source",
    "documents",
    "workflow_inputs",
    "workflow_outputs",
    "steps",
    "tools",
    "graph",
    "tests",
    "warnings"
  ],
  "properties": {
    "summary_version": {
      "type": "string",
      "enum": [
        "1"
      ],
      "description": "Summary schema major version."
    },
    "source": {
      "$ref": "#/$defs/SourceRecord"
    },
    "documents": {
      "$ref": "#/$defs/DocumentSet"
    },
    "workflow_inputs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkflowInput"
      }
    },
    "workflow_outputs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkflowOutput"
      }
    },
    "steps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkflowStep"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CommandLineTool"
      }
    },
    "graph": {
      "$ref": "#/$defs/WorkflowGraph"
    },
    "tests": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TestCase"
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Warning"
      }
    }
  },
  "$defs": {
    "SourceRecord": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "ecosystem",
        "workflow",
        "url",
        "version",
        "license",
        "slug",
        "cwl_version",
        "entrypoint"
      ],
      "properties": {
        "ecosystem": {
          "type": "string",
          "enum": [
            "cwl"
          ],
          "description": 
...

Load on demand

research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 2.0 KB
bundle
references/notes/cwl-v1.2-schemas.md
source
content/research/cwl-v1.2-schemas/index.md
Preview md
---
type: research
title: "CWL v1.2 schema documents"
tags:
  - source/cwl
status: draft
created: 2026-05-10
revised: 2026-05-10
revision: 1
related_notes:
  - "[[component-cwl-workflow-anatomy]]"
  - "[[summary-cwl]]"
related_molds:
  - "[[summarize-cwl]]"
companions:
  - "cwl-v1.2/cwl.yaml"
  - "cwl-v1.2/CommonWorkflowLanguage.yml"
  - "cwl-v1.2/Process.yml"
  - "cwl-v1.2/CommandLineTool.yml"
  - "cwl-v1.2/CommandLineTool-standalone.yml"
  - "cwl-v1.2/Workflow.yml"
  - "cwl-v1.2/Operation.yml"
sources:
  - "https://github.com/common-workflow-language/cwl-v1.2/tree/v1.2.1"
  - "https://www.commonwl.org/v1.2/Workflow.html"
summary: "Vendored official CWL v1.2.1 JSON/SALAD schema documents used as source-structure reference for CWL summarization."
---

# CWL v1.2 Schema Documents

Vendored from `common-workflow-language/cwl-v1.2` tag `v1.2.1`, pinned at SHA `ae6899d`. These files are reference material for [[summarize-cwl]] and [[component-cwl-workflow-anatomy]], not Mold IO schemas.

Vendored files under `cwl-v1.2/`, beside this note:

- `cwl.yaml` — generated JSON Schema for CWL v1.2.
- `CommonWorkflowLanguage.yml` — top-level SALAD schema imports.
- `Process.yml` — shared process, requirement, hint, and parameter definitions.
- `CommandLineTool.yml` — command-line tool schema.
- `CommandLineTool-standalone.yml` — standalone command-line tool import surface.
- `Workflow.yml` — workflow, step, scatter, link, and output-source schema.
- `Operation.yml` — abstract operation schema.

Re-sync:

```sh
pnpm sync:vendored
```

The vendored upstream manifest uses pinned raw GitHub URLs. Updating to a new CWL release should change the raw URLs and `pinned_ref` values together, then re-run `pnpm sync:vendored`.

## Foundry Role

Use these documents to check field names, enums, an
...
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 54 B
bundle
references/notes/cwl-v1.2/CommandLineTool-standalone.yml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/CommandLineTool-standalone.yml
Preview yml
- $import: Process.yml
- $import: CommandLineTool.yml
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 68.0 KB
bundle
references/notes/cwl-v1.2/CommandLineTool.yml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/CommandLineTool.yml
Preview yml
saladVersion: v1.1
$base: "https://w3id.org/cwl/cwl#"

$namespaces:
  cwl: "https://w3id.org/cwl/cwl#"

$graph:

- name: CommandLineToolDoc
  type: documentation
  doc:
    - |
      # Common Workflow Language (CWL) Command Line Tool Description, v1.2

      This version:
        * https://w3id.org/cwl/v1.2/

      Latest stable version:
        * https://w3id.org/cwl/
    - "\n\n"
    - {$include: contrib.md}
    - "\n\n"
    - |
      # Abstract

      A Command Line Tool is a non-interactive executable program that reads
      some input, performs a computation, and terminates after producing some
      output.  Command line programs are a flexible unit of code sharing and
      reuse, unfortunately the syntax and input/output semantics among command
      line programs is extremely heterogeneous. A common layer for describing
      the syntax and semantics of programs can reduce this incidental
      complexity by providing a consistent way to connect programs together.
      This specification defines the Common Workflow Language (CWL) Command
      Line Tool Description, a vendor-neutral standard for describing the
      syntax and input/output semantics of command line programs.

    - {$include: intro.md}

    - |
      ## Introduction to the CWL Command Line Tool standard v1.2.1

      There are no new features nor behavior changes in CWL v1.2.1
      as compared to CWL v1.2.0. v1.2.1 fixes only typos, adds clarifications,
      and adds additional conformance tests. Some changes to the schema defining
      CWL are to aid the auto-generation of libraries for the reading and
      writing of CWL documents.

      Documents should continue to specify `cwlVersion: v1.2`. However, when
      reporting results from running the CWL conformance tests, please do repor
...
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 228 B
bundle
references/notes/cwl-v1.2/CommonWorkflowLanguage.yml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/CommonWorkflowLanguage.yml
Preview yml
saladVersion: v1.1
$base: "https://w3id.org/cwl/cwl#"

$namespaces:
  cwl: "https://w3id.org/cwl/cwl#"
  sld: "https://w3id.org/cwl/salad#"

$graph:

- $import: Process.yml
- $import: CommandLineTool.yml
- $import: Workflow.yml
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 69.1 KB
bundle
references/notes/cwl-v1.2/cwl.yaml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/cwl.yaml
Preview yaml
$schema: "http://json-schema.org/draft-07/schema#"
$author: "Francis Charette-Migneault <francis.charette.migneault@gmail.com>"
$id: "https://raw.githubusercontent.com/common-workflow-language/cwl-v1.2/1.2.1_proposed/json-schema/cwl.yaml"

$defs:
  CWL:
    oneOf:
      - $ref: '#/$defs/CWLAtomic'
      - $ref: '#/$defs/CWLGraph'
      - $ref: '#/$defs/CWLWorkflow'
  CWLKeywordList:
    type: array
    title: KeywordList
    description: Keywords applied to the process for search and categorization purposes.
    items:
      type: string
      title: keyword
      minLength: 1
  CWLTextPatternID:
    $comment: |
      Identifier with text pattern that can allow additional non-ASCII characters depending on regex implementation.
      The identifier allows a '#' or a relative 'sub/part#ref' prefix, to support references to other definitions
      in the CWL document, such as when using 'SchemaDefRequirement'.

      JSON spec regex does not include '\w' in its default subset to allow all word-like unicode characters
      (see reference: https://json-schema.org/understanding-json-schema/reference/regular_expressions.html).

      Since support is implementation specific, add both the ASCII-only and '\w' representation simultaneously
      and let the parser reading this document apply whichever is more relevant or supported
      (see discussion: https://github.com/common-workflow-language/cwl-v1.2/pull/256#discussion_r1234037814).
    # TODO: implement specific characters supported by CWL
    # (https://github.com/common-workflow-language/common-workflow-language/issues/429)
    pattern: '^([A-Za-z0-9\w]+(/[A-Za-z0-9\w]+)*)?[#.]?[A-Za-z0-9\w]+(?:[-_.][A-Za-z0-9\w]+)*$'
    type: string
    description: Generic identifier name pattern.
  CWLIdentifier:
    anyOf:
    - ty
...
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 2.4 KB
bundle
references/notes/cwl-v1.2/Operation.yml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/Operation.yml
Preview yml
saladVersion: v1.1
$base: "https://w3id.org/cwl/cwl#"

$namespaces:
  cwl: "https://w3id.org/cwl/cwl#"

$graph:

- name: OperationInputParameter
  type: record
  extends: InputParameter
  docParent: "#Operation"
  doc: |
    Describe an input parameter of an operation.
  fields:
    - name: type
      type:
        - CWLType
        - InputRecordSchema
        - InputEnumSchema
        - InputArraySchema
        - string
        - type: array
          items:
            - CWLType
            - InputRecordSchema
            - InputEnumSchema
            - InputArraySchema
            - string
      jsonldPredicate:
        "_id": "sld:type"
        "_type": "@vocab"
        refScope: 2
        typeDSL: True
      doc: |
        Specify valid types of data that may be assigned to this parameter.

- name: OperationOutputParameter
  type: record
  extends: OutputParameter
  docParent: "#Operation"
  doc: |
    Describe an output parameter of an operation.
  fields:
    - name: type
      type:
        - CWLType
        - OutputRecordSchema
        - OutputEnumSchema
        - OutputArraySchema
        - string
        - type: array
          items:
            - CWLType
            - OutputRecordSchema
            - OutputEnumSchema
            - OutputArraySchema
            - string
      jsonldPredicate:
        "_id": "sld:type"
        "_type": "@vocab"
        refScope: 2
        typeDSL: True
      doc: |
        Specify valid types of data that may be assigned to this parameter.

- type: record
  name: Operation
  extends: Process
  documentRoot: true
  specialize:
    - specializeFrom: InputParameter
      specializeTo: OperationInputParameter
    - specializeFrom: OutputParameter
      specializeTo: OperationOutputParameter
  doc: |
    This record describes an a
...
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 40.1 KB
bundle
references/notes/cwl-v1.2/Process.yml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/Process.yml
Preview yml
saladVersion: v1.1
$base: "https://w3id.org/cwl/cwl#"

$namespaces:
  cwl: "https://w3id.org/cwl/cwl#"
  sld: "https://w3id.org/cwl/salad#"
  rdfs: "http://www.w3.org/2000/01/rdf-schema#"

$graph:

- name: "Common Workflow Language, v1.2"
  type: documentation
  doc: {$include: concepts.md}

- $import: "salad/schema_salad/metaschema/metaschema_base.yml"

- name: BaseTypesDoc
  type: documentation
  doc: |
    ## Base types
  docChild:
    - "#CWLType"
    - "#Process"

- type: enum
  name: CWLVersion
  doc: "Version symbols for published CWL document versions."
  symbols:
    - cwl:draft-2
    - cwl:draft-3.dev1
    - cwl:draft-3.dev2
    - cwl:draft-3.dev3
    - cwl:draft-3.dev4
    - cwl:draft-3.dev5
    - cwl:draft-3
    - cwl:draft-4.dev1
    - cwl:draft-4.dev2
    - cwl:draft-4.dev3
    - cwl:v1.0.dev4
    - cwl:v1.0
    - cwl:v1.1.0-dev1   # a dash is required by the semver 2.0 rules
    - cwl:v1.1
    - cwl:v1.2.0-dev1
    - cwl:v1.2.0-dev2
    - cwl:v1.2.0-dev3
    - cwl:v1.2.0-dev4
    - cwl:v1.2.0-dev5
    - cwl:v1.2

- name: CWLType
  type: enum
  extends: "sld:PrimitiveType"
  symbols:
    - cwl:File
    - cwl:Directory
  doc:
    - "Extends primitive types with the concept of a file and directory as a builtin type."
    - "File: A File object"
    - "Directory: A Directory object"

- name: File
  type: record
  docParent: "#CWLType"
  doc: |
    Represents a file (or group of files when `secondaryFiles` is provided) that
    will be accessible by tools using standard POSIX file system call API such as
    open(2) and read(2).

    Files are represented as objects with `class` of `File`.  File objects have
    a number of properties that provide metadata about the file.

    The `location` property of a File is a IRI that uniquely identifies the
    file.  I
...
research

cwl-v1.2-schemas

packaged

Check official CWL v1.2 field names and source-language semantics when summarizing less-common features.

Trigger: When the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.

on-demand runtime verbatim corpus-observed deterministic 40.6 KB
bundle
references/notes/cwl-v1.2/Workflow.yml
source
content/research/cwl-v1.2-schemas/cwl-v1.2/Workflow.yml
Preview yml
saladVersion: v1.1
$base: "https://w3id.org/cwl/cwl#"

$namespaces:
  cwl: "https://w3id.org/cwl/cwl#"
  rdfs: "http://www.w3.org/2000/01/rdf-schema#"

$graph:

- name: "WorkflowDoc"
  type: documentation
  doc:
    - |
      # Common Workflow Language (CWL) Workflow Description, v1.2

      This version:
        * https://w3id.org/cwl/v1.2/

      Latest stable version:
        * https://w3id.org/cwl/
    - "\n\n"
    - {$include: contrib.md}
    - "\n\n"
    - |
      # Abstract

      This specification defines the Common Workflow Language (CWL)
      Workflow description, a vendor-neutral standard for representing
      analysis tasks where a sequence of operations are described
      using a directed graph of operations to transform input to
      output.  CWL is portable across a variety of computing
      platforms.

    - {$include: intro.md}

    - |
      ## Introduction to the CWL Workflow standard v1.2.1

      There are no new features nor behavior changes in CWL v1.2.1
      as compared to CWL v1.2.0. v1.2.1 fixes only typos, adds clarifications,
      and adds additional conformance tests. Some changes to the schema defining
      CWL have been made to aid the auto-generation of libraries for the reading
      and writing of CWL documents.

      Documents should continue to specify `cwlVersion: v1.2`. However, when
      reporting results from running the CWL conformance tests, please do report
      all three components; for example "99% of CWL v1.2.0 required tests" or
      "100% of CWL v1.2.1 required tests".

      See also the [CommandLineTool v1.2.1 changelog](CommandLineTool.html#Changelog_for_v1.2.1)
      and the [Schema-Salad v1.2.1 changelog](SchemaSalad.html#Changelog_for_v1.2.1).

      ## Changelog for v1.2.1

      * CWL has been assigned
...

SKILL.md


# summarize-cwl

Follow the procedure below and use the artifact/reference sections as the runtime contract.

## When To Use

- Validate and normalize a CWL Workflow tree, then emit a lightweight structured summary for downstream Galaxy translation.

## Inputs

- No upstream artifact inputs declared. See the procedure for user-supplied runtime inputs.

## Outputs

- Write artifact `summary-cwl` as `summary-cwl.json`. Format: `json`. Schema: summary-cwl. Structured summary of a CWL Workflow + CommandLineTool tree: inputs, outputs, scatter, conditionals, requirements.

## Required Tools

- **`cwl-normalizer`** (cwl-utils). `uv tool install cwl-utils` (or `pip install cwl-utils`).
  Ephemeral run: `uvx --from cwl-utils cwl-normalizer`.
  Check: `cwl-normalizer --help`.
  Docs: https://github.com/common-workflow-language/cwl-utils
  Bundled reference: `references/cli/cwl-utils.md`.
- **`cwltool`** (cwltool). `uv tool install cwltool` (or `pip install cwltool`).
  Ephemeral run: `uvx cwltool`.
  Check: `cwltool --version`.
  Docs: https://cwltool.readthedocs.io/
  Bundled reference: `references/cli/cwltool.md`.
- **`foundry`** (foundry). `npm install -g @galaxy-foundry/foundry`.
  Ephemeral run: `npx --package @galaxy-foundry/foundry foundry`.
  Check: `foundry --help`.
  Docs: https://github.com/galaxyproject/foundry/blob/main/packages/foundry/README.md
  Bundled reference: `references/cli/foundry.md`.

## Load Upfront

- `references/cli/cwl-utils.md`: CLI tool reference copied verbatim into the bundle. Normalize the CWL workflow (cwl-normalizer) into a single JSON document for extraction.
- `references/cli/cwltool.md`: CLI tool reference copied verbatim into the bundle. Validate the CWL entrypoint before normalization.
- `references/cli/foundry.md`: CLI tool reference copied verbatim into the bundle. Schema-check summary-cwl.json before returning it from the skill.
- `references/notes/component-cwl-workflow-anatomy.md`: Research note copied verbatim into the bundle. Use CWL's native workflow, step, tool, scatter, conditional, and requirement structure without copying the heavier Nextflow inference pipeline.
- `references/schemas/summary-cwl.schema.json`: Schema file copied verbatim into the bundle. Validate the emitted CWL summary JSON and provide downstream consumers the output contract.

## Load On Demand

- `references/notes/cwl-v1.2-schemas.md`: Research note copied verbatim into the bundle. Check official CWL v1.2 field names and source-language semantics when summarizing less-common features. Use when: the workflow uses WorkflowStep features, requirements, hints, Operation, ExpressionTool, or CommandLineTool bindings not covered by the short procedure.
- `references/notes/cwl-v1.2/CommandLineTool-standalone.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.
- `references/notes/cwl-v1.2/CommandLineTool.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.
- `references/notes/cwl-v1.2/CommonWorkflowLanguage.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.
- `references/notes/cwl-v1.2/cwl.yaml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.
- `references/notes/cwl-v1.2/Operation.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.
- `references/notes/cwl-v1.2/Process.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.
- `references/notes/cwl-v1.2/Workflow.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/cwl-v1.2-schemas.md`; read it where that note directs.

## Validation

- Validate `summary-cwl.json` before returning it: run `foundry validate-summary-cwl summary-cwl.json` from `@galaxy-foundry/foundry`. If the command is not on PATH, run `npx --package @galaxy-foundry/foundry foundry validate-summary-cwl summary-cwl.json`. This checks artifact `summary-cwl` against the summary-cwl schema.

## Procedure

Read a CWL Workflow entrypoint, resolve referenced `Workflow`, `CommandLineTool`, `ExpressionTool`, and `Operation` documents, and emit `summary-cwl.json`. This skill is source-specific and target-agnostic: it records what the CWL says, validates and normalizes references, and leaves Galaxy interface/data-flow choices to downstream molds.

CWL is already a structured workflow language. Do not imitate summarize-nextflow's heavy inference machinery unless a real CWL fixture proves the need.

### Inputs

The skill expects:

- A local CWL entrypoint path or an HTTP(S) URL.
- Optional pin/version metadata supplied by the harness or user.
- Optional output directory/path for a normalized CWL document.
- Optional test/job file hints. If no test files are supplied or discoverable, emit `tests: []`.

### Outputs

A single JSON document conforming to summary-cwl. Sketch shape:

```jsonc
{
  "summary_version": "1",
  "source": {
    "ecosystem": "cwl",
    "workflow": "rnaseq-qc",
    "url": "https://example.org/workflows/rnaseq-qc.cwl",
    "version": "abc123",
    "license": null,
    "slug": "rnaseq-qc",
    "cwl_version": "v1.2",
    "entrypoint": "rnaseq-qc.cwl#main"
  },
  "documents": {
    "entrypoint": "rnaseq-qc.cwl",
    "normalized_path": "normalized/rnaseq-qc.cwl.json",
    "validation": {
      "command": "cwltool --validate rnaseq-qc.cwl",
      "status": "valid",
      "diagnostics": []
    }
  },
  "workflow_inputs": [
    {
      "id": "reads",
      "label": "reads",
      "type": "File[]",
      "optional": false,
      "default": null,
      "doc": "Input FASTQ files.",
      "format": "edam:format_1930",
      "secondary_files": []
    }
  ],
  "workflow_outputs": [
    {
      "id": "report",
      "label": "report",
      "type": "File",
      "output_source": "multiqc/report",
      "doc": null,
      "format": "edam:format_2330",
      "secondary_files": []
    }
  ],
  "steps": [
    {
      "id": "fastqc",
      "run": "#fastqc_tool",
      "run_class": "CommandLineTool",
      "label": "FastQC",
      "doc": null,
      "in": [{ "id": "reads", "source": ["reads"], "value_from": null }],
      "out": ["html", "zip"],
      "scatter": ["reads"],
      "scatter_method": "dotproduct",
      "when": null,
      "requirements": [],
      "hints": []
    }
  ],
  "tools": [
    {
      "id": "fastqc_tool",
      "label": "FastQC",
      "base_command": ["fastqc"],
      "arguments": [],
      "inputs": [],
      "outputs": [],
      "requirements": [
        {
          "class": "DockerRequirement",
          "docker_pull": "quay.io/biocontainers/fastqc:0.12.1--hdfd78af_0",
          "docker_image_id": null,
          "packages": [],
          "raw": {}
        }
      ],
      "hints": []
    }
  ],
  "graph": {
    "nodes": [{ "id": "fastqc", "kind": "step", "label": "FastQC" }],
    "edges": [{ "from": "reads", "to": "fastqc/reads", "via": ["scatter"] }]
  },
  "tests": [],
  "warnings": []
}
```

### Procedure

1. Validate the entrypoint with `cwltool --validate` or equivalent library validation. If invalid, emit source provenance, validation diagnostics, `warnings[]`, and do not invent graph structure.
2. Normalize the workflow with `cwl-normalizer` from `cwl-utils` when possible. Use the normalized JSON document as the preferred extraction surface because referenced documents have been gathered, older CWL versions have been upgraded to v1.2 when needed, and the output is regular JSON.
3. Extract `Workflow` inputs/outputs, step wiring, `scatter`, `scatterMethod`, `when`, `requirements`, and `hints` directly from the normalized CWL object model.
4. Extract every referenced `CommandLineTool` command surface: `baseCommand`, `arguments`, input/output bindings, output globs, `DockerRequirement`, and `SoftwareRequirement`.
5. Build a simple graph from workflow inputs to step inputs, step outputs to step inputs, and step outputs to workflow outputs. Add `via` markers for `scatter`, `linkMerge`, `pickValue`, `valueFrom`, and `secondaryFiles`.
6. Record test/job files only when supplied or discoverable by convention. Do not infer expected outputs from command names.
7. Validate the assembled object with `foundry validate-summary-cwl summary-cwl.json` before returning it.

### Caveats Baked Into The Procedure

- **Expressions are preserved, not executed.** `valueFrom`, `when`, expression-based globs, and JavaScript-heavy tools should surface warnings when they affect data shape.
- **Directory is a review trigger.** Preserve `Directory` types; downstream Galaxy molds decide whether to use directory-capable wrappers, explicit files, or collections.
- **Nested workflows stay visible.** A nested `Workflow` in `run:` is a step target, not a reason to flatten blindly. Summarize its boundary and warn if downstream Galaxy translation needs expansion.
- **Dependency solving is downstream.** Capture `DockerRequirement` and `SoftwareRequirement`, but do not resolve them into Tool Shed tools or new wrappers here.
- **Remote document resolution is bounded.** Resolve referenced CWL documents and tool files; do not recursively download arbitrary input data.

### Reference Dispatch

- summary-cwl — always validate output against this schema before emitting.
- component-cwl-workflow-anatomy — use for normalization, graph extraction, scatter/conditionals, requirements, and known non-goals.

### Non-Goals

- **Translation to Galaxy.** Collection choice, datatype choice, data-flow reshaping, IWC comparison, and gxformat2 authoring belong downstream.
- **Tool discovery or wrapper authoring.** Existing Galaxy wrapper search and new wrapper authoring are handled by the per-step Galaxy loop.
- **Runtime execution.** This skill summarizes and validates CWL structure; run-workflow-test owns execution.

## Runtime Notes

- Do not read Foundry source files at runtime; use only files packaged in this skill bundle and user-supplied artifacts.
- Preserve declared artifact filenames unless the user or harness supplies explicit paths.
- Carry unresolved assumptions into the output artifact instead of silently inventing missing source evidence.