Agent Skill · cast

author-galaxy-tool-wrapper

Author a new Galaxy user-defined tool YAML definition when discovery yields nothing acceptable.

← 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:author-galaxy-tool-wrapper

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:

$author-galaxy-tool-wrapper

Skill Bundle

/ packaged cast
attached files
5
upfront
2
on demand
3
cast rev
1
validated
0

Produces: 1 artifact.

Consumes: 1 artifact.

Artifact Contract

/ skill handoff

Produces

galaxy-user-tool-definition

Galaxy `GalaxyUserTool` YAML definition for a tool not present on the Tool Shed.

yamlgalaxy-user-tool.yml
Raw artifact contract
{
  "id": "galaxy-user-tool-definition",
  "kind": "yaml",
  "default_filename": "galaxy-user-tool.yml",
  "description": "Galaxy `GalaxyUserTool` YAML definition for a tool not present on the Tool Shed."
}

Consumes

summary-nextflow

Source pipeline summary from [[summarize-nextflow]]; provides process command, inputs, outputs, and container or conda evidence for UDT authoring.

Raw artifact contract
{
  "id": "summary-nextflow",
  "description": "Source pipeline summary from [[summarize-nextflow]]; provides process command, inputs, outputs, and container or conda evidence for UDT authoring.",
  "inherited_schema": "[[summary-nextflow]]",
  "producers": [
    "summarize-nextflow"
  ]
}

Attached Files

/ runtime references

Load upfront

research

galaxy-user-tool-authoring

packaged

Field contract, expression syntax, script placement, and package inference for a `GalaxyUserTool` definition.

upfront runtime verbatim corpus-observed deterministic 9.1 KB
bundle
references/notes/galaxy-user-tool-authoring.md
source
content/research/galaxy-user-tool-authoring/index.md
Preview md
---
type: research
title: "Galaxy user-defined tool authoring rules"
tags:
  - target/galaxy
status: draft
created: 2026-08-24
revised: 2026-08-24
revision: 1
component: tool_util_models
related_notes:
  - "[[component-nextflow-containers-and-envs]]"
  - "[[galaxy-user-tool-critique]]"
sources:
  - "https://github.com/galaxyproject/galaxy/blob/4d235b615e60bdb8c7e7d9ada100245068c8e4d9/lib/galaxy/agents/prompts/custom_tool_structured.md"
  - "https://github.com/galaxyproject/galaxy/blob/4d235b615e60bdb8c7e7d9ada100245068c8e4d9/lib/galaxy/agents/prompts/custom_tool_container_critic.md"
summary: "What validates in a GalaxyUserTool definition — fields, expression syntax, script placement, package inference — derived from Galaxy's own generator prompts."
---

The rules a `GalaxyUserTool` YAML document has to satisfy, and the decisions worth making while writing one.

Derived from two vendored Galaxy prompts — [[custom-tool-structured]] and [[custom-tool-container-critic]] — rather than restating them. Those prompts are written for Galaxy's in-process agent, where a grammar constrains generation and a deployment-side step may rewrite the container. Neither holds in a cast, so the harness divergences are named in the last section instead of being inherited silently.

Sections 6 and 7 are target-neutral: they are about running a script and naming its dependencies, not about Galaxy. They are kept self-contained so a CWL-side note can lift them without a rewrite.

## 1. Required fields

- **`class`** — exactly `GalaxyUserTool`.
- **`id`** — must start with a lowercase letter; after that, lowercase letters, digits, `_` and `-`. Min 3 characters, max 255.
- **`version`** — semantic version, e.g. `1.0.0`.
- **`name`** — display name, **at least 5 characters**. Short tool names (`BWA`
...
schema

summary-nextflow

packaged

Read process tool, container, conda, inputs, outputs, script summary, and test fixture evidence from the source pipeline summary.

upfront runtime verbatim corpus-observed deterministic 59.2 KB
bundle
references/schemas/summary-nextflow.schema.json
source
package://@galaxy-foundry/summarize-nextflow#summaryNextflowSchema
Preview json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://galaxyproject.org/foundry/schemas/summary-nextflow.schema.json",
  "$comment": "Canonical source: packages/summarize-nextflow/src/schema/summary-nextflow.schema.json in galaxyproject/foundry. Mold frontmatter cites this schema via [[summary-nextflow]] wiki-links; the cast pipeline imports the `summaryNextflowSchema` runtime export and serializes it into cast bundles.",
  "title": "Nextflow Pipeline Summary",
  "description": "Structured per-source summary emitted by the summarize-nextflow Mold.\n\nPer-source schema by design — paper, Nextflow, and CWL each have their own summary shape; downstream Molds (data flow, templates, tool wrappers) consume any source's summary and handle the polymorphism.\n\nField names mirror gxy-sketches' SketchSource / ToolSpec / TestDataRef / ExpectedOutputRef where parity exists; see content/research/gxy-sketches-alignment/index.md.",
  "$ref": "#/$defs/Summary",
  "$defs": {
    "Summary": {
      "title": "Summary",
      "description": "Top-level shape. Every Nextflow summary is exactly this object.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source",
        "params",
        "sample_sheets",
        "profiles",
        "tools",
        "processes",
        "subworkflows",
        "workflow",
        "reference_assets",
        "reference_rebuilds",
        "test_fixtures",
        "nf_tests"
      ],
      "properties": {
        "source": {
          "$ref": "#/$defs/SourceRecord"
        },
        "params": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Param"
          }
        },
        "sample_sheets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SampleSheet"
          },
          "description": "Structured sample-sheet inputs. Each entry binds one `params[]` parameter to a row schema (column names, types, path-vs-meta classification, required flags, enums, patterns). Promoted from prose inside `params[].description` so downstream target translations (Galaxy `sample_sheet*` collections, CWL records-of-arrays) can choose collection variants without re-parsing the source pipeline. Empty array when no sample-sheet idiom is detected. Discovery sources: nf-schema `schema:` references, `samplesheetToList()` calls, and `splitCsv(header
