pincer-workflow 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +6 -2
  2. package/bin/pincer.js +1 -1
  3. package/package.json +2 -2
  4. package/template/.agents/skills/pincer-code/SKILL.md +46 -4
  5. package/template/.agents/skills/pincer-evaluate/SKILL.md +64 -13
  6. package/template/.agents/skills/pincer-narrow/SKILL.md +46 -7
  7. package/template/.agents/skills/pincer-plan/SKILL.md +30 -1
  8. package/template/.agents/skills/pincer-release/SKILL.md +17 -3
  9. package/template/.agents/skills/pincer-status/SKILL.md +5 -3
  10. package/template/.claude/commands/pincer-code.md +46 -4
  11. package/template/.claude/commands/pincer-evaluate.md +64 -13
  12. package/template/.claude/commands/pincer-narrow.md +46 -7
  13. package/template/.claude/commands/pincer-plan.md +30 -1
  14. package/template/.claude/commands/pincer-release.md +17 -3
  15. package/template/.claude/commands/pincer-status.md +5 -3
  16. package/template/.claude/hooks/hook-policy.cjs +101 -8
  17. package/template/.claude/references/prd-template.md +38 -6
  18. package/template/.claude/references/ticket-template.md +15 -0
  19. package/template/.github/prompts/pincer-code.prompt.md +46 -4
  20. package/template/.github/prompts/pincer-evaluate.prompt.md +64 -13
  21. package/template/.github/prompts/pincer-narrow.prompt.md +46 -7
  22. package/template/.github/prompts/pincer-plan.prompt.md +30 -1
  23. package/template/.github/prompts/pincer-release.prompt.md +17 -3
  24. package/template/.github/prompts/pincer-status.prompt.md +5 -3
  25. package/template/AGENTS.md +9 -2
  26. package/template/docs/dry-run-checklist.md +126 -14
  27. package/template/docs/release-checklist.md +6 -5
  28. package/template/scripts/pincer-evidence.cjs +292 -0
  29. package/template/scripts/pincer-status.sh +21 -5
  30. package/template/scripts/pincer-ticket-lib.sh +56 -5
  31. package/template/scripts/pincer-ticket.sh +1 -1
package/README.md CHANGED
@@ -86,7 +86,7 @@ want the repo-side rules too can copy `AGENTS.md` from the
86
86
  npx pincer-workflow@latest update
