@thebassclef/lite 1.1.1 → 1.2.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 (135) hide show
  1. package/dist/cli.cjs +23 -6
  2. package/dist/cli.js +23 -6
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/lite/.claude/bassclef-configs.jsonc +56 -0
  7. package/dist/lite/.claude/bassclef-orientation.md +120 -0
  8. package/dist/lite/.claude/hooks/adr-discipline-check.sh +132 -0
  9. package/dist/lite/.claude/hooks/atomic-pr-check.sh +169 -0
  10. package/dist/lite/.claude/hooks/auto-save-idle.sh +51 -0
  11. package/dist/lite/.claude/hooks/bassclef-sync.sh +51 -13
  12. package/dist/lite/.claude/hooks/bet-doc-gate.sh +283 -0
  13. package/dist/lite/.claude/hooks/bug-diagnosis.sh +64 -0
  14. package/dist/lite/.claude/hooks/destructive-command-guard.sh +136 -0
  15. package/dist/lite/.claude/hooks/file-rename-discipline-check.sh +147 -0
  16. package/dist/lite/.claude/hooks/hook-classifier-canary.sh +158 -0
  17. package/dist/lite/.claude/hooks/kiss-default-check.sh +129 -0
  18. package/dist/lite/.claude/hooks/multi-tenancy-check.sh +83 -0
  19. package/dist/lite/.claude/hooks/oo-ad-entry-point-check.sh +216 -0
  20. package/dist/lite/.claude/hooks/operator-private-path-check.sh +203 -0
  21. package/dist/lite/.claude/hooks/pattern-annotation-validate.sh +142 -0
  22. package/dist/lite/.claude/hooks/plain-english-steering.sh +15 -1
  23. package/dist/lite/.claude/hooks/post-write-trace.sh +66 -0
  24. package/dist/lite/.claude/hooks/pr-body-scrub-check.sh +446 -0
  25. package/dist/lite/.claude/hooks/pre-commit-identifier-leak-scrub.sh +137 -0
  26. package/dist/lite/.claude/hooks/pre-gh-pr-body-scrub.sh +192 -0
  27. package/dist/lite/.claude/hooks/pre-gh-pr-title-scrub.sh +172 -0
  28. package/dist/lite/.claude/hooks/role-entry-gate.sh +115 -0
  29. package/dist/lite/.claude/hooks/save-state.sh +268 -0
  30. package/dist/lite/.claude/hooks/session-reflection.d/08-settings-drift.sh +8 -1
  31. package/dist/lite/.claude/hooks/session-reflection.d/10-abrupt-stop-recovery.sh +52 -0
  32. package/dist/lite/.claude/hooks/session-reflection.d/55-orientation-gate.sh +40 -4
  33. package/dist/lite/.claude/hooks/session-reflection.d/80-hook-heartbeat-check.sh +12 -5
  34. package/dist/lite/.claude/hooks/session-reflection.d/81-hook-manifest-staleness.sh +18 -2
  35. package/dist/lite/.claude/hooks/session-reflection.d/91-npm-version-drift.sh +54 -0
  36. package/dist/lite/.claude/hooks/session-reflection.d/tests/10-abrupt-stop-recovery.test.sh +95 -0
  37. package/dist/lite/.claude/hooks/session-reflection.sh +62 -15
  38. package/dist/lite/.claude/hooks/tool-failure-diagnosis.sh +50 -0
  39. package/dist/lite/.claude/luminaries/andrej-karpathy.md +165 -0
  40. package/dist/lite/.claude/luminaries/dave-gray.md +155 -0
  41. package/dist/lite/.claude/luminaries/gary-klein.md +166 -0
  42. package/dist/lite/.claude/luminaries/kaoru-ishikawa.md +162 -0
  43. package/dist/lite/.claude/luminaries/lean-product-canvas.md +33 -0
  44. package/dist/lite/.claude/luminaries/luke-wroblewski.md +224 -0
  45. package/dist/lite/.claude/luminaries/ryan-singer.md +113 -0
  46. package/dist/lite/.claude/luminaries/steve-krug.md +168 -0
  47. package/dist/lite/.claude/luminaries/tony-ulwick.md +134 -0
  48. package/dist/lite/.claude/rules/arc-level-orientation-before-leaf.md +60 -0
  49. package/dist/lite/.claude/rules/architect-review-discipline.md +71 -0
  50. package/dist/lite/.claude/rules/auto-fix-criteria.md +126 -0
  51. package/dist/lite/.claude/rules/bassclef-hook-drift-blocker.md +144 -0
  52. package/dist/lite/.claude/rules/bassclef-models-discovery.md +107 -0
  53. package/dist/lite/.claude/rules/bassclef-workflow-parity.md +104 -0
  54. package/dist/lite/.claude/rules/cost-governance.md +154 -0
  55. package/dist/lite/.claude/rules/file-rename-discipline.md +95 -0
  56. package/dist/lite/.claude/rules/mechanism-fidelity.md +88 -0
  57. package/dist/lite/.claude/rules/prototype-production-coupling.md +125 -0
  58. package/dist/lite/.claude/rules/quick-fix-criteria.md +90 -0
  59. package/dist/lite/.claude/rules/session-artifacts.md +30 -0
  60. package/dist/lite/.claude/rules/sibling-smoke-after-substrate-change.md +107 -0
  61. package/dist/lite/.claude/rules/substrate-as-system.md +67 -0
  62. package/dist/lite/.claude/rules/usability.md +22 -0
  63. package/dist/lite/.claude/settings.json +20 -0
  64. package/dist/lite/.claude/skills/agent-research-spawn/SKILL.md +100 -0
  65. package/dist/lite/.claude/skills/architect-review/SKILL.md +201 -0
  66. package/dist/lite/.claude/skills/auto-fix/SKILL.md +297 -0
  67. package/dist/lite/.claude/skills/autonomous/SKILL.md +300 -0
  68. package/dist/lite/.claude/skills/bind-subdomain/SKILL.md +232 -0
  69. package/dist/lite/.claude/skills/canvas/SKILL.md +41 -0
  70. package/dist/lite/.claude/skills/deploy-prod/SKILL.md +106 -0
  71. package/dist/lite/.claude/skills/docs-sync/SKILL.md +188 -0
  72. package/dist/lite/.claude/skills/eisenhower/SKILL.md +273 -0
  73. package/dist/lite/.claude/skills/empathy-map/SKILL.md +168 -0
  74. package/dist/lite/.claude/skills/frontend-design/SKILL.md +53 -0
  75. package/dist/lite/.claude/skills/interview-me/SKILL.md +171 -0
  76. package/dist/lite/.claude/skills/journal-export/SKILL.md +293 -0
  77. package/dist/lite/.claude/skills/jtbd-tasks/SKILL.md +203 -0
  78. package/dist/lite/.claude/skills/objectory-decompose/SKILL.md +256 -0
  79. package/dist/lite/.claude/skills/pick-luminaries/SKILL.md +100 -0
  80. package/dist/lite/.claude/skills/pre-mortem/SKILL.md +180 -0
  81. package/dist/lite/.claude/skills/prototype-gallery/SKILL.md +264 -0
  82. package/dist/lite/.claude/skills/provision-deploy-host/SKILL.md +257 -0
  83. package/dist/lite/.claude/skills/quick-fix/SKILL.md +273 -0
  84. package/dist/lite/.claude/skills/release/SKILL.md +311 -0
  85. package/dist/lite/.claude/skills/release-notes/SKILL.md +202 -0
  86. package/dist/lite/.claude/skills/rfc/SKILL.md +222 -0
  87. package/dist/lite/.claude/skills/riff-prototypes/SKILL.md +637 -0
  88. package/dist/lite/.claude/skills/secrets-bootstrap/SKILL.md +209 -0
  89. package/dist/lite/.claude/skills/skill/SKILL.md +304 -0
  90. package/dist/lite/.claude/skills/smoke-test/SKILL.md +100 -0
  91. package/dist/lite/.claude/skills/state/SKILL.md +204 -0
  92. package/dist/lite/.claude/skills/substrate-check/SKILL.md +218 -0
  93. package/dist/lite/.claude/skills/synthetic-user/SKILL.md +381 -0
  94. package/dist/lite/.claude/skills/task-scenarios/SKILL.md +105 -0
  95. package/dist/lite/.claude/skills/tier-dependency-audit/SKILL.md +139 -0
  96. package/dist/lite/.claude/skills/ux-migration/SKILL.md +424 -0
  97. package/dist/lite/.claude/skills/value-prop-canvas/SKILL.md +297 -0
  98. package/dist/lite/README.md +5 -1
  99. package/dist/lite/gitignore +6 -0
  100. package/dist/lite/lib/bassclef-dir-resolver.sh +85 -0
  101. package/dist/lite/lib/clone-failure-classifier.sh +59 -0
  102. package/dist/lite/lib/fixture-builder.sh +190 -0
  103. package/dist/lite/lib/fresh-install-check.sh +49 -0
  104. package/dist/lite/lib/hook-heartbeat.sh +0 -1
  105. package/dist/lite/lib/mechanism-fidelity.sh +569 -0
  106. package/dist/lite/lib/npm-version-check.sh +112 -0
  107. package/dist/lite/lib/preview-state.sh +229 -0
  108. package/dist/lite/lib/session-rescue.sh +0 -1
  109. package/dist/lite/scripts/generate-lite-manifest.sh +145 -4
  110. package/dist/lite/scripts/lite-manifest-drift-check.sh +5 -1
  111. package/dist/lite/standards/architect-review-discipline.md +222 -0
  112. package/dist/lite/standards/bassclef-platform.md +249 -0
  113. package/dist/lite/standards/bassclef-test-repos.md +97 -0
  114. package/dist/lite/standards/bassclef-wiring-manifest.json +25 -1
  115. package/dist/lite/standards/cold-adopter-harness.md +205 -0
  116. package/dist/lite/standards/data-management.md +135 -0
  117. package/dist/lite/standards/frontend-stack/nextjs-prisma.md +124 -0
  118. package/dist/lite/standards/lite-manifest-schema-changes.md +27 -0
  119. package/dist/lite/standards/lite-manifest.json +1456 -14
  120. package/dist/lite/standards/mechanism-fidelity.md +205 -0
  121. package/dist/lite/standards/operator-private-discipline.md +200 -0
  122. package/dist/lite/standards/operator-to-public-flow.md +195 -0
  123. package/dist/lite/standards/prototype-gallery.md +251 -0
  124. package/dist/lite/standards/pseudonym-key-schema.md +109 -0
  125. package/dist/lite/standards/sibling-validation-checklist.md +181 -0
  126. package/dist/lite/standards/slack-notifications.md +161 -0
  127. package/dist/lite/standards/synthetic-user-testing.md +173 -0
  128. package/dist/lite/standards/vendor-bindings.md +165 -0
  129. package/dist/lite/standards/vendor-plugins/frontend-design.md +66 -0
  130. package/dist/lite/standards/vpc-fit-validation.md +167 -0
  131. package/dist/lite/templates/gallery-yml.md +113 -0
  132. package/dist/lite/templates/product-canvas.md +169 -0
  133. package/dist/lite/templates/value-prop-canvas.md +180 -0
  134. package/package.json +3 -3
  135. /package/dist/lite/{whereami.md → docs/whereami.md} +0 -0