...

Load on demand

research

component-nextflow-containers-and-envs

packaged

Map Nextflow container/conda evidence to Galaxy UDT container and package provenance.

Trigger: When a missing Galaxy user-defined tool must be authored from a Nextflow process with container or conda directives.

on-demand runtime verbatim hypothesis deterministic 30.8 KB
bundle
references/notes/component-nextflow-containers-and-envs.md
source
content/research/component-nextflow-containers-and-envs/index.md
Preview md
---
type: research
tags:
  - source/nextflow
  - target/galaxy
component: "Nextflow Containers and Environments"
status: draft
created: 2026-05-01
revised: 2026-05-05
revision: 3
summary: "Container URL grammar (depot, BioContainers, mulled-v2, Wave, ORAS) and conda directive resolution rules backing summarize-nextflow §5."
companions:
  - "component-nextflow-containers-and-envs.yml"
sources:
  - "https://docs.seqera.io/nextflow/process"
  - "https://docs.seqera.io/nextflow/reference/process"
  - "https://github.com/nf-core/modules/blob/master/modules/nf-core/fastqc/main.nf"
  - "https://github.com/nf-core/modules/blob/master/modules/nf-core/multiqc/main.nf"
  - "https://github.com/nf-core/modules/blob/master/modules/nf-core/dragmap/align/main.nf"
  - "https://github.com/nf-core/modules/blob/master/modules/nf-core/seqkit/sample/main.nf"
  - "https://github.com/nf-core/modules/blob/master/modules/meta-schema.json"
  - "https://github.com/nf-core/modules/blob/master/modules/environment-schema.json"
  - "https://github.com/nf-core/tools/blob/master/nf_core/module-template/main.nf"
  - "https://github.com/BioContainers/multi-package-containers"
  - "https://github.com/BioContainers/singularity-build-bot"
  - "https://depot.galaxyproject.org/singularity/"
  - "https://biocontainers.pro/registry"
  - "https://bioconda.github.io/"
  - "https://docs.seqera.io/wave"
  - "https://nf-co.re/events/2024/bytesize_pipeline_container_urls"
related_molds:
  - "[[summarize-nextflow]]"
  - "[[author-galaxy-tool-wrapper]]"
  - "[[summarize-galaxy-tool]]"
related_notes:
  - "[[component-nextflow-pipeline-anatomy]]"
  - "[[component-nf-core-tools]]"
  - "[[component-nextflow-inspect]]"
---

# Nextflow Containers and Environments

