@thebassclef/lite 1.0.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/dist/cli.cjs +65 -0
  2. package/dist/cli.js +65 -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/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 +1 -1
@@ -0,0 +1,301 @@
1
+ ---
2
+ tier: lite
3
+ description: docs/whereami.md is the authoritative project-state snapshot in any bassclef-substrate repo.
4
+ ---
5
+
6
+ # Whereami Schema
7
+
8
+ `docs/whereami.md` is the **authoritative project-state snapshot** in
9
+ any bassclef-substrate repo. One per repo, maintained at session-end,
10
+ read at session-start. Functionally it is the current-state header —
11
+ whereas `docs/iteration-bets/` holds the goal.contracts and `chronicle/`
12
+ holds the narrative log, `whereami.md` answers "where is the project
13
+ right now?" in one glance.
14
+
15
+ ## Why this exists
16
+
17
+ Before this standard: each agent reconstructed project state by
18
+ reading iteration-bets + chronicles + git log + substrate.config.md
19
+ at session-start. This reconstruction:
20
+
21
+ - Duplicates ~5 reads per session-start
22
+ - Drifts silently when phase or iteration changes without cross-artifact
23
+ updates
24
+ - Produces inconsistent answers to "what phase are we in?" depending on
25
+ which agent asked and which files it read
26
+
27
+ Making whereami load-bearing solves all three by establishing one
28
+ source, maintained at session boundaries.
29
+
30
+ ## The artifact
31
+
32
+ Location: `docs/whereami.md` (every consumer repo). Bassclef itself
33
+ maintains one at the same path.
34
+
35
+ Format: Markdown with a standard structure (schema below). Plain prose
36
+ allowed in descriptive fields. No YAML frontmatter — simpler to eyeball.
37
+
38
+ ## Schema
39
+
40
+ Nine sections, in this order. Missing fields acceptable when no data
41
+ exists yet (new repo, no active iteration); empty sections MUST render
42
+ as "—" rather than be omitted, so the reader knows what's unset vs. what
43
+ was forgotten.
44
+
45
+ Section 2a (Active sessions registry) is OPTIONAL in singleton mode and
46
+ REQUIRED in plural / parallel mode. Section count is "8 + optional 1."
47
+
48
+ ### 1. Project-level phase
49
+
50
+ ```markdown
51
+ ## Project-level phase
52
+
53
+ phase: [Inception | Elaboration | Construction | Transition]
54
+ note: [one-paragraph description of what this phase means for this repo]
55
+ ```
56
+
57
+ Bassclef values only. If you're tempted to write a custom phase, the
58
+ project is either between standard phases (write "Construction, tail
59
+ end of iteration X") or the phase model doesn't fit (surface as a
60
+ bassclef-evolution proposal, don't invent a value).
61
+
62
+ ### 2. Active iteration
63
+
64
+ Two shapes — singleton (sequential mode, one goal at a time) and plural
65
+ (parallel mode, multiple bets in flight on the same repo). Singleton is
66
+ the bassclef default; plural is the parallel-fanout extension (Phase
67
+ A WS-2 of example-pipeline bet).
68
+
69
+ #### Singleton (default — sequential mode)
70
+
71
+ ```markdown
72
+ ## Active iteration
73
+
74
+ iteration_bet: [path to current bet, or "none — between iterations"]
75
+ iteration_started: [YYYY-MM-DD]
76
+ iteration_phase: [current WS or stage within the goal. or "—"]
77
+ previous_bet: [path to last closed bet]
78
+ next_bet: [one-line description of planned next bet, or "—"]
79
+ ```
80
+
81
+ If `iteration_bet` is "none," `iteration_phase` MUST be "—".
82
+
83
+ #### Plural (parallel mode — Stage 4+)
84
+
85
+ ```markdown
86
+ ## Active iteration
87
+
88
+ iteration_bets:
89
+ - bet: docs/iteration-bets/2026-04-25-example-pipeline.md
90
+ started: 2026-04-25
91
+ phase: Phase A
92
+ session: 2026-04-26-phase-a-autonomous
93
+ - bet: docs/iteration-bets/2026-04-26-quorum-prototype-gallery.md
94
+ started: 2026-04-26
95
+ phase: WS-1
96
+ session: 2026-04-26-quorum-wire
97
+ previous_bet: [path to last closed bet]
98
+ next_bet: [one-line description of planned next bet, or "—"]
99
+ ```
100
+
101
+ **Backward-compatibility window**: readers MUST accept BOTH the
102
+ singleton field (`iteration_bet:`) AND the plural field
103
+ (`iteration_bets:`). Writers in sequential mode SHOULD continue using
104
+ the singleton form. The plural form activates when ≥2 bets are
105
+ in-flight against the same repo — typically via worktree-based
106
+ parallel sessions. Plural form deprecates singleton 30 days after
107
+ parallel-mode adoption stabilizes; until then both are valid.
108
+
109
+ ### 2a. Active sessions registry (parallel mode)
110
+
111
+ ```markdown
112
+ ## Active sessions
113
+
114
+ active_sessions:
115
+ - session_id: 2026-04-26-phase-a-autonomous
116
+ started: 2026-04-26T01:00:00+0000
117
+ working_dir: /Users/<operator>/src/<org>/bassclef
118
+ agent: orchestrator-gated-sequential
119
+ bet: docs/iteration-bets/2026-04-25-example-pipeline.md
120
+ tier: longrun
121
+ - session_id: 2026-04-26-quorum-wire
122
+ started: 2026-04-26T02:30:00+0000
123
+ working_dir: /Users/<operator>/src/<org>/bassclef-quorum-worktree
124
+ agent: builder
125
+ bet: docs/iteration-bets/2026-04-26-quorum-prototype-gallery.md
126
+ tier: short
127
+ ```
128
+
129
+ Empty when only one session is active (singleton mode). Each session
130
+ appends an entry at `/longrun prep` and removes its entry at
131
+ `/longrun closeout`. Stale entries (session_id has no live process
132
+ AND age > 24h) are reaped by `bassclef-sync.sh` session-start hook.
133
+
134
+ The session-id MUST match the session-board filename slug (per
135
+ `standards/session-board.md`) so cross-references resolve cleanly.
136
+
137
+ ### 3. Active agents
138
+
139
+ ```markdown
140
+ ## Active agents
141
+
142
+ [sequential mode]
143
+ - [role-name] ([current task])
144
+
145
+ [multi-agent mode]
146
+ - [role-name] on branch [branch-name] ([status])
147
+ ```
148
+
149
+ For sequential sessions, typically one entry. For multi-agent /
150
+ multi-worktree sessions, one entry per active agent. If between
151
+ iterations: "None (between iterations)".
152
+
153
+ ### 4. Subsystem phases (table)
154
+
155
+ ```markdown
156
+ ## Subsystem phases
157
+
158
+ | Subsystem | Phase | Last iteration | Notes |
159
+ |-----------|-------|---------------|-------|
160
+ | [name] | [phase] | [YYYY-MM-DD] | [one-line] |
161
+ ```
162
+
163
+ Subsystems are the repo's own decomposition — in bassclef, these are
164
+ standards / skills / agents / SDLC-process / session-continuity /
165
+ design-system. Each consumer repo defines its own list.
166
+
167
+ ### 5. Gate progress (project-level)
168
+
169
+ ```markdown
170
+ ## Gate progress (project-level)
171
+
172
+ ### Inception — [COMPLETE (YYYY-MM-DD) | IN PROGRESS | PENDING]
173
+ - [x] Vision doc
174
+ - [x] Risk register populated
175
+ ...
176
+
177
+ ### Elaboration — [status]
178
+ - [ ] ADRs drafted
179
+ ...
180
+
181
+ ### Construction — [status]
182
+ ...
183
+
184
+ ### Transition — [status]
185
+ ...
186
+ ```
187
+
188
+ Checkbox format. Gate items are repo-specific. Bassclef values
189
+ only for phase status: COMPLETE / IN PROGRESS / PENDING.
190
+
191
+ ### 6. Risk register
192
+
193
+ ```markdown
194
+ ## Risk register
195
+
196
+ See docs/risk-register.md
197
+ ```
198
+
199
+ One-line pointer. The register itself is a separate artifact; this
200
+ field just establishes the reference. If no register exists, write
201
+ "none yet — file when first risk materializes."
202
+
203
+ ### 7. Last updated (MUST)
204
+
205
+ ```markdown
206
+ ## Last updated
207
+
208
+ 2026-04-16T19:00:00Z — session-end
209
+ session: [chronicle filename, e.g., 2026-04-16c-plan-declaration-and-whereami.md]
210
+ ```
211
+
212
+ ISO 8601 UTC timestamp. Auto-stamped by `/session-end` skill when it
213
+ updates whereami. Hook-read to detect staleness.
214
+
215
+ ### 8. Configuration pointer
216
+
217
+ ```markdown
218
+ ## Configuration
219
+
220
+ See substrate.config.md for external resource references.
221
+ ```
222
+
223
+ One-line pointer. Decouples state tracking (whereami) from resource
224
+ references (substrate.config.md) — both are single-source but for
225
+ different concerns.
226
+
227
+ ## Freshness rules
228
+
229
+ Hook-enforced via `bassclef-sync.sh` section emitted on session-start:
230
+
231
+ - `last_updated` newer than 3 days → green, session proceeds normally
232
+ - `last_updated` 3–7 days old → warning surfaced, session proceeds
233
+ - `last_updated` older than 7 days → BLOCKED (per `blocked-items.md`)
234
+ - File missing → BLOCKED
235
+
236
+ Threshold is tuneable. 3 days v1 default. Consumer repos may override
237
+ via `substrate.config.md` field (proposed: `whereami_freshness_days`).
238
+
239
+ ## Who updates it
240
+
241
+ | Trigger | Who | Action |
242
+ |---------|-----|--------|
243
+ | Session end | `/session-end` skill (MUST tier) | Update last_updated + any field that changed |
244
+ | Phase transition | Closer / operator | Update phase + gate progress |
245
+ | Iteration start | `/autonomous start` or equivalent | Update iteration_bet + active agents |
246
+ | Iteration end | `/session-end` + closeout | Update previous_bet; clear iteration_phase |
247
+ | Subsystem change | Agent performing the change | Update subsystem row with one-line + date |
248
+
249
+ ## Who reads it
250
+
251
+ | Reader | When | What it expects |
252
+ |--------|------|-----------------|
253
+ | `/sprint` skill | Session-start orientation | Primary source (no longer fallback) |
254
+ | `bassclef-sync.sh` hook | Session-start | Freshness check only |
255
+ | `/substrate-check` skill | On-demand validation | Presence + schema conformance |
256
+ | Operator eyeballing | Any time | Human-readable summary |
257
+ | Chronicle writer | Session-end | Phase context for narrative |
258
+
259
+ ## What whereami is NOT
260
+
261
+ - **Not the iteration goal** — iteration goal is the scope contract for
262
+ the current work; whereami references it by path
263
+ - **Not the chronicle** — chronicle is retrospective narrative;
264
+ whereami is current snapshot
265
+ - **Not substrate.config.md** — that file is resource references
266
+ (where is X); whereami is state (where are we)
267
+ - **Not a risk register** — register is a separate artifact; whereami
268
+ points to it
269
+ - **Not an ADR log** — ADRs are decisions; whereami is state
270
+ - **Not `/sprint` output** — `/sprint` READS whereami; it doesn't
271
+ replace it
272
+
273
+ ## Relationship to other standards
274
+
275
+ - `standards/substrate-config-schema.md` — same single-source-of-truth
276
+ pattern, different concern (resources vs. state)
277
+ - `strategy/session-continuity.md` — three-layer memory architecture
278
+ where whereami is the "current state" layer
279
+ - `strategy/agent-choreography.md` — which agent updates whereami at
280
+ which gate is defined here
281
+ - `.claude/rules/whereami-load-bearing.md` — enforces read + write
282
+ obligations per session
283
+
284
+ ## Template
285
+
286
+ See `templates/whereami-template.md` for a fillable starting
287
+ point. `/autonomous start` creates one when scaffolding a new repo.
288
+
289
+ ## Scrutiny
290
+
291
+ Bar for adding a schema: the artifact must have load-bearing behavior
292
+ elsewhere in the methodology, or it's documentation for documentation's
293
+ sake. Whereami meets the bar because:
294
+
295
+ 1. `/sprint` will read it as primary source (not fallback)
296
+ 2. `bassclef-sync.sh` will block on staleness
297
+ 3. `/session-end` will write to it as MUST tier
298
+ 4. `/substrate-check` will validate its shape
299
+
300
+ Without those four hooks, this standard would be shelfware. Ship the
301
+ hooks with the schema.
@@ -0,0 +1,211 @@
1
+ ---
2
+ tier: lite
3
+ description: Defines the lifecycle for git worktrees in autonomous agent sessions.
4
+ ---
5
+
6
+ # Worktree Management Standard
7
+
8
+ Defines the lifecycle for git worktrees in autonomous agent sessions.
9
+ Worktrees enable parallel branch work but create operational hazards when
10
+ agents crash, hit rate limits, or exhaust context without cleanup.
11
+
12
+ This standard applies whenever agents use `git worktree add` — whether
13
+ in parallel autonomous mode or manual multi-branch work.
14
+
15
+ ---
16
+
17
+ ## Worktree Lifecycle
18
+
19
+ ```
20
+ CREATE → WORK → COMMIT → PR → CLEANUP
21
+ ```
22
+
23
+ Every worktree must complete this lifecycle. A worktree that skips CLEANUP
24
+ leaves a branch lock, consumes disk, and confuses the next session.
25
+
26
+ ---
27
+
28
+ ## Pre-Session Audit (MUST — session start)
29
+
30
+ Before creating any new worktrees, audit existing ones:
31
+
32
+ ```bash
33
+ git worktree list
34
+ ```
35
+
36
+ For each worktree that is not the main working tree:
37
+
38
+ 1. **Check if prunable**: `git worktree list` shows `prunable` for worktrees
39
+ whose directory no longer exists
40
+ 2. **Check age**: if the worktree is from a previous session (different date
41
+ or session ID), it is stale
42
+ 3. **Check for uncommitted work**: `git -C <worktree-path> status` — if dirty,
43
+ the previous agent died mid-work
44
+
45
+ ### Stale worktree resolution
46
+
47
+ | State | Action |
48
+ |-------|--------|
49
+ | Prunable (directory gone) | `git worktree prune` — safe, just cleans metadata |
50
+ | Clean (no uncommitted changes) | `git worktree remove <path>` — safe to remove |
51
+ | Dirty (uncommitted changes) | Commit as `chore: wip — recovered from stale worktree`, then remove |
52
+ | Branch has open PR | Remove worktree, leave PR open for review |
53
+ | Branch has no PR and no useful commits | Remove worktree, delete branch |
54
+
55
+ Present stale worktrees to the operator at session start. In orchestrator-gated
56
+ mode, auto-clean prunable and clean worktrees; prompt for dirty ones.
57
+
58
+ The session-start hook should surface stale worktrees. If it doesn't, the
59
+ agent checks manually.
60
+
61
+ ---
62
+
63
+ ## Creating Worktrees
64
+
65
+ ### Naming convention
66
+
67
+ ```
68
+ .claude/worktrees/<slug>
69
+ ```
70
+
71
+ Where `<slug>` matches the branch's short description. Example:
72
+ `feature/100-stack-1-worktree-mgmt` → `.claude/worktrees/worktree-mgmt`
73
+
74
+ ### Creation checklist
75
+
76
+ 1. Verify the branch doesn't already exist: `git branch --list <name>`
77
+ 2. Create from main (not from another worktree's branch):
78
+ ```bash
79
+ git worktree add .claude/worktrees/<slug> -b <branch-name>
80
+ ```
81
+ 3. Record the worktree in the stack manifest if one exists
82
+ 4. Never `cd` into the worktree — use `git -C <path>` for all operations
83
+
84
+ ### Why never `cd` into a worktree
85
+
86
+ If the agent's working directory is inside a worktree and the worktree is
87
+ removed (by cleanup, crash recovery, or another agent), the shell's cwd
88
+ becomes invalid. All subsequent commands fail with "Unable to read current
89
+ working directory." This was observed in POA parallel run 2026-04-07.
90
+
91
+ Instead:
92
+ ```bash
93
+ # Good — run from main working tree
94
+ git -C .claude/worktrees/my-feature add .
95
+ git -C .claude/worktrees/my-feature commit -m "feat: description"
96
+
97
+ # Bad — changes cwd, creates cleanup hazard
98
+ cd .claude/worktrees/my-feature
99
+ git add .
100
+ ```
101
+
102
+ ---
103
+
104
+ ## File Watcher Conflicts
105
+
106
+ ### Problem
107
+
108
+ Dev servers (Next.js, Vite), linters (ESLint watch mode), formatters
109
+ (Prettier watch), and IDE file sync tools monitor the filesystem. When a
110
+ worktree agent writes a file, watchers may:
111
+
112
+ - Revert the file to their cached state
113
+ - Trigger a rebuild that overwrites agent output
114
+ - Lock files that the agent needs to write
115
+
116
+ ### Mitigation
117
+
118
+ Before creating worktrees for parallel work:
119
+
120
+ 1. **Stop all file watchers**: dev server, lint --watch, test --watch
121
+ 2. **Check for processes holding files**:
122
+ ```bash
123
+ lsof +D <worktree-path> 2>/dev/null
124
+ ```
125
+ 3. **If watchers can't be stopped** (e.g., IDE integration), document in
126
+ the stack manifest that this branch is not parallel-safe
127
+
128
+ The `/autonomous start` boot sequence should check for running dev servers
129
+ and warn before spawning parallel agents.
130
+
131
+ ### IDE-specific notes
132
+
133
+ - **VS Code**: File watcher is aggressive. If the worktree is inside the
134
+ project directory (which `.claude/worktrees/` is), VS Code will watch it.
135
+ Consider creating worktrees outside the project directory for parallel runs.
136
+ - **Cursor/JetBrains**: Similar behavior. Same mitigation.
137
+
138
+ ---
139
+
140
+ ## Cleanup Protocol (MUST — before session end)
141
+
142
+ Every agent that creates a worktree MUST clean it up before exiting.
143
+ This is part of the graceful exit protocol (see `standards/graceful-exit.md`).
144
+
145
+ ### Normal cleanup (work complete, PR open)
146
+
147
+ ```bash
148
+ git worktree remove .claude/worktrees/<slug>
149
+ ```
150
+
151
+ If the branch was merged, also delete the branch:
152
+ ```bash
153
+ git branch -d <branch-name>
154
+ ```
155
+
156
+ ### Abnormal cleanup (agent dying, context exhaustion)
157
+
158
+ If the agent knows it's about to die (context pressure, rate limit, budget):
159
+
160
+ 1. Commit any in-progress work: `git -C <worktree-path> commit -am "chore: wip"`
161
+ 2. Push the branch: `git -C <worktree-path> push -u origin <branch>`
162
+ 3. Remove the worktree: `git worktree remove <path>`
163
+ 4. Note in checkpoint: "worktree cleaned, branch pushed, PR not yet open"
164
+
165
+ If the agent dies without cleanup (crash, kill, timeout), the next session's
166
+ pre-session audit handles recovery.
167
+
168
+ ### Cleanup order
169
+
170
+ When multiple worktrees exist:
171
+
172
+ 1. Remove worktrees with merged PRs first (safest)
173
+ 2. Remove worktrees with open PRs next (work is preserved in the PR)
174
+ 3. Remove worktrees with unpushed work last (commit and push first)
175
+
176
+ ---
177
+
178
+ ## Rate Limit Awareness
179
+
180
+ Parallel worktree agents multiply API request rate against the same account
181
+ quota. This was observed in POA 2026-04-07: 3 agents = 3x RPM pressure,
182
+ causing 429 errors.
183
+
184
+ ### Mitigations
185
+
186
+ | Strategy | When to use |
187
+ |----------|------------|
188
+ | Sequential mode | Default. Zero rate limit risk. Recommended for most work. |
189
+ | Staggered starts | If parallel: delay 30s between agent spawns |
190
+ | Reduced context | Send only relevant files to each agent, not full repo |
191
+ | Fewer parallel agents | Max 2 concurrent for most account tiers |
192
+
193
+ ### Rate limit detection
194
+
195
+ If an agent receives a 429 or rate limit error:
196
+
197
+ 1. Do NOT retry immediately — this makes it worse
198
+ 2. Wait the duration specified in the Retry-After header (or 60s default)
199
+ 3. If rate limits persist after 3 retries: save state, report to operator,
200
+ recommend switching to sequential mode
201
+
202
+ ---
203
+
204
+ ## Relationship to Other Standards
205
+
206
+ | Standard | Relationship |
207
+ |----------|-------------|
208
+ | `standards/graceful-exit.md` | Worktree cleanup is a MUST gate in exit protocol |
209
+ | `standards/branch-stacking.md` | Stack manifest tracks worktree branches |
210
+ | `.claude/rules/cost-governance.md` | Rate limit cost of parallel worktrees |
211
+ | `strategy/agent-choreography.md` | Orchestrator manages worktree lifecycle in parallel mode |