/writ:writ-approvefrom writ
Advances the current Writ workflow phase by spending a tool-confirmed approval token. Requires a token minted by exact approval detection; fails closed if no token is present.
Ships in writ. Installing the plugin adds it to Claude Code.
You have been invoked to advance the Writ workflow phase. Confirm the user's intent is to advance, then run this command via Bash.
This command does NOT detect approval, and it cannot substitute for detection. Step 3
below reads the gate token, and the ONLY thing that writes that token is
auto-approve-gate.sh when the user's own prompt classified as an exact approval. So on
a detection miss there is no token, this command has nothing to send, and the advance
fails closed. The description used to claim this command replaced pattern matching, which
was never true of its own procedure.
The detector has three tiers (bin/lib/approval_match.py):
Check the current phase via GET /session/$SESSION_ID/current-phase. The response also
reports next_gate (the gate a token would be bound to) and plan_hash.
If the current phase artifact exists and was presented to the user in this or a prior turn (plan.md for planning, test skeletons for testing, etc.), proceed. Otherwise, respond: "No current phase artifact to approve. Present the artifact first."
Advance via POST, passing the gate token and the working directory. The token at
/tmp/writ-gate-token-$SESSION_ID is written by the approval hook ONLY when the
user's prompt matched an exact approval pattern, so it proves genuine user approval; the
advance route requires it and consumes it (one approval = one advance).
The token file has THREE lines: the secret, the gate that approval authorizes, and the plan fingerprint it was given for. Send LINE ONE ONLY. The advance route checks lines two and three itself: a token bound to a different gate, or to a plan.md that has changed since the approval, is refused with the reason named.
cwd MUST be sent: the server resolves the project root from it (that is where
plan.md and the test skeletons are looked for), and it cannot substitute its own
working directory, which is Writ's install dir. Omitting it makes a planning advance
fail closed on an empty root.
TOKEN=$(head -1 "/tmp/writ-gate-token-$SESSION_ID" 2>/dev/null)
curl -sX POST http://localhost:8765/session/$SESSION_ID/advance-phase \
-H 'Content-Type: application/json' \
-d "{\"confirmation_source\": \"tool\", \"token\": \"$TOKEN\", \"cwd\": \"$(pwd -P)\"}"
If the response is {"advanced": false, ...} with a token error, the user has not
actually approved this turn (no token was written). Do NOT retry or fabricate a token:
tell the user the approval was not detected and ask them to confirm explicitly.
validated and project_root fields verbatim, so the user can see WHICH plan.md was accepted and catch a wrong project root.Each advance is recorded to session.phase_transitions with confirmation_source: "tool" AND appended to workflow-friction.log as a phase_advance event. Phase 5 telemetry distinguishes tool-confirmed from pattern-confirmed advances for rubric refinement.
writ_approve). Pattern match on "approved" in user prompts is the channel that mints the authorization, and it is what advances the gate on an exact match.What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub infinri/writ --plugin writOther plugins' commands for the same job