Agent skill

Add Subworkflow

by bactopia in bactopia/bactopia

Scaffold a new Bactopia subworkflow that orchestrates existing modules.

MITAuto-check passed

Install Add Subworkflow

skills CLI
$ npx skills add bactopia/bactopia --skill add-subworkflow -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bactopia/bactopia add-subworkflow --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bactopia/bactopia.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/add-subworkflow .claude/skills/add-subworkflow && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-subworkflow
GitHub stars
522
Token cost
~2.6k tokens
SKILL.md length
932 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Scaffold a new Bactopia subworkflow that orchestrates existing modules.

  • Works in 3 steps: Gather Information → File Generation → Review & Customize
  • Asked to add a new subworkflow
  • SKILL.md covers Prerequisites, Interactive Questioning, What a Subworkflow Contains and Phased Workflow, plus 3 more sections
  • Calls bash

What it does

Add Subworkflow is an agent skill from bactopia/bactopia. Scaffold a new Bactopia subworkflow that orchestrates existing modules. Creates main.nf with GroovyDoc and test files. Use when asked to add a new subworkflow, create a subworkflow, or wire up modules into a subworkflow.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A flexible pipeline for complete analysis of bacterial genomes. The licence is MIT.

When your agent uses it

  • Asked to add a new subworkflow
  • Create a subworkflow
  • Wire up modules into a subworkflow

Example prompts

  • “/add-subworkflow”

Requirements

  • Docker

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Gather Information
  2. File Generation
  3. Review & Customize

What it can do on your machine

Read from SKILL.md and the folder at commit 29fb741. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Subworkflow loads about 2.6k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 932 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bactopia/bactopia at commit 29fb741, republished under its MIT licence (© bactopia). 932 words, ~2,645 tokens.

