Three deterministic gate checks for agent pipelines. One python3 file, standard library only, no installs. Every check prints what it measured and exits 0 when clean, 1 on any failure, so an orchestrator or a Claude Code hook can branch on the exit code and nothing else. A gate that returns an adjective is not a gate.
This repo is the free slice of Claude Code Pipeline Patterns (NerdyChefs), a 12-pattern method for running Claude Code, or any orchestrating coding agent, as a gated pipeline instead of one long hopeful session.
A pipeline is a fixed sequence of stages. Each stage runs in a fresh context and produces exactly one artifact: a file on disk, never a promise in a chat window. Between stages sits a gate: a deterministic check that the artifact meets its contract. Every gate event appends one machine-parseable line to a ledger, and the current stage is always the lowest stage without a logged PASS. When a gate says FAIL, the work goes back exactly one stage with the evidence attached; that move is fail-back. Stages, artifacts, gates, ledger, fail-back. Everything else is detail.
| Path | What it is |
|---|---|
gate_scripts.py |
The three gate checks (ledger, manifest, textcheck) plus --selftest. |
patterns/stage-gate-orchestrator.md |
Pattern 1 of 12, the full card: prompts, gate check, fail-back rule. |
examples/example-status-ledger-v1.md |
A real six-line gate log from a product shipped on July 3, 2026. |
examples/example-manifest-v1.md |
A live manifest; this repo checks itself with it. |
python3 and this repo. All four commands below exit 0 from the repo root, as shipped.
# validate a STATUS-style gate log, line by line, against the gate-line grammar
python3 gate_scripts.py ledger examples/example-status-ledger-v1.md
# check a manifest's claims (exists, min-bytes:N, contains:<string>) against real files
python3 gate_scripts.py manifest examples/example-manifest-v1.md
# flag sentences over a word cap; a template rule, swap in your own structural check
python3 gate_scripts.py textcheck patterns/stage-gate-orchestrator.md --max-words 40
# the script gates itself: fixtures for all three checkers, asserted exit codes
python3 gate_scripts.py --selftestWire any of the three as a Claude Code hook or as the gate between two pipeline stages. The exit code is the whole interface.
This exact tooling ran the pipeline that shipped two complete digital products in one day, July 3, 2026, with 12 gate PASS lines logged. The ledger in examples/ is one of those products' logs, counts and file names intact; a stranger could re-run any line and land on the same verdict. In a controlled comparison, a gated run and an ungated run of the same task both returned 6/6 compliant prompt cards. The tie is the finding: the gated run knew its 6/6, the ungated run got lucky. Checking is the product.
Pattern 1 rides here free, prompts unmodified. The paid kit, Claude Code Pipeline Patterns ($49), adds:
- the 11 remaining pattern cards, each with orchestrator prompt, subagent prompts, gate check, fail-back rule
- the 28-page book (PDF and EPUB), its 26 prompt fences verified byte-identical to the cards file by script, 26/26
- the pipeline design worksheet plus the gate-design checklist
- a working Claude Code gate hook example
Get it here: Claude Code Pipeline Patterns, $49
The method rides on capabilities most orchestrating coding agents already have: spawn a fresh worker, run a script, read a project memory file. No framework dependency, so the patterns port beyond Claude Code. This is an independent publication, not affiliated with or endorsed by Anthropic.
The code (gate_scripts.py) is MIT, see LICENSE. The pattern card text under patterns/ is CC BY-SA 4.0, the house convention for prompt content.