87
87
  ```
88
88
 
89
- Files you never touched are refreshed in place. (Installs older than v0.2.0 gain the ticket state machine, the status report and the ticket-guard hook on update; `.claude/settings.json` conflicts if you edited it — merge the new hook entry from the `.new` file. v0.2.2 replaces the Codex adapter: the commands are now skills in `.agents/skills/` invoked as `$pincer-*`, since Codex no longer loads `~/.codex/prompts/` — you can delete the copies there. v0.2.3 ships the playbooks, rubrics and templates under `.claude/` on every platform, which Codex- and Copilot-only installs were missing. v0.3.0 makes trust revocable: every verification attempt is recorded, `done` re-runs the check, tickets carry `prd:`, the release audit is read-only, and `.pincer.json` moves to schema 2 — an install from 0.2.x is treated as an untrusted baseline, so on the first update every changed file arrives as a `.new` proposal once; hooks now need Node 18+.) Files you edited are left
89
+ Files you never touched are refreshed in place. (Installs older than v0.2.0 gain the ticket state machine, the status report and the ticket-guard hook on update; `.claude/settings.json` conflicts if you edited it — merge the new hook entry from the `.new` file. v0.2.2 replaces the Codex adapter: the commands are now skills in `.agents/skills/` invoked as `$pincer-*`, since Codex no longer loads `~/.codex/prompts/` — you can delete the copies there. v0.2.3 ships the playbooks, rubrics and templates under `.claude/` on every platform, which Codex- and Copilot-only installs were missing. v0.3.0 makes trust revocable: every verification attempt is recorded, `done` re-runs the check, tickets carry `prd:`, the release audit is read-only, and `.pincer.json` moves to schema 2 — an install from 0.2.x is treated as an untrusted baseline, so on the first update every changed file arrives as a `.new` proposal once; hooks now need Node 18+. v0.4.0 carries requirement IDs and `Proves:` checks from the PRD to evaluation, adds `profile: small|standard`, and saves candidate evidence under `.prd/evidence/`; the update is additive, but an existing `NOTES.md` without an `evidence:` manifest reads as stale until `/pincer-evaluate` is re-run.) Files you edited are left
90
90
  alone — the new version lands next to them as `<file>.new` for a manual merge.
91
91
  `npx pincer-workflow doctor` checks the health of an install (hook executable,
92
92
  `.gitignore` covering `.env*`, no unmerged `*.new` files, version current).
@@ -99,7 +99,8 @@ alone — the new version lands next to them as `<file>.new` for a manual merge.
99
99
  | `.claude/commands/` | The five playbooks plus `/pincer-status` (canonical — adapters are generated from them; ships on every platform together with `agents/` and `references/`) |
100
100
  | `.claude/agents/` | `codebase-explorer` and `code-quality-reviewer` subagents, with inline fallbacks for platforms without subagents |
101
101
  | `scripts/pincer-ticket.sh` | The ticket state machine: `start` (enforces dependency order) → `verify` (runs the ticket's check, stamps a receipt only on green) → `done` (refuses without a matching receipt or with unticked criteria) |
102
- | `scripts/pincer-status.sh` | Read-only state report: current PRD, associated tickets, clock-based elapsed time, optional user budget, warnings, and next command |
102
+ | `scripts/pincer-status.sh` | Read-only state report: current PRD and profile, associated tickets, wall-clock elapsed time while work is active or against an explicit budget, evidence verdict, warnings, and next command |
103
+ | `scripts/pincer-evidence.cjs` | Read-only validator for candidate evidence (schema 1): `/pincer-evaluate` writes `.prd/evidence/prd-vN/<candidate>/manifest.json` plus logs and screenshots; status and release validate schema, references, candidate association, required results, file containment and SHA-256 digests. Legacy `NOTES.md` without a manifest is readable but never release-ready; an older runtime does not enforce this contract |
103
104
  | `.claude/hooks/` + `settings.json` | Claude guardrails for documented destructive command forms and ticket state writes; Node.js 18+ parses hook payloads structurally |
104
105
  | `.agents/skills/` · `.codex/` · `.github/` | Generated Codex skills and Copilot prompt files + platform wiring (`.codex/README.md` covers the Codex posture) |
105
106
  | `scripts/sync-prompts.sh` | Regenerates the adapters after you edit a playbook |
@@ -118,6 +119,9 @@ alone — the new version lands next to them as `<file>.new` for a manual merge.
118
119
  - **State lives in files, not in the conversation** — a new session runs
119
120
  `/pincer-status` and knows exactly where to resume; elapsed time comes from
120
121
  timestamps, not from the model's sense of time.
122
+ - **Evidence is saved, not narrated** — requirements carry stable IDs from the
123
+ PRD through tickets to evaluation, and the evaluation writes a validated
124
+ manifest under `.prd/evidence/` that release reads instead of trusting chat.
121
125
  - **Scope is a first-class artifact** — cuts are recorded, never silent.
122
126
  - **Security is threaded through every stage** — designed in at Plan, specified
123
127
  as reject-path criteria at Narrow, enforced by a pre-commit sweep at Code,
package/bin/pincer.js CHANGED
@@ -26,7 +26,7 @@ const MANIFEST_SCHEMA = 2;
26
26
  // and Copilot prompts point at them), so they ship everywhere; only Claude
27
27
  // Code's own wiring (CLAUDE.md, settings.json, hooks) is platform-specific.
28
28
  const PLATFORM_ROOTS = {
29
- common: ['AGENTS.md', 'docs/release-checklist.md', 'docs/dry-run-checklist.md', 'scripts/sync-prompts.sh', 'scripts/pincer-ticket.sh', 'scripts/pincer-ticket-lib.sh', 'scripts/pincer-status.sh', '.claude/commands', '.claude/agents', '.claude/references'],
29
+ common: ['AGENTS.md', 'docs/release-checklist.md', 'docs/dry-run-checklist.md', 'scripts/sync-prompts.sh', 'scripts/pincer-ticket.sh', 'scripts/pincer-ticket-lib.sh', 'scripts/pincer-status.sh', 'scripts/pincer-evidence.cjs', '.claude/commands', '.claude/agents', '.claude/references'],
30
30
  claude: ['CLAUDE.md', '.claude/settings.json', '.claude/hooks'],
31
31
  codex: ['.codex', '.agents'],
32
32
  copilot: ['.github'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pincer-workflow",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "PINCER — a PRD-driven agentic delivery workflow for Claude Code, Codex CLI, and GitHub Copilot. Plan · Investigate · Narrow · Code · Evaluate · Release.",
5
5
  "bin": {
6
6
  "pincer": "bin/pincer.js"
@@ -14,7 +14,7 @@
14
14
  "node": ">=18"
15
15
  },
16
16
  "scripts": {
17
- "test": "node test/smoke.test.js && node test/installer.test.js && node test/ticket.test.js && node test/validation.test.js && node test/verification.test.js && node test/recovery.test.js && node test/hooks.test.js && node test/workflow.test.js && node test/distribution.test.js"
17
+ "test": "node test/smoke.test.js && node test/installer.test.js && node test/ticket.test.js && node test/validation.test.js && node test/verification.test.js && node test/behavioral-verification.test.js && node test/evidence.test.js && node test/candidate.test.js && node test/recovery.test.js && node test/hooks.test.js && node test/workflow.test.js && node test/distribution.test.js"
18
18
  },
19
19
  "keywords": [
20
20
  "claude-code",
@@ -41,7 +41,11 @@ previously authorized work.
41
41
  conventions, and nothing else.
42
42
  3. **Verify:** `scripts/pincer-ticket.sh verify T-{NN}` — runs the Verification block and
43
43
  writes the receipt only if it exits 0. Red → fix and re-run; report the actual output,
44
- not assumptions. Green output is the definition of done, not your confidence.
44
+ not assumptions. Green output is the definition of done, not your confidence. If the
45
+ check only validated syntax or a build, say so — that is not behavioral proof. A
46
+ visual judgment is recorded separately in evaluation, not as the receipt, and a tool
47
+ the check needs but cannot run yields an explicit `unverified` result, never
48
+ fabricated output.
45
49
  4. **Self-review the diff** before committing: silent failures (empty catches,
46
50
  un-awaited promises), leftover debug code, drift from the ticket's acceptance criteria.
47
51
  Then a security sweep of the same diff:
@@ -59,8 +63,33 @@ previously authorized work.
59
63
  Inspect `git status --short`, preserve pre-existing staged work, and stage only the
60
64
  explicit paths changed for this ticket plus its ticket file. Review `git diff --cached`
61
65
  before committing as `T-{NN}: {title}`.
62
- 6. Give a one-line progress update using the elapsed figure from
63
- `scripts/pincer-status.sh` ("T-02 done, 3 remaining, 38m elapsed") and continue.
66
+ 6. Give a one-line progress update ("T-02 done, 3 remaining") and continue. Quote the
67
+ wall-clock elapsed figure from `scripts/pincer-status.sh` when it shows one it
68
+ appears while a ticket is in progress or a budget is set, and it is not a measure
69
+ of active execution time.
70
+
71
+ ## Recovering a ticket file
72
+
73
+ Ticket lifecycle fields are written only by `scripts/pincer-ticket.sh`, and the guard
74
+ also blocks shell restores that would touch ticket files from the assistant's shell:
75
+ `git checkout`/`git restore`/`git switch` naming a ticket path or a normalized
76
+ pathspec that cannot be shown to stay outside `tickets/` (the whole tree, `.`, `:/`,
77
+ `:(top)`, globs, absolute or unexpanded paths, `tickets/…` in any spelling, a
78
+ `-C tickets` prefix), force flags (`-f`, `--force`, `--discard-changes`,
79
+ `--pathspec-from-file`), `git reset --hard|--merge|--keep`, `git stash` (except
80
+ `list`, `show`, `create`, `store`), `git clean -f` without a narrow pathspec,
81
+ `git checkout-index -a` and `git read-tree -u|--reset`, including when wrapped in
82
+ `bash -c`, `eval`, `nice`, `time`, `nohup`, `timeout` or `xargs`. Restoring HEAD
83
+ would erase a newer failed attempt and revive an old passing receipt. Branch
84
+ switches and file-specific restores outside `tickets/` stay allowed. The guard is a
85
+ pattern-based safety net for documented mistake forms, not a complete shell
86
+ boundary; the receipt and status checks remain the source of trust. When a ticket file is malformed or its state was hand
87
+ edited, preserve the malformed contents as they are, report the validation error that
88
+ the script or `scripts/pincer-status.sh` printed, and hand the repair to the user, who
89
+ performs it in their own terminal. Then return through the lifecycle — `start`,
90
+ `verify`, `done` — so the ticket carries fresh verification; a restored receipt is
91
+ never evidence. Do not recommend restoring source files or unrelated edits as routine
92
+ ticket repair. Automated recovery that preserves attempt history is later work (M1).
64
93
 
65
94
  ## Budget rules
66
95
 
@@ -73,5 +102,18 @@ previously authorized work.
73
102
 
74
103
  ## When all tickets are done
75
104
 
76
- Update the PRD to `status: built`, then finish with:
105
+ Update the PRD to `status: built` and commit that change on its own (`PRD vN: built`).
106
+ The built transition is part of the candidate that `$pincer-evaluate` reviews; it is
107
+ never moved into a later evidence-only commit. Then finish with:
77
108
  "All tickets built. Run `$pincer-evaluate` for a final quality pass."
109
+
110
+ ## Authorization rule (shared by plan, narrow, code and evaluate)
111
+
112
+ Reuse explicit authorization for the same scope and decisions; ask only about a
113
+ material choice not already authorized, and prepare the concrete proposal before
114
+ asking. A decision the user delegated (for example "pick the architecture") does not
115
+ need another approval when you exercise it, but a newly discovered consequential
116
+ choice is surfaced before implementation. Record the authorization basis and the
117
+ scope it covers in the PRD or the handover. An agent-written record or a status
118
+ field is not authenticated human approval. When resuming without the context that
119
+ granted authorization, do not invent it — ask.
@@ -20,13 +20,26 @@ run the pipeline, then present results.
20
20
  its ticket commits and recorded context. If it cannot be established, resolve
21
21
  that uncertainty before claiming a complete review. Record full commit IDs for
22
22
  `base` and `candidate` (`git rev-parse HEAD`), then review `git diff <base>..<candidate>`.
23
- Require a clean candidate before review, excluding only the notes being written.
23
+ The candidate is the clean, committed tree that already includes the implementation,
24
+ the ticket closures and the PRD `status: built` commit: `git status --short` must be
25
+ empty before review. If anything is uncommitted or the PRD is not yet built, return
26
+ to `$pincer-code`; do not review a dirty tree.
24
27
  2. Dispatch a `code-quality-reviewer` agent with: the diff, the PRD's Success Criteria and
25
28
  Scope sections, and the list of tickets. If the diff is large, split by area and
26
29
  dispatch two in parallel. (No subagents on this platform? Review the diff yourself
27
30
  in a separate pass, applying `.claude/agents/code-quality-reviewer.md` as the rubric.)
28
- 3. Yourself, in parallel, check spec compliance: does what was built match every ticket's
29
- acceptance criteria and the PRD scope? List any gaps.
31
+ Keep the reviewer's report or its explicit no-findings statement for step 9,
32
+ where it is saved as an artifact; a review that left no record cannot be audited.
33
+ 3. Yourself, in parallel, check spec compliance. For every requirement `R-NN` in the
34
+ PRD record one disposition: `delivered` (evidence on this candidate), `blocked`
35
+ (required behavior failed or was left unverified — this blocks PASS; do not relabel
36
+ it a known limitation to pass), or `deferred` (only with explicit user authorization;
37
+ record the scope decision in the PRD's Out of Scope and evaluate the revised
38
+ candidate). Compare what was built against every ticket's acceptance criteria and
39
+ the PRD scope, and list any gaps. Whether the requirement map is complete and each
40
+ check is semantically adequate is your judgment as reviewer — record that judgment
41
+ in the evaluation; the kit is not a mechanical traceability engine and does not
42
+ validate requirement-revision impact.
30
43
  4. If the project has a UI, look at it — don't only read the code. Start it, open it in
31
44
  the browser (screenshot via Chrome DevTools MCP if available), and check it against
32
45
  the PRD's Visual Direction and Success Criteria. Note anything visibly broken or off.
@@ -44,28 +57,66 @@ run the pipeline, then present results.
44
57
  concrete bugs, silent failures, misleading code. Drop nitpicks and style opinions.
45
58
  7. Present findings as a short list with `file:line` references, ordered by severity.
46
59
  Security findings always rank above style-adjacent ones. For each, say whether you
47
- recommend fixing now (within the timebox) or noting as known-issue.
60
+ recommend fixing now through a ticket or recording it as a known issue.
48
61
  8. Fix findings clearly within the authorized PRD through a new ticket associated with
49
62
  that PRD. Use `pincer-ticket.sh` to start, verify, and close it, then make a scoped
50
63
  `T-{NN}: {title}` commit. Ask only when a fix changes scope, architecture, or another
51
- material decision; never make an ad-hoc `review: fixes` commit.
52
- 9. Close out: write a brief `NOTES.md` at the repo root with frontmatter:
64
+ material decision; never make an ad-hoc `review: fixes` commit. Every fix commit
65
+ produces a new candidate: re-record `candidate`, re-run the checks against it, and
66
+ write fresh evidence in step 9 — never reuse a manifest from a previous candidate.
67
+ 9. Persist evidence for the candidate under `.prd/evidence/prd-vN/<candidate>/`:
68
+ - `checks/C-NN.log` — the command and a redacted summary or safe log of each
69
+ executable check. Never secrets, never an environment dump.
70
+ - `visual/<scenario>.png` — each visual capture from step 4, with its scenario,
71
+ viewport and observed result recorded in the manifest. When nothing renders,
72
+ record `visual_review: {applicable: false, reason}` and say why.
73
+ - `review/code-quality.md` — the reviewer's findings from step 2 with their
74
+ dispositions, or its explicit no-findings statement, recorded as a check of
75
+ kind `review` and referenced by the requirements it covers.
76
+ - `manifest.json` — evidence schema 1 (field list in the header of
77
+ `scripts/pincer-evidence.cjs`): selected PRD, full `base` and `candidate` IDs,
78
+ `created`, `environment` with tool limitations, `coverage_review` (your judgment
79
+ from step 3), one `requirements` entry per `R-NN` with its disposition, tickets
80
+ and check IDs, one `checks` entry per check with `kind`, `required`, `result`,
81
+ `command`, timestamp and artifact paths, and `artifacts` with digests from
82
+ `node scripts/pincer-evidence.cjs digest <file>...`.
83
+ A tool you cannot run yields a check with `result: unverified` and a note — never a
84
+ fabricated artifact. A deferred requirement carries `authorized_by` naming the
85
+ user's explicit authorization. Then run
86
+ `node scripts/pincer-evidence.cjs validate .prd/evidence/prd-vN/<candidate>/manifest.json --candidate <candidate> --prd .prd/prd-vN.md`
87
+ and correct the manifest until it prints `ok`; the same validator runs in status
88
+ and release. It checks the record's consistency, not that the commands ran.
89
+ 10. Close out: write a brief `NOTES.md` at the repo root with frontmatter:
53
90
  ```yaml