@@ -42,6 +42,11 @@
42
42
  "type": "command",
43
43
  "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-commit-gate.sh",
44
44
  "timeout": 15
45
+ },
46
+ {
47
+ "type": "command",
48
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/pre-commit-identifier-leak-scrub.sh",
49
+ "timeout": 10
45
50
  }
46
51
  ]
47
52
  },
@@ -102,6 +107,11 @@
102
107
  "type": "command",
103
108
  "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/vocabulary-migration-check.sh",
104
109
  "timeout": 10
110
+ },
111
+ {
112
+ "type": "command",
113
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/persona-name-scrub-check.sh",
114
+ "timeout": 10
105
115
  }
106
116
  ]
107
117
  }
@@ -156,6 +166,16 @@
156
166
  "type": "command",
157
167
  "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/longrun-prep-compounding-sequence-check.sh",
158
168
  "timeout": 10
169
+ },
170
+ {
171
+ "type": "command",
172
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/longrun-prep-render-check.sh",
173
+ "timeout": 10
174
+ },
175
+ {
176
+ "type": "command",
177
+ "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/skill-step-list-check.sh",
178
+ "timeout": 10
159
179
  }
160
180
  ]
161
181
  }
@@ -0,0 +1,100 @@
1
+ ---
2
+ tier: lite
3
+ name: agent-research-spawn
4
+ description: "Generate a bassclef-conformant pattern catalog entry by researching a named pattern against authoritative web sources. Used by /launch chain when the catalog has gaps. Also operator-callable for catalog growth."
5
+ problem: "Pattern catalog entries take hours to research. Adopters copy patterns without knowing when they fit."
6
+ value: "Generates a bassclef-conformant catalog entry for a named pattern. Cites authoritative sources."
7
+ inputs: [Pattern name from GoF or Fowler or DDD]
8
+ outputs: [Full catalog entry markdown, Source citations, Applicability notes]
9
+ user_invocable: true
10
+ disable_model_invocation: false
11
+ ---
12
+
13
+ # /agent-research-spawn — Research a pattern, populate the catalog
14
+
15
+ The primitive that lets bassclef's pattern catalogs grow. Takes a pattern name + target shelf path + optional context. Performs WebSearch + WebFetch against authoritative sources. Produces a catalog entry that conforms to `patterns/_template/catalog-entry.md`.
16
+
17
+ INSTEAD of guessing or summarizing from training data: search for the pattern's source catalog (Smarter Patterns for UX-AI, Fowler/refactoring.guru/sourcemaking for code), fetch the bassclef page, structure the findings into the catalog template. Cite source URL explicitly.
18
+
19
+ ## When to invoke
20
+
21
+ - **Operator dispatches**: `/agent-research-spawn "<pattern name>" patterns/<shelf>/<source-catalog>/` — when operator wants to add a specific pattern to the catalog
22
+ - **Workflow fallback**: `/launch` chain detects catalog gap (luminary refers to "Cooper's Persona" but `patterns/ux-ai/cooper/persona.md` is missing) → spawn this skill to fill the gap
23
+ - **Standalone**: operator browses an existing shelf, notices a missing entry that should exist, dispatches the skill
24
+
25
+ ## Procedure
26
+
27
+ 1. **Validate inputs.** Pattern name must be specific (not "patterns about AI"). Target shelf must exist or be createable; source-catalog directory under it must align with where this pattern's source lives.
28
+ 2. **Read existing entries on the same shelf.** Establish format conventions, related-pattern cross-refs that already exist, naming patterns. The new entry must compose with siblings.
29
+ 3. **WebSearch for the pattern's authoritative source.** Prefer bassclef catalogs:
30
+ - `ux-ai/smarterpatterns/` → smarterpatterns.com
31
+ - `code/gof/` → refactoring.guru, sourcemaking.com, gangofour.com mirrors
32
+ - `code/fowler/` → martinfowler.com, refactoring.com
33
+ - `code/eip/` → enterpriseintegrationpatterns.com
34
+ - `code/posa/` → POSA volume PDFs. When the operator has not provided a file path, the skill BLOCKs and asks for the path before continuing.
35
+ 4. **WebFetch the source page.** Extract: intent, structure, when-to-use, when-NOT-to-use, example, related patterns, trade-offs.
36
+ 5. **Structure findings into catalog template.** Use `patterns/_template/catalog-entry.md` exactly. Fill every required frontmatter field; fill every required body section. Plain language; cite source URL in `source_url` and in body's "Source" section.
37
+ 6. **Write the entry** at `patterns/<shelf>/<source-catalog>/<slug>.md`. Use `name`-derived kebab-case slug consistent with the shelf's existing entries.
38
+ 7. **Validate format**: required frontmatter present, required body sections present, source URL set, no Lorem ipsum, no XXX/FIXME.
39
+ 8. **Surface output**: path written, source URL cited, related-patterns identified for cross-shelf-link follow-ups.
40
+
41
+ ## What NOT to do
42
+
43
+ - **Don't summarize from training data without citation.** INSTEAD: WebSearch first; if no authoritative source surfaces, surface BLOCKED rather than fabricating an entry.
44
+ - **Don't write entries for patterns that aren't in any source catalog.** If the named pattern is folk-knowledge (e.g., "the way we do things at bassclef"), that's a /promote candidate for the design/discoveries layer, not a catalog entry. INSTEAD: surface to operator, ask whether to log as a discovery.
45
+ - **Don't invent related-patterns cross-refs.** INSTEAD: only link to entries that exist on disk OR to entries the source page explicitly references; gaps surfaced as "TODO: cross-link when sibling entry ships."
46
+ - **Don't ship entries with `status: stub`** unless explicitly requested. The skill's job is research-to-live; stubs are an explicit lesser-output for time-boxed shaping.
47
+
48
+ ## Source-catalog conventions
49
+
50
+ Each source catalog has its own slug/path conventions; the skill respects them:
51
+
52
+ | Shelf | Source catalog | URL pattern | Example slug |
53
+ |---|---|---|---|
54
+ | ux-ai | smarterpatterns | smarterpatterns.com/patterns/<id>/<slug> | `algorithm-effectiveness-rating` |
55
+ | code | gof | refactoring.guru/design-patterns/<slug> | `strategy`, `adapter` |
56
+ | code | fowler | martinfowler.com/eaaCatalog/<slug>.html | `repository`, `unit-of-work` |
57
+ | code | eip | enterpriseintegrationpatterns.com/patterns/messaging/<slug>.html | `message-channel`, `pipes-and-filters` |
58
+
59
+ When a new shelf launches, the operator (or this skill on first invocation) declares the convention in a top-level `patterns/<shelf>/README.md`.
60
+
61
+ ## Acceptance
62
+
63
+ - The skill scaffold loads via bassclef's harness (matches `.claude/skills/<name>/SKILL.md` shape)
64
+ - Test fixtures (in `scripts/tests/agent-research-spawn.test.sh`) cover:
65
+ - Catalog template format validation
66
+ - Frontmatter required-fields check
67
+ - Body required-sections check
68
+ - Source-URL must be set on `ux-ai` and `code` shelves
69
+ - Slug-from-name normalization
70
+ - First 5 invocations land entries on `patterns/ux-ai/smarterpatterns/` (this step's deliverables)
71
+
72
+ ## Composes with
73
+
74
+ - `/refactor-input` (bassclef#475, future) — calls this skill when the brownfield input handler discovers a luminary or pattern gap
75
+ - `/launch` Phase 1.5 (future) — when the chain selects a luminary whose pattern set has gaps, dispatch this skill before continuing
76
+ - `/pattern-trace` (bassclef#478 Layer 3, future LR5) — reads catalog entries this skill produces
77
+
78
+ ## Distinct from
79
+
80
+ - `/luminary` — browses existing luminary files; doesn't create new ones. This skill creates pattern catalog entries; luminary file creation is `/skill` work.
81
+ - `/promote` — files bassclef-evolution tickets for substrate gaps. This skill fills the gap directly when the gap is "missing catalog entry"; for missing skills/standards, /promote is correct.
82
+
83
+ ## Sources read
84
+
85
+ When this skill runs, it reads:
86
+
87
+ - `patterns/_template/catalog-entry.md` — the format contract
88
+ - `patterns/<shelf>/README.md` if it exists — shelf conventions
89
+ - Existing sibling entries on the target shelf — for cross-ref patterns
90
+ - The named pattern's authoritative web source — via WebSearch + WebFetch
91
+
92
+ When this skill is documented (this file): all of the above plus bassclef#476 (parent ticket) and the catalog-template work that ships in the same PR.
93
+
94
+ ## Closes
95
+
96
+ Filed in iteration-goal `2026-05-04d-catalog-substrate-roadmap-reconnect` (LR4) as WU-2's primary deliverable. Closes bassclef#476's primitive scope (full luminary imputation pipeline expansion deferred to LR5).
97
+
98
+ ## Output discipline
99
+
100
+ Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.
@@ -0,0 +1,201 @@
1
+ ---
2
+ tier: lite
3
+ name: architect-review
4
+ description: "Run a periodic system-level architecture review. Static pass, dynamic pass, plus a per-run coverage checklist. Fires from /longrun close, /build close, or on operator ask."
5
+ problem: "System architecture drifts across releases. ADRs get bypassed. Static checks miss runtime rot."
6
+ value: "A periodic architecture review that runs both static and dynamic passes. Names the drift with evidence."
7
+ inputs: [Optional scope — full system or specific subsystem]
8
+ outputs: [Static comprehension findings, Dynamic verification findings, Coverage report per run]
9
+ user_invocable: true
10
+ disable_model_invocation: false
11
+ ---
12
+
13
+ # Architect Review
14
+
15
+ Review the system for architecture health.
16
+
17
+ <!-- FKGL-EXEMPT: this SKILL body is dense with substrate labels (CodeReviewer, /architect-review, /longrun, /build, MUST NOT, per-PR, per-architectural-period, /promote, tech_stack.kind, etc.). These labels are precision-critical vocabulary. Rewriting them out to hit grade 8-9 loses meaning. The technical procedure + comparison table + separation rules read at grade 10-13 by nature. Body reads at the ceiling by intent, not by drift. -->
18
+
19
+ ## When it fires
20
+
21
+ - Auto-dispatch from /longrun closeout (per #1437 Step 2 wiring)
22
+ - Auto-dispatch from /build close (same)
23
+ - Manual on operator ask (`/architect-review`)
24
+ - Fallback: after every 10 commits since the last review
25
+ - Before any user-facing launch
26
+ - After any critical security change (auth, middleware, tenant isolation)
27
+
28
+ ## Skip criteria (auto-dispatch only)
29
+
30
+ Auto-dispatch skips when any hold. Manual runs ignore skip criteria.
31
+
32
+ - Session shipped docs-only changes (no source code touched)
33
+ - Session shipped a single-file quick-fix per `.claude/rules/quick-fix-criteria.md`
34
+ - Session ran under 10 commits AND last review ran under 10 commits ago
35
+ - Operator explicit-deferred at session close
36
+
37
+ Silence is not deferral. Skip log the reason in the session log.
38
+
39
+ ## Distinct from Reviewer agent (per #1437)
40
+
41
+ Two roles serve different scopes. Keep them apart.
42
+
43
+ | Axis | CodeReviewer (agent) | /architect-review (skill) |
44
+ |---|---|---|
45
+ | Trigger | Per PR | Per architectural period |
46
+ | Diff scope | One PR's changes | Whole codebase |
47
+ | Stance | Adversarial — assumes Builder missed something | Comprehensive — surveys system state |
48
+ | Model | Haiku (cheap-fast) | Whatever is loaded |
49
+ | Cadence | Every PR in Construction to Transition | Auto-dispatch from /longrun + /build close + manual |
50
+ | Output | Approve / request changes / block on PR | Report at `docs/architecture/reviews/YYYY-MM-DD.md` + follow-on tickets |
51
+
52
+ **Overlap ban.** CodeReviewer MUST NOT run /architect-review inside a PR review. Per-PR review is tactical. Periodic review is strategic. Mixing them loses the per-PR focus AND floods system-level work at PR cadence.
53
+
54
+ **Compose-with.** CodeReviewer reads OPEN /architect-review finding tickets when it reviews a PR. When a PR touches a surface a prior review flagged, CodeReviewer notes the overlap. Future /architect-review runs then sweep the still-open tickets.
55
+
56
+ Sister edit at `.claude/agents/reviewer.md` line 32 — the wording moves from "Invoke /architect-review during PR evaluation" to "Reference open /architect-review findings during per-PR evaluation".
57
+
58
+ ## Anchor luminaries
59
+
60
+ Primary — 5 lenses. Each run picks one dominant lens. Report frontmatter names the pick.
61
+
62
+ - **@luminary frederick-brooks** — conceptual integrity across the system
63
+ - **@luminary linus-torvalds** — adopter compatibility (we don't break adopters)
64
+ - **@luminary michael-feathers** — characterization tests before recommending change to legacy code
65
+ - **@luminary kent-beck** — TDD anchor; tests pin contracts
66
+ - **@luminary saltzer-schroeder** — complete mediation of security surfaces
67
+
68
+ Supporting lens set at `standards/architect-review-discipline.md` — hoare, hyrum-wright, ishikawa, deming, robert-c-martin, eric-evans, michael-nygard.
69
+
70
+ The three verification-side lenses (feathers + beck + saltzer-schroeder) landed via goal 24c recommendation A1. Comprehension lenses alone missed the mechanism-fidelity class.
71
+
72
+ ## Procedure
73
+
74
+ ### 1. Read prior review
75
+
76
+ Read the most recent report under `docs/architecture/reviews/` or `architecture/reviews/`. When the directory is missing, create it. When no prior report exists, note that as the baseline.
77
+
78
+ ### 2. Enumerate assessment areas from per-stack sibling
79
+
80
+ Read `standards/architect-review-discipline/<stack>.md` where `<stack>` matches the adopter's `tech_stack.kind`. The sibling names the assessment areas + verification suite for the stack.
81
+
82
+ When no sibling exists, use the universal areas (Step 3) and file `/promote bassclef-evolution` for the missing sibling per `.claude/rules/architect-review-discipline.md`.
83
+
84
+ ### 3. Static comprehension pass — check each assessment area
85
+
86
+ Universal areas:
87
+
88
+ - Component architecture — boundaries, cross-cutting concerns
89
+ - Data flow — ingestion to processing to display
90
+ - Auth + security — session, tenant isolation
91
+ - Queue + workers — routing, failure modes
92
+ - External dependencies — failure modes, cost
93
+ - Error handling — silent failures, observability
94
+ - Database — N+1, unbounded queries, missing indexes
95
+ - Testing coverage — from Step 4 test-run actuals
96
+ - Performance — page load, query efficiency
97
+ - ADR fitness — are past decisions still valid?
98
+ - CLAUDE.md fitness (see 3b)
99
+ - SOLID + Clean Architecture per @luminary robert-c-martin
100
+ - DDD per @luminary eric-evans
101
+ - Stability patterns per @luminary michael-nygard
102
+
103
+ **Characterization-test gate per @luminary michael-feathers.** Before recommending ANY refactor to legacy code (any module lacking tests), require that a characterization test pin current behavior first. Refactor recommendations without characterization tests ship as "edit and pray" per Feathers's anti-pattern. See `.claude/rules/testing-tier-config.md` for tier assignments.
104
+
105
+ ### 3b. CLAUDE.md audit
106
+
107
+ - Stack section matches actual dependencies
108
+ - Skills table lists every skill — none missing, none stale
109
+ - Key Commands actually work
110
+ - Key Files list reflects current codebase
111
+ - Conventions match current practice
112
+ - Session Protocol reflects current hooks
113
+ - No bloat — remove anything derivable from the code itself
114
+
115
+ ### 4. Dynamic verification pass — per-stack sibling suite
116
+
117
+ Invoke the verification suite named at `standards/architect-review-discipline/<stack>.md`. When the adopter has no sibling, run whatever verification is available and note the gap.
118
+
119
+ Record: test files, passed, failed, total tests. Environment-dependent failures (missing codegen, no DB, no network) get their own section — instruct the operator to file a ticket for the environment gap when back in the native environment.
120
+
121
+ Per `.claude/rules/architect-review-discipline.md`, this step MUST run. Static comprehension alone fails the two-method requirement.
122
+
123
+ ### 5. Per-run coverage checklist
124
+
125
+ Every assessment area from Step 3 gets one of three marks:
126
+
127
+ - `[x]` covered — findings recorded (or none)
128
+ - `[~]` deferred — reason stated in one line
129
+ - `[SKIP]` not applicable — reason stated in one line
130
+
131
+ Silence is not deferral. An unmarked area is a compliance failure per `.claude/rules/architect-review-discipline.md` A4.
132
+
133
+ ### 6. Classify findings per severity
134
+
135
+ Trivial / moderate / significant. Default when unclassified is MODERATE per Saltzer-Schroeder fail-safe defaults. Trivial requires explicit rationale.
136
+
137
+ ### 7. Write the report
138
+
139
+ Path: `docs/architecture/reviews/YYYY-MM-DD.md` or `architecture/reviews/YYYY-MM-DD.md`.
140
+
141
+ Required sections:
142
+
143
+ - Frontmatter: `primary_lens`, date, prior review path, coverage checklist link
144
+ - Verdict: READY / NOT READY
145
+ - Critical blockers (must fix)
146
+ - High / medium / low findings
147
+ - Component map (Mermaid, when substantive)
148
+ - Test coverage assessment (actuals from Step 4)
149
+ - Environment-dependent failures (from Step 4)
150
+ - ADR fitness check
151
+ - CLAUDE.md fitness — what was stale, what was fixed
152
+ - SOLID + DDD + Stability findings per anchors
153
+ - Coverage checklist (per Step 5)
154
+ - Recommendations by priority
155
+
156
+ ### 8. Create tickets for every moderate+ finding
157
+
158
+ One ticket per moderate+ finding. Not optional. Each ticket carries:
159
+
160
+ - Finding classification (moderate / significant)
161
+ - Primary lens applied
162
+ - Characterization-test requirement (per Step 3 gate) when the fix touches legacy code
163
+ - Link back to the review report
164
+
165
+ Trivial findings note in the report; no ticket.
166
+
167
+ ### 9. Commit
168
+
169
+ Report + coverage marker + finding-ticket references ship in one commit. Commit body cites the coverage checklist marks + finding counts by severity.
170
+
171
+ ### 10. Return summary
172
+
173
+ One-line summary to caller — verdict + finding counts + ticket count + coverage marks.
174
+
175
+ Example: `NOT READY — 2 significant, 5 moderate, 3 trivial; 7 tickets filed; coverage 12/13 covered + 1 deferred (docs-only area)`.
176
+
177
+ ## Write scope (per Saltzer-Schroeder least privilege)
178
+
179
+ /architect-review writes to three surfaces only:
180
+
181
+ - `docs/architecture/reviews/YYYY-MM-DD.md` or `architecture/reviews/YYYY-MM-DD.md` — the report
182
+ - `gh issue create` — finding tickets (Step 8)
183
+ - `state/markers/architect-review/YYYY-MM-DD.marker` — coverage audit trail
184
+
185
+ Everything else is read-only. When a skill dispatched under /architect-review needs to write elsewhere, escalate to operator — do not silently expand write scope.
186
+
187
+ ## Output discipline
188
+
189
+ Dispatch `/kiss words --rewrite` on the summary output before returning. See `standards/skill-output-discipline.md` for the contract.
190
+
191
+ ## Refs
192
+
193
+ - `.claude/rules/architect-review-discipline.md` — two-method requirement + coverage-checklist enforcement
194
+ - `.claude/rules/testing-tier-config.md` — tier assignments for characterization-test gate
195
+ - `.claude/agents/reviewer.md` — sister agent; line 32 amended per this SKILL's separation section
196
+ - `architecture/audits/2026-06-27-audit-method-blind-spot.md` — recursive Act phase motivating verification-side lens
197
+ - `architecture/consultations/2026-08-30-architect-review-clarity.md` — 5 HIGH cures applied here
198
+ - ADR-035 substrate-as-system — the tenet this SKILL operationalizes
199
+ - sunj-labs/bassclef-upstream#1437 — parent ticket
200
+
201
+ <!-- /FKGL-EXEMPT -->
@@ -0,0 +1,297 @@
1
+ ---
2
+ tier: lite
3
+ name: auto-fix
4
+ description: "Autonomous fix lane for narrow non-trivial bugs. Orchestrator drives full /diagnose then a Builder writes the fix, then /verify runs, then a PR opens. Operator merges. Refuses auth, middleware, schema, security, tenant, or prod-infra."
5
+ problem: "Narrow bugs get patched with quick edits. Root cause gets skipped. Regressions come back."
6
+ value: "Autonomous fix lane for non-trivial narrow bugs. Runs full /diagnose before writing any fix."
7
+ inputs: [A failing test or error log or bug ticket]
8
+ outputs: [/diagnose evidence, Fix commit, Verify report]
9
+ user_invocable: true
10
+ disable_model_invocation: false
11
+ ---
12
+
13
+ # /auto-fix — Autonomous Fix Lane
14
+
15
+ Bassclef's answer to "I trust the agent on this code area and want
16
+ the full diagnosis ceremony without writing it myself."
17
+
18
+ Full /diagnose runs. Builder writes the fix. /verify runs. PR opens.
19
+ Operator reviews + merges. Governance preserved; ceremony cost carried
20
+ by the agent instead of the operator.
21
+
22
+ ## Entry criteria (ALL must hold)
23
+
24
+ 1. **Narrow scope** — defect expressible as one concern. "The scraper
25
+ times out on large payloads" is narrow. "The API is slow" is not.
26
+ 2. **Named code area** — operator can name a file, module, or route
27
+ where the defect lives. Agent verifies by reading that area first.
28
+ 3. **NOT in blast-radius floor** — hard floor (see below). Anything
29
+ in the floor forces manual /diagnose or /quick-fix (for trivial cases).
30
+ 4. **Builder agent available** — `.claude/agents/Builder.md` exists
31
+ and is configured. If Builder is unreachable, degrade to operator-
32
+ in-loop /diagnose.
33
+ 5. **Clear acceptance criteria** — one sentence stating how you'll
34
+ know the fix worked. This is non-optional. Without it, /verify
35
+ has nothing to measure against.
36
+
37
+ Any failure → escalate to full /diagnose (operator writes) or
38
+ /quick-fix (if trivial).
39
+
40
+ ## Blast-radius floor (HARD — no override)
41
+
42
+ These paths ALWAYS force manual lane, regardless of other criteria:
43
+
44
+ - **Auth**: `src/lib/auth/**`, `src/app/api/auth/**`,
45
+ `src/middleware.ts` where auth logic lives
46
+ - **Schema**: `prisma/schema.prisma`, `prisma/migrations/**`
47
+ - **Security**: `src/lib/security/**`, crypto/signing/token-handling code
48
+ - **Tenant**: any tenant-scoped query or tenant-context resolution
49
+ - **Middleware**: any file matching `middleware.ts` (auth or not —
50
+ middleware has system-wide effect)
51
+ - **Production infrastructure**: `.github/workflows/deploy*.yml`,
52
+ production env var configuration, CDN/DNS config
53
+
54
+ Rationale: autonomous fixes in these areas produce silent failures
55
+ that affect every user, every request, or the entire deploy pipeline.
56
+ The blast radius justifies always asking a human.
57
+
58
+ There is NO `SKIP_BLAST_RADIUS` override for /auto-fix. If you need
59
+ to fix these areas autonomously, the right answer is to widen the
60
+ blast-radius discussion (ADR), not bypass the floor.
61
+
62
+ ## When to use
63
+
64
+ - API route bug in a specific endpoint
65
+ - Scraper logic defect in a named scraper
66
+ - Background worker processing a specific queue with wrong behavior
67
+ - Data transformation bug in a pure function
68
+ - CLI command with a wrong flag interpretation
69
+ - UI component with a specific interaction bug (non-auth, non-admin)
70
+
71
+ ## When NOT to use
72
+
73
+ - Anything in blast-radius floor (see above)
74
+ - Defects spanning multiple concerns (fix-this-and-that)
75
+ - Defects that might require interface changes or new abstractions
76
+ (use /decompose + normal Construction)
77
+ - Intermittent failures with unknown repro — these belong in full
78
+ operator-led /diagnose
79
+
80
+ ## Usage
81
+
82
+ ```
83
+ /auto-fix [issue-ref] → with issue context
84
+ /auto-fix for "description" in <path> → freeform scope + path
85
+ ```
86
+
87
+ ## Procedure
88
+
89
+ ### Step 1: Entry-criteria self-check
90
+
91
+ State explicitly which criteria hold:
92
+
93
+ ```
94
+ ## /auto-fix entry check
95
+ - Narrow scope? ✅ / ❌
96
+ - Named code area? ✅ / ❌ (path: ...)
97
+ - NOT in blast-radius floor? ✅ / ❌ (if ❌, ABORT)
98
+ - Builder agent available? ✅ / ❌
99
+ - Clear acceptance criteria? ✅ / ❌ (statement: ...)
100
+
101
+ If any ❌ → escalate; if all ✅ → proceed
102
+ ```
103
+
104
+ If blast-radius floor fires, STOP immediately and escalate to manual
105
+ lane. Do NOT proceed; do NOT negotiate.
106
+
107
+ ### Step 2: Full /diagnose ceremony
108
+
109
+ Orchestrator invokes /diagnose with the full Steps 0-4 procedure:
110
+
111
+ - Step 0: Reproduce (establish repro command/URL; no skip in /auto-fix)
112
+ - Step 1: Gather evidence (logs, recent commits, health)
113
+ - Step 2: Is / Is Not (+ Resolution Chain if layered system)
114
+ - Step 3: Five Whys
115
+ - Step 4: Hypothesis + falsifiable test
116
+
117
+ Output lands in the session conversation; no new file produced.
118
+ Reason: /diagnose output is input to Step 3; making it an artifact
119
+ is premature unless the fix is non-trivial enough to warrant a
120
+ decomposition (that path uses /decompose, not /auto-fix).
121
+
122
+ ### Step 3: Orchestrator dispatches Builder
123
+
124
+ Orchestrator routes to Builder agent with:
125
+
126
+ - Issue reference (if any)
127
+ - Full /diagnose output (repro + is/is not + five whys + hypothesis)
128
+ - Acceptance criteria (from entry check)
129
+ - Blast-radius floor reminder (Builder double-checks before writing)
130
+ - Scope lock: one file + its tests, or one named function + caller
131
+ updates. Anything broader requires escalation.
132
+
133
+ Builder MUST:
134
+
135
+ - Confirm blast-radius floor compliance before first edit
136
+ - Run /temperance before first edit (standard gate)
137
+ - Write the minimum fix matching the hypothesis
138
+ - Write/update tests matching the acceptance criteria
139
+ - Run /verify after the edit
140
+ - Produce commit with `[auto-fix]` footer
141
+
142
+ Builder MUST NOT:
143
+
144
+ - Broaden scope beyond the one concern (no "while I'm here, let me
145
+ also fix X")
146
+ - Introduce new interfaces, abstractions, or decorators (that's
147
+ /decompose territory)
148
+ - Touch blast-radius floor paths (immediate abort)
149
+ - Skip /verify
150
+ - Auto-merge the PR
151
+
152
+ ### Step 4: /verify (change-type-matched)
153
+
154
+ Standard /verify runs per the skill. Full production build, full test
155
+ suite for the change type. Markers written to both `/tmp` and
156
+ `state/markers/verify/`.
157
+
158
+ If /verify fails, /auto-fix STOPS. Builder does not retry silently —
159
+ the failure is surfaced, a human decides next step. Auto-retry is
160
+ the path to silently shipping wrong fixes that happen to pass some
161
+ checks but not others.
162
+
163
+ ### Step 5: PR open with audit marker
164
+
165
+ PR title: `fix: [description] (#NNN)`
166
+ PR body includes:
167
+
168
+ - Summary of diagnosis (repro + cause + fix)
169
+ - Acceptance criteria verification
170
+ - /verify output summary
171
+ - `[auto-fix]` marker in body
172
+
173
+ Commit footer:
174
+
175
+ ```
176
+ [auto-fix] — diagnosed via full /diagnose; Builder-written; /verify
177
+ passed. Orchestrator-dispatched.
178
+
179
+ Closes #NNN
180
+ ```
181
+
182
+ Auditing ratio of /auto-fix usage parallels /quick-fix:
183
+
184
+ ```bash
185
+ git log --all --oneline --since='30 days ago' --grep='\[auto-fix\]' | wc -l
186
+ ```
187
+
188
+ Target ratio relative to all fix branches: ≤25%. Higher ratio = either
189
+ Builder is being used where manual judgment was needed, or the mix
190
+ of defects is systematically narrow (suggesting upstream architectural
191
+ issue).
192
+
193
+ ### Step 6: Operator reviews + merges
194
+
195
+ Operator reviews PR:
196
+
197
+ - Does the diagnosis match the observed defect?
198
+ - Does the fix address the root cause (Five Whys endpoint), not just
199
+ the symptom?
200
+ - Does /verify evidence confirm the acceptance criteria?
201
+ - Any blast-radius concern the agent missed?
202
+
203
+ Operator merges. Never auto-merge — the merge step is always human.
204
+
205
+ ## Output format
206
+
207
+ ```markdown
208
+ ## /auto-fix — [short description]
209
+
210
+ ### Sources read
211
+ - [issue ref, repo files, relevant docs]
212
+
213
+ ### Entry-criteria check
214
+ - Narrow scope? ✅ — [scope statement]
215
+ - Named code area? ✅ — [path]
216
+ - NOT in blast-radius floor? ✅ — [confirmed path is outside floor]
217
+ - Builder agent available? ✅
218
+ - Clear acceptance criteria? ✅ — [acceptance statement]
219
+
220
+ ### Full diagnosis (/diagnose output)
221
+ [Step 0 Reproduce, Step 1 Evidence, Step 2 Is/Is Not, Step 3 Five
222
+ Whys, Step 4 Hypothesis + Test]
223
+
224
+ ### Builder dispatch
225
+ [Brief: what Builder was given, what scope lock applies]
226
+
227
+ ### Fix
228
+ [Applied via Builder — one-file or tight-scope change]
229
+
230
+ ### Verify evidence
231
+ [/verify output summary]
232
+
233
+ ### PR
234
+ [#NNN — ready for operator review]
235
+
236
+ ### [auto-fix] audit footer
237
+ Confirmed; diagnosed via full /diagnose; Builder-written;
238
+ /verify passed.
239
+ ```
240
+
241
+ ## Rules
242
+
243
+ - Blast-radius floor is a HARD floor. No override in /auto-fix.
244
+ - Full /diagnose is MANDATORY. No compression (that's /quick-fix).
245
+ - Builder writes, Orchestrator dispatches, Operator merges. No
246
+ auto-merge.
247
+ - /verify is MANDATORY. Failure stops the workflow; no silent retry.
248
+ - Scope lock: one concern, one file (or tight equivalent). Anything
249
+ broader requires /decompose and normal Construction.
250
+ - `[auto-fix]` audit footer is MANDATORY. Enables ratio audit.
251
+
252
+ ## Relationship to other skills
253
+
254
+ | Skill | Relationship |
255
+ |-------|-------------|
256
+ | `/diagnose` | /auto-fix invokes full /diagnose as Step 2 — no compression |
257
+ | `/quick-fix` | Sibling (compressed, operator-in-loop); /auto-fix is full-ceremony autonomous |
258
+ | `/verify` | /auto-fix invokes /verify as Step 4 — mandatory |
259
+ | `/decompose` | If the fix reveals cross-cutting concern, halt /auto-fix and go through /decompose first |
260
+ | `/temperance` | Builder fires /temperance before first edit, per standard gate |
261
+
262
+ ## Common pitfalls
263
+
264
+ - **Scope creep inside Builder** — "while I'm here, let me also fix X."
265
+ Explicitly prohibited. Scope lock is load-bearing.
266
+ - **Silent blast-radius violation** — agent notices the target path
267
+ touches middleware but writes the fix anyway "because it seemed
268
+ narrow." Floor is HARD. Abort, don't negotiate.
269
+ - **Auto-merge temptation** — /verify passed, PR opened, "why not
270
+ merge?" Operator merge is the final gate. Skip it and you've built
271
+ a bypass around the hardest guardrail.
272
+ - **Skipping /diagnose** — "the cause is obvious from the repro." If
273
+ it's that obvious, /quick-fix is the right tool. /auto-fix always
274
+ runs full /diagnose.
275
+
276
+ ## Why this skill exists
277
+
278
+ Today bassclef operators have two fix lanes:
279
+
280
+ - Full /diagnose + operator writes the fix (expensive for non-trivial
281
+ narrow bugs where the operator trusts the agent)
282
+ - Drop to Claude Code `/bugfix` (opaque; no bassclef governance;
283
+ the agent can do whatever it wants)
284
+
285
+ Neither is right for "narrow, non-trivial, operator trusts the agent
286
+ on this area." That case needs full ceremony + autonomous execution
287
+ + hard blast-radius floors. That's /auto-fix.
288
+
289
+ The `[auto-fix]` audit marker plus the hard floor means the skill
290
+ cannot drift into handling the cases it shouldn't — the floor is
291
+ mechanical, the ratio is observable.
292
+
293
+ Closes bassclef #152. Part of fix-workflow family 2026-04-16d.
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.