Bio Prefect + Dask + Nextflow
This skill helps an agent design, scaffold, and harden bioinformatics pipelines across:
- Local workstation/laptop (Prefect + Dask LocalCluster)
- HPC clusters (Nextflow executors; or Prefect → Slurm worker patterns)
- Hybrid patterns (Prefect orchestrates metadata/approvals/notifications; Nextflow runs heavy compute)
Use this skill when
- The user mentions Prefect, Dask, Nextflow, HPC, Slurm, PBS, nf-core, or “bioinformatics pipeline”.
- The user needs parallelism, distributed execution, retries, scheduling, reproducible runs, or “local prototype then scale”.
Outputs this skill should produce
When activated, the agent should return (and/or generate in a repo):
- Engine choice:
prefect+dask, nextflow, or hybrid, with rationale.
- Runnable scaffold (files + commands) for the chosen engine.
- Resource plan per step (cpus/mem/time) + I/O layout (scratch vs shared).
- Validation plan: tiny test run + failure/retry + resume test.
- Pitfalls & mitigations: what will likely break on HPC and why.
2-minute decision
Use the decision matrix for nuance: decision-matrix.md
Default heuristics:
- Choose Nextflow if the pipeline is mainly CLI tools over files, must run on HPC schedulers, and reproducibility/caching are top priorities.
- Choose Prefect + Dask if the pipeline is mainly Python functions, needs dynamic branching, API/DB integration, or interactive development.
- Choose Hybrid if Prefect should own the “outer loop” (metadata, batching, approvals, notifications) while Nextflow owns “inner loop” compute.
Standard workflow (agent playbook)
- Requirements intake
- Scheduler type (Slurm/PBS/LSF/etc), queue/partition rules, walltime limits, node topology.
- Container policy (Docker vs Singularity/Apptainer vs no containers) and module/conda availability.
- Data location and throughput constraints (shared FS vs scratch, object storage).
- Parallelism shape (many independent samples? big distributed arrays? long single jobs?).
- Choose engine using decision-matrix.md; state assumptions.
- Scaffold the project
- Prefect path → prefect-dask.md and (if needed) prefect-hpc-slurm.md
- Nextflow path → nextflow-hpc.md
- Implement steps with replayable boundaries
- Each step idempotent; deterministic output paths.
- Pass around paths/URIs, not giant in-memory objects.
- Add operational glue
- Logging, retries/timeouts, resource hints, output manifest.
- Validate locally
- Tiny dataset run + forced failure + resume/retry test.
- Scale to HPC
- Confirm filesystem layout, job submission permissions, and environment bootstrap.
Response template
Use this template in your final answer to the user:
# Pipeline plan: [name]
## Recommended engine
- Choice: [prefect+dask | nextflow | hybrid]
- Why: [3–6 bullet rationale]
## Project scaffold
- Files to create:
- ...
- Commands to run:
- ...
## Execution model
- Parallelism strategy:
- Resource plan (per step):
- Data layout (work/results/cache):
## Pitfalls & mitigations
- ...
## Validation checklist
- ...
Deep references (read as needed)
- Engine comparison and “when to use what”: decision-matrix.md
- Prefect + Dask local patterns: prefect-dask.md
- Prefect on Slurm + Dask-on-HPC options: prefect-hpc-slurm.md
- Nextflow on HPC (executors, modules, resume/cache): nextflow-hpc.md
- Examples (Prefect-only, Nextflow-only, Hybrid): examples.md
- Validation loop + common failure modes: validation-checklist.md
1---2name: bio-prefect-dask-nextflow3description: Designs and scaffolds bioinformatics pipelines using Prefect (Python) with Dask for local/distributed task execution and Nextflow for HPC scheduler-native execution. Use when an agent must choose between Prefect+Dask vs Nextflow, generate runnable project skeletons, or adapt workflows for laptops, workstations, and HPC clusters (e.g., Slurm/PBS) with reproducibility, caching/resume, and resource-aware configuration.4---5
6# Bio Prefect + Dask + Nextflow
7
8This skill helps an agent design, scaffold, and harden bioinformatics pipelines across:
9- **Local workstation/laptop** (Prefect + Dask LocalCluster)
10- **HPC clusters** (Nextflow executors; or Prefect → Slurm worker patterns)
11- **Hybrid** patterns (Prefect orchestrates metadata/approvals/notifications; Nextflow runs heavy compute)
12
13## Use this skill when
14- The user mentions **Prefect**, **Dask**, **Nextflow**, **HPC**, **Slurm**, **PBS**, **nf-core**, or “bioinformatics pipeline”.
15- The user needs **parallelism**, **distributed execution**, **retries**, **scheduling**, **reproducible runs**, or “local prototype then scale”.
16
17## Outputs this skill should produce
18When activated, the agent should return (and/or generate in a repo):
191. **Engine choice**: `prefect+dask`, `nextflow`, or `hybrid`, with rationale.
202. **Runnable scaffold** (files + commands) for the chosen engine.
213. **Resource plan** per step (cpus/mem/time) + I/O layout (scratch vs shared).
224. **Validation plan**: tiny test run + failure/retry + resume test.
235. **Pitfalls & mitigations**: what will likely break on HPC and why.
24
25## 2-minute decision
26Use the decision matrix for nuance: [decision-matrix.md](decision-matrix.md)
27
28Default heuristics:
29- Choose **Nextflow** if the pipeline is mainly **CLI tools over files**, must run on **HPC schedulers**, and reproducibility/caching are top priorities.
30- Choose **Prefect + Dask** if the pipeline is mainly **Python functions**, needs **dynamic branching**, API/DB integration, or interactive development.
31- Choose **Hybrid** if Prefect should own the “outer loop” (metadata, batching, approvals, notifications) while Nextflow owns “inner loop” compute.
32
33## Standard workflow (agent playbook)
341. **Requirements intake**
35 - Scheduler type (Slurm/PBS/LSF/etc), queue/partition rules, walltime limits, node topology.
36 - Container policy (Docker vs Singularity/Apptainer vs no containers) and module/conda availability.
37 - Data location and throughput constraints (shared FS vs scratch, object storage).
38 - Parallelism shape (many independent samples? big distributed arrays? long single jobs?).
392. **Choose engine** using [decision-matrix.md](decision-matrix.md); state assumptions.
403. **Scaffold the project**
41 - Prefect path → [prefect-dask.md](prefect-dask.md) and (if needed) [prefect-hpc-slurm.md](prefect-hpc-slurm.md)
42 - Nextflow path → [nextflow-hpc.md](nextflow-hpc.md)
434. **Implement steps with replayable boundaries**
44 - Each step idempotent; deterministic output paths.
45 - Pass around *paths/URIs*, not giant in-memory objects.
465. **Add operational glue**
47 - Logging, retries/timeouts, resource hints, output manifest.
486. **Validate locally**
49 - Tiny dataset run + forced failure + resume/retry test.
507. **Scale to HPC**
51 - Confirm filesystem layout, job submission permissions, and environment bootstrap.
52
53## Response template
54Use this template in your final answer to the user:
55
56```markdown
57# Pipeline plan: [name]
58
59## Recommended engine
60- Choice: [prefect+dask | nextflow | hybrid]
61- Why: [3–6 bullet rationale]
62
63## Project scaffold
64- Files to create:
65 - ...
66- Commands to run:
67 - ...
68
69## Execution model
70- Parallelism strategy:
71- Resource plan (per step):
72- Data layout (work/results/cache):
73
74## Pitfalls & mitigations
75- ...
76
77## Validation checklist
78- ...
79```
80
81## Deep references (read as needed)
82- Engine comparison and “when to use what”: [decision-matrix.md](decision-matrix.md)
83- Prefect + Dask local patterns: [prefect-dask.md](prefect-dask.md)
84- Prefect on Slurm + Dask-on-HPC options: [prefect-hpc-slurm.md](prefect-hpc-slurm.md)
85- Nextflow on HPC (executors, modules, resume/cache): [nextflow-hpc.md](nextflow-hpc.md)
86- Examples (Prefect-only, Nextflow-only, Hybrid): [examples.md](examples.md)
87- Validation loop + common failure modes: [validation-checklist.md](validation-checklist.md)
88