Operational grounding for [[summarize-nextflow]] §5 ("Build th
...
research

component-nextflow-containers-and-envs

packaged

Map Nextflow container/conda evidence to Galaxy UDT container and package provenance.

Trigger: When a missing Galaxy user-defined tool must be authored from a Nextflow process with container or conda directives.

on-demand runtime verbatim hypothesis deterministic 7.1 KB
bundle
references/notes/component-nextflow-containers-and-envs.yml
source
content/research/component-nextflow-containers-and-envs/component-nextflow-containers-and-envs.yml
Preview yml
# Container & conda directive cheatsheet for summarize-nextflow §5.
# Companion to component-nextflow-containers-and-envs.md.
#
# Matching contract: regexes match URL/string token *content* after the cast skill
# has unwrapped the directive's outer "${ ... ? '<url>' : '<url>' }" GString.
# The walker is responsible for extracting both ternary-branch strings before
# applying these patterns.
#
# Bucketing rule: by URL prefix (NOT by ternary branch). See note §"Bucketing rule".

ternary_predicate:
  description: "Detect either form of the canonical nf-core ternary predicate."
  patterns:
    - "workflow\\.containerEngine\\s*==\\s*'singularity'"
    - "workflow\\.containerEngine\\s+in\\s*\\[\\s*'singularity'(?:\\s*,\\s*'apptainer')?\\s*\\]"
  also_typical: "&& !task.ext.singularity_pull_docker_container"

container_forms:

  - id: galaxy_singularity_simple
    regex: "^https://depot\\.galaxyproject\\.org/singularity/(?P<name>[^:/]+):(?P<version>[^-][^-]*)--(?P<build>[^/]+)$"
    example: "https://depot.galaxyproject.org/singularity/fastqc:0.12.1--hdfd78af_0"
    source: "modules/nf-core/fastqc/main.nf"
    resolves_to_field: "singularity"
    derivation_rule: "name+version+build from path basename; Bioconda dual exists at quay.io/biocontainers/<name>:<version>--<build>."
    notes: "BioContainers Singularity mirror; CVMFS-distributed; produced by singularity-build-bot from quay.io."

  - id: galaxy_singularity_mulled
    regex: "^https://depot\\.galaxyproject\\.org/singularity/mulled-v2-(?P<hash>[0-9a-f]+):(?P<verhash>[0-9a-f]+)-(?P<rev>\\d+)$"
    example: "https://depot.galaxyproject.org/singularity/mulled-v2-580d344d9d4a496cd403932da8765f9e0187774d:df80ed8d23d0a2c43181a2b3dd1b39f2d00fab5c-0"
    source: "modules/nf-core/dragmap/align/main.nf"
    resolves_to_field: "sin
...
research

galaxy-user-tool-critique

packaged

Clarity and idiomaticity criteria, and the text-versus-structural test for each proposed fix.

Trigger: After the drafted `GalaxyUserTool` passes structural validation and before emitting `galaxy-user-tool.yml`.

on-demand runtime verbatim corpus-observed deterministic 4.2 KB
bundle
references/notes/galaxy-user-tool-critique.md
source
content/research/galaxy-user-tool-critique/index.md
Preview md
---
type: research
title: "Galaxy user-defined tool critique criteria"
tags:
  - target/galaxy
status: draft
created: 2026-08-24
revised: 2026-08-24
revision: 1
component: tool_util_models
related_notes:
  - "[[galaxy-user-tool-authoring]]"
sources:
  - "https://github.com/galaxyproject/galaxy/blob/4d235b615e60bdb8c7e7d9ada100245068c8e4d9/lib/galaxy/agents/prompts/custom_tool_critic.md"
summary: "What to flag in a structurally-valid GalaxyUserTool definition, what to leave alone, and when a fix is structural."
---

The fuzzy quality pass on a `GalaxyUserTool` definition that has **already passed structural validation** — clarity, idiomaticity, sensible defaults, helpful text. Derived from the vendored [[custom-tool-critic]] prompt.

Load this after validation, not before. Its whole premise is that ids are well-formed, referenced inputs are declared, and the container shape is recognized. Running it on an invalid draft produces critique of things that should have been fixed as authoring errors — see [[galaxy-user-tool-authoring]].

## Clarity — text an end user reads

- `description` does not say what the tool actually does, or is generic ("Run the tool", "Process input").
- `name` is opaque, or does not match the description.
- An input `label` is missing, or just restates the parameter name.
- An input `help` is missing on a non-obvious parameter.
- An output `label` is missing or unclear.

## Idiomaticity — the shape of the tool

- `shell_command` quoting that will not escape correctly — bare `$(date)` where `\$(date)` is meant.
- An optional **text**, **integer**, **float** or **boolean** parameter with no `value`, forcing the user to supply something that should have been sensible. The field is `value`; `default` is not accepted and fails validation. **select** para
...

SKILL.md


# author-galaxy-tool-wrapper

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

## When To Use

- Author a new Galaxy user-defined tool YAML definition when discovery yields nothing acceptable.

## Inputs

- Read artifact `summary-nextflow`. Schema: summary-nextflow. Produced by `summarize-nextflow`. Source pipeline summary from summarize-nextflow; provides process command, inputs, outputs, and container or conda evidence for UDT authoring.

## Outputs

- Write artifact `galaxy-user-tool-definition` as `galaxy-user-tool.yml`. Format: `yaml`. Galaxy `GalaxyUserTool` YAML definition for a tool not present on the Tool Shed.

## Required Tools

- None declared. Procedure should not assume external CLIs are present.

## Load Upfront

- `references/notes/galaxy-user-tool-authoring.md`: Research note copied verbatim into the bundle. Field contract, expression syntax, script placement, and package inference for a `GalaxyUserTool` definition.
- `references/schemas/summary-nextflow.schema.json`: Schema file copied verbatim into the bundle. Read process tool, container, conda, inputs, outputs, script summary, and test fixture evidence from the source pipeline summary.

## Load On Demand

- `references/notes/component-nextflow-containers-and-envs.md`: Research note copied verbatim into the bundle. Map Nextflow container/conda evidence to Galaxy UDT container and package provenance. Use when: a missing Galaxy user-defined tool must be authored from a Nextflow process with container or conda directives.
- `references/notes/component-nextflow-containers-and-envs.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/component-nextflow-containers-and-envs.md`; read it where that note directs.
- `references/notes/galaxy-user-tool-critique.md`: Research note copied verbatim into the bundle. Clarity and idiomaticity criteria, and the text-versus-structural test for each proposed fix. Use when: after the drafted `GalaxyUserTool` passes structural validation and before emitting `galaxy-user-tool.yml`.

## Validation

- None declared.

## Procedure

Author a Galaxy user-defined tool (UDT) YAML definition when discover-shed-tool cannot produce an acceptable existing Tool Shed wrapper. This skill owns the author-on-fallthrough path only; do not duplicate existing wrappers unless discovery evidence is weak or missing.

The output is a single `GalaxyUserTool` YAML document, not Galaxy XML. Preserve source evidence and unresolved assumptions in the emitted artifact or companion notes rather than inventing command flags, containers, datatypes, or package names.

### Inputs

Use the source summary and branch fallthrough context to identify:

- The process or abstract step that needs a tool.
- Command intent, required inputs, expected outputs, and test fixture evidence.
- Container, Bioconda, Conda, or environment evidence from the source pipeline.
- Why Tool Shed discovery did not supply an acceptable existing wrapper.

### Procedure

#### 1. Confirm authoring is justified

Read the discovery result before authoring. Continue only when discovery returned `miss`, or when the selected hit was weak enough that the harness explicitly fell through.

If the missing tool need is under-specified, ask for clarification or emit an unresolved assumption. Do not create a plausible-looking UDT from absent command or container evidence.

#### 2. Build the UDT requirements brief

Extract the minimum executable contract:

- Tool id, version, display name, and description.
- Container image or package evidence, with confidence.
- `shell_command` intent and every referenced input/output token.
- Input parameters with Galaxy-compatible names, types, labels, defaults, help text, and datatypes when evidenced.
- Output datasets or collections with formats and `from_work_dir` / discovery rules.

Prefer BioContainers or directly evidenced containers. If only Conda/package evidence exists, record what is known and avoid guessing an image tag.

Nothing downstream of this skill re-resolves the container. Galaxy deployments can re-resolve a generated tool's image against verified biocontainers, but that is off by default upstream and absent here — the image written is the image that runs. Where the source evidences no container, infer packages from the command per §7 of the authoring note rather than deferring the choice.

#### 3. Generate the structured draft

Write the `GalaxyUserTool` YAML draft from the requirements brief, following `references/notes/galaxy-user-tool-authoring.md`.

Nothing constrains this draft to the schema as it is written, so the rules in that note are load-bearing rather than advisory. The ones that fail most often: `format` on a data input is a list even for a single format; the default field is `value` and never `default`; an output's `format` is a string while an input's is a list; `$(outputs.X.path)` is not valid syntax; and every `inputs.NAME` in `shell_command` must match a declared input exactly.

#### 4. Validate structurally

Validate the draft against the available Galaxy user-tool validator or schema surface before critique. Treat structural validation failures as authoring failures, not critic feedback.

Fix validation errors directly. Do not run the critic until the draft passes structural validation.

#### 5. Run mandatory critic pass

After structural validation passes, review the draft against `references/notes/galaxy-user-tool-critique.md`, with the original request and requirements brief in hand.

Apply every concrete clarity or idiomaticity issue. Sort each fix into text-level or structural per that note: text-level fixes are applied to the named field directly; a structural one means regenerating from §3 rather than improvising an edit. Re-validate structurally after edits — a `shell_command` change can break name matching. If critique conflicts with source evidence, keep the source evidence and record the conflict.

#### 6. Emit the UDT artifact

Write `galaxy-user-tool.yml` with the validated and critic-reviewed `GalaxyUserTool` definition.

The artifact should be ready for the downstream harness or Galaxy runtime to load as a user-defined tool. Include unresolved assumptions only when they are truthful and actionable; otherwise fail instead of emitting a misleading tool.

### Non-goals

- **Tool Shed discovery.** Use discover-shed-tool before this skill.
- **Existing wrapper summarization.** Use summarize-galaxy-tool for Tool Shed or installed Galaxy wrappers.
- **Galaxy XML authoring.** This skill emits UDT YAML only.
- **Workflow step binding.** implement-galaxy-tool-step decides how the authored tool is used in a workflow step.

## 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.