54
91
  ---
55
92
  prd: .prd/prd-vN.md
56
93
  base: <full reviewed base commit ID>
57
94
  candidate: <full reviewed candidate commit ID>
95
+ evidence: .prd/evidence/prd-vN/<candidate>/manifest.json
58
96
  ---
59
97
  ```
60
- Record the candidate before the separate NOTES commit. Status accepts a later
61
- commit only when its diff from the candidate changes solely `NOTES.md`; changes
62
- to source, tickets, or PRD require reevaluation. Legacy notes without these
63
- references do not establish readiness. Then describe what was built, what was cut
98
+ Then commit NOTES.md, the manifest and its listed artifacts and nothing else
99
+ as `evaluate: PRD vN candidate <short sha>`. Status accepts this later commit only
100
+ when its diff from the candidate is limited to `NOTES.md` and the evidence files
101
+ the manifest lists; changes to source, tests, configuration, tickets, the PRD or
102
+ other evaluations require reevaluation. Legacy notes without these references
103
+ do not establish readiness. Then describe what was built, what was cut
64
104
  and why, known issues, and what you'd do next with more time. Then a **Handover**
65
105
  section, written for the stranger who inherits this repo in six months: how to get
66
106
  oriented (which file to read first), what each dependency is for and why it earned
67
107
  its place, and what breaks first as the code ages (the riskiest assumption, the
68
- least-tested path). Commit it. This is the first document a reviewer of this repo
69
- should read.
70
- 10. Suggest `$pincer-release` as the final step: "Run `$pincer-release` for a pass/fail audit of the
108
+ least-tested path). This is the first document a reviewer of this repo should read;
109
+ summarize the requirement dispositions from the manifest in it.
110
+ 11. Suggest `$pincer-release` as the final step: "Run `$pincer-release` for a pass/fail audit of the
71
111
  whole workflow's artifacts."
112
+
113
+ ## Authorization rule (shared by plan, narrow, code and evaluate)
114
+
115
+ Reuse explicit authorization for the same scope and decisions; ask only about a
116
+ material choice not already authorized, and prepare the concrete proposal before
117
+ asking. A decision the user delegated (for example "pick the architecture") does not
118
+ need another approval when you exercise it, but a newly discovered consequential
119
+ choice is surfaced before implementation. Record the authorization basis and the
120
+ scope it covers in the PRD or the handover. An agent-written record or a status
121
+ field is not authenticated human approval. When resuming without the context that
122
+ granted authorization, do not invent it — ask.
@@ -9,7 +9,10 @@ description: "Turn the approved PRD into local, AI-ready ticket files"
9
9
 
10
10
  You are decomposing the PRD into coherent, independently verifiable tickets stored as
11
11
  local markdown files (no external tracker needed). Ticket count and size follow the
12
- change's dependencies and risk, plus any budget the user supplied.
12
+ change's dependencies and risk, plus any budget the user supplied. There is no hard
13
+ one-to-two-ticket cap for small PRDs and no default timebox: cohesion and dependencies
14
+ decide the count. A breakdown that follows the PRD needs no second approval; a newly
15
+ discovered consequential choice is surfaced before implementation.
13
16
 
14
17
  **Initial request:** the text that follows the `$pincer-narrow` mention, if any (when omitted, use the playbook's documented default)
15
18
 
@@ -28,10 +31,29 @@ change's dependencies and risk, plus any budget the user supplied.
28
31
  brownfield work, begin with the smallest protected vertical change; add a
29
32
  characterization ticket before changing load-bearing code that lacks coverage.
30
33
  - Order by dependency; note blockers explicitly ("depends on T-01").
34
+ - Build the requirement map: for every `R-NN` in the PRD and each of its
35
+ scenarios, name the ticket that owns the implementation and the executable
36
+ check that exercises it, or an explicit review method when no executable check
37
+ exists. Record the IDs in each ticket's Context as `Implements: R-NN, R-MM`.
38
+ Enabling work that implements no requirement states its purpose in the ticket
39
+ Objective. Resolve missing coverage and conflicting criteria with the user
40
+ before implementation; do not start with an unmapped required scenario.
31
41
  - Every ticket gets a runnable command in its Verification block — a fenced `bash`
32
42
  block that exits 0 only when the ticket is done. `scripts/pincer-ticket.sh verify`
33
43
  runs it verbatim and stamps the receipt that `done` requires, so it must be
34
44
  non-interactive and self-contained (no "check by hand").
45
+ - Each Verification section opens with `Proves:` — what the check establishes and
46
+ which regression it detects. A check for an executable change must exercise
47
+ observable behavior (including relevant rejection paths and, in brownfield work,
48
+ preservation of existing behavior) and fail when the behavior is wrong, not only
49
+ when an identifier is renamed. Reuse adequate focused tests. A build, a syntax
50
+ check, or an identifier grep alone is not proof; static assertions are primary
51
+ evidence only for static contracts such as generated files, and `Proves:` says so.
52
+ - Adequacy is a judgment about what the command observes, never a word match: do
53
+ not call a command sufficient because it contains `grep`, `test`, or a runner
54
+ name, nor insufficient for lacking them. Manual visual judgment is recorded
55
+ separately in evaluation; a tool the check needs but cannot run yields an
56
+ explicit `unverified` result, never fabricated evidence or a silent waiver.
35
57
  - If the brief or stack implies automated tests, at least one ticket's verification
36
58
  command must be the test runner (e.g. `npm test`) — manual checks alone don't count.
37
59
  - Any ticket whose surface accepts external input (HTTP endpoint, form, file,
@@ -48,12 +70,29 @@ change's dependencies and risk, plus any budget the user supplied.
48
70
  numbering or old notes. The other state fields
49
71
  (`started`, `last_check`, `verified`, `finished`) are added later by `scripts/pincer-ticket.sh` —
50
72
  never write them yourself.
51
- 4. Present the ticket list (number, title, size, dependencies) as a table.
73
+ 4. Present the ticket list (number, title, size, dependencies) as a table, followed
74
+ by the requirement map as a second table (requirement · scenario · ticket · check
75
+ or review method). Whether the map is complete and each check is adequate is your
76
+ judgment as the author; say so rather than presenting the table as mechanical proof.
52
77
 
53
- Present the concrete breakdown and build order. Reuse existing authorization for the same
54
- scope and order; ask only when the breakdown introduces a material decision or scope change.
78
+ Present the concrete breakdown and build order as a report, not a question. Reuse
79
+ existing authorization for the same scope and order.
55
80
 
56
- 5. Once authorized, update the selected PRD frontmatter to `status: ticketed`. Inspect
57
- existing staged changes, stage that PRD and the explicit new ticket paths, review
58
- `git diff --cached`, and commit only those paths. Finish with:
81
+ 5. Finalize. A breakdown that follows the PRD is already authorized by the PRD: do not
82
+ ask whether to proceed. Update the selected PRD frontmatter to `status: ticketed`,
83
+ inspect existing staged changes, stage that PRD and the explicit new ticket paths,
84
+ review `git diff --cached`, and commit only those paths. Ask first — and finalize
85
+ once it is resolved — only when step 4 surfaced a newly discovered consequential
86
+ choice or a scope change the PRD does not cover. Finish with:
59
87
  "Tickets ready in `tickets/`. Run `$pincer-code` to start implementing."
88
+
89
+ ## Authorization rule (shared by plan, narrow, code and evaluate)
90
+
91
+ Reuse explicit authorization for the same scope and decisions; ask only about a
92
+ material choice not already authorized, and prepare the concrete proposal before
93
+ asking. A decision the user delegated (for example "pick the architecture") does not
94
+ need another approval when you exercise it, but a newly discovered consequential
95
+ choice is surfaced before implementation. Record the authorization basis and the
96
+ scope it covers in the PRD or the handover. An agent-written record or a status
97
+ field is not authenticated human approval. When resuming without the context that
98
+ granted authorization, do not invent it — ask.
@@ -11,6 +11,14 @@ You are turning a task brief into a reviewable PRD. Scale discovery and detail t
11
11
  the change's uncertainty, risk, and any time budget the user supplied. The PRD feeds
12
12
  `$pincer-narrow` next.
13
13
 
14
+ Choose the planning profile and record why it fits: `profile: small` for bounded
15
+ scope, low risk, known behavior and straightforward verification; otherwise
16
+ `standard` (the default). Few changed lines alone do not qualify — migrations,
17
+ authorization boundaries, uncertain requirements and broad effects need proper
18
+ investigation even for a tiny patch. Honor an explicit budget the user supplied;
19
+ there is no default timebox, and a budget never silently cuts requirements —
20
+ record any cut in Out of Scope.
21
+
14
22
  **Initial request:** the text that follows the `$pincer-plan` mention in the user's message (ask only if the required input is missing)
15
23
 
16
24
  First run `scripts/pincer-status.sh`. If a PRD already exists, preserve it and select
@@ -22,7 +30,11 @@ unless the user explicitly authorized a separate change.
22
30
  ## Phase 1: Discovery
23
31
 
24
32
  1. If `the text that follows the `$pincer-plan` mention in the user's message (ask only if the required input is missing)` contains the brief, extract what you can before asking anything.