Download SKILL.mdSave it as .claude/skills/add-subworkflow/SKILL.md (or your agent's skills folder).
name
add-subworkflow
description
Scaffold a new Bactopia subworkflow that orchestrates existing modules. Creates main.nf with GroovyDoc and test files. Use when asked to add a new subworkflow, create a subworkflow, or wire up modules into a subworkflow.

Add Subworkflow

Scaffold a Bactopia subworkflow that orchestrates one or more existing modules. Subworkflows are glue -- they wire modules together, aggregate results, and provide a clean interface for workflows.

Prerequisites

  • The module(s) this subworkflow will use must already exist under modules/
  • Read .agents/docs/standards/04-subworkflow-documentation.md for documentation standards

Interactive Questioning

This skill is interactive -- ask the user early and often, especially before creating files.

  • Multiple questions at once: Use AskUserQuestion popups (up to 4 questions per batch). Mark the recommended option with "(Recommended)" at the end of its label and place it first.
  • Single simple question: Just ask in chat, no popup needed.
  • When in doubt: Ask. It's cheaper to clarify upfront than to regenerate files.

What a Subworkflow Contains

A subworkflow is a single main.nf file plus tests:

subworkflows/{tool}/
    main.nf              # Workflow definition with GroovyDoc
    tests/
        main.nf.test     # nf-test specification
        main.nf.test.snap # Snapshot (generated by nf-test)
        nextflow.config  # Includes ALL module.configs used by this subworkflow
        nf-test.config   # Standard nf-test config
        .nftignore       # Exclude unstable files from snapshots

No module.config or schema.json -- those belong to modules only.

Phased Workflow

Phase 1: Gather Information

Goal: Determine which modules to orchestrate and how, using interactive prompts.

Important: Use the AskUserQuestion tool for structured choices throughout this phase. Present up to 4 questions per batch. Mark the recommended option with "(Recommended)" at the end of its label and place it first in the options list.

  1. Ask the user which modules this subworkflow uses. Get the module paths (e.g., modules/nohuman/run, modules/mlst).

    • Read each module's main.nf to understand its inputs and outputs.
    • Does it call other subworkflows? If so, use @subworkflows tag (not @modules) for those includes.
  2. Run the lookup command if package info is needed:

    bash
    bash .agents/skills/add-bactopia-tool/scripts/run-bactopia-scaffold.sh lookup {package_name} --bactopia-path . --pretty
  3. Determine the input type from the primary module's inputs, then run test-data discovery:

    bash
    bash .agents/skills/add-bactopia-tool/scripts/run-bactopia-scaffold.sh test-data --input-type {input_type} --bactopia-path . --pretty

    This returns species/accession combinations already used by similar modules, with pre-computed test_data_path, test_uncompressed_path, test_species, and test_sample_id values. Use the returned paths directly in the scaffold config (Phase 2) -- do NOT construct paths manually. Subworkflow tests use the compressed path (test_data_path).

  4. Batch 1: Design choices (AskUserQuestion, up to 3 questions)

    Question 1 -- Aggregation strategy:

    • CSVTK_CONCAT -- concatenate per-sample tabular output (most common) (Recommended)
    • Dedicated summary module -- tool has its own aggregation command (rare)
    • No aggregation -- tool doesn't produce per-sample tabular output

    Question 2 -- Test data species: Present top 3-4 species from the test-data discovery results. Recommend species that exercise the tool's functionality. Include the accession in each option's description.

    Question 3 -- Aggregation field (if CSVTK_CONCAT or dedicated_summary selected): Which output field should be aggregated? (e.g., tsv, report, csv) What format? (tsv or csv)

  5. Present the following for confirmation (derive from module main.nf and lookup):

    • Tool identity: name (snake_case), display name, one-sentence description
    • Outputs: from the primary module's output block (for @output GroovyDoc tags)
    • Citation key and keywords for GroovyDoc
  6. Final confirmation (AskUserQuestion, 1 question)

    After presenting the summary, ask:

    • Looks good, proceed to file generation
    • I need to make changes (user provides details via "Other" or notes)

Phase 2: File Generation

Goal: Generate the 5 subworkflow files using bactopia-scaffold.

  1. Construct the JSON config from the design decisions. Write it to /tmp/scaffold-config.json:

    json
    {
        "tool": "{tool_name}",
        "display_name": "{DisplayName}",
        "description": "{One-sentence description}",
        "process_name": "{TOOL_NAME}",
        "package": "{package_name}",
        "version": "{version}",
        "build": "{build}",
        "home_url": "{github_url}",
        "input_type": "assembly",
        "has_database": false,
        "handles_gz": false,
        "layout": "flat",
        "resource_label": "process_low",
        "version_command": "{version_command}",
        "citation_key": "{citation_key}",
        "keywords": ["{keyword1}", "{keyword2}"],
        "aggregation": {
            "strategy": "csvtk_concat",
            "field": "{output_field}",
            "format": "{tsv|csv}"
        },
        "outputs": [
            {"name": "{field}", "extension": "{ext}", "description": "{desc}"}
        ],
        "parameters": [],
        "container_refs": {
            "toolName": "{from lookup}",
            "docker": "{from lookup}",
            "image": "{from lookup}"
        },
        "test_species": "{species}",
        "test_sample_id": "{sample_id}",
        "test_data_path": "{compressed_path}",
        "test_uncompressed_path": "{uncompressed_path}"
    }

    For database-dependent subworkflows, also include:

    json
    {
        "database": {
            "param_name": "{tool}_db",
            "test_path": "datasets/{tool}/{db_file}"
        }
    }
  2. Run the scaffold command:

    bash
    bash .agents/skills/add-bactopia-tool/scripts/run-bactopia-scaffold.sh subworkflow --config /tmp/scaffold-config.json --bactopia-path . --pretty
  3. The command creates 5 files:

    • subworkflows/{tool}/main.nf
    • subworkflows/{tool}/tests/main.nf.test
    • subworkflows/{tool}/tests/nextflow.config
    • subworkflows/{tool}/tests/nf-test.config
    • subworkflows/{tool}/tests/.nftignore

Show full SKILL.md (450 more words)Show less
Phase 3: Review & Customize

Goal: Review generated files and make tool-specific adjustments.

  1. Subworkflow main.nf -- review and customize:

    • The @input GroovyDoc should match the subworkflow's take channel name
    • For the CSVTK_CONCAT pattern, verify the gather field and format are correct
    • If the subworkflow uses modules not in the standard pattern (e.g., calls other subworkflows), add the appropriate @subworkflows tag and adjust includes
    • The @modules tag should use underscore-delimited directory keys: csvtk_concat, {tool}
  2. Test nextflow.config -- verify it includes ALL module.configs for processes in the subworkflow:

    • The primary module's config
    • csvtk/concat/module.config if using CSVTK_CONCAT
    • Any other module configs
  3. Test main.nf.test -- verify:

    • Test data paths match the species/sample chosen
    • Database input lines are present if needed
    • Snapshot fields include the right output field names
  4. Run the linter to catch structural issues before proceeding:

    bash
    bash .agents/skills/add-bactopia-tool/scripts/run-bactopia-lint.sh {tool} --bactopia-path .

    This runs bactopia-lint scoped to the new subworkflow (and module if it exists). Fix any FAILs before moving on. Common issues:

    • S011: misaligned include braces in subworkflow
    • S019: citation key not found in data/citations.yml
  5. Update data/citations.yml -- add the tool citation entry in alphabetical order (if not already present from a prior /add-module run):

    yaml
    {tool}:
      name: "{ToolName}"
      link: "{github_url}"
      description: "{One-sentence description}"
      cite: "{Full citation text}"
  6. List all created files with full paths.

  7. Remind the user to run these follow-up steps in order:

    1. /run-tests {tool} subworkflow --generate -- generate snapshots and verify the subworkflow test passes (new subworkflows have no existing snapshots)
    2. The subworkflow needs a workflow entry point to be usable -- use /add-bactopia-tool if this is a standalone bactopia-tool

    The --generate flag is required because newly scaffolded subworkflows have no snapshot files yet. Without it, nf-test will fail immediately on missing snapshots.


Subworkflow Patterns

The scaffold generates one of three patterns based on the aggregation.strategy:

StrategyPatternIncludeEmit
csvtk_concatCSVTK_CONCAT aggregationgatherCsvtk from pluginsample_outputs + run_outputs
dedicated_summaryTool's own summary commandgatherFields from pluginsample_outputs + run_outputs
noneNo aggregationNo pluginsample_outputs + Channel.empty()

CSVTK_CONCAT is the default and most common (~80% of subworkflows).

Edge Cases

  1. Multi-module subworkflows (e.g., snippy + snpdists + gubbins): The scaffold generates a single-module pattern. For complex orchestration, generate the scaffold then manually adjust the includes and channel wiring.

  2. Composite subworkflows that call other subworkflows: Add @subworkflows tag manually and adjust includes to point to ../../subworkflows/{name}/main instead of ../../modules/{name}/main.

Test Data Discovery

Test data paths are discovered dynamically from existing module tests using:

bash
bash .agents/skills/add-bactopia-tool/scripts/run-bactopia-scaffold.sh test-data --input-type {type} --bactopia-path . --pretty

This scans modules/*/tests/main.nf.test for paths matching the input type and returns pre-computed template variables. Always use the discovered paths -- never construct test data paths manually. The output includes test_data_path (compressed, for subworkflow tests), test_uncompressed_path (for module tests), test_species, and test_sample_id.

Supported input types: assembly, reads, assembly_reads, proteins, gff, genbank.

© bactopia, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/add-subworkflow of bactopia/bactopia.

Open the folder on GitHubat commit 29fb741

Compare with similar skills

Add Subworkflow next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Subworkflow compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Subworkflow this skillbactopia/bactopia522—~2.6kAutomated safety check: PassMIT
Scaffoldingdotnet/efcore15k—~165Automated safety check: PassMIT
Team Agent Orchestrationaffaan-m/ECC275k1 repos~1.2kAutomated safety check: PassMIT
Module Scaffolderaiskillstore/marketplace430—~846Automated safety check: NotesNone
Scaffold Elementremotion-dev/remotion62k—~202Automated safety check: PassCustom licence
Orca Orchestrationstablyai/orca87k—~916Automated safety check: PassMIT

Similar skills

  • Scaffolding

    dotnet/efcore

    Official

    Implementation details for EF Core scaffolding (reverse engineering).

    15k GitHub stars~165 tokensUpdated today
    SecurityAuto-check passed
  • Run team-based orchestration for agent squads: work items with owners and scope, agent Kanban state, branch isolation, control pane visibility, and merge gates.

    275k GitHub starsUsed in 1 repo~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Module Scaffolder

    aiskillstore/marketplace

    Scaffolds new feature modules in DevPrep AI following the 6-folder architecture with proper TypeScript interfaces, path aliases, and quality standards.

    430 GitHub stars~846 tokensUpdated today
    DevelopmentAuto-check: notes
  • Scaffold Element

    remotion-dev/remotion

    Official

    Scaffold a new Remotion Element for development in the docs Remotion Studio.

    62k GitHub stars~202 tokensUpdated today
    Media & CreativeAuto-check passed
  • Orca Orchestration

    stablyai/orca

    Coordinate supervised Orca workers: threaded messages, blocking ask/reply, task dispatch, worker_done/escalation waits, task DAGs, decision gates, coordinator…

    87k GitHub stars~916 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agent skill for orchestrator-task - invoke with $agent-orchestrator-task

    74k GitHub starsUsed in 3 repos~1k tokens
    Agent WorkflowsAuto-check passed

More from bactopia/bactopia

All 15 skills in this repo
  • Add Bactopia Tool

    bactopia/bactopia

    Scaffold a complete Bactopia Tool across all three tiers -- module, subworkflow, and workflow entry point under workflows/bactopia-tools/.

    522 GitHub stars~4.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Bump Versions

    bactopia/bactopia

    Propagate the Bactopia and nf-bactopia versions declared in versions.yml into the hand-maintained files that carry a literal version (conf/testbase.config, CITATION.cff, bin/bactopia…

    522 GitHub stars~1.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Merge Schemas

    bactopia/bactopia

    Regenerate nextflow.config and nextflowschema.json for Bactopia workflows by running bactopia-merge-schemas.

    522 GitHub stars~1.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Project Status

    bactopia/bactopia

    Show a live snapshot of the Bactopia project state — component counts, GroovyDoc coverage, nf-test coverage, and structural issues.

    522 GitHub stars~787 tokensUpdated 2 mo ago
    Auto-check passed
  • Release Checklist

    bactopia/bactopia

    Audit whether Bactopia is ready for a version release and produce a GO / NO-GO recommendation report.

    522 GitHub stars~4.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Review Citations

    bactopia/bactopia

    Review citation integrity across data/citations.yml and @citation tags using bactopia-citations --validate.

    522 GitHub stars~2.5k tokensUpdated 2 mo ago
    Auto-check passed

Questions about Add Subworkflow

What does Add Subworkflow do?

Scaffold a new Bactopia subworkflow that orchestrates existing modules. Add Subworkflow is an agent skill from bactopia/bactopia. Scaffold a new Bactopia subworkflow that orchestrates existing modules.

When should I use Add Subworkflow?

Add Subworkflow fits situations like: asked to add a new subworkflow; create a subworkflow; wire up modules into a subworkflow.

How do I install Add Subworkflow in Claude Code?

Run `npx skills add bactopia/bactopia --skill add-subworkflow -a claude-code`. Or copy the skill folder (.agents/skills/add-subworkflow in bactopia/bactopia) into .claude/skills/add-subworkflow in your project. Claude Code loads it when a task matches its description.

How do I install Add Subworkflow in Codex?

Run `npx skills add bactopia/bactopia --skill add-subworkflow -a codex`. Or copy the skill folder (.agents/skills/add-subworkflow in bactopia/bactopia) into .agents/skills/add-subworkflow in your project. Codex loads it when a task matches its description.

Can I use Add Subworkflow in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bactopia/bactopia --skill add-subworkflow -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-subworkflow, .gemini/skills/add-subworkflow, .github/skills/add-subworkflow and .opencode/skills/add-subworkflow in your project.

What does Add Subworkflow need to run?

Going by SKILL.md and its folder, Add Subworkflow needs the command-line tools its instructions call (bash). Our summary lists: Docker.

Does Add Subworkflow access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Subworkflow safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Subworkflow use?

Add Subworkflow is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Subworkflow use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Add Subworkflow?

Skills that share tags, products or a category with Add Subworkflow: Scaffolding (dotnet/efcore, 15k stars), Team Agent Orchestration (affaan-m/ECC, 275k stars), Module Scaffolder (aiskillstore/marketplace, 430 stars) and Scaffold Element (remotion-dev/remotion, 62k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Subworkflow?

bactopia (a GitHub organization) maintains it in bactopia/bactopia, which has 522 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on August 5, 2026.

Source: bactopia/bactopia on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.