pi-matt-pocock 0.2.2 → 0.3.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 (70) hide show
  1. package/ARCHITECTURE.zh-CN.md +37 -19
  2. package/README.md +80 -13
  3. package/package.json +12 -7
  4. package/procedures/code-review.md +25 -17
  5. package/procedures/codebase-design.md +11 -10
  6. package/procedures/deslop.md +4 -2
  7. package/procedures/diagnosing-bugs.md +25 -25
  8. package/procedures/domain-modeling.md +18 -20
  9. package/procedures/grill-me.md +1 -1
  10. package/procedures/grill-with-docs.md +1 -1
  11. package/procedures/grilling.md +29 -5
  12. package/procedures/handoff.md +1 -1
  13. package/procedures/implement.md +7 -1
  14. package/procedures/improve-codebase-architecture.md +22 -22
  15. package/procedures/pr.md +169 -0
  16. package/procedures/prototype.md +7 -6
  17. package/procedures/research.md +2 -2
  18. package/procedures/retro.md +42 -0
  19. package/procedures/setup-matt-pocock-skills.md +26 -22
  20. package/procedures/tdd.md +17 -15
  21. package/procedures/teach.md +11 -7
  22. package/procedures/to-questionnaire.md +7 -5
  23. package/procedures/to-spec.md +2 -2
  24. package/procedures/to-tickets.md +12 -12
  25. package/procedures/triage.md +22 -22
  26. package/procedures/wait-what.md +1 -1
  27. package/procedures/wayfinder.md +24 -24
  28. package/procedures/wizard.md +7 -7
  29. package/procedures/writing-for-agents.md +14 -14
  30. package/{procedures → references}/ADR-FORMAT.md +11 -11
  31. package/{procedures → references}/AGENT-BRIEF.md +4 -4
  32. package/{procedures → references}/DEEPENING.md +3 -3
  33. package/{procedures → references}/DESIGN-IT-TWICE.md +7 -7
  34. package/{procedures → references}/GLOSSARY-FORMAT.md +9 -2
  35. package/{procedures → references}/HTML-REPORT.md +15 -15
  36. package/{procedures → references}/LEARNING-RECORD-FORMAT.md +10 -10
  37. package/{procedures → references}/LOGIC.md +5 -5
  38. package/{procedures → references}/MISSION-FORMAT.md +2 -2
  39. package/{procedures → references}/OUT-OF-SCOPE.md +11 -11
  40. package/{procedures → references}/RESOURCES-FORMAT.md +1 -1
  41. package/{procedures → references}/SKILL-MECHANICS.md +3 -3
  42. package/{procedures → references}/UI.md +14 -14
  43. package/{procedures → references}/bdd-best-practices.md +3 -3
  44. package/{procedures → references}/bdd.md +9 -9
  45. package/{procedures → references}/domain.md +12 -12
  46. package/references/issue-tracker-github.md +50 -0
  47. package/{procedures → references}/issue-tracker-gitlab.md +9 -9
  48. package/{procedures → references}/issue-tracker-local.md +3 -3
  49. package/{procedures → references}/phase-boundaries.md +8 -8
  50. package/src/catalog.json +49 -28
  51. package/src/catalog.ts +58 -2
  52. package/src/index.ts +521 -383
  53. package/src/native-dialog.ts +149 -213
  54. package/src/resolver.ts +30 -14
  55. package/src/workflow.ts +55 -16
  56. package/upstream/UPSTREAM.md +116 -0
  57. package/{scripts → upstream}/check-upstream-sync.mjs +12 -12
  58. package/{upstream-selection.json → upstream/upstream-selection.json} +9 -7
  59. package/UPSTREAM.md +0 -63
  60. package/procedures/CONTEXT-FORMAT.md +0 -60
  61. package/procedures/issue-tracker-github.md +0 -45
  62. /package/{procedures → assets}/hitl-loop.template.sh +0 -0
  63. /package/{procedures → assets}/template.sh +0 -0
  64. /package/{procedures → references}/GLOSSARY.md +0 -0
  65. /package/{procedures → references}/gherkin-guide.md +0 -0
  66. /package/{procedures → references}/mocking.md +0 -0
  67. /package/{procedures → references}/testing-anti-patterns.md +0 -0
  68. /package/{procedures → references}/tests.md +0 -0
  69. /package/{procedures → references}/triage-labels.md +0 -0
  70. /package/{procedures → references}/writing-great-skills.md +0 -0
@@ -2,23 +2,23 @@
2
2
 
3
3
  A discipline for hard bugs. Skip phases only when explicitly justified.
4
4
 
5
- When exploring the codebase, read `CONTEXT.md` (if it exists) to get a clear mental model of the relevant modules, and check ADRs in the area you're touching.
5
+ When exploring the codebase, read `GLOSSARY.md` (if it exists) to get a clear mental model of the relevant modules, and check ADRs in the area you're touching.
6
6
 
7
7
  ## Redact
8
8
 
9
- This skill has you show commands, outputs and captured artifacts. **Redact every secret first** — write `<REDACTED>` in its place. Build loops against env vars, so the credential stays in the environment rather than in what you show. Captured artifacts carry auth headers: quote only the lines that carry the signal.
9
+ This skill has you show commands, outputs and captured artifacts. **Redact every secret first**: write `<REDACTED>` in its place. Build loops against env vars, so the credential stays in the environment rather than in what you show. Captured artifacts carry auth headers: quote only the lines that carry the signal.
10
10
 
11
11
  If the redacted output is not enough to diagnose the bug, say so and ask the user.
12
12
 
13
- ## Phase 1 — Build a feedback loop
13
+ ## Phase 1: Build a feedback loop
14
14
 
