Walk through a training tutorial as a user would, progressively building examples exactly as instructed, running all commands, and verifying results against solutions...
Walk through a training tutorial lesson as a learner would, progressively building code, running commands, and verifying the learning journey works end-to-end.
If you are the top-level invocation of this skill (nobody has handed you a lesson-scoped brief already), you are the coordinator, not the walker. Your job is orchestration only: resolve mode and environment via AskUserQuestion, read the lesson once to identify the sections in scope, then jump to Delegation Pattern and spawn a subagent per lesson to actually execute Phases 1-3. Everything from "Skill Dependencies" through "Phase 4" below is written for that subagent, not for you. If you notice yourself calling /validate, /docker-setup, /check-highlights, /check-inline-code, /test-example, or raw Bash (grep, docker, nextflow, nf-test, ...) yourself, stop - that work belongs in the delegated subagent, and doing it inline recreates the exact context bloat delegation exists to avoid.
This skill supports two distinct modes. Ask the user which mode if not clear from context:
Walk through as a learner would, editing starter files progressively. Use when:
Run solution files and verify documentation matches actual outputs. Use when:
Key difference: In Mode A, you progressively edit starter files (then reset). In Mode B, you run solutions directly and check docs for accuracy.
Starter files (e.g., hello-nextflow/hello-config.nf) represent the end state of the previous chapter. They are the starting point for learners beginning a new lesson.
| Scenario | Action |
|---|---|
| Bug or syntax error inherited from previous chapter | β Fix and commit |
| Changes made while running through exercises | β Reset before committing |
If you modified starter files while walking through exercises, reset them:
git checkout hello-nextflow/*.nf
Only keep changes to:
solutions/**/*) - these should be correct and completedocs/**/*.md) - fix code snippets, outputs, examplesThis walkthrough MUST invoke other skills. Do not skip these.
| Checkpoint | Skill | Condition |
|---|---|---|
| Before Phase 2 | /docker-setup |
If Docker environment selected |
| Before Phase 2 | /validate |
Always - check lesson structure first |
| Phase 3 | /test-example |
For each solution file |
Run this skill as a coordinator, not a single long-lived session that inlines every command and every line of terminal output. A multi-section walkthrough that captures raw nextflow run output inline, for every section, in one context, burns most of its budget on transcripts that are only useful for the few seconds it takes to compare them against the docs.
Agent tool (general-purpose is sufficient; this is read-heavy comparison work, not judgment work that needs a stronger model). Brief it with the lesson file path, the mode (A or B), the working directory from repo-conventions.md, and the exact per-section report shape from Output Format. It runs /validate, the progressive build/execution, and /test-example itself, and does the Before/After and hash-consistency comparisons itself; it returns the structured report, not the raw terminal output. The coordinator reads the report, not the transcript. Splitting Phase 1 into its own separate subagent (so its /validate report can be reused across lessons before committing to Phase 2/3) is a fine variant when you're validating several lessons up front - but Phase 1 must still land in some subagent, never in the coordinator's own context.Skill tool - /docker-setup, /validate (which itself mandates /check-highlights and /check-inline-code), /test-example - rather than approximate the same logic by eye. A subagent that manually recounts hl_lines instead of invoking /check-highlights has not satisfied that checkpoint, even when its count turns out correct. Require the subagent's report to name which skills it actually invoked, not just state a result.grep, an hl_lines count, a hash-consistency check) can instead be confirmed directly by rerunning that check. See pr-workflow.md for the full procedure: what evidence the verifier gets, what it must reproduce, the completeness check, and the two-attempt bound before surfacing an unresolved fix to the user.Use AskUserQuestion to determine:
If Docker selected:
>>> STOP. INVOKE /docker-setup NOW.
Do not proceed until the container is confirmed running.
If existing environment: Verify Nextflow is installed with nextflow -version
Always use the strict syntax parser when running Nextflow commands:
NXF_SYNTAX_PARSER=v2 nextflow run ...
In Docker:
docker exec -e NXF_SYNTAX_PARSER=v2 nf-training nextflow run ...
This validates tutorials against the strict syntax that will become default in future Nextflow versions.
Nextflow 26.04+ detects Claude Code (via the CLAUDECODE environment variable) and switches to a machine-readable "agent mode" console format that no learner ever sees. Every direct nextflow run invocation must force human mode, or any console output copied into documentation will not match reality:
env -u CLAUDECODE NXF_AGENT_MODE=false nextflow run ...
In Docker, this is not needed since containers don't inherit the host shell's CLAUDECODE variable β but see Console Output Mode in repo-conventions for the full explanation before assuming that holds in every setup.
See ../shared/repo-conventions.md for full directory mapping table.
Key pattern: documentation uses underscores (hello_nextflow), working directories use hyphens (hello-nextflow).
When verifying documentation (especially in Mode B), watch for these frequent problems:
.process instead of .nameparams.greeting vs params.input'file.csv' vs 'data/file.csv'nextflow config output examples must match what the config actually producesWhile your actual hashes will differ from documented ones, check that docs are internally consistent:
[j6/abc123] contain invalid characters (only 0-9, a-f allowed)nextflow run commands showing identical hashes (unless cached)hl_lines highlight the correct lines (count from line 1 of snippet, not linenums)Use TodoWrite to track progress through phases and sections.
>>> STOP. INVOKE /validate on the lesson file NOW.
Record any issues found. Do not proceed to Phase 2 until validation completes.
Complete steps 2.1-2.6 for each section before moving to the next. Do not batch sections together.
For each numbered section in the lesson:
Before applying any code change:
Edit tool to make incremental changes, mimicking how a learner would typeBash toolBefore moving to the next section:
TodoWrite to mark section completeFor documentation verification mode, skip progressive editing of starter files. Instead:
env -u CLAUDECODE NXF_AGENT_MODE=false nextflow run solutions/<lesson>/script.nf -c solutions/<lesson>/nextflow.config
env -u CLAUDECODE NXF_AGENT_MODE=false nextflow run solutions/<lesson>/script.nf -c solutions/<lesson>/nextflow.config -profile test
env -u CLAUDECODE NXF_AGENT_MODE=false nextflow run solutions/<lesson>/script.nf -c solutions/<lesson>/nextflow.config -profile my_laptop,test
nextflow config -profile <profiles>
Compare output against documented nextflow config examples in the lesson.
For each documented output block:
Run these checks on ALL documentation files in scope:
# 1. Check for invalid hex characters in hashes
grep -oE '\[[^]]+\]' docs/path/to/*.md | grep -Ev '^\[[0-9a-f]{2}/[0-9a-f]{6}\]$' | head -20
# 2. Find duplicate hashes (may indicate copy-paste errors)
grep -oE '\[[0-9a-f]{2}/[0-9a-f]{6}\]' docs/path/to/*.md | sort | uniq -c | sort -rn | head -20
For any duplicates found, verify they are legitimate:
-resume showing cached results from earlier in same lesson (acceptable)nextflow run commands without -resume (NOT acceptable - flag as issue)See references/acceptable-differences.md for detailed hash validation rules.
After completing all sections:
Read the solution file and compare with what was built. Minor differences (whitespace, comments) may be acceptable. Report any significant differences.
>>> STOP. INVOKE /test-example on each solution file.
For each solution script, verify:
- Fresh run works
- Resume caches correctly
- Parameter handling (if applicable)
- Output matches documentation
Record results before proceeding.
Only if walkthrough succeeded with no issues:
git checkout "${WORKING_DIR}/"If issues found: Leave files in place for Phase 4. Save work directory paths for troubleshooting.
If fixable issues were identified, follow references/pr-workflow.md to create a PR.
Key points:
AskUserQuestion before making changesStructure your report with these sections:
# Tutorial Walkthrough: <lesson-name>
## Environment
Mode, Nextflow version, working directory
## Section N: <exact title from document>
- State verification: matches "Before" β or mismatch details
- Code changes applied
- Commands run with results
## Validation Results (from /validate)
## Solution Tests (from /test-example)
## Solution Comparison
## Summary
Sections completed, mismatches, failures, discrepancies
## Issues Found
Categorize as Critical / Warning / Minor
## Proposed Fixes (if any)
Table with file, line, current, proposed, reason
# Documentation Verification: <module-name>
## Environment
Container name, Nextflow version, working directory
## Solutions Tested
| Solution | Base Run | With Profiles | Issues |
|----------|----------|---------------|--------|
| 1-hello-world | β | N/A | None |
| 6-hello-config | β | β test | Fixed: .processβ.name |
## Hash Consistency Check
- Invalid hex characters found: [list or "None"]
- Duplicate hashes across different runs: [list or "None - all legitimate"]
- Prose/output mismatches: [list or "None"]
## Documentation Issues Found
### Critical (breaks functionality)
- File: `06_hello_config.md`, Lines 893-931
- Issue: `.process` property doesn't exist, should be `.name`
- Also affects: `solutions/6-hello-config/hello-config.nf`
### Minor (cosmetic/clarity)
- ...
## Fixes Applied
| File | Change | Reason |
|------|--------|--------|
| docs/.../06_hello_config.md | `.process` β `.name` | Property doesn't exist |
| solutions/.../nextflow.config | `params.greeting` β `params.input` | Wrong parameter name |
| docs/.../03_config.md | `[f0/35723c]` β `[2b/9a7d1e]` | Duplicate hash for different run |
When encountering ??? exercise blocks:
??? solution blockSome tutorials have optional paths: