@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
@@ -0,0 +1,180 @@
1
+ ---
2
+ tier: lite
3
+ name: pre-mortem
4
+ description: "Draft a Klein pre-mortem risk ledger for a scope (goal, feature, PR). Two modes: light (3 luminary lenses, 30 min) and full (5-8 lenses, 90 min). Always fires on auth, schema, payments, or compliance work."
5
+ problem: "Goal docs ship without risk consideration. Teams find failures late instead of before code."
6
+ value: "Drafts a Klein pre-mortem risk ledger for a scope. Two modes \u2014 light (3 lenses) or full (5+ lenses)."
7
+ inputs: [A goal or feature or PR ref, Optional mode — light or full]
8
+ outputs: [Risk ledger at docs/risk-ledgers/, Risks per lens with cures, Disposition]
9
+ user_invocable: true
10
+ disable_model_invocation: false
11
+ modes: [light, full]
12
+ composes_baseline: [gary-klein, daniel-kahneman]
13
+ ---
14
+
15
+ # /pre-mortem — Klein-style risk enumeration
16
+
17
+ Draft a pre-mortem risk ledger for a scope before commit. Klein's method: assume the ship failed spectacularly; silently write every reason for the failure; collate without argument; incorporate the strongest concerns into the plan as mitigations, monitoring signals, or scope cuts.
18
+
19
+ Bassclef adapts the workshop shape into a written artifact — the solo operator + Claude walk multiple luminary lenses in sequence, each surfacing a distinct failure class. Output lives at `docs/risk-ledgers/<slug>.md` and feeds goal doc `## Risk ledger (pre-mortem)` sections.
20
+
21
+ Two modes.
22
+
23
+ - **light** (default): 30 minutes, 3 rotating luminary lenses, 5-8 risks per lens. Good for a standalone feature or a single-WU decision. Produces a short risk ledger operator can absorb in one read.
24
+ - **full**: 90 minutes, 5-8 rotating lenses, 10-15 risks per lens. Good for an iteration goal, a security-sensitive change, or any always-fire domain (see below). Produces a research-grade risk ledger with per-risk owner + mitigation trigger + monitoring signal.
25
+
26
+ ## Always-fire domains
27
+
28
+ The skill fires automatically at scope-commit time on:
29
+
30
+ 1. **Authentication and authorization** — session, MFA, SSO, RBAC, OAuth flows
31
+ 2. **Schema migrations** — especially with data backfills
32
+ 3. **Payments, billing, invoicing** — money flows in either direction
33
+ 4. **PII data handling** — export, delete, retention, cross-border transfer
34
+ 5. **Multi-tenant isolation** — RBAC boundaries between tenants
35
+ 6. **Public marketing claims** — brand promises that create legal exposure
36
+ 7. **User-lifecycle-critical flows** — account creation, deletion, password reset
37
+ 8. **Deploy pipeline changes** — CI/CD edits that touch release safety
38
+ 9. **Third-party integrations** — new external dependency in the customer path
39
+ 10. **Compliance-scoped work** — GDPR, HIPAA, SOC 2, PCI DSS
40
+
41
+ Operator can extend the list per adopter via `.claude/bassclef-configs.jsonc` `pre_mortem.always_fire_domains` (V2 field; not yet wired — until then, the list above is the default).
42
+
43
+ When a scope touches an always-fire domain, `/pre-mortem full` runs before scope commit unless operator explicitly defers per `.claude/rules/blocked-items.md` deferral syntax. Silence is not deferral.
44
+
45
+ ## Sources read
46
+
47
+ - `.claude/luminaries/gary-klein.md` — full luminary with HBR 2007 method + 4-step procedure + 4 operator-URL adaptations
48
+ - Operator direction 2026-07-07 evening — always-fire domain list + LLM-driven lens rotation for solo operator + Claude shape
49
+ - Bet 30b risk ledger `docs/risk-ledgers/2026-06-30b-substrate-anchoring-cure.md` — reference exemplar of the multi-lens written pre-mortem shape
50
+
51
+ ## Sources used
52
+
53
+ ### Gary Klein — 4-step pre-mortem
54
+
55
+ Per `.claude/luminaries/gary-klein.md` §Core methods [ref: HBR 2007]:
56
+
57
+ 1. **Assume failure vividly** — "Imagine the project has failed spectacularly. It is a year from now. The project shipped and it is a disaster."
58
+ 2. **Silent write-down** — each participant independently writes every reason for the failure. Silent, not shared, no debate.
59
+ 3. **Round-robin readout** — collect reasons one at a time from each source until every reason is on the list. No argument, no ranking during collection.
60
+ 4. **Strengthen the plan** — review the list post-meeting; incorporate strongest concerns into the plan as mitigations, monitoring signals, or scope cuts.
61
+
62
+ ### Bassclef adaptation for solo operator + Claude
63
+
64
+ The "participants" in a bassclef pre-mortem are luminary lenses summoned in sequence. Each lens brings a distinct failure class:
65
+
66
+ | Lens | Failure class it surfaces |
67
+ |---|---|
68
+ | `@luminary michael-feathers` | Cure ships without characterization test; ship-then-hope pattern |
69
+ | `@luminary john-ousterhout` | Interface complexity; shared lib duplicates existing helper |
70
+ | `@luminary kent-beck` | Test discipline drift; Tier 0 test written after source |
71
+ | `@luminary tony-hoare` | Precondition or postcondition violated silently |
72
+ | `@luminary saltzer-schroeder` | Complete mediation gap; every path not verified |
73
+ | `@luminary michael-nygard` | Stability pattern missing; circuit breaker or bulkhead absent |
74
+ | `@luminary daniel-kahneman` | Planning fallacy; optimism bias in time budget estimate |
75
+ | `@luminary ash-maurya` | User perspective missing; feature solves the wrong problem |
76
+ | `@luminary linus-torvalds` | Adopter contract broken; observable behavior changes silently |
77
+
78
+ Claude prompts each lens in turn; operator writes concerns for that lens; Claude collates without ranking during the pass. Follow-up pass names owners and mitigations.
79
+
80
+ ## Domain → default lens map
81
+
82
+ For always-fire domains, `/pre-mortem full` selects lenses matched to the failure class most likely at that domain:
83
+
84
+ | Domain | Primary lens | Supporting lenses |
85
+ |---|---|---|
86
+ | Authentication and authorization | saltzer-schroeder | tony-hoare, michael-feathers |
87
+ | Schema migrations | tony-hoare | michael-nygard, michael-feathers |
88
+ | Payments and billing | michael-nygard | saltzer-schroeder, tony-hoare |
89
+ | PII data handling | saltzer-schroeder | linus-torvalds, michael-nygard |
90
+ | Multi-tenant isolation | saltzer-schroeder | tony-hoare, john-ousterhout |
91
+ | Public marketing claims | ash-maurya | linus-torvalds, april-dunford |
92
+ | User-lifecycle flows | michael-feathers | saltzer-schroeder, ash-maurya |
93
+ | Deploy pipeline changes | michael-nygard | linus-torvalds, kent-beck |
94
+ | Third-party integrations | vaughn-vernon (anticorruption layer) | michael-nygard, saltzer-schroeder |
95
+ | Compliance-scoped work | saltzer-schroeder | linus-torvalds, michael-nygard |
96
+
97
+ For non-always-fire scope, `/pre-mortem light` picks 3 lenses appropriate to the scope shape (operator can override).
98
+
99
+ ## Procedure
100
+
101
+ ### Common to both modes
102
+
103
+ 1. **Ask for the scope** — one paragraph: what's shipping, why now, what's the target outcome, what's the time budget (turns or time)
104
+ 2. **Detect always-fire signal** — grep scope description for auth, schema, payment, PII, tenant, marketing, lifecycle, deploy, integration, compliance terms; if matched, escalate to `full` mode unless operator explicitly stays in `light`
105
+ 3. **Pick lenses** — per the domain map (always-fire) or per operator preference (non-always-fire)
106
+ 4. **Walk lenses in sequence** — each lens gets its own section in the ledger; Klein's 4-step method applies within each section
107
+
108
+ ### Light mode (30 min)
109
+
110
+ - 3 rotating lenses selected by scope shape
111
+ - Per lens: 5-8 imagined failures written by operator; Claude collates without ranking during the pass
112
+ - Follow-up pass: pick top 5 risks total (across all lenses); name owner + mitigation per risk
113
+ - Output at `docs/risk-ledgers/<slug>.md` — short-form ledger
114
+
115
+ ### Full mode (90 min)
116
+
117
+ - 5-8 rotating lenses per domain map
118
+ - Per lens: 10-15 imagined failures; per-risk severity (high/medium/low); per-risk trigger signal (what would tell operator the risk materialized); per-risk mitigation
119
+ - Follow-up pass: rank all risks by severity × probability; name owner + mitigation trigger + monitoring signal per top-10 risks
120
+ - Output at `docs/risk-ledgers/<slug>.md` — research-grade ledger
121
+
122
+ ## Output
123
+
124
+ Structured markdown artifact saved at `docs/risk-ledgers/<slug>.md`:
125
+
126
+ ```markdown
127
+ ---
128
+ slug: 2026-07-07a-skills-authoring
129
+ scope: "Bet 2026-07-07a — author 4 discovery-phase skills + audit composes_with + prototype configs UI"
130
+ mode: full
131
+ lenses: [michael-feathers, john-ousterhout, kent-beck, ash-maurya, gary-klein]
132
+ date: 2026-07-07
133
+ always_fire_matched: false
134
+ ---
135
+
136
+ # Pre-mortem risk ledger — bet 2026-07-07a
137
+
138
+ ## Lens: Michael Feathers (characterization tests)
139
+
140
+ Assume failure: "The skills shipped but adopter sessions surface bugs in the empathy-map fill order because we never characterized the actual conversational flow with a real transcript."
141
+
142
+ Risks:
143
+ 1. Skill body describes the flow but no test pins the actual per-mode question count [severity: medium; owner: WU-2 test file; mitigation: characterization test that walks light mode with a fixture persona]
144
+ 2. ...
145
+
146
+ ## Lens: John Ousterhout (deep modules)
147
+ ...
148
+ ```
149
+
150
+ ## Called by
151
+
152
+ `/pre-mortem` is a foundational discipline skill. Larger skills call it:
153
+
154
+ - `/longrun prep` — Step 1.7 (fires at scope-commit boundary; produces bet-doc risk ledger)
155
+ - `/build` — before Construction phase; produces feature-scope risk ledger
156
+ - `/security-review` — always fires as part of the review chain
157
+ - `/architect-review` — one of the two methods per `.claude/rules/architect-review-discipline.md`
158
+
159
+ ## Anti-patterns it prevents
160
+
161
+ Per `.claude/luminaries/gary-klein.md` §Anti-patterns:
162
+
163
+ - **Retrospective blame** — skill refuses to run after failure with names attached. INSTEAD: run BEFORE the failure so concerns are gifts about a hypothetical future.
164
+ - **Generic risk lists** — skill prompts operator to write imagined failures vividly ("the migration ran during holiday freeze and locked payments for 3 hours") not generic ("the team might be busy"). INSTEAD of accepting generic entries: skill asks a follow-up probe until the risk carries a specific scenario.
165
+ - **Skipping silent write-down** — skill enforces one-lens-at-a-time discipline; operator writes for the current lens before Claude collates. INSTEAD of a free-form brainstorm: silent per-lens pass mirrors Klein's silent-write-down step.
166
+ - **Meeting-then-forget** — skill enforces owner + mitigation per risk; a risk without owner does not close the pass. INSTEAD of a bare risk list: the ledger has an accountable next-step per row.
167
+
168
+ ## Refs
169
+
170
+ - Ticket #655 — this skill's filing
171
+ - Bet 2026-07-07a — this skill's ship vehicle
172
+ - Luminary file `.claude/luminaries/gary-klein.md` — full-depth anchor
173
+ - Klein, G. (2007). "Performing a Project Premortem." HBR
174
+ - Bet 30b risk ledger — reference exemplar of the multi-lens written pre-mortem shape
175
+ - Rule `.claude/rules/loop-discipline.md` — per-PR discipline that consumes pre-mortem output
176
+ - Rule `.claude/rules/architect-review-discipline.md` — two-method requirement composes this skill
177
+
178
+ ## Output discipline
179
+
180
+ Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.
@@ -0,0 +1,264 @@
1
+ ---
2
+ tier: lite
3
+ name: prototype-gallery
4
+ description: "Generate a variant index page for a repo's prototypes \u2014 DEPRECATED 2026-05-12 per ADR-020. Use /stage instead. Skill retained during 3-month deprecation grace before retirement."
5
+ problem: "DEPRECATED 2026-05-12 per ADR-020. Use /stage instead."
6
+ value: "Deprecated skill kept for backward compat. Points to /stage."
7
+ inputs: [Redirects to /stage]
8
+ outputs: [Deprecation notice, Redirect to /stage]
9
+ deprecated: true
10
+ deprecated_in_favor_of: /stage
11
+ deprecated_decision: architecture/decisions/ADR-020-prototype-skill-family-consolidation.md
12
+ user_invocable: true
13
+ disable_model_invocation: false
14
+ ---
15
+
16
+ # /prototype-gallery — DEPRECATED
17
+
18
+ > **Deprecation notice (2026-05-12 per ADR-020):** This skill is deprecated in favor of `/stage` (any size). `/stage` already produces a shareable gallery URL per ADR-016. New work should invoke `/stage` instead. This skill remains invocable during the deprecation grace period (≥3 months) before retirement.
19
+
20
+ # /prototype-gallery — Variant Index Page
21
+
22
+ Scaffold a single gallery page that lists all variants in a repo's
23
+ `prototypes/` directory with scannable context (title + 2-line value
24
+ prop + luminary attribution + "Open" CTA). Operator shares ONE URL;
25
+ collaborators see every variant without tab-switching or hunting for
26
+ per-variant URLs.
27
+
28
+ First consumer wired (variant gallery with synthesis variants).
29
+
30
+ ## When to invoke
31
+
32
+ - A repo has ≥3 variants in `prototypes/` that the operator wants to
33
+ share or compare side-by-side
34
+ - After `/riff-prototypes` produces new variants in an existing
35
+ gallery-enabled repo (regenerate cards + copies)
36
+ - First time wiring gallery on a repo that already has variants
37
+
38
+ ## When NOT to invoke
39
+
40
+ - Repo has 0–2 variants — direct variant URLs are sufficient; gallery
41
+ adds scaffolding without value
42
+ - Variants are still in-flight (no `gallery.yml` or README frontmatter
43
+ yet) — run `/riff-prototypes` to metadata-complete them first
44
+ - Repo has hand-built index page at the target route that is NOT a
45
+ bassclef gallery scaffold — skill surfaces diff + asks rather than
46
+ overwriting
47
+
48
+ ## Sources read
49
+
50
+ - `standards/prototype-gallery.md` — the standard this skill
51
+ operationalizes (directory convention, `gallery.yml` schema, route
52
+ rules, card shape, regeneration discipline)
53
+ - `standards/project-directory-layout.md` — `prototypes/` is bassclef
54
+ - `templates/gallery-yml.md` — metadata template
55
+ - Bassclef #252 — the ticket this skill closes
56
+ - `.claude/skills/prototype-variants/SKILL.md` — upstream producer
57
+
58
+ ## Prerequisites
59
+
60
+ 1. Consumer repo has `prototypes/<slug>/` directories with at least
61
+ an `index.html` per variant (skill tolerates additional assets:
62
+ `styles.css`, images, etc.)
63
+ 2. Each variant has either:
64
+ - `prototypes/<slug>/gallery.yml` (preferred), OR
65
+ - `prototypes/<slug>/README.md` with frontmatter matching the
66
+ gallery schema
67
+ Variants with neither block the skill — see Rules below.
68
+ 3. Consumer repo is a Next.js app (App Router) per `standards/frontend-stack.md`
69
+
70
+ ## Procedure
71
+
72
+ ### Step 1 — Scan
73
+
74
+ ```bash
75
+ # List candidate variants (any directory under prototypes/ with an index.html)
76
+ find prototypes -mindepth 2 -maxdepth 2 -name index.html -exec dirname {} \;
77
+ ```
78
+
79
+ Filter out directories matching `.gitignore`d patterns. Sort alphabetically.
80
+
81
+ ### Step 2 — Read metadata per variant
82
+
83
+ For each variant, read in priority order:
84
+
85
+ 1. `prototypes/<slug>/gallery.yml` — parse YAML
86
+ 2. `prototypes/<slug>/README.md` — parse frontmatter (if `.yml` missing)
87
+ 3. If neither exists: record the variant as METADATA-MISSING
88
+
89
+ Produce a list of variant metadata records:
90
+
91
+ ```json
92
+ {
93
+ "slug": "variant-a-ive-hig",
94
+ "title": "Variant A — Ive + HIG",
95
+ "value_prop": "Restrained surfaces. Operator reads the deal in under 3 seconds.\nStrong typographic hierarchy; no decorative affordances.",
96
+ "luminaries": ["Jony Ive", "Apple HIG"],
97
+ "date": "2026-04-20",
98
+ "status": "active"
99
+ }
100
+ ```
101
+
102
+ ### Step 3 — Validate
103
+
104
+ - `value_prop` ≤ 2 lines (split on `\n`, reject if >2): surface as warning,
105
+ truncate to 2 lines for the card
106
+ - `status` in `{active, archived, superseded}`: default to `active`
107
+ - `superseded` status requires `superseded_by: <slug>` — if missing, downgrade
108
+ to `archived` and surface warning
109
+ - METADATA-MISSING variants: list them to the operator, STOP. Do not
110
+ scaffold a gallery with silent gaps.
111
+
112
+ Operator confirms whether to proceed (skipping METADATA-MISSING
113
+ variants) or abort (and backfill metadata first).
114
+
115
+ ### Step 4 — Detect route
116
+
117
+ - If `src/app/page.tsx` exists AND differs materially from a gallery
118
+ scaffold (heuristic: > 50 lines OR contains imports the scaffold
119
+ wouldn't): route = `/prototypes` (create `src/app/prototypes/page.tsx`)
120
+ - Else: route = `/` (create or regenerate `src/app/page.tsx`)
121
+
122
+ Surface the chosen route to the operator before Step 5.
123
+
124
+ ### Step 5 — Copy variant HTML to `public/`
125
+
126
+ For each `active` + `superseded` variant:
127
+
128
+ ```bash
129
+ mkdir -p public/prototypes/<slug>
130
+ cp -r prototypes/<slug>/* public/prototypes/<slug>/
131
+ ```
132
+
133
+ Remove `public/prototypes/<slug>/README.md` and `gallery.yml` from the
134
+ public copy (they're source-of-truth, not served artifacts).
135
+
136
+ `archived` variants are NOT copied. Their `public/` copies from prior
137
+ runs persist (old URLs still resolve).
138
+
139
+ ### Step 6 — Scaffold or regenerate `page.tsx`
140
+
141
+ **First-time scaffold**: write the bassclef gallery scaffold (plain
142
+ CSS-only cards, semantic markup, no framework deps beyond Next.js
143
+ App Router).
144
+
145
+ **Regenerate**: compute hash of existing `page.tsx`; compare to the
146
+ scaffold template + current metadata:
147
+ - If matches scaffold-with-metadata hash: regenerate (just an update)
148
+ - If differs (hand-edited): surface diff, ask operator whether to
149
+ merge new variants into existing hand-edited page OR leave alone
150
+
151
+ Active variants sort by `date` descending (newest first) unless the
152
+ operator overrides via `gallery.yml`'s optional `sort_order: N` field.
153
+
154
+ Superseded variants render in a collapsed "archived" section at the
155
+ bottom, with link to `superseded_by` successor.
156
+
157
+ ### Anthropic baseline variant — visibly flagged (per step-11b)
158
+
159
+ When `/riff-prototypes` runs (post-WU-11b), it ALWAYS emits an
160
+ Anthropic `/frontend-design` baseline variant alongside the N
161
+ luminary-driven variants. The baseline lives at
162
+ `docs/prototypes/<sprint-slug>/variant-baseline-anthropic/` (the
163
+ directory name is the marker).
164
+
165
+ `/prototype-gallery` MUST render baseline cards distinctively so
166
+ operators can tell at-a-glance which variants are luminary-driven
167
+ (champions) vs. the Anthropic baseline (challenger). Choose ONE
168
+ treatment per repo (consistency across sprints):
169
+
170
+ - **Border**: 2px dashed (vs. solid for luminary variants), or
171
+ - **Badge**: render "Baseline" pill above card title, or
172
+ - **Annotation**: small italic line in card body — "Anthropic /frontend-design baseline (no luminary contamination)"
173
+
174
+ The marker convention: any variant whose directory name CONTAINS
175
+ `baseline-anthropic` (case-insensitive) renders with the chosen
176
+ distinguishing treatment.
177
+
178
+ **Why this matters**: the baseline is bassclef's champion-challenger
179
+ measurement. If operators consistently pick baseline variants over
180
+ luminary-driven ones, the luminary system isn't doing real work and
181
+ needs review. Visibility in the gallery is what makes the comparison
182
+ honest — operators must KNOW which is the baseline when picking.
183
+
184
+ **Out of scope here**: the comparison signal capture (writing
185
+ `is_baseline: <bool>` to `preview-state.yml`) lives in `/riff-prototypes`
186
+ WU-11b output AND `/stage` workflow (WU-9). This skill just renders
187
+ distinctively.
188
+
189
+ ### Step 7 — Output summary
190
+
191
+ Write a short summary to stdout:
192
+
193
+ ```
194
+ /prototype-gallery
195
+ Variants scanned: 23
196
+ Active: 19 (cards rendered)
197
+ Superseded: 4 (collapsed section)
198
+ Archived: 0
199
+ METADATA-MISSING: 0
200
+ Route: /
201
+ public/prototypes/ copies: 19 updated
202
+ src/app/page.tsx: scaffold written (initial)
203
+ ```
204
+
205
+ ## Output format
206
+
207
+ Skill produces three side-effects, enumerated in the summary:
208
+
209
+ 1. Updated `public/prototypes/<slug>/` copies (N of them)
210
+ 2. Updated `src/app/[page].tsx` (route detected per Step 4)
211
+ 3. stdout summary + any warnings (METADATA-MISSING, value-prop truncation, route conflicts)
212
+
213
+ No artifacts in `docs/` (this skill is runtime scaffolding, not
214
+ methodology documentation — the standard already covers that).
215
+
216
+ ## Rules
217
+
218
+ - **Read-only on variant HTML.** Never modify files under `prototypes/`
219
+ during scaffold/regenerate. The skill is downstream; operator edits
220
+ flow upstream only.
221
+ - **Never overwrite a hand-edited `page.tsx` silently.** Hash-check
222
+ against scaffold template; on mismatch, surface diff + ask.
223
+ - **Never synthesize metadata defaults.** A variant without `gallery.yml`
224
+ or README frontmatter blocks the skill. A gallery card without a
225
+ value prop is worse than no card.
226
+ - **Additive regeneration for archived/superseded.** Don't delete
227
+ `public/prototypes/<archived-slug>/`. Old URLs keep resolving for
228
+ operators who bookmarked them.
229
+ - **Respect the route-detection heuristic.** If operator wants to force
230
+ a specific route, they edit `src/app/` directly and re-run; skill
231
+ detects hand-edit and pauses per Rule 2.
232
+
233
+ ## Mode dispatch
234
+
235
+ | Invocation | Behavior |
236
+ |-----------|----------|
237
+ | `/prototype-gallery` (no args) | Full scan + regenerate; prompt before overwriting hand-edited `page.tsx` |
238
+ | `/prototype-gallery --dry-run` | Scan + validate + emit summary; no file writes |
239
+ | `/prototype-gallery --force` | Overwrite `page.tsx` without prompting (use when operator has confirmed in-session) |
240
+
241
+ ## Relationship to other skills
242
+
243
+ - `/riff-prototypes` — upstream producer of the variants this skill indexes
244
+ - `/visual-review` — evaluates a single variant; gallery doesn't replace the review, just surfaces the variants for sharing + decision
245
+ - `/frontend-design` — if the consumer app's scaffold needs the gallery styled to match brand direction, run after this skill to refine card aesthetics
246
+ - `/substrate-check` — validates the consumer repo has the skill wired after bassclef-sync
247
+
248
+ ## Open-source propagation
249
+
250
+ This skill lives in bassclef's `.claude/skills/` and propagates to
251
+ consumer repos via `bassclef-sync.sh` (per ADR-014). Consumer repos
252
+ inherit it automatically on next session-start. No per-repo install.
253
+
254
+ ## Retirement condition
255
+
256
+ Retires alongside `standards/prototype-gallery.md` if operators stop
257
+ running multi-variant bets. The skill file is removable without data
258
+ loss — variant HTML and metadata stay on disk at `prototypes/`.
259
+
260
+ Closes bassclef #252.
261
+
262
+ ## Output discipline
263
+
264
+ Dispatch `/kiss words --rewrite` on your skill output before you return it. See `standards/skill-output-discipline.md` for the contract.