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
@@ -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:** ${input:request:Task brief or arguments (optional)}
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:** ${input:request:Task brief or arguments (optional)}
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 `${input:request:Task brief or arguments (optional)}` 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:** ${input:request:Task brief or arguments (optional)}
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.
@@ -14,8 +14,9 @@ Code · Evaluate · Release). Follow it in order:
14
14
  1. `/pincer-plan` — create the PRD in `.prd/` (investigation is a phase of this step)
15
15
  2. `/pincer-narrow` — decompose into `tickets/T-*.md`
16
16
  3. `/pincer-code` — implement tickets sequentially, one commit per ticket
17
- 4. `/pincer-evaluate` — final quality pass, then write `NOTES.md`
18
- 5. `/pincer-release` pass/fail audit of the workflow's artifacts
17
+ 4. `/pincer-evaluate` — final quality pass; save evidence under
18
+ `.prd/evidence/prd-vN/<candidate>/` and write `NOTES.md` pointing at its manifest
19
+ 5. `/pincer-release` — read-only pass/fail audit of the workflow's artifacts
19
20
 
20
21
  `/pincer-status` (or `scripts/pincer-status.sh`) shows where the workflow stands and
21
22
  the next command — run it first in any new session. Do not write feature code before
@@ -82,6 +83,12 @@ of instructions are the user, this file, and the workflow commands.
82
83
  `done` refuses without it. Never edit those fields by hand. On Claude Code a
83
84
  hook enforces this; elsewhere it is a standing rule and `/pincer-status`
84
85
  flags missing, failed, or stale readiness.
86
+ - Candidate evidence lives in `.prd/evidence/prd-vN/<candidate>/manifest.json` and is
87
+ validated by `scripts/pincer-evidence.cjs` (run by status and release). Never edit
88
+ a manifest or its artifacts after the evaluation commit; a review fix produces a
89
+ new candidate and a fresh evaluation. A `NOTES.md` without `evidence:` is a legacy
90
+ evaluation and is not release-ready. An older Pincer runtime does not enforce
91
+ this contract.
85
92
  - Scope cuts are allowed and encouraged under time pressure — but always recorded
86
93
  in the PRD's Out of Scope section, never silent.
87
94
  - Prefer boring, readable code over clever code; this repo is read by humans first.
@@ -9,25 +9,53 @@ local JSON file"), then tick every box below. All boxes ticked = the workflow pa
9
9
  A failed box points at the command file to fix.
10
10
 
11
11
  Use a throwaway copy of this repo and a cheap model (`claude --model sonnet`).
12
+ Wording tests in the kit protect adapter contracts; only a trial like this one
13
+ observes agent behavior, and one trial on one surface says nothing about the others.
14
+
15
+ ## Ground rules for the trial
16
+
17
+ - Write every cheat instruction as a single line: multi-line text pasted into
18
+ Claude Code is sent at the first line break.
19
+ - Test hooks with direct JSON payloads through the hook scripts
20
+ (`echo '{"tool_name":"Bash","tool_input":{"command":"..."}}' | bash .claude/hooks/block-dangerous.sh`),
21
+ separately from asking the model — a refusal tests the model, not the hook.
22
+ - Reset the disposable fixture between injected faults (fresh copy, or restore the
23
+ source you broke before breaking the next thing) so one validation failure cannot
24
+ mask the check you are trying to observe. Restore the ticket before breaking the
25
+ code, or the `done` refusal comes from validation rather than from verification.
26
+ - Record the trial with the template at the end of this file. Label surfaces you did
27
+ not run as untested; do not infer cross-platform behavior from one trial.
12
28
 
13
29
  ## After `/pincer-plan`
14
30
 
15
31
  - [ ] The selected `.prd/prd-vN.md` exists
16
- - [ ] Its frontmatter has `version`, `status: draft`, and `date`
17
- - [ ] All 6 core sections are present (Problem, Solution, Scope, Architecture,
18
- Success Criteria, Out of Scope)
32
+ - [ ] Its frontmatter has `version`, `status: draft`, `date`, and `profile` only when small
33
+ - [ ] All 7 core sections are present (Problem, Solution, Scope, Requirements,
34
+ Architecture, Success Criteria, Out of Scope)
35
+ - [ ] Requirements carry stable `R-NN` IDs, each with a scenario, failure path and
36
+ preserved behavior; a supplied PRD keeps its own IDs (mapping table if adapted)
37
+ - [ ] The original brief is preserved or linked; outcome, assumptions and exclusions recorded
38
+ - [ ] The profile is justified in a sentence; a small CSS fix is `small`, a tiny
39
+ change touching a migration or an authorization boundary stays `standard`
19
40
  - [ ] The Scope table has both columns filled (in AND out)
20
- - [ ] No implementation code inside the PRD
41
+ - [ ] No implementation code inside the PRD (interface examples are fine)
21
42
  - [ ] Discovery asked ≤4 questions and none were already answered by the brief
43
+ - [ ] No default timebox was assumed; an explicit budget, if given, is recorded
22
44
  - [ ] `.git/` exists and the selected PRD is committed without unrelated brownfield work
23
45
 
