migrate-nextflow-code
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMigrate Nextflow Code
迁移Nextflow代码
Migrate Nextflow pipeline code to satisfy newer language requirements. Each migration is detection-driven: a tool reports what must change, you apply behavior-preserving fixes, then re-run the tool until it is clean.
Requires Nextflow 26.04 or later (for the command and the strict syntax parser, which is the default from 26.04 onward).
nextflow lintnf-core pipelines — check the template version before starting. If the pipeline has a , check which version of nf-core/tools last generated its template. If is unspecified or less than 3.0.0, stop. Tell the user to upgrade their template first () before attempting any code migrations. This will resolve syntax errors in the template code and provide a cleaner baseline.
.nf-core.ymlnf_core_versionnf-core pipelines sync将Nextflow管道代码迁移至符合更新的语言要求。每一项迁移都由检测驱动:工具会报告需要修改的内容,你需应用不改变原有行为的修复,然后重新运行工具直至无问题。
要求Nextflow 26.04或更高版本(用于命令和严格语法解析器,该解析器从26.04版本起成为默认选项)。
nextflow lintnf-core管道——开始前请检查模板版本。如果管道包含文件,请检查nf-core/tools最后生成该模板的版本。若未指定或低于3.0.0,请停止操作。告知用户先升级模板(执行),再尝试进行任何代码迁移。这将解决模板代码中的语法错误,并提供更清晰的基线。
.nf-core.ymlnf_core_versionnf-core pipelines syncHow to use this skill
如何使用此Skill
This SKILL.md is an index. Identify which migration the user needs from the table below, then read the matching reference file for the full detect → fix → verify procedure before doing any work. Each reference file is self-contained.
| Migration | Use when the user… | Read this file |
|---|---|---|
| Strict syntax | …has strict syntax errors, or asks to run | |
| Topic channels | …wants to replace the | |
| Static typing | …wants to add static types — typed process/workflow inputs and outputs, records (replacing tuples), or typed params | |
| Workflow outputs | …wants to replace | |
If the request matches no row, tell the user which migrations are currently supported rather than improvising.
If the request covers multiple migrations, recommend performing only the first matching migration in the table. The order is also a dependency order: strict syntax -> topic channels -> static typing -> workflow outputs. Do not try to perform multiple migrations at the same time.
本SKILL.md是一份索引。从下表中确定用户所需的迁移类型,然后阅读对应的参考文件,了解完整的检测→修复→验证流程后再开展工作。每份参考文件都是独立完整的。
| 迁移类型 | 适用场景 | 阅读文件 |
|---|---|---|
| 严格语法 | 用户遇到严格语法错误,或要求运行 | |
| 主题通道 | 用户希望用主题通道替换 | |
| 静态类型 | 用户希望添加静态类型——类型化流程/工作流的输入输出、记录(替换元组)或类型化参数 | |
| 工作流输出 | 用户希望用工作流输出替换 | |
如果用户的请求与上表中的任何一行都不匹配,请告知用户当前支持的迁移类型,不要自行尝试。
如果用户的请求涉及多项迁移,建议仅执行表格中第一个匹配的迁移。顺序同时也是依赖顺序:严格语法 → 主题通道 → 静态类型 → 工作流输出。请勿同时执行多项迁移。
Critical Rules
关键规则
These hold regardless of which reference file you load. Each reference file adds its own migration-specific rules.
- Detect before editing — follow the reference guidelines to determine what needs changing. Never guess.
- Preserve behavior — a migration adapts code to new language requirements; it is not a refactor. Apply the smallest change that resolves each issue and leave unrelated logic alone.
- Verify — run the project's tests (, or
nf-test test) to confirm behavior is unchanged before declaring the migration done.nextflow run . -profile test,docker -resume
无论加载哪份参考文件,以下规则均适用。每份参考文件会添加各自迁移类型的特定规则。
- 先检测再编辑——遵循参考指南确定需要修改的内容。切勿猜测。
- 保留原有行为——迁移是让代码适配新的语言要求,而非重构。应用最小的修改来解决每个问题,不要改动无关逻辑。
- 验证——运行项目的测试(,或
nf-test test),确认行为未发生变化后再宣布迁移完成。nextflow run . -profile test,docker -resume