@thebassclef/lite 0.1.0 → 0.1.2

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 +2 -0
  2. package/dist/cli.js +2 -0
  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,292 @@
1
+ ---
2
+ tier: lite
3
+ description: - Alistair Cockburn — Writing Effective Use Cases (2000).
4
+ ---
5
+
6
+ ## Sources read
7
+
8
+ - Alistair Cockburn — *Writing Effective Use Cases* (2000). Bassclef source for fully-dressed format, goal levels, extension enumeration, preconditions + guarantees, stakeholders + interests.
9
+ - Alistair Cockburn — *Unifying user stories, use cases, and story maps* (2024). Artifact non-overlap (use-case ≠ user-story ≠ task-scenario ≠ story-map); this standard respects the boundaries.
10
+ - `.claude/skills/use-case/SKILL.md` — the skill that produces this artifact; this standard codifies the format the skill emits.
11
+ - `standards/user-story-invest.md` — sibling standard; user-stories slice use-case lines with traceability back. INVEST validation there is orthogonal to Cockburn validation here.
12
+ - `standards/persona-schema.md` — primary-actor field MUST reference a persona slug per this schema.
13
+
14
+ ## What I'm NOT reading (with reason)
15
+
16
+ - RUP, Jacobson "Use Case 2.0," and other use-case notation variants — Cockburn is the bassclef shape in sunj-labs per this standard. Alternatives may be adopted later with an explicit ADR.
17
+
18
+ # Use-Case Format Standard
19
+
20
+ Bassclef format for use cases in sunj-labs repos. The contract the
21
+ `/use-case` skill writes and every downstream consumer
22
+ (`/user-stories`, `/interaction-design`, `/decompose`, `/verify`,
23
+ `/spec`) composes against.
24
+
25
+ Template: `templates/use-case-template.md`.
26
+ Skill: `.claude/skills/use-case/SKILL.md`.
27
+
28
+ ## Why this standard exists
29
+
30
+ Before /use-case, the user-centric chain had:
31
+
32
+ - `/jtbd-tasks` — WHY (job the product is hired for)
33
+ - `/task-scenarios` — CONTEXT (narrative day-in-the-life)
34
+ - `/user-stories` — WHAT (backlog tokens, INVEST-shaped)
35
+ - `/decompose` — HOW (responsibilities + patterns)
36
+
37
+ Missing: **goal-level behavior spec**. `/user-stories` slices
38
+ goals into INVEST-sized increments, but stories don't enumerate
39
+ alternate flows systematically. `/interaction-design` renders
40
+ flows as diagrams, but diagrams permit free-form omission —
41
+ nothing forces the designer to list every extension.
42
+
43
+ Use cases close the gap. Cockburn's format *requires* extension
44
+ enumeration (1a, 1b, 2a, 2b...), *requires* preconditions and
45
+ postconditions, *requires* stakeholders-and-interests. The
46
+ skill can't emit a valid use case without those fields, so
47
+ cross-cutting concerns (audit, compliance, rate limits) can't
48
+ be silently dropped on the way to `/decompose`.
49
+
50
+ ## File convention
51
+
52
+ ### Preferred path
53
+
54
+ `docs/use-cases/UC-NNN-{slug}.md` — one file per use case.
55
+
56
+ `NNN` is a zero-padded 3-digit number assigned in creation order.
57
+ `{slug}` is URL-safe: lowercase, hyphens, no spaces. Slug MUST
58
+ match a form of the goal (e.g., `sign-in-with-email` not
59
+ `login` — avoids ambiguity when multiple auth flows coexist).
60
+
61
+ ### Matrix
62
+
63
+ `docs/use-cases/_matrix.md` — traceability table with one row
64
+ per use case. See `/use-case` skill Step 7 for columns.
65
+
66
+ ## Required fields
67
+
68
+ Every use case MUST include these fields. The skill validates
69
+ presence and emits WARN/BLOCK per the validation matrix below.
70
+
71
+ ### Header
72
+
73
+ ```markdown
74
+ # UC-NNN — [imperative goal title]
75
+ ```
76
+
77
+ The title is the goal statement, imperative mood, no period.
78
+ Examples: `UC-001 — Sign in with email and password`,
79
+ `UC-014 — Submit an expense for approval`.
80
+
81
+ ### Metadata block
82
+
83
+ ```markdown
84
+ - **Primary actor**: [persona-slug]
85
+ - **Goal level**: ☁️ summary | 🎯 user-goal | 🐟 subfunction
86
+ - **Scope**: [system-under-design]
87
+ - **Status**: draft | accepted | deprecated
88
+ - **Last validated**: YYYY-MM-DD
89
+ ```
90
+
91
+ **Primary actor** MUST be a persona slug from `docs/personas/` or
92
+ equivalent. "User," "actor," or role words like "admin" without a
93
+ persona file are WARN.
94
+
95
+ **Goal level** exactly one of the three icons. Default ☁️/🎯/🐟
96
+ per `/use-case` Step 2. Summary only for multi-session goals;
97
+ subfunction only for reused-by-2+ use cases.
98
+
99
+ **Scope** names the system boundary: `POA web UI + auth service`,
100
+ `bassclef-sync hook`, `POA backend`. Fuzzy scope ("the app") is
101
+ WARN — split into distinct use cases.
102
+
103
+ ### Stakeholders + interests
104
+
105
+ ```markdown
106
+ ## Stakeholders + interests
107
+
108
+ | Stakeholder | Interest |
109
+ |-------------|----------|
110
+ | [stakeholder] | [what they want to be true about this goal's execution] |
111
+ ```
112
+
113
+ At least **2 non-actor** stakeholders required. Non-actor means:
114
+ not the primary actor. Examples: Compliance, Ops, Support, Billing,
115
+ Legal, Security, Partners, Regulators, Operator/Admin.
116
+
117
+ This block is load-bearing — it's what feeds `/decompose`'s -ility
118
+ audit. A use case with only the primary actor listed will pass
119
+ validation with a WARN but will produce a decomposition missing
120
+ cross-cutting concerns. The skill will flag the WARN explicitly.
121
+
122
+ ### Preconditions + guarantees + trigger
123
+
124
+ ```markdown
125
+ ## Preconditions
126
+ - [state invariant 1]
127
+ - [state invariant 2]
128
+
129
+ ## Minimal guarantees
130
+ - [what's true after, regardless of success/failure]
131
+
132
+ ## Success guarantees
133
+ - [what's true after a successful run]
134
+
135
+ ## Trigger
136
+ - [event that starts the use case]
137
+ ```
138
+
139
+ **Preconditions** are checkable state invariants the use case
140
+ assumes on entry. "The system is running" is throat-clearing, not
141
+ a precondition — reject as WARN. Valid preconditions: "account
142
+ exists," "user is authenticated," "quota below limit."
143
+
144
+ **Minimal guarantees** hold on ANY exit (success or extension):
145
+ typically audit logging, state consistency, no secret leakage.
146
+ This is where the "audit-trail written even on failure" invariant
147
+ gets recorded.
148
+
149
+ **Success guarantees** hold on successful completion only.
150
+
151
+ **Trigger** is the specific event (actor action, scheduled event,
152
+ external signal) that starts the flow.
153
+
154
+ ### Main success scenario
155
+
156
+ ```markdown
157
+ ## Main success scenario
158
+
159
+ 1. [Actor action OR system response]
160
+ 2. [Next step, actor↔system alternating]
161
+ 3. [...]
162
+ ```
163
+
164
+ Numbered list, 3-9 steps. Each step is either actor action or
165
+ system response; alternate between them. Steps >9 = split into
166
+ subfunction use case.
167
+
168
+ Implementation language prohibited: "System calls Postgres" ❌.
169
+ Say "System retrieves account" — let `/decompose` pick storage.
170
+
171
+ ### Extensions
172
+
173
+ ```markdown
174
+ ## Extensions
175
+
176
+ - **Na. [condition]**:
177
+ - Na1. [step 1 of recovery]
178
+ - Na2. [step 2 of recovery]
179
+ - Na3. Use case ends with [outcome].
180
+ ```
181
+
182
+ `N` = the main-scenario step number where the branch originates.
183
+ `a`, `b`, `c` = multiple extensions at the same step. Sub-steps
184
+ within an extension are `Na1`, `Na2`, `Na3`...
185
+
186
+ Nested extensions (`Na1a`) are allowed but nesting >2 levels
187
+ signals a subfunction extraction is needed.
188
+
189
+ **Every step in the main scenario MUST have at least one
190
+ extension considered.** If a step has no realistic branch, state
191
+ that explicitly: `*No extensions — [reason]*`. Silence is a
192
+ failure signal, not confirmation of happy path.
193
+
194
+ Extension enumeration prompts (Cockburn, per skill Step 4):
195
+
196
+ 1. What if actor input is invalid?
197
+ 2. What if system can't complete step (timeout, dependency, resource)?
198
+ 3. What if a precondition silently broke?
199
+ 4. What if actor abandons partway?
200
+ 5. What if concurrent actor changed state?
201
+
202
+ ### Technology/data variations (optional)
203
+
204
+ ```markdown
205
+ ## Technology / data variations
206
+
207
+ - *Step 3*: password may also be verified via WebAuthn credential
208
+ - *Step 4*: session cookie may be HttpOnly OR stored in SessionStorage per platform
209
+ ```
210
+
211
+ Use when the same logical step has multiple implementation paths
212
+ with different -ility characteristics. Feeds `/decompose` with
213
+ variation points needing Strategy pattern.
214
+
215
+ ### Related information
216
+
217
+ ```markdown
218
+ ## Related information
219
+
220
+ - Non-functional requirements: [rate limits, latency SLOs, etc.]
221
+ - References: [specs, ADRs, canvases, external docs]
222
+ - Sliced by stories: US-NNN, US-NNN, ...
223
+ ```
224
+
225
+ Rate-limit, latency, and other cross-cutting NFRs live here when
226
+ they don't map cleanly to a stakeholder+interests row.
227
+
228
+ ## Validation matrix
229
+
230
+ | # | Check | Fail signal | Severity |
231
+ |---|-------|-------------|----------|
232
+ | 1 | Goal level stated | Missing ☁️/🎯/🐟 | BLOCK |
233
+ | 2 | Primary actor is a persona slug | "user" / missing / role word without persona file | WARN |
234
+ | 3 | ≥2 non-actor stakeholders | Only primary actor listed | WARN |
235
+ | 4 | Preconditions are checkable state invariants | Throat-clearing ("system is running") | WARN |
236
+ | 5 | Main scenario steps numbered | Bullets or prose | BLOCK |
237
+ | 6 | Main scenario 3-9 steps | ≥10 steps | WARN (candidate for subfunction split) |
238
+ | 7 | Every step has ≥1 extension OR explicit "*No extensions — [reason]*" | Silence | BLOCK |
239
+ | 8 | Extensions use Na Nb format | Free-form bullets | BLOCK |
240
+ | 9 | Success guarantees trace back to trigger | Guarantee unrelated to trigger outcome | WARN |
241
+ | 10 | Scope names a specific system boundary | "The app" / missing | WARN |
242
+ | 11 | No implementation language in steps | "System calls Postgres" / framework names | WARN |
243
+ | 12 | Trigger is a specific event | Abstract ("when needed") | WARN |
244
+
245
+ BLOCK = skill refuses to emit; operator must fix.
246
+ WARN = skill emits with warnings recorded in `_matrix.md`.
247
+
248
+ ## Relationship to adjacent standards
249
+
250
+ | Standard | Relationship |
251
+ |----------|-------------|
252
+ | `persona-schema.md` | Primary actor MUST reference a persona slug per this schema |
253
+ | `user-story-invest.md` | User stories slice use-case lines; stories cite UC-N step Xa in traceability |
254
+ | `vpc-fit-validation.md` | VPC Pain-Relievers + Gain-Creators inform the stakeholders+interests "why this matters" framing |
255
+ | `project-directory-layout.md` | `docs/use-cases/` is the bassclef path in app repos |
256
+
257
+ ## Relationship to adjacent skills
258
+
259
+ | Skill | Role in use-case lifecycle |
260
+ |-------|----------------------------|
261
+ | `/use-case` | Produces use-case files per this standard |
262
+ | `/user-stories` | Slices use-case lines into backlog tokens |
263
+ | `/interaction-design` | Renders main scenario + extensions as diagrams |
264
+ | `/decompose` | Reads use-case as alternative input to sequence diagrams; stakeholders+interests drive -ility audit |
265
+ | `/verify` | Maps use-case lines to test assertions (1:1) |
266
+ | `/spec` | Consumes use cases + stories as input |
267
+ | `/shape` | `medium` + `full` tiers invoke /use-case as part of the chain |
268
+
269
+ ## Evolution
270
+
271
+ - **v1.0 (2026-04-21)** — initial bassclef standard, Cockburn
272
+ fully-dressed format with goal levels, stakeholders+interests
273
+ discipline, and extension enumeration rules. Validation matrix
274
+ encodes BLOCK/WARN severities for skill-time gate.
275
+
276
+ ## Open questions for future iteration
277
+
278
+ - **Concurrent-actor extensions**: Cockburn's rule 5 ("what if a
279
+ concurrent actor changed state?") is underspecified here. May
280
+ warrant a companion standard on optimistic-concurrency patterns
281
+ tied to use-case extensions.
282
+ - **Use-case reuse (subfunction callouts)**: current format inlines
283
+ subfunction use cases; larger systems may need explicit "include"
284
+ references (UC-001 includes UC-042). Defer until observed pain.
285
+ - **Use-case deprecation lifecycle**: `status: deprecated` is
286
+ noted but lifecycle (when to delete vs. archive) isn't codified.
287
+ Defer until first use-case is retired.
288
+
289
+ ## Closes
290
+
291
+ - bassclef #213 (companion to `/use-case` skill)
292
+ - Part of spec-lineage family epic #155
@@ -0,0 +1,268 @@
1
+ ---
2
+ tier: lite
3
+ description: Validation rules for user stories produced by /user-stories.
4
+ ---
5
+
6
+ # User Story INVEST Standard
7
+
8
+ Validation rules for user stories produced by `/user-stories`. INVEST
9
+ (Bill Wake, 2003) is the bassclef heuristic for backlog-ready story
10
+ quality. This standard codifies the rules + pass/warn/fail semantics.
11
+
12
+ Skill: `.claude/skills/user-stories/SKILL.md`.
13
+ Template: `templates/user-story-template.md`.
14
+
15
+ ## Why this standard exists
16
+
17
+ User stories are conversation tokens, not specifications. Without
18
+ quality gates, "story" devolves into "any sentence formatted with
19
+ 'As a / I want / So that.'" The result: bloated stories that take
20
+ weeks, vague stories that can't be estimated, dependent stories that
21
+ block release planning, technical-debt stories disguised as user
22
+ value.
23
+
24
+ INVEST is six load-bearing tests every story passes before it enters
25
+ the backlog. Stories that fail multiple letters require rewrite.
26
+ Stories that fail one letter get WARN with a path to resolution.
27
+
28
+ ## The six tests
29
+
30
+ ### I — Independent
31
+
32
+ **Test**: Can this story ship to production without any other story
33
+ shipping first?
34
+
35
+ **Why**: dependent stories couple release planning. If A depends on
36
+ B which depends on C, you can't ship A early or skip C. Independent
37
+ stories let the team reorder, kill, or ship in any sequence.
38
+
39
+ **Acceptable dependencies**:
40
+ - Infrastructure that's already in place (no story dependency, just
41
+ platform reality)
42
+ - Optional enhancement: "this story is BETTER if X is also shipped,
43
+ but ships valuable on its own"
44
+
45
+ **Not acceptable**:
46
+ - "Need US-002 before US-001 makes sense" — merge or resequence
47
+ - Implicit dependencies hidden in acceptance criteria — surface them
48
+
49
+ **Resolution if fail**:
50
+ - Merge dependent stories into one
51
+ - Resequence so the prerequisite ships as its own story first
52
+ - Re-scope so this story doesn't NEED the prerequisite (deliver lesser
53
+ but standalone value)
54
+
55
+ ### N — Negotiable
56
+
57
+ **Test**: Is this story a starting-point for conversation, or a
58
+ contract that mandates exact wording?
59
+
60
+ **Why**: stories are tokens for conversation between PO + dev + UX,
61
+ not specs. A story that locks in "must be a left-side panel" loses
62
+ the design negotiation that should happen at sprint planning. Stories
63
+ say WHAT outcome the persona gets; teams negotiate HOW during
64
+ implementation.
65
+
66
+ **Acceptable**:
67
+ - Constraints when they're load-bearing: "must be accessible per WCAG
68
+ AA" (this isn't negotiable for legal/ethical reasons, mark it
69
+ explicit)
70
+ - Acceptance criteria that pin down outcomes (those ARE the contract)
71
+
72
+ **Not acceptable**:
73
+ - Implementation prescription in the story body (move to acceptance
74
+ criteria or out of story entirely)
75
+ - "Must use [framework/library]" — that's an architecture decision,
76
+ not a story
77
+
78
+ **Resolution if fail**:
79
+ - Move prescriptive content to acceptance criteria
80
+ - Move architecture/library mandates to ADRs
81
+ - Rewrite story body in user-outcome terms
82
+
83
+ ### V — Valuable
84
+
85
+ **Test**: Does the named persona get observable, demonstrable value
86
+ when this story ships?
87
+
88
+ **Why**: stories that exist for internal reasons (refactor, tech-debt,
89
+ infrastructure) aren't user stories — they're technical tasks. They
90
+ belong in a separate backlog or as enabler stories with explicit
91
+ "this enables future user value" framing. Confusing tech-tasks with
92
+ user-stories pollutes the backlog and obscures actual user work.
93
+
94
+ **Acceptable**:
95
+ - Direct value: persona uses the new behavior
96
+ - Indirect value: persona experiences a quality improvement
97
+ (faster, more reliable, more secure)
98
+ - Enabler value: explicit framing — "enables US-NNN which delivers
99
+ user value"
100
+
101
+ **Not acceptable**:
102
+ - "Refactor X" with no user-facing change
103
+ - "Pay down tech debt in module Y" — this is a tech task
104
+ - "Add observability" — unless persona is operator/SRE, this is
105
+ internal
106
+
107
+ **Resolution if fail**:
108
+ - Reclassify as tech-debt task; move to engineering backlog
109
+ - Reframe as enabler story tied to a user-facing story
110
+ - If genuinely user-valuable but value is hard to articulate, the
111
+ value isn't there — kill the story
112
+
113
+ ### E — Estimable
114
+
115
+ **Test**: Can the team estimate this story (in story points,
116
+ t-shirt size, or hours) within ~30 minutes of refinement?
117
+
118
+ **Why**: unestimable stories indicate hidden complexity, missing
119
+ context, or unfamiliar territory. Either the story needs more
120
+ discovery (research spike), or it needs to be split until the parts
121
+ are estimable.
122
+
123
+ **Common reasons stories aren't estimable**:
124
+ - Unknown technical territory (need spike)
125
+ - Unclear acceptance criteria (need refinement)
126
+ - Unknown user behavior (need research)
127
+ - Too big to fit estimation in one head (split)
128
+
129
+ **Resolution if fail**:
130
+ - Schedule a research spike for unknowns (timeboxed, separate story)
131
+ - Refine acceptance criteria
132
+ - Split the story until parts are estimable
133
+
134
+ ### S — Small
135
+
136
+ **Test**: Does this story fit in one iteration / sprint?
137
+
138
+ **Why**: stories that span multiple sprints become epics. Epics are
139
+ fine as containers but they're not stories. A story that takes 3
140
+ weeks misses every benefit of incremental delivery — no early
141
+ feedback, no early value, no early risk discovery.
142
+
143
+ **Heuristic**: a story should be doable in 1-5 days by one or two
144
+ developers with normal context. If 6+ days, split it.
145
+
146
+ **Splitting strategies** (Patton, Cohn):
147
+ - By workflow step (extract a single step into its own story)
148
+ - By data type (one story per data variant)
149
+ - By acceptance criterion (one criterion per story)
150
+ - By user role (different personas as different stories)
151
+ - By happy path vs. edge cases (ship happy path first, edges later)
152
+ - By UI vs. backend (when independently shippable; risky if not)
153
+
154
+ **Resolution if fail**: split. The most common letter to fail.
155
+
156
+ ### T — Testable
157
+
158
+ **Test**: Are the acceptance criteria concrete enough to write
159
+ automated tests against?
160
+
161
+ **Why**: untestable stories ship as "looks done" — and "looks done"
162
+ ships bugs. Acceptance criteria that read "works well" or "is
163
+ intuitive" aren't testable. Criteria that read "loads in <2s on 4G"
164
+ or "all form fields validate before submit" are.
165
+
166
+ **Testable criteria**:
167
+ - Pin specific observable behaviors
168
+ - Include thresholds for non-functional concerns (performance, a11y)
169
+ - Cover happy path + at least one edge case
170
+ - Map to test types (unit / integration / e2e)
171
+
172
+ **Not testable**:
173
+ - "Looks good" / "feels fast" / "is intuitive"
174
+ - "Standard behavior" without defining what standard means
175
+ - Implementation assertions ("uses Redis cache") rather than behavior
176
+
177
+ **Resolution if fail**: rewrite criteria. Each criterion = one test
178
+ assertion. If you can't write the test, the criterion isn't done.
179
+
180
+ ## Pass / Warn / Fail semantics
181
+
182
+ Per-story status is computed from the six tests:
183
+
184
+ | INVEST score | Status | Meaning |
185
+ |--------------|--------|---------|
186
+ | 6 PASS | **PASS** | Backlog-ready |
187
+ | 5 PASS / 1 WARN | **PASS-WARN** | Backlog-ready; resolve warning at refinement |
188
+ | 4 PASS / 2 WARN | **WARN** | Refine before sprint planning |
189
+ | ≤3 PASS or any FAIL | **FAIL** | Rewrite required |
190
+
191
+ Aggregate iteration health:
192
+
193
+ ```markdown
194
+ **INVEST aggregate**: N PASS / M PASS-WARN / K WARN / J FAIL
195
+ **Backlog-ready ratio**: (PASS + PASS-WARN) / total
196
+ ```
197
+
198
+ Target ratio: ≥85%. Below 70% = backlog-quality systemic issue
199
+ (refinement discipline missing, scope confusion, persona inflation).
200
+
201
+ ## Validation procedure (`/user-stories validate`)
202
+
203
+ `/user-stories validate` walks every story under `docs/user-stories/`
204
+ (or `docs/user-stories/[iteration]/`) and reports per-story status.
205
+
206
+ ```markdown
207
+ ## Story validation — [iteration]
208
+
209
+ | Story | I | N | V | E | S | T | Status | Notes |
210
+ |-------|---|---|---|---|---|---|--------|-------|
211
+ | US-001 | ✅ | ✅ | ✅ | ✅ | ⚠️ | ✅ | PASS-WARN | S: 5-day estimate at upper bound; consider split |
212
+ | US-002 | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | FAIL | I: depends on US-005 not yet in backlog |
213
+ | ... | ... | ... | ... | ... | ... | ... | ... | ... |
214
+
215
+ **Aggregate**: 8 PASS / 3 PASS-WARN / 2 WARN / 1 FAIL
216
+ **Backlog-ready ratio**: 11/14 = 79% (below 85% target — refine)
217
+ ```
218
+
219
+ ## Traceability rules
220
+
221
+ Every story carries a traceability block linking to upstream artifacts:
222
+
223
+ | Field | Required? | When absent |
224
+ |-------|-----------|-------------|
225
+ | Persona | MUST | FAIL — every story names a persona slug |
226
+ | JTBD | MUST | FAIL — story without JTBD is solution-looking-for-problem |
227
+ | VPC entry | SHOULD | WARN — benefit clause is weaker without VPC grounding |
228
+ | Use-case line | SHOULD when /use-case exists | WARN — coverage gap on use-case |
229
+
230
+ A story with no JTBD trace is a **red flag**: it's likely a feature
231
+ request from operator intuition rather than user need. Either find
232
+ the JTBD (which means /jtbd-tasks needs another pass) or kill the
233
+ story.
234
+
235
+ ## What this standard does NOT cover
236
+
237
+ - **Story estimation methodology** (story points vs. t-shirt vs. hours)
238
+ — team choice, not standard concern
239
+ - **Sprint composition rules** — separate concern (`/sprint` skill)
240
+ - **Acceptance test format** — Given/When/Then BDD or assertion-style
241
+ both fine; team picks
242
+ - **Task breakdown within a story** — implementation detail, not
243
+ story-level
244
+
245
+ ## Relationship to other standards + rules
246
+
247
+ | Related | Connection |
248
+ |---------|-----------|
249
+ | `standards/persona-schema.md` | Personas referenced in `<As a>` clause must validate against schema |
250
+ | `.claude/rules/artifact-ingestion.md` | Stories trace to upstream artifacts; same "cite before claim" discipline |
251
+ | `standards/vpc-fit-validation.md` | VPC Pain-Relievers + Gain-Creators ground story `<benefit>` clause |
252
+ | `.claude/skills/user-stories/SKILL.md` | The skill that produces stories validated by this standard |
253
+ | `.claude/skills/spec/SKILL.md` | Downstream — spec consumes stories as input scope |
254
+
255
+ ## When to revisit
256
+
257
+ - Backlog-ready ratio drops below 70% repeatedly (refinement issue OR
258
+ the standard is too strict)
259
+ - A team consistently fails one letter (might indicate a process gap
260
+ worth surfacing, e.g., "always failing E means we don't have
261
+ estimation rigor")
262
+ - New bassclef artifact upstream of stories (e.g., when /use-case
263
+ lands, traceability rule adds use-case-line as MUST when present)
264
+
265
+ ## Closes
266
+
267
+ - bassclef #208 (paired with skill)
268
+ - Part of follow-up to iteration `2026-04-19e-persona-vpc-promotions`