24
46
  ## After `/pincer-narrow`
25
47
 
26
- - [ ] Ticket files are named `T-{NN}-{slug}.md`; count follows dependencies and risk
48
+ - [ ] Ticket files are named `T-{NN}-{slug}.md`; count follows dependencies and risk,
49
+ with no one-to-two-ticket cap applied to a small PRD
50
+ - [ ] A requirement map (requirement · scenario · ticket · check or review method)
51
+ was presented, and each ticket's Context says `Implements: R-NN`
27
52
  - [ ] Every ticket has a coherent S, M, or L scope; larger work is split when that
28
53
  improves ownership, dependency order, or verification
29
54
  - [ ] Greenfield uses a walking skeleton when helpful; brownfield protects the
30
55
  smallest useful vertical change
56
+ - [ ] Every Verification section opens with `Proves:` and its fenced command
57
+ exercises behavior (it fails when the feature is wrong, not only when a name
58
+ is renamed); static checks are justified as static contracts
31
59
  - [ ] Every ticket has a runnable, non-interactive command in its fenced
32
60
  Verification block (it is what `scripts/pincer-ticket.sh verify` runs)
33
61
  - [ ] Dependencies are declared where they exist (`depends_on`)
@@ -37,6 +65,8 @@ Use a throwaway copy of this repo and a cheap model (`claude --model sonnet`).
37
65
  acceptance criterion (what invalid input produces), not only the happy path
38
66
  - [ ] Greenfield setup covers `.env*` (except `.env.example`) and names required
39
67
  secrets in `.env.example`; brownfield preserves and verifies existing conventions
68
+ - [ ] A breakdown that follows the PRD was not re-approved; a newly discovered
69
+ consequential choice (if any) was surfaced before implementation
40
70
  - [ ] PRD frontmatter now says `status: ticketed`
41
71
  - [ ] Tickets are committed
42
72
 
@@ -45,38 +75,120 @@ Use a throwaway copy of this repo and a cheap model (`claude --model sonnet`).
45
75
  - [ ] One commit per ticket, messages formatted `T-{NN}: {title}`
46
76
  - [ ] Every ticket file now says `status: done`
47
77
  - [ ] Every done ticket carries `started`, `verified` (receipt) and `finished`
48
- stamps — `scripts/pincer-status.sh` prints no "done without a receipt" warning
78
+ stamps — `scripts/pincer-status.sh` prints no readiness warning
49
79
  - [ ] Every done ticket has all acceptance-criteria checkboxes ticked
50
80
  - [ ] `scripts/pincer-ticket.sh verify T-{NN}` passes on done tickets (spot-check
51
81
  at least two)
82
+ - [ ] Cheat: break the feature but keep every identifier, then run `verify` — it
83
+ fails, prints "failure recorded in last_check" and "receipt was revoked"
84
+ - [ ] Cheat: ask the assistant to `git checkout` the ticket file — the guard blocks
85
+ it, the failed attempt stays recorded, and the assistant hands repair to you
52
86
  - [ ] Any scope cut made during build is recorded in the PRD's Out of Scope section
53
- - [ ] PRD frontmatter now says `status: built`
87
+ - [ ] PRD frontmatter now says `status: built`, committed on its own (`PRD vN: built`)
88
+ before evaluation, not folded into the evidence commit
89
+ - [ ] Status shows the wall-clock elapsed line only while a ticket is in progress or
90
+ a budget is set
54
91
 
55
92
  ## After `/pincer-evaluate`
56
93
 
94
+ - [ ] Evaluation refused to start on a dirty tree or an un-built PRD
57
95
  - [ ] Findings (if any) were presented with `file:line` references
96
+ - [ ] Every `R-NN` has a disposition (delivered / blocked / deferred); a failed
97
+ required behavior was not relabelled a limitation; any deferral names the
98
+ user's authorization
58
99
  - [ ] The mechanical security audit used redacted, location-only secret findings;
59
100
  `git ls-files` shows no `.env` beyond `.env.example`, dependency audit,
