[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EGARHW6058DWF09ZYWWBWM":3,"skill-same:01M7EGARHW6058DWF09ZYWWBWM":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EGARHW6058DWF09ZYWWBWM","bio-workflow-management-cwl-workflows",null,"Authors portable, strongly-typed bioinformatics pipelines in the Common Workflow Language (CWL v1.2) as CommandLineTool\u002FWorkflow\u002FExpressionTool documents, validated with cwltool and run at scale on Toil\u002FArvados\u002FCalrissian. Use when deciding CWL (portability\u002Fprovenance\u002Fregulated) vs Nextflow\u002FWDL\u002FSnakemake; declaring secondaryFiles for indexed companions (.bai\u002F.fai\u002F.dict\u002F.tbi and the caret rule); putting resources\u002Fcontainers under requirements (must-hold) vs hints (advisory) to avoid silent OOM; choosing scatterMethod (dotproduct vs flat_\u002Fnested_crossproduct); preferring $(...) parameter refs over ${...} JavaScript for portability; pinning DockerRequirement images; or emitting a CWLProv provenance object for audited\u002Fclinical settings.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflow-management-cwl-workflows\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-workflow-management-cwl-workflows\ndescription: Authors portable, strongly-typed bioinformatics pipelines in the Common Workflow Language (CWL v1.2) as CommandLineTool\u002FWorkflow\u002FExpressionTool documents, validated with cwltool and run at scale on Toil\u002FArvados\u002FCalrissian. Use when deciding CWL (portability\u002Fprovenance\u002Fregulated) vs Nextflow\u002FWDL\u002FSnakemake; declaring secondaryFiles for indexed companions (.bai\u002F.fai\u002F.dict\u002F.tbi and the caret rule); putting resources\u002Fcontainers under requirements (must-hold) vs hints (advisory) to avoid silent OOM; choosing scatterMethod (dotproduct vs flat_\u002Fnested_crossproduct); preferring $(...) parameter refs over ${...} JavaScript for portability; pinning DockerRequirement images; or emitting a CWLProv provenance object for audited\u002Fclinical settings.\ntool_type: cli\nprimary_tool: cwltool\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"workflow-management\u002Fcwl-workflows\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: cwltool 3.1+, CWL spec v1.2, Docker 24+ (or Singularity\u002FApptainer 3.8+)\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\nNote: target `cwlVersion: v1.2` for genomics (the record-form secondaryFiles with `required:` needs it). cwltool is the REFERENCE runner - correct, local, single-node, deliberately slow - NOT the spec; run Toil\u002FArvados\u002FCalrissian at scale. In v1.2, ExpressionTool outputs are NOT type-checked (a known reference-impl gap, fix planned for v1.3), so do not lean on ExpressionTool for type safety.\n\n# CWL Workflows\n\n**\"Write a portable pipeline that runs the same everywhere and proves what it ran\"** -> Describe each tool and their wiring as strongly-typed, machine-checkable CWL documents that any conforming runner honors identically, validate the contract before any compute, then execute locally (cwltool) or at scale (Toil\u002FArvados\u002FCalrissian).\n- CLI: `cwltool --validate wf.cwl`, `cwltool wf.cwl job.yml`, `cwltool --provenance ro\u002F wf.cwl job.yml`\n- YAML: `class: CommandLineTool` (wrap a tool) and `class: Workflow` (wire tools) at `cwlVersion: v1.2`\n\n## The governing principle: CWL is a SPECIFICATION, not an engine\n\nCWL deliberately splits the workflow DESCRIPTION (a portable, declarative, strongly-typed YAML\u002FJSON document) from its EXECUTION (performed by any conforming runner). Nextflow and Snakemake are engines that happen to have a DSL; WDL is a language with a dominant engine (Cromwell). CWL alone is a community-governed open standard with multiple independent implementations and a formal conformance test suite (Crusoe 2022 *Commun ACM* 65(6):54-63). The whole value proposition - portability, auditability, vendor-neutrality, provenance, regulatory fit - is a consequence of \"spec not engine.\" The correct frame: the author writes a portable, machine-checkable CONTRACT for a computation that any conforming platform must honor identically. That contract is why CWL is the most VERBOSE and most EXPLICIT of the four systems - the verbosity buys static analyzability and portability.\n\nThe most common conceptual error is conflating CWL with cwltool. cwltool is the reference implementation: correct, single-node, and slow by design (it prioritizes spec-conformance over speed). \"CWL is slow\" or \"CWL can't scale\" almost always means \"I ran cwltool\" - at scale the same unchanged document runs on Toil (HPC\u002Fcloud batch), Arvados (clinical\u002Fenterprise data management), or Calrissian (Kubernetes). Never equate a runner's limits with the spec's.\n\nAdopting CWL buys reproducible workflow LOGIC and nothing else automatically. A clean typed DAG over unpinned tools is NOT reproducible - pin the software environment (containers by digest, not a moving `:latest`), the reference data and seeds, and control arch\u002Fthread\u002Flocale leaks separately. The type system closes the wiring-error layer; the author still owns the rest.\n\n## Decision: choose CWL vs the other engines\n\n| Dimension | CWL | Nextflow | WDL | Snakemake |\n|-----------|-----|----------|-----|-----------|\n| Nature | open SPEC, many engines | engine + Groovy DSL | language + Cromwell\u002Fminiwdl | engine + Python DSL |\n| Typing | strong static (File\u002FDir\u002Frecord\u002Fenum\u002Foptional) | dynamic | moderate | weak (paths\u002Fstrings) |\n| Index companions | `secondaryFiles` = File type property | manual channel\u002Ftuple wiring | manual per-input | manual |\n| Provenance | CWLProv RO out of the box | report\u002Ftrace\u002FDAG | via platform | report\u002Fplugins |\n| Verbosity | HIGHEST (deliberate) | terse | moderate | moderate |\n| New-author mindshare | DECLINING | ASCENDANT (nf-core) | strong on Terra | strong in academia |\n| Sweet spot | multi-platform, provenance-critical, regulated\u002Fclinical, standards-driven | fast authoring, curated catalog | Terra\u002FGATK ecosystem | single-lab Python\u002FHPC |\n\nChoose CWL when vendor-neutral portability across multiple platforms, a standardized provenance artifact for a regulated\u002Faudited setting, static type-checking before compute, or publishing to a multi-runner registry (Dockstore) drives the decision. Be honest about mindshare: for NEW pipeline authoring CWL has been losing ground to Nextflow\u002Fnf-core and WDL\u002FTerra for years (they win on authoring speed and community momentum). CWL retains and deepens its hold where the SPEC is the point - not as a neutral default. Prefer Nextflow\u002FWDL when authoring speed, an existing curated catalog (nf-core), or a specific hosted platform (Terra) dominates.\n\n## Decision: which runner\n\n| Engine | For | Runtime model | Notes |\n|--------|-----|---------------|-------|\n| cwltool | authoring, `--validate`, `--pack`, `--provenance`, CI, local dev | local, single-node | the conformance yardstick; slow by design - do NOT read its limits as CWL's |\n| Toil | HPC and cloud batch scale | Python; Slurm\u002FKubernetes\u002FAWS\u002FGrid Engine | `toil-cwl-runner`; the workhorse for large CWL |\n| Arvados | enterprise\u002Fclinical data management + execution | cluster + content-addressed storage | `arvados-cwl-runner`; strong data provenance; regulated settings |\n| Calrissian | CWL on Kubernetes | one k8s pod per step | needs `ReadWriteMany` volumes; cloud-native parallelism |\n| Cromwell | primarily WDL, PARTIAL CWL | JVM | runs a subset only; do not rely on it for full CWL conformance |\n\n## Decision: requirements vs hints (get this wrong and jobs silently OOM)\n\n`requirements` MUST be satisfied - if the runner cannot honor one, execution FAILS loudly (correctly). `hints` are advisory: the runner MAY honor or ignore them without error. The canonical failure is putting `ResourceRequirement: {ramMin: 32000}` under `hints` on a memory-hungry step - a runner is free to ignore a hint and schedule it on a small node, giving intermittent OOM kills. Anything whose absence would corrupt results or crash (the container, minimum RAM\u002Fcores, a required input layout, an env var a tool depends on) goes under `requirements`. Both inherit Workflow -> step -> tool with the INNERMOST declaration winning, so set a default `DockerRequirement`\u002F`ResourceRequirement` at workflow scope and override per-step where a tool needs a different image or more RAM. A surprising container at a step is usually a forgotten override.\n\n## Decision: scatterMethod\n\n`scatter` runs a step once per array element; when scattering over MULTIPLE inputs, `scatterMethod` decides how they combine. This is the most misunderstood CWL construct.\n\n| scatterMethod | Combines by | Jobs | Output shape | Use when |\n|---------------|-------------|------|--------------|----------|\n| `dotproduct` | position-aligned zip | N (arrays MUST be equal length) | flat array of N | paired arrays that correspond 1:1 (R1[i] with R2[i]) |\n| `flat_crossproduct` | every combination | N x M | FLAT array of N x M | all pairs, want a flat result list |\n| `nested_crossproduct` | every combination | N x M | NESTED array (N of M) | all pairs, preserve the 2-D grid |\n\n`dotproduct` requires equal-length arrays (unequal is an error, not truncation). The two cross-products run the SAME N x M jobs and differ only in output nesting - choosing `flat_` vs `nested_` wrong gives the right computations with a mis-shaped output that then mis-wires a downstream `File[]` step. `ScatterFeatureRequirement` must be declared regardless of scatterMethod.\n\n## CommandLineTool: wrap one tool\n\nA CommandLineTool binds typed inputs to the command line (`inputBinding`) and captures outputs (`outputBinding.glob` or `stdout`). Tool outputs use `outputBinding`; workflow outputs use `outputSource` - mixing them is a validation error.\n\n```yaml\ncwlVersion: v1.2\nclass: CommandLineTool\nbaseCommand: [bwa, mem]\nrequirements:\n  DockerRequirement:\n    dockerPull: quay.io\u002Fbiocontainers\u002Fbwa:0.7.17--he4a0461_11   # digest-pin in production; :latest breaks reproducibility\n  ResourceRequirement:            # under requirements: must hold, or the runner fails loudly (a hint could be ignored -> OOM)\n    coresMin: 8\n    ramMin: 16000                 # MB; bwa-mem index residency + reads, empirical floor for a human genome\ninputs:\n  reference:\n    type: File\n    secondaryFiles:               # the .amb\u002F.ann\u002F.bwt\u002F.pac\u002F.sa BWA index files are STAGED next to the fasta\n      [.amb, .ann, .bwt, .pac, .sa]\n    inputBinding: {position: 2}\n  reads_1: {type: File, inputBinding: {position: 3}}\n  reads_2: {type: File?, inputBinding: {position: 4}}   # File? is optional: [null, File]\n  threads: {type: int, default: 8, inputBinding: {prefix: -t, position: 1}}\nstdout: aligned.sam\noutputs:\n  sam: {type: stdout}\n```\n\n## Workflow: wire tools by explicit typed connections\n\nCWL is PULL\u002Fgoal-oriented and fully declarative: dataflow is wired explicitly through `source`\u002F`outputSource`, never through implicit channels (Nextflow) or filename wildcards (Snakemake). `--validate` type-checks every connection statically, before a byte of data moves.\n\n```yaml\ncwlVersion: v1.2\nclass: Workflow\nrequirements:\n  ScatterFeatureRequirement: {}\ninputs:\n  fastq_1: File\n  fastq_2: File\n  salmon_index: Directory\noutputs:\n  quant_results:\n    type: Directory\n    outputSource: salmon\u002Fquant_dir     # workflow output wires with outputSource (NOT outputBinding)\nsteps:\n  fastp:\n    run: fastp.cwl\n    in: {reads_1: fastq_1, reads_2: fastq_2}\n    out: [trimmed_1, trimmed_2, json_report]\n  salmon:\n    run: salmon_quant.cwl\n    in: {index: salmon_index, reads_1: fastp\u002Ftrimmed_1, reads_2: fastp\u002Ftrimmed_2}   # source: other_step\u002Foutput\n    out: [quant_dir]\n```\n\n## secondaryFiles: index and companion files as a type property\n\nGenomics tools demand companion files that must sit next to the primary with a derived name: `.bam` needs `.bai`, `.fasta` needs `.fai` and `.dict`, `.vcf.gz` needs `.tbi`. CWL makes the companion a PROPERTY of the File type, so every conforming runner is OBLIGATED to co-stage them - the other engines leave this to hand-wiring. This is the single most genomics-relevant CWL feature and the strongest reason to target v1.2.\n\n```yaml\ninputs:\n  bam:\n    type: File\n    secondaryFiles: [.bai]         # append: sample.bam -> sample.bam.bai staged alongside\n  reference:\n    type: File\n    secondaryFiles:                # v1.2 record form makes required-ness explicit\n      - {pattern: .fai, required: true}\n      - {pattern: ^.dict, required: false}   # caret ^ STRIPS one extension: genome.fasta -> genome.dict (NOT genome.fasta.dict)\n```\n\nThe caret `^` removes one extension from the basename before appending; each leading `^` strips one more - the classic `.dict` gotcha. In v1.0\u002Fv1.1 a bare string pattern is required-by-default; only the v1.2 record `{pattern, required}` form can mark an index optional (a `.tbi` that may be absent). secondaryFiles are declared on OUTPUT File parameters too, so a produced BAM carries its `.bai` to the next step; on inputs required defaults true, on outputs the index is collected if present.\n\n## Expressions: $(...) is portable, ${...} is a portability debt\n\nParameter references `$(...)` are a restricted, safe subset - property\u002Findex access into `inputs`, `self`, `runtime` (e.g. `$(inputs.reads.nameroot)`, `$(runtime.outdir)`). They need NO JavaScript engine, are statically analyzable, and are portable - prefer them. Full JavaScript `${ return ...; }` runs only when `InlineJavascriptRequirement` is present; it is powerful but (a) needs a node engine wherever the workflow runs, (b) is opaque to static analysis, (c) is the leading cause of \"works on my runner, breaks on theirs.\" Reach for `${...}` only when a parameter reference genuinely cannot express the need, and treat every `InlineJavascriptRequirement` as a portability debt taken on knowingly. `valueFrom` transforms a step input before it reaches the tool (needs `StepInputExpressionRequirement` for expressions at step scope).\n\n## Portability leaks: \"run anywhere\" is real but DISCIPLINED\n\nThe promise is genuine for disciplined CWL, but it leaks - name the leaks. `InlineJavascriptRequirement` needs a JS engine (node). `DockerRequirement` carries arch\u002Fregistry assumptions (an amd64-only image fails on arm64 Apple Silicon\u002FGraviton; a private-registry image needs credentials the target may lack; `:latest` is not reproducible). Engine-specific extensions under custom namespaces (`cwltool:`, `arv:`) are portable only among runners that understand them - they live under `hints` so a naive runner can ignore them, but a workflow that DEPENDS on their behavior has forfeited portability. Conformance is graded (a coverage percentage per implementation), not binary - \"valid CWL\" does not guarantee \"runs identically on engine X.\" The disciplined recipe: target v1.2; containerize every tool with a digest-pinned multi-arch image; minimize `${...}` in favor of `$(...)`; keep `cwltool:`\u002F`arv:` items under `hints` and never depend on them for correctness; in the input (job) object prefer `location:` URIs over a local `path:` (a `path:` binds the job to one machine's filesystem); validate, then exercise the real target engine before trusting portability.\n\n## Provenance: CWL's high ground for regulated\u002Fclinical settings\n\n`cwltool --provenance ro\u002F wf.cwl job.yml` produces a CWLProv Research Object (a W3C PROV + RO-Crate\u002FBagIt bundle) capturing the workflow, the exact input object, all outputs, intermediates, container images, and the enactment trace (Khan 2019 *GigaScience* 8(11):giz095). No other mainstream system ships a standardized retrospective-provenance artifact out of the box - this is the concrete reason CWL wins in regulated\u002Faudited genomics: hand an auditor one object that answers \"exactly what ran, on what inputs, in what containers, producing what outputs.\" CWL is also a first-class GA4GH citizen: TRS (Tool Registry Service, implemented by Dockstore) standardizes discovery, WES standardizes cross-platform execution - the strongest reproducibility+portability+provenance story of the four systems.\n\n## Run commands\n\n```bash\ncwltool --validate wf.cwl                     # static type-check the contract; no compute\ncwltool wf.cwl job.yml                         # run locally (reference runner)\ncwltool --singularity wf.cwl job.yml           # swap container runtime (Apptainer is Singularity-compatible)\ncwltool --pack wf.cwl > packed.cwl             # bundle a multi-file workflow into one shareable JSON\ncwltool --provenance ro\u002F wf.cwl job.yml        # emit a CWLProv Research Object\ntoil-cwl-runner --batchSystem slurm wf.cwl job.yml   # same document, at HPC scale\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| \"CWL is slow \u002F can't scale\" | ran cwltool (reference runner, single-node, slow by design) | run the same document on Toil\u002FArvados\u002FCalrissian; do not equate runner limits with the spec |\n| \"index not found\" at runtime (e.g. no `.bai`\u002F`.fai`) | secondaryFiles not declared, so the runner staged the primary but not its index | declare `secondaryFiles` on the indexed File input (and output) |\n| `genome.fasta.dict` produced instead of `genome.dict` | forgot the caret; `.dict` appends, `^.dict` strips one extension | use `^.dict` (each `^` strips one extension) |\n| Intermittent OOM \u002F undersized node on a heavy step | `ResourceRequirement` placed under `hints` (advisory, may be ignored) | move anything that MUST hold under `requirements` |\n| Validation error on a workflow output | used `outputBinding.glob` on a workflow output | workflow outputs wire via `outputSource: step\u002Fout`; only tool outputs use `outputBinding` |\n| Scatter runs but produces N x M or wrong-shaped output | wrong scatterMethod (dotproduct vs flat_\u002Fnested_crossproduct) | pick deliberately: dotproduct=zip, flat_\u002Fnested_=all pairs (flat vs nested output) |\n| Works on cwltool, fails\u002Fdiffers on another engine | `${...}` JS or `cwltool:`\u002F`arv:` extension the target lacks; graded conformance | prefer `$(...)`; keep engine extensions in hints; test the real target |\n| \"ScatterFeatureRequirement not specified\" | used `scatter:` without the feature flag | add `requirements: [ScatterFeatureRequirement]` |\n| Non-reproducible result across time | mutable `:latest` container tag | pin `DockerRequirement` by `@sha256:` digest |\n\n## Related Skills\n\n- workflow-management\u002Fwdl-workflows - WDL\u002FCromwell alternative for the Terra\u002FGATK ecosystem\n- workflow-management\u002Fnextflow-pipelines - reactive-dataflow alternative with the nf-core catalog\n- workflow-management\u002Fsnakemake-workflows - Python\u002Ffile-pattern alternative for single-lab HPC\n- workflows\u002Ffastq-to-variants - an end-to-end variant-calling pipeline these engines orchestrate\n\n## References\n\n- Crusoe MR, Abeln S, Iosup A, et al. 2022. Methods Included: Standardizing Computational Reuse and Portability with the Common Workflow Language. *Commun ACM* 65(6):54-63. DOI 10.1145\u002F3486897.\n- Amstutz P, Crusoe MR, Tijanic N, et al. 2016. Common Workflow Language, v1.0. figshare. DOI 10.6084\u002Fm9.figshare.3115156.v2.\n- Khan FZ, Soiland-Reyes S, Sinnott RO, Lonie A, Goble C, Crusoe MR. 2019. Sharing interoperable workflow provenance: a review of best practices and their practical application in CWLProv. *GigaScience* 8(11):giz095. DOI 10.1093\u002Fgigascience\u002Fgiz095.\n- Wratten L, Wilm A, Göke J. 2021. Reproducible, scalable, and shareable analysis pipelines with bioinformatics workflow managers. *Nat Methods* 18:1161-1168. DOI 10.1038\u002Fs41592-021-01254-9.\n","## Version Compatibility\n\nReference examples tested with: cwltool 3.1+, CWL spec v1.2, Docker 24+ (or Singularity\u002FApptainer 3.8+)\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\nNote: target `cwlVersion: v1.2` for genomics (the record-form secondaryFiles with `required:` needs it). cwltool is the REFERENCE runner - correct, local, single-node, deliberately slow - NOT the spec; run Toil\u002FArvados\u002FCalrissian at scale. In v1.2, ExpressionTool outputs are NOT type-checked (a known reference-impl gap, fix planned for v1.3), so do not lean on ExpressionTool for type safety.\n\n# CWL Workflows\n\n**\"Write a portable pipeline that runs the same everywhere and proves what it ran\"** -> Describe each tool and their wiring as strongly-typed, machine-checkable CWL documents that any conforming runner honors identically, validate the contract before any compute, then execute locally (cwltool) or at scale (Toil\u002FArvados\u002FCalrissian).\n- CLI: `cwltool --validate wf.cwl`, `cwltool wf.cwl job.yml`, `cwltool --provenance ro\u002F wf.cwl job.yml`\n- YAML: `class: CommandLineTool` (wrap a tool) and `class: Workflow` (wire tools) at `cwlVersion: v1.2`\n\n## The governing principle: CWL is a SPECIFICATION, not an engine\n\nCWL deliberately splits the workflow DESCRIPTION (a portable, declarative, strongly-typed YAML\u002FJSON document) from its EXECUTION (performed by any conforming runner). Nextflow and Snakemake are engines that happen to have a DSL; WDL is a language with a dominant engine (Cromwell). CWL alone is a community-governed open standard with multiple independent implementations and a formal conformance test suite (Crusoe 2022 *Commun ACM* 65(6):54-63). The whole value proposition - portability, auditability, vendor-neutrality, provenance, regulatory fit - is a consequence of \"spec not engine.\" The correct frame: the author writes a portable, machine-checkable CONTRACT for a computation that any conforming platform must honor identically. That contract is why CWL is the most VERBOSE and most EXPLICIT of the four systems - the verbosity buys static analyzability and portability.\n\nThe most common conceptual error is conflating CWL with cwltool. cwltool is the reference implementation: correct, single-node, and slow by design (it prioritizes spec-conformance over speed). \"CWL is slow\" or \"CWL can't scale\" almost always means \"I ran cwltool\" - at scale the same unchanged document runs on Toil (HPC\u002Fcloud batch), Arvados (clinical\u002Fenterprise data management), or Calrissian (Kubernetes). Never equate a runner's limits with the spec's.\n\nAdopting CWL buys reproducible workflow LOGIC and nothing else automatically. A clean typed DAG over unpinned tools is NOT reproducible - pin the software environment (containers by digest, not a moving `:latest`), the reference data and seeds, and control arch\u002Fthread\u002Flocale leaks separately. The type system closes the wiring-error layer; the author still owns the rest.\n\n## Decision: choose CWL vs the other engines\n\n| Dimension | CWL | Nextflow | WDL | Snakemake |\n|-----------|-----|----------|-----|-----------|\n| Nature | open SPEC, many engines | engine + Groovy DSL | language + Cromwell\u002Fminiwdl | engine + Python DSL |\n| Typing | strong static (File\u002FDir\u002Frecord\u002Fenum\u002Foptional) | dynamic | moderate | weak (paths\u002Fstrings) |\n| Index companions | `secondaryFiles` = File type property | manual channel\u002Ftuple wiring | manual per-input | manual |\n| Provenance | CWLProv RO out of the box | report\u002Ftrace\u002FDAG | via platform | report\u002Fplugins |\n| Verbosity | HIGHEST (deliberate) | terse | moderate | moderate |\n| New-author mindshare | DECLINING | ASCENDANT (nf-core) | strong on Terra | strong in academia |\n| Sweet spot | multi-platform, provenance-critical, regulated\u002Fclinical, standards-driven | fast authoring, curated catalog | Terra\u002FGATK ecosystem | single-lab Python\u002FHPC |\n\nChoose CWL when vendor-neutral portability across multiple platforms, a standardized provenance artifact for a regulated\u002Faudited setting, static type-checking before compute, or publishing to a multi-runner registry (Dockstore) drives the decision. Be honest about mindshare: for NEW pipeline authoring CWL has been losing ground to Nextflow\u002Fnf-core and WDL\u002FTerra for years (they win on authoring speed and community momentum). CWL retains and deepens its hold where the SPEC is the point - not as a neutral default. Prefer Nextflow\u002FWDL when authoring speed, an existing curated catalog (nf-core), or a specific hosted platform (Terra) dominates.\n\n## Decision: which runner\n\n| Engine | For | Runtime model | Notes |\n|--------|-----|---------------|-------|\n| cwltool | authoring, `--validate`, `--pack`, `--provenance`, CI, local dev | local, single-node | the conformance yardstick; slow by design - do NOT read its limits as CWL's |\n| Toil | HPC and cloud batch scale | Python; Slurm\u002FKubernetes\u002FAWS\u002FGrid Engine | `toil-cwl-runner`; the workhorse for large CWL |\n| Arvados | enterprise\u002Fclinical data management + execution | cluster + content-addressed storage | `arvados-cwl-runner`; strong data provenance; regulated settings |\n| Calrissian | CWL on Kubernetes | one k8s pod per step | needs `ReadWriteMany` volumes; cloud-native parallelism |\n| Cromwell | primarily WDL, PARTIAL CWL | JVM | runs a subset only; do not rely on it for full CWL conformance |\n\n## Decision: requirements vs hints (get this wrong and jobs silently OOM)\n\n`requirements` MUST be satisfied - if the runner cannot honor one, execution FAILS loudly (correctly). `hints` are advisory: the runner MAY honor or ignore them without error. The canonical failure is putting `ResourceRequirement: {ramMin: 32000}` under `hints` on a memory-hungry step - a runner is free to ignore a hint and schedule it on a small node, giving intermittent OOM kills. Anything whose absence would corrupt results or crash (the container, minimum RAM\u002Fcores, a required input layout, an env var a tool depends on) goes under `requirements`. Both inherit Workflow -> step -> tool with the INNERMOST declaration winning, so set a default `DockerRequirement`\u002F`ResourceRequirement` at workflow scope and override per-step where a tool needs a different image or more RAM. A surprising container at a step is usually a forgotten override.\n\n## Decision: scatterMethod\n\n`scatter` runs a step once per array element; when scattering over MULTIPLE inputs, `scatterMethod` decides how they combine. This is the most misunderstood CWL construct.\n\n| scatterMethod | Combines by | Jobs | Output shape | Use when |\n|---------------|-------------|------|--------------|----------|\n| `dotproduct` | position-aligned zip | N (arrays MUST be equal length) | flat array of N | paired arrays that correspond 1:1 (R1[i] with R2[i]) |\n| `flat_crossproduct` | every combination | N x M | FLAT array of N x M | all pairs, want a flat result list |\n| `nested_crossproduct` | every combination | N x M | NESTED array (N of M) | all pairs, preserve the 2-D grid |\n\n`dotproduct` requires equal-length arrays (unequal is an error, not truncation). The two cross-products run the SAME N x M jobs and differ only in output nesting - choosing `flat_` vs `nested_` wrong gives the right computations with a mis-shaped output that then mis-wires a downstream `File[]` step. `ScatterFeatureRequirement` must be declared regardless of scatterMethod.\n\n## CommandLineTool: wrap one tool\n\nA CommandLineTool binds typed inputs to the command line (`inputBinding`) and captures outputs (`outputBinding.glob` or `stdout`). Tool outputs use `outputBinding`; workflow outputs use `outputSource` - mixing them is a validation error.\n\n```yaml\ncwlVersion: v1.2\nclass: CommandLineTool\nbaseCommand: [bwa, mem]\nrequirements:\n  DockerRequirement:\n    dockerPull: quay.io\u002Fbiocontainers\u002Fbwa:0.7.17--he4a0461_11   # digest-pin in production; :latest breaks reproducibility\n  ResourceRequirement:            # under requirements: must hold, or the runner fails loudly (a hint could be ignored -> OOM)\n    coresMin: 8\n    ramMin: 16000                 # MB; bwa-mem index residency + reads, empirical floor for a human genome\ninputs:\n  reference:\n    type: File\n    secondaryFiles:               # the .amb\u002F.ann\u002F.bwt\u002F.pac\u002F.sa BWA index files are STAGED next to the fasta\n      [.amb, .ann, .bwt, .pac, .sa]\n    inputBinding: {position: 2}\n  reads_1: {type: File, inputBinding: {position: 3}}\n  reads_2: {type: File?, inputBinding: {position: 4}}   # File? is optional: [null, File]\n  threads: {type: int, default: 8, inputBinding: {prefix: -t, position: 1}}\nstdout: aligned.sam\noutputs:\n  sam: {type: stdout}\n```\n\n## Workflow: wire tools by explicit typed connections\n\nCWL is PULL\u002Fgoal-oriented and fully declarative: dataflow is wired explicitly through `source`\u002F`outputSource`, never through implicit channels (Nextflow) or filename wildcards (Snakemake). `--validate` type-checks every connection statically, before a byte of data moves.\n\n```yaml\ncwlVersion: v1.2\nclass: Workflow\nrequirements:\n  ScatterFeatureRequirement: {}\ninputs:\n  fastq_1: File\n  fastq_2: File\n  salmon_index: Directory\noutputs:\n  quant_results:\n    type: Directory\n    outputSource: salmon\u002Fquant_dir     # workflow output wires with outputSource (NOT outputBinding)\nsteps:\n  fastp:\n    run: fastp.cwl\n    in: {reads_1: fastq_1, reads_2: fastq_2}\n    out: [trimmed_1, trimmed_2, json_report]\n  salmon:\n    run: salmon_quant.cwl\n    in: {index: salmon_index, reads_1: fastp\u002Ftrimmed_1, reads_2: fastp\u002Ftrimmed_2}   # source: other_step\u002Foutput\n    out: [quant_dir]\n```\n\n## secondaryFiles: index and companion files as a type property\n\nGenomics tools demand companion files that must sit next to the primary with a derived name: `.bam` needs `.bai`, `.fasta` needs `.fai` and `.dict`, `.vcf.gz` needs `.tbi`. CWL makes the companion a PROPERTY of the File type, so every conforming runner is OBLIGATED to co-stage them - the other engines leave this to hand-wiring. This is the single most genomics-relevant CWL feature and the strongest reason to target v1.2.\n\n```yaml\ninputs:\n  bam:\n    type: File\n    secondaryFiles: [.bai]         # append: sample.bam -> sample.bam.bai staged alongside\n  reference:\n    type: File\n    secondaryFiles:                # v1.2 record form makes required-ness explicit\n      - {pattern: .fai, required: true}\n      - {pattern: ^.dict, required: false}   # caret ^ STRIPS one extension: genome.fasta -> genome.dict (NOT genome.fasta.dict)\n```\n\nThe caret `^` removes one extension from the basename before appending; each leading `^` strips one more - the classic `.dict` gotcha. In v1.0\u002Fv1.1 a bare string pattern is required-by-default; only the v1.2 record `{pattern, required}` form can mark an index optional (a `.tbi` that may be absent). secondaryFiles are declared on OUTPUT File parameters too, so a produced BAM carries its `.bai` to the next step; on inputs required defaults true, on outputs the index is collected if present.\n\n## Expressions: $(...) is portable, ${...} is a portability debt\n\nParameter references `$(...)` are a restricted, safe subset - property\u002Findex access into `inputs`, `self`, `runtime` (e.g. `$(inputs.reads.nameroot)`, `$(runtime.outdir)`). They need NO JavaScript engine, are statically analyzable, and are portable - prefer them. Full JavaScript `${ return ...; }` runs only when `InlineJavascriptRequirement` is present; it is powerful but (a) needs a node engine wherever the workflow runs, (b) is opaque to static analysis, (c) is the leading cause of \"works on my runner, breaks on theirs.\" Reach for `${...}` only when a parameter reference genuinely cannot express the need, and treat every `InlineJavascriptRequirement` as a portability debt taken on knowingly. `valueFrom` transforms a step input before it reaches the tool (needs `StepInputExpressionRequirement` for expressions at step scope).\n\n## Portability leaks: \"run anywhere\" is real but DISCIPLINED\n\nThe promise is genuine for disciplined CWL, but it leaks - name the leaks. `InlineJavascriptRequirement` needs a JS engine (node). `DockerRequirement` carries arch\u002Fregistry assumptions (an amd64-only image fails on arm64 Apple Silicon\u002FGraviton; a private-registry image needs credentials the target may lack; `:latest` is not reproducible). Engine-specific extensions under custom namespaces (`cwltool:`, `arv:`) are portable only among runners that understand them - they live under `hints` so a naive runner can ignore them, but a workflow that DEPENDS on their behavior has forfeited portability. Conformance is graded (a coverage percentage per implementation), not binary - \"valid CWL\" does not guarantee \"runs identically on engine X.\" The disciplined recipe: target v1.2; containerize every tool with a digest-pinned multi-arch image; minimize `${...}` in favor of `$(...)`; keep `cwltool:`\u002F`arv:` items under `hints` and never depend on them for correctness; in the input (job) object prefer `location:` URIs over a local `path:` (a `path:` binds the job to one machine's filesystem); validate, then exercise the real target engine before trusting portability.\n\n## Provenance: CWL's high ground for regulated\u002Fclinical settings\n\n`cwltool --provenance ro\u002F wf.cwl job.yml` produces a CWLProv Research Object (a W3C PROV + RO-Crate\u002FBagIt bundle) capturing the workflow, the exact input object, all outputs, intermediates, container images, and the enactment trace (Khan 2019 *GigaScience* 8(11):giz095). No other mainstream system ships a standardized retrospective-provenance artifact out of the box - this is the concrete reason CWL wins in regulated\u002Faudited genomics: hand an auditor one object that answers \"exactly what ran, on what inputs, in what containers, producing what outputs.\" CWL is also a first-class GA4GH citizen: TRS (Tool Registry Service, implemented by Dockstore) standardizes discovery, WES standardizes cross-platform execution - the strongest reproducibility+portability+provenance story of the four systems.\n\n## Run commands\n\n```bash\ncwltool --validate wf.cwl                     # static type-check the contract; no compute\ncwltool wf.cwl job.yml                         # run locally (reference runner)\ncwltool --singularity wf.cwl job.yml           # swap container runtime (Apptainer is Singularity-compatible)\ncwltool --pack wf.cwl > packed.cwl             # bundle a multi-file workflow into one shareable JSON\ncwltool --provenance ro\u002F wf.cwl job.yml        # emit a CWLProv Research Object\ntoil-cwl-runner --batchSystem slurm wf.cwl job.yml   # same document, at HPC scale\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| \"CWL is slow \u002F can't scale\" | ran cwltool (reference runner, single-node, slow by design) | run the same document on Toil\u002FArvados\u002FCalrissian; do not equate runner limits with the spec |\n| \"index not found\" at runtime (e.g. no `.bai`\u002F`.fai`) | secondaryFiles not declared, so the runner staged the primary but not its index | declare `secondaryFiles` on the indexed File input (and output) |\n| `genome.fasta.dict` produced instead of `genome.dict` | forgot the caret; `.dict` appends, `^.dict` strips one extension | use `^.dict` (each `^` strips one extension) |\n| Intermittent OOM \u002F undersized node on a heavy step | `ResourceRequirement` placed under `hints` (advisory, may be ignored) | move anything that MUST hold under `requirements` |\n| Validation error on a workflow output | used `outputBinding.glob` on a workflow output | workflow outputs wire via `outputSource: step\u002Fout`; only tool outputs use `outputBinding` |\n| Scatter runs but produces N x M or wrong-shaped output | wrong scatterMethod (dotproduct vs flat_\u002Fnested_crossproduct) | pick deliberately: dotproduct=zip, flat_\u002Fnested_=all pairs (flat vs nested output) |\n| Works on cwltool, fails\u002Fdiffers on another engine | `${...}` JS or `cwltool:`\u002F`arv:` extension the target lacks; graded conformance | prefer `$(...)`; keep engine extensions in hints; test the real target |\n| \"ScatterFeatureRequirement not specified\" | used `scatter:` without the feature flag | add `requirements: [ScatterFeatureRequirement]` |\n| Non-reproducible result across time | mutable `:latest` container tag | pin `DockerRequirement` by `@sha256:` digest |\n\n## Related Skills\n\n- workflow-management\u002Fwdl-workflows - WDL\u002FCromwell alternative for the Terra\u002FGATK ecosystem\n- workflow-management\u002Fnextflow-pipelines - reactive-dataflow alternative with the nf-core catalog\n- workflow-management\u002Fsnakemake-workflows - Python\u002Ffile-pattern alternative for single-lab HPC\n- workflows\u002Ffastq-to-variants - an end-to-end variant-calling pipeline these engines orchestrate\n\n## References\n\n- Crusoe MR, Abeln S, Iosup A, et al. 2022. Methods Included: Standardizing Computational Reuse and Portability with the Common Workflow Language. *Commun ACM* 65(6):54-63. DOI 10.1145\u002F3486897.\n- Amstutz P, Crusoe MR, Tijanic N, et al. 2016. Common Workflow Language, v1.0. figshare. DOI 10.6084\u002Fm9.figshare.3115156.v2.\n- Khan FZ, Soiland-Reyes S, Sinnott RO, Lonie A, Goble C, Crusoe MR. 2019. Sharing interoperable workflow provenance: a review of best practices and their practical application in CWLProv. *GigaScience* 8(11):giz095. DOI 10.1093\u002Fgigascience\u002Fgiz095.\n- Wratten L, Wilm A, Göke J. 2021. Reproducible, scalable, and shareable analysis pipelines with bioinformatics workflow managers. *Nat Methods* 18:1161-1168. DOI 10.1038\u002Fs41592-021-01254-9.\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","cli","2026-09-20","workflow-management\u002Fcwl-workflows\u002FSKILL.md","cwltool","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-workflow-management-cwl-workflows","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflow-management-cwl-workflows",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflow-management-cwl-workflows",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflow-management-cwl-workflows","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflow-management-cwl-workflows\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Frnaseq.cwl","OTHER","其他",7492,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflow-management-cwl-workflows\u002Fexamples\u002Frnaseq.cwl",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",6558,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflow-management-cwl-workflows\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]