Skip to content
youdede

Phase Gate Guard

DevelopmentHookv1.0.0

Guard the reserved .youdede/phases/ evidence directory so a phase advances only when its predecessor's evidence file exists, parses, and carries a matching phase, a real summary, and non-empty anchors. Unknown filenames, malformed evidence, and unsafe predecessors are blocked.

Runs on

Scope
$npx @youdede/toolkit add phase-gate-guard --target claude-code

What it does

Block phase evidence writes unless the previous phase in the spec-design-tasks-implementation chain exists and is valid.

When it fires

  • planning
  • implementation

How it behaves

Evaluate Write and Edit calls against the reserved phase-evidence directory and block invalid phase advancement.

It does not judge the quality of any phase document; it verifies only the predecessor chain's presence and validity.

It does not inspect, block, or observe writes outside the reserved .youdede/phases/ directory.

It does not execute submitted content, call an LLM, download dependencies, or transmit inspected data.

It does not treat an unreadable, symlinked, or oversized predecessor file as valid evidence.

Configuration

targets/claude-code/phase-gate-guard.mjsnode · none

Version
1.0.0
Requires
node
Licence
RiskThis automatic gate blocks phase evidence writes unless the previous phase in the spec-design-tasks-implementation chain exists and is valid; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyThe entrypoint handles one intercepted event to block phase evidence writes unless the previous phase in the spec-design-tasks-implementation chain exists and is valid without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained
In packs
  • Plan and verify loop

Often used with

All in Development