15
- **This is the skill.** Everything else is mechanical. If you have a **tight** pass/fail signal for the bug — one that goes red on _this_ bug — you will find the cause; bisection, hypothesis-testing, and instrumentation all just consume it. If you don't have one, no amount of staring at code will save you.
15
+ **This is the skill.** Everything else is mechanical. If you have a **tight** pass/fail signal for the bug (one that goes red on _this_ bug), you will find the cause; bisection, hypothesis-testing, and instrumentation all just consume it. If you don't have one, no amount of staring at code will save you.
16
16
 
17
17
  Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to give up.**
18
18
 
19
19
  ### Ways to construct one — try them in roughly this order
20
20
 
21
- 1. **Failing test** at whatever seam reaches the bug — unit, integration, e2e.
21
+ 1. **Failing test** at whatever seam reaches the bug: unit, integration, e2e.
22
22
  2. **Curl / HTTP script** against a running dev server.
23
23
  3. **CLI invocation** with a fixture input, diffing stdout against a known-good snapshot.
24
24
  4. **Headless browser script** (Playwright / Puppeteer) — drives the UI, asserts on DOM/console/network.
@@ -27,7 +27,7 @@ Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to give
27
27
  7. **Property / fuzz loop.** If the bug is "sometimes wrong output", run 1000 random inputs and look for the failure mode.
28
28
  8. **Bisection harness.** If the bug appeared between two known states (commit, dataset, version), automate "boot at state X, check, repeat" so you can `git bisect run` it.
29
29
  9. **Differential loop.** Run the same input through old-version vs new-version (or two configs) and diff outputs.
30
- 10. **HITL bash script.** Last resort. If a human must click, drive _them_ with `hitl-loop.template.sh` so the loop is still structured. Captured output feeds back to you.
30
+ 10. **HITL bash script.** Last resort. If a human must click, drive _them_ with [hitl-loop.template.sh](../assets/hitl-loop.template.sh) so the loop is still structured. Captured output feeds back to you.
31
31
 
32
32
  Build the right feedback loop, and the bug is 90% fixed.
33
33
 
@@ -39,7 +39,7 @@ Treat the loop as a product. Once you have _a_ loop, **tighten** it:
39
39
  - Can I make the signal sharper? (Assert on the specific symptom, not "didn't crash".)
40
40
  - Can I make it more deterministic? (Pin time, seed RNG, isolate filesystem, freeze network.)
41
41
 
42
- A 30-second flaky loop is barely better than no loop; a 2-second deterministic one is tight — a debugging superpower.
42
+ A 30-second flaky loop is barely better than no loop; a 2-second deterministic one is tight, a debugging superpower.
43
43
 
44
44
  ### Non-deterministic bugs
45
45
 
@@ -49,28 +49,28 @@ The goal is not a clean repro but a **higher reproduction rate**. Loop the trigg
49
49
 
50
50
  Stop and say so explicitly. List what you tried. Ask the user directly in the conversation for (a) access to whatever environment reproduces it, (b) a redacted captured artifact (HAR file, log dump, core dump, screen recording with timestamps), or (c) permission to add temporary production instrumentation, then wait for the reply. Do **not** proceed to hypothesise without a loop.
51
51
 
52
- ### Completion criterion — a tight loop that goes red
52
+ ### Completion criterion: a tight loop that goes red
53
53
 
54
- Phase 1 is done when the loop is **tight** and **red-capable**: you can name **one command** — a script path, a test invocation, a curl — that you have **already run at least once** (show the invocation and its output, redacted), and that is:
54
+ Phase 1 is done when the loop is **tight** and **red-capable**: you can name **one command** (a script path, a test invocation, a curl) that you have **already run at least once** (show the invocation and its output, redacted), and that is:
55
55
 
56
- - [ ] **Red-capable** — it drives the actual bug code path and asserts the **user's exact symptom**, so it can go red on this bug and green once fixed. Not "runs without erroring" — it must be able to _catch this specific bug_.
57
- - [ ] **Deterministic** — same verdict every run (flaky bugs: a pinned, high reproduction rate, per above).
58
- - [ ] **Fast** — seconds, not minutes.
59
- - [ ] **Agent-runnable** — you can run it unattended; a human in the loop only via `hitl-loop.template.sh`.
56
+ - [ ] **Red-capable**: it drives the actual bug code path and asserts the **user's exact symptom**, so it can go red on this bug and green once fixed. Not "runs without erroring"; it must be able to _catch this specific bug_.
57
+ - [ ] **Deterministic**: same verdict every run (flaky bugs: a pinned, high reproduction rate, per above).
58
+ - [ ] **Fast**: seconds, not minutes.
59
+ - [ ] **Agent-runnable** — you can run it unattended; a human in the loop only via [hitl-loop.template.sh](../assets/hitl-loop.template.sh).
60
60
 
61
- If you catch yourself reading code to build a theory before this command exists, **stop — jumping straight to a hypothesis is the exact failure this skill prevents.** No red-capable command, no Phase 2.
61
+ If you catch yourself reading code to build a theory before this command exists, **stop: jumping straight to a hypothesis is the exact failure this skill prevents.** No red-capable command, no Phase 2.
62
62
 
63
63
  ## CRITICAL: No loop, no theory
64
64
 
65
65
  The feedback loop **is** the skill. Do not hypothesise, instrument, or fix until a tight, red-capable command exists — one you have already run at least once, that drives this bug's exact symptom, deterministically and fast. No red-capable command, no Phase 2.
66
66
 
67
- ## Phase 2 — Reproduce + minimise
67
+ ## Phase 2: Reproduce + minimise
68
68
 
69
69
  Run the loop. Watch it go red — the bug appears.
70
70
 
71
71
  Confirm:
72
72
 
