Skip to content
Development
Command

/writ-approve

Advance the current Writ workflow phase. Replaces pattern-match "approved" detection with an explicit tool-confirmed advance (plan Section 8.1).

From plugin
writ
1731 skill5 agents1 command12 hooks
Install
> /plugin marketplace add infinri/Writ
> /plugin install writ@writ

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/writ-approve

Context preview

What this command does when you run it.

Advance the current Writ workflow phase. Replaces pattern-match "approved" detection with an explicit tool-confirmed advance (plan Section 8.1).

Command definition

writ-approve.md
name: writ-approve
description: Advance the current Writ workflow phase. Replaces pattern-match "approved" detection with an explicit tool-confirmed advance (plan Section 8.1).

You have been invoked to advance the Writ workflow phase. Confirm the user's intent is to advance, then run this command via Bash.

Procedure

1. Check the current phase via `GET /session/$SESSION_ID/current-phase`. 2. 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." 3. Advance via POST, passing the gate token. The token at `/tmp/writ-gate-token-$SESSION_ID` is written by the approval hook ONLY when the user's prompt matched an approval pattern, so it proves genuine user approval; the advance route now requires it and consumes it (one approval = one advance):

`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 made every planning advance fail closed on an empty root and spend the approval token.

TOKEN=$(cat "/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.

4. Confirm to the user: "[Writ: $ARG advanced → $NEW_PHASE]" where $ARG is what they approved (design / plan / tests) and $NEW_PHASE is the new phase name from the response. Also report the response's `validated` and `project_root` fields verbatim, so the user can see WHICH plan.md was accepted and catch a wrong project root.

Audit trail

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.

Never

  • Never advance without this command (or its MCP equivalent `writ_approve`). Pattern match on "approved" in user prompts is defence in depth, not the primary path.
  • Never advance multiple phases in a single invocation. One call = one advance.
  • Never fabricate approval. If the user has not explicitly authorized, ask them before calling.
Read more
Ships withwrit

A Claude Code harness that enforces engineering discipline at the moment the AI acts, and delivers the rules that fit the work in front of it.

Get the whole plugin
Stats
174
Stars
13
Forks
Active
Maintenance
Python
Language
MIT
License
1d ago
Last commit
4mo ago
Created

Repo: infinri/Writ