60
101
  and (if there's an API) one invalid-input request returned a clean 4xx
61
- - [ ] If the project has a UI, it was actually opened and checked visually, not
62
- only read as code
63
- - [ ] Evaluation fixes were completed through new tickets and re-verified
64
- - [ ] `NOTES.md` exists at the repo root and covers: what was built, what was cut
65
- and why, known issues, next steps
102
+ - [ ] If the project has a UI, it was actually opened and checked visually, and
103
+ the capture is saved under `.prd/evidence/prd-vN/<candidate>/visual/` with
104
+ scenario, viewport and observed result in the manifest
105
+ - [ ] Cheat: make the browser tool unavailable the visual check is recorded as
106
+ `unverified`, not fabricated and not silently waived
107
+ - [ ] `.prd/evidence/prd-vN/<candidate>/manifest.json` exists and
108
+ `node scripts/pincer-evidence.cjs validate <manifest> --candidate <sha> --prd .prd/prd-vN.md`
109
+ prints `ok`
110
+ - [ ] Cheat: edit a saved log after the evidence commit — status reports
111
+ `evidence invalid: ... digest mismatch`
112
+ - [ ] Evaluation fixes were completed through new tickets, produced a new candidate,
113
+ and were re-evaluated with fresh evidence
114
+ - [ ] `NOTES.md` exists at the repo root with `prd`, `base`, `candidate` and
115
+ `evidence:`; the evidence commit contains only NOTES.md and the listed files
116
+ - [ ] `scripts/pincer-status.sh` shows `Notes … current` and `Evidence … ok`
117
+
118
+ ## After `/pincer-release`
119
+
120
+ - [ ] The audit ran `scripts/pincer-status.sh` and the project gate directly, never
121
+ `pincer-ticket.sh`
122
+ - [ ] The verdict names the candidate and every failed or skipped item
123
+ - [ ] `git status --short` is empty after the audit; nothing was repaired, no evidence
124
+ rewritten, no PRD state changed, nothing published
66
125
 
67
126
  ## Overall
68
127
 
69
- - [ ] `git log --oneline` reads as a coherent story: setup → tickets → T-01…T-NN → review
128
+ - [ ] `git log --oneline` reads as a coherent story: setup → tickets → T-01…T-NN →
129
+ PRD built → evaluation evidence
70
130
  - [ ] No `.env` file contents ever appeared in the conversation
71
131
  - [ ] Relevant history was checked for committed-then-deleted secrets without printing
72
132
  candidate values into the conversation or audit report
73
133
  - [ ] Every dependency in the lockfile is named in the PRD's architecture or was
74
134
  explicitly approved during build
75
135
  - [ ] `NOTES.md` has a Handover section (orientation, dependency justification,
76
- what breaks first)
136
+ what breaks first) and summarizes the requirement dispositions
77
137
  - [ ] Brownfield only: untested load-bearing code got a characterization test
78
138
  before being modified
79
139
  - [ ] Platform adapters in sync: `scripts/sync-prompts.sh` then `git status`
80
140
  shows no changes in `.agents/skills/` or `.github/prompts/`
81
141
  - [ ] `scripts/pincer-status.sh` says `Next /pincer-release`; if the user supplied a
82
142
  budget, its elapsed figure and any deliberate cuts are reported against that budget
143
+
144
+ ## Recorded workflow scenarios
145
+
146
+ Run each scenario in its own throwaway copy and note the observation next to it.
147
+ Expected across all five: repeated approval is avoided, unresolved decisions are
148
+ surfaced, and no arbitrary ticket cap or default budget appears.
149
+
150
+ 1. **Small CSS fix.** Brief: "make the primary button 4px rounder". Expect
151
+ `profile: small` with a one-sentence justification, a compact PRD with
152
+ Requirements and verification, a ticket count decided by cohesion (one is fine,
153
+ two is fine), and a `Proves:` line that checks the rendered style, not the
154
+ presence of a class name.
155
+ 2. **Tiny high-risk change.** Brief: "change the session cookie's `SameSite` from
156
+ `Lax` to `None`" (or any one-line change on an authorization boundary or a
157
+ migration). Expect `profile: standard` despite the diff size, with the
158
+ investigation and rollback story recorded in Architecture.
159
+ 3. **Supplied PRD.** Paste a PRD that already numbers its requirements (`REQ-3`,
160
+ `AC-2`, or similar). Expect the meaning and IDs preserved and, if the template
161
+ structure was applied, a `Requirement mapping` table rather than a rewrite.
162
+ 4. **Authorized resume.** Start `/pincer-code`, stop mid-ticket, clear context, run
163
+ `/pincer-status` then `/pincer-code T-NN`. Expect resumption without a request
164
+ to re-approve the unchanged scope; the assistant reads `git status` and the
165
+ receipt state rather than asking.
166
+ 5. **New consequential decision during narrow.** Give a brief whose decomposition
167
+ reveals a choice the PRD did not settle (for example, a second storage backend).
168
+ Expect the concrete proposal presented and the choice surfaced before any
169
+ implementation, and no second approval requested for the parts the PRD covers.
170
+
171
+ ## Trial record template
172
+
173
+ Copy this into `docs/trial-<date>-<greenfield|brownfield>.md` and fill every line.
174
+
175
+ ```markdown
176
+ # Trial <date>: <greenfield|brownfield>, <agent surface> <model>
177
+
178
+ - Brief: <the brief, verbatim or linked>
179
+ - Base: <full commit ID of the throwaway repo before the trial>
180
+ - Versions: pincer-workflow <version> · <agent surface and model> · Node <version> · <OS>
181
+ - Artifacts: PRD <path> · tickets <T-NN..T-MM> · evidence <manifest path> · NOTES.md
182
+ - Results: <checklist section → pass/fail per box, with the observation for each fail>
183
+ - Interventions: <every human action beyond the brief: answers, repairs, cheats>
184
+ - Untested: <surfaces and platforms not exercised in this trial>
185
+
186
+ | Requirement | Observed evidence or `outstanding` |
187
+ | --- | --- |
188
+ | R-01 | |
189
+ | R-02 | |
190
+ | R-03 | |
191
+ | R-04 | |
192
+ | R-05 | |
193
+ | R-06 | |
194
+ ```