73
- - [ ] The loop produces the failure mode the **user** described — not a different failure that happens to be nearby. Wrong bug = wrong fix.
73
+ - [ ] The loop produces the failure mode the **user** described, not a different failure that happens to be nearby. Wrong bug = wrong fix.
74
74
  - [ ] The failure is reproducible across multiple runs (or, for non-deterministic bugs, reproducible at a high enough rate to debug against).
75
75
  - [ ] You have captured the exact symptom (error message, wrong output, slow timing) so later phases can verify the fix actually addresses it.
76
76
 
@@ -80,11 +80,11 @@ Once it's red, shrink the repro to the **smallest scenario that still goes red**
80
80
 
81
81
  Why bother: a minimal repro shrinks the hypothesis space in Phase 3 (fewer moving parts left to suspect) and becomes the clean regression test in Phase 5.
82
82
 
83
- Done when **every remaining element is load-bearing** — removing any one of them makes the loop go green.
83
+ Done when **every remaining element is load-bearing**: removing any one of them makes the loop go green.
84
84
 
85
85
  Do not proceed until you have reproduced **and** minimised.
86
86
 
87
- ## Phase 3 — Hypothesise
87
+ ## Phase 3: Hypothesise
88
88
 
89
89
  Generate **3–5 ranked hypotheses** before testing any of them. Single-hypothesis generation anchors on the first plausible idea.
90
90
 
@@ -92,11 +92,11 @@ Each hypothesis must be **falsifiable**: state the prediction it makes.
92
92
 
93
93
  > Format: "If <X> is the cause, then <changing Y> will make the bug disappear / <changing Z> will make it worse."
94
94
 
95
- If you cannot state the prediction, the hypothesis is a vibe — discard or sharpen it.
95
+ If you cannot state the prediction, the hypothesis is a vibe: discard or sharpen it.
96
96
 
97
- **Show the ranked list to the user before testing.** They often have domain knowledge that re-ranks instantly ("we just deployed a change to #3"), or know hypotheses they've already ruled out. Cheap checkpoint, big time saver. Don't block on it — proceed with your ranking if the user is AFK.
97
+ **Show the ranked list to the user before testing.** They often have domain knowledge that re-ranks instantly ("we just deployed a change to #3"), or know hypotheses they've already ruled out. Cheap checkpoint, big time saver. Don't block on it; proceed with your ranking if the user is AFK.
98
98
 
99
- ## Phase 4 — Instrument
99
+ ## Phase 4: Instrument
100
100
 
101
101
  Each probe must map to a specific prediction from Phase 3. **Change one variable at a time.**
102
102
 
@@ -110,9 +110,9 @@ Tool preference:
110
110
 
111
111
  **Perf branch.** For performance regressions, logs are usually wrong. Instead: establish a baseline measurement (timing harness, `performance.now()`, profiler, query plan), then bisect. Measure first, fix second.
112
112
 
113
- ## Phase 5 — Fix + regression test
113
+ ## Phase 5: Fix + regression test
114
114
 
115
- Write the regression test **before the fix** — but only if there is a **correct seam** for it.
115
+ Write the regression test **before the fix**, but only if there is a **correct seam** for it.
116
116
 
