@thebassclef/lite 0.0.1 → 0.1.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 (182) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +85 -4
  3. package/dist/cli.cjs +1610 -0
  4. package/dist/cli.js +1587 -0
  5. package/dist/index.cjs +4 -0
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +4 -0
  8. package/package.json +51 -3
  9. package/substrate/.bassclef/lite-manifest.json +1794 -0
  10. package/substrate/.claude/agents/architect.md +70 -0
  11. package/substrate/.claude/agents/builder.md +114 -0
  12. package/substrate/.claude/agents/designer.md +156 -0
  13. package/substrate/.claude/agents/reviewer.md +88 -0
  14. package/substrate/.claude/hooks/artifact-ingestion-gate.sh +357 -0
  15. package/substrate/.claude/hooks/assert-verify-steering.sh +77 -0
  16. package/substrate/.claude/hooks/bassclef-source-config-validate.sh +215 -0
  17. package/substrate/.claude/hooks/bassclef-sync.sh +634 -0
  18. package/substrate/.claude/hooks/compound-noun-scrub.sh +292 -0
  19. package/substrate/.claude/hooks/kiss-expansion-inject.sh +69 -0
  20. package/substrate/.claude/hooks/plain-english-steering.sh +156 -0
  21. package/substrate/.claude/hooks/post-skill-friction-check.sh +177 -0
  22. package/substrate/.claude/hooks/post-skill-telemetry.sh +62 -0
  23. package/substrate/.claude/hooks/pre-build-gate.sh +511 -0
  24. package/substrate/.claude/hooks/pre-commit-gate.sh +452 -0
  25. package/substrate/.claude/hooks/session-end.sh +433 -0
  26. package/substrate/.claude/hooks/session-reflection.sh +303 -0
  27. package/substrate/.claude/hooks/skill-body-grade-gate.sh +219 -0
  28. package/substrate/.claude/hooks/skill-body-intent-drift.sh +107 -0
  29. package/substrate/.claude/hooks/skill-step-list-check.sh +171 -0
  30. package/substrate/.claude/hooks/state-validate.sh +271 -0
  31. package/substrate/.claude/hooks/substrate-clarity-gate.sh +1110 -0
  32. package/substrate/.claude/hooks/temperance-gate.sh +147 -0
  33. package/substrate/.claude/hooks/testing-tier-enforce.sh +233 -0
  34. package/substrate/.claude/hooks/turn-prose-grade-measure.sh +219 -0
  35. package/substrate/.claude/hooks/turn-prose-kiss-check.sh +434 -0
  36. package/substrate/.claude/hooks/vocabulary-migration-check.sh +171 -0
  37. package/substrate/.claude/hooks/whereami-utc-gate.sh +142 -0
  38. package/substrate/.claude/luminaries/alan-cooper.md +170 -0
  39. package/substrate/.claude/luminaries/alistair-cockburn.md +140 -0
  40. package/substrate/.claude/luminaries/amazon-pr-faq.md +34 -0
  41. package/substrate/.claude/luminaries/ash-maurya.md +121 -0
  42. package/substrate/.claude/luminaries/bill-buxton.md +210 -0
  43. package/substrate/.claude/luminaries/charles-sanders-peirce.md +150 -0
  44. package/substrate/.claude/luminaries/david-ogilvy.md +192 -0
  45. package/substrate/.claude/luminaries/don-norman.md +173 -0
  46. package/substrate/.claude/luminaries/edward-tufte.md +179 -0
  47. package/substrate/.claude/luminaries/eric-evans.md +160 -0
  48. package/substrate/.claude/luminaries/frederick-brooks.md +50 -0
  49. package/substrate/.claude/luminaries/gang-of-four.md +157 -0
  50. package/substrate/.claude/luminaries/jason-fried-dhh.md +46 -0
  51. package/substrate/.claude/luminaries/jesse-james-garrett.md +154 -0
  52. package/substrate/.claude/luminaries/john-ousterhout.md +94 -0
  53. package/substrate/.claude/luminaries/karl-popper.md +132 -0
  54. package/substrate/.claude/luminaries/kent-beck.md +168 -0
  55. package/substrate/.claude/luminaries/linus-torvalds.md +218 -0
  56. package/substrate/.claude/luminaries/martin-fowler.md +164 -0
  57. package/substrate/.claude/luminaries/michael-feathers.md +125 -0
  58. package/substrate/.claude/luminaries/michael-nygard.md +118 -0
  59. package/substrate/.claude/luminaries/robert-c-martin.md +164 -0
  60. package/substrate/.claude/luminaries/saltzer-schroeder.md +194 -0
  61. package/substrate/.claude/luminaries/sophia-prater.md +193 -0
  62. package/substrate/.claude/luminaries/stephen-toulmin.md +131 -0
  63. package/substrate/.claude/rules/artifact-ingestion.md +179 -0
  64. package/substrate/.claude/rules/assert-only-after-verify.md +137 -0
  65. package/substrate/.claude/rules/blocked-items.md +146 -0
  66. package/substrate/.claude/rules/branching.md +28 -0
  67. package/substrate/.claude/rules/commit-conventions.md +22 -0
  68. package/substrate/.claude/rules/context-engineering.md +202 -0
  69. package/substrate/.claude/rules/context-management.md +85 -0
  70. package/substrate/.claude/rules/destructive-operations.md +69 -0
  71. package/substrate/.claude/rules/diagnosis.md +38 -0
  72. package/substrate/.claude/rules/guardrails.md +73 -0
  73. package/substrate/.claude/rules/identifier-leak-prevention.md +104 -0
  74. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +98 -0
  75. package/substrate/.claude/rules/oo-ad-entry-point.md +117 -0
  76. package/substrate/.claude/rules/operator-facing-prose.md +196 -0
  77. package/substrate/.claude/rules/plain-english-discipline.md +154 -0
  78. package/substrate/.claude/rules/pr-body-shape.md +317 -0
  79. package/substrate/.claude/rules/pr-strategy.md +167 -0
  80. package/substrate/.claude/rules/sdlc-gates.md +149 -0
  81. package/substrate/.claude/rules/session-artifacts.md +236 -0
  82. package/substrate/.claude/rules/state-schema-validation.md +162 -0
  83. package/substrate/.claude/rules/whereami-load-bearing.md +202 -0
  84. package/substrate/.claude/rules/writing-craft-discipline.md +92 -0
  85. package/substrate/.claude/skills/build/SKILL.md +640 -0
  86. package/substrate/.claude/skills/decompose/SKILL.md +280 -0
  87. package/substrate/.claude/skills/diagnose/SKILL.md +297 -0
  88. package/substrate/.claude/skills/howdoi/SKILL.md +105 -0
  89. package/substrate/.claude/skills/ia-model/SKILL.md +108 -0
  90. package/substrate/.claude/skills/interaction-design/SKILL.md +112 -0
  91. package/substrate/.claude/skills/interpret-input/SKILL.md +180 -0
  92. package/substrate/.claude/skills/kiss/SKILL.md +449 -0
  93. package/substrate/.claude/skills/launch/SKILL.md +924 -0
  94. package/substrate/.claude/skills/lean-canvas/SKILL.md +332 -0
  95. package/substrate/.claude/skills/longrun/SKILL.md +426 -0
  96. package/substrate/.claude/skills/luminary/SKILL.md +481 -0
  97. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +177 -0
  98. package/substrate/.claude/skills/onboard-repo/SKILL.md +2190 -0
  99. package/substrate/.claude/skills/pattern-review/SKILL.md +99 -0
  100. package/substrate/.claude/skills/personas/SKILL.md +207 -0
  101. package/substrate/.claude/skills/promote/SKILL.md +283 -0
  102. package/substrate/.claude/skills/requirement/SKILL.md +98 -0
  103. package/substrate/.claude/skills/retro/SKILL.md +117 -0
  104. package/substrate/.claude/skills/riff/SKILL.md +114 -0
  105. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +163 -0
  106. package/substrate/.claude/skills/session-end/SKILL.md +309 -0
  107. package/substrate/.claude/skills/session-log/SKILL.md +299 -0
  108. package/substrate/.claude/skills/skills/SKILL.md +228 -0
  109. package/substrate/.claude/skills/spec/SKILL.md +105 -0
  110. package/substrate/.claude/skills/sprint/SKILL.md +392 -0
  111. package/substrate/.claude/skills/stage/SKILL.md +384 -0
  112. package/substrate/.claude/skills/state-a-problem/SKILL.md +185 -0
  113. package/substrate/.claude/skills/temperance/SKILL.md +108 -0
  114. package/substrate/.claude/skills/use-case/SKILL.md +417 -0
  115. package/substrate/.claude/skills/user-stories/SKILL.md +268 -0
  116. package/substrate/.claude/skills/value-prop/SKILL.md +251 -0
  117. package/substrate/.claude/skills/verify/SKILL.md +160 -0
  118. package/substrate/.claude/skills/whereami/SKILL.md +307 -0
  119. package/substrate/AGENTS.md +79 -0
  120. package/substrate/CLAUDE-lite.md +85 -0
  121. package/substrate/CODE_OF_CONDUCT.md +28 -0
  122. package/substrate/CONTRIBUTING.md +177 -0
  123. package/substrate/README.md +173 -0
  124. package/substrate/SECURITY.md +19 -0
  125. package/substrate/architecture/decisions/ADR-029-release-pipeline.md +79 -0
  126. package/substrate/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +139 -0
  127. package/substrate/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +192 -0
  128. package/substrate/architecture/decisions/ADR-039-release-tagging-scheme.md +145 -0
  129. package/substrate/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +155 -0
  130. package/substrate/architecture/decisions/ADR-044-unified-skill-body-template.md +162 -0
  131. package/substrate/lib/clean-artifacts-sweep.sh +112 -0
  132. package/substrate/lib/code-comment-discipline.sh +144 -0
  133. package/substrate/lib/composer-preflight.sh +459 -0
  134. package/substrate/lib/hook-inject.sh +255 -0
  135. package/substrate/lib/luminary-pick.sh +96 -0
  136. package/substrate/lib/output-discipline.sh +143 -0
  137. package/substrate/lib/rewrite-check.sh +214 -0
  138. package/substrate/lib/state.sh +1372 -0
  139. package/substrate/lib/telemetry.sh +205 -0
  140. package/substrate/lib/tier-check.sh +138 -0
  141. package/substrate/lib/tier-dependency-audit.sh +933 -0
  142. package/substrate/presence/install/bassclef-hook-connect.sh +178 -0
  143. package/substrate/presence/install/bassclef-sync.dispatcher.template.sh +841 -0
  144. package/substrate/presence/install/bassclef-sync.template.sh +2076 -0
  145. package/substrate/presence/install/schedule-auto-save.cron.sh +88 -0
  146. package/substrate/presence/install/schedule-auto-save.taskscheduler.md +122 -0
  147. package/substrate/scripts/aggregate-telemetry.sh +217 -0
  148. package/substrate/scripts/analyze-tier-dependencies.sh +239 -0
  149. package/substrate/scripts/generate-lite-manifest.sh +489 -0
  150. package/substrate/scripts/generate-tier-manifest.sh +28 -0
  151. package/substrate/scripts/intent-drift-check.sh +456 -0
  152. package/substrate/scripts/lite-manifest-drift-check.sh +146 -0
  153. package/substrate/scripts/render-lite-manifest-doc.sh +150 -0
  154. package/substrate/standards/bassclef-configs-schema.md +232 -0
  155. package/substrate/standards/bassclef-evolution.md +143 -0
  156. package/substrate/standards/bassclef-internal-jargon.md +244 -0
  157. package/substrate/standards/bassclef-managed-sentinel.md +96 -0
  158. package/substrate/standards/bassclef-source-config.md +228 -0
  159. package/substrate/standards/deferred-actions-schema.md +204 -0
  160. package/substrate/standards/docs-sync-allowlist.md +76 -0
  161. package/substrate/standards/graceful-exit.md +227 -0
  162. package/substrate/standards/hook-idempotency.md +102 -0
  163. package/substrate/standards/lite-manifest-schema-changes.md +75 -0
  164. package/substrate/standards/luminary-problem-patterns.md +481 -0
  165. package/substrate/standards/ogilvy-writing-rules.md +225 -0
  166. package/substrate/standards/opener-discipline.md +96 -0
  167. package/substrate/standards/operator-facing-prose-discipline.md +201 -0
  168. package/substrate/standards/project-directory-layout.md +276 -0
  169. package/substrate/standards/release-tagging.md +137 -0
  170. package/substrate/standards/sdlc-compliance.md +286 -0
  171. package/substrate/standards/secrets-lifecycle.md +210 -0
  172. package/substrate/standards/security-scanner-adapter.md +145 -0
  173. package/substrate/standards/skill-output-discipline.md +90 -0
  174. package/substrate/standards/state-spine.md +511 -0
  175. package/substrate/standards/tech-stack-config.md +109 -0
  176. package/substrate/standards/tier-dependency-analysis.md +167 -0
  177. package/substrate/standards/tier-runtime-deps/lite.md +57 -0
  178. package/substrate/standards/tier-tag-schema.md +155 -0
  179. package/substrate/standards/whereami-schema.md +301 -0
  180. package/substrate/standards/writing-guide.md +213 -0
  181. package/substrate/templates/deferred-action-template.md +45 -0
  182. package/substrate/templates/whereami-template.md +101 -0