25
- Never ask a question the brief already answers.
33
+ Never ask a question the brief already answers. Preserve or link the original
34
+ brief in the PRD, and record the desired outcome, assumptions and exclusions.
35
+ If the user supplied a PRD, review it: keep its meaning and existing requirement
36
+ IDs; do not silently replace either. Where its structure needs adapting to the
37
+ template, record a mapping table (`their section or ID → R-NN`) inside the PRD.
26
38
  2. Ask only the questions whose answers would change the architecture or scope.
27
39
  Batch them (max 3–4 at once). Typical ones:
28
40
  - What does "done" look like — what will be run, demoed, or reviewed at the end?
@@ -70,6 +82,11 @@ concrete scope and architecture; do not repeat an approval already given for the
70
82
  ## Phase 4: Write the PRD
71
83
 
72
84
  1. Load `.claude/references/prd-template.md` and write all core sections.
85
+ In Requirements, assign stable `R-NN` IDs within the selected PRD: a revision
86
+ keeps existing IDs and adds new ones, never renumbers. Every requirement has
87
+ observable acceptance scenarios, the relevant failure paths, and the existing
88
+ behavior it must preserve — `$pincer-narrow` maps each scenario to a ticket and
89
+ a check, and `$pincer-evaluate` dispositions every ID.
73
90
  2. Include optional sections when risk or the product context warrants them.
