Skip to content

Build1 publisher2 min readPublished

sdlc-playbooks enforces coding-agent phase rules with a gate script that aborts on exit code 2

sdlc-playbooks runs a gate script before each of its seven coding-agent phases, and a failed precondition aborts the Claude Code command with exit code 2. The check binds only at that entry point, so direct script calls and other editing paths still need their own controls.

The Engineer · Build desk

What happened

  • The author of sdlc-playbooks published a file-based delivery procedure for coding agents that runs in Claude Code and Codex from one source.
  • The procedure has seven phases, from locking a design system to reviewing a change, and each phase has exactly one playbook and one gate.
  • Each phase starts by running a Node gate script that checks preconditions against the repo and exits 2 with a named reason and a fix when one fails.
  • An earlier version with separate agent persona definitions was dropped, leaving the playbook as the single place each procedure is maintained.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • decision Adopters have to design their own guards for direct script calls and other editing paths, because the gate fires only where a command file invokes it.
  • capability Teams can drop or swap the agent tooling mid-project without losing agreed state, since a human can finish the job from the artifacts left in the repo.
  • cost Gating does not remove the human reviewer: each project still pays a person to judge whether requirements and results are right, because scripts only catch missing or inconsistent files.

When someone invokes /approve in Claude Code, the command file runs one line before any instruction text: `` !`node .claude/tools/gate.mjs approve $0 $1 2>&1` `` [5]. Claude Code expands that line as shell before the model reads further, and a non-zero exit aborts the command [5]. The two positional arguments pass straight to the gate, and `2>&1` merges its error output into standard output [5].

The old version of /approve said: "This command represents a human decision. Do not run it on your own judgment." [7] It asked the model to use its judgment about when to withhold its judgment. "A rule written only as prose for a model to honour will eventually be skipped," the author wrote [3].

The phase 5 contract shows which rules become checks [12]. Its gate is `node .claude/tools/gate.mjs implement ST-###` [12]. Its done-condition is mechanical: every `verify.commands` entry green and the story marked in-review [12]. Its Never row, which forbids copying the prototype into the product, is still a sentence [12].

The enforcement covers one entry point. On failure, the playbook instructs the agent to stop, and the author says direct script calls and other editing paths still need their own controls [6]. That stop instruction is prose, the category the author expects models to skip [3]. The procedure runs in Claude Code and in Codex from one source [1], but the post does not say how the gate is enforced in Codex.

The part I would copy first is the state model, because a gate script can only test what has been written to the repo [4]. Handoffs go through saved artifacts: acceptance criteria feed prototyping, an approved snapshot feeds planning and implementation, and the plan and code feed review [9]. The next phase can start in a fresh session, with no persona or conversation history to reconstruct [9]. "Keeping two copies of a rule means you have one rule and one future contradiction," the author wrote of the dropped persona files [14].

The case for the pattern rests on the author's experience, in which the usual failure is "a feature nobody specified, built from a design nobody approved, against a mock-up that changed after the work started" [13]. For it to transfer, a team's agent has to enter every phase through a command that runs the gate. Each precondition also has to reduce to files that exist and agree with each other. Approval is the hard case. Phase 3 freezes a snapshot and cuts stories only after a human approves the prototype [15].

What to watch

  • Whether the author documents how the same gate is enforced when the playbooks run in Codex.
  • Whether sdlc-playbooks adds controls for the direct script calls and other editing paths that the command-entry gate does not cover.
  • Any count of runs blocked by gates against prose rules skipped, which would test the central claim beyond one author's experience.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories