claude-mem 13.2.0 → 13.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.
@@ -0,0 +1,312 @@
1
+ ---
2
+ name: design-is
3
+ description: Audit a design against Dieter Rams' ten "Good design is..." principles, then hand off a /make-plan prompt for one of three outcomes — new design, refine design, or redesign. Use when the user says "audit this design", "design review", "check this UI against Rams", "is this UI good", "critique this design", "design audit", or asks for a critique that should lead to a plan.
4
+ ---
5
+
6
+ # Design Is
7
+
8
+ ## Do not use for
9
+
10
+ - Routine UI code reviews → use `/review`
11
+ - Pure copy edits → use a separate copy pass
12
+ - Pre-design ideation with no artifact yet → start with `/make-plan` directly
13
+
14
+ You are an ORCHESTRATOR. Audit a design against Dieter Rams' ten principles, score each principle with evidence, decide the outcome verdict (NEW / REFINE / REDESIGN), and hand off to `/make-plan` with a ready-to-run prompt.
15
+
16
+ You do not write implementation code. You produce: evidence-cited scores, a verdict, and a `/make-plan` handoff prompt.
17
+
18
+ ## The Ten Principles (Dieter Rams)
19
+
20
+ Audit each principle in this exact order. Each gets a score 0–3 and ≥1 piece of evidence (`file:line`, screenshot region, copy excerpt, or measured value).
21
+
22
+ 1. **Good design is innovative** — Does it advance the form, or imitate? Innovation rides on technology; never an end in itself.
23
+ 2. **Good design makes a product useful** — Does it serve the primary task? Emphasizes usefulness; disregards anything that detracts.
24
+ 3. **Good design is aesthetic** — Is it beautiful? Only well-executed objects can be beautiful; aesthetic quality affects well-being.
25
+ 4. **Good design makes a product understandable** — Does the structure clarify function? Or is it self-explanatory at best?
26
+ 5. **Good design is unobtrusive** — Does it stay out of the way? Neither decorative objects nor works of art — leave room for self-expression.
27
+ 6. **Good design is honest** — Does it claim only what it is? No false promises, no manipulation, no inflated value.
28
+ 7. **Good design is long-lasting** — Will it age well? Avoids being fashionable; never appears antiquated.
29
+ 8. **Good design is thorough down to the last detail** — Are edges, empty states, errors, focus rings, motion curves all considered? Care and accuracy express respect for the user.
30
+ 9. **Good design is environmentally friendly** — Does it conserve resources? Minimizes pollution — in software: bundle weight, energy, attention, cognitive load.
31
+ 10. **Good design is as little design as possible** — Less, but better. Concentrates on essentials; back to purity, back to simplicity.
32
+
33
+ > The user wrote "Dieter Braun" — they mean Dieter Rams. Don't correct them inline; just use the right principles.
34
+
35
+ ## Delegation Model
36
+
37
+ Use subagents for *evidence gathering* (reading components, measuring contrast, counting elements, inspecting tokens, screenshotting via agent-browser). Keep *scoring and verdict synthesis* with the orchestrator. Reject subagent reports that score without citing evidence and redeploy.
38
+
39
+ ### Subagent Reporting Contract (MANDATORY)
40
+
41
+ Each evidence subagent response must include:
42
+ 1. Sources consulted — exact file paths and line ranges, or screenshot regions
43
+ 2. Concrete findings — what is present, what is missing, with quotes/values
44
+ 3. Per-principle facts (not opinions) — leave scoring to the orchestrator
45
+ 4. Known gaps — what could not be inspected and why
46
+
47
+ ## Output Artifacts
48
+
49
+ All artifacts go in `DESIGN-IS-<YYYY-MM-DD>/` at repo root (or the project the user points at):
50
+
51
+ - `00-scope.md` — what was audited (URL, component paths, screens), input materials
52
+ - `01-evidence.md` — per-principle evidence collected by subagents
53
+ - `02-scorecard.md` — per-principle 0–3 score with one-line justification + total
54
+ - `03-verdict.md` — NEW / REFINE / REDESIGN with reasoning
55
+ - `04-handoff-prompt.md` — copy-pasteable `/make-plan` prompt for the chosen outcome
56
+
57
+ ## Phases
58
+
59
+ ### Phase 0: Scope Lock (ALWAYS FIRST)
60
+
61
+ Ask the user (or infer from the request) and write `00-scope.md`:
62
+ - What is being audited? (live URL, repo path, Figma frame, component name)
63
+ - Who is the primary user, and what is the primary task?
64
+ - Constraints (brand, stack, deadline)
65
+ - Reference designs or competitors, if any
66
+
67
+ If the user is asking about a design that doesn't exist yet, skip Phases 1–2 and go straight to Phase 3 with verdict = **NEW**.
68
+
69
+ ### Phase 1: Evidence Gathering (FAN OUT)
70
+
71
+ Deploy subagents in parallel. Each must return ONLY the required fields below — no prose paragraphs, no scoring.
72
+
73
+ **1. Structural Evidence** subagent (always deploy)
74
+ Required fields returned:
75
+ - Total interactive-element count on audited surface
76
+ - Max nesting depth of the primary component tree
77
+ - Repeated-pattern count (same affordance appearing >1 place with the same purpose)
78
+ - Dead-prop / unused-import count
79
+ - File:line citations for every count
80
+
81
+ **2. Visual Evidence** subagent (always deploy)
82
+ Mode: if target is a reachable URL or running dev server → use the `agent-browser` skill for screenshots and computed-style inspection. If target is a static repo with no running instance → read source CSS / tokens / component files and report inferred facts only (mark these "INFERRED").
83
+ Required fields returned:
84
+ - Spacing scale observed (px array)
85
+ - Type scale observed (px array)
86
+ - Distinct color count (count of unique hex/oklch tokens actually rendered or referenced)
87
+ - Lowest contrast ratio observed across primary text
88
+ - States present checklist: empty / loading / error / success / focus / disabled — present or missing for each
89
+
90
+ **3. Copy & Honesty** subagent (always deploy)
91
+ Required fields returned:
92
+ - List of every user-facing string with file:line
93
+ - Flagged inflations (marketing superlatives without backing)
94
+ - Flagged dark patterns (forced continuity, hidden cost, fake scarcity, confirmshaming)
95
+ - Flagged jargon / unclear labels with proposed plain replacement
96
+ - Label→behavior mismatches with file:line of both
97
+
98
+ **4. Weight & Friction** subagent (always deploy)
99
+ Required fields returned:
100
+ - Initial JS bytes (number)
101
+ - Network request count for primary view (number)
102
+ - Time-to-interactive ms (number, measured or estimated with method noted)
103
+ - Animation count on idle screen (number)
104
+ - Notification / badge / modal count on initial load (number)
105
+
106
+ **5. Accessibility Evidence** subagent (OPTIONAL — deploy only if target has a meaningful interactive UI surface; skip for static landing pages without interaction)
107
+ Required fields returned:
108
+ - WCAG contrast pass/fail per text token
109
+ - Focus order list across primary controls
110
+ - Keyboard reachability of every primary action (yes/no per action)
111
+ - ARIA landmark count
112
+ - Skip-link present (yes/no)
113
+
114
+ **Principle → subagent mapping** (orchestrator uses this when scoring):
115
+
116
+ | Principle | Fed by |
117
+ |-----------|--------|
118
+ | #1 innovative | orchestrator-only (judgment using all evidence) |
119
+ | #2 useful | Structural, Accessibility |
120
+ | #3 aesthetic | Visual |
121
+ | #4 understandable | Structural, Copy & Honesty, Accessibility |
122
+ | #5 unobtrusive | Structural, Visual |
123
+ | #6 honest | Copy & Honesty |
124
+ | #7 long-lasting | orchestrator-only (judgment using all evidence) |
125
+ | #8 thorough | Visual |
126
+ | #9 environmentally friendly | Weight & Friction |
127
+ | #10 as little design as possible | Structural |
128
+
129
+ The orchestrator writes `01-evidence.md` consolidating all subagent reports. Reject any finding without a source citation. Subagents are explicitly forbidden from scoring — only the orchestrator scores, using the rubric in Phase 2.
130
+
131
+ ### Phase 2: Scorecard (ORCHESTRATOR)
132
+
133
+ The orchestrator scores each of the ten principles itself — do NOT delegate scoring.
134
+
135
+ For each principle, write to `02-scorecard.md`:
136
+
137
+ ```
138
+ N. Good design is <principle> — Score: X/3
139
+ Evidence: <one-line summary citing 01-evidence.md anchors>
140
+ Justification: <one sentence on why this score, not the one above or below>
141
+ ```
142
+
143
+ Per-principle scoring anchors (apply verbatim — pick the level whose signal best matches the audited surface):
144
+
145
+ #1 innovative — 3: introduces a pattern not seen in 5+ peer products and ships it with restraint. 2: refreshes an existing pattern with a clear improvement. 1: imitates competitors with minor variation. 0: copies a competitor's flow wholesale.
146
+ #2 useful — 3: primary task completes in fewest possible steps; no decoy actions. 2: primary task completes but adjacent surface adds steps. 1: primary task requires unnecessary detours. 0: primary task is not directly supported on the screen audited.
147
+ #3 aesthetic — 3: spacing/type/color obey a single visible system; no orphan styles. 2: ≤2 minor inconsistencies across audited surface. 1: 3–5 inconsistencies OR one jarring violation. 0: no visible system OR active visual noise.
148
+ #4 understandable — 3: a first-time user names every primary control correctly. 2: 1 control needs a tooltip. 1: 2–3 controls unclear; jargon present. 0: primary action is not identifiable without help.
149
+ #5 unobtrusive — 3: chrome recedes; content is the figure, UI the ground. 2: chrome visible but quiet. 1: decoration competes with content. 0: chrome dominates content.
150
+ #6 honest — 3: every claim, badge, and label maps 1:1 to actual behavior. 2: ≤1 minor inflation (e.g. "powerful" once). 1: 2+ inflations OR one dark pattern. 0: any deceptive flow (forced continuity, hidden cost, fake scarcity).
151
+ #7 long-lasting — 3: visual language has no dated trend markers; would read as current 3 years from now. 2: 1 dated marker. 1: 2–3 dated markers (skeuomorph residue, fad gradients, trend typography). 0: design reads as a specific year's trend.
152
+ #8 thorough — 3: empty / loading / error / success / focus / disabled all present and considered. 2: 1 state missing or rough. 1: 2–3 states missing. 0: 4+ states missing or default-browser.
153
+ #9 environmentally friendly — 3: initial JS <100KB, no idle animation, dark mode honored, prefers-reduced-motion respected. 2: <500KB, motion gated. 1: 500KB–2MB, motion always on. 0: >2MB OR autoplay video OR dark mode ignored.
154
+ #10 as little design as possible — 3: every element earns its place; removing any one breaks the task. 2: ≤2 removable elements. 1: 3–5 removable elements. 0: page is dominated by decoration or duplicated affordances.
155
+
156
+ Scoring rules:
157
+ - **Tie-breaker rule**: When uncertain between two scores, pick the lower one. Convergence > generosity.
158
+ - **Score worst, not mean**: When a principle has multiple representative instances on the audited surface, score the worst instance — not the average.
159
+ - **No bonuses, no weights**: Scores stay 0–3 integer. Principles are equally weighted. Total is sum of ten scores, max 30.
160
+
161
+ ### Phase 3: Verdict (ORCHESTRATOR)
162
+
163
+ Write `03-verdict.md` with one of three verdicts, chosen by these rules:
164
+
165
+ - **NEW DESIGN** — No design exists yet, OR the existing artifact is a stub/wireframe with no real decisions to preserve.
166
+ - **REFINE** — Total score ≥ 20 AND no individual principle scored 0. The bones are good; iterate.
167
+ - **REDESIGN** — Total score < 20, OR any principle scored 0 on a load-bearing dimension (typically #2 useful, #4 understandable, or #6 honest). Start over from purpose.
168
+
169
+ State the verdict in one sentence. Then list the 3–5 highest-leverage moves — each tied to a specific principle and evidence anchor. These become the spine of the next phase's plan.
170
+
171
+ **Anti-patterns to reject in your own verdict:**
172
+ - Recommending REFINE because the codebase is large (sunk cost is not a design principle)
173
+ - Recommending REDESIGN because a single screen is ugly (scope it)
174
+ - Recommending NEW when an honest REDESIGN is warranted (don't dodge the critique)
175
+
176
+ ### Phase 4: /make-plan Handoff
177
+
178
+ Write `04-handoff-prompt.md` containing exactly ONE fenced `/make-plan` prompt matching the verdict. The prompt must be self-contained — the next session won't see this audit unless it's quoted in.
179
+
180
+ Use the matching template below. Fill every `<bracket>`. Include the top 3–5 moves from Phase 3 verbatim, each with its evidence anchor.
181
+
182
+ **Quote-in step (mandatory, applies to all three templates below):** Before emitting the handoff, replace EVERY `<bracket>` placeholder with concrete content from the audit. Inline the verdict paragraph from `03-verdict.md` and the top 3–5 moves verbatim into the template. Do NOT leave bare references like "see DESIGN-IS-.../03-verdict.md" — the next session won't have file access to the audit. The emitted handoff must be readable and actionable with zero external lookups.
183
+
184
+ #### Template: NEW DESIGN
185
+
186
+ ````
187
+ /make-plan Design <product/screen/component name> from scratch.
188
+
189
+ Primary user: <who>
190
+ Primary task: <one sentence>
191
+ Constraints: <brand, stack, deadline, accessibility floor>
192
+
193
+ Non-goals (do not design these now):
194
+ - <explicit out-of-scope item 1>
195
+ - <explicit out-of-scope item 2>
196
+ - <explicit out-of-scope item 3>
197
+
198
+ Reference principles to optimize for, in order:
199
+ 1. Useful (#2) — <what useful looks like here>
200
+ 2. Understandable (#4) — <what clarity looks like here>
201
+ 3. As little design as possible (#10) — <what restraint looks like here>
202
+
203
+ Deliverables for the plan:
204
+ - Information architecture (one screen map or component tree)
205
+ - Primary flow wireframe (low-fi, labeled)
206
+ - Token decisions (type scale, spacing scale, color count cap)
207
+ - States checklist (empty, loading, error, success, focus, disabled)
208
+ - Honesty audit on every user-facing string before ship
209
+
210
+ Anti-patterns to guard against (specific to NEW):
211
+ - Decoration without function
212
+ - Novel interactions without precedent
213
+ - Copy that overpromises
214
+ - Designing for screens the Non-goals list excluded
215
+ ````
216
+
217
+ #### Template: REFINE DESIGN
218
+
219
+ ````
220
+ /make-plan Refine <product/screen/component name> based on a Dieter Rams audit (total <X>/30).
221
+
222
+ Verdict paragraph (quoted from 03-verdict.md):
223
+ > <paste the one-sentence verdict here>
224
+
225
+ Keep (already strong, do NOT touch in this pass):
226
+ - Principle #<N> (<name>) scored 3 — Evidence: <file:line or anchor>. Regression check: <what to grep / re-test to confirm it still scores 3 after the refine>.
227
+ - <repeat for every principle that scored 3>
228
+
229
+ Fix in priority order (top 3–5 moves from the audit, verbatim):
230
+ 1. <Principle # — short name>: <specific move>. Evidence: <file:line or anchor>.
231
+ 2. <Principle # — short name>: <specific move>. Evidence: <file:line or anchor>.
232
+ 3. <Principle # — short name>: <specific move>. Evidence: <file:line or anchor>.
233
+ 4. <optional 4th>
234
+ 5. <optional 5th>
235
+
236
+ Out of scope for this refine pass: <explicit list — what NOT to touch>
237
+
238
+ Deliverables for the plan:
239
+ - Per-fix: target files, exact change, verification step
240
+ - Token/spec changes consolidated in one place
241
+ - Regression checklist for every "Keep" item above
242
+
243
+ Anti-patterns to guard against (specific to REFINE):
244
+ - Adding new abstractions where a direct change suffices
245
+ - Restyling areas that already scored 3
246
+ - Scope creep into structural redesign (if structure must change, this should be REDESIGN, not REFINE)
247
+ - Letting fixes mutate principles outside the priority list
248
+ ````
249
+
250
+ #### Template: REDESIGN
251
+
252
+ ````
253
+ /make-plan Redesign <product/screen/component name>. Current design failed audit at <X>/30 with critical gaps in principles <comma-separated list of 0-scored or 1-scored load-bearing principles>.
254
+
255
+ Verdict paragraph (quoted from 03-verdict.md):
256
+ > <paste the one-sentence verdict here>
257
+
258
+ Why redesign and not refine: <one sentence — usually a load-bearing principle (#2, #4, or #6) scored 0, or total is below threshold>
259
+
260
+ Preserve from current design (MUST be non-empty — at minimum, name the brand tokens):
261
+ - <specific element 1, with file:line>
262
+ - <specific element 2, with file:line>
263
+ - (if structurally nothing survives, write: "Brand tokens only — color palette and logo. Discard everything else.")
264
+
265
+ Discard (MUST be non-empty — name the structural patterns causing the failures):
266
+ - <pattern 1>. Evidence: <file:line>. Caused failure on principle #<N>.
267
+ - <pattern 2>. Evidence: <file:line>. Caused failure on principle #<N>.
268
+
269
+ Top 3–5 moves from the audit (verbatim):
270
+ 1. <Principle # — short name>: <specific move>. Evidence: <file:line>.
271
+ 2. <Principle # — short name>: <specific move>. Evidence: <file:line>.
272
+ 3. <Principle # — short name>: <specific move>. Evidence: <file:line>.
273
+
274
+ Redesign principles in priority order:
275
+ 1. <Principle # — name> — <what success looks like>
276
+ 2. <Principle # — name> — <what success looks like>
277
+ 3. <Principle # — name> — <what success looks like>
278
+
279
+ Deliverables for the plan:
280
+ - New information architecture (not derived from old)
281
+ - New primary flow (low-fi, labeled, compared side-by-side to current)
282
+ - States checklist (empty, loading, error, success, focus, disabled)
283
+ - Migration path for users currently on the old design
284
+ - Cutover criteria (when is the old design retired)
285
+
286
+ Anti-patterns to guard against (specific to REDESIGN):
287
+ - Porting old structure under new styling
288
+ - Keeping both designs behind a flag indefinitely
289
+ - Redesigning to follow a trend rather than the principles above
290
+ - Treating the Preserve list as optional — it must be filled before this handoff is valid
291
+ ````
292
+
293
+ ## Key Principles (for the auditor)
294
+
295
+ - **Evidence over taste** — every score cites a source; "feels wrong" is not a finding
296
+ - **Score what is, not what was intended** — design is what ships, not what was drawn
297
+ - **Honesty applies to the audit too** — if total is 28/30, say REFINE even if the user wanted a redesign; if it's 12/30, say REDESIGN even if the user wanted a refine
298
+ - **One verdict, not three** — pick NEW or REFINE or REDESIGN; do not hedge
299
+ - **Handoff, don't implement** — `design-is` ends at the `/make-plan` prompt; `/make-plan` and `/do` take it from there
300
+ - **Verdict commitment** — Once `02-scorecard.md` is written, the verdict follows the Phase 3 rule mechanically. Never re-score to back into a preferred verdict; if the scorecard says REDESIGN, the handoff is REDESIGN.
301
+
302
+ ## Failure Modes to Prevent
303
+
304
+ - Scoring from screenshots alone without reading the code — redeploy with structural subagent
305
+ - Scoring the codebase instead of the design — re-anchor on user-facing evidence
306
+ - Awarding 3s generously to soften the verdict — recalibrate against the per-principle anchors in Phase 2
307
+ - Producing a handoff prompt that doesn't quote the verdict and top moves — the next session is blind without them
308
+ - Skipping Phase 0 scope lock — auditing the wrong surface wastes Phase 1
309
+ - **Sunk-cost reasoning** — recommending REFINE because the codebase is large; sunk cost is not a design principle
310
+ - **Hedging across verdicts** — "could be REFINE or REDESIGN depending on..." — pick one
311
+ - **Score inflation to match a desired verdict** — score the evidence, then read the verdict off the rule
312
+ - **Letting Phase 0 user preference override Phase 3 evidence** — the user can disagree with the verdict, but the audit reports what the evidence says
@@ -61,3 +61,7 @@ The orchestrator consolidates findings into a single Phase 0 output.
61
61
  - Adding parameters not in documentation
62
62
  - Skipping verification steps
63
63
  - Assuming structure without checking examples
64
+
65
+ ## See Also
66
+
67
+ - `oh-my-issues` — the issue-side sibling. When the plan you're being asked to make is rooted in a bug or feature backlog rather than a fresh idea, route through `oh-my-issues` first to cluster issues by root cause into plan masters and `plans/0X-*.md` design docs. `make-plan` then operates on the design doc for one plan slice.
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: oh-my-issues
3
+ description: Cluster a GitHub issue backlog by root cause into a small set of plan-master issues, redirect children with a standardized comment, and bundle architectural-fix PRs that close clusters atomically. Use when an issue tracker has accumulated dozens of reports that share underlying defects, when asked to triage / consolidate / cluster / dedupe issues, when asked to build a plan series or roadmap from open issues, or when routing a new incoming bug into an existing plan.
4
+ ---
5
+
6
+ # oh-my-issues
7
+
8
+ Turn an issue backlog into a roadmap. Issues are symptom data, not units of work — the unit of work is the architectural defect that produces them. The end state is `open issues == open plans`, 1:1.
9
+
10
+ ## Core principle
11
+
12
+ Stop closing issues one at a time. Group symptoms that share a single architectural fix into a cluster, give the cluster one canonical home (a plan-master issue + a `plans/0X-*.md` design doc), close every child with a standardized redirect, and ship one PR per cluster that closes all children atomically. New incoming bugs get appended to the matching master as a "Round N" comment, not opened as new tracked issues.
13
+
14
+ This compounds three ways: architectural fixes retire whole symptom families, the plan's test matrix institutionalizes prevention in CI, and standardized triage makes residual inflow cheap.
15
+
16
+ ## When to use
17
+
18
+ - The repo has 20+ open issues and many feel like duplicates or platform-specific symptoms of the same defect.
19
+ - The user asks to "triage", "consolidate", "cluster", "dedupe", "group", or "make a plan from" the issue list.
20
+ - A new bug is filed and the user wants to know whether it belongs to existing work.
21
+ - The user wants to ship a focused PR that resolves a cluster of related issues.
22
+
23
+ ## When NOT to use
24
+
25
+ - Fewer than ~15 open issues: just close them.
26
+ - Issues are genuinely independent (no shared root causes): one fix per issue is correct.
27
+ - The repo lacks `plans/` discipline and the user does not want to introduce one — propose first, do not impose.
28
+
29
+ ## Three modes
30
+
31
+ ### Mode 1: Cluster pass (initial reduction)
32
+
33
+ Use when the backlog has never been consolidated. Goal: go from N issues to N_plans masters in one operation.
34
+
35
+ 1. **Read everything in full.** Fetch every open issue's body *and* its comment thread — not just titles. Surface-level grouping fails without full text, and reproduction steps, linked duplicates, and diagnostic output often live in comments rather than the original body. See "GitHub CLI primitives" below for the correct paginated listing + per-issue comment fetch (a single `gh issue list` call does **not** return comment bodies).
36
+ 2. **Cluster by root cause, not by surface.** The clustering question is *would one architectural change retire all of these?* — not *do these mention the same word?*. "Windows" is a surface; "spawn contract violated by host shells" is a root cause. Two issues with different surfaces can share a cluster (e.g. an env-var leak in two different code paths sharing one missing env-isolation boundary).
37
+ 3. **Name each cluster as an architectural problem.** Title format: `[plan-XX] <Architectural Defect> — <one-line scope>`. Example: `[plan-02] Spawn-Contract Templating — canonical ${CLAUDE_PLUGIN_ROOT} resolution across all hosts`. The title must imply a fix, not a topic.
38
+ 4. **Open one master issue per cluster** with a body that lists: the architectural defect, the children (by issue number), the fix sequence, and a required test matrix (host × IDE × shell, etc.) that prevents regression.
39
+ 5. **Mirror each master as `plans/0X-<slug>.md`** in the repo. The issue is the public tracker; the doc is the design. They reference each other.
40
+ 6. **Close every child** with the standardized redirect comment (see below) and state `not planned`.
41
+ 7. **Verify end state:** `gh issue list --state open` returns exactly the masters and nothing else.
42
+
43
+ Target shape for ~100 issues: 4–8 masters. More than 10 means you're clustering by surface; fewer than 3 means clusters are too broad to ship as one PR each.
44
+
45
+ ### Mode 2: Triage (new incoming bug, steady state)
46
+
47
+ Use when a new issue is filed after consolidation is in place. Goal: never let the issue list re-accumulate.
48
+
49
+ 1. **Read the new issue's body in full.**
50
+ 2. **Pattern-match the symptom against existing plan masters.** For each open master, ask: *would the fix described here also fix this new bug?* If yes → it belongs to that plan.
51
+ 3. **If a match exists**, post a "Round N" comment on the master that:
52
+ - Names the new child by number
53
+ - Describes the symptom in one line
54
+ - Sketches the concrete fix (1–3 lines, e.g. "guard with `case "$_SH" in /*.exe|"") _SH=bash ;; esac`")
55
+ - Adds any new test-matrix cell the bug exposes
56
+ 4. **Close the child** with the standardized redirect comment, `not planned`.
57
+ 5. **If no match exists** and the bug is genuinely novel: open a new plan master + `plans/0X-*.md`. Resist this. Most bugs are children of existing plans.
58
+
59
+ ### Mode 3: Bundle (ship the cluster)
60
+
61
+ Use when a plan slice is ready to ship. Goal: one PR closes N children atomically.
62
+
63
+ 1. **List the master's children.** From the master body and consolidation comments, collect every child issue number routed to this plan.
64
+ 2. **Verify each child's symptom is covered** by the architectural fix in the PR. If a child is not covered, the PR is not ready or that child belongs in a different plan.
65
+ 3. **Generate the PR description**: title is the plan slice (e.g. "fix(spawn): canonical ${CLAUDE_PLUGIN_ROOT} resolution"); body lists every child with `Closes #N` so GitHub auto-closes them on merge.
66
+ 4. **Add the test matrix from the plan** to CI in the same PR. Without the matrix, the cluster will re-emerge.
67
+ 5. **After merge**, the master issue can be closed only if every child was covered. If the plan has remaining scope, leave the master open and link the PR as a partial-shipping checkpoint.
68
+
69
+ ## Naming a plan master
70
+
71
+ A plan-master title must imply its fix.
72
+
73
+ | Bad (surface) | Good (architectural) |
74
+ |---|---|
75
+ | Windows bugs | Spawn-Contract Templating across hosts |
76
+ | Worker crashes | Worker / Daemon Lifecycle Hardening — supervision, health, retry |
77
+ | Auth issues | Worker Env Isolation — strip host CLI env from the SDK subprocess |
78
+ | Install failures | Installer Failure Transparency — cross-IDE error taxonomy + 12×4 test matrix |
79
+
80
+ If you cannot write a one-line architectural scope, the cluster is wrong.
81
+
82
+ ## The standardized redirect comment
83
+
84
+ Use this exact phrasing on every child closure. Consistency lets contributors recognize the pattern at a glance and keeps the audit trail searchable.
85
+
86
+ ```text
87
+ Consolidating into #<MASTER> (plan-XX). The root cause and fix sequencing are tracked there alongside the rest of the cluster — please follow that issue for progress.
88
+ ```
89
+
90
+ Close as `not planned` (not `completed`) — the child was a symptom, not a unit of work.
91
+
92
+ ## GitHub CLI primitives
93
+
94
+ Resolve repo:
95
+
96
+ ```bash
97
+ repo_json=$(gh repo view --json owner,name)
98
+ owner=$(jq -r '.owner.login // .owner.name' <<<"$repo_json")
99
+ repo=$(jq -r '.name' <<<"$repo_json")
100
+ ```
101
+
102
+ List all open issues (the read-everything pass). Two gotchas:
103
+ - `gh issue list --json comments` returns only a count placeholder, not the comment bodies. You must fetch comments per issue with `gh issue view <N> --json comments`.
104
+ - Any explicit `--limit` silently truncates if the backlog is larger. Always check the total open count first.
105
+
106
+ ```bash
107
+ # 1. Confirm total — never trust an arbitrary --limit.
108
+ # Note: GitHub's REST API treats PRs as issues, so .open_issues_count
109
+ # from /repos/{owner}/{repo} is actually issues + PRs. Use the search
110
+ # API to get the issue-only count.
111
+ total=$(gh api "search/issues?q=repo:$owner/$repo+is:issue+is:open" --jq '.total_count')
112
+ echo "Open issues: $total"
113
+
114
+ # 2. List bodies (set --limit at or above the true total)
115
+ gh issue list --state open --limit "$total" \
116
+ --json number,title,body,labels,author,createdAt
117
+
118
+ # 3. For each issue, fetch its full comment thread
119
+ for n in $(gh issue list --state open --limit "$total" --json number --jq '.[].number'); do
120
+ echo "=== Issue #$n ==="
121
+ gh issue view "$n" --json comments \
122
+ --jq '.comments[] | "\(.author.login) (\(.createdAt)): \(.body)"'
123
+ done
124
+ ```
125
+
126
+ If `total > 1000`, paginate via the REST API: `gh api "repos/$owner/$repo/issues?state=open&per_page=100&page=N"` looped until the result array is empty (note this includes PRs, so filter `select(.pull_request|not)`).
127
+
128
+ Open a plan master:
129
+
130
+ ```bash
131
+ gh issue create \
132
+ --title "[plan-02] Spawn-Contract Templating — canonical \${CLAUDE_PLUGIN_ROOT} resolution across all hosts" \
133
+ --body-file plans/02-spawn-contract-templating.md \
134
+ --label plan,plan-02
135
+ ```
136
+
137
+ Post the consolidation comment + close the child:
138
+
139
+ ```bash
140
+ gh issue comment <CHILD> --body "Consolidating into #<MASTER> (plan-XX). The root cause and fix sequencing are tracked there alongside the rest of the cluster — please follow that issue for progress."
141
+ gh issue close <CHILD> --reason "not planned"
142
+ ```
143
+
144
+ Append a "Round N" triage comment to a master:
145
+
146
+ ```bash
147
+ gh issue comment <MASTER> --body "$(cat <<'EOF'
148
+ **Round N consolidation**
149
+
150
+ - #<CHILD> (<one-line symptom>) folded into this plan as <classification>.
151
+
152
+ Proposed fix: <1–3 line sketch>.
153
+
154
+ Adds matrix cell: <host/IDE/shell combination>.
155
+ EOF
156
+ )"
157
+ ```
158
+
159
+ Verify final state:
160
+
161
+ ```bash
162
+ gh issue list --state open --json number,title \
163
+ | jq -r '.[] | "\(.number)\t\(.title)"'
164
+ ```
165
+
166
+ Output should be exactly the plan masters.
167
+
168
+ ## Plan master body template
169
+
170
+ Save as `plans/0X-<slug>.md` and use as `--body-file` for the master issue.
171
+
172
+ ```markdown
173
+ # [plan-XX] <Architectural Defect> — <one-line scope>
174
+
175
+ ## Defect
176
+
177
+ <One paragraph: what is structurally broken, why it produces the observed family of symptoms.>
178
+
179
+ ## Children
180
+
181
+ - #N — <symptom one-liner>
182
+ - #N — <symptom one-liner>
183
+ - ...
184
+
185
+ ## Fix sequence
186
+
187
+ 1. <First architectural change — bounded, reviewable>
188
+ 2. <Second>
189
+ 3. ...
190
+
191
+ ## Test matrix
192
+
193
+ | Axis A | Axis B | Required behavior |
194
+ |---|---|---|
195
+ | ... | ... | ... |
196
+
197
+ The matrix lives in CI. A future regression must fail CI before a user can file.
198
+
199
+ ## Out of scope
200
+
201
+ <What this plan deliberately does not cover, with pointers to other plan masters.>
202
+ ```
203
+
204
+ ## Health checks
205
+
206
+ Run periodically against the plan masters to catch the failure modes.
207
+
208
+ - **Graveyard master:** master issue has accumulated 5+ "Round N" comments without a shipping PR. The plan needs a forcing PR or it must be split.
209
+ - **Over-broad master:** the children's fixes cannot fit one PR. Split into two plans with narrower scope.
210
+ - **Surface-clustered master:** the children share a topic but not a fix. Re-cluster by root cause; some children belong to different plans.
211
+ - **Drift between issue and doc:** the plan master body and `plans/0X-*.md` disagree. Pick one as canonical (the doc) and regenerate the issue body from it.
212
+
213
+ ## Stop conditions
214
+
215
+ For a cluster pass: stop when `gh issue list --state open` returns exactly the masters.
216
+
217
+ For a triage: stop when the new child is closed and the master has a Round-N entry.
218
+
219
+ For a bundle: stop when the PR is merged and every listed child is auto-closed by `Closes #N`.
220
+
221
+ ## Failure modes worth refusing
222
+
223
+ - **Premature clustering** before reading every issue body in full. Don't.
224
+ - **Closing children before the master is open.** Children must always have a redirect target.
225
+ - **Using the redirect comment for issues that aren't symptoms** (e.g. genuine feature requests with no shared root cause). Those stay open or get their own track.
226
+ - **Closing a master before every listed child is shipped.** The master is the contract; closing it early breaks the audit trail.