@thebassclef/lite 1.0.4 → 1.1.1

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 (275) hide show
  1. package/dist/cli.cjs +298 -55
  2. package/dist/cli.js +298 -55
  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/agents/architect.md +70 -0
  7. package/dist/lite/.claude/agents/builder.md +114 -0
  8. package/dist/lite/.claude/agents/designer.md +156 -0
  9. package/dist/lite/.claude/agents/reviewer.md +88 -0
  10. package/dist/lite/.claude/hooks/bassclef-sync.sh +85 -27
  11. package/dist/lite/.claude/hooks/longrun-prep-compounding-axis-check.sh +492 -0
  12. package/dist/lite/.claude/hooks/longrun-prep-render-check.sh +236 -0
  13. package/dist/lite/.claude/hooks/persona-name-scrub-check.sh +105 -0
  14. package/dist/lite/.claude/hooks/skill-step-list-check.sh +171 -0
  15. package/dist/lite/.claude/luminaries/alan-cooper.md +170 -0
  16. package/dist/lite/.claude/luminaries/alistair-cockburn.md +140 -0
  17. package/dist/lite/.claude/luminaries/amazon-pr-faq.md +34 -0
  18. package/dist/lite/.claude/luminaries/andreas-zeller.md +74 -0
  19. package/dist/lite/.claude/luminaries/ash-maurya.md +121 -0
  20. package/dist/lite/.claude/luminaries/bill-buxton.md +210 -0
  21. package/dist/lite/.claude/luminaries/charles-sanders-peirce.md +150 -0
  22. package/dist/lite/.claude/luminaries/david-ogilvy.md +192 -0
  23. package/dist/lite/.claude/luminaries/don-norman.md +173 -0
  24. package/dist/lite/.claude/luminaries/edward-tufte.md +179 -0
  25. package/dist/lite/.claude/luminaries/eric-evans.md +160 -0
  26. package/dist/lite/.claude/luminaries/frederick-brooks.md +50 -0
  27. package/dist/lite/.claude/luminaries/gang-of-four.md +157 -0
  28. package/dist/lite/.claude/luminaries/glenford-myers.md +230 -0
  29. package/dist/lite/.claude/luminaries/hunt-thomas.md +115 -0
  30. package/dist/lite/.claude/luminaries/hyrum-wright.md +94 -0
  31. package/dist/lite/.claude/luminaries/jason-fried-dhh.md +46 -0
  32. package/dist/lite/.claude/luminaries/jesse-james-garrett.md +154 -0
  33. package/dist/lite/.claude/luminaries/john-ousterhout.md +94 -0
  34. package/dist/lite/.claude/luminaries/karl-popper.md +132 -0
  35. package/dist/lite/.claude/luminaries/kent-beck.md +168 -0
  36. package/dist/lite/.claude/luminaries/linus-torvalds.md +218 -0
  37. package/dist/lite/.claude/luminaries/martin-fowler.md +164 -0
  38. package/dist/lite/.claude/luminaries/michael-feathers.md +125 -0
  39. package/dist/lite/.claude/luminaries/michael-nygard.md +118 -0
  40. package/dist/lite/.claude/luminaries/robert-c-martin.md +164 -0
  41. package/dist/lite/.claude/luminaries/saltzer-schroeder.md +194 -0
  42. package/dist/lite/.claude/luminaries/sophia-prater.md +193 -0
  43. package/dist/lite/.claude/luminaries/stephen-toulmin.md +131 -0
  44. package/dist/lite/.claude/luminaries/tony-hoare.md +170 -0
  45. package/dist/lite/.claude/luminaries/vaughn-vernon.md +50 -0
  46. package/dist/lite/.claude/luminaries/w-edwards-deming.md +158 -0
  47. package/dist/lite/.claude/rules/accessor-library-discipline.md +110 -0
  48. package/dist/lite/.claude/rules/adr-discipline.md +96 -0
  49. package/dist/lite/.claude/rules/api-conventions.md +115 -0
  50. package/dist/lite/.claude/rules/artifact-ingestion.md +137 -0
  51. package/dist/lite/.claude/rules/assert-only-after-verify.md +111 -0
  52. package/dist/lite/.claude/rules/blocked-items.md +139 -0
  53. package/dist/lite/.claude/rules/bootstrap-pair-discipline.md +106 -0
  54. package/dist/lite/.claude/rules/branching.md +28 -0
  55. package/dist/lite/.claude/rules/cold-adopter-harness-discipline.md +93 -0
  56. package/dist/lite/.claude/rules/commit-conventions.md +22 -0
  57. package/dist/lite/.claude/rules/compounding-axis-fresh-analysis.md +173 -0
  58. package/dist/lite/.claude/rules/compounding-sequence-fresh-analysis.md +173 -0
  59. package/dist/lite/.claude/rules/context-engineering.md +155 -0
  60. package/dist/lite/.claude/rules/context-management.md +85 -0
  61. package/dist/lite/.claude/rules/defensive-bash.md +52 -0
  62. package/dist/lite/.claude/rules/deferred-actions.md +233 -0
  63. package/dist/lite/.claude/rules/destructive-operations.md +69 -0
  64. package/dist/lite/.claude/rules/diagnosis.md +38 -0
  65. package/dist/lite/.claude/rules/github-issue-flash-tweet.md +114 -0
  66. package/dist/lite/.claude/rules/guardrails.md +73 -0
  67. package/dist/lite/.claude/rules/hook-wire-on-author.md +77 -0
  68. package/dist/lite/.claude/rules/identifier-leak-prevention.md +73 -0
  69. package/dist/lite/.claude/rules/iteration-bet-brief-completeness.md +43 -0
  70. package/dist/lite/.claude/rules/lite-manifest-schema-change-discipline.md +79 -0
  71. package/dist/lite/.claude/rules/longrun-prep-plan-doc-compression.md +77 -0
  72. package/dist/lite/.claude/rules/loop-discipline.md +71 -0
  73. package/dist/lite/.claude/rules/manual-prod-approval.md +100 -0
  74. package/dist/lite/.claude/rules/marker-enrichment-discipline.md +72 -0
  75. package/dist/lite/.claude/rules/mobile-ephemeral-session.md +109 -0
  76. package/dist/lite/.claude/rules/new-dependency-check.md +44 -0
  77. package/dist/lite/.claude/rules/oo-ad-entry-point.md +95 -0
  78. package/dist/lite/.claude/rules/operator-facing-prose.md +177 -0
  79. package/dist/lite/.claude/rules/option-label-discipline.md +82 -0
  80. package/dist/lite/.claude/rules/pattern-annotation.md +83 -0
  81. package/dist/lite/.claude/rules/persona-name-leak-scrub.md +90 -0
  82. package/dist/lite/.claude/rules/plain-english-discipline.md +132 -0
  83. package/dist/lite/.claude/rules/plan-enumeration-needs-value-props.md +177 -0
  84. package/dist/lite/.claude/rules/pr-body-shape.md +195 -0
  85. package/dist/lite/.claude/rules/pr-strategy.md +142 -0
  86. package/dist/lite/.claude/rules/pr-title-shape.md +90 -0
  87. package/dist/lite/.claude/rules/prototype-workflow.md +53 -0
  88. package/dist/lite/.claude/rules/reserved-skill-names.md +103 -0
  89. package/dist/lite/.claude/rules/schema-management.md +42 -0
  90. package/dist/lite/.claude/rules/sdlc-gates.md +149 -0
  91. package/dist/lite/.claude/rules/security.md +37 -0
  92. package/dist/lite/.claude/rules/session-artifacts.md +236 -0
  93. package/dist/lite/.claude/rules/skill-composition-declarations.md +105 -0
  94. package/dist/lite/.claude/rules/skill-description-clarity.md +196 -0
  95. package/dist/lite/.claude/rules/skill-procedure-step-list.md +119 -0
  96. package/dist/lite/.claude/rules/sprint-prep-preset-picker.md +76 -0
  97. package/dist/lite/.claude/rules/state-schema-validation.md +156 -0
  98. package/dist/lite/.claude/rules/stuck-signal-diagnostic.md +111 -0
  99. package/dist/lite/.claude/rules/substrate-config-schema.md +85 -0
  100. package/dist/lite/.claude/rules/test-list-discipline.md +129 -0
  101. package/dist/lite/.claude/rules/test-sufficiency.md +186 -0
  102. package/dist/lite/.claude/rules/testing-tier-config.md +125 -0
  103. package/dist/lite/.claude/rules/testing.md +38 -0
  104. package/dist/lite/.claude/rules/turn-estimate-grounding.md +82 -0
  105. package/dist/lite/.claude/rules/visual-hierarchy.md +427 -0
  106. package/dist/lite/.claude/rules/we-dont-break-adopters.md +103 -0
  107. package/dist/lite/.claude/rules/whereami-load-bearing.md +184 -0
  108. package/dist/lite/.claude/rules/writing-craft-discipline.md +72 -0
  109. package/dist/lite/.claude/rules/wu-sequencing-compounds.md +119 -0
  110. package/dist/lite/.claude/skills/build/SKILL.md +640 -0
  111. package/dist/lite/.claude/skills/chronicle/SKILL.md +55 -0
  112. package/dist/lite/.claude/skills/clean-artifacts/SKILL.md +249 -0
  113. package/dist/lite/.claude/skills/decompose/SKILL.md +280 -0
  114. package/dist/lite/.claude/skills/diagnose/SKILL.md +297 -0
  115. package/dist/lite/.claude/skills/feynman/SKILL.md +90 -0
  116. package/dist/lite/.claude/skills/howdoi/SKILL.md +105 -0
  117. package/dist/lite/.claude/skills/ia-model/SKILL.md +108 -0
  118. package/dist/lite/.claude/skills/interaction-design/SKILL.md +112 -0
  119. package/dist/lite/.claude/skills/interpret-input/SKILL.md +180 -0
  120. package/dist/lite/.claude/skills/journal/SKILL.md +209 -0
  121. package/dist/lite/.claude/skills/kiss/SKILL.md +449 -0
  122. package/dist/lite/.claude/skills/launch/SKILL.md +915 -0
  123. package/dist/lite/.claude/skills/lean-canvas/SKILL.md +332 -0
  124. package/dist/lite/.claude/skills/longrun/SKILL.md +512 -0
  125. package/dist/lite/.claude/skills/luminary/SKILL.md +481 -0
  126. package/dist/lite/.claude/skills/ogilvy-writing-audit/SKILL.md +177 -0
  127. package/dist/lite/.claude/skills/onboard-repo/SKILL.md +1640 -0
  128. package/dist/lite/.claude/skills/pattern-review/SKILL.md +99 -0
  129. package/dist/lite/.claude/skills/personas/SKILL.md +207 -0
  130. package/dist/lite/.claude/skills/promote/SKILL.md +283 -0
  131. package/dist/lite/.claude/skills/requirement/SKILL.md +98 -0
  132. package/dist/lite/.claude/skills/retro/SKILL.md +117 -0
  133. package/dist/lite/.claude/skills/riff/SKILL.md +114 -0
  134. package/dist/lite/.claude/skills/roadmap-reconcile/SKILL.md +163 -0
  135. package/dist/lite/.claude/skills/session-end/SKILL.md +309 -0
  136. package/dist/lite/.claude/skills/session-log/SKILL.md +299 -0
  137. package/dist/lite/.claude/skills/skills/SKILL.md +228 -0
  138. package/dist/lite/.claude/skills/spec/SKILL.md +105 -0
  139. package/dist/lite/.claude/skills/sprint/SKILL.md +418 -0
  140. package/dist/lite/.claude/skills/stage/SKILL.md +384 -0
  141. package/dist/lite/.claude/skills/state-a-problem/SKILL.md +185 -0
  142. package/dist/lite/.claude/skills/temperance/SKILL.md +108 -0
  143. package/dist/lite/.claude/skills/use-case/SKILL.md +417 -0
  144. package/dist/lite/.claude/skills/user-stories/SKILL.md +268 -0
  145. package/dist/lite/.claude/skills/value-prop/SKILL.md +251 -0
  146. package/dist/lite/.claude/skills/verify/SKILL.md +160 -0
  147. package/dist/lite/.claude/skills/visual-review/SKILL.md +503 -0
  148. package/dist/lite/.claude/skills/whats-the-plan/SKILL.md +202 -0
  149. package/dist/lite/.claude/skills/whereami/SKILL.md +307 -0
  150. package/dist/lite/AGENTS.md +79 -0
  151. package/dist/lite/CLAUDE-lite.md +85 -0
  152. package/dist/lite/CODE_OF_CONDUCT.md +28 -0
  153. package/dist/lite/CONTRIBUTING.md +177 -0
  154. package/dist/lite/README.md +173 -0
  155. package/dist/lite/SECURITY.md +19 -0
  156. package/dist/lite/architecture/decisions/ADR-029-release-pipeline.md +79 -0
  157. package/dist/lite/architecture/decisions/ADR-031-non-breaking-changes-adopter-discipline.md +139 -0
  158. package/dist/lite/architecture/decisions/ADR-032-adopter-sync-dispatcher-architecture.md +192 -0
  159. package/dist/lite/architecture/decisions/ADR-039-release-tagging-scheme.md +145 -0
  160. package/dist/lite/architecture/decisions/ADR-040-planning-skill-vocabulary-and-lite-profile.md +155 -0
  161. package/dist/lite/architecture/decisions/ADR-044-unified-skill-body-template.md +162 -0
  162. package/dist/lite/lib/clean-artifacts-sweep.sh +112 -0
  163. package/dist/lite/lib/code-comment-discipline.sh +144 -0
  164. package/dist/lite/lib/composer-preflight.sh +459 -0
  165. package/dist/lite/lib/deferred-actions.sh +146 -0
  166. package/dist/lite/lib/hook-header-parser.sh +61 -0
  167. package/dist/lite/lib/hook-heartbeat.sh +152 -0
  168. package/dist/lite/lib/hook-inject.sh +255 -0
  169. package/dist/lite/lib/hook-installer.sh +195 -0
  170. package/dist/lite/lib/luminary-pick.sh +96 -0
  171. package/dist/lite/lib/output-discipline.sh +143 -0
  172. package/dist/lite/lib/prose-scan-boundary.sh +171 -0
  173. package/dist/lite/lib/rewrite-check.sh +214 -0
  174. package/dist/lite/lib/session-rescue.sh +151 -0
  175. package/dist/lite/lib/source-graph-walker.sh +277 -0
  176. package/dist/lite/lib/state.sh +1372 -0
  177. package/dist/lite/lib/telemetry.sh +205 -0
  178. package/dist/lite/lib/tier-check.sh +187 -0
  179. package/dist/lite/lib/tier-dependency-audit.sh +1088 -0
  180. package/dist/lite/presence/install/bassclef-hook-connect.sh +178 -0
  181. package/dist/lite/presence/install/bassclef-sync.dispatcher.template.sh +841 -0
  182. package/dist/lite/presence/install/bassclef-sync.template.sh +2278 -0
  183. package/dist/lite/presence/install/schedule-auto-save.cron.sh +88 -0
  184. package/dist/lite/presence/install/schedule-auto-save.taskscheduler.md +122 -0
  185. package/dist/lite/scripts/aggregate-telemetry.sh +217 -0
  186. package/dist/lite/scripts/analyze-tier-dependencies.sh +239 -0
  187. package/dist/lite/scripts/generate-lite-manifest.sh +505 -0
  188. package/dist/lite/scripts/generate-tier-manifest.sh +28 -0
  189. package/dist/lite/scripts/intent-drift-check.sh +456 -0
  190. package/dist/lite/scripts/lite-manifest-drift-check.sh +146 -0
  191. package/dist/lite/scripts/render-lite-manifest-doc.sh +150 -0
  192. package/dist/lite/standards/adr-template.md +86 -0
  193. package/dist/lite/standards/api-conventions/nextjs.md +84 -0
  194. package/dist/lite/standards/artifact-composition.md +209 -0
  195. package/dist/lite/standards/bash-hook-safety.md +246 -0
  196. package/dist/lite/standards/bassclef-configs-schema.md +232 -0
  197. package/dist/lite/standards/bassclef-evolution.md +143 -0
  198. package/dist/lite/standards/bassclef-internal-jargon.md +244 -0
  199. package/dist/lite/standards/bassclef-managed-sentinel.md +96 -0
  200. package/dist/lite/standards/bassclef-source-config.md +228 -0
  201. package/dist/lite/standards/branch-stacking.md +408 -0
  202. package/dist/lite/standards/code-safety-principles.md +176 -0
  203. package/dist/lite/standards/composer-prerequisites.md +155 -0
  204. package/dist/lite/standards/deferred-actions-schema.md +204 -0
  205. package/dist/lite/standards/dependency-discipline/cargo.md +39 -0
  206. package/dist/lite/standards/dependency-discipline/gem.md +43 -0
  207. package/dist/lite/standards/dependency-discipline/go-mod.md +41 -0
  208. package/dist/lite/standards/dependency-discipline/npm.md +42 -0
  209. package/dist/lite/standards/dependency-discipline/pip.md +42 -0
  210. package/dist/lite/standards/deployment-topology/ec2-tailscale.md +225 -0
  211. package/dist/lite/standards/deployment-topology.md +69 -0
  212. package/dist/lite/standards/docs-sync-allowlist.md +76 -0
  213. package/dist/lite/standards/domain-and-dns.md +145 -0
  214. package/dist/lite/standards/frontend-stack.md +67 -0
  215. package/dist/lite/standards/frontmatter-schema.md +154 -0
  216. package/dist/lite/standards/graceful-exit.md +227 -0
  217. package/dist/lite/standards/hook-idempotency.md +102 -0
  218. package/dist/lite/standards/hook-injection-discipline.md +202 -0
  219. package/dist/lite/standards/hook-install-class.md +215 -0
  220. package/dist/lite/standards/input-handler-interface.md +152 -0
  221. package/dist/lite/standards/lite-manifest-schema-changes.md +180 -0
  222. package/dist/lite/standards/lite-manifest.json +2797 -0
  223. package/dist/lite/standards/luminary-matching.md +105 -0
  224. package/dist/lite/standards/luminary-problem-patterns.md +481 -0
  225. package/dist/lite/standards/migration-discipline/active-record.md +50 -0
  226. package/dist/lite/standards/migration-discipline/alembic.md +43 -0
  227. package/dist/lite/standards/migration-discipline/gorm.md +50 -0
  228. package/dist/lite/standards/migration-discipline/prisma.md +53 -0
  229. package/dist/lite/standards/migration-discipline/sqlalchemy.md +51 -0
  230. package/dist/lite/standards/mobile-ephemeral-session.md +167 -0
  231. package/dist/lite/standards/model-routing-discipline.md +160 -0
  232. package/dist/lite/standards/ogilvy-writing-rules.md +225 -0
  233. package/dist/lite/standards/opener-discipline.md +96 -0
  234. package/dist/lite/standards/operator-facing-prose-discipline.md +201 -0
  235. package/dist/lite/standards/persona-schema.md +229 -0
  236. package/dist/lite/standards/pluggable-luminaries.md +323 -0
  237. package/dist/lite/standards/pr-body-discipline.md +115 -0
  238. package/dist/lite/standards/preview-state-schema.md +189 -0
  239. package/dist/lite/standards/project-directory-layout.md +276 -0
  240. package/dist/lite/standards/release-tagging.md +137 -0
  241. package/dist/lite/standards/reserved-skill-names.md +120 -0
  242. package/dist/lite/standards/scannable-multi-option-output.md +265 -0
  243. package/dist/lite/standards/sdlc-compliance.md +286 -0
  244. package/dist/lite/standards/sdlc-gates/typescript.md +57 -0
  245. package/dist/lite/standards/secrets-lifecycle.md +210 -0
  246. package/dist/lite/standards/security-scanner-adapter.md +145 -0
  247. package/dist/lite/standards/session-board.md +256 -0
  248. package/dist/lite/standards/skill-output-discipline.md +121 -0
  249. package/dist/lite/standards/state-spine-contract.md +255 -0
  250. package/dist/lite/standards/state-spine.md +511 -0
  251. package/dist/lite/standards/steering-hints/kiss-words.md +11 -0
  252. package/dist/lite/standards/substrate-config-schema.md +267 -0
  253. package/dist/lite/standards/tech-stack-config.md +109 -0
  254. package/dist/lite/standards/tier-dependency-analysis.md +167 -0
  255. package/dist/lite/standards/tier-runtime-deps/lite.md +57 -0
  256. package/dist/lite/standards/tier-tag-schema.md +155 -0
  257. package/dist/lite/standards/two-layer-config.md +99 -0
  258. package/dist/lite/standards/use-case-format.md +292 -0
  259. package/dist/lite/standards/user-story-invest.md +268 -0
  260. package/dist/lite/standards/velocity-and-appetite.md +229 -0
  261. package/dist/lite/standards/voice-input-pattern.md +119 -0
  262. package/dist/lite/standards/whereami-schema.md +301 -0
  263. package/dist/lite/standards/worktree-management.md +211 -0
  264. package/dist/lite/standards/writing-guide.md +213 -0
  265. package/dist/lite/templates/chronicle-template.md +75 -0
  266. package/dist/lite/templates/deferred-action-template.md +45 -0
  267. package/dist/lite/templates/memory-proposal-template.md +77 -0
  268. package/dist/lite/templates/persona-template.md +200 -0
  269. package/dist/lite/templates/pr-faq.md +45 -0
  270. package/dist/lite/templates/secret-rotation-template.md +162 -0
  271. package/dist/lite/templates/spec-template.md +131 -0
  272. package/dist/lite/templates/use-case-template.md +194 -0
  273. package/dist/lite/templates/user-story-template.md +107 -0
  274. package/dist/lite/templates/whereami-template.md +101 -0
  275. package/package.json +12 -5