74
91
  3. Save to the next unused `.prd/prd-v{N}.md` (create `.prd/` if needed), with `N`
75
92
  matching the filename and frontmatter:
@@ -78,6 +95,7 @@ concrete scope and architecture; do not repeat an approval already given for the
78
95
  version: {N}
79
96
  status: draft
80
97
  date: {today}
98
+ profile: small # only when small; omit for standard
81
99
  ---
82
100
  ```
83
101
  4. If `.git/` doesn't exist, run `git init`. Commit the PRD and only the intended setup
@@ -87,3 +105,14 @@ concrete scope and architecture; do not repeat an approval already given for the
87
105
  Present the saved draft and obtain approval only when the same scope/architecture was not
88
106
  already authorized. Finish with: "PRD saved to `.prd/prd-v{N}.md`. Run `$pincer-narrow`
89
107
  to break it into work items."
108
+
109
+ ## Authorization rule (shared by plan, narrow, code and evaluate)
110
+
111
+ Reuse explicit authorization for the same scope and decisions; ask only about a
112
+ material choice not already authorized, and prepare the concrete proposal before
113
+ asking. A decision the user delegated (for example "pick the architecture") does not
114
+ need another approval when you exercise it, but a newly discovered consequential
115
+ choice is surfaced before implementation. Record the authorization basis and the
116
+ scope it covers in the PRD or the handover. An agent-written record or a status
117
+ field is not authenticated human approval. When resuming without the context that
118
+ granted authorization, do not invent it — ask.
@@ -8,7 +8,11 @@ description: "Audit the repo against the workflow checklist — pass/fail per it
8
8
  # $pincer-release — Workflow Audit
9
9
 
10
10
  You are auditing the current repo state against `docs/release-checklist.md`. Read-only:
11
- report pass/fail, never fix anything — fixes belong to the stage commands.
11
+ report pass/fail, never fix anything — fixes belong to the stage commands. Release does
12
+ not repair tickets, rewrite evidence, change PRD state, or publish. A check that mutates
13
+ the candidate invalidates the audit: if `git status --short` is not empty afterwards,
14
+ the verdict is FAIL and names the mutation. The verdict is reported to the user; a
15
+ durable runtime-owned release record is later work.
12
16
 
13
17
  **Requested stage:** the text that follows the `$pincer-release` mention, if any (when omitted, use the playbook's documented default)
14
18
 
@@ -27,13 +31,23 @@ report pass/fail, never fix anything — fixes belong to the stage commands.
27
31
  - Receipts: every done ticket carries current `last_check` and `verified` evidence;
28
32
  any status warning fails the audit. Do not call `pincer-ticket.sh` from Release:
29
33
  it writes receipts and would invalidate the evaluated candidate.
34
+ - Evidence: `scripts/pincer-status.sh` runs the shared validator
35
+ (`scripts/pincer-evidence.cjs`) against the manifest `NOTES.md` names. The `Notes`
36
+ line must read `current` and the `Evidence` line `ok`; any other text fails the
37
+ audit with that diagnostic. Do not re-implement evidence checks and do not accept
38
+ screenshots described in chat: read the manifest's `checks`, requirement
39
+ dispositions and `visual_review`. Validation establishes that the record is
40
+ consistent, not that the commands ran — say so if asked.
41
+ - Every file the manifest lists is tracked, and `git status --short` is empty before
42
+ and after the audit.
30
43
  - Run the repository's candidate-wide release gate directly (`npm test`, or the
31
44
  equivalent declared by the project) and report its actual output. Any failure
32
45
  blocks PASS. Confirm `git status --short` remains clean afterward.
33
46
  4. For judgment items (tickets genuinely S/M, history reads as a story), give your
34
47
  verdict AND one sentence of evidence — never a bare pass.
35
48
  5. Present a table: checklist item | pass/fail/skipped | evidence. Order by stage.
36
- 6. End with a one-line verdict: "PASS — workflow artifacts complete" or
37
- "FAIL — {n} items failed; fix via {command}". For each failure, name the command
49
+ 6. End with a one-line verdict naming the candidate: "PASS — candidate {sha}: workflow
50
+ artifacts complete" or "FAIL — candidate {sha}: {n} items failed; fix via {command}".
51
+ Fixes go through a new ticket, a new candidate and a new evaluation. For each failure, name the command
38
52
  file (`.claude/commands/*.md`) whose instructions should be tightened if the
39
53
  failure is a workflow bug rather than a run mistake.
@@ -13,11 +13,13 @@ start of a session. Read-only: change nothing.
13
13
  ## Steps
14
14
 
15
15
  1. Run `scripts/pincer-status.sh`. It reads the artifacts on disk (`.prd/`, `tickets/`,
16
- `NOTES.md`) and prints the PRD state, every ticket with its state and clock-based
17
- elapsed time, what is blocked, build time against any explicit user budget, any warnings (a ticket
18
- marked done without a verification receipt), and the next command to run.
16
+ `NOTES.md`) and prints the PRD state and profile, every ticket with its state and
17
+ clock-based elapsed time, what is blocked, wall-clock build time while a ticket is in
18
+ progress or against an explicit user budget, the evidence verdict for the evaluated
19
+ candidate, any warnings (each readiness problem once), and the next command to run.
19
20
  2. Report in three lines: where the workflow is, what is in progress or blocked, and the
20
21
  next command. Quote the `Next` line as-is.
21
22
  3. If a ticket is `in_progress`, read it and `git status`, then offer to resume it with
22
23
  `$pincer-code T-{NN}`. If the script printed a warning, surface it — a done ticket
23
24
  without a receipt was marked by hand and needs `scripts/pincer-ticket.sh verify T-{NN}`.
25
+ Never restore a ticket file from git to clear a warning; a failed attempt is a record.
@@ -39,7 +39,11 @@ previously authorized work.
39
39
  conventions, and nothing else.
40
40
  3. **Verify:** `scripts/pincer-ticket.sh verify T-{NN}` — runs the Verification block and
41
41
  writes the receipt only if it exits 0. Red → fix and re-run; report the actual output,
42
- not assumptions. Green output is the definition of done, not your confidence.
42
+ not assumptions. Green output is the definition of done, not your confidence. If the
43
+ check only validated syntax or a build, say so — that is not behavioral proof. A
44
+ visual judgment is recorded separately in evaluation, not as the receipt, and a tool
45
+ the check needs but cannot run yields an explicit `unverified` result, never
46
+ fabricated output.
43
47
  4. **Self-review the diff** before committing: silent failures (empty catches,
44
48
  un-awaited promises), leftover debug code, drift from the ticket's acceptance criteria.
45
49
  Then a security sweep of the same diff:
@@ -57,8 +61,33 @@ previously authorized work.
57
61
  Inspect `git status --short`, preserve pre-existing staged work, and stage only the
58
62
  explicit paths changed for this ticket plus its ticket file. Review `git diff --cached`
59
63
  before committing as `T-{NN}: {title}`.
60
- 6. Give a one-line progress update using the elapsed figure from
61
- `scripts/pincer-status.sh` ("T-02 done, 3 remaining, 38m elapsed") and continue.
64
+ 6. Give a one-line progress update ("T-02 done, 3 remaining") and continue. Quote the
65
+ wall-clock elapsed figure from `scripts/pincer-status.sh` when it shows one it
66
+ appears while a ticket is in progress or a budget is set, and it is not a measure
67
+ of active execution time.
68
+
69
+ ## Recovering a ticket file
70
+
71
+ Ticket lifecycle fields are written only by `scripts/pincer-ticket.sh`, and the guard
72
+ also blocks shell restores that would touch ticket files from the assistant's shell:
73
+ `git checkout`/`git restore`/`git switch` naming a ticket path or a normalized
74
+ pathspec that cannot be shown to stay outside `tickets/` (the whole tree, `.`, `:/`,
75
+ `:(top)`, globs, absolute or unexpanded paths, `tickets/…` in any spelling, a
76
+ `-C tickets` prefix), force flags (`-f`, `--force`, `--discard-changes`,
77
+ `--pathspec-from-file`), `git reset --hard|--merge|--keep`, `git stash` (except
78
+ `list`, `show`, `create`, `store`), `git clean -f` without a narrow pathspec,
79
+ `git checkout-index -a` and `git read-tree -u|--reset`, including when wrapped in
80
+ `bash -c`, `eval`, `nice`, `time`, `nohup`, `timeout` or `xargs`. Restoring HEAD
81
+ would erase a newer failed attempt and revive an old passing receipt. Branch
82
+ switches and file-specific restores outside `tickets/` stay allowed. The guard is a
83
+ pattern-based safety net for documented mistake forms, not a complete shell
84
+ boundary; the receipt and status checks remain the source of trust. When a ticket file is malformed or its state was hand
85
+ edited, preserve the malformed contents as they are, report the validation error that
86
+ the script or `scripts/pincer-status.sh` printed, and hand the repair to the user, who
87
+ performs it in their own terminal. Then return through the lifecycle — `start`,
88
+ `verify`, `done` — so the ticket carries fresh verification; a restored receipt is
89
+ never evidence. Do not recommend restoring source files or unrelated edits as routine
90
+ ticket repair. Automated recovery that preserves attempt history is later work (M1).
62
91
 
63
92
  ## Budget rules
64
93
 
@@ -71,5 +100,18 @@ previously authorized work.
71
100
 
72
101
  ## When all tickets are done
73
102
 
74
- Update the PRD to `status: built`, then finish with:
103
+ Update the PRD to `status: built` and commit that change on its own (`PRD vN: built`).
104
+ The built transition is part of the candidate that `/pincer-evaluate` reviews; it is
105
+ never moved into a later evidence-only commit. Then finish with:
75
106
  "All tickets built. Run `/pincer-evaluate` for a final quality pass."
107
+
108
+ ## Authorization rule (shared by plan, narrow, code and evaluate)
109
+
110
+ Reuse explicit authorization for the same scope and decisions; ask only about a
111
+ material choice not already authorized, and prepare the concrete proposal before
112
+ asking. A decision the user delegated (for example "pick the architecture") does not
113
+ need another approval when you exercise it, but a newly discovered consequential
114
+ choice is surfaced before implementation. Record the authorization basis and the
115
+ scope it covers in the PRD or the handover. An agent-written record or a status
116
+ field is not authenticated human approval. When resuming without the context that
117
+ granted authorization, do not invent it — ask.