@thebassclef/lite 0.1.0 → 0.1.3

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 (163) hide show
  1. package/dist/cli.cjs +40 -6
  2. package/dist/cli.js +40 -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/package.json +1 -1
  7. package/substrate/.bassclef/lite-manifest.json +999 -92
  8. package/substrate/.claude/hooks/longrun-prep-compounding-axis-check.sh +492 -0
  9. package/substrate/.claude/hooks/longrun-prep-compounding-sequence-check.sh +492 -0
  10. package/substrate/.claude/hooks/pre-commit-gate.sh +1 -2
  11. package/substrate/.claude/hooks/turn-prose-kiss-check.sh +30 -1
  12. package/substrate/.claude/luminaries/glenford-myers.md +230 -0
  13. package/substrate/.claude/luminaries/hunt-thomas.md +115 -0
  14. package/substrate/.claude/luminaries/hyrum-wright.md +94 -0
  15. package/substrate/.claude/luminaries/michael-feathers.md +2 -2
  16. package/substrate/.claude/luminaries/tony-hoare.md +170 -0
  17. package/substrate/.claude/luminaries/vaughn-vernon.md +50 -0
  18. package/substrate/.claude/luminaries/w-edwards-deming.md +158 -0
  19. package/substrate/.claude/rules/accessor-library-discipline.md +138 -0
  20. package/substrate/.claude/rules/adr-discipline.md +120 -0
  21. package/substrate/.claude/rules/api-conventions.md +125 -0
  22. package/substrate/.claude/rules/bootstrap-pair-discipline.md +141 -0
  23. package/substrate/.claude/rules/cold-adopter-harness-discipline.md +129 -0
  24. package/substrate/.claude/rules/compounding-axis-fresh-analysis.md +188 -0
  25. package/substrate/.claude/rules/compounding-sequence-fresh-analysis.md +188 -0
  26. package/substrate/.claude/rules/defensive-bash.md +68 -0
  27. package/substrate/.claude/rules/deferred-actions.md +233 -0
  28. package/substrate/.claude/rules/github-issue-flash-tweet.md +156 -0
  29. package/substrate/.claude/rules/hook-wire-on-author.md +103 -0
  30. package/substrate/.claude/rules/iteration-bet-brief-completeness.md +54 -0
  31. package/substrate/.claude/rules/lite-manifest-schema-change-discipline.md +3 -3
  32. package/substrate/.claude/rules/longrun-prep-plan-doc-compression.md +89 -0
  33. package/substrate/.claude/rules/loop-discipline.md +81 -0
  34. package/substrate/.claude/rules/manual-prod-approval.md +100 -0
  35. package/substrate/.claude/rules/marker-enrichment-discipline.md +99 -0
  36. package/substrate/.claude/rules/mobile-ephemeral-session.md +109 -0
  37. package/substrate/.claude/rules/new-dependency-check.md +51 -0
  38. package/substrate/.claude/rules/option-label-discipline.md +108 -0
  39. package/substrate/.claude/rules/pattern-annotation.md +100 -0
  40. package/substrate/.claude/rules/plain-english-discipline.md +11 -9
  41. package/substrate/.claude/rules/plan-enumeration-needs-value-props.md +211 -0
  42. package/substrate/.claude/rules/pr-title-shape.md +161 -0
  43. package/substrate/.claude/rules/prototype-workflow.md +65 -0
  44. package/substrate/.claude/rules/reserved-skill-names.md +123 -0
  45. package/substrate/.claude/rules/schema-management.md +49 -0
  46. package/substrate/.claude/rules/security.md +37 -0
  47. package/substrate/.claude/rules/skill-composition-declarations.md +124 -0
  48. package/substrate/.claude/rules/skill-description-clarity.md +247 -0
  49. package/substrate/.claude/rules/skill-procedure-step-list.md +137 -0
  50. package/substrate/.claude/rules/stuck-signal-diagnostic.md +140 -0
  51. package/substrate/.claude/rules/substrate-config-schema.md +98 -0
  52. package/substrate/.claude/rules/test-list-discipline.md +175 -0
  53. package/substrate/.claude/rules/test-sufficiency.md +210 -0
  54. package/substrate/.claude/rules/testing-tier-config.md +145 -0
  55. package/substrate/.claude/rules/testing.md +38 -0
  56. package/substrate/.claude/rules/turn-estimate-grounding.md +134 -0
  57. package/substrate/.claude/rules/visual-hierarchy.md +437 -0
  58. package/substrate/.claude/rules/we-dont-break-adopters.md +126 -0
  59. package/substrate/.claude/rules/wu-sequencing-compounds.md +145 -0
  60. package/substrate/.claude/skills/build/SKILL.md +1 -1
  61. package/substrate/.claude/skills/chronicle/SKILL.md +55 -0
  62. package/substrate/.claude/skills/clean-artifacts/SKILL.md +249 -0
  63. package/substrate/.claude/skills/decompose/SKILL.md +1 -1
  64. package/substrate/.claude/skills/diagnose/SKILL.md +1 -1
  65. package/substrate/.claude/skills/feynman/SKILL.md +90 -0
  66. package/substrate/.claude/skills/howdoi/SKILL.md +1 -1
  67. package/substrate/.claude/skills/ia-model/SKILL.md +1 -1
  68. package/substrate/.claude/skills/interaction-design/SKILL.md +1 -1
  69. package/substrate/.claude/skills/interpret-input/SKILL.md +8 -8
  70. package/substrate/.claude/skills/journal/SKILL.md +209 -0
  71. package/substrate/.claude/skills/kiss/SKILL.md +1 -1
  72. package/substrate/.claude/skills/launch/SKILL.md +14 -23
  73. package/substrate/.claude/skills/lean-canvas/SKILL.md +1 -1
  74. package/substrate/.claude/skills/longrun/SKILL.md +45 -8
  75. package/substrate/.claude/skills/luminary/SKILL.md +1 -1
  76. package/substrate/.claude/skills/ogilvy-writing-audit/SKILL.md +1 -1
  77. package/substrate/.claude/skills/onboard-repo/SKILL.md +143 -709
  78. package/substrate/.claude/skills/pattern-review/SKILL.md +1 -1
  79. package/substrate/.claude/skills/personas/SKILL.md +5 -5
  80. package/substrate/.claude/skills/promote/SKILL.md +1 -1
  81. package/substrate/.claude/skills/requirement/SKILL.md +1 -1
  82. package/substrate/.claude/skills/retro/SKILL.md +1 -1
  83. package/substrate/.claude/skills/riff/SKILL.md +1 -1
  84. package/substrate/.claude/skills/roadmap-reconcile/SKILL.md +1 -1
  85. package/substrate/.claude/skills/session-end/SKILL.md +1 -1
  86. package/substrate/.claude/skills/session-log/SKILL.md +3 -3
  87. package/substrate/.claude/skills/skills/SKILL.md +1 -1
  88. package/substrate/.claude/skills/spec/SKILL.md +1 -1
  89. package/substrate/.claude/skills/sprint/SKILL.md +1 -1
  90. package/substrate/.claude/skills/stage/SKILL.md +1 -1
  91. package/substrate/.claude/skills/state-a-problem/SKILL.md +1 -1
  92. package/substrate/.claude/skills/temperance/SKILL.md +1 -1
  93. package/substrate/.claude/skills/use-case/SKILL.md +1 -1
  94. package/substrate/.claude/skills/user-stories/SKILL.md +1 -1
  95. package/substrate/.claude/skills/value-prop/SKILL.md +1 -1
  96. package/substrate/.claude/skills/verify/SKILL.md +1 -1
  97. package/substrate/.claude/skills/visual-review/SKILL.md +503 -0
  98. package/substrate/.claude/skills/whats-the-plan/SKILL.md +202 -0
  99. package/substrate/.claude/skills/whereami/SKILL.md +2 -2
  100. package/substrate/CONTRIBUTING.md +1 -1
  101. package/substrate/README.md +5 -5
  102. package/substrate/lib/prose-scan-boundary.sh +171 -0
  103. package/substrate/lib/tier-check.sh +50 -1
  104. package/substrate/lib/tier-dependency-audit.sh +159 -4
  105. package/substrate/presence/install/bassclef-sync.template.sh +1 -1
  106. package/substrate/scripts/generate-lite-manifest.sh +21 -5
  107. package/substrate/standards/adr-template.md +86 -0
  108. package/substrate/standards/api-conventions/nextjs.md +84 -0
  109. package/substrate/standards/artifact-composition.md +209 -0
  110. package/substrate/standards/bash-hook-safety.md +246 -0
  111. package/substrate/standards/branch-stacking.md +408 -0
  112. package/substrate/standards/code-safety-principles.md +176 -0
  113. package/substrate/standards/composer-prerequisites.md +155 -0
  114. package/substrate/standards/dependency-discipline/cargo.md +39 -0
  115. package/substrate/standards/dependency-discipline/gem.md +43 -0
  116. package/substrate/standards/dependency-discipline/go-mod.md +41 -0
  117. package/substrate/standards/dependency-discipline/npm.md +42 -0
  118. package/substrate/standards/dependency-discipline/pip.md +42 -0
  119. package/substrate/standards/deployment-topology/ec2-tailscale.md +225 -0
  120. package/substrate/standards/deployment-topology.md +69 -0
  121. package/substrate/standards/docs-sync-allowlist.md +4 -4
  122. package/substrate/standards/domain-and-dns.md +145 -0
  123. package/substrate/standards/frontend-stack.md +67 -0
  124. package/substrate/standards/frontmatter-schema.md +154 -0
  125. package/substrate/standards/hook-injection-discipline.md +202 -0
  126. package/substrate/standards/hook-install-class.md +215 -0
  127. package/substrate/standards/input-handler-interface.md +152 -0
  128. package/substrate/standards/lite-manifest-schema-changes.md +60 -0
  129. package/substrate/standards/luminary-matching.md +105 -0
  130. package/substrate/standards/migration-discipline/active-record.md +50 -0
  131. package/substrate/standards/migration-discipline/alembic.md +43 -0
  132. package/substrate/standards/migration-discipline/gorm.md +50 -0
  133. package/substrate/standards/migration-discipline/prisma.md +53 -0
  134. package/substrate/standards/migration-discipline/sqlalchemy.md +51 -0
  135. package/substrate/standards/mobile-ephemeral-session.md +167 -0
  136. package/substrate/standards/model-routing-discipline.md +160 -0
  137. package/substrate/standards/persona-schema.md +229 -0
  138. package/substrate/standards/pluggable-luminaries.md +323 -0
  139. package/substrate/standards/pr-body-discipline.md +115 -0
  140. package/substrate/standards/preview-state-schema.md +189 -0
  141. package/substrate/standards/reserved-skill-names.md +120 -0
  142. package/substrate/standards/scannable-multi-option-output.md +261 -0
  143. package/substrate/standards/sdlc-gates/typescript.md +57 -0
  144. package/substrate/standards/session-board.md +256 -0
  145. package/substrate/standards/state-spine-contract.md +255 -0
  146. package/substrate/standards/steering-hints/kiss-words.md +11 -0
  147. package/substrate/standards/substrate-config-schema.md +267 -0
  148. package/substrate/standards/tier-dependency-analysis.md +1 -1
  149. package/substrate/standards/tier-tag-schema.md +1 -1
  150. package/substrate/standards/two-layer-config.md +99 -0
  151. package/substrate/standards/use-case-format.md +292 -0
  152. package/substrate/standards/user-story-invest.md +268 -0
  153. package/substrate/standards/velocity-and-appetite.md +229 -0
  154. package/substrate/standards/voice-input-pattern.md +119 -0
  155. package/substrate/standards/worktree-management.md +211 -0
  156. package/substrate/templates/chronicle-template.md +75 -0
  157. package/substrate/templates/memory-proposal-template.md +77 -0
  158. package/substrate/templates/persona-template.md +200 -0
  159. package/substrate/templates/pr-faq.md +45 -0
  160. package/substrate/templates/secret-rotation-template.md +162 -0
  161. package/substrate/templates/spec-template.md +131 -0
  162. package/substrate/templates/use-case-template.md +194 -0
  163. package/substrate/templates/user-story-template.md +107 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ tier: lite