@@ -0,0 +1,154 @@
1
+ ---
2
+ tier: lite
3
+ description: Schema for the YAML frontmatter that opens substrate files — .claude/skills/<name>/SKILL.md and .claude/rules/<name>.md.
4
+ ---
5
+
6
+ # Frontmatter Schema
7
+
8
+ Schema for the YAML frontmatter that opens substrate files — `.claude/skills/<name>/SKILL.md` and `.claude/rules/<name>.md`. Validated by `.claude/hooks/substrate-clarity-gate.sh` on Edit / Write (bassclef#862 Gap 1; WU-3 of bet 2026-06-18a).
9
+
10
+ Without write-time validation, `tech_stack_match:` declarations from WU-8 + WU-9, future `composes_with:` + `depends_on:` declarations from WU-15, and ordinary skill description fields ship with typos or missing required fields and only surface in adopter sessions. This schema closes the gap at the authoring surface.
11
+
12
+ ## When the hook fires
13
+
14
+ On any Edit / Write to:
15
+
16
+ - `.claude/skills/<name>/SKILL.md`
17
+ - `.claude/rules/<name>.md`
18
+
19
+ Other substrate surfaces (luminaries, chronicles, iteration goals, decompositions, journal entries) keep their existing validation rules and do not gain frontmatter-schema enforcement in WU-3.
20
+
21
+ ## What the hook validates
22
+
23
+ Three checks fire in order. The first to fail returns the exit code; further checks do not run.
24
+
25
+ | Check | Outcome | Exit |
26
+ |---|---|---|
27
+ | Frontmatter present at top of file (starts with `---`) | Required for files NOT on allowlist; missing → BLOCK | 2 |
28
+ | YAML parses cleanly | Malformed YAML → BLOCK | 2 |
29
+ | Required fields present + non-empty | Missing required → BLOCK | 2 |
30
+ | All field names are recognized | Unknown field → WARN; written to stderr | 0 |
31
+
32
+ The hook continues running existing checks (description length, INSTEAD-block, jargon ladder) after the schema pass.
33
+
34
+ ## Skill schema
35
+
36
+ Frontmatter required for every `.claude/skills/<name>/SKILL.md`.
37
+
38
+ **Required fields:**
39
+
40
+ - `name` — the skill's slash-command alias. Lowercase, hyphens, no spaces.
41
+ - `description` — operator-readable one-liner. Length + verb-first + plain-language checks per `.claude/rules/skill-description-clarity.md`.
42
+
43
+ **Recognized optional fields:**
44
+
45
+ | Field | Used by | Type |
46
+ |---|---|---|
47
+ | `args` | skill body (operator-visible args reference) | string |
48
+ | `authoring_luminaries` | skills that declare which luminary lenses shaped their design; picked via `/extract-intent` Voyage matching or `/pick-luminaries` | object (primary: list, supporting: list) |
49
+ | `composes_baseline` | `/launch`, `/riff-prototypes`, `/frontend-design`, `/visual-review` | list[string] (luminary slugs) |
50
+ | `composes_with` | future — WU-15 (bassclef#862 Gap 3) | list[string] (skill slugs) |
51
+ | `depends_on` | future — WU-15 (bassclef#862 Gap 3) | list[string] (skill slugs) |
52
+ | `deprecated` | retirement metadata | bool |
53
+ | `deprecated_decision` | retirement metadata | string |
54
+ | `deprecated_in_favor_of` | retirement metadata | string |
55
+ | `disable_friction_check` | `/promote`-skip discipline | bool |
56
+ | `disable_model_invocation` | Claude Code harness routing | bool |
57
+ | `maturity` | skills declaring lifecycle stage — `alpha`, `beta`, `stable`, `hardened` per ADR-043 | string |
58
+ | `model_tier` | per-agent LLM tier routing | string |
59
+ | `modes` | mode-bearing skills (e.g., `/longrun`) | list[string] |
60
+ | `no_user_modes` | mode-bearing-skill opt-out | bool |
61
+ | `prereqs` | runtime prerequisites — richer shape per bassclef-web#94 | object (see prereqs schema below) |
62
+ | `requires` | runtime prerequisites — older simpler shape | object (cli + network) |
63
+ | `reserved_name_override` | reserved-name-shadow allow path | string |
64
+ | `sizes` | size-bearing skills (e.g., `/value-prop`) | list[string] |
65
+ | `tech_stack_match` | future — stack-bound skills | object |
66
+ | `tiers` | tier-bearing skills (e.g., `/shape`) | list[string] |
67
+ | `user_invocable` | Claude Code harness routing | bool |
68
+
69
+ Unknown fields surface as WARN — adopter-authored fields might appear here; the warning surfaces the new field but does not block.
70
+
71
+ ## Prereqs schema (bassclef-web#94)
72
+
73
+ The `prereqs:` block splits runtime prerequisites into required + optional buckets so docs sites can render a signifier per bucket. Skills without a `prereqs:` block still work — docs render a generic "check the skill body" fallback.
74
+
75
+ ```yaml
76
+ prereqs:
77
+ required:
78
+ cli: [git, gh]
79
+ env: [ANTHROPIC_API_KEY]
80
+ network: true
81
+ optional:
82
+ cli: [jq]
83
+ env: [VOYAGE_API_KEY]
84
+ note: "VOYAGE_API_KEY enables semantic ranking; grep-only fallback works without."
85
+ ```
86
+
87
+ Design rules per ticket:
88
+
89
+ - Optional. Skills without the block still work.
90
+ - 4-8 lines typical; 12 lines max. Docs sites render as a collapsed `<details>` block by default (progressive disclosure per Cooper).
91
+ - Uses tool names adopters already know — `git`, `gh`, `python3`, `jq`, `curl`. No bassclef vocabulary.
92
+ - Zero prereqs beyond "you have Claude Code running" — skip the block entirely.
93
+
94
+ Relationship to `requires:`:
95
+
96
+ - `requires:` is the older simpler shape (cli + network only). Existing skills that use it keep working.
97
+ - `prereqs:` is the newer richer shape (required / optional split + env vars + note). Preferred for new lite skills.
98
+ - No migration required. Both fields are recognized. Adopters pick per skill.
99
+
100
+ Docs render logic is out of scope for bassclef — docs sites (Fumadocs or similar) read the manifest and render the signifier block. Bassclef's job is to define the schema and apply it as an exemplar.
101
+
102
+ ## Rule schema
103
+
104
+ Frontmatter is OPTIONAL for `.claude/rules/<name>.md`. Many existing rules carry no frontmatter and start with the body directly. When frontmatter IS present, it must conform.
105
+
106
+ **Required fields (when frontmatter is present):**
107
+
108
+ - `description` — one-line operator-readable description of what the rule enforces.
109
+
110
+ **Recognized optional fields:**
111
+
112
+ | Field | Used by | Type |
113
+ |---|---|---|
114
+ | `composes_with` | future — WU-15 (bassclef#862 Gap 3) | list[string] |
115
+ | `depends_on` | future — WU-15 (bassclef#862 Gap 3) | list[string] |
116
+ | `globs` | rule-routing (which file paths the rule applies to) | list[string] |
117
+ | `model_tier` | per-rule LLM tier routing | string |
118
+ | `tech_stack_match` | per-stack rule routing (WU-8 + WU-9; future Phase 2 work) | object — admits `lang`, `frontend`, `backend`, `orm`, `pkg_manager`, `deploy` per `standards/tech-stack-config.md` |
119
+
120
+ Unknown fields surface as WARN.
121
+
122
+ Rules with NO frontmatter pass through validation entirely (the schema applies only when frontmatter is present). Authors adding frontmatter to legacy rules pick the required + optional fields as appropriate.
123
+
124
+ ## Allowlist baseline
125
+
126
+ `.claude/hooks/substrate-frontmatter-allowlist.txt` grandfathers files that fail validation today with a 60-day grace window. Same shape as `testing-tier-enforce-allowlist.txt` per bassclef#1037.
127
+
128
+ Format: `<repo-relative-path>|<grace-until ISO 8601>`.
129
+
130
+ At WU-3 ship, the allowlist is empty — current files (75 skills + 19 rules with frontmatter + 33 rules without) all pass. The file ships with its header explaining the shape so future violators can be added with grace if/when they surface.
131
+
132
+ ## What this schema does NOT do
133
+
134
+ - Does not enforce field VALUE shape beyond presence + non-empty. `tech_stack_match` content is not validated against the `tech-stack.schema.json` ranges shipped in WU-2. That richer validation lives in the consumer-side hooks that USE the field (future Phase 3 work).
135
+ - Does not require frontmatter on legacy rules without one. 33 rules ship with no frontmatter today; the schema applies only when frontmatter IS present.
136
+ - Does not validate luminary, chronicle, iteration-bet, decomposition, or journal-entry frontmatter. Those surfaces have their own checks in the same hook.
137
+ - Does not catch description-quality issues — that's the existing `.claude/rules/skill-description-clarity.md` rule.
138
+
139
+ ## Override path
140
+
141
+ `SKIP_SUBSTRATE_CLARITY=1` — same env var as the rest of the hook's checks. Logged via trace-helper. Use sparingly.
142
+
143
+ ## Refs
144
+
145
+ - bassclef#862 Gap 1 — this schema closes it.
146
+ - bassclef#382 — substrate-clarity-gate hook (parent of this validation pass).
147
+ - WU-3 of bet `docs/iteration-bets/2026-06-18a-public-adopter-leverage-longrun.md` — ships the validation.
148
+ - Sister WU-15 (bassclef#862 Gap 3) — adds `composes_with` + `depends_on` field schemas + targets-exist validation.
149
+ - Pairs with `standards/tech-stack-config.md` (WU-2) — tech_stack_match values map to that schema's enums.
150
+ - Sister discipline: `.claude/rules/testing-tier-config.md` (bassclef#1037) — allowlist baseline pattern.
151
+
152
+ ## Retirement condition
153
+
154
+ This schema retires only if bassclef migrates off YAML frontmatter as a substrate convention. Field set evolves as new substrate fields ship (e.g., WU-15 introduces composes_with + depends_on into the recognized set).
@@ -0,0 +1,227 @@
1
+ ---
2
+ tier: lite
3
+ description: Defines how autonomous agent sessions save state, handle interruptions, and enable the next session to resume without data loss or ambiguity.
4
+ ---
5
+
6
+ # Graceful Exit + Checkpointing Standard
7
+
8
+ Defines how autonomous agent sessions save state, handle interruptions, and
9
+ enable the next session to resume without data loss or ambiguity.
10
+
11
+ This standard applies in all configurations. In orchestrator-gated mode it is
12
+ enforced. In operator-gated mode it is advisory — the human is steering, but
13
+ the checkpoint format is still useful.
14
+
15
+ ---
16
+
17
+ ## Exit Conditions
18
+
19
+ Every agent must recognize the following conditions and respond with the
20
+ prescribed action. Do not finish the current task before responding — respond
21
+ immediately when the condition is detected.
22
+
23
+ | Condition | Trigger | Required action |
24
+ |-----------|---------|----------------|
25
+ | Time budget exhausted | Turn count or duration reaches iteration ceiling | Save state, report progress, write checkpoint, end gracefully |
26
+ | Budget limit reached | Cost ceiling hit (from cost-governance.md) | Save state, surface cost delta, write checkpoint, end |
27
+ | Ambiguity unresolvable | Agent cannot proceed without a human decision that has not been delegated | Save state, write checkpoint with blocker stated, escalate to human |
28
+ | Blocked by external dependency | A required artifact, credential, service, or decision from outside the session is missing | Save state, log blocker in checkpoint, end — do NOT work around |
29
+ | Error after 3 diagnosis attempts | Three Is/Is Not + Five Whys cycles have not resolved the failure | Save state, escalate to Architect (Builder) or human, end |
30
+ | User interrupts | Human interrupts the session at any point | Save state immediately, write checkpoint, report what is done |
31
+ | Session idle timeout | Session has been inactive (platform-level) | Save state before context is lost |
32
+ | Context window pressure ≥ 70% | Active context fills to 70% of limit | Write checkpoint NOW, let compaction run, re-read survival kit after |
33
+
34
+ ### What "save state" means
35
+
36
+ 1. Commit any in-progress work (even if incomplete — use `chore: wip` if needed)
37
+ 2. Clean up worktrees (see below)
38
+ 3. Write or update `.claude/CHECKPOINT.md` (see format below)
39
+ 4. Update `docs/whereami.md` to reflect current reality
40
+ 5. Push if network is available
41
+
42
+ In that order. Steps 2-3 (worktree cleanup + checkpoint) must complete
43
+ before end of session. If steps 4-5 fail, the checkpoint file alone is
44
+ sufficient for recovery.
45
+
46
+ ### Worktree cleanup (MUST — if any worktrees exist)
47
+
48
+ If the agent created or used worktrees during this session, clean them up
49
+ before writing the checkpoint. See `standards/worktree-management.md` for
50
+ the full protocol. Summary:
51
+
52
+ 1. For each worktree: commit work, push branch, remove worktree
53
+ 2. If removal fails (dirty state, locked files): note in checkpoint
54
+ 3. Never leave the session with active worktrees if avoidable
55
+ 4. The next session's pre-session audit will catch anything missed
56
+
57
+ This is a MUST gate because stale worktrees cause branch locks, disk
58
+ waste, and confusing state for the next session.
59
+
60
+ ---
61
+
62
+ ## Checkpoint Format
63
+
64
+ **Location**: `.claude/CHECKPOINT.md`
65
+
66
+ This file is overwritten on every checkpoint. It contains the latest state
67
+ only — it is not a log. The chronicle is the log.
68
+
69
+ ```markdown
70
+ # Checkpoint
71
+
72
+ written_at: YYYY-MM-DDTHH:MM:SSZ
73
+ session_id: (same as chronicle entry if one exists)
74
+ exit_reason: (one of: appetite_exhausted | budget_limit | ambiguity | blocked |
75
+ error_escalation | user_interrupt | idle_timeout | context_pressure |
76
+ role_transition | phase_transition | periodic)
77
+
78
+ ---
79
+
80
+ ## Agent state
81
+
82
+ active_agent: Builder
83
+ task: Implementing SearchBar component per spec at docs/specs/crm.md#search
84
+ status: in_progress # done | in_progress | blocked
85
+
86
+ ### Done this session
87
+ - Implemented DealCard component (commit abc1234)
88
+ - Added unit tests for DealCard (commit def5678)
89
+ - Updated design tokens for card treatment (commit ghi9012)
90
+
91
+ ### In progress
92
+ - SearchBar component — skeleton written, filter logic incomplete
93
+ - File: src/components/SearchBar.tsx (partially complete)
94
+ - Blocking decision: none
95
+ - Estimated remaining: ~15 turns
96
+
97
+ ### Blocked
98
+ (none — or state the blocker)
99
+
100
+ ### Artifacts produced this session
101
+ | Artifact | Path | Commit |
102
+ |----------|------|--------|
103
+ | DealCard component | src/components/DealCard.tsx | abc1234 |
104
+ | DealCard tests | src/components/DealCard.test.tsx | def5678 |
105
+ | Design tokens | docs/design/tokens/card.md | ghi9012 |
106
+
107
+ ### Decision authority exercised
108
+ - Accepted ADR-009 (component library choice) — no violations
109
+ - Spec interpretation: SearchBar debounce = 300ms (inferred from interaction-design)
110
+
111
+ ---
112
+
113
+ ## Iteration state
114
+
115
+ iteration_bet: docs/iteration-bets/2026-04-07-crm-build.md
116
+ iteration_phase: Construction
117
+ gate_checklist:
118
+ - [x] Spec exists and is referenced
119
+ - [x] GitHub issue open (#41)
120
+ - [x] Branch stack manifest written
121
+ - [ ] All tasks complete
122
+ - [ ] Reviewer sign-off
123
+ - [ ] Designer sign-off
124
+
125
+ risk_register_changes: none this session
126
+
127
+ budget:
128
+ turns_consumed: 14
129
+ turns_remaining: ~6 (estimate)
130
+ duration: ~22 minutes
131
+
132
+ ---
133
+
134
+ ## Handoff state
135
+
136
+ next_agent: Builder (resume) | Reviewer (if all tasks done)
137
+ resume_task: Complete SearchBar filter logic, then /verify, then open PR
138
+
139
+ ### Survival kit (what the next agent MUST read before starting)
140
+ 1. docs/iteration-bets/2026-04-07-crm-build.md — scope + acceptance criteria
141
+ 2. docs/specs/crm.md — current spec
142
+ 3. strategy/agent-choreography.md Section 9 — MUST gates
143
+ 4. docs/whereami.md — current phase and subsystem status
144
+ 5. docs/branch-stacks/2026-04-07-crm-stack.md — branch dependencies
145
+ 6. .claude/agents/builder.md — luminaries + checkpointing rules
146
+
147
+ ### Context the next agent needs
148
+ - SearchBar is branch `feature/41-crm-search`, PR not yet open
149
+ - DealCard PR is open (#38), awaiting Reviewer
150
+ - Design token values are in docs/design/tokens/card.md — read before building
151
+
152
+ ### Blockers for the next agent
153
+ (none — or state them clearly)
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Checkpoint Triggers
159
+
160
+ Checkpoints fire in two modes: event-driven and periodic.
161
+
162
+ ### Event-driven triggers (fire immediately when the event occurs)
163
+
164
+ | Event | Who triggers |
165
+ |-------|-------------|
166
+ | Any exit condition (see table above) | Active agent |
167
+ | Role transition (any agent hands off to another) | Outgoing agent, before signaling completion |
168
+ | Phase transition (Inception → Elaboration, etc.) | Orchestrator, after gate validation |
169
+ | Context pressure ≥ 70% | Active agent (self-monitored) |
170
+
171
+ ### Periodic trigger
172
+
173
+ Every 20 turns (configurable in substrate.config.md as `checkpoint_interval`).
174
+ If no `checkpoint_interval` is set, default is 20 turns.
175
+
176
+ The periodic trigger exists because event-driven triggers rely on the agent
177
+ recognizing the event. Long tasks can drift without triggering any event.
178
+ The periodic checkpoint ensures a recovery point always exists within 20 turns.
179
+
180
+ ### What to skip
181
+
182
+ Do NOT write a checkpoint for trivial tool calls (read, grep, glob). A
183
+ checkpoint is a meaningful state save — it fires at the granularity of
184
+ "completed or partially completed a task," not at every action.
185
+
186
+ ---
187
+
188
+ ## Recovery Protocol
189
+
190
+ When a session starts after a previous session ended abnormally (or was
191
+ interrupted), the Orchestrator (or the operator in operator-gated mode) checks for a
192
+ checkpoint before scheduling any work:
193
+
194
+ 1. Check if `.claude/CHECKPOINT.md` exists
195
+ 2. If it exists: read it, read `docs/whereami.md`, reconcile any gaps
196
+ 3. Present to operator:
197
+ ```
198
+ Last session stopped: [exit_reason] at [written_at]
199
+ Active agent was: [agent] working on [task]
200
+ Done: [list from checkpoint]
201
+ In progress: [list from checkpoint]
202
+ Blocked: [list from checkpoint]
203
+ Resume from here, or restart from last clean gate?
204
+ ```
205
+ 4. On resume: activate the agent named in `next_agent`, point it at the
206
+ survival kit files listed in the checkpoint
207
+ 5. On restart: operator decides what to keep. Delete checkpoint after restart
208
+ to avoid stale state
209
+
210
+ The checkpoint is advisory — the operator always decides whether to resume
211
+ or restart. Never resume silently without presenting the checkpoint summary.
212
+
213
+ ---
214
+
215
+ ## Relationship to Other Standards
216
+
217
+ | Standard | Relationship |
218
+ |----------|-------------|
219
+ | `strategy/agent-choreography.md` | Sections 10 and 12a define when to checkpoint; this standard defines how |
220
+ | `.claude/rules/guardrails.md` | Exit conditions in guardrails reference this standard for protocol |
221
+ | `.claude/skills/session-end/SKILL.md` | Session-end reads the checkpoint if present; incorporates it into the chronicle |
222
+ | `standards/branch-stacking.md` | Branch stack manifest is part of the survival kit for Construction checkpoints |
223
+ | `docs/whereami.md` | Updated at every checkpoint; the checkpoint and whereami are complementary |
224
+
225
+ The checkpoint captures **agent-level state** (what this agent was doing, what's
226
+ done, what's next). Phase-state captures **project-level state** (phase, iteration,
227
+ subsystem maturity). Both must be current for a clean recovery.
@@ -0,0 +1,102 @@
1
+ ---
2
+ tier: lite
3
+ description: Hooks must be idempotent. If a hook fails partway and reruns, it must not duplicate work, generate false warnings, or corrupt state.
4
+ ---
5
+
6
+ # Hook Idempotency Standard
7
+
8
+ ## Principle
9
+
10
+ Hooks must be idempotent. If a hook fails partway and reruns, it must
11
+ not duplicate work, generate false warnings, or corrupt state.
12
+
13
+ ## Rules
14
+
15
+ ### 1. No write-then-detect
16
+
17
+ A hook must not write state and then check for that state in the same
18
+ execution. The classic violation:
19
+
20
+ ```bash
21
+ # BAD: writes SESSION_LOCK, then detects it and warns "another session active"
22
+ echo "$(date)" > .claude/SESSION_LOCK
23
+ if [ -f .claude/SESSION_LOCK ]; then
24
+ echo "WARNING: another session may be active"
25
+ fi
26
+ ```
27
+
28
+ Fix: check BEFORE writing, or use a lock acquisition pattern:
29
+
30
+ ```bash
31
+ # GOOD: check first, then write
32
+ if [ -f .claude/SESSION_LOCK ]; then
33
+ echo "WARNING: another session may be active"
34
+ else
35
+ echo "$(date)" > .claude/SESSION_LOCK
36
+ fi
37
+ ```
38
+
39
+ ### 2. Append with dedup
40
+
41
+ Hooks that append to files (trace logs, artifact lists) must check
42
+ whether the content already exists:
43
+
44
+ ```bash
45
+ # BAD: appends every run, creating duplicates on retry
46
+ echo "gate: temperance" >> docs/sdlc-traces/today.log
47
+
48
+ # GOOD: check before appending
49
+ grep -q "gate: temperance" docs/sdlc-traces/today.log 2>/dev/null || \
50
+ echo "gate: temperance" >> docs/sdlc-traces/today.log
51
+ ```
52
+
53
+ ### 3. Create-if-missing, not create-always
54
+
55
+ ```bash
56
+ # BAD: overwrites existing file on every run
57
+ echo "# Risk Register" > docs/risk-register.md
58
+
59
+ # GOOD: only create if missing
60
+ [ -f docs/risk-register.md ] || echo "# Risk Register" > docs/risk-register.md
61
+ ```
62
+
63
+ ### 4. Exit codes are meaningful
64
+
65
+ - Exit 0: hook succeeded, continue
66
+ - Exit non-zero: hook failed, behavior depends on hook type
67
+ - PreToolUse hooks: non-zero blocks the tool call
68
+ - PostToolUse/Stop hooks: non-zero is logged but doesn't block
69
+
70
+ Never swallow errors silently:
71
+
72
+ ```bash
73
+ # BAD: hides failures
74
+ some_command 2>/dev/null || true
75
+
76
+ # GOOD: log the failure, then decide whether to continue
77
+ some_command 2>&1 || echo "WARNING: some_command failed (non-blocking)"
78
+ ```
79
+
80
+ ### 5. Timeout awareness
81
+
82
+ Stop hooks have limited execution time. If your Stop hook does
83
+ network operations (git push, API calls), put them AFTER local
84
+ operations so that local artifacts are saved even if the hook times out.
85
+
86
+ ```bash
87
+ # Phase 1: Local (always completes)
88
+ write_chronicle
89
+ update_memory
90
+ remove_session_lock
91
+
92
+ # Phase 2: Remote (may timeout — that's OK)
93
+ git push || echo "WARNING: push failed — run manually"
94
+ push_to_gdoc || echo "WARNING: Google Doc push skipped"
95
+ ```
96
+
97
+ Minimum recommended Stop hook timeout: 30 seconds.
98
+
99
+ ## Verification
100
+
101
+ The `/substrate-check` skill includes a hook idempotency spot-check (step 8)
102
+ that scans for common violations of these rules.