Agent Skill · cast cwl-to-test-data
Resolve a CWL workflow's own declared test cases into Galaxy workflow test-data refs.
← 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:cwl-to-test-data
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:
$cwl-to-test-data
Install with Antigravity
git clone https://github.com/galaxyproject/foundry
agy plugin install foundry/casts/claude
Then select with /skills or invoke explicitly as:
/cwl-to-test-data
Skill Bundle
/ packaged cast
- attached files
- 4
- upfront
- 1
- on demand
- 3
- cast rev
- n/a
- validated
- 0
Produces: 1 artifact.
Consumes: 2 artifacts.
Artifact Contract
/ skill handoff Produces
test-data-refs
Test data resolved from the CWL source's declared test cases, expressed as URLs/paths plus expected shapes for downstream test authoring. Shared id with [[find-test-data]] — the branch's search fallback fills only the inputs this Mold leaves unresolved.
jsontest-data-refs.json
Raw artifact contract
{
"id": "test-data-refs",
"kind": "json",
"default_filename": "test-data-refs.json",
"description": "Test data resolved from the CWL source's declared test cases, expressed as URLs/paths plus expected shapes for downstream test authoring. Shared id with [[find-test-data]] — the branch's search fallback fills only the inputs this Mold leaves unresolved."
}
Consumes
summary-cwl
Structured CWL summary from [[summarize-cwl]]; carries the source's test cases (`tests[]`) — each a `job_path` (a CWL job file naming the test inputs) plus `expected_outputs`.
Raw artifact contract
{
"id": "summary-cwl",
"description": "Structured CWL summary from [[summarize-cwl]]; carries the source's test cases (`tests[]`) — each a `job_path` (a CWL job file naming the test inputs) plus `expected_outputs`.",
"inherited_schema": "[[summary-cwl]]",
"producers": [
"summarize-cwl"
]
}
cwl-galaxy-interface
Galaxy interface brief from [[cwl-summary-to-galaxy-interface]] pinning the workflow input labels, collection shapes, and datatypes each resolved fixture must map onto.
Raw artifact contract
{
"id": "cwl-galaxy-interface",
"description": "Galaxy interface brief from [[cwl-summary-to-galaxy-interface]] pinning the workflow input labels, collection shapes, and datatypes each resolved fixture must map onto.",
"producers": [
"cwl-summary-to-galaxy-interface"
]
}
Attached Files
/ runtime references Load upfront
schema
summary-cwl
packaged Input contract: read `tests[]` — each case's `job_path` inputs and `expected_outputs` — as the declared source of test data.
upfront runtime verbatim corpus-observed deterministic 19.3 KB
- bundle
references/schemas/summary-cwl.schema.json - source
package://@galaxy-foundry/gxwf-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/gxwf-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"
],
"descripti
...
Load on demand
Interpret a CWL job file's input objects (File/Directory, secondaryFiles, arrays, inline literals) before mapping them onto Galaxy inputs.
Trigger: When reading a `job_path`'s declared inputs to decide their Galaxy shape.
on-demand runtime verbatim corpus-observed 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
...
Map each declared job input to an addressable Galaxy input label and the collection shape it must populate.
Trigger: When mapping a CWL File-array or secondaryFiles input onto a Galaxy collection shape.
on-demand runtime verbatim corpus-observed deterministic 7.8 KB
- bundle
references/notes/galaxy-workflow-testability-design.md - source
content/research/galaxy-workflow-testability-design/index.md
Preview md
---
type: research
tags:
- target/galaxy
status: draft
created: 2026-05-03
revised: 2026-09-23
revision: 3
related_notes:
- "[[iwc-workflow-testability-survey]]"
- "[[iwc-test-data-conventions]]"
- "[[planemo-asserts-idioms]]"
- "[[iwc-shortcuts-anti-patterns]]"
- "[[planemo-workflow-test-architecture]]"
- "[[implement-galaxy-workflow-test]]"
- "[[gxformat2-schema]]"
- "[[gxformat2-workflow-inputs]]"
- "[[galaxy-datatypes-conf]]"
summary: "Design guidance for Galaxy workflow inputs, outputs, and checkpoints that make IWC-style workflow tests possible."
---
# Design a Galaxy workflow that can be tested
Choose the workflow's public inputs and outputs while designing the analysis, before writing its `-tests.yml`. A workflow test supplies `job:` values by input name and checks `outputs:` by output name. It can only check results the workflow exposes. A good interface gives the test a reproducible input, an addressable result, and at least one assertion that would catch a meaningful wrong result.
This note concerns workflow design. [[iwc-test-data-conventions]] covers the test file's input fixtures, [[planemo-asserts-idioms]] covers assertion syntax, and [[iwc-shortcuts-anti-patterns]] explains when a smoke check is enough. [[iwc-workflow-testability-survey]] holds the broader corpus evidence.
## Name the public interface before writing tests
Give each input and promoted output a stable, descriptive public name. In an exported gxformat2 workflow this is commonly the entry's `id`. The structural [[gxformat2-schema]] also permits `label`. Check the **effective name in the workflow being tested** instead of assuming a step label, generated dataset name, or array position will become the test key. In the pinned [Scanpy workflow](https://github.com/galaxy
...
Express each ref remote-URL-first with SHA-1 integrity and per-input collection layout when recording resolved fixtures.
Trigger: When writing each `test-data-refs` entry.
on-demand runtime verbatim corpus-observed deterministic 11.6 KB
- bundle
references/notes/iwc-test-data-conventions.md - source
content/research/iwc-test-data-conventions/index.md
Preview md
---
type: research
tags:
- target/galaxy
status: draft
created: 2026-04-30
revised: 2026-09-23
revision: 4
related_notes:
- "[[galaxy-workflow-testability-design]]"
- "[[iwc-shortcuts-anti-patterns]]"
- "[[planemo-asserts-idioms]]"
- "[[implement-galaxy-workflow-test]]"
- "[[tests-format]]"
- "[[iwc-tabular-operations-survey]]"
summary: "IWC and Planemo workflow-test fixture shapes, file provenance, collection identifiers, input hashes, and built-in index values."
---
# IWC test data conventions
An IWC workflow test pairs each workflow with a sibling `<workflow>-tests.yml`. Each YAML test case supplies `job:` inputs under the workflow's input labels and `outputs:` assertions under its output labels. The optional `test-data/` directory holds local fixtures. These are the [IWC contribution layout](https://github.com/galaxyproject/iwc/blob/main/workflows/README.md) and [Planemo test-format](https://planemo.readthedocs.io/en/latest/test_format.html) contracts. For decisions about the workflow interface before writing fixtures, see [[galaxy-workflow-testability-design]]. For the exact supported YAML vocabulary and static validation, see [[tests-format]].
Examples below come from the cited IWC files or Planemo documentation. Corpus observations describe the workflows sampled for this note, not a rule that every IWC workflow follows.
## Fixture locations and provenance
A `class: File` input can use `path:` for a local fixture or `location:` for a URI. Planemo resolves a relative `path:` from the workflow and test directory. IWC's contribution guide recommends small inputs and suggests publishing a toy dataset to Zenodo for a permanent URL. The repository also permits an optional local `test-data/` directory. It gives no universal size cutoff or mandatory hos
...
SKILL.md
# cwl-to-test-data
Follow the procedure below and use the artifact/reference sections as the runtime contract.
## When To Use
- Resolve a CWL workflow's own declared test cases into Galaxy workflow test-data refs.
## Inputs
- Read artifact `summary-cwl`. Schema: summary-cwl. Produced by `summarize-cwl`. Structured CWL summary from summarize-cwl; carries the source's test cases (`tests[]`) — each a `job_path` (a CWL job file naming the test inputs) plus `expected_outputs`.
- Read artifact `cwl-galaxy-interface`. Produced by `cwl-summary-to-galaxy-interface`. Galaxy interface brief from cwl-summary-to-galaxy-interface pinning the workflow input labels, collection shapes, and datatypes each resolved fixture must map onto.
## Outputs
- Write artifact `test-data-refs` as `test-data-refs.json`. Format: `json`. Test data resolved from the CWL source's declared test cases, expressed as URLs/paths plus expected shapes for downstream test authoring. Shared id with find-test-data — the branch's search fallback fills only the inputs this Mold leaves unresolved.
## Required Tools
- None declared. Procedure should not assume external CLIs are present.
## Load Upfront
- `references/schemas/summary-cwl.schema.json`: Schema file copied verbatim into the bundle. Input contract: read `tests[]` — each case's `job_path` inputs and `expected_outputs` — as the declared source of test data.
## Load On Demand
- `references/notes/component-cwl-workflow-anatomy.md`: Research note copied verbatim into the bundle. Interpret a CWL job file's input objects (File/Directory, secondaryFiles, arrays, inline literals) before mapping them onto Galaxy inputs. Use when: reading a `job_path`'s declared inputs to decide their Galaxy shape.
- `references/notes/galaxy-workflow-testability-design.md`: Research note copied verbatim into the bundle. Map each declared job input to an addressable Galaxy input label and the collection shape it must populate. Use when: mapping a CWL File-array or secondaryFiles input onto a Galaxy collection shape.
- `references/notes/iwc-test-data-conventions.md`: Research note copied verbatim into the bundle. Express each ref remote-URL-first with SHA-1 integrity and per-input collection layout when recording resolved fixtures. Use when: writing each `test-data-refs` entry.
## Validation
- None declared.
## Procedure
Resolve the CWL workflow's own declared test cases into Galaxy `test-data-refs`. The CWL summary carries the source's test cases (`tests[]`) — each a `job_path` (a CWL job file naming the test inputs) plus `expected_outputs`. Read the declared inputs and map them onto the Galaxy workflow's inputs, emitting one ref per input, ready for implement-galaxy-workflow-test to stage.
This skill is the source-specific first leg of the harness's `test-data-resolution` branch. It resolves what the CWL source itself declares; any input it cannot resolve from a declared test case stays a reported gap and the harness falls through to find-test-data (search), then to `user-supplied`. Deciding to fall through is a harness concern, not this skill's — its job is an honest map of the source's own test cases.
### Sequence
1. **Enumerate Galaxy inputs and their required shape.** From the interface brief, list each workflow input: label, Galaxy collection shape (File / list / paired / list:paired / record), and datatype. This is the *target shape* every ref must satisfy.
2. **Read the declared test cases.** From the summary's `tests[]`, read each case's `job_path` inputs — File/Directory objects with their `location`/`path`, `secondaryFiles`, arrays, and inline literals — plus `expected_outputs`. Prefer the case whose inputs best cover the workflow's inputs.
3. **Map each declared input onto a Galaxy input.** Match by id and shape onto the interface's input labels. A CWL File array maps to a Galaxy list; a File carrying `secondaryFiles` may map to a record or composite datatype — record element identifiers and any prep needed to reach the Galaxy collection shape (galaxy-workflow-testability-design).
4. **Emit refs.** Write one `test-data-refs.json` entry per resolved input: prefer a remote `location` URL when the job references one (remote-URL-first, iwc-test-data-conventions); fall back to the in-tree `path` plus provenance only when no URL is published. Carry datatype, collection element identifiers, and any subset/split prep. Each entry maps to an addressable workflow input label.
5. **Report genuine gaps.** An input with no declared test-case input of the right shape stays `resolved: false` with a reason — this is what the harness hands to find-test-data. Do not search public sources here; searching is find-test-data's job, not this skill's.
### No fabrication
Never invent a URL, accession, or path, and never emit a placeholder for an input you could not resolve from a declared test case. A declared input with no published URL is recorded by its in-tree `path` plus provenance, not papered over with a guessed URL. Every emitted ref points at data the source actually declares; everything else is an honest gap for the next leg of the branch.
## Feedback Mode
- Feedback mode is off unless the caller explicitly enables `--feedback` or supplies a feedback-ledger path.
- When enabled, read `_feedback.md` before doing the work and use its registered `foundry-feedback.ledger.yml` protocol.
- Preserve harness-owned run and phase state. Append only concrete observations about a canonical Foundry source asset or a related project that this run showed to be at fault; do not put ordinary workflow requirements in this ledger.
- Before reporting completion, make one explicit pass over the work you just did. Do not ask yourself whether anything was unclear — recall what happened: where you guessed at something the instructions should have settled, needed information this bundle does not carry, hit an instruction that contradicted another or contradicted the artifacts in front of you, used a packaged reference that did not cover your case, or did something the procedure never describes.
- Append an entry for each such event that clears the protocol's bar. If none do, append nothing and report `no feedback` explicitly. Silence and a clean pass are not the same thing, and nothing downstream can tell them apart unless you say which one it was.
- Pass the same ledger path to any subagent used for this work, and merge updates serially so one writer cannot overwrite another.
## 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.