117
117
  A correct seam is one where the test exercises the **real bug pattern** as it occurs at the call site. If the only available seam is too shallow (single-caller test when the bug needs multiple callers, unit test that can't replicate the chain that triggered the bug), a regression test there gives false confidence.
118
118
 
@@ -121,7 +121,7 @@ A correct seam is one where the test exercises the **real bug pattern** as it oc
121
121
  If a correct seam exists:
122
122
 
123
123
  1. Turn the minimised repro into a failing test at that seam.
124
- 2. Watch it fail.
124
+ 2. Watch it fail. If you forced the red by mutating code or a fixture, `diff` against a pristine copy to prove the mutation landed before you trust it.
125
125
  3. Apply the fix.
126
126
  4. Watch it pass.
127
127
  5. Re-run the Phase 1 feedback loop against the original (un-minimised) scenario.
@@ -134,6 +134,6 @@ Required before declaring done:
134
134
  - [ ] Regression test passes (or absence of seam is documented)
135
135
  - [ ] All `[DEBUG-...]` instrumentation removed (`grep` the prefix)
136
136
  - [ ] Throwaway prototypes deleted (or moved to a clearly-marked debug location)
137
- - [ ] The hypothesis that turned out correct is stated in the commit / PR message — so the next debugger learns
137
+ - [ ] The hypothesis that turned out correct is stated in the commit / PR message, so the next debugger learns
138
138
 
139
139
  **Then determine from the evidence what would have prevented this bug** — no good test seam / tangled callers / hidden coupling / nothing worth changing / another cause. Record the finding and run [code-review](code-review.md) over the fix immediately — a bug fix without a two-axis review is not finished work. If the evidence leaves a genuinely user-owned architectural trade-off, ask it through `matt_pocock_ask` without making the review wait; otherwise hand off to [improve-codebase-architecture](improve-codebase-architecture.md) when it involves no good test seam, tangled callers, or hidden coupling. Make the recommendation **after** the fix is in, not before — you have more information now than when you started.
@@ -1,6 +1,6 @@
1
1
  # Domain Modeling
2
2
 
3
- Actively build and sharpen the project's domain model as you design. This is the *active* discipline — challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `CONTEXT.md` for vocabulary is not this skill — that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
3
+ Actively build and sharpen the project's domain model as you design. This is the *active* discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `GLOSSARY.md` for vocabulary is not this skill: that's a one-line habit any procedure can do. This skill is for when you're changing the model, not just consuming it.)
4
4
 
5
5
  ## File structure
6
6
 
@@ -8,7 +8,7 @@ Most repos have a single context:
8
8
 
9
9
  ```
10
10
  /
11
- ├── CONTEXT.md
11
+ ├── GLOSSARY.md
12
12
  ├── docs/
13
13
  │ └── adr/
14
14
  │ ├── 0001-event-sourced-orders.md
@@ -16,33 +16,33 @@ Most repos have a single context:
16
16
  └── src/
17
17
  ```
18
18
 
19
- If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
19
+ If a `GLOSSARY-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
20
20
 
21
21
  ```
22
22
  /
23
- ├── CONTEXT-MAP.md
23
+ ├── GLOSSARY-MAP.md
24
24
  ├── docs/
25
25
  │ └── adr/ ← system-wide decisions
26
26
  ├── src/
27
27
  │ ├── ordering/
28
- │ │ ├── CONTEXT.md
28
+ │ │ ├── GLOSSARY.md
29
29
  │ │ └── docs/adr/ ← context-specific decisions
30
30
  │ └── billing/
31
- │ ├── CONTEXT.md
31
+ │ ├── GLOSSARY.md
32
32
  │ └── docs/adr/
33
33
  ```
34
34
 
35
- Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
35
+ Create files lazily: only when you have something to write. If no `GLOSSARY.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
36
36
 
37
37
  ## During the session
38
38
 
39
39
  ### Challenge against the glossary
40
40
 
41
- When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
41
+ When the user uses a term that conflicts with the existing language in `GLOSSARY.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?"
42
42
 
43
43
  ### Sharpen fuzzy language
44
44
 
45
- When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
45
+ When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account': do you mean the Customer or the User? Those are different things."
46
46
 
47
47
  ### Discuss concrete scenarios
48
48
 
@@ -50,24 +50,22 @@ When domain relationships are being discussed, stress-test them with specific sc
50
50
 
51
51
  ### Cross-reference with code
52
52
 
53
- When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
53
+ When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?"
54
54
 
55
- ### Update CONTEXT.md inline
55
+ ### Update GLOSSARY.md inline
56
56
 
57
- When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format in [CONTEXT-FORMAT.md](./CONTEXT-FORMAT.md).
57
+ When a term is resolved, update `GLOSSARY.md` right there. Don't batch these up: capture them as they happen. Use the format in [GLOSSARY-FORMAT.md](../references/GLOSSARY-FORMAT.md).
58
58
 
59
- `CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
59
+ `GLOSSARY.md` should be totally devoid of implementation details. Do not treat `GLOSSARY.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
60
60
 
61
- ## CRITICAL: CONTEXT.md is a glossary and nothing else
62
-
63
- Never treat `CONTEXT.md` as a spec, a scratch pad, or a home for implementation decisions — implementation details are forbidden there. Capture resolved terms inline the moment they crystallise, and offer an ADR only when a decision is hard to reverse, surprising without context, and the result of a real trade-off.
61
+ Keep glossary entries pure: they must not contain implementation paths, function behavior, tests, or code/spec divergence. Do not add Open questions or Resolutions sections to `GLOSSARY.md`. When asked to record uncertainties, use a separate question note following the repository's document conventions, or the conversation. Keep unresolved policy there; do not state a universal policy for an unresolved choice. Check each definition against those questions before finishing.
64
62
 
65
63
  ### Offer ADRs sparingly
66
64
 
67
65
  Only offer to create an ADR when all three are true:
68
66
 
69
- 1. **Hard to reverse** — the cost of changing your mind later is meaningful
70
- 2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
71
- 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
67
+ 1. **Hard to reverse**: the cost of changing your mind later is meaningful
68
+ 2. **Surprising without context**: a future reader will wonder "why did they do it this way?"
69
+ 3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
72
70
 
73
- If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
71
+ If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](../references/ADR-FORMAT.md).
@@ -2,4 +2,4 @@ Run a [grilling](grilling.md) session.
2
2
 
3
3
  ## CRITICAL: One question at a time, with a recommendation
4
4
 
5
- Run the [grilling](grilling.md) discipline relentlessly: ask one question at a time using the `matt_pocock_ask` interactive selection tool, provide suggested options with a recommended option marked "(Recommended)" or set as fallback, support a timeout mechanism, and allow the user to type custom answers. Wait for the reply before continuing. Do not act until the user confirms shared understanding.
5
+ Run the [grilling](grilling.md) discipline relentlessly: ask one question at a time using the `matt_pocock_ask` interactive selection tool, provide suggested options with a recommended option marked "(Recommended)" passed as the required recommended value, and allow the user to type custom answers. The deadline adopts the recommendation, so no question waits indefinitely. Wait for the reply before continuing. Do not act until the user confirms shared understanding.
@@ -2,4 +2,4 @@ Run a [grilling](grilling.md) session, with [domain-modeling](domain-modeling.md
2
2
 
3
3
  ## CRITICAL: Grill with grilling and domain-modeling bundled
4
4
 
5
- Run the [grilling](grilling.md) session with the bundled [domain-modeling](domain-modeling.md) procedure. Every sharpened term and locked decision lands in `CONTEXT.md` or an ADR as it crystallises — the paper trail is what distinguishes this procedure from [grill-me](grill-me.md). Ask interview questions using the `matt_pocock_ask` interactive tool, one at a time, with suggested options, recommendations, timeout, and custom response support. Wait for each reply as [grilling](grilling.md) dictates.
5
+ Run the [grilling](grilling.md) session with the bundled [domain-modeling](domain-modeling.md) procedure. Every sharpened term and locked decision lands in `GLOSSARY.md` or an ADR as it crystallises — the paper trail is what distinguishes this procedure from [grill-me](grill-me.md). Ask interview questions using the `matt_pocock_ask` interactive tool, one at a time, with suggested options, a required recommendation, a deadline that adopts it, and custom response support. Wait for each reply as [grilling](grilling.md) dictates.
@@ -1,11 +1,35 @@
1
- Interview me relentlessly about every aspect of this until we reach a shared understanding. Walk down each branch of the decision tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
1
+ Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
2
2
 
3
- Ask each question using the `matt_pocock_ask` interactive selection tool, one at a time, and wait for the reply before continuing. Give 2–4 concise alternatives, put your recommended option first marked "(Recommended)", specify a timeout, and explicitly welcome a different answer via custom input. When a recommended option is provided, a timeout automatically adopts the recommendation and continues the workflow; when no recommended option is provided, the selection has no timeout and waits for the user's decision. Asking multiple questions at once is bewildering.
3
+ Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled: the questions you can ask _now_ without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
4
4
 
5
- If a *fact* can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking me. The *decisions*, though, are mine — put each one to me via `matt_pocock_ask` and wait for my answer.
5
+ Format a round like so:
6
6
 
7
- Do not act on it until I confirm we have reached a shared understanding. Once that confirmation has been reached and the confirmed decisions are recorded: Do not ask whether to continue or request separate permission for the next step; begin the next applicable workflow work immediately.
7
+ ```
8
+ ❓ **Q1** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
9
+
10
+ ➡️ <your recommended answer>
11
+
12
+ ---
13
+
14
+ ❓ **Q2** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
15
+
16
+ ➡️ <your recommended answer>
17
+ ```
18
+
19
+ Word each question so "yes" accepts your recommended answer.
20
+
21
+ Each round the user answers reshapes the tree: settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a _later_ round, not this one.
22
+
23
+ Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), use a teammate with a fresh context window when the teammate facility is available, otherwise look it up yourself; don't ask the user for anything you could look up. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait; ask the rest of the frontier now. The _decisions_ are the user's: put each to them and wait.
24
+
25
+ The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Do not act on it until the user confirms you have reached a shared understanding.
8
26
 
9
27
  ## CRITICAL: One question at a time — facts you look up, decisions the user makes
10
28
 
11
- Ask each question using `matt_pocock_ask`, one at a time, and wait for the reply before continuing; multiple questions at once is bewildering. Put the recommended option first, marked "(Recommended)", specify a timeout, and leave room for a different answer via custom typing. When a recommended option is provided, timeout automatically adopts it; without a recommendation, the selection has no timeout and waits for the user. If a fact can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking. The decisions are the user's — put each one to them, and do not act until they confirm shared understanding. After shared understanding is confirmed, proceed directly to the next applicable workflow work rather than asking whether to continue.
29
+ In this harness a frontier round is delivered through `matt_pocock_ask`, one question at a time. For each frontier question: give 2–4 concise alternatives, put your recommended answer first marked "(Recommended)", pass that same string as the required `recommended` value, and leave room for a different answer through custom input. The deadline adopts the recommendation and continues the workflow, so no question waits indefinitely. A round is complete when the user has answered every question on the frontier. Asking several questions inside one selector is bewildering.
30
+
31
+ If a *fact* can be found by exploring the environment (filesystem, tools, etc.), look it up rather than asking. The *decisions* are the user's — put each one to them, and do not act until they confirm shared understanding. Treat explicitly approved decisions already recorded in the task or authoritative spec as confirmed shared understanding: do not reopen them, invent new policy choices, or require a second confirmation. Ask only for unresolved decisions that affect the requested scope.
32
+
33
+ For an approval-required external or destructive action, recommend the option that does not act, because the deadline adopts it. Cancellation or interruption leaves the decision pending, not adopted. Once shared understanding is confirmed and the decisions are recorded, do not ask whether to continue or request separate permission for the next step: begin the next applicable workflow work immediately.
34
+
35
+ When running this procedure as a standalone capability, ask in conversation because workflow-only question tools are unavailable.
@@ -1,4 +1,4 @@
1
- Write a portable handoff document summarising the current conversation. This skill only writes the document: it does not create, fork, or seed a session. Save it to the temporary directory of the user's OS — not the current workspace. The user or a receiving agent may use the document in a later session.
1
+ Write a portable handoff document summarising the current conversation. This skill only writes the document: it does not create, fork, or seed a session. Save it to the temporary directory of the user's OS (`$TMPDIR`, else `/tmp`; `%TEMP%` on Windows), not the current workspace. The user or a receiving agent may use the document in a later session.
2
2
 
3
3
  Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
4
4
 
@@ -1,6 +1,12 @@
1
1
  Implement the work described by the user in the spec or tickets.
2
2
 
3
- Use [bdd](bdd.md) at the agreed seams, one red-green slice at a time. The bundled [tdd](tdd.md) owns Automation-phase test quality, seams, and mocking guidance.
3
+ If the user passes a ticket reference, fetch it from the issue tracker and state its title before starting. If the reference is ambiguous, ask.
4
+
5
+ Use [bdd](../references/bdd.md) at the agreed seams, one red-green slice at a time. The bundled [tdd](tdd.md) owns Automation-phase test quality, seams, and mocking guidance.
6
+
7
+ ## Minimal fix
8
+
9
+ Fix the defect directly. Do not add a defensive default or fallback for a value the trusted path cannot miss: `quantity ?? 1` and `quantity || 0` are the shape to avoid. Validate once at the boundary instead of guarding at every use.
4
10
 
5
11
  ## Verification and integration
6
12
 
@@ -1,24 +1,24 @@
1
1
  # Improve Codebase Architecture
2
2
 
3
- Surface architectural friction and propose **deepening opportunities** — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
3
+ Surface architectural friction and propose **deepening opportunities**: refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
4
4
 
5
5
  This command is _informed_ by the project's domain model and built on a shared design vocabulary:
6
6
 
7
7
  - Follow the bundled [codebase-design](codebase-design.md) procedure for the architecture vocabulary (**module**, **interface**, **depth**, **seam**, **adapter**, **leverage**, **locality**) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use these terms exactly in every suggestion — don't drift into "component," "service," "API," or "boundary."
8
- - The domain language in `CONTEXT.md` gives names to good seams; ADRs in `docs/adr/` record decisions this command should not re-litigate.
8
+ - The domain language in `GLOSSARY.md` gives names to good seams; ADRs in `docs/adr/` record decisions this command should not re-litigate.
9
9
 
10
10
  ## Process
11
11
 
12
12
  ### 1. Explore
13
13
 
14
- **Scope before you scan — YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:
14
+ **Scope before you scan: YAGNI.** Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide *where* to look before you look:
15
15
 
16
- - If the user named a direction — a module, a subsystem, a pain point — take it, and skip the inference below.
17
- - Otherwise, walk back a good stretch of the commit history (`git log --oneline`) to find the codebase's hot spots — the files and areas that keep coming up — and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.
16
+ - If the user named a direction (a module, a subsystem, a pain point), take it, and skip the inference below.
17
+ - Otherwise, walk back a good stretch of the commit history (`git log --oneline`) to find the codebase's hot spots, the files and areas that keep coming up, and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.
18
18
 
19
- Read the project's domain glossary (`CONTEXT.md`) and any ADRs in the area you're touching first.
19
+ Read the project's domain glossary (`GLOSSARY.md`) and any ADRs in the area you're touching first.
20
20
 
21
- If the teammate facility is available, delegate this codebase walk to a teammate; otherwise perform it in the current context. Don't follow rigid heuristics — explore organically and note where you experience friction:
21
+ If the teammate facility is available, delegate this codebase walk to a teammate with a fresh context window; otherwise perform it in the current context. Don't follow rigid heuristics — explore organically and note where you experience friction:
22
22
 
23
23
  - Where does understanding one concept require bouncing between many small modules?
24
24
  - Where are modules **shallow** — interface nearly as complex as the implementation?
@@ -30,32 +30,32 @@ Apply the **deletion test** to anything you suspect is shallow: would deleting i
30
30
 
31
31
  ### 2. Present candidates as an HTML report
32
32
 
33
- Write a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from `$TMPDIR`, falling back to `/tmp` (or `%TEMP%` on Windows), and write to `<tmpdir>/architecture-review-<timestamp>.html` so each run gets a fresh file. Open it for the user — `xdg-open <path>` on Linux, `open <path>` on macOS, `start <path>` on Windows — and tell them the absolute path.
33
+ Write a self-contained HTML file to the path the task names. When the task names none, write to the OS temp directory so nothing lands in the repo: resolve the temp dir from `$TMPDIR`, falling back to `/tmp` (or `%TEMP%` on Windows), and write to `<tmpdir>/architecture-review-<timestamp>.html` so each run gets a fresh file. The file is the deliverable: do not end the turn before it exists. Open it for the user — `xdg-open <path>` on Linux, `open <path>` on macOS, `start <path>` on Windows — and tell them the absolute path.
34
34
 
35
- The report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals — use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before/after visualisation**. Be visual.
35
+ The report uses **Tailwind via CDN** for layout and styling, and **Mermaid via CDN** for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals: use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a **before/after visualisation**. Be visual.
36
36
 
37
37
  For each candidate, render a card with:
38
38
 
39
- - **Files** — which files/modules are involved
40
- - **Problem** — why the current architecture is causing friction
41
- - **Solution** — plain English description of what would change
42
- - **Benefits** — explained in terms of locality and leverage, and how tests would improve
43
- - **Before / After diagram** — side-by-side, custom-drawn, illustrating the shallowness and the deepening
44
- - **Recommendation strength** — one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge
39
+ - **Files**: which files/modules are involved
40
+ - **Problem**: why the current architecture is causing friction
41
+ - **Solution**: plain English description of what would change
42
+ - **Benefits**: explained in terms of locality and leverage, and how tests would improve
43
+ - **Before / After diagram**: side-by-side, custom-drawn, illustrating the shallowness and the deepening
44
+ - **Recommendation strength**: one of `Strong`, `Worth exploring`, `Speculative`, rendered as a badge
45
45
 
46
46
  End the report with a **Top recommendation** section: which candidate you'd tackle first and why.
47
47
 
48
- **Use CONTEXT.md vocabulary for the domain, and the [codebase-design](codebase-design.md) vocabulary for the architecture.** If `CONTEXT.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
48
+ **Use GLOSSARY.md vocabulary for the domain, and the [codebase-design](codebase-design.md) vocabulary for the architecture.** If `GLOSSARY.md` defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
49
49
 
50
- **ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: _"contradicts ADR-0007 — but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids.
50
+ **ADR conflicts**: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: _"contradicts ADR-0007, but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids.
51
51
 
52
- See [HTML-REPORT.md](HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
52
+ See [HTML-REPORT.md](../references/HTML-REPORT.md) for the full HTML scaffold, diagram patterns, and styling guidance.
53
53
 
54
54
  Do NOT propose interfaces yet. After the file is written, present the candidates in the conversation, mark your recommended one "(Recommended)", ask which candidate to explore, and wait for the reply.
55
55
 
56
56
  ## CRITICAL: Scope before you scan — and never propose interfaces
57
57
 
58
- Decide where to look before looking: follow the user's direction, or walk the commit history for hot spots — YAGNI. The report surfaces candidates only: **do NOT propose interfaces yet** — present the report, ask directly in the conversation which candidate to explore, and wait for the reply before any design work.
58
+ Decide where to look before looking: follow the user's direction, or walk the commit history for hot spots — YAGNI. The report surfaces candidates only: **do NOT propose interfaces yet** — present the report, ask directly in the conversation which candidate to explore, and wait for the reply before any design work. This step writes the report and nothing else: do not modify source files.
59
59
 
60
60
  ### 3. Grilling loop
61
61
 
@@ -63,7 +63,7 @@ Once the user picks a candidate, load the [grilling](grilling.md) reference with
63
63
 
64
64
  Side effects happen inline as decisions crystallize — load the [domain-modeling](domain-modeling.md) reference with `matt_pocock_active` (`action: "load"`, from available references) to keep the domain model current as you go:
65
65
 
66
- - **Naming a deepened module after a concept not in `CONTEXT.md`?** Add the term to `CONTEXT.md`. Create the file lazily if it doesn't exist.
67
- - **Sharpening a fuzzy term during the conversation?** Update `CONTEXT.md` right there.
68
- - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing — skip ephemeral reasons ("not worth it right now") and self-evident ones.
66
+ - **Naming a deepened module after a concept not in `GLOSSARY.md`?** Add the term to `GLOSSARY.md`. Create the file lazily if it doesn't exist.
67
+ - **Sharpening a fuzzy term during the conversation?** Update `GLOSSARY.md` right there.
68
+ - **User rejects the candidate with a load-bearing reason?** Offer an ADR, framed as: _"Want me to record this as an ADR so future architecture reviews don't re-suggest it?"_ Only offer when the reason would actually be needed by a future explorer to avoid re-suggesting the same thing; skip ephemeral reasons ("not worth it right now") and self-evident ones.
69
69
  - **Want to explore alternative interfaces for the deepened module?** Follow the bundled [codebase-design](codebase-design.md) procedure and use its Design It Twice pattern with teammates when the teammate facility is available, or compare designs sequentially in the current context.
@@ -0,0 +1,169 @@
1
+ # Pull Request Body
2
+
3
+ Use this procedure when writing a pull request body.
4
+
5
+ The body is a file, not a chat message. Write it to the path the task names, and do not end the turn until that file exists.
6
+
7
+ Use this template for writing the PR body:
8
+
9
+ ```markdown
10
+ ## Summary
11
+
12
+ <diagram, diff-sketch, or tree>
13
+
14
+ ## Evidence
15
+
16
+ - **Before:** <screenshot/output/failing test run>
17
+ **After:** <screenshot/output/passing test run>
18
+
19
+ ## Merge Danger
20
+
21
+ **Door:** <one-way or two-way>
22
+
23
+ <optional: description>
24
+
25
+ **Blast Radius:** <one-word description>
26
+
27
+ <optional: potential ramifications of merge>
28
+ ```
29
+
30
+ ## Sections
31
+
32
+ Skip all preambles and keep prose brief. Use the user's domain language from `GLOSSARY.md`.
33
+
34
+ ### Summary
35
+
36
+ Pick the smallest view that makes the key point clear.
37
+
38
+ - Show logic or an algorithm as pseudocode:
39
+
40
+ ```text
41
+ on(save)
42
+ if content is unchanged
43
+ return cached result
44
+ write new content
45
+ return fresh result
46
+ ```
47
+
48
+ - Show runtime control flow as a call tree:
49
+
50
+ ```text
51
+ submitForm
52
+ createSession
53
+ persistPrompt
54
+ launchAgent
55
+ navigateToSession
56
+ ```
57
+
58
+ - Show UI structure as a component tree, including state and module boundaries that matter:
59
+
60
+ ```text
61
+ <SessionPage> (apps/example/src/routes/session.tsx)
62
+ useSessionEvents()
63
+ <SessionToolbar>
64
+ <RunSkillButton> (packages/ui)
65
+ ```
66
+
67
+ - Show file responsibility or a broad refactor as a shallow file tree:
68
+
69
+ ```text
70
+ src/
71
+ ├── commands/ # parses user actions
72
+ ├── sessions/ # owns session state
73
+ └── transport/ # sends API requests
74
+ ```
75
+
76
+ - Show component interaction, control flow, or data flow with Mermaid:
77
+
78
+ ```mermaid
79
+ sequenceDiagram
80
+ participant User
81
+ participant UI
82
+ participant Daemon
83
+ User->>UI: choose command
84
+ UI->>Daemon: send expanded prompt
85
+ Daemon-->>UI: stream result
86
+ ```
87
+
88
+ - Use `diff` when the point is what changes and the surrounding shape already exists. Match the diff shape to the topic.
89
+
90
+ For a component change:
91
+
92
+ ```diff
93
+ <SessionPage>
94
+ useSessionEvents()
95
+ <SessionToolbar>
96
+ + <RunSkillButton />
97
+ <SessionTimeline>
98
+ + <SkillResultCard />
99
+ ```
100
+
101
+ For a file-layout change:
102
+
103
+ ```diff
104
+ src/
105
+ ├── commands/
106
+ +│ └── show-me.ts # expands the slash command
107
+ ├── sessions/
108
+ -└── transport.ts
109
+ +└── transport/
110
+ + ├── client.ts
111
+ + └── stream.ts
112
+ ```
113
+
114
+ For a call-tree or call-stack change:
115
+
116
+ ```diff
117
+ submitForm
118
+ createSession
119
+ persistPrompt
120
+ + expandSkillMention
121
+ launchAgent
122
+ - navigateToSession
123
+ + navigateToSession
124
+ + subscribeToEvents
125
+ ```
126
+
127
+ For a state or control-flow change:
128
+
129
+ ```diff
130
+ on(save)
131
+ - write content
132
+ + if content is unchanged
133
+ + return cached result
134
+ + write new content
135
+ + invalidate cache
136
+ ```
137
+
138
+ - Show the whole block when most of it is new, when omitted context would hide ownership or order, or when the user needs a copyable target shape:
139
+
140
+ ```ts
141
+ function expandSkill(command: string): string {
142
+ const skillName = command.slice(1);
143
+ return `use the ${skillName} skill`;
144
+ }
145
+ ```
146
+
147
+ #### Guidance
148
+
149
+ Place each visual next to the short text it supports. Keep only the calls, files, props, states, and boundaries needed to answer the user's current question or the options to resolve the current discussion point.
150
+
151
+ You may use one of these, you may use several, it is unlikely you will use all of them. Use your judgement and don't overwhelm the user.
152
+
153
+ ### Evidence
154
+
155
+ Concrete evidence that the change works. Show a before and after.
156
+
157
+ Screenshots are S-tier - when the environment is set up for it and the change is visual.
158
+
159
+ Execution-based evidence is A-tier. Test results, console output. Show the exact test that now fails and passes, using pseudocode.
160
+
161
+ ### Merge Danger
162
+
163
+ Describe whether it's a one-way or two-way door. You can walk back through two-way doors, but not one-way doors. A PR that is cheap to roll back is lower risk. Changes that involve destructive actions or hard-to-reverse decisions are one-way doors.
164
+
165
+ The blast radius is the potential impact or scope of the changes introduced by this PR. Consider all possibilities. Examples are layout shift, breakages for consumers, mobile responsiveness, etc.
166
+
167
+ ## Attribution
168
+
169
+ The **Summary** section's menu of visuals (pseudocode, call trees, component trees, file trees, Mermaid, diffs) and its placement guidance come from [Dex Horthy](https://github.com/dexhorthy)'s [`show-me`](https://github.com/humanlayer/humanlayer) skill, reproduced almost word for word and aimed at a diff instead of a live conversation. Upstream records this in its own `CREDITS.md`; this procedure carries the attribution directly, because `pr` does not depend on `show-me`.
@@ -6,8 +6,8 @@ A prototype is **throwaway code that answers a question**. The question decides
6
6
 
7
7
  Identify which question is being answered — from the user's prompt, the surrounding code, or by asking the user directly in the conversation if they are available:
8
8
 
9
- - **"Does this logic / state model feel right?"** → [LOGIC.md](LOGIC.md). Build a tiny interactive terminal app that pushes the state machine through cases that are hard to reason about on paper.
10
- - **"What should this look like?"** → [UI.md](UI.md). Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.
9
+ - **"Does this logic / state model feel right?"** → [LOGIC.md](../references/LOGIC.md). Build a tiny interactive terminal app that pushes the state machine through cases that are hard to reason about on paper.
10
+ - **"What should this look like?"** → [UI.md](../references/UI.md). Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.
11
11
 
12
12
  The two branches produce very different artifacts — getting this wrong wastes the whole prototype. If the question is genuinely ambiguous and the user isn't reachable, default to whichever branch better matches the surrounding code (a backend module → logic; a page or component → UI) and state the assumption at the top of the prototype.
13
13
 
@@ -17,9 +17,10 @@ Identify the question being answered before building — "does this logic / stat
17
17
 
18
18
  ## Rules that apply to both
19
19
 
20
- 1. **Throwaway from day one, and clearly marked as such.** Locate the prototype code close to where it will actually be used (next to the module or page it's prototyping for) so context is obvious — but name it so a casual reader can see it's a prototype, not production. For throwaway UI routes, obey whatever routing convention the project already uses; don't invent a new top-level structure.
21
- 2. **One command to run.** Whatever the project's existing task runner supports — `pnpm <name>`, `python <path>`, `bun <path>`, etc. The user must be able to start it without thinking.
22
- 3. **No persistence by default.** State lives in memory. Persistence is the thing the prototype is _checking_, not something it should depend on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear "PROTOTYPE — wipe me" name.
20
+ 1. **Throwaway from day one, and clearly marked as such.** Locate the prototype code close to where it will actually be used (next to the module or page it's prototyping for) so context is obvious, but name it so a casual reader can see it's a prototype, not production. For throwaway UI routes, obey whatever routing convention the project already uses; don't invent a new top-level structure.
21
+ 2. **One command to run.** Whatever the project's existing task runner supports — `bun <name>`, `python <path>`, or the project's own script runner, etc. The user must be able to start it without thinking.
22
+ 3. **No persistence by default.** State lives in memory. Persistence is the thing the prototype is _checking_, not something it should depend on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear "PROTOTYPE, wipe me" name.
23
23
  4. **Skip the polish.** No tests, no error handling beyond what makes the prototype _runnable_, no abstractions. The point is to learn something fast.
24
24
  5. **Surface the state.** After every action (logic) or on every variant switch (UI), print or render the full relevant state so the user can see what changed.
25
- 6. **Capture it when done.** Fold any validated decision into the real code, then preserve the prototype as a **primary source** on a throwaway branch, out of main, and leave a context pointer to that branch on the implementation issue. Record the verdict and the question it settled in the issue or commit message. When a commit is needed, follow the repository's git-agent workflow rather than staging or committing directly. The main branch keeps only the validated decision.
25
+ 6. **Bound the conclusion.** Separate measured results from proposed production choices. Leave unresolved policy explicit: a numeric representation experiment cannot settle a rounding boundary or business rule it has not tested. Recommend follow-up questions rather than presenting those choices as validated requirements.
26
+ 7. **Capture it when done.** Fold any validated decision into the real code, then preserve the prototype as a **primary source** on a throwaway branch, out of main, and leave a context pointer to that branch on the implementation issue. Record the verdict and the question it settled in the issue or commit message. When a commit is needed, follow the repository's git-agent workflow rather than staging or committing directly. The main branch keeps only the validated decision.