snakemake
Create, run, debug, deploy, and programmatically inspect Snakemake 9.23.1 workflows, including Snakefile authoring, CLI execution, configuration/data validation, deployment/storage, reporting/testing, and Python API/plugin usage.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- snakemake
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Create, run, debug, deploy, and programmatically inspect Snakemake 9.23.1 workflows, including Snakefile authoring, CLI execution, configuration/data validation, deployment/storage, reporting/testing, and Python API/plugin usage.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/installation-and-capabilities.md3.0 KB
- 参考文档references/repo-provenance.md2.1 KB
- 参考文档references/repo-routing-metadata.json316 B
- 参考文档references/troubleshooting.md3.3 KB
- 脚本scripts/check_snakemake_install.py2.9 KB
03 SKILL.md 正文
Snakemake
Use this skill when a user asks for help with Snakemake workflows: writing or refactoring Snakefiles, constructing safe execution commands, validating configs and sample metadata, using conda/containers/storage/executors, generating diagnostics/reports/tests, or embedding Snakemake through its Python API.
Start Here
- Identify whether the user is changing a workflow definition, running an existing workflow, validating inputs, configuring deployment/storage, debugging/reporting, or writing Python integration code.
- Confirm the installed Snakemake generation when commands or APIs matter: this skill targets Snakemake 9.23.1.
- Prefer non-mutating checks first:
snakemake --cores 1 --dry-run --printshellcmds,snakemake --lint, DAG/rulegraph/summary commands, or the bundled smoke scripts. - Do not add the legacy
--reasonflag. Snakemake 9.23.1 rejects it; dry-run output already prints job reasons. - Keep workflow-generated artifacts separate from DisCo artifacts; Snakemake unit-test outputs such as
.tests/unitare user workflow files, not repo-skill review files.
Route by Task
- Write or refactor Snakefiles: use
sub-skills/workflow-authoring/SKILL.mdfor rules, wildcards, directives, helper functions, modules, checkpoints, includes, scripts, notebooks, wrappers, CWL hooks, and authoring-time failures. - Run or scale workflows from CLI: use
sub-skills/execution-cli/SKILL.mdfor dry-runs, targets, cores/jobs/local cores, profiles, resources, batches, groups, DAG/rulegraph/summary inspection, schedulers, reruns, locks, and smoke checks. - Configure workflows and validate data: use
sub-skills/configuration-data/SKILL.mdforconfigfile,--config,--configfile, profiles as config sources, schemas, sample tables, PEP metadata, pathvars, envvars, YTE, and data-driven helpers. - Deploy software or storage: use
sub-skills/deployment-storage/SKILL.mdfor conda, Apptainer/Singularity, env modules, storage providers/prefixes, shared filesystem usage, executor/jobscript surfaces, archives, and deployment caches. - Debug, report, and test: use
sub-skills/debugging-reporting/SKILL.mdfor linting, DAG/rulegraph/filegraph outputs, reports, notebooks, generated unit tests, benchmarking, runtime profiles, failed logs, and diagnostic bundles. - Embed Snakemake in Python: use
sub-skills/python-api-plugins/SKILL.mdforSnakemakeApi,WorkflowApi,DAGApi, settings dataclasses, plugin settings, and CLI-to-API translation.
Install Baseline
For a new public environment, start with pip install snakemake or the user's package-manager equivalent, then verify both the console script and Python module before running workflow commands. Optional integrations such as PEP metadata, reports, storage plugins, executor plugins, conda, and containers can require extras, separate plugins, external binaries, credentials, or site profiles.
Shared References
- Read
references/installation-and-capabilities.mdbefore making environment, optional dependency, CLI availability, or plugin capability claims. - Read
references/troubleshooting.mdfor cross-cutting install/import, optional dependency, CLI/API, and version-mismatch failures. - Read
references/repo-provenance.mdwhen deciding whether this skill is stale relative to a checked-out Snakemake repository. - Run
scripts/check_snakemake_install.py --helpto inspect a candidate Snakemake executable or Python module without depending on any original repository examples.
Safety Defaults
- Use dry-runs, explicit targets, low
--cores, and temporary workdirs before modifying outputs. - Avoid executing workflows that download data, create conda environments, start containers, access remote storage, require credentials, or run long benchmarks unless the user explicitly approves.
- Treat cloud/storage/executor integrations as plugin- and credential-dependent; verify the plugin and credential surface before promising execution.
- Route shell/script/notebook failures to the owning workflow sub-skill first, then use debugging/reporting for lint, graphs, reports, or generated tests.
Minimal Checks
python -m snakemake --help
snakemake --help
snakemake --cores 1 --dry-run --printshellcmds
python scripts/check_snakemake_install.py --command snakemake
For Python API checks, use sub-skills/python-api-plugins/scripts/api_dryrun_example.py in an environment where snakemake is importable.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).