pincer-workflow 0.7.0 → 1.0.1
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.
- package/README.md +161 -193
- package/bin/pincer.js +189 -166
- package/package.json +4 -3
- package/template/.agents/skills/pincer-blueprint/SKILL.md +70 -0
- package/template/.agents/skills/pincer-status/SKILL.md +29 -55
- package/template/.claude/commands/pincer-blueprint.md +7 -0
- package/template/.claude/commands/pincer-status.md +4 -59
- package/template/.claude/hooks/hook-policy.cjs +60 -25
- package/template/.claude/hooks/ticket-guard.sh +6 -3
- package/template/.claude/pincer/library/agents/accessibility-reviewer.md +27 -0
- package/template/.claude/pincer/library/agents/code-quality-reviewer.md +25 -0
- package/template/.claude/pincer/library/agents/codebase-explorer.md +23 -0
- package/template/.claude/pincer/library/agents/fix-agent.md +23 -0
- package/template/.claude/pincer/library/agents/history-reviewer.md +26 -0
- package/template/.claude/pincer/library/agents/implementer.md +24 -0
- package/template/.claude/pincer/library/agents/security-reviewer.md +26 -0
- package/template/.claude/pincer/library/agents/silent-failure-hunter.md +27 -0
- package/template/.claude/pincer/library/agents/standards-reviewer.md +25 -0
- package/template/.claude/pincer/library/agents/test-coverage-reviewer.md +26 -0
- package/template/.claude/pincer/library/agents-skeleton.md +89 -0
- package/template/.claude/pincer/library/agreement.md +46 -0
- package/template/.claude/pincer/library/models.json +6 -0
- package/template/.claude/pincer/library/stages/blueprint/SKILL.md +69 -0
- package/template/.claude/pincer/library/stages/blueprint/formats/harness.md +82 -0
- package/template/.claude/pincer/library/stages/blueprint/formats/roster-rules.md +61 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/confirm-kind.md +19 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/first-job.md +18 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-handoffs.md +21 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-models.md +20 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-pipeline.md +27 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-repo.md +21 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-responsibility.md +30 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-roster.md +20 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-simplify.md +26 -0
- package/template/.claude/pincer/library/stages/blueprint/prompts/q-systems.md +28 -0
- package/template/.claude/pincer/library/stages/code/SKILL.md +59 -0
- package/template/.claude/pincer/library/stages/code/formats/pr.md +55 -0
- package/template/.claude/pincer/library/stages/code/prompts/implement.md +25 -0
- package/template/.claude/pincer/library/stages/evaluate/SKILL.md +51 -0
- package/template/.claude/pincer/library/stages/evaluate/formats/evidence.md +49 -0
- package/template/.claude/pincer/library/stages/evaluate/formats/finding-report.md +72 -0
- package/template/.claude/pincer/library/stages/evaluate/formats/finding.md +35 -0
- package/template/.claude/pincer/library/stages/evaluate/prompts/review.md +25 -0
- package/template/.claude/pincer/library/stages/narrow/SKILL.md +47 -0
- package/template/.claude/pincer/library/stages/narrow/formats/ticket.md +126 -0
- package/template/.claude/pincer/library/stages/narrow/prompts/explore.md +19 -0
- package/template/.claude/pincer/library/stages/plan/SKILL.md +46 -0
- package/template/.claude/pincer/library/stages/plan/formats/spec.md +100 -0
- package/template/.claude/pincer/library/stages/plan/prompts/explore.md +20 -0
- package/template/.claude/pincer/library/stages/release/SKILL.md +51 -0
- package/template/.claude/pincer/library/stages/status/SKILL.md +37 -0
- package/template/.claude/skills/pincer-blueprint/SKILL.md +69 -0
- package/template/.claude/skills/pincer-blueprint/formats/harness.md +82 -0
- package/template/.claude/skills/pincer-blueprint/formats/roster-rules.md +61 -0
- package/template/.claude/skills/pincer-blueprint/prompts/confirm-kind.md +19 -0
- package/template/.claude/skills/pincer-blueprint/prompts/first-job.md +18 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-handoffs.md +21 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-models.md +20 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-pipeline.md +27 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-repo.md +21 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-responsibility.md +30 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-roster.md +20 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-simplify.md +26 -0
- package/template/.claude/skills/pincer-blueprint/prompts/q-systems.md +28 -0
- package/template/.claude/skills/pincer-status/SKILL.md +37 -0
- package/template/.codex/README.md +39 -35
- package/template/.github/copilot-instructions.md +19 -14
- package/template/.github/prompts/pincer-blueprint.prompt.md +70 -0
- package/template/.github/prompts/pincer-status.prompt.md +29 -55
- package/template/AGENTS.md +34 -67
- package/template/docs/engine.md +249 -0
- package/template/docs/release-checklist.md +27 -28
- package/template/scripts/pincer/blueprint.cjs +137 -0
- package/template/scripts/pincer/cli.cjs +233 -0
- package/template/scripts/pincer/evidence.cjs +142 -0
- package/template/scripts/pincer/generate.cjs +375 -0
- package/template/scripts/pincer/harness.cjs +269 -0
- package/template/scripts/pincer/models.cjs +121 -0
- package/template/scripts/{pincer-runtime → pincer}/parse.cjs +83 -133
- package/template/scripts/pincer/recon.cjs +205 -0
- package/template/scripts/pincer/status.cjs +173 -0
- package/template/scripts/pincer/ticket.cjs +204 -0
- package/template/scripts/pincer/util.cjs +104 -0
- package/template/scripts/pincer-blueprint.cjs +7 -0
- package/template/scripts/pincer-evidence.cjs +5 -73
- package/template/scripts/pincer-status.sh +10 -12
- package/template/scripts/pincer-ticket.sh +15 -18
- package/template/scripts/sync-prompts.sh +2 -50
- package/template/.agents/skills/pincer-code/SKILL.md +0 -240
- package/template/.agents/skills/pincer-evaluate/SKILL.md +0 -178
- package/template/.agents/skills/pincer-narrow/SKILL.md +0 -148
- package/template/.agents/skills/pincer-plan/SKILL.md +0 -134
- package/template/.agents/skills/pincer-release/SKILL.md +0 -82
- package/template/.claude/agents/code-quality-reviewer.md +0 -38
- package/template/.claude/agents/codebase-explorer.md +0 -23
- package/template/.claude/commands/pincer-code.md +0 -238
- package/template/.claude/commands/pincer-evaluate.md +0 -176
- package/template/.claude/commands/pincer-narrow.md +0 -146
- package/template/.claude/commands/pincer-plan.md +0 -132
- package/template/.claude/commands/pincer-release.md +0 -80
- package/template/.claude/references/prd-template.md +0 -108
- package/template/.claude/references/ticket-template.md +0 -86
- package/template/.github/prompts/pincer-code.prompt.md +0 -240
- package/template/.github/prompts/pincer-evaluate.prompt.md +0 -178
- package/template/.github/prompts/pincer-narrow.prompt.md +0 -148
- package/template/.github/prompts/pincer-plan.prompt.md +0 -134
- package/template/.github/prompts/pincer-release.prompt.md +0 -82
- package/template/docs/dry-run-checklist.md +0 -264
- package/template/docs/runtime-contracts.md +0 -1769
- package/template/scripts/pincer-runtime/adopt.cjs +0 -132
- package/template/scripts/pincer-runtime/agreement.cjs +0 -240
- package/template/scripts/pincer-runtime/authorization.cjs +0 -167
- package/template/scripts/pincer-runtime/changes.cjs +0 -517
- package/template/scripts/pincer-runtime/checks.cjs +0 -48
- package/template/scripts/pincer-runtime/coverage.cjs +0 -361
- package/template/scripts/pincer-runtime/dispositions.cjs +0 -95
- package/template/scripts/pincer-runtime/evidence.cjs +0 -676
- package/template/scripts/pincer-runtime/fsutil.cjs +0 -37
- package/template/scripts/pincer-runtime/gates.cjs +0 -73
- package/template/scripts/pincer-runtime/identity.cjs +0 -163
- package/template/scripts/pincer-runtime/impact.cjs +0 -177
- package/template/scripts/pincer-runtime/io.cjs +0 -41
- package/template/scripts/pincer-runtime/lifecycle.cjs +0 -311
- package/template/scripts/pincer-runtime/locator.cjs +0 -158
- package/template/scripts/pincer-runtime/migrate.cjs +0 -204
- package/template/scripts/pincer-runtime/phases.cjs +0 -245
- package/template/scripts/pincer-runtime/readiness.cjs +0 -102
- package/template/scripts/pincer-runtime/requirements.cjs +0 -255
- package/template/scripts/pincer-runtime/resume.cjs +0 -273
- package/template/scripts/pincer-runtime/routing.cjs +0 -54
- package/template/scripts/pincer-runtime/runner.cjs +0 -242
- package/template/scripts/pincer-runtime/sanitize.cjs +0 -63
- package/template/scripts/pincer-runtime/scaffold.cjs +0 -254
- package/template/scripts/pincer-runtime/source.cjs +0 -129
- package/template/scripts/pincer-runtime/state.cjs +0 -314
- package/template/scripts/pincer-runtime/status.cjs +0 -514
- package/template/scripts/pincer-runtime/transaction.cjs +0 -200
- package/template/scripts/pincer-runtime/transitions.cjs +0 -134
- package/template/scripts/pincer-runtime.cjs +0 -686
|
@@ -1,51 +1,3 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
# of truth: edit them, re-run this script, commit the result.
|
|
5
|
-
#
|
|
6
|
-
# .agents/skills/pincer-*/SKILL.md — Codex CLI skills (repo-local; Codex
|
|
7
|
-
# removed custom prompts in 0.9x, see
|
|
8
|
-
# openai/codex#16115). Invoke by typing
|
|
9
|
-
# $pincer-plan <brief> in a Codex session.
|
|
10
|
-
# .github/prompts/pincer-*.prompt.md — VS Code Copilot prompt files
|
|
11
|
-
# (enable: "chat.promptFiles": true)
|
|
12
|
-
set -euo pipefail
|
|
13
|
-
cd "$(dirname "$0")/.."
|
|
14
|
-
|
|
15
|
-
mkdir -p .agents/skills .github/prompts
|
|
16
|
-
|
|
17
|
-
count=0
|
|
18
|
-
for src in .claude/commands/pincer-*.md; do
|
|
19
|
-
name=$(basename "$src" .md)
|
|
20
|
-
desc=$(sed -n 's/^description: *"\{0,1\}\([^"]*\)"\{0,1\}$/\1/p' "$src" | head -1)
|
|
21
|
-
if grep -q '^argument-hint:.*optional' "$src"; then
|
|
22
|
-
argument_text="the text that follows the \`\$$name\` mention, if any (when omitted, use the playbook's documented default)"
|
|
23
|
-
else
|
|
24
|
-
argument_text="the text that follows the \`\$$name\` mention in the user's message (ask only if the required input is missing)"
|
|
25
|
-
fi
|
|
26
|
-
body=$(awk 'flag; /^---$/ { if (++c == 2) flag = 1 }' "$src")
|
|
27
|
-
|
|
28
|
-
# Codex: one skill directory per playbook. Skills have no $ARGUMENTS
|
|
29
|
-
# substitution and are invoked as $name mentions, so the argument placeholder
|
|
30
|
-
# becomes prose and cross-references to /pincer-* become $pincer-* (the
|
|
31
|
-
# leading-context guard keeps paths like scripts/pincer-status.sh intact).
|
|
32
|
-
mkdir -p ".agents/skills/$name"
|
|
33
|
-
{
|
|
34
|
-
printf -- '---\nname: %s\ndescription: "%s"\n---\n' "$name" "$desc"
|
|
35
|
-
printf '<!-- Generated from %s by scripts/sync-prompts.sh — edit the source, not this file -->\n\n' "$src"
|
|
36
|
-
printf '%s\n' "$body" \
|
|
37
|
-
| sed "s/\$ARGUMENTS/$argument_text/g" \
|
|
38
|
-
| sed -e 's#^/pincer-\([a-z]*\)#$pincer-\1#' -e 's#\([^A-Za-z0-9_./]\)/pincer-\([a-z]*\)#\1$pincer-\2#g'
|
|
39
|
-
} > ".agents/skills/$name/SKILL.md"
|
|
40
|
-
|
|
41
|
-
# Copilot: prompt-file frontmatter; $ARGUMENTS becomes an input variable.
|
|
42
|
-
{
|
|
43
|
-
printf -- '---\nmode: agent\ndescription: "%s"\n---\n' "$desc"
|
|
44
|
-
printf '<!-- Generated from %s by scripts/sync-prompts.sh — edit the source, not this file -->\n\n' "$src"
|
|
45
|
-
printf '%s\n' "$body" | sed 's/\$ARGUMENTS/${input:request:Task brief or arguments (optional)}/g'
|
|
46
|
-
} > ".github/prompts/$name.prompt.md"
|
|
47
|
-
|
|
48
|
-
count=$((count + 1))
|
|
49
|
-
done
|
|
50
|
-
|
|
51
|
-
echo "Synced $count playbooks -> .agents/skills/ and .github/prompts/"
|
|
2
|
+
# Regenerates the project copies, Codex skills and Copilot prompts from the library and harness.json (scripts/pincer/cli.cjs generate).
|
|
3
|
+
exec node "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/pincer/cli.cjs" generate "$@"
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pincer-code
|
|
3
|
-
description: "Implement tickets sequentially with verification and one commit per ticket"
|
|
4
|
-
---
|
|
5
|
-
<!-- Generated from .claude/commands/pincer-code.md by scripts/sync-prompts.sh — edit the source, not this file -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# $pincer-code — Ticket Implementation
|
|
9
|
-
|
|
10
|
-
You are implementing the tickets in `tickets/` sequentially. The approved PRD, ticket
|
|
11
|
-
breakdown, and existing session authorization define the work; run continuously and report
|
|
12
|
-
progress between tickets unless a material scope or design decision appears.
|
|
13
|
-
|
|
14
|
-
**Initial request:** the text that follows the `$pincer-code` mention, if any (when omitted, use the playbook's documented default)
|
|
15
|
-
|
|
16
|
-
Ticket state lives in the ticket file's frontmatter and is written **only** by
|
|
17
|
-
`scripts/pincer-ticket.sh` (`start` → `verify` → `done`). `verify` runs the ticket's
|
|
18
|
-
Verification block and stamps a receipt only on a green exit; `done` refuses without a
|
|
19
|
-
receipt that matches the current check, or with unticked acceptance criteria. Never edit
|
|
20
|
-
`status`, `started`, `last_check`, `verified`, or `finished` by hand — on Claude Code a hook blocks it.
|
|
21
|
-
On a migrated project (a change binding under `.prd/changes/`; the `Runtime` line of
|
|
22
|
-
`scripts/pincer-status.sh` names it) `verify` records an attempt under `.pincer/runtime/`
|
|
23
|
-
and writes no receipt into the ticket, and `done` consumes the current passing attempt
|
|
24
|
-
against the current source without re-running the check. `.pincer/`, `.prd/changes/` and `.prd/evidence/changes/`
|
|
25
|
-
are written only by the runtime; never edit or delete them by hand. On a project with
|
|
26
|
-
change records (`Runtime changes …`) every `start`, `verify` and `done` first passes
|
|
27
|
-
the change gate: the ticket's change must be selected in this worktree, `active`
|
|
28
|
-
(`verify` also runs on a `completed` change), on a compatible branch, and authorized
|
|
29
|
-
for the current agreement — otherwise the command refuses with `SELECTION_REQUIRED`,
|
|
30
|
-
`WRONG_CHANGE`, `LIFECYCLE_BLOCKED`, `BASE_MISMATCH`, `DECISION_REQUIRED`,
|
|
31
|
-
`AUTHORIZATION_REQUIRED` or `AGREEMENT_CHANGED` before anything runs or is written.
|
|
32
|
-
|
|
33
|
-
## Before the loop
|
|
34
|
-
|
|
35
|
-
Run `scripts/pincer-status.sh`. It lists every ticket's state, what is blocked, elapsed
|
|
36
|
-
build time from the clock, and the next action. If a ticket is `in_progress`, you are
|
|
37
|
-
resuming: read it, check `git status` / `git diff` for uncommitted work, and continue
|
|
38
|
-
from wherever the receipt says you are. Do not ask the user to reconfirm unchanged,
|
|
39
|
-
previously authorized work. Read the `Runtime` line before the first ticket. `changes` (change records under
|
|
40
|
-
`.prd/changes/`) → run `node scripts/pincer-runtime.cjs resume` and follow its `Next`
|
|
41
|
-
line: it names the selected change, its lifecycle state, the agreement and the
|
|
42
|
-
authorization verdict, the blockers in order and the exact next command, all from the
|
|
43
|
-
files on disk. `resume --brief` is the same report projected to counts and one next
|
|
44
|
-
action — the same verdict and the same `Next` line, with every blocker category kept
|
|
45
|
-
and its `Detail` line naming the command that prints the rows it grouped. Prefer it
|
|
46
|
-
when you are orienting, and read the full report when a blocker needs its detail. Select the change to work on (`node scripts/pincer-runtime.cjs change
|
|
47
|
-
select <id>`; selection is local metadata and touches no source), activate it
|
|
48
|
-
(`change activate <id>`; refused until the user's authorization is recorded with
|
|
49
|
-
`change authorize` and no consequential decision is open) and resume a paused change
|
|
50
|
-
with `change resume <id>`. On a change with strict coverage (`Coverage strict …` in status) also read
|
|
51
|
-
`node scripts/pincer-runtime.cjs coverage` — it names the scenario, ticket, check or
|
|
52
|
-
decision that is next and every structural gap (`COVERAGE_INCOMPLETE`,
|
|
53
|
-
`SCOPE_UNAUTHORIZED`, `OBLIGATION_MISSING`) — and, after any PRD, ticket or map edit,
|
|
54
|
-
`node scripts/pincer-runtime.cjs impact` (`--from G-NN` for another baseline): it
|
|
55
|
-
lists the affected scenarios, tickets and checks with reasons and the dependency
|
|
56
|
-
dependents separately, and reports an unscoped PRD change or unavailable history
|
|
57
|
-
rather than "no impact". `legacy` and no ticket of this PRD carries legacy
|
|
58
|
-
receipts → register now (`node scripts/pincer-runtime.cjs register --prd .prd/prd-vN.md`,
|
|
59
|
-
commit `.prd/changes/` and `.gitignore` as `Register PRD vN`), then record the user's
|
|
60
|
-
approval (`change authorize …`, as `$pincer-narrow` describes), select and activate.
|
|
61
|
-
`legacy` with legacy receipts, or a v0.5.0 binding (`Runtime change <id> · revision …`)
|
|
62
|
-
→ run `node scripts/pincer-runtime.cjs migrate --preview --prd .prd/prd-vN.md`, show
|
|
63
|
-
the plan (backups, receipts imported as history, the converted binding, the
|
|
64
|
-
`.gitignore` line, the local selection) and ask once whether to apply. Apply only on
|
|
65
|
-
a yes, then commit the rewritten tickets, `.gitignore` and the record as `Migrate PRD
|
|
66
|
-
vN to the runtime`. The migrated change is planned with no authorization: record the
|
|
67
|
-
user's actual earlier instruction with `change authorize` (the v0.5.0 free text is
|
|
68
|
-
history only) and activate it. Never migrate silently, and never apply when the
|
|
69
|
-
preview reports a conflict.
|
|
70
|
-
|
|
71
|
-
## Loop (per ticket, in dependency order)
|
|
72
|
-
|
|
73
|
-
1. **Start:** `scripts/pincer-ticket.sh start T-{NN}` — refuses while a `depends_on` ticket
|
|
74
|
-
isn't done, and stamps the start time. Read the ticket and the files it references.
|
|
75
|
-
Announce: "Starting T-{NN}: {title}."
|
|
76
|
-
2. **Implement.** Follow the conventions in `AGENTS.md` and the PRD's architecture and
|
|
77
|
-
visual direction. Installing a dependency not named in the PRD's architecture is a
|
|
78
|
-
stop-and-ask: verify it's the real package on the registry (linked repo, downloads —
|
|
79
|
-
hallucinated names get typosquatted), say why it earns its place, and wait for a yes.
|
|
80
|
-
For an S ticket, implement directly. For an M ticket touching isolated files, you may
|
|
81
|
-
dispatch a subagent with a clean prompt: paste the full ticket body, the relevant
|
|
82
|
-
conventions, and nothing else.
|
|
83
|
-
3. **Verify:** `scripts/pincer-ticket.sh verify T-{NN}` — runs the Verification block and
|
|
84
|
-
writes the receipt only if it exits 0 (after migration it records an attempt with the
|
|
85
|
-
captured log under `.pincer/runtime/` and writes no receipt into the ticket; readiness
|
|
86
|
-
derives from the latest attempt and the current source). Red → fix and re-run; report the actual output,
|
|
87
|
-
not assumptions. Green output is the definition of done, not your confidence. If the
|
|
88
|
-
check only validated syntax or a build, say so — that is not behavioral proof. A
|
|
89
|
-
visual judgment is recorded separately in evaluation, not as the receipt, and a tool
|
|
90
|
-
the check needs but cannot run yields an explicit `unverified` result, never
|
|
91
|
-
fabricated output.
|
|
92
|
-
4. **Self-review the diff** before committing: silent failures (empty catches,
|
|
93
|
-
un-awaited promises), leftover debug code, drift from the ticket's acceptance criteria.
|
|
94
|
-
Then a security sweep of the same diff:
|
|
95
|
-
- Check for secret-like assignments without printing values. If a scanner reports a
|
|
96
|
-
possible secret, report only its file and line until the value is safely redacted;
|
|
97
|
-
environment references and names in `.env.example` are allowed.
|
|
98
|
-
- External input touched by this diff is validated server-side, and untrusted
|
|
99
|
-
content (user input, LLM output) is escaped where rendered — per the
|
|
100
|
-
Security defaults in `AGENTS.md`.
|
|
101
|
-
- No error path leaks internals (stack traces, key names with values) to the client.
|
|
102
|
-
If the review changed code, run `verify` again — the receipt must match the code you commit.
|
|
103
|
-
5. **Close the ticket:** tick every verified acceptance-criteria checkbox (`- [ ]` → `- [x]`;
|
|
104
|
-
editing the checkboxes is allowed), then `scripts/pincer-ticket.sh done T-{NN}`. After
|
|
105
|
-
migration `done` consumes the current passing attempt and does not re-run the check; it
|
|
106
|
-
refuses with a reason code (`SOURCE_CHANGED`, `CHECK_CHANGED`, `CHECK_FAILED`,
|
|
107
|
-
`CRITERIA_UNTICKED`, …) and the next step when the latest attempt is not current. A
|
|
108
|
-
criterion that was cut is a scope change to record in the PRD, not a box to skip.
|
|
109
|
-
Inspect `git status --short`, preserve pre-existing staged work, and stage only the
|
|
110
|
-
explicit paths changed for this ticket plus its ticket file. Review `git diff --cached`
|
|
111
|
-
before committing as `T-{NN}: {title}`.
|
|
112
|
-
6. Give a one-line progress update ("T-02 done, 3 remaining") and continue. Quote the
|
|
113
|
-
wall-clock elapsed figure from `scripts/pincer-status.sh` when it shows one — it
|
|
114
|
-
appears while a ticket is in progress or a budget is set, and it is not a measure
|
|
115
|
-
of active execution time.
|
|
116
|
-
|
|
117
|
-
## Recovering a ticket file
|
|
118
|
-
|
|
119
|
-
Ticket lifecycle fields are written only by `scripts/pincer-ticket.sh`, and the guard
|
|
120
|
-
also blocks shell restores that would touch ticket files from the assistant's shell:
|
|
121
|
-
`git checkout`/`git restore`/`git switch` naming a ticket path or a normalized
|
|
122
|
-
pathspec that cannot be shown to stay outside `tickets/` (the whole tree, `.`, `:/`,
|
|
123
|
-
`:(top)`, globs, absolute or unexpanded paths, `tickets/…` in any spelling, a
|
|
124
|
-
`-C tickets` prefix), force flags (`-f`, `--force`, `--discard-changes`,
|
|
125
|
-
`--pathspec-from-file`), `git reset --hard|--merge|--keep`, `git stash` (except
|
|
126
|
-
`list`, `show`, `create`, `store`), `git clean -f` without a narrow pathspec,
|
|
127
|
-
`git checkout-index -a` and `git read-tree -u|--reset`, including when wrapped in
|
|
128
|
-
`bash -c`, `eval`, `nice`, `time`, `nohup`, `timeout` or `xargs`. Restoring HEAD
|
|
129
|
-
would erase a newer failed attempt and revive an old passing receipt. Branch
|
|
130
|
-
switches and file-specific restores outside `tickets/` stay allowed. The guard is a
|
|
131
|
-
pattern-based safety net for documented mistake forms, not a complete shell
|
|
132
|
-
boundary; the receipt and status checks remain the source of trust. When a ticket file is malformed or its state was hand
|
|
133
|
-
edited, preserve the malformed contents as they are, report the validation error that
|
|
134
|
-
the script or `scripts/pincer-status.sh` printed, and hand the repair to the user, who
|
|
135
|
-
performs it in their own terminal. Then return through the lifecycle — `start`,
|
|
136
|
-
`verify`, `done` — so the ticket carries fresh verification; a restored receipt is
|
|
137
|
-
never evidence. Do not recommend restoring source files or unrelated edits as routine
|
|
138
|
-
ticket repair. One exception: when the PRD is built with valid candidate evidence;
|
|
139
|
-
tracked files other than the ticket file being restored match the evaluated candidate
|
|
140
|
-
(or the candidate plus its evidence-only commit) with nothing untracked; the recorded
|
|
141
|
-
failure is explained by a working-tree change that has since been reverted (the failed
|
|
142
|
-
`last_check` was stamped while source differed from the candidate, and that difference
|
|
143
|
-
is gone); and the ticket's Verification block passes when run
|
|
144
|
-
directly rather than through `verify` (which would write a receipt), in the
|
|
145
|
-
same execution context as `verify` — the same shell, working directory, `PATH`
|
|
146
|
-
and environment, with no substituted binary and no repair made first — then
|
|
147
|
-
the committed evaluation still describes the tree. Say so, name the exact command
|
|
148
|
-
for the user to restore the ticket file in their own terminal, and
|
|
149
|
-
do not run `verify`, refresh the receipt or commit anything — the restored file is
|
|
150
|
-
what is already committed, not new evidence. If the block fails on that clean tree,
|
|
151
|
-
the failure is real: keep the failed `last_check` and repair through the lifecycle.
|
|
152
|
-
A changed executable, runner, working directory or environment repair requires a
|
|
153
|
-
new recorded verification through `verify`; the exception does not apply to it.
|
|
154
|
-
An unexplained failure cannot be cleared by restoring a receipt: when no
|
|
155
|
-
since-reverted source change explains it (a service down, a missing dependency, a
|
|
156
|
-
check that reads external data), keep the failure, name the cause you observed, and
|
|
157
|
-
ask for the environment to be repaired before `verify` runs again.
|
|
158
|
-
If source still differs from the candidate, name the differing paths and let the
|
|
159
|
-
user decide rather than asking which way to fix them; permission to restore a ticket
|
|
160
|
-
does not authorize discarding source changes.
|
|
161
|
-
After migration (a change binding exists) recovery is the lifecycle itself: retain the
|
|
162
|
-
failure, repair the cause, run `verify` again; readiness derives from the latest attempt,
|
|
163
|
-
both attempts stay in `.pincer/runtime/` and no tracked file changes. Never restore a
|
|
164
|
-
ticket file or delete `.pincer/runtime` to obtain a green status; the legacy exception
|
|
165
|
-
above applies only before migration. A session that died mid-`verify` leaves a `running`
|
|
166
|
-
attempt: run `node scripts/pincer-runtime.cjs recover`, which finalizes it as
|
|
167
|
-
`interrupted` once the owner process is gone, then `verify` again.
|
|
168
|
-
|
|
169
|
-
## Changes: pausing, decisions and completion
|
|
170
|
-
|
|
171
|
-
- Stopping before the change is complete (end of session, switching to another
|
|
172
|
-
change): `node scripts/pincer-runtime.cjs change pause <id> --reason "<why>" --note "<handoff for the next session>"`
|
|
173
|
-
and commit the record. Pausing keeps every ticket state, attempt and authorization;
|
|
174
|
-
it refuses while a check is running (`recover` first if its owner died). A fresh
|
|
175
|
-
session runs `resume`, then `change resume <id>` under the existing authorization —
|
|
176
|
-
do not ask the user to re-approve unchanged scope. Another change's work in the
|
|
177
|
-
meantime makes this change's passing attempts `SOURCE_CHANGED`; verify again, do
|
|
178
|
-
not ask for approval again.
|
|
179
|
-
- A newly discovered consequential choice: `node scripts/pincer-runtime.cjs change decide <id> --summary "<the question>"`
|
|
180
|
-
blocks execution (`DECISION_REQUIRED`) until the user answers; record the answer with
|
|
181
|
-
`change decide <id> --resolve D-NN --reference "<where>" --excerpt "<the user's words>"`,
|
|
182
|
-
then `change authorize <id> --agreement <digest> --reference … --excerpt … --decision D-NN`.
|
|
183
|
-
A revision within the user's delegation (for example an added regression check for
|
|
184
|
-
approved behavior) records `change authorize <id> --agreement <digest> --delegated --basis A-NN --explanation "<why it stays within the delegation>"`
|
|
185
|
-
without asking again, and the changed check still needs fresh verification.
|
|
186
|
-
- Editing the PRD under its filename, or a ticket's acceptance text, dependencies,
|
|
187
|
-
size, timeout, association or check — and, with strict coverage, a scenario's text,
|
|
188
|
-
a map link, a declared command or timeout, or a scope entry — changes the agreement:
|
|
189
|
-
execution refuses with `AGREEMENT_CHANGED` (status shows the structural difference;
|
|
190
|
-
`impact` explains it) until its disposition is recorded as above. Ticking criteria, starting or closing tickets and recording
|
|
191
|
-
attempts never change it. An `AGREEMENT_CHANGED` caused by an edit this session
|
|
192
|
-
did not make — a revised PRD, an added or changed ticket found on resume — is a
|
|
193
|
-
consequential decision: raise it with `change decide <id> --summary "<what changed>"`,
|
|
194
|
-
report the structural difference (and the `impact` report) and stop. A general instruction to continue,
|
|
195
|
-
resume or not re-ask never authorizes new scope; record a `user` authorization for
|
|
196
|
-
the revised agreement only for an instruction that names the revised content. With strict coverage a scenario that will not be delivered is
|
|
197
|
-
never dropped from the map or the PRD: it is deferred or removed through a decision
|
|
198
|
-
the user resolves naming it, a `scope` entry (a removal keeps a tombstone naming the
|
|
199
|
-
prior agreement) and an authorization naming that decision; `coverage` reports
|
|
200
|
-
`OBLIGATION_MISSING` or `SCOPE_UNAUTHORIZED` until then, and `change complete`
|
|
201
|
-
refuses. A revised check declaration (a stricter command, an added check) within the
|
|
202
|
-
user's delegation is a `--delegated` authorization and needs fresh verification.
|
|
203
|
-
- When every ticket is done and ready: `node scripts/pincer-runtime.cjs change complete <id>`
|
|
204
|
-
(it refuses unfinished tickets, unticked criteria, stale or failed verification and
|
|
205
|
-
open decisions; with strict coverage also an incomplete map, an unauthorized
|
|
206
|
-
disposition or a missing obligation, before the ticket gate) and commit the record
|
|
207
|
-
as `Complete PRD vN`. Completion never asks for candidate evidence. Completed means ready
|
|
208
|
-
for evaluation, not evaluated or released; a later finding is `change reopen <id> --reason …`
|
|
209
|
-
plus a fix ticket.
|
|
210
|
-
|
|
211
|
-
## Budget rules
|
|
212
|
-
|
|
213
|
-
- If the user set `PINCER_BUILD_BUDGET_MIN` or stated another budget, use the elapsed
|
|
214
|
-
figure from `scripts/pincer-status.sh` rather than estimating. If the remaining tickets won't fit,
|
|
215
|
-
stop and propose a scope cut: which remaining tickets to drop or shrink. Cutting scope
|
|
216
|
-
deliberately beats an unfinished mess — record the cut in the PRD's Out of Scope.
|
|
217
|
-
- If a ticket reveals the plan was wrong, stop and say so rather than silently diverging.
|
|
218
|
-
Update the ticket/PRD, then continue.
|
|
219
|
-
|
|
220
|
-
## When all tickets are done
|
|
221
|
-
|
|
222
|
-
On a project with change records, complete the change first (`change complete <id>`,
|
|
223
|
-
committed as `Complete PRD vN`). Then update the PRD to `status: built` and commit that change on its own (`PRD vN: built`).
|
|
224
|
-
The built transition is part of the candidate that `$pincer-evaluate` reviews; it is
|
|
225
|
-
never moved into a later evidence-only commit. Then finish with:
|
|
226
|
-
"All tickets built. Run `$pincer-evaluate` for a final quality pass."
|
|
227
|
-
|
|
228
|
-
## Authorization rule (shared by plan, narrow, code and evaluate)
|
|
229
|
-
|
|
230
|
-
Reuse explicit authorization for the same scope and decisions; ask only about a
|
|
231
|
-
material choice not already authorized, and prepare the concrete proposal before
|
|
232
|
-
asking. A decision the user delegated (for example "pick the architecture") does not
|
|
233
|
-
need another approval when you exercise it, but a newly discovered consequential
|
|
234
|
-
choice is surfaced before implementation. Record the authorization basis and the
|
|
235
|
-
scope it covers in the PRD or the handover, and on a project with change records as
|
|
236
|
-
a `change authorize` record (the user's words as the excerpt, or a `--delegated`
|
|
237
|
-
disposition with its basis). An agent-written record or a status
|
|
238
|
-
field is not authenticated human approval. When resuming without the context that
|
|
239
|
-
granted authorization, do not invent it — read the `resume` report; an authorization
|
|
240
|
-
it reports as `current` needs no repeat approval, and any other verdict is asked.
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pincer-evaluate
|
|
3
|
-
description: "Final quality pass over everything built — high-confidence findings only"
|
|
4
|
-
---
|
|
5
|
-
<!-- Generated from .claude/commands/pincer-evaluate.md by scripts/sync-prompts.sh — edit the source, not this file -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# $pincer-evaluate — Final Quality Pass
|
|
9
|
-
|
|
10
|
-
You are reviewing all work built this session against the PRD and tickets. Autonomous —
|
|
11
|
-
run the pipeline, then present results.
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
1. Run `scripts/pincer-status.sh`. Review only tickets associated with the selected
|
|
16
|
-
PRD. Every such ticket should be `done` with a current receipt; if one
|
|
17
|
-
is still open or in progress, stop and ask whether it was cut (then it goes in the
|
|
18
|
-
PRD's Out of Scope) or should be finished first via `$pincer-code`. Then get the full
|
|
19
|
-
diff of the change: identify the actual base commit before this change from
|
|
20
|
-
its ticket commits and recorded context. If it cannot be established, resolve
|
|
21
|
-
that uncertainty before claiming a complete review. Record full commit IDs for
|
|
22
|
-
`base` and `candidate` (`git rev-parse HEAD`), then review `git diff <base>..<candidate>`.
|
|
23
|
-
The candidate is the clean, committed tree that already includes the implementation,
|
|
24
|
-
the ticket closures, on a project with change records the `change complete` commit
|
|
25
|
-
(the `Runtime` line reads `… · completed ·`; `check` and `evidence export` refuse an
|
|
26
|
-
active, paused or unauthorized change), and the PRD `status: built` commit:
|
|
27
|
-
`git status --short` must be empty before review. If anything is uncommitted or the PRD is not yet built, return
|
|
28
|
-
to `$pincer-code`; do not review a dirty tree.
|
|
29
|
-
2. Dispatch a `code-quality-reviewer` agent with: the diff, the PRD's Success Criteria and
|
|
30
|
-
Scope sections, and the list of tickets. If the diff is large, split by area and
|
|
31
|
-
dispatch two in parallel. (No subagents on this platform? Review the diff yourself
|
|
32
|
-
in a separate pass, applying `.claude/agents/code-quality-reviewer.md` as the rubric.)
|
|
33
|
-
Keep the reviewer's report — or its explicit no-findings statement — for step 9,
|
|
34
|
-
where it is saved as an artifact; a review that left no record cannot be audited.
|
|
35
|
-
3. Yourself, in parallel, check spec compliance. On a change with strict coverage
|
|
36
|
-
(`Coverage strict …` in status) start from `node scripts/pincer-runtime.cjs coverage`:
|
|
37
|
-
its structure must be complete, and its scenario rows are the obligations — the
|
|
38
|
-
export derives every disposition from the map and the outcomes, so you do not
|
|
39
|
-
author `requirements`; your judgment is recorded as `adequacy` (whether the
|
|
40
|
-
declared checks and reviews really establish their scenarios) and in
|
|
41
|
-
`coverage_review`. Otherwise, for every requirement `R-NN` in the
|
|
42
|
-
PRD record one disposition: `delivered` (evidence on this candidate), `blocked`
|
|
43
|
-
(required behavior failed or was left unverified — this blocks PASS; do not relabel
|
|
44
|
-
it a known limitation to pass), or `deferred` (only with explicit user authorization;
|
|
45
|
-
record the scope decision in the PRD's Out of Scope and evaluate the revised
|
|
46
|
-
candidate). Compare what was built against every ticket's acceptance criteria and
|
|
47
|
-
the PRD scope, and list any gaps. Whether the requirement map is complete and each
|
|
48
|
-
check is semantically adequate is your judgment as reviewer — record that judgment
|
|
49
|
-
in the evaluation; the kit is not a mechanical traceability engine and does not
|
|
50
|
-
validate requirement-revision impact.
|
|
51
|
-
4. If the project has a UI, look at it — don't only read the code. Start it, open it in
|
|
52
|
-
the browser (screenshot via Chrome DevTools MCP if available), and check it against
|
|
53
|
-
the PRD's Visual Direction and Success Criteria. Note anything visibly broken or off.
|
|
54
|
-
5. Run a mechanical security audit:
|
|
55
|
-
- Inspect the relevant history with a secret scanner that redacts values, when one is
|
|
56
|
-
available. Otherwise review likely locations without copying candidate values into
|
|
57
|
-
output. Report file, line, and remediation only; a secret committed then deleted is
|
|
58
|
-
still leaked.
|
|
59
|
-
- `.gitignore` covers `.env*` (except `.env.example`), and `git ls-files | grep -i env`
|
|
60
|
-
shows only `.env.example`.
|
|
61
|
-
- `npm audit --omit=dev` (or the ecosystem's equivalent) — report high/critical only.
|
|
62
|
-
- If there's an HTTP API: hit one endpoint with invalid input (empty, oversized)
|
|
63
|
-
and confirm a clean 4xx with a generic message, no stack trace.
|
|
64
|
-
6. Filter the agent's findings: report only issues you'd flag in a real PR review —
|
|
65
|
-
concrete bugs, silent failures, misleading code. Drop nitpicks and style opinions.
|
|
66
|
-
7. Present findings as a short list with `file:line` references, ordered by severity.
|
|
67
|
-
Security findings always rank above style-adjacent ones. For each, say whether you
|
|
68
|
-
recommend fixing now through a ticket or recording it as a known issue.
|
|
69
|
-
8. Fix findings clearly within the authorized PRD through a new ticket associated with
|
|
70
|
-
that PRD. Use `pincer-ticket.sh` to start, verify, and close it, then make a scoped
|
|
71
|
-
`T-{NN}: {title}` commit. Ask only when a fix changes scope, architecture, or another
|
|
72
|
-
material decision; never make an ad-hoc `review: fixes` commit. Every fix commit
|
|
73
|
-
produces a new candidate: re-record `candidate`, re-run the checks against it, and
|
|
74
|
-
write fresh evidence in step 9 — never reuse a manifest from a previous candidate.
|
|
75
|
-
9. Persist evidence for the candidate under `.prd/evidence/prd-vN/<candidate>/`.
|
|
76
|
-
Strict coverage: run every declared command check as
|
|
77
|
-
`node scripts/pincer-runtime.cjs check C-NN --candidate <sha>` (no command, no
|
|
78
|
-
timeout: the map's declaration is the only source, and a supplied command is
|
|
79
|
-
`CHECK_UNDECLARED`); record each declared review or visual obligation in the
|
|
80
|
-
draft with its `result` and an artifact saved under the candidate's evidence
|
|
81
|
-
directory (a required one that is not passed with an artifact is
|
|
82
|
-
`REVIEW_MISSING`); write `adequacy: { verdict: "adequate" | "inadequate", note }`;
|
|
83
|
-
list every declared check once and no `requirements` (they are derived). The
|
|
84
|
-
export writes the inventory and map snapshots under `coverage/`, derives the
|
|
85
|
-
scenario and requirement rows and `delivery` (original versus agreed scope) and
|
|
86
|
-
validates them against the committed candidate; an `inadequate` judgment or a
|
|
87
|
-
failed required check is recorded honestly and blocks readiness. Migrated
|
|
88
|
-
project without strict coverage (the `Runtime` status line names a change): run
|
|
89
|
-
each executable check through the runtime on the clean candidate view —
|
|
90
|
-
`node scripts/pincer-runtime.cjs check C-NN --candidate <sha> -- <command>` (one
|
|
91
|
-
command per check, the command line as run; `npm test` stays one aggregate check) —
|
|
92
|
-
then write the authored fields to a draft outside the evidence directory, for
|
|
93
|
-
example `.pincer/drafts/<sha>.json`: `environment.tools` and `environment.limitations`,
|
|
94
|
-
`coverage_review`, `requirements`, review and visual checks with their saved
|
|
95
|
-
artifacts, `visual_review`, and a stub `{"id": "C-NN", "kind": "command",
|
|
96
|
-
"required": true|false}` for each executable check. Then run
|
|
97
|
-
`node scripts/pincer-runtime.cjs evidence export --candidate <sha> --base <base> --prd .prd/prd-vN.md --draft <file>`.
|
|
98
|
-
The export writes `checks/C-NN.log` from the captured logs, fills `command`,
|
|
99
|
-
`result`, `provenance: runtime` and `attempt` from the attempts, labels review and
|
|
100
|
-
visual checks `provenance: authored`, computes the digests and writes an evidence
|
|
101
|
-
schema 2 manifest; it refuses a dirty tree, a HEAD that is not the candidate, a stub
|
|
102
|
-
without an attempt, and a `passed` or `failed` command result written by hand. On a
|
|
103
|
-
project with change records the export also appends the evaluation to the change's
|
|
104
|
-
locator `.prd/evidence/changes/<id>.json` (the identity of this change's
|
|
105
|
-
evaluation; root `NOTES.md` stays the human summary and may be overwritten by a
|
|
106
|
-
later change's evaluation without losing this one) — commit the locator with the
|
|
107
|
-
evidence. A tool that cannot run is recorded as an authored command check with
|
|
108
|
-
`result: unverified` and a note, as before. Legacy project (no change binding):
|
|
109
|
-
author the schema 1 manifest as follows.
|
|
110
|
-
- `checks/C-NN.log` — the command and a redacted summary or safe log of each
|
|
111
|
-
executable check. Never secrets, never an environment dump. Record
|
|
112
|
-
one check per command: `command` holds the command line as run, never prose
|
|
113
|
-
describing a session, and a manual smoke run is recorded as the command lines
|
|
114
|
-
that were run (separate entries when they establish independent outcomes).
|
|
115
|
-
Independently assessed commands — the tracked `.env` check, the secret scan,
|
|
116
|
-
the dependency audit — are separate `checks` entries with their own `result`
|
|
117
|
-
and log, so only the tool that could not run is `unverified`. A test runner
|
|
118
|
-
such as `npm test` stays one aggregate check; do not split every subprocess or
|
|
119
|
-
assertion. Visual and review checks keep their kinds and get no artificial
|
|
120
|
-
shell command. Note a redaction rather than inventing a substitute command.
|
|
121
|
-
- `visual/<scenario>.png` — each visual capture from step 4, with its scenario,
|
|
122
|
-
viewport and observed result recorded in the manifest. When nothing renders,
|
|
123
|
-
record `visual_review: {applicable: false, reason}` and say why.
|
|
124
|
-
- `review/code-quality.md` — the reviewer's findings from step 2 with their
|
|
125
|
-
dispositions, or its explicit no-findings statement, recorded as a check of
|
|
126
|
-
kind `review` and referenced by the requirements it covers.
|
|
127
|
-
- `manifest.json` — evidence schema 1 (field list in the header of
|
|
128
|
-
`scripts/pincer-evidence.cjs`): selected PRD, full `base` and `candidate` IDs,
|
|
129
|
-
`created`, `environment` with tool limitations, `coverage_review` (your judgment
|
|
130
|
-
from step 3), one `requirements` entry per `R-NN` with its disposition, tickets
|
|
131
|
-
and check IDs, one `checks` entry per check with `kind`, `required`, `result`,
|
|
132
|
-
`command`, timestamp and artifact paths, and `artifacts` with digests from
|
|
133
|
-
`node scripts/pincer-evidence.cjs digest <file>...`.
|
|
134
|
-
A tool you cannot run yields a check with `result: unverified` and a note — never a
|
|
135
|
-
fabricated artifact. A deferred requirement carries `authorized_by` naming the
|
|
136
|
-
user's explicit authorization. Then run
|
|
137
|
-
`node scripts/pincer-evidence.cjs validate .prd/evidence/prd-vN/<candidate>/manifest.json --candidate <candidate> --prd .prd/prd-vN.md`
|
|
138
|
-
and correct the manifest until it prints `ok`; the same validator runs in status
|
|
139
|
-
and release. It checks the record's consistency, not that the commands ran.
|
|
140
|
-
10. Close out: write a brief `NOTES.md` at the repo root with frontmatter:
|
|
141
|
-
```yaml
|
|
142
|
-
---
|
|
143
|
-
prd: .prd/prd-vN.md
|
|
144
|
-
base: <full reviewed base commit ID>
|
|
145
|
-
candidate: <full reviewed candidate commit ID>
|
|
146
|
-
evidence: .prd/evidence/prd-vN/<candidate>/manifest.json
|
|
147
|
-
---
|
|
148
|
-
```
|
|
149
|
-
Then commit NOTES.md, the manifest, its listed artifacts and (change records) the
|
|
150
|
-
evaluation locator — and nothing else —
|
|
151
|
-
as `evaluate: PRD vN candidate <short sha>`. Status accepts this later commit only
|
|
152
|
-
when its diff from the candidate is limited to `NOTES.md`, the candidate's evidence
|
|
153
|
-
directories and evaluation locators; changes to source, tests, configuration,
|
|
154
|
-
tickets, the PRD or the change record (a lifecycle transition after the
|
|
155
|
-
candidate) require reevaluation. Legacy notes without these references
|
|
156
|
-
do not establish readiness. Then describe what was built, what was cut
|
|
157
|
-
and why, known issues, and what you'd do next with more time. Then a **Handover**
|
|
158
|
-
section, written for the stranger who inherits this repo in six months: how to get
|
|
159
|
-
oriented (which file to read first), what each dependency is for and why it earned
|
|
160
|
-
its place, and what breaks first as the code ages (the riskiest assumption, the
|
|
161
|
-
least-tested path). This is the first document a reviewer of this repo should read;
|
|
162
|
-
summarize the requirement dispositions from the manifest in it.
|
|
163
|
-
11. Suggest `$pincer-release` as the final step: "Run `$pincer-release` for a pass/fail audit of the
|
|
164
|
-
whole workflow's artifacts."
|
|
165
|
-
|
|
166
|
-
## Authorization rule (shared by plan, narrow, code and evaluate)
|
|
167
|
-
|
|
168
|
-
Reuse explicit authorization for the same scope and decisions; ask only about a
|
|
169
|
-
material choice not already authorized, and prepare the concrete proposal before
|
|
170
|
-
asking. A decision the user delegated (for example "pick the architecture") does not
|
|
171
|
-
need another approval when you exercise it, but a newly discovered consequential
|
|
172
|
-
choice is surfaced before implementation. Record the authorization basis and the
|
|
173
|
-
scope it covers in the PRD or the handover, and on a project with change records as
|
|
174
|
-
a `change authorize` record (the user's words as the excerpt, or a `--delegated`
|
|
175
|
-
disposition with its basis). An agent-written record or a status
|
|
176
|
-
field is not authenticated human approval. When resuming without the context that
|
|
177
|
-
granted authorization, do not invent it — read the `resume` report; an authorization
|
|
178
|
-
it reports as `current` needs no repeat approval, and any other verdict is asked.
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pincer-narrow
|
|
3
|
-
description: "Turn the approved PRD into local, AI-ready ticket files"
|
|
4
|
-
---
|
|
5
|
-
<!-- Generated from .claude/commands/pincer-narrow.md by scripts/sync-prompts.sh — edit the source, not this file -->
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
# $pincer-narrow — PRD to Local Tickets
|
|
9
|
-
|
|
10
|
-
You are decomposing the PRD into coherent, independently verifiable tickets stored as
|
|
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. 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.
|
|
16
|
-
|
|
17
|
-
**Initial request:** the text that follows the `$pincer-narrow` mention, if any (when omitted, use the playbook's documented default)
|
|
18
|
-
|
|
19
|
-
## Steps
|
|
20
|
-
|
|
21
|
-
1. Run `scripts/pincer-status.sh`. If tickets already exist for another PRD, leave them
|
|
22
|
-
as history. New tickets continue the numbering and existing ones are never renumbered.
|
|
23
|
-
If tickets already exist for this PRD, extend them only when the current request already
|
|
24
|
-
authorizes that work; otherwise present the concrete addition before asking. Then read the
|
|
25
|
-
PRD (`the text that follows the `$pincer-narrow` mention, if any (when omitted, use the playbook's documented default)` or the latest `.prd/prd-v*.md`). If its status isn't `draft`, ask
|
|
26
|
-
which PRD to use.
|
|
27
|
-
2. Decompose into tickets. Rules:
|
|
28
|
-
- Each ticket is one coherent unit. Use S, M, or L as relative scope indicators and
|
|
29
|
-
split work when that improves dependency order, verification, or ownership.
|
|
30
|
-
- For greenfield work, use a walking skeleton when it reduces integration risk. For
|
|
31
|
-
brownfield work, begin with the smallest protected vertical change; add a
|
|
32
|
-
characterization ticket before changing load-bearing code that lacks coverage.
|
|
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
|
-
(a navigation aid). Enabling work that implements no requirement states its purpose
|
|
39
|
-
in the ticket Objective. Resolve missing coverage and conflicting criteria with
|
|
40
|
-
the user before implementation; do not start with an unmapped required scenario. On a change with change records, author the map once as
|
|
41
|
-
`.prd/coverage/<change id>.json` (coverage map schema 1, "Coverage map" in
|
|
42
|
-
`docs/runtime-contracts.md`). Start from
|
|
43
|
-
`node scripts/pincer-runtime.cjs coverage scaffold --change <change id>`: it prints
|
|
44
|
-
a read-only draft listing every live scenario exactly once with its requirement,
|
|
45
|
-
every ticket with its objective, its own `Implements:` claim and its Verification
|
|
46
|
-
text, and an `Unresolved` list of what is still unauthored. It writes nothing,
|
|
47
|
-
adopts nothing and decides nothing — it removes the transcription, not the
|
|
48
|
-
judgment, so a ticket's claim is material to check rather than a link, and no check
|
|
49
|
-
command, ticket role or scope disposition is ever invented. The draft is not a map:
|
|
50
|
-
it carries no `schema` key and `coverage adopt` refuses it. You author the real map
|
|
51
|
-
yourself, working through the draft's unresolved entries:
|
|
52
|
-
one `scenarios` row per `S-NN` naming its
|
|
53
|
-
implementing tickets and declared checks, every ticket of the change in
|
|
54
|
-
`tickets` as `implements` or `enables` (with a rationale), each check declared
|
|
55
|
-
once in `checks` with its kind, `required` flag and, for a command, the exact
|
|
56
|
-
command line and timeout, and a `scope` entry (`deferred` or `removed`) for a
|
|
57
|
-
scenario this change will not deliver, naming the decision that records the
|
|
58
|
-
user's choice. The map is authored work you edit by hand; the runtime never
|
|
59
|
-
rewrites it, and it validates it against the PRD's definitions.
|
|
60
|
-
- Every ticket gets a runnable command in its Verification block — a fenced `bash`
|
|
61
|
-
block that exits 0 only when the ticket is done. `scripts/pincer-ticket.sh verify`
|
|
62
|
-
runs it verbatim and stamps the receipt that `done` requires, so it must be
|
|
63
|
-
non-interactive and self-contained (no "check by hand"). An optional
|
|
64
|
-
`timeout: <seconds>` frontmatter field (default 600) bounds the run; it is part of
|
|
65
|
-
the check identity, so changing it invalidates earlier passes.
|
|
66
|
-
- Each Verification section opens with `Proves:` — what the check establishes and
|
|
67
|
-
which regression it detects. A check for an executable change must exercise
|
|
68
|
-
observable behavior (including relevant rejection paths and, in brownfield work,
|
|
69
|
-
preservation of existing behavior) and fail when the behavior is wrong, not only
|
|
70
|
-
when an identifier is renamed. Reuse adequate focused tests. A build, a syntax
|
|
71
|
-
check, or an identifier grep alone is not proof; static assertions are primary
|
|
72
|
-
evidence only for static contracts such as generated files, and `Proves:` says so.
|
|
73
|
-
- Adequacy is a judgment about what the command observes, never a word match: do
|
|
74
|
-
not call a command sufficient because it contains `grep`, `test`, or a runner
|
|
75
|
-
name, nor insufficient for lacking them. Manual visual judgment is recorded
|
|
76
|
-
separately in evaluation; a tool the check needs but cannot run yields an
|
|
77
|
-
explicit `unverified` result, never fabricated evidence or a silent waiver.
|
|
78
|
-
- If the brief or stack implies automated tests, at least one ticket's verification
|
|
79
|
-
command must be the test runner (e.g. `npm test`) — manual checks alone don't count.
|
|
80
|
-
- Any ticket whose surface accepts external input (HTTP endpoint, form, file,
|
|
81
|
-
LLM output) gets an acceptance criterion for the reject path — what invalid
|
|
82
|
-
input produces (e.g. "empty goal → 400 with a clear message"), not only the
|
|
83
|
-
happy path.
|
|
84
|
-
- A greenfield setup ticket includes `.gitignore` covering `.env*` (except
|
|
85
|
-
`.env.example`) and an `.env.example` naming any required secrets before any
|
|
86
|
-
secret can exist in the repo. In brownfield repositories, preserve and verify
|
|
87
|
-
the existing ignore and environment conventions.
|
|
88
|
-
3. Write each ticket to `tickets/T-{NN}-{slug}.md` using
|
|
89
|
-
`.claude/references/ticket-template.md`, with `status: open` and an explicit
|
|
90
|
-
`prd: .prd/prd-vN.md` naming the selected PRD. Never infer this association from
|
|
91
|
-
numbering or old notes. The other state fields
|
|
92
|
-
(`started`, `last_check`, `verified`, `finished`) are added later by `scripts/pincer-ticket.sh` —
|
|
93
|
-
never write them yourself.
|
|
94
|
-
4. Present the ticket list (number, title, size, dependencies) as a table, followed
|
|
95
|
-
by the requirement map as a second table (requirement · scenario · ticket · check
|
|
96
|
-
or review method). Whether the map is complete and each check is adequate is your
|
|
97
|
-
judgment as the author; say so rather than presenting the table as mechanical proof.
|
|
98
|
-
|
|
99
|
-
Present the concrete breakdown and build order as a report, not a question. Reuse
|
|
100
|
-
existing authorization for the same scope and order.
|
|
101
|
-
|
|
102
|
-
5. Finalize. A breakdown that follows the PRD is already authorized by the PRD: do not
|
|
103
|
-
ask whether to proceed. Update the selected PRD frontmatter to `status: ticketed`,
|
|
104
|
-
inspect existing staged changes, stage that PRD and the explicit new ticket paths,
|
|
105
|
-
review `git diff --cached`, and commit only those paths. Ask first — and finalize
|
|
106
|
-
once it is resolved — only when step 4 surfaced a newly discovered consequential
|
|
107
|
-
choice or a scope change the PRD does not cover. Then register the change when the
|
|
108
|
-
`Runtime` status line says `legacy` and no ticket of this PRD carries legacy
|
|
109
|
-
receipts, or `changes` (the project already keeps change records):
|
|
110
|
-
`node scripts/pincer-runtime.cjs register --prd .prd/prd-vN.md` writes the change
|
|
111
|
-
record `.prd/changes/prd-vN.json` (retaining every earlier change); stage
|
|
112
|
-
`.prd/changes/` and `.gitignore` (registration adds `.pincer/` to it) and commit them
|
|
113
|
-
as `Register PRD vN`. Then record the user's actual approval against the agreement
|
|
114
|
-
the record binds — `node scripts/pincer-runtime.cjs change show prd-vN --json`
|
|
115
|
-
prints the agreement digest — with
|
|
116
|
-
`node scripts/pincer-runtime.cjs change authorize prd-vN --agreement <digest> --reference "<where the user said it>" --excerpt "<the user's approval, quoted>"`,
|
|
117
|
-
select it for this worktree (`node scripts/pincer-runtime.cjs change select prd-vN`)
|
|
118
|
-
and commit `.prd/changes/` as `Authorize PRD vN`. When the map was authored, adopt
|
|
119
|
-
strict coverage explicitly: `node scripts/pincer-runtime.cjs coverage adopt --preview --change prd-vN`
|
|
120
|
-
shows the inventory, the map digest and the agreement it records (it refuses an
|
|
121
|
-
incomplete map, naming the scenario or ticket); `--apply` writes the schema 3
|
|
122
|
-
record with a backup and grants nothing — record the user's approval of that
|
|
123
|
-
agreement with `change authorize` (the same instruction, if it named this
|
|
124
|
-
breakdown; a delegated disposition needs its basis) and commit `.prd/coverage/`
|
|
125
|
-
and `.prd/changes/` as `Adopt strict coverage for PRD vN`. A scenario the user
|
|
126
|
-
deferred or removed is a decision: `change decide --summary "<the choice>"`,
|
|
127
|
-
`--resolve D-NN` with the user's words naming the scenario, the `scope` entry in
|
|
128
|
-
the map, then `change authorize … --decision D-NN`. Never record a disposition
|
|
129
|
-
the user did not state; `coverage` reports `SCOPE_UNAUTHORIZED` until it is. The excerpt records the user's own
|
|
130
|
-
words; running the command proves nothing by itself, and a registration, a PRD
|
|
131
|
-
status or a passing check never becomes an authorization. A project whose tickets
|
|
132
|
-
carry legacy receipts, or that still holds a v0.5.0 binding (`Runtime change <id> ·
|
|
133
|
-
revision …`), is migrated from `$pincer-code` after a preview, never here. Finish with:
|
|
134
|
-
"Tickets ready in `tickets/`. Run `$pincer-code` to start implementing."
|
|
135
|
-
|
|
136
|
-
## Authorization rule (shared by plan, narrow, code and evaluate)
|
|
137
|
-
|
|
138
|
-
Reuse explicit authorization for the same scope and decisions; ask only about a
|
|
139
|
-
material choice not already authorized, and prepare the concrete proposal before
|
|
140
|
-
asking. A decision the user delegated (for example "pick the architecture") does not
|
|
141
|
-
need another approval when you exercise it, but a newly discovered consequential
|
|
142
|
-
choice is surfaced before implementation. Record the authorization basis and the
|
|
143
|
-
scope it covers in the PRD or the handover, and on a project with change records as
|
|
144
|
-
a `change authorize` record (the user's words as the excerpt, or a `--delegated`
|
|
145
|
-
disposition with its basis). An agent-written record or a status
|
|
146
|
-
field is not authenticated human approval. When resuming without the context that
|
|
147
|
-
granted authorization, do not invent it — read the `resume` report; an authorization
|
|
148
|
-
it reports as `current` needs no repeat approval, and any other verdict is asked.
|