3
+ id: <ISO-ts>-memory-<topic-slug>
4
+ created_by_session: <chronicle-slug>
5
+ created_in: ephemeral-mobile | cloud-web
6
+ created_at: <ISO-8601 UTC>
7
+ pending_action: apply-memory-proposal
8
+ requires_capability: [memory-write]
9
+ priority: medium
10
+ origin_skill: /<skill-that-proposed-it>
11
+ resolves_when: |
12
+ Proposed memory file exists at the target path and MEMORY.md index
13
+ references it. Proposal file git mv'd to
14
+ docs/deferred-actions/completed/.
15
+ ---
16
+
17
+ ## Context
18
+
19
+ Mobile or cloud-web session identified a memory entry worth adding
20
+ but couldn't write to `~/.claude/projects/.../memory/` (ephemeral
21
+ sandboxes lack filesystem access to the operator's real home).
22
+
23
+ Surface the proposal here; a capable desktop session reviews and
24
+ applies it per the Command section below.
25
+
26
+ ## Proposed memory entry
27
+
28
+ **Target path**: `~/.claude/projects/<project>/memory/<category>_<topic>.md`
29
+
30
+ **Frontmatter + body** (copy-paste into the target file verbatim):
31
+
32
+ ```markdown
33
+ ---
34
+ name: <one-line title>
35
+ description: <one-line description for MEMORY.md index>
36
+ type: <user | feedback | project | reference>
37
+ ---
38
+
39
+ <memory content — follow the auto memory guide's structure for this type:
40
+ - user: role, preferences, responsibilities, knowledge
41
+ - feedback: rule + Why + How to apply
42
+ - project: fact/decision + Why + How to apply
43
+ - reference: pointer to external resource + purpose>
44
+ ```
45
+
46
+ **MEMORY.md index line to append**:
47
+
48
+ ```
49
+ - [<title>](<filename>.md) — <one-line hook>
50
+ ```
51
+
52
+ ## Command to execute
53
+
54
+ Operator action. Resolving session:
55
+
56
+ 1. Read the proposed content above
57
+ 2. Apply it verbatim (or edit first if the content needs refinement)
58
+ 3. Verify via the auto-memory guide in the main system prompt:
59
+ - frontmatter fields correct for the memory type
60
+ - content conforms to the type's structure
61
+ - MEMORY.md index line added (≤150 chars)
62
+ 4. Confirm the entry works: next session-start will load MEMORY.md
63
+ and the index line surfaces the new entry
64
+
65
+ ## On completion
66
+
67
+ - [ ] Memory file exists at target path with correct frontmatter
68
+ - [ ] MEMORY.md index updated with the new entry line
69
+ - [ ] `git mv docs/deferred-actions/<id>.md docs/deferred-actions/completed/<id>.md`
70
+ - [ ] `git commit -m "chore: apply memory proposal <id>"`
71
+
72
+ ## Cross-refs
73
+
74
+ - <chronicle that originated the proposal>
75
+ - <related memory entries, if the proposal extends or contradicts existing memory>
76
+ - `.claude/rules/session-artifacts.md`
77
+ - `.claude/rules/deferred-actions.md`
@@ -0,0 +1,200 @@
1
+ ---
2
+ tier: lite
3
+ ---
4
+
5
+ # Persona — [Name]
6
+
7
+ <!--
8
+ Bassclef persona template. Pichler-shaped with evidence-traceability.
9
+ Referenced by /personas skill (.claude/skills/personas/SKILL.md) and
10
+ validated by standards/persona-schema.md.
11
+
12
+ Delete this comment block after copy-paste.
13
+
14
+ Save location:
15
+ Preferred: docs/personas/{slug}.md
16
+ Legacy (backward-compat with /jtbd-tasks + /synthetic-user):
17
+ docs/design/personas/{slug}.md
18
+
19
+ The filename basename MUST match the `slug` field below.
20
+ -->
21
+
22
+ **Slug:** [url-safe-identifier]
23
+ **Name:** [Human-readable display name]
24
+ **Archetype:** [One-line categorical framing — e.g., "PE operator managing 50+ active deals", "Bootstrapped couple founders", "Tier-2 SaaS customer-success manager"]
25
+ **Evidence quality:** [High | Medium | Low | — (unsourced default)]
26
+ **Generated:** [YYYY-MM-DD] via [/psychographic-mine | /auto-user-research | manual research | operator-default]
27
+ **Source synthesis:** [path to research doc, or "—"]
28
+
29
+ ---
30
+
31
+ ## Provenance
32
+
33
+ <!--
34
+ Required for any persona with a claim about behavior, pain points, or
35
+ workflows. Every claim should trace to a source. Orphan claims
36
+ (claims without citation) surface as WARN in /personas validate.
37
+
38
+ If this is an operator-default, state so plainly:
39
+ "Operator-default; not research-backed."
40
+ -->
41
+
42
+ Persona built from:
43
+ - **[Source 1 name]** — [link or repo-local path]. [One-line characterization of what this source establishes]
44
+ - **[Source 2 name]** — [link]. [Characterization]
45
+ - **[Source 3+ as applicable]**
46
+
47
+ ---
48
+
49
+ ## Goal
50
+
51
+ <!--
52
+ REQUIRED. One sentence. What this persona is trying to accomplish
53
+ that the product hires to help with.
54
+
55
+ Not a feature. An outcome.
56
+ -->
57
+
58
+ [One-sentence goal. Start with a verb. End with an outcome, not a feature.]
59
+
60
+ ---
61
+
62
+ ## Role / Context
63
+
64
+ <!--
65
+ Pichler "context" field + enough environmental grounding that
66
+ downstream skills can frame tasks, jargon level, and viewport
67
+ appropriately.
68
+ -->
69
+
70
+ - **Relationship / cohort:** [e.g., married 5+ years, solo founder, cross-functional IC]
71
+ - **Organizational stage:** [e.g., bootstrapped pre-seed, Series B, established enterprise]
72
+ - **Revenue / scale context:** [if applicable]
73
+ - **Team size:** [self, 2, 10, 100+]
74
+ - **Industry:** [specific or range]
75
+
76
+ **Representative example (composite OK):** [Name + age + one-line bio so
77
+ downstream skills can render concrete scenarios. Mark explicitly as
78
+ composite vs. real if from research.]
79
+
80
+ ---
81
+
82
+ ## Workflows (today)
83
+
84
+ <!--
85
+ Pichler "tasks" + "approach" combined. How they currently operate,
86
+ what tools they use, what rhythm they follow.
87
+ -->
88
+
89
+ ### How they currently work
90
+
91
+ - [Primary tool / pattern / rhythm]
92
+ - [Secondary tools]
93
+ - [Coordination / collaboration mechanism if relevant]
94
+
95
+ ### Daily or typical rhythm
96
+
97
+ - [Morning routine]
98
+ - [Workday pattern]
99
+ - [Evening / end-of-day]
100
+
101
+ ---
102
+
103
+ ## Pain points (with evidence trace)
104
+
105
+ <!--
106
+ Each pain should cite a source. Formatting convention:
107
+ > *Source trace: [source-N reference] — "[direct quote]"*
108
+
109
+ This is the evidence-traceability rule. Orphan pains (no trace)
110
+ are WARN in /personas validate.
111
+ -->
112
+
113
+ ### P1 — [Concise pain label]
114
+
115
+ [One-paragraph description of the pain — what triggers it, how it
116
+ manifests, what it costs them.]
117
+
118
+ > *Source trace: [source reference] — "[direct quote or paraphrase]"*
119
+
120
+ ### P2 — [Concise pain label]
121
+
122
+ [Description]
123
+
124
+ > *Source trace: [source reference]*
125
+
126
+ ### P3+ as applicable
127
+
128
+ ---
129
+
130
+ ## Workarounds they've built
131
+
132
+ <!--
133
+ Important for JTBD reasoning and /value-prop-canvas Jobs mapping.
134
+ The workaround is the "status quo" alternative in the Strategyzer
135
+ Value Map.
136
+ -->
137
+
138
+ - [Workaround 1] — [effectiveness] — [source trace if applicable]
139
+ - [Workaround 2] — ...
140
+
141
+ ---
142
+
143
+ ## Knowledge / jargon comfort
144
+
145
+ <!--
146
+ Pichler "knowledge" field. Drives /synthetic-user viewport,
147
+ /visual-review jargon checks, /spec copy tier.
148
+ -->
149
+
150
+ - **Domain expertise:** [novice / working-knowledge / expert]
151
+ - **Technical fluency:** [what they use confidently; what they avoid]
152
+ - **Jargon comfort:** [specific terms known vs. need-plain-language]
153
+
154
+ ---
155
+
156
+ ## Biography
157
+
158
+ <!--
159
+ Pichler "biography" field. Short — 2-3 sentences. Formative
160
+ background, not life story. Use this to give downstream skills a
161
+ narrative anchor for synthesis and testing.
162
+ -->
163
+
164
+ [Short biographical framing — age range, prior roles, formative influences, what brought them to this goal.]
165
+
166
+ ---
167
+
168
+ ## Quotes / voice samples
169
+
170
+ <!--
171
+ Optional but highly valuable. Direct or paraphrased language from
172
+ source material. Drives /synthetic-user test narration and
173
+ /value-prop-canvas Gains articulation.
174
+ -->
175
+
176
+ > "[Direct quote from source]"
177
+ > — [source reference]
178
+
179
+ > "[Another quote]"
180
+ > — [source]
181
+
182
+ ---
183
+
184
+ ## Anti-persona / NOT this persona
185
+
186
+ <!--
187
+ Optional. Who this persona is explicitly NOT. Prevents downstream
188
+ skills from conflating adjacent cohorts.
189
+ -->
190
+
191
+ - NOT: [adjacent cohort that might get confused]
192
+ - NOT: [another adjacent cohort]
193
+
194
+ ---
195
+
196
+ ## Further reading
197
+
198
+ - Roman Pichler, *The Persona Template* — https://www.romanpichler.com/the-persona-template/
199
+ - Alan Cooper, *The Inmates Are Running the Asylum* — archetype-based persona framework (complementary to Pichler)
200
+ - Agile Alliance, *Personas* glossary — https://agilealliance.org/glossary/personas/
@@ -0,0 +1,45 @@
1
+ ---
2
+ tier: lite
3
+ ---
4
+
5
+ # [Initiative Name] — Press Release / FAQ
6
+
7
+ ## Press Release (Written as if launching today)
8
+
9
+ ### Headline
10
+ One sentence. What did we ship and why does anyone care?
11
+
12
+ ### Subheadline
13
+ Who is this for and what do they get?
14
+
15
+ ### Problem Paragraph
16
+ The world before this existed. Pain. Friction. Cost.
17
+
18
+ ### Solution Paragraph
19
+ What we built. How it works. What changes.
20
+
21
+ ### Quote (You)
22
+ Why you built it. What you believe.
23
+
24
+ ### How It Works
25
+ Three steps. Maximum.
26
+
27
+ ### Quote (Customer)
28
+ A fictional but realistic customer reaction.
29
+
30
+ ### Call to Action
31
+ What the reader does next.
32
+
33
+ ---
34
+
35
+ ## FAQ
36
+
37
+ ### Customer FAQ
38
+ Q: What does this cost?
39
+ Q: How is my data handled?
40
+ Q: What if it breaks something?
41
+
42
+ ### Internal FAQ
43
+ Q: How long will this take to build?
44
+ Q: What's the biggest technical risk?
45
+ Q: What do we explicitly NOT build in v1?
@@ -0,0 +1,162 @@
1
+ ---
2
+ tier: lite
3
+ ---
4
+
5
+ # Rotate `<SECRET_NAME>`
6
+
7
+ Runbook for rotating `<SECRET_NAME>` (purpose: `<one-line>`).
8
+
9
+ Schema: `standards/state-spine/schemas/substrate-secrets.schema.json`.
10
+ Standard: `standards/secrets-lifecycle.md`.
11
+
12
+ ## When to rotate
13
+
14
+ - Scheduled: every `<rotation_cadence>` (per `substrate.secrets.md`)
15
+ - Triggered: on suspected leak / vendor migration / role change
16
+ - BLOCKED: session-start hook fires within `<alert_threshold_days>` of expiry
17
+
18
+ ## Pre-flight
19
+
20
+ - [ ] Confirm you have access to the issuing service's admin console
21
+ - [ ] Confirm you have write access to wherever the secret lives
22
+ (GitHub Actions Secrets / 1Password / `.env` / AWS Secrets Manager)
23
+ - [ ] Pull a fresh `git pull` of bassclef so your `substrate.secrets.md`
24
+ is current
25
+ - [ ] Identify all consumers of this secret (grep workflows, scripts,
26
+ hooks); know what stops working if rotation fails mid-procedure
27
+
28
+ ## Procedure
29
+
30
+ ### 1. Generate the new credential
31
+
32
+ `<service-specific instructions>`
33
+
34
+ Examples by storage type:
35
+
36
+ - **GitHub PAT**: github.com → Settings → Developer settings →
37
+ Personal access tokens → Fine-grained → Generate. Scope: minimum
38
+ required (e.g., `Contents: write` + `Pull requests: write` for
39
+ cross-repo PR creation).
40
+ - **Slack incoming webhook**: api.slack.com/apps → your app →
41
+ Incoming Webhooks → Add New Webhook to Workspace.
42
+ - **Google OAuth refresh token**: re-run the OAuth consent flow
43
+ (e.g., `npx tsx scripts/google-oauth-bootstrap.ts`).
44
+ - **AWS access key**: console.aws.amazon.com → IAM → Users → your-user
45
+ → Security credentials → Create access key. Old key stays valid until
46
+ explicitly deactivated — overlap rotations.
47
+
48
+ ### 2. Update the storage location
49
+
50
+ `<storage-type-specific instructions>`
51
+
52
+ Examples:
53
+
54
+ - **`github_actions_secret`**: github.com → repo → Settings → Secrets
55
+ and variables → Actions → Update existing secret. New value takes
56
+ effect for next workflow run.
57
+ - **`env`** (operator's `.env`): edit `.env` file; restart any running
58
+ process that reads it (dev server, REPL).
59
+ - **`file`**: replace the file at `<reference>` path; ensure permissions
60
+ match (typically `0600`).
61
+ - **`1password`**: 1Password app → vault → item → edit → save. Any
62
+ process using the 1Password CLI picks up new value on next read.
63
+ - **`aws_secrets_manager`**: AWS Console → Secrets Manager → secret
64
+ → Retrieve secret value → Edit → Save. Code reads via
65
+ `GetSecretValue` API; cached values may need invalidation.
66
+
67
+ ### 3. Update `substrate.secrets.md`
68
+
69
+ In the entry for `<SECRET_NAME>`:
70
+
71
+ ```yaml
72
+ last_rotated: YYYY-MM-DD # today
73
+ expires_at: YYYY-MM-DD # today + rotation_cadence
74
+ ```
75
+
76
+ Commit this update with a small commit:
77
+
78
+ ```bash
79
+ git add substrate.secrets.md
80
+ git commit -m "chore: rotate <SECRET_NAME> — last_rotated + expires_at updated"
81
+ git push
82
+ ```
83
+
84
+ ### 4. Verify
85
+
86
+ Run the status script:
87
+
88
+ ```bash
89
+ bash scripts/secrets-status.sh
90
+ ```
91
+
92
+ The entry should show `✅ OK` with the new `Days` value (close to the
93
+ full cadence in days).
94
+
95
+ If the secret has a `health_check_command`, run with `--health-check`:
96
+
97
+ ```bash
98
+ bash scripts/secrets-status.sh --health-check
99
+ ```
100
+
101
+ The corresponding `[health: ✓]` should appear.
102
+
103
+ ### 5. Confirm downstream consumers still work
104
+
105
+ `<test-specific instructions>`
106
+
107
+ Examples:
108
+
109
+ - **Slack webhook**: trigger a workflow that posts (e.g., merge a small
110
+ PR); verify Slack receives the message
111
+ - **GitHub PAT**: trigger a cross-repo workflow; verify PR opens in the
112
+ consumer repo
113
+ - **Google OAuth**: run `npx tsx ~/src/sunj-labs/poa/scripts/push-to-gdoc.ts --auth-check`
114
+ - **Anthropic API key**: send a test API request via curl
115
+
116
+ ### 6. Revoke the old credential (when applicable)
117
+
118
+ For credentials that overlap (e.g., AWS access keys), explicitly
119
+ revoke / deactivate the old credential after the new one is verified.
120
+
121
+ ## What might break
122
+
123
+ `<failure-mode-specific notes>`
124
+
125
+ Examples:
126
+
127
+ - **Slack webhook rotation**: any workflow run that fired between the
128
+ old webhook becoming invalid and the secret update will silently
129
+ drop messages. Consider rotating during low-activity windows.
130
+ - **GitHub PAT rotation**: cross-repo PRs in flight may need to be
131
+ re-opened / re-triggered if the workflow run consumed the old token.
132
+ - **Google OAuth refresh token**: the bootstrap flow may surface a
133
+ "Verify your account" prompt; complete it before tokenizing.
134
+ - **AWS keys**: cached credentials in long-running processes (CI
135
+ runners, serverless functions) may keep using the old key until
136
+ cycled.
137
+
138
+ ## Rollback
139
+
140
+ If the new credential doesn't work:
141
+
142
+ 1. Restore the old credential to the storage location
143
+ 2. Revert the `substrate.secrets.md` update
144
+ 3. Diagnose: was the new credential generated correctly? Was it
145
+ pasted with whitespace? Does the issuing service have a
146
+ propagation delay (some do)?
147
+ 4. Once diagnosed: re-attempt rotation OR file an incident-report
148
+ if the failure mode is novel
149
+
150
+ ## When the runbook itself breaks
151
+
152
+ If these instructions stop working (e.g., service redesign, deprecated
153
+ API), update this runbook in the same PR that handles the rotation.
154
+ The runbook must stay current — a stale runbook is the same operational
155
+ debt that motivated this whole tracking system.
156
+
157
+ ## Composes with
158
+
159
+ - `standards/secrets-lifecycle.md` — schema + field reference
160
+ - `scripts/secrets-status.sh` — status verification
161
+ - `.claude/hooks/session-reflection.d/90-secrets-expiry.sh` — alert
162
+ surface that drives rotation cadence
@@ -0,0 +1,131 @@
1
+ ---
2
+ tier: lite
3
+ ---
4
+
5
+ # SPEC-NNN: [Feature Name]
6
+
7
+ ## Canvas Reference
8
+ Link to product canvas or PR/FAQ.
9
+
10
+ ## Context
11
+ Why now? What triggered this work?
12
+
13
+ ## Requirements
14
+ ### Must Have
15
+ - ...
16
+ ### Should Have
17
+ - ...
18
+ ### Won't Have (this version)
19
+ - ...
20
+
21
+ ## Design
22
+ ### User Flow
23
+ Step-by-step, what the user (or system) does.
24
+
25
+ ### Object Model
26
+ What are the core objects? How do they relate?
27
+ (Define objects, not screens.)
28
+
29
+ ### Interface
30
+ Wireframe, CLI spec, API contract — whatever's appropriate.
31
+
32
+ ## Technical Approach
33
+ Architecture, dependencies, risks.
34
+
35
+ ## Patterns Used
36
+
37
+ (Required when spec drives Construction work. Maps named patterns from bassclef's catalog to where they'll be implemented. Pairs with `@pattern` annotations in code per `.claude/rules/pattern-annotation.md`. Layer 2 of bassclef#478 traceability.)
38
+
39
+ | Pattern | Catalog path | Implementing file/class | Why this pattern |
40
+ |---------|--------------|--------------------------|------------------|
41
+ | <Name> | `patterns/<shelf>/<source>/<slug>.md` | `src/.../<file>.ts` :: `<ClassName>` | <one-line rationale> |
42
+
43
+ If a needed pattern has no catalog entry yet, file `/agent-research-spawn` to add it, then update this table. Don't fabricate catalog paths.
44
+
45
+ If the spec has no conscious pattern choices (e.g., a one-line config edit), state "No load-bearing patterns" — silence is not exemption.
46
+
47
+ ## Deployment & Access Architecture
48
+
49
+ Answer these before writing code. The answers determine your deployment tier,
50
+ networking, auth, and domain strategy.
51
+
52
+ ### Who accesses this?
53
+
54
+ | Question | Answer |
55
+ |----------|--------|
56
+ | Is this operator/team-only (internal)? | yes / no |
57
+ | Will trusted external people use it (partners, clients)? | yes / no |
58
+ | Will the public use it (customers, strangers)? | yes / no |
59
+ | Does access need to work from outside the corporate network / VPN? | yes / no |
60
+
61
+ ### What does it need?
62
+
63
+ | Question | Answer |
64
+ |----------|--------|
65
+ | Does it persist data (database, filesystem)? | yes / no |
66
+ | Does it handle secrets server-side (API keys, OAuth tokens)? | yes / no |
67
+ | Does it need SSR or API routes? | yes / no |
68
+ | Does it call other internal services? | yes / no |
69
+ | Does it need auth (login, user accounts, SSO)? | yes / no |
70
+
71
+ ### Deployment decision
72
+
73
+ Based on the answers above:
74
+
75
+ | Condition | Tier |
76
+ |-----------|------|
77
+ | Internal-only, no persistence, validating UI | **Mockup** (prototype, local dev, design tool) |
78
+ | Needs a shareable link, still mock data, no backend | **Staging** (static hosting, internal CDN) |
79
+ | Any "yes" to persistence, secrets, SSR, or service calls | **Production** (full deployment to your infra) |
80
+ | Public users outside corporate network | **Production + edge** (CDN, TLS, public domain) |
81
+
82
+ ### If public-facing, additionally answer:
83
+
84
+ | Question | Answer |
85
+ |----------|--------|
86
+ | Domain name? | |
87
+ | TLS strategy? | |
88
+ | Auth provider? (OAuth, SSO, magic link, none?) | |
89
+ | Rate limiting needed? | yes / no |
90
+ | Do we need a public status page? | yes / no |
91
+ | GDPR / data handling implications? | |
92
+
93
+ ### Monitoring
94
+
95
+ | Question | Answer |
96
+ |----------|--------|
97
+ | Healthcheck endpoint path? | `/health` or specify |
98
+ | Add to infrastructure monitoring? | yes / no |
99
+ | LLM/AI observability needed? | yes / no |
100
+ | Cost controls relevant? | yes / no |
101
+
102
+ ## Acceptance Criteria
103
+ How we know it's done. Testable statements.
104
+
105
+ ## Workunits enumerated
106
+
107
+ REQUIRED for specs that feed `/build` (bassclef#335 + bassclef#367).
108
+ Each WU traces to one INVEST user story and lands as one stacked-atomic
109
+ PR. /build's Phase 1 parser greps for this exact section heading.
110
+
111
+ Format (one entry per WU):
112
+
113
+ ```markdown
114
+ ### WU-N — <imperative title>
115
+
116
+ **Story refs:** US-NNN[, US-NNN]
117
+ **Branch:** feature/<bet-slug>-stack-N-<wu-slug>
118
+ **Acceptance:**
119
+ - [ ] <inherited from story; testable; observable>
120
+ - [ ] <edge case / extension>
121
+ **Estimated:** ~Nt turns
122
+
123
+ (per /preview-build Phase 9 contract per bassclef#367)
124
+ ```
125
+
126
+ If the spec doesn't feed `/build` (e.g., bassclef-evolution shaping
127
+ specs, design specs, methodology specs), this section is optional —
128
+ include a brief note explaining why it's omitted.
129
+
130
+ ## Open Questions
131
+ Things we don't know yet.