@@ -0,0 +1,280 @@
1
+ ---
2
+ tier: lite
3
+ name: decompose
4
+ description: Pre-build responsibility audit — reads sequence diagrams, assigns responsibilities using GRASP with mandatory interface identification, audits functional and non-functional friction, selects patterns from GoF / Fowler / stack idioms. Bridges design and build.
5
+ problem: "Cross-cutting concerns bolt into implementations. Logging and tracing pile inside business code."
6
+ value: "A responsibility matrix that keeps each concern in its own class. Decorators stay clean."
7
+ inputs: [Sequence diagrams from spec, A decomposition target — feature or defect]
8
+ outputs: [Responsibility matrix, Interface registry, Pattern map for construction]
9
+ user_invocable: true
10
+ disable_model_invocation: false
11
+ composes_with: [spec, ia-model, interaction-design, pattern-review, temperance]
12
+ ---
13
+
14
+ # /decompose
15
+
16
+ ## What you get
17
+
18
+ A responsibility matrix + interface registry + pattern map for any non-trivial construction work. Three phases — GRASP responsibility assignment with mandatory interface names, coupling / variation / stability audit plus cross-cutting concerns (the -ilities), and pattern selection from GoF / Fowler / DDD / Clean Architecture vocabularies. The output answers "who handles what, through which interfaces, with what cross-cutting concerns" before the Builder writes a line of code.
19
+
20
+ Key principle: GRASP is applied literally, not conceptually. Every Indirection and Protected Variation assignment MUST produce a named interface. Every cross-cutting concern (observability, testability, extensibility, security, cacheability) MUST be identified in the NFR check and resolved as a Decorator or Proxy wrapping an interface — never bolted inside an implementation.
21
+
22
+ ## When to use it
23
+
24
+ - **Before any non-trivial build.** If the work touches 2+ layers (UI + API, API + DB, worker + queue), decompose first.
25
+ - **After `/interaction-design`** produces sequence diagrams. Those diagrams are the primary input.
26
+ - **When responsibility is ambiguous.** "Should this logic live in the API route or a service?" — decompose answers that structurally, not by gut feel.
27
+ - **On any Construction branch** (`feature/`, `fix/`) creating changes to `src/` per `.claude/rules/oo-ad-entry-point.md`.
28
+
29
+ Skip for single-file changes, config updates, docs, simple CRUD with obvious ownership, or pure refactors within one function.
30
+
31
+ ## ADR-consult — fire before scope confirmation (per bassclef-upstream#424)
32
+
33
+ Read every relevant ADR in `architecture/decisions/` before confirming scope. If your scope deviates from any ADR's decision or constraints, surface the deviation as the first agenda item — the operator decides amend-ADR vs revise-scope.
34
+
35
+ Per `.claude/rules/adr-discipline.md`. Mechanism: `adr-discipline-check.sh` fires on architectural edits (wired in `.claude/settings.json` since bet 28a WU-1).
36
+
37
+ ## FAQ
38
+
39
+ ### What are the three entry-point states?
40
+
41
+ - **State 1 — Canvas/greenfield.** Full flow preceded (canvas → spec → ia-model → interaction-design → sequence diagrams). `/decompose` reads sequence diagrams as primary input. If `/use-case` produced fully-dressed cases at `docs/use-cases/UC-NNN-*.md`, those feed in parallel.
42
+ - **State 2 — Epic/defect (no sequence diagrams, spec exists).** Reverse-engineer — read the spec, read current implementation, identify system events from ticket + code, treat current as "as-is" and ticket as "to-be." Phase 2 NFR check becomes especially critical.
43
+ - **State 3 — Bug/hotfix (symptom known, cause unknown).** `/diagnose` already ran per SDLC gates. Read the diagnose output (Is/Is Not, Five Whys, Hypothesis), identify which responsibility is mis-assigned OR which cross-cutting concern is missing (the bug is often a missing interface / decorator, not a logic error). Phase 1 is targeted.
44
+
45
+ ### Why must every Indirection or Protected Variation produce a named interface?
46
+
47
+ Because "Indirection: adapter wraps provider" without naming `IProviderAdapter` has not completed the decomposition. The interface IS the artifact, not the principle citation. Bet 2026-07-04 experience — the POA session bolted Langfuse tracing inside HaikuImputer because the earlier decomposition named "Indirection" without producing `IAssociationImputer`. Interface name forces the concrete artifact.
48
+
49
+ ### What are the -ilities?
50
+
51
+ Five cross-cutting concerns Phase 2 audits — observability, testability, extensibility, security, cacheability. Each maps to a Decorator or Proxy wrapping an interface. Missing any -ility from the audit is the same failure mode as skipping tests. If an -ility applies to a responsibility, it MUST appear as its own row with a named interface or wrapper.
52
+
53
+ ### When does a luminary lens influence pattern choice?
54
+
55
+ Phase 1 (Responsibility Matrix) and Phase 2 (Friction Points + NFR) are luminary-agnostic — they are structural facts about the domain. Phase 3 is the first phase where a luminary POV legitimately influences pattern choice among valid options. A luminary cannot override GRASP or NFR gates; the luminary shapes pattern choice among valid options only.
56
+
57
+ If the iteration goal declares multiple `primary_luminaries`, each pattern choice in Phase 3 cites which luminary drove it. All-one-name attribution when the goal lists multiple luminaries is the collapse-to-single failure.
58
+
59
+ ### What's the output artifact?
60
+
61
+ A single Decomposition Summary at `docs/decompositions/[feature-name].md` containing the three-phase output plus an Interface Registry (the primary Builder handoff artifact) plus proposed file structure plus decisions.
62
+
63
+ The Interface Registry answers "what interfaces do I need to implement?" before any code lands.
64
+
65
+ ### How does /decompose compose with /temperance and /pattern-review?
66
+
67
+ `/temperance` fires BEFORE `/decompose`. Temperance asks "should we build this?" Decompose asks "how should we structure it?" — different questions, different answers.
68
+
69
+ `/pattern-review` fires DURING or AFTER build. Decompose selects patterns before code lands; pattern-review validates they were applied per the decomposition.
70
+
71
+ ## Details below the fold
72
+
73
+ ### Position in the chain
74
+
75
+ ```
76
+ /interaction-design (sequence diagrams, state diagrams)
77
+
78
+ /decompose (responsibility audit → pattern map)
79
+
80
+ Builder implements against the decomposition
81
+
82
+ /pattern-review (validates patterns during/after build)
83
+ ```
84
+
85
+ ### Phase 1 — Responsibility Matrix (GRASP)
86
+
87
+ For each system event in the sequence diagrams, assign responsibility using Larman's GRASP principles:
88
+
89
+ | Principle | Question it answers | Stack translation |
90
+ |---|---|---|
91
+ | **Information Expert** | Who has the data needed to do this? | Prisma model → repository / service. React component with local state → handler stays in component. |
92
+ | **Creator** | Who should create this object? | API route creates via Prisma. Factory if creation varies by type. |
93
+ | **Controller** | Entry point for this system event? | API route (server boundary) or server action. One controller per use case, not per entity. |
94
+ | **Low Coupling** | Does A need to know B's internals? | If yes → introduce indirection (service layer, repository, adapter). |
95
+ | **High Cohesion** | Is this module doing too many unrelated things? | If a route handles validation + business logic + DB + email → extract. |
96
+ | **Pure Fabrication** | No natural home for this logic? | `lib/services/ScoringService.ts`, `lib/repositories/DealRepository.ts`. |
97
+ | **Indirection** | Need to decouple two things? | Middleware, event bus, service layer between route and DB. |
98
+ | **Protected Variations** | What changes? What stays stable? | Interface / adapter around unstable external APIs. Strategy for varying business rules. |
99
+
100
+ Output — Responsibility Matrix:
101
+
102
+ ```markdown
103
+ | System Event | Controller | Expert | Fabrications | Interfaces | GRASP Justification |
104
+ |---|---|---|---|---|---|
105
+ | User submits deal | `POST /api/deals` | `Deal` (Prisma) | `DealRepository` | `IDealRepository` | Expert: Deal model owns fields. Pure Fabrication: repository isolates query logic from route. |
106
+ | Score recalculates | Server action | `ScoreConfig`, `Deal` | `ScoringService` | `IScoringStrategy` | Expert: ScoreConfig owns dimensions. Protected Variation: scoring rules vary. |
107
+ ```
108
+
109
+ Rules:
110
+
111
+ - Every row cites at least one GRASP principle.
112
+ - Interfaces column is mandatory. Every Indirection / Protected Variation names its interface.
113
+ - If you cannot name the Expert, the entity model is incomplete — go back to `/ia-model`.
114
+ - If a Controller handles 3+ responsibilities, split it.
115
+ - Names in the matrix match the ubiquitous language of the domain (Evans DDD) — not database schema.
116
+ - Each fabrication is a deep module (Ousterhout) — small interface, complex implementation hidden. A Service passing calls through to a Repository is two shallow modules pretending to be one deep.
117
+
118
+ ### Phase 2 — Coupling, Variation, NFR Audit
119
+
120
+ Review the Responsibility Matrix. For each row, run four checks:
121
+
122
+ 1. **Coupling check.** Does the Controller reach into the Expert's internals? If yes → introduce a Repository or Service.
123
+ 2. **Variation check.** Does behavior vary by type / configuration / context? If yes → Protected Variation.
124
+ 3. **Stability check.** Does this touch an external API that could change? If yes → Adapter.
125
+ 4. **NFR check** (the -ilities):
126
+
127
+ | -ility | Question | What it catches |
128
+ |---|---|---|
129
+ | **Observability** | Who traces this? Records latency / cost / input / output? | Missing Decorator — the Langfuse-inside-HaikuImputer mistake. Tracing bolted inside implementation instead of wrapping interface. |
130
+ | **Testability** | Can I test this in isolation? What needs mocking? | Concrete dependencies without interfaces. Cannot swap implementation in a test. |
131
+ | **Extensibility** | What's the next provider / strategy / channel? | Missing interface for Protected Variation. "Add SMS" means editing the email service. |
132
+ | **Security** | Who authenticates / authorizes? Where is tenant context resolved? | Auth wired inside business logic instead of at the boundary. |
133
+ | **Cacheability** | What's read-heavy and stable enough to cache? Where does invalidation live? | Cache logic mixed into business logic instead of isolated as Proxy / Decorator. |
134
+
135
+ Rule: if an -ility concern applies to a responsibility, it MUST appear as its own row in Friction Points with a named interface or wrapper. "Add observability later" is the same failure as "add tests later."
136
+
137
+ Output — Friction Points:
138
+
139
+ ```markdown
140
+ | Location | Type | Risk | Resolution |
141
+ |---|---|---|---|
142
+ | `POST /api/deals` → Prisma query | Coupling | Route knows schema shape | Extract `DealRepository` |
143
+ | Scoring dimensions | Variation | Rules vary per deal type | Strategy — `IScoringStrategy` |
144
+ | Association imputation | Observability | Tracing lives inside HaikuImputer; swapping to Gemma loses traces | Decorator — `ObservedImputer(IAssociationImputer)` traces via Langfuse |
145
+ | Association imputation | Testability | Cannot test imputation without LLM call | Interface — `IAssociationImputer` enables stub / mock |
146
+ ```
147
+
148
+ ### Phase 3 — Pattern Map
149
+
150
+ Select concrete patterns from the vocabulary:
151
+
152
+ **Functional patterns:**
153
+
154
+ | Friction | Pattern sources |
155
+ |---|---|
156
+ | Variation by type | GoF: Strategy, State. React: polymorphic components, render props. |
157
+ | Complex creation | GoF: Factory Method, Abstract Factory. Prisma: nested create, transaction. |
158
+ | Unstable external API | GoF: Adapter. Next.js: route handler wrapping SDK. |
159
+ | Complex orchestration | GoF: Facade. Next.js: server action composing services. |
160
+ | Event propagation | GoF: Observer. Prisma: middleware hooks. Next.js: revalidation. |
161
+ | Data access isolation | Fowler: Repository, Unit of Work. |
162
+ | State complexity | GoF: State. React: useReducer, state machines (XState). |
163
+ | Caching / memoization | React: useMemo, React.cache. Next.js: ISR, unstable_cache. |
164
+
165
+ **Cross-cutting patterns (from NFR check):**
166
+
167
+ | -ility | Pattern sources | Structural principle |
168
+ |---|---|---|
169
+ | Observability | GoF: Decorator, Observer. Langfuse: trace wrapper. OpenTelemetry: span instrumentation. | Decorator wraps the interface, not the implementation. Tracing MUST survive provider swap. |
170
+ | Testability | Interface extraction → stub / mock. Fowler: Test Double. | Cannot swap implementation in a test = coupled to concrete class. |
171
+ | Extensibility | GoF: Strategy, Abstract Factory. Plugin registries. | New provider = new class implementing existing interface. Zero edits to existing code. |
172
+ | Security | Middleware chain. Next.js: middleware.ts. Fowler: Gateway. | Auth resolved at boundary, passed as context. Business logic never checks auth. |
173
+ | Cacheability | GoF: Proxy. React: React.cache. Next.js: ISR. Redis wrapper. | Cache as Proxy / Decorator wrapping interface. Invalidation strategy declared, not bolted on. |
174
+
175
+ Per @luminary gang-of-four: program to an interface, not an implementation; favor object composition over class inheritance. Cross-cutting concerns wrap interfaces via Decorator — they never live inside the concrete implementation.
176
+
177
+ ### Luminary lens on Phase 3
178
+
179
+ Read the iteration goal's `primary_luminaries` field (list form) — treat scalar `primary_luminary` as single-element list for backward compat. For each entry, read `.claude/luminaries/[slug].md`.
180
+
181
+ Multi-luminary handling: each luminary should have a `role` annotation. Phase 3 Pattern Map cites which luminary drove each pattern choice — no "applied the primary" language when 2+ luminaries active. Add an Attribution column to the pattern table.
182
+
183
+ Stub-depth luminary — emit BLOCKED (per `.claude/rules/blocked-items.md`) and either upgrade the luminary or explicitly defer.
184
+
185
+ Common preferences:
186
+
187
+ | Primary luminary | Pattern preferences |
188
+ |---|---|
189
+ | Sophia Prater | Componentized content, progressive disclosure, entity-derived nav; Strategy over Factory when behavior varies by entity type |
190
+ | Don Norman | Explicit affordances, feedback wrappers, constraint-first validation; Decorator for feedback consistency |
191
+ | Edward Tufte | Small-multiples for comparison, sparklines in tables; data-dense patterns over card-based |
192
+ | Dieter Rams / Jony Ive | Minimal API surface on components, removal over addition; Facade to hide complexity |
193
+ | Alan Cooper | Role-based UI variants, primary-persona-optimized Controllers; Strategy per persona-role |
194
+ | @luminary alistair-cockburn | Walking Skeleton as first PR; Hexagonal Architecture with Ports & Adapters — business logic at center, adapters at outside |
195
+
196
+ ### Final Output — Decomposition Summary
197
+
198
+ Combine all three phases into `docs/decompositions/[feature-name].md`:
199
+
200
+ ```markdown
201
+ # Decomposition: [Feature Name]
202
+
203
+ **Source**: [sequence diagram reference or entry-point state]
204
+ **Date**: YYYY-MM-DD
205
+
206
+ ## Responsibility Matrix
207
+ [Phase 1 table with Interfaces column]
208
+
209
+ ## Friction Points
210
+ ### Functional
211
+ [Phase 2 coupling / variation / stability rows]
212
+ ### Non-Functional (-ilities)
213
+ [Phase 2 NFR rows]
214
+
215
+ ## Pattern Map
216
+ ### Functional patterns
217
+ [Phase 3 functional table]
218
+ ### Cross-cutting patterns
219
+ [Phase 3 cross-cutting table]
220
+
221
+ ## Interface Registry
222
+ | Interface | Purpose | Implementations (known) |
223
+ |---|---|---|
224
+ | `IAssociationImputer` | Abstract LLM provider | `HaikuImputer`, `GemmaImputer` (future) |
225
+
226
+ ## File Structure (proposed)
227
+ src/
228
+ app/api/[route]/ ← Controllers
229
+ app/actions/ ← Facades (server actions)
230
+ lib/
231
+ services/ ← Pure Fabrications
232
+ repositories/ ← Data access (Fowler Repository)
233
+ adapters/ ← External API wrappers
234
+ decorators/ ← Cross-cutting: Observed*, Cached*, Logged*
235
+ [domain]/
236
+ types.ts ← Interface definitions (I* contracts)
237
+ strategies/ ← Strategy implementations
238
+
239
+ ## Decisions
240
+ - [Why X is a service, not inline in the route]
241
+ - [Why observability is a Decorator, not inline tracing]
242
+ - [Why caching is a Proxy, not inline Redis calls]
243
+ ```
244
+
245
+ ### Anti-patterns
246
+
247
+ - Decomposing trivial work
248
+ - Forcing patterns when the friction table is empty (say "no friction — build directly")
249
+ - Skipping Phase 1 and jumping to "use a Factory"
250
+ - Decomposing without sequence diagrams (State 1) or without spec / current code (State 2)
251
+ - Skipping the NFR check — cross-cutting concerns identified later become bolt-on hacks
252
+ - Naming principles without interfaces — the interface IS the artifact
253
+ - Cross-cutting logic inside implementations — tracing inside HaikuImputer, caching inside DealRepository, auth inside a route handler are all the same mistake
254
+
255
+ ### Composes with
256
+
257
+ | Skill | Relationship |
258
+ |---|---|
259
+ | `/temperance` | Fires BEFORE. Should we build this at all? |
260
+ | `/interaction-design` | Produces sequence diagrams `/decompose` consumes |
261
+ | `/ia-model` | Produces entity model that informs Information Expert assignments |
262
+ | `/pattern-review` | Validates patterns DURING or AFTER build. Decompose selects BEFORE. |
263
+ | `/spec` | May contain sequence diagrams inline. Decompose reads from spec or standalone artifacts. |
264
+ | `/use-case` | Fully-dressed cases feed Phase 1 in parallel with sequence diagrams |
265
+
266
+ ### Refs
267
+
268
+ - Craig Larman, *Applying UML and Patterns* — GRASP patterns
269
+ - @luminary gang-of-four — *Design Patterns* — 23 pattern vocabulary
270
+ - @luminary martin-fowler — *Patterns of Enterprise Application Architecture* + *Refactoring* catalog
271
+ - @luminary eric-evans — *Domain-Driven Design* — Ubiquitous Language + Bounded Contexts + Aggregates
272
+ - @luminary alistair-cockburn — *Writing Effective Use Cases* + Hexagonal Architecture (Ports & Adapters)
273
+ - @luminary robert-c-martin — *Clean Architecture* — SOLID + Dependency Rule
274
+ - @luminary john-ousterhout — *A Philosophy of Software Design* — deep modules + comments-as-design
275
+ - `.claude/rules/oo-ad-entry-point.md` — entry-point rule requiring `/decompose` evidence
276
+ - `.claude/rules/adr-discipline.md` — ADR-consult before scope confirmation
277
+
278
+ ## Output discipline
279
+
280
+ Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.
@@ -0,0 +1,297 @@
1
+ ---
2
+ tier: lite
3
+ name: diagnose
4
+ description: Diagnose a defect before fixing — reproduce the failure (Step 0) + Is/Is Not + Five Whys + Hypothesis. Run before writing any fix code; lazy diagnosis ships brittle fixes.
5
+ problem: "Bugs get fixed on guesses. The wrong cause gets patched. The class comes back a week later."
6
+ value: "A short trace from failure to root cause. You fix the class once instead of the instance three times."
7
+ inputs: [A failing test or error log, A bug ticket or screenshot]
8
+ outputs: [Reproduce step, Is/Is Not table, Five Whys chain, Hypothesis with a read-only test]
9
+ user_invocable: true
10
+ disable_model_invocation: false
11
+ ---
12
+
13
+ # /diagnose
14
+
15
+ ## What you get
16
+
17
+ Structured defect diagnosis. Run `/diagnose` before writing any fix code. I walk you through 7 steps:
18
+
19
+ - Step 0 — reproduce the failure (RED anchor)
20
+ - Step 1 — gather evidence
21
+ - Step 2 — Is/Is Not table
22
+ - Step 3 — resolution chain across stack layers
23
+ - Step 4 — Five Whys to root cause
24
+ - Step 5 — hypothesis with a read-only test
25
+ - Step 6 — significance check
26
+ - Step 7 — gate marker, then the fix
27
+
28
+ The output separates "I fixed it" from a real cure. Without a repro, "I fixed it" has no counterpart. The repro is the surface every next step operates on.
29
+
30
+ Every diagnosis writes a marker at `state/markers/diagnose/<branch>.marker`. The pre-build-gate hook reads it. Lazy diagnosis ships weak fixes.
31
+
32
+ ## When to use it
33
+
34
+ Any time something is wrong, broken, failing, or behaving unexpectedly. Trigger words:
35
+
36
+ - **Defects**: bug, defect, regression, flaky, intermittent
37
+ - **Failures**: error, fail, crash, panic, exception, abort, SIGKILL, OOM
38
+ - **State**: broken, wrong, corrupt, stale, stuck, hung, hanging, frozen, deadlock
39
+ - **HTTP**: 404, 500, 502, 503, 504, redirect loop, CORS
40
+ - **Performance**: timeout, timed out, slow, degraded, memory leak, high CPU
41
+ - **Availability**: down, dead, unreachable, not responding, connection refused
42
+ - **Behavior**: not working, does not work, will not start, stopped working, blank page, spinner
43
+ - **Data semantic renames** (bassclef#601): before renaming a label / column / enum / UI copy that reflects data, verify the data semantic matches the new name
44
+
45
+ Skip diagnosis only for the three trivial cases in the FAQ — typo, missing env var, off-by-one. Everything else earns the ceremony.
46
+
47
+ ## FAQ
48
+
49
+ ### Why is Step 0 (Reproduce) load-bearing?
50
+
51
+ Without a repro, "I fixed it" has no counterpart "here's the thing it does not do anymore." The repro is the surface every subsequent step operates on. Step 0 writes a Reproduction block with the exact command / URL / action that triggers the failure, observed vs expected, environment, and reproducibility (every time / intermittent / unable).
52
+
53
+ If you cannot reproduce, STOP. You may not be looking at a real defect — you may be looking at operator expectation mismatch, environment drift, or stale cache. Escalate before continuing.
54
+
55
+ ### When can I skip Step 0?
56
+
57
+ Three localized cases: typo (obvious misspelling visible in diff), missing env var (error message names the var), off-by-one (index / boundary, one-character fix). In these cases the repro is implicit in the code change itself. State "Step 0 skipped — [reason]" in your output. Silence is not skip.
58
+
59
+ For all other failures, Step 0 is mandatory.
60
+
61
+ ### What's the Step 0 identifier check?
62
+
63
+ Before naming any external identifier in the Reproduction block — hook filename, npm scope, ticket ID, GitHub org, file path, ADR number — verify the identifier resolves against reality. Hook filenames: `find .claude/hooks -name "<name>.sh"` returns non-empty. Ticket IDs: `gh issue view <N>` returns a title. File paths: `test -f <path>`. ADR numbers: `ls architecture/decisions/ADR-<NNN>-*.md`.
64
+
65
+ Bet 2026-07-04b caught three R8 misses in one session — invented hook name, invented npm scope, invented Chain B shape. All three came from authoring text against a mental model without a read against reality. Tier 0 tests used the invented names as fixture data — self-referential pass. Reading the source once at Step 0 falsifies the class before the ticket ships.
66
+
67
+ Sister to `.claude/rules/assert-only-after-verify.md`.
68
+
69
+ ### What's the Resolution Chain step?
70
+
71
+ If the defect involves behavior that could be produced at multiple layers of a stack, draw the resolution chain BEFORE forming hypotheses. This is the spatial complement to Five Whys (which traces causation over time).
72
+
73
+ Pre-configured chains cover CSS / Layout / Scroll, Auth / Middleware, State Management (React), Config / Environment, Database / ORM, Network / API, Build Pipeline, Module / Import Resolution, Cross-Repo CI Write-Path. Pick the domain chain that matches your defect. Details below the fold.
74
+
75
+ ### What's the significance check?
76
+
77
+ Before fixing, classify the finding — trivial (< 30 min + no new objects + no UI change), moderate, or significant. Trivial goes straight to fix with a note in the commit message. Moderate or significant requires a GitHub issue BEFORE writing fix code, so the scope is tracked.
78
+
79
+ ### When do I run /promote after diagnosis?
80
+
81
+ If the diagnosis reveals a reusable pattern (new resolution chain, diagnostic technique, anti-pattern, trap) that would help in a different repo, run `/promote` with the pattern. Agents don't self-recognize promotable patterns; the pre-commit hook catches file-level changes to `.claude/` but not workflow insights. Step 7 is the self-catch mechanism.
82
+
83
+ Skip promotion for trivial fixes.
84
+
85
+ ## Details below the fold
86
+
87
+ ### Procedure
88
+
89
+ **Step 0 — Reproduce (RED anchor).**
90
+
91
+ ```
92
+ ## Reproduction
93
+ - Repro command / URL / action: [exact sequence]
94
+ - Observed: [what happens — exact error, status, behavior]
95
+ - Expected: [what should happen]
96
+ - Environment: [local / staging / prod / CI]
97
+ - Reproducible?: [every time | intermittent N/M | unable to reproduce]
98
+ ```
99
+
100
+ Then run the Step 0 identifier check (see FAQ) on every external name in the block.
101
+
102
+ **Step 1 — Gather evidence (READ-ONLY — no code changes).**
103
+
104
+ - `git log --oneline -10` — what changed recently?
105
+ - Check logs (application, worker, CI output)
106
+ - Check health endpoints
107
+ - Check browser console errors (ask user for screenshot if needed)
108
+
109
+ **Step 2 — Is / Is Not.**
110
+
111
+ ```
112
+ ## Is / Is Not
113
+ - IS: [what fails — URLs, status codes, error messages]
114
+ - IS NOT: [what still works — narrow the impact]
115
+ - Changed: [recent commits, deploys, config, external services]
116
+ ```
117
+
118
+ **Step 2b — Resolution Chain.**
119
+
120
+ Pick the pre-configured chain for your domain. For each layer:
121
+
122
+ - What does this layer contribute? (transform, filter, override, wrap, proxy)
123
+ - Does it have hidden side effects? (implicit defaults, wrapper elements, middleware)
124
+ - Can it silently override downstream layers? (specificity, precedence, config cascade)
125
+ - Is a library or framework adding a layer you did not write? (READ THE SOURCE)
126
+
127
+ Then identify which layer produces the observed behavior, which SHOULD control it, and whether any intermediate layers silently override or wrap.
128
+
129
+ Skip Resolution Chain if the defect is single-file, obviously a typo / env var / off-by-one, or Is/Is Not already narrows to one layer.
130
+
131
+ **Step 3 — Five Whys.**
132
+
133
+ ```
134
+ ## Five Whys
135
+ 1. Why does [symptom]? → because [X]
136
+ 2. Why [X]? → because [Y]
137
+ 3. Why [Y]? → because [Z]
138
+ 4. Why [Z]? → because [W]
139
+ 5. Why [W]? → ROOT CAUSE: [...]
140
+ ```
141
+
142
+ **Step 4 — Hypothesis + Test.**
143
+
144
+ ```
145
+ ## Hypothesis
146
+ - Cause: [your theory]
147
+ - Test: [a read-only command to verify — NOT a fix]
148
+ - If confirmed: [what you'll change]
149
+ ```
150
+
151
+ **Step 5 — Significance check.**
152
+
153
+ ```
154
+ ## Significance
155
+ - Level: [trivial / moderate / significant]
156
+ - Criteria: [< 30 min + no new objects + no UI change = trivial]
157
+ - UI surface impacted?: [yes/no — if yes, UX translation may be needed]
158
+ - Epic required?: [trivial = no (log in commit), moderate+ = yes]
159
+ ```
160
+
161
+ Moderate or significant → create a GitHub issue BEFORE writing fix code. Trivial → proceed to fix with commit-message note.
162
+
163
+ **Step 6 — Write the gate marker, then fix.**
164
+
165
+ ```bash
166
+ BRANCH=$(git branch --show-current)
167
+ BRANCH_SLUG=$(echo "$BRANCH" | tr '/' '-')
168
+ BRANCH_HASH=$(echo "$BRANCH" | md5 -q 2>/dev/null || echo "$BRANCH" | md5sum 2>/dev/null | cut -d' ' -f1)
169
+ SESSION_ID=${CLAUDE_SESSION_ID:-$$}
170
+
171
+ # Ephemeral flag
172
+ touch "/tmp/claude-diagnosis-done-${SESSION_ID}-${BRANCH_HASH}"
173
+
174
+ # Durable git-tracked marker
175
+ mkdir -p state/markers/diagnose
176
+ date -u +%Y-%m-%dT%H:%M:%SZ > "state/markers/diagnose/${BRANCH_SLUG}.marker"
177
+ git add "state/markers/diagnose/${BRANCH_SLUG}.marker"
178
+ ```
179
+
180
+ Only NOW may you write code. The fix should address the ROOT CAUSE, not the symptom.
181
+
182
+ **Step 7 — Pattern promotion check.**
183
+
184
+ After the fix is confirmed working:
185
+
186
+ - Did this diagnosis reveal a reusable pattern (new resolution chain, diagnostic technique, anti-pattern, or trap)?
187
+ - Would this help in a DIFFERENT repo?
188
+ - If yes → run `/promote` with the pattern, not just the fix.
189
+
190
+ Skip if the fix was trivial.
191
+
192
+ ### Pre-configured resolution chains by domain
193
+
194
+ **CSS / Layout / Scroll**
195
+ ```
196
+ viewport → html → body → layout container → scroll container → target element
197
+ ```
198
+ Per ancestor check: overflow-x / overflow-y, position, display (flex child missing min-w-0?), creates new scroll context?, creates new stacking context?, component library adding hidden wrapper divs? (READ THE SOURCE).
199
+
200
+ Traps: shadcn/Radix wrapping in scroll containers, w-full overriding explicit width, border-collapse clipping box-shadow (Chrome), overflow:clip breaking sticky on iOS, flex children expanding past viewport.
201
+
202
+ **Auth / Middleware**
203
+ ```
204
+ client → proxy/CDN → edge middleware → route middleware → route handler → DB policy → response
205
+ ```
206
+ Per layer check: short-circuit? (redirect, 401), modify the request? (headers, cookies), cache auth state? (stale session, revoked token still cached), which layer enforces tenant isolation?
207
+
208
+ Traps: Next.js middleware running before route handlers, cached sessions surviving token revocation, middleware redirect loops, tenant context resolved at wrong layer.
209
+
210
+ **State Management (React)**
211
+ ```
212
+ server state → cache (React Query/SWR) → global store → context → component state → derived → render
213
+ ```
214
+ Per layer check: is this layer stale?, are multiple layers holding copies?, does a re-render trigger here?, is the update path sync or async?
215
+
216
+ Traps: optimistic UI not rolling back on server error, stale cache surviving a mutation, context re-rendering all consumers, derived state computed from stale inputs.
217
+
218
+ **Config / Environment**
219
+ ```
220
+ hardcoded default → config file → .env → env var → CLI flag → runtime override → framework injection
221
+ ```
222
+ Per layer check: is this layer actually being read? (wrong .env, NODE_ENV mismatch), does higher-precedence layer silently override? (framework defaults), is the value being coerced? (string "false" → truthy in JS).
223
+
224
+ Traps: Next.js/Prisma adding defaults, .env.local overriding .env, Docker not passing env vars, string coercion of booleans.
225
+
226
+ **Database / ORM**
227
+ ```
228
+ application code → ORM query builder → connection pool → DB engine → query planner → indexes → storage
229
+ ```
230
+ Per layer check: is the ORM generating the expected SQL? (log the query), is the connection pool exhausted?, is the query planner using the expected index? (EXPLAIN), is there a transaction holding a lock?
231
+
232
+ Traps: Prisma implicit select (fetching all columns), N+1 queries from relations, connection pool exhaustion from unclosed transactions, migration applied locally but not in prod.
233
+
234
+ **Network / API**
235
+ ```
236
+ client → DNS → CDN/proxy → load balancer → origin server → upstream API → response
237
+ ```
238
+ Per layer check: is the request reaching the origin? (CDN cache, proxy rewrite), is the response being modified? (CORS headers stripped), is there a timeout at this layer? (LB timeout < API response time), is TLS terminating at the right layer?
239
+
240
+ Traps: CDN caching stale responses, proxy rewriting headers, CORS preflight failing at CDN layer, WebSocket connections killed by LB timeout, DNS caching a dead IP.
241
+
242
+ **Build Pipeline**
243
+ ```
244
+ source → preprocessor → TypeScript compiler → bundler → tree-shaking → minifier → output
245
+ ```
246
+ Per layer check: is the source file included in the compilation? (tsconfig includes), is tree-shaking removing code with side effects?, is the bundler resolving the expected module? (duplicate packages), is minification mangling names that are reflected on?
247
+
248
+ Traps: barrel file re-exports defeating tree-shaking, tsconfig paths not matching bundler aliases, package duplicated at different versions in node_modules, CSS modules hashed differently in dev vs prod.
249
+
250
+ **Module / Import Resolution**
251
+ ```
252
+ import statement → tsconfig paths → bundler alias → node_modules → package.json exports → actual file
253
+ ```
254
+ Per layer check: is tsconfig path mapping matching? (baseUrl, paths), is the bundler using different resolution than tsc?, is the package re-exporting from a different version?, are there multiple copies of the same package?
255
+
256
+ Traps: path alias in tsconfig not matching webpack/vite, package using "exports" field that blocks deep imports, monorepo hoisting creating duplicate React instances.
257
+
258
+ **Cross-Repo CI Write-Path (GitHub Actions / shared substrate distribution)**
259
+ ```
260
+ source repo push → Actions trigger → workflow runner → checkout source → cross-repo action → target repo
261
+ ```
262
+ Per layer check: is the workflow trigger firing? (event type, branch filter — check Actions tab), did the runner allocate?, is the cross-repo credential still valid? (PAT expired, GitHub App installation removed), does the credential carry the required target scope?, is the target repo accepting the write? (branch protection, Actions disabled), is the action library on a compatible version?
263
+
264
+ Traps: PAT silently expires without CI failure signal (step reports "success" but opened zero PRs); fine-grained PAT scope reduced after creation; GitHub App installation removed from ONE target while others still work (silent matrix partial-fail); peter-evans/create-pull-request returning no-op when target branch already exists; target repo added branch protection after PAT creation; cross-repo rate limits; `add-paths:` filter silently excluding the intended file; `delete-branch: true` racing with a fresh open; auto-merge stalled waiting on required checks that never ran because Actions was disabled at target.
265
+
266
+ Specific to bassclef substrate distribution: if `BASSCLEF_CONSUMER_WRITE_TOKEN` fails, the publish half (S3 upload) still succeeds because it uses different credentials — the pipeline is half-broken, surfaces only when consumers sync and hit a stale pin. Origin: bassclef#222, 2026-04-20.
267
+
268
+ ### Anti-patterns
269
+
270
+ - Guessing-and-retrying with different parameters
271
+ - Silently working around an error instead of understanding it
272
+ - Fixing the symptom without tracing to root cause
273
+ - Skipping diagnosis because "it's obvious" — it's usually not
274
+ - Fixing at one layer without mapping the full resolution chain — each fix addresses the wrong layer, creating a whack-a-mole pattern that compounds over multiple commits. Origin: POA sticky columns — 16 commits because each attempt fixed one CSS layer without seeing the full containment chain.
275
+ - Assuming the layer you wrote is the only layer involved. Libraries and frameworks routinely add intermediate layers (wrapper divs, middleware, config defaults) that silently override your code. READ THE SOURCE.
276
+
277
+ ### Output discipline
278
+
279
+ Per bassclef#790 (operator-facing-prose discipline): /diagnose output (Step 0 repro, Is/Is Not table, Five Whys, Hypothesis, Resolution Chain) surfaces shorthand (WU-N, F-X.Y, ADR-NNN, #NNN, LF-N) with a plain-language gloss at first mention per response. See `standards/operator-facing-prose-discipline.md` for format examples.
280
+
281
+ Per bassclef#790 Rule 2: any /diagnose SKILL.md edit applies a /kiss pass to the whole file in the same change.
282
+
283
+ ### Refs
284
+
285
+ - `.claude/rules/assert-only-after-verify.md` — Step 0 identifier check sister discipline
286
+ - `.claude/rules/blocked-items.md` — substrate-defect promotion mandatory trigger
287
+ - `.claude/rules/stuck-signal-diagnostic.md` — stuck-counter path that surfaces substrate defects
288
+ - `.claude/hooks/pre-build-gate.sh` — reads the diagnose marker on fix/ branches
289
+ - `.claude/skills/promote/SKILL.md` — pattern promotion downstream skill
290
+ - bet 2026-07-04b — R8 identifier-check parent
291
+ - bet 2026-07-04c WU-4 — Step 0 identifier check shipped
292
+ - bassclef#601 — data semantic rename trigger
293
+ - bassclef#790 — operator-facing-prose discipline
294
+
295
+ ## Output discipline
296
+
297
+ Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.