@erclx/canon 5.30.0 → 5.32.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 (343) hide show
  1. package/README.md +1 -1
  2. package/claude/.claude-plugin/plugin.json +1 -1
  3. package/claude/skills/api-design/references/adopted.md +1 -1
  4. package/claude/skills/auto-ship/REQUIREMENT.md +4 -16
  5. package/claude/skills/auto-ship/SKILL.md +13 -58
  6. package/claude/skills/auto-ship/references/draft-mark.md +2 -2
  7. package/claude/skills/auto-ship/references/failure-recovery.md +1 -5
  8. package/claude/skills/auto-ship/references/tier-failures.md +1 -1
  9. package/claude/skills/auto-ship/references/ui-checklist.md +2 -2
  10. package/claude/skills/auto-ship/references/verb-absent.md +3 -27
  11. package/claude/skills/backlog-triage/SKILL.md +1 -1
  12. package/claude/skills/build-in-slices/REQUIREMENT.md +1 -1
  13. package/claude/skills/build-in-slices/references/adopted.md +1 -1
  14. package/claude/skills/canon-cli/REQUIREMENT.md +4 -6
  15. package/claude/skills/canon-cli/SKILL.md +2 -2
  16. package/claude/skills/canon-feedback/REQUIREMENT.md +1 -1
  17. package/claude/skills/canon-feedback/SKILL.md +10 -13
  18. package/claude/skills/canon-feedback-triage/REQUIREMENT.md +13 -14
  19. package/claude/skills/canon-feedback-triage/SKILL.md +50 -29
  20. package/claude/skills/canvas/REQUIREMENT.md +3 -4
  21. package/claude/skills/canvas/SKILL.md +5 -5
  22. package/{standards → claude/skills/canvas/references}/canvas.md +12 -1
  23. package/claude/skills/ci-workflow/REQUIREMENT.md +0 -1
  24. package/claude/skills/context-fold/REQUIREMENT.md +8 -20
  25. package/claude/skills/context-fold/SKILL.md +21 -45
  26. package/claude/skills/context-fold/references/classify.md +7 -8
  27. package/claude/skills/context-fold/references/completion-report.md +2 -6
  28. package/claude/skills/context-fold/references/context-refresh.md +5 -15
  29. package/claude/skills/context-fold/references/promoted-pages.md +3 -3
  30. package/claude/skills/context-fold/references/receipt-sweep.md +6 -17
  31. package/claude/skills/context-fold/references/unusable-baseline.md +4 -6
  32. package/claude/skills/create-rule/REQUIREMENT.md +0 -1
  33. package/claude/skills/create-skill/REQUIREMENT.md +6 -4
  34. package/claude/skills/create-skill/SKILL.md +9 -8
  35. package/{standards → claude/skills/create-skill/references}/skill-paths.md +1 -0
  36. package/claude/skills/decision-escalate/REQUIREMENT.md +1 -1
  37. package/claude/skills/decision-escalate/SKILL.md +1 -1
  38. package/claude/skills/design-taste/REQUIREMENT.md +0 -2
  39. package/claude/skills/design-taste/SKILL.md +2 -4
  40. package/claude/skills/design-taste/references/vocabulary.md +1 -1
  41. package/claude/skills/docs-sync/REQUIREMENT.md +3 -3
  42. package/claude/skills/docs-sync/SKILL.md +1 -1
  43. package/claude/skills/document-health/REQUIREMENT.md +2 -2
  44. package/claude/skills/document-health/SKILL.md +4 -5
  45. package/claude/skills/document-health/references/axes.md +4 -6
  46. package/claude/skills/draft-and-pick/REQUIREMENT.md +16 -14
  47. package/claude/skills/draft-and-pick/SKILL.md +40 -32
  48. package/claude/skills/draft-and-pick/references/live-arms.md +9 -9
  49. package/claude/skills/draft-doc/REQUIREMENT.md +5 -5
  50. package/claude/skills/draft-doc/SKILL.md +10 -11
  51. package/claude/skills/draft-doc/references/requirements.md +61 -0
  52. package/claude/skills/draft-doc/references/wiki-kind.md +53 -0
  53. package/claude/skills/draft-doc/references/wiki.md +50 -30
  54. package/claude/skills/draft-figure/REQUIREMENT.md +2 -2
  55. package/claude/skills/draft-figure/SKILL.md +5 -5
  56. package/claude/skills/draft-figure/references/architecture-set.md +4 -4
  57. package/claude/skills/draft-figure/references/hand-drawn.md +1 -1
  58. package/claude/skills/draft-figure/references/mermaid-path.md +55 -0
  59. package/claude/skills/draft-figure/references/mermaid.md +43 -34
  60. package/claude/skills/draft-identity/REQUIREMENT.md +1 -1
  61. package/claude/skills/draft-identity/SKILL.md +9 -7
  62. package/claude/skills/draft-ready/REQUIREMENT.md +1 -1
  63. package/claude/skills/draft-ready/SKILL.md +6 -6
  64. package/claude/skills/draft-ready/references/assembly.md +1 -1
  65. package/{standards → claude/skills/draft-ready/references}/ready.md +13 -5
  66. package/claude/skills/git-issue/SKILL.md +1 -1
  67. package/claude/skills/git-issue/references/issue.md +3 -3
  68. package/claude/skills/git-pr/SKILL.md +1 -1
  69. package/claude/skills/git-ship/REQUIREMENT.md +0 -2
  70. package/claude/skills/git-ship/SKILL.md +16 -24
  71. package/claude/skills/git-stage/SKILL.md +1 -1
  72. package/claude/skills/markdown-craft/REQUIREMENT.md +23 -0
  73. package/claude/skills/markdown-craft/SKILL.md +17 -0
  74. package/{standards → claude/skills/markdown-craft/references}/markdown.md +14 -7
  75. package/claude/skills/plan-feature/REQUIREMENT.md +2 -1
  76. package/claude/skills/plan-feature/SKILL.md +14 -8
  77. package/{standards → claude/skills/plan-feature/references}/plan.md +33 -21
  78. package/claude/skills/plan-groundwork/SKILL.md +5 -6
  79. package/{standards → claude/skills/plan-groundwork/references}/groundwork.md +17 -4
  80. package/claude/skills/plan-intake/SKILL.md +2 -3
  81. package/{standards → claude/skills/plan-intake/references}/intake.md +17 -2
  82. package/claude/skills/plan-intake-answer/REQUIREMENT.md +1 -1
  83. package/claude/skills/plan-intake-answer/SKILL.md +1 -1
  84. package/claude/skills/review-address/SKILL.md +2 -2
  85. package/claude/skills/review-address/references/post-review-findings.md +1 -1
  86. package/claude/skills/review-craft/REQUIREMENT.md +3 -3
  87. package/claude/skills/review-craft/SKILL.md +2 -2
  88. package/claude/skills/review-craft/references/ui.md +4 -4
  89. package/claude/skills/review-pr/REQUIREMENT.md +1 -1
  90. package/claude/skills/review-pr/SKILL.md +5 -7
  91. package/claude/skills/review-pr/references/post.md +2 -2
  92. package/claude/skills/review-ui/REQUIREMENT.md +0 -1
  93. package/claude/skills/review-ui/SKILL.md +1 -1
  94. package/claude/skills/review-ui/references/post.md +1 -1
  95. package/claude/skills/role-orchestrator/REQUIREMENT.md +0 -3
  96. package/claude/skills/role-orchestrator/SKILL.md +8 -8
  97. package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +4 -3
  98. package/claude/skills/role-orchestrator/references/orchestrator-handoff.md +7 -10
  99. package/claude/skills/role-orchestrator/references/orchestrator-parked.md +2 -2
  100. package/claude/skills/role-orchestrator/references/orchestrator-refill.md +0 -3
  101. package/claude/skills/role-orchestrator/references/orchestrator-resume.md +1 -1
  102. package/claude/skills/role-planner/SKILL.md +2 -2
  103. package/claude/skills/role-reviewer/SKILL.md +1 -1
  104. package/claude/skills/role-worker/SKILL.md +2 -2
  105. package/claude/skills/session-compact/REQUIREMENT.md +1 -4
  106. package/claude/skills/session-compact/SKILL.md +3 -13
  107. package/claude/skills/session-compact/references/handoff-note.md +2 -2
  108. package/claude/skills/session-map/REQUIREMENT.md +1 -9
  109. package/claude/skills/session-map/SKILL.md +8 -16
  110. package/{standards → claude/skills/session-map/references}/session.md +17 -11
  111. package/claude/skills/session-relay/REQUIREMENT.md +1 -1
  112. package/claude/skills/session-resume/REQUIREMENT.md +4 -6
  113. package/claude/skills/session-resume/SKILL.md +3 -9
  114. package/claude/skills/session-worktree/SKILL.md +1 -1
  115. package/claude/skills/session-worktree/references/main-root-writes.md +2 -2
  116. package/claude/skills/systematic-debugging/REQUIREMENT.md +0 -1
  117. package/claude/skills/target-check/REQUIREMENT.md +3 -3
  118. package/claude/skills/target-check/SKILL.md +1 -1
  119. package/claude/skills/target-check/references/domains.md +1 -1
  120. package/claude/skills/target-setup/REQUIREMENT.md +4 -4
  121. package/claude/skills/target-setup/SKILL.md +3 -3
  122. package/claude/skills/target-setup/references/detect.md +1 -1
  123. package/claude/skills/target-setup/references/indexes.md +1 -1
  124. package/claude/skills/task-board/SKILL.md +4 -4
  125. package/claude/skills/task-board/references/archive.md +1 -1
  126. package/{standards → claude/skills/task-board/references}/board.md +9 -0
  127. package/claude/skills/task-board/references/decline.md +1 -1
  128. package/{standards → claude/skills/task-board/references}/tasks.md +13 -8
  129. package/claude/skills/teach-workspace/SKILL.md +1 -1
  130. package/claude/skills/teach-workspace/references/revisit.md +1 -1
  131. package/{standards → claude/skills/teach-workspace/references}/teach.md +17 -5
  132. package/claude/skills/test-first/REQUIREMENT.md +1 -1
  133. package/claude/skills/ux-audit/REQUIREMENT.md +2 -2
  134. package/claude/skills/ux-audit/SKILL.md +2 -3
  135. package/claude/skills/write-human/REQUIREMENT.md +0 -1
  136. package/claude/skills/write-human/SKILL.md +2 -2
  137. package/docs/agents/audits.md +1 -1
  138. package/docs/agents/canvas.md +1 -1
  139. package/docs/agents/commands.md +6 -10
  140. package/docs/agents/context-audit-checks.md +10 -24
  141. package/docs/agents/context-audit.md +7 -15
  142. package/docs/agents/context-classify.md +5 -5
  143. package/docs/agents/counts.md +5 -5
  144. package/docs/agents/drift-surfaces.md +2 -2
  145. package/docs/agents/index.md +3 -4
  146. package/docs/agents/install-and-sync.md +6 -6
  147. package/docs/agents/intake.md +1 -1
  148. package/docs/agents/markdown-audit.md +1 -1
  149. package/docs/agents/records-stale.md +5 -5
  150. package/docs/agents/records-validate.md +1 -1
  151. package/docs/agents/records.md +2 -2
  152. package/docs/agents/restated.md +1 -1
  153. package/docs/agents/routing.md +1 -1
  154. package/docs/agents/rule-citations.md +1 -1
  155. package/docs/agents/skills-audit.md +2 -2
  156. package/docs/agents/state-scoped-risk.md +2 -2
  157. package/docs/agents/superseded.md +2 -2
  158. package/docs/agents/tasks-plans.md +2 -2
  159. package/docs/agents/tasks-validate.md +1 -1
  160. package/docs/agents/tasks.md +1 -1
  161. package/docs/agents/teach.md +1 -1
  162. package/docs/agents/test-order.md +1 -1
  163. package/docs/agents/upstream.md +94 -0
  164. package/docs/target/migrations.md +24 -0
  165. package/docs/target/projects.md +5 -7
  166. package/docs/target/scenarios.md +2 -2
  167. package/docs/target/sync.md +3 -3
  168. package/docs/workflow/ai-workflow.md +7 -38
  169. package/docs/workflow/index.md +1 -1
  170. package/docs/workflow/operating-model.md +8 -8
  171. package/docs/workflow/parallel-features.md +7 -7
  172. package/docs/workflow/skill-map-on-request.md +13 -16
  173. package/docs/workflow/skill-map.md +20 -32
  174. package/docs/workflow/visual-design-workflow.md +11 -14
  175. package/governance/renames.toml +0 -23
  176. package/governance/rules/canon/605-worktrees.md +1 -1
  177. package/governance/rules/{standards → canon}/plan.md +5 -5
  178. package/governance/rules/canon/tasks.md +18 -0
  179. package/governance/rules/writing/markdown.md +23 -0
  180. package/governance/stacks/base.toml +1 -1
  181. package/package.json +1 -1
  182. package/scripts/core/install-check.sh +2 -2
  183. package/scripts/core/regen-web-previews.ts +1 -1
  184. package/src/audits/catalog.ts +5 -97
  185. package/src/claude/cases/authoring.ts +5 -18
  186. package/src/claude/cases/misc.ts +0 -17
  187. package/src/claude/cases/setup.ts +3 -20
  188. package/src/claude/cases/workflow.ts +0 -33
  189. package/src/claude/seeds.ts +1 -7
  190. package/src/claude/skills-audit.ts +1 -1
  191. package/src/claude/skills-reach.ts +1 -1
  192. package/src/cli/help.ts +3 -4
  193. package/src/cli.ts +2 -4
  194. package/src/commands/claude.ts +9 -15
  195. package/src/commands/context.ts +18 -280
  196. package/src/commands/feedback.ts +22 -91
  197. package/src/commands/gov.ts +2 -2
  198. package/src/commands/records.ts +24 -6
  199. package/src/commands/sync.ts +5 -3
  200. package/src/commands/upstream.ts +430 -0
  201. package/src/context/audit.ts +6 -15
  202. package/src/context/classify/extract.ts +6 -13
  203. package/src/context/classify/patterns.ts +2 -41
  204. package/src/context/classify/prompts.ts +2 -6
  205. package/src/context/classify/run.ts +3 -3
  206. package/src/context/folders.ts +7 -12
  207. package/src/context/gate.ts +11 -91
  208. package/src/context/requirements.ts +13 -4
  209. package/src/counts/scan.ts +3 -3
  210. package/src/design/components.ts +2 -2
  211. package/src/feedback/body.ts +0 -12
  212. package/src/gate/measures.ts +6 -57
  213. package/src/gate/stages.ts +0 -1
  214. package/src/gov/citations.ts +9 -3
  215. package/src/gov/restated.ts +3 -3
  216. package/src/markdown/structure.ts +3 -3
  217. package/src/migrate/record-layout.ts +3 -3
  218. package/src/records/backup.ts +1 -0
  219. package/src/records/ordinal.ts +1 -1
  220. package/src/records/prune.ts +2 -1
  221. package/src/records/stale-canonical.ts +2 -2
  222. package/src/records/validate.ts +55 -0
  223. package/src/roots/record.ts +2 -1
  224. package/src/sandbox/scenario.ts +115 -11
  225. package/src/shipped/references.ts +3 -3
  226. package/src/standards/read.ts +52 -1
  227. package/src/sync/seeds-report.ts +1 -1
  228. package/src/tasks/answers.ts +14 -1
  229. package/src/tasks/reach.ts +2 -2
  230. package/src/tasks/stack.ts +176 -0
  231. package/src/tasks/validate.ts +1 -1
  232. package/src/teach/workspace.ts +1 -1
  233. package/src/upstream/catalog.ts +112 -0
  234. package/src/upstream/cursor.ts +120 -0
  235. package/src/upstream/digest.ts +75 -0
  236. package/src/upstream/due.ts +128 -0
  237. package/src/upstream/releases.ts +170 -0
  238. package/standards/context.md +3 -5
  239. package/standards/design.md +2 -3
  240. package/standards/index.md +0 -23
  241. package/standards/publish.md +1 -1
  242. package/standards/rule.md +1 -1
  243. package/standards/skill.md +1 -1
  244. package/tooling/base/reference.md +1 -1
  245. package/tooling/claude/reference.md +6 -20
  246. package/tooling/claude/seeds/.claude/hooks/index-reminder.sh +1 -1
  247. package/tooling/claude/seeds/.claude/hooks/records-index.sh +8 -20
  248. package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +3 -3
  249. package/tooling/claude/seeds/CLAUDE.md +1 -3
  250. package/tooling/claude/seeds/canon/REQUIREMENTS.md +2 -9
  251. package/tooling/web/configs/e2e/screenshot.ts +0 -1
  252. package/claude/skills/auto-ship/references/review-findings.md +0 -20
  253. package/claude/skills/bash-cli-script/REQUIREMENT.md +0 -43
  254. package/claude/skills/bash-cli-script/SKILL.md +0 -53
  255. package/claude/skills/bash-cli-script/references/template.md +0 -19
  256. package/claude/skills/canon-operator/REQUIREMENT.md +0 -62
  257. package/claude/skills/canon-operator/SKILL.md +0 -113
  258. package/claude/skills/canon-rollout/REQUIREMENT.md +0 -59
  259. package/claude/skills/canon-rollout/SKILL.md +0 -140
  260. package/claude/skills/canon-rollout/references/failure-recovery.md +0 -20
  261. package/claude/skills/context-fold/references/anchor-sweep.md +0 -58
  262. package/claude/skills/context-fold/references/wireframe-sweep.md +0 -45
  263. package/claude/skills/create-standard/REQUIREMENT.md +0 -33
  264. package/claude/skills/create-standard/SKILL.md +0 -31
  265. package/claude/skills/design-extract/REQUIREMENT.md +0 -42
  266. package/claude/skills/design-extract/SKILL.md +0 -108
  267. package/claude/skills/draft-and-pick/references/frame.html +0 -118
  268. package/claude/skills/draft-doc/references/wireframes.md +0 -48
  269. package/claude/skills/index-lookup/REQUIREMENT.md +0 -35
  270. package/claude/skills/index-lookup/SKILL.md +0 -44
  271. package/claude/skills/markdown-propose/REQUIREMENT.md +0 -47
  272. package/claude/skills/markdown-propose/SKILL.md +0 -122
  273. package/claude/skills/markdown-propose/references/format.md +0 -118
  274. package/claude/skills/memory-capture/REQUIREMENT.md +0 -50
  275. package/claude/skills/memory-capture/SKILL.md +0 -117
  276. package/claude/skills/memory-review/REQUIREMENT.md +0 -52
  277. package/claude/skills/memory-review/SKILL.md +0 -129
  278. package/claude/skills/memory-review/references/later-phases.md +0 -118
  279. package/claude/skills/memory-review/references/receipt-format.md +0 -64
  280. package/claude/skills/project-commands/REQUIREMENT.md +0 -42
  281. package/claude/skills/project-commands/SKILL.md +0 -87
  282. package/claude/skills/repo-metadata/REQUIREMENT.md +0 -37
  283. package/claude/skills/repo-metadata/SKILL.md +0 -54
  284. package/claude/skills/restate-plainly/REQUIREMENT.md +0 -41
  285. package/claude/skills/restate-plainly/SKILL.md +0 -41
  286. package/claude/skills/review-branch/REQUIREMENT.md +0 -40
  287. package/claude/skills/review-branch/SKILL.md +0 -137
  288. package/claude/skills/seed-sync/REQUIREMENT.md +0 -45
  289. package/claude/skills/seed-sync/SKILL.md +0 -158
  290. package/claude/skills/sketch-design/REQUIREMENT.md +0 -38
  291. package/claude/skills/sketch-design/SKILL.md +0 -94
  292. package/claude/skills/ux-walkthrough/REQUIREMENT.md +0 -56
  293. package/claude/skills/ux-walkthrough/SKILL.md +0 -53
  294. package/claude/skills/ux-walkthrough/references/builds.md +0 -15
  295. package/claude/skills/ux-walkthrough/references/candidate-pages.md +0 -11
  296. package/claude/skills/ux-walkthrough/references/measuring.md +0 -22
  297. package/claude/skills/ux-walkthrough/references/record.md +0 -36
  298. package/claude/skills/ux-walkthrough/references/relay.md +0 -25
  299. package/docs/agents/architecture-record.md +0 -36
  300. package/docs/agents/review-classification.md +0 -76
  301. package/governance/rules/canon/601-indexes.md +0 -9
  302. package/governance/rules/canon/603-memory.md +0 -11
  303. package/governance/rules/claude/565-behavior.md +0 -27
  304. package/governance/rules/claude/567-planning.md +0 -16
  305. package/governance/rules/claude/575-hooks.md +0 -16
  306. package/governance/rules/claude/576-settings.md +0 -13
  307. package/governance/rules/claude/592-claude-md.md +0 -19
  308. package/governance/rules/lang/120-bash.md +0 -18
  309. package/governance/rules/standards/architecture.md +0 -13
  310. package/governance/rules/standards/groundwork.md +0 -13
  311. package/governance/rules/standards/intake.md +0 -12
  312. package/governance/rules/standards/markdown.md +0 -16
  313. package/governance/rules/standards/memory.md +0 -12
  314. package/governance/rules/standards/ready.md +0 -13
  315. package/governance/rules/standards/requirements.md +0 -12
  316. package/governance/rules/standards/session.md +0 -13
  317. package/governance/rules/standards/tasks.md +0 -15
  318. package/governance/rules/standards/teach.md +0 -14
  319. package/governance/rules/standards/wiki.md +0 -13
  320. package/governance/rules/standards/wireframes.md +0 -13
  321. package/governance/rules/writing/800-prose.md +0 -15
  322. package/src/autoship/classify.ts +0 -75
  323. package/src/autoship/paths.ts +0 -50
  324. package/src/commands/autoship.ts +0 -129
  325. package/src/commands/repo.ts +0 -393
  326. package/src/context/architecture.ts +0 -654
  327. package/src/context/wireframe-states.ts +0 -238
  328. package/src/repo/metadata.ts +0 -206
  329. package/standards/architecture.md +0 -127
  330. package/standards/memory.md +0 -158
  331. package/standards/mermaid.md +0 -64
  332. package/standards/requirements.md +0 -79
  333. package/standards/wiki.md +0 -77
  334. package/standards/wireframes.md +0 -143
  335. package/tooling/claude/seeds/.claude/memory/index.md +0 -8
  336. package/tooling/claude/seeds/canon/ARCHITECTURE.md +0 -23
  337. package/tooling/claude/seeds/canon/wireframes/index.md +0 -8
  338. /package/{standards → claude/skills/create-skill/references}/skill-practice.md +0 -0
  339. /package/{standards → claude/skills/create-skill/references}/skill-requirement.md +0 -0
  340. /package/{standards → claude/skills/plan-feature/references}/plan-lifecycle.md +0 -0
  341. /package/{standards → claude/skills/plan-groundwork/references}/groundwork-spikes.md +0 -0
  342. /package/{standards → claude/skills/task-board/references}/tasks-decline.md +0 -0
  343. /package/{standards → claude/skills/teach-workspace/references}/glossary.md +0 -0
@@ -0,0 +1,170 @@
1
+ import { $ } from 'bun'
2
+ import { gitEnv } from '@/git/env'
3
+ import { compareVersions } from '@/upstream/cursor'
4
+
5
+ const RELEASES_URL =
6
+ 'https://api.github.com/repos/anthropics/claude-code/releases'
7
+ const PER_PAGE = 100
8
+ const MAX_PAGES = 10
9
+
10
+ /** The subset of a GitHub release the digest reads. */
11
+ export interface Release {
12
+ readonly tag_name: string
13
+ readonly published_at: string
14
+ readonly body: string | null
15
+ readonly draft?: boolean
16
+ }
17
+
18
+ export interface ReleaseLine {
19
+ readonly version: string
20
+ readonly date: string
21
+ readonly text: string
22
+ }
23
+
24
+ export type FetchFailure = 'rate-limited' | 'network' | 'http'
25
+
26
+ export type PageResult =
27
+ | { readonly ok: true; readonly releases: readonly Release[] }
28
+ | {
29
+ readonly ok: false
30
+ readonly reason: FetchFailure
31
+ readonly message: string
32
+ }
33
+
34
+ /** Page numbers start at 1. A page past the feed's end comes back empty. */
35
+ export type PageFetcher = (page: number) => Promise<PageResult>
36
+
37
+ export type Walk =
38
+ | { readonly kind: 'reached'; readonly releases: readonly Release[] }
39
+ | { readonly kind: 'cursor-missing'; readonly cursor: string }
40
+ | {
41
+ readonly kind: 'failed'
42
+ readonly reason: FetchFailure
43
+ readonly message: string
44
+ }
45
+
46
+ // Ported from the groundwork's mechanical-drop script. The first group anchors on the line
47
+ // start, the rest match anywhere because the surface they name can sit mid-line.
48
+ const DROP =
49
+ /^(Fixed|\[VSCode\]|\[Claude Tag\]|\[Code Review\]|Windows:|Self-hosted)|apps gateway|managed setting|OpenTelemetry|Bedrock|Vertex|screen reader/i
50
+ const KEEP = /^(Added|Changed|Removed|Improved|Deprecated)/
51
+ const BULLET = /^\s*[-*] (.*)$/gm
52
+ const DIFFERENCE_LINE = /^(\[[^\]]+\] )?(Changed|Removed|Deprecated)/
53
+ const BACKTICKED = /`([^`]{3,60})`/g
54
+ const DISTINCTIVE = /[-/.A-Z]/
55
+
56
+ export function versionOf(tag: string): string {
57
+ return tag.replace(/^v/, '')
58
+ }
59
+
60
+ export function keepLines(release: Release): ReleaseLine[] {
61
+ const version = versionOf(release.tag_name)
62
+ const date = release.published_at.slice(0, 10)
63
+
64
+ return [...(release.body ?? '').matchAll(BULLET)]
65
+ .map((match) => match[1] ?? '')
66
+ .filter((text) => KEEP.test(text) && !DROP.test(text))
67
+ .map((text) => ({ version, date, text }))
68
+ }
69
+
70
+ export function extractIdentifiers(text: string): string[] {
71
+ if (!DIFFERENCE_LINE.test(text)) return []
72
+
73
+ return [...text.matchAll(BACKTICKED)]
74
+ .map((match) => match[1] ?? '')
75
+ .filter((name) => DISTINCTIVE.test(name))
76
+ }
77
+
78
+ /**
79
+ * Collects the releases newer than the cursor, newest first.
80
+ *
81
+ * The walk stops at the first release whose version is not newer than the
82
+ * cursor, wherever it sits, so a range crossing a page boundary is read whole
83
+ * and a cursor naming a version the feed never carried, as 2.1.256 is not,
84
+ * still bounds the range. A feed that ends with every release newer than the
85
+ * cursor reports `cursor-missing` instead of returning all of it.
86
+ */
87
+ export async function walkReleases(
88
+ cursor: string,
89
+ fetchPage: PageFetcher,
90
+ perPage: number = PER_PAGE,
91
+ ): Promise<Walk> {
92
+ const collected: Release[] = []
93
+
94
+ for (let page = 1; page <= MAX_PAGES; page++) {
95
+ const result = await fetchPage(page)
96
+ if (!result.ok) {
97
+ return { kind: 'failed', reason: result.reason, message: result.message }
98
+ }
99
+
100
+ for (const release of result.releases) {
101
+ if (release.draft) continue
102
+ if (compareVersions(versionOf(release.tag_name), cursor) <= 0) {
103
+ return { kind: 'reached', releases: collected }
104
+ }
105
+ collected.push(release)
106
+ }
107
+
108
+ if (result.releases.length < perPage) break
109
+ }
110
+
111
+ return { kind: 'cursor-missing', cursor }
112
+ }
113
+
114
+ export function githubPageFetcher(
115
+ env: Record<string, string | undefined> = process.env,
116
+ signal?: AbortSignal,
117
+ ): PageFetcher {
118
+ const token = env.GH_TOKEN ?? env.GITHUB_TOKEN
119
+ const headers: Record<string, string> = {
120
+ Accept: 'application/vnd.github+json',
121
+ 'User-Agent': 'canon-upstream',
122
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
123
+ }
124
+
125
+ return async (page) => {
126
+ try {
127
+ const response = await fetch(
128
+ `${RELEASES_URL}?per_page=${PER_PAGE}&page=${page}`,
129
+ { headers, signal },
130
+ )
131
+ if (response.status === 403 || response.status === 429) {
132
+ return {
133
+ ok: false,
134
+ reason: 'rate-limited',
135
+ message:
136
+ 'GitHub refused the request. Set GH_TOKEN or GITHUB_TOKEN to lift the hourly limit.',
137
+ }
138
+ }
139
+ if (!response.ok) {
140
+ return {
141
+ ok: false,
142
+ reason: 'http',
143
+ message: `GitHub answered ${response.status} for page ${page}.`,
144
+ }
145
+ }
146
+
147
+ return { ok: true, releases: (await response.json()) as Release[] }
148
+ } catch {
149
+ return {
150
+ ok: false,
151
+ reason: 'network',
152
+ message: 'The releases feed could not be reached.',
153
+ }
154
+ }
155
+ }
156
+ }
157
+
158
+ /** The tracked files naming an identifier, as a hint for where to look. */
159
+ export async function grepHint(
160
+ root: string,
161
+ identifier: string,
162
+ ): Promise<string[]> {
163
+ const result =
164
+ await $`git -C ${root} grep -l -F -e ${identifier} -- . ':!wiki'`
165
+ .env(gitEnv())
166
+ .quiet()
167
+ .nothrow()
168
+
169
+ return result.stdout.toString().split('\n').filter(Boolean)
170
+ }
@@ -18,10 +18,8 @@ Governs per-domain narrative entries under `canon/context/`: their structure, th
18
18
 
19
19
  Does not govern:
20
20
 
21
- - Decisions filling a stack, delivery, boundary, layout, or build-principle slot, and system-wide risks: `architecture.md`
22
21
  - Product scope, goals, and non-goals: `requirements.md`
23
22
  - Path-scoped coding rules: `rule.md`
24
- - Wireframes, which answer layout questions an entry hands off: `wireframes.md`
25
23
  - Figures and architecture views, which answer structure questions an entry hands off: the `draft-figure` skill
26
24
  - The consumer-facing reference under `docs/`, whose reader is operating the project without the source open: `docs.md`
27
25
 
@@ -88,10 +86,10 @@ Only the `development` entry carries this section. It is not a general-purpose h
88
86
  ## What goes in
89
87
 
90
88
  - Per-domain narrative on how the code is structured and why
91
- - Decisions that constrain the domain, whether or not their reasoning touches another one. This is a decision's default home, and `canon/ARCHITECTURE.md` takes only a decision that fills one of the slots its standard names.
89
+ - Decisions that constrain the domain, whether or not their reasoning touches another one. A decision lives in the entry of the domain it constrains.
92
90
  - Constraints, gotchas, things tried and rejected
93
91
  - Domain-specific conventions that do not fit a `paths:`-scoped rule
94
- - A measured figure, anchored the way `architecture.md` states under `## Verification anchors`, so an entry and the architecture record date a number the same way.
92
+ - A measured figure, closed with a trailing `Measured at <short-sha> on <YYYY-MM-DD>.` naming a commit rather than a pull request number or a branch. Carry one anchor per figure and rewrite it in place when the number is re-read, whether or not it moved. An absent anchor reads as unchecked.
95
93
  - A reference to another entry, spelled as the path that entry sits at rather than as its bare filename. A bare name resolves against whichever folder the reader is already in, so a domain that splits into subfolders strands every inbound reference and the break surfaces nowhere. A reference to a seed, a standard, or a file the project owns elsewhere keeps the form its own surface uses.
96
94
 
97
95
  ## What does not go in
@@ -103,7 +101,7 @@ Only the `development` entry carries this section. It is not a general-purpose h
103
101
  - Rules. Those go in `.claude/rules/<scope>.md` with a `paths:` glob.
104
102
  - Tutorials or human onboarding. Those go in `docs/` if a public audience exists.
105
103
  - Generated content (API references). Generate, do not write by hand.
106
- - Anything already in `canon/REQUIREMENTS.md` or `canon/ARCHITECTURE.md`.
104
+ - Anything already in `canon/REQUIREMENTS.md`.
107
105
  - The history of how the domain reached its current shape. An entry describes the repository as it stands, so a change number, release label, or date attached to a change goes wherever the project tracks work.
108
106
  - A rejected alternative's provenance, which is the same rule at the one place the section above admits history. Keep what was tried and why it lost. Cut who tried it and when.
109
107
  - The route to a decision: the rounds of candidates, the tuning steps a threshold passed through, the review pass that caught a miss. State the decision, what lost, and why, once and in the present tense. Cut the route. Git and the change that introduced it keep it.
@@ -15,13 +15,12 @@ Governs the visual-intent document at `canon/DESIGN.md`: tokens described as int
15
15
 
16
16
  Does not govern:
17
17
 
18
- - Screen layout, on-screen copy, and interaction intent: `wireframes.md`
19
18
  - Per-domain implementation narrative: `context.md`
20
19
 
21
20
  ## What goes in
22
21
 
23
22
  - A token's exact value, anchored to the surface it was read from and tagged per `## The uncertainty tag` when unconfirmed. Fall back to intent language ("mid gray, muted text") only where no source exists yet to anchor from.
24
- - Layout constraints and sizing rules not obvious from wireframes
23
+ - Layout constraints and sizing rules not obvious from the tokens and the code
25
24
  - Visual rules a developer could get wrong without guidance
26
25
  - Non-obvious omissions ("no motion", "no custom icons") that prevent scope creep
27
26
 
@@ -34,7 +33,7 @@ Does not govern:
34
33
  ## Format
35
34
 
36
35
  - Use tables for token systems, one row per token. Write every other rule as a short bullet, one decision per line, within `## Prose budget`.
37
- - Plain English over technical notation. If a section could be removed and the developer would still build correctly from wireframes and code alone, remove it.
36
+ - Plain English over technical notation. If a section could be removed and the developer would still build correctly from the tokens and code alone, remove it.
38
37
  - Keep table headers and role names intact so the render tooling can parse the token tables.
39
38
 
40
39
  ## Prose budget
@@ -7,40 +7,17 @@ subtitle: Reference docs for consistent authoring across the toolkit and target
7
7
 
8
8
  Reference docs for consistent authoring across the toolkit and target projects.
9
9
 
10
- - [Architecture reference](architecture.md): Shape and content rules for canon/ARCHITECTURE.md
11
- - [Board reference](board.md): Readiness groups, row cells, and ordering for priority.md, the unordered backlog.md beside it, and the generated index under .canon/tasks/
12
10
  - [Branch reference](branch.md): Branch naming format and type conventions
13
- - [Canvas reference](canvas.md): Page folders, frame files, the layout.json shape, token resolution, and what a frame must not assume on a local design canvas
14
11
  - [Commit reference](commit.md): Commit message format and type conventions
15
12
  - [Context entry reference](context.md): Shape and content rules for canon/context/<domain>.md entries
16
13
  - [Design reference](design.md): Shape and content rules for canon/DESIGN.md
17
14
  - [Docs reference](docs.md): Reader and jurisdiction, frontmatter, page structure, what a page links out to, the diagram permission, and when a category earns a subfolder
18
15
  - [Figure reference](figures.md): When a figure earns its place, the render-first policy for a graph-shaped subject, freehand SVG as the escape hatch, and its wrapping, color, and accessibility rules
19
- - [Glossary reference](glossary.md): Frontmatter, entry shape, ordering, and the rules deciding which terms a glossary carries
20
- - [Groundwork spikes reference](groundwork-spikes.md): What each spike in a track's 08-spikes.md records, the sample rule, and the three folders that hold what a spike produced
21
- - [Groundwork reference](groundwork.md): Folder layout, ordinal naming, reserved numbering, frontmatter and dating, required file contents, and conventions for a measurement track
22
- - [Intake reference](intake.md): Folder layout, ordinal naming, reserved index number, frontmatter and dating, the item template, the answer contract, and retrieval
23
- - [Markdown reference](markdown.md): Headings, paragraph and list structure, code spans, the date form, punctuation, emphasis, file references, American spelling, and frontmatter wording
24
- - [Memory reference](memory.md): Filename and type prefix, frontmatter, the body shape per type, links between entries, and the lifecycle from write to retire
25
- - [Mermaid reference](mermaid.md): Direction and layout, node and edge budgets, accessibility fields, label punctuation, and render verification for a Mermaid diagram
26
- - [Plan lifecycle reference](plan-lifecycle.md): When a feature plan is written, where it lives, how it changes mid-flight, and its move to the archive
27
- - [Plan reference](plan.md): Filename and slug, the required sections, and the suggested-and-answer contract for a feature plan
28
16
  - [Pull request reference](pr.md): Pull request title and body conventions
29
17
  - [Publish reference](publish.md): Scan an author runs against finished text, the cross-reference form each destination takes, and the response to an unreadable source
30
18
  - [Readme reference](readme.md): Readme voice, structure, and content conventions
31
- - [Ready reference](ready.md): Folder layout, ordinal naming, the overview frontmatter, the thin-plan contract, and the archive lifecycle for a finished-file handoff
32
- - [Requirements reference](requirements.md): Shape and content rules for canon/REQUIREMENTS.md
33
19
  - [Governance rule reference](rule.md): Rule frontmatter, body shape, and voice for .claude/rules files
34
- - [Session map reference](session.md): Filename and location, the sections a handoff carries, the write and read procedures, and how a role extends it
35
- - [Skill path reference](skill-paths.md): Which root a file a skill body names resolves against, and how a body cites a standard
36
- - [Practice skill reference](skill-practice.md): Closing sections and source ledger for a skill carrying engineering practice
37
- - [Skill requirement reference](skill-requirement.md): Shape and content rules for the REQUIREMENT.md beside a skill
38
20
  - [Claude skill reference](skill.md): Skill structure and authoring rules for Claude Code
39
21
  - [Slug reference](slug.md): Transform from a git branch name to a slug, and the three responses to an empty result
40
22
  - [Standard reference](standard.md): Shape and content rules for authoring a standard
41
- - [Task decline reference](tasks-decline.md): Where a task decided against moves, the Declined line it carries, and what happens to its plan and board row
42
- - [Tasks reference](tasks.md): Folder layout, filename convention, file format, origin lines, and archiving for task files under .canon/tasks/
43
- - [Teach reference](teach.md): Workspace layout, ordinal naming, frontmatter, and the mission and learning-record formats for a learning workspace
44
23
  - [Versioning reference](versioning.md): Phase label vs semver discipline across tasks, PRs, reviews, issues, commits, and tags
45
- - [Wiki reference](wiki.md): Folder split, frontmatter, naming convention, and sourcing for a wiki reference page
46
- - [Wireframe reference](wireframes.md): Shape and content rules for canon/wireframes/<surface>.md files
@@ -70,7 +70,7 @@ Qualifying it against `erclx/canon` fixes nothing, because a reader holding only
70
70
 
71
71
  Write `owner/repo#123` and `owner/repo@abc1234` for a citation of a different, resolvable repository, across every such surface. `canon gate run` fails a push on a bare reference there, and a line whose bare form is the point carries `canon-allow-reference: <reason>` on itself or on the line above.
72
72
 
73
- Choose the number over the sha where the citation names a decided change, since a pull request number resolves to the diff and the review behind it. Take the sha only for a tree or measurement state, the `Measured at <sha>` shape `canon/ARCHITECTURE.md` already uses. The choice holds for both spellings this section fixes, the bare form a remote auto-links and the qualified form a cross-repository citation carries.
73
+ Choose the number over the sha where the citation names a decided change, since a pull request number resolves to the diff and the review behind it. Take the sha only for a tree or measurement state, the `Measured at <sha>` shape a context entry already uses. The choice holds for both spellings this section fixes, the bare form a remote auto-links and the qualified form a cross-repository citation carries.
74
74
 
75
75
  A commit message takes the bare form even though it is also read through the log, where nothing links. The remote is what the form is chosen for, since a reader in the log loses only a link that plain text never carried.
76
76
 
package/standards/rule.md CHANGED
@@ -57,7 +57,7 @@ The cost is that a project-authored rule's leading digit stops naming its domain
57
57
 
58
58
  The reservation above divides one pair, being a shipped set against the rules a project wrote for itself. A third source, a rule set held back from targets and installed only where it was authored, needs its own division too. This repository is the one place all three sources exist at once, and it divides the third pair two ways at once rather than one: `canon/` and `internal/` separate a shipped rule from an internal one by location, the same way `project/` separates a project-authored one, and within each subdirectory the numbering still divides by source as well, one source taking the top of the band and the other the gaps between the tens.
59
59
 
60
- The numbering half stays because location alone does not carry to a reader who only sees the number, such as one comparing `claude/567-planning.md` against a citation written before the rules moved into `canon/`.
60
+ The numbering half stays because location alone does not carry to a reader who only sees the number, such as one comparing `claude/566-output.md` against a citation written before the rules moved into `canon/`.
61
61
 
62
62
  The collision this prevents is silent. Two rules that resolve to the same `<n>-<slug>` path leave one file in the installed folder, and neither the install nor the session that reads it reports which source lost. Nothing checks a division outside the reserved bands, so it holds only while both sources follow it. Separating `canon/` from `internal/` by folder removes the filename-collision case specifically, since the two no longer install to the same directory, but the number still carries the source signal for a reader who has only the number in view.
63
63
 
@@ -149,7 +149,7 @@ allowed-tools: <tools required>
149
149
  ### Output and tuning
150
150
 
151
151
  - Skill success lines emit the full relative path from the project root (`<dir>/<file>`) for any file written, updated, or deleted. A bare filename names a file the reader cannot open. The `## Output` section of the project's instruction file sets the form that path takes, so a skill body states which path is emitted and leaves the form to that section.
152
- - Before a skill writes anything, decide whether the output is a deliverable the project keeps or a toolkit session record. A deliverable lands among the project's own tracked files. A session record lands under `.canon/`, in the named subfolder for its kind (`tasks/`, `plans/`, `review/`, `memory/`, `groundwork/`, `intake/`, `proposals/`, `diagrams/`, `teach/`, `ready/`, `feedback/`, `picks/`, `evidence/`, `transcripts/`, or `walkthroughs/`, with `tmp/` for scratch nothing else claims), never in a folder the body invents. A `review/` writer names its file `<kind>-<slug>.md` and writes it flat, and an `evidence/` folder takes the next two-digit ordinal as `<nn>-<slug>/`, numbered in the order the folders first appeared.
152
+ - Before a skill writes anything, decide whether the output is a deliverable the project keeps or a toolkit session record. A deliverable lands among the project's own tracked files. A session record lands under `.canon/`, in the named subfolder for its kind (`tasks/`, `plans/`, `review/`, `groundwork/`, `intake/`, `proposals/`, `diagrams/`, `teach/`, `ready/`, `feedback/`, `picks/`, `evidence/`, `transcripts/`, or `walkthroughs/`, with `tmp/` for scratch nothing else claims), never in a folder the body invents. A `review/` writer names its file `<kind>-<slug>.md` and writes it flat, and an `evidence/` folder takes the next two-digit ordinal as `<nn>-<slug>/`, numbered in the order the folders first appeared.
153
153
  - Codify a skill's posted or generated output as a fenced template, and keep the body consistent with every capability the frontmatter description names.
154
154
  - When a skill gathers user input or pre-seeds a template, attach a concrete proposed default to every question, derived from project context. Accept "use defaults" as a bulk-confirm.
155
155
  - Separate correctness axes (routing, sourcing, escalation, decline) from shape axes (line count, formatting, variant sprawl) when tuning a skill. Tighten only on correctness regressions, never turning a soft cap hard for aesthetic drift.
@@ -45,7 +45,7 @@ Seeds live in `tooling/base/seeds/`. Sync drops each once on first install and n
45
45
 
46
46
  - All shell scripts live in `scripts/`. Do not place a `.sh` file outside it.
47
47
  - Dictionaries live in `.cspell/`, hooks in `.husky/`, seeded context docs in `canon/context/`.
48
- - The `canon/context/` location matches the three-tier context model: project-wide invariants in `CLAUDE.md`, `canon/REQUIREMENTS.md`, and `canon/ARCHITECTURE.md`, path-scoped rules in `.claude/rules/`, and on-demand domain narrative in `canon/context/`. Indexes stay opt-in.
48
+ - The `canon/context/` location matches the three-tier context model: project-wide invariants in `CLAUDE.md` and `canon/REQUIREMENTS.md`, path-scoped rules in `.claude/rules/`, and on-demand domain narrative in `canon/context/`. Indexes stay opt-in.
49
49
 
50
50
  ## Hooks
51
51
 
@@ -10,11 +10,9 @@ The claude stack installs the `.claude/` workflow directory into a project. Stat
10
10
  CLAUDE.md ← seeded. Project context and rules, auto-loaded by Claude Code each session
11
11
 
12
12
  canon/
13
- ├── REQUIREMENTS.md ← seeded. Project goals, non-goals, MVP scope
14
- ├── ARCHITECTURE.md ← seeded. Technical design decisions and open questions
13
+ ├── REQUIREMENTS.md ← seeded. Project problem, goals, non-goals
15
14
  ├── DESIGN.md ← seeded. Visual intent and the decisions behind it
16
- ├── context/ ← seeded. Per-domain narrative. `index.md` is the discovery anchor.
17
- └── wireframes/ ← seeded. Per-surface regions and states. `index.md` is the discovery anchor; `<surface>.md` files hold the regions list, the states table, and the behavior bullets.
15
+ └── context/ ← seeded. Per-domain narrative. `index.md` is the discovery anchor.
18
16
 
19
17
  .claude/
20
18
  ├── GOV.md ← retired. Removed by `canon gov sync` if present from a prior install
@@ -24,9 +22,8 @@ canon/
24
22
  .canon/
25
23
  ├── tasks/ ← seeded. One file per task plus a generated index.md, local scratch only. `archive/` holds the tasks that shipped.
26
24
  ├── plans/ ← execution detail for multi-step tasks. `feature-*.md` entries swept by context-fold into `archive/`.
27
- ├── review/ ← one subfolder per producer. `branch/` for review-branch, `feedback/` for canon feedback, `memory/` for memory-review with its own `archive/`, `design/` for canon design render.
28
- ├── tmp/ ← ephemeral scratch space, safe to delete without loss
29
- └── memory/ ← session facts no context entry owns. `index.md` regenerated by a hook.
25
+ ├── review/ ← one subfolder per producer. `branch/` no longer written, `design/` for canon design render.
26
+ └── tmp/ ← ephemeral scratch space, safe to delete without loss
30
27
  ```
31
28
 
32
29
  One ignore entry covers `.canon/` whole, so nothing under it is named separately and nothing tracked may ever land there. A project scaffolded before the move keeps its records under `.claude/`, and every command reads either root.
@@ -35,7 +32,7 @@ One ignore entry covers `.canon/` whole, so nothing under it is named separately
35
32
 
36
33
  A project installed before the split still holds its records under `.claude/`. `canon migrate records` moves them and repoints every tracked file that cites one, reporting the plan until `--write` is passed.
37
34
 
38
- Run `canon tooling sync claude . --write` first. The verb refuses while the project does not ignore `.canon/`, because every folder it relocates is ignored where it stands and landing one under a tracked root commits the memory pen. Until the move runs, this project's records sit at a root the shipped ignore set no longer names, so a `git add -A` in that window picks them up.
35
+ Run `canon tooling sync claude . --write` first. The verb refuses while the project does not ignore `.canon/`, because every folder it relocates is ignored where it stands and landing one under a tracked root commits the task board and the plans. Until the move runs, this project's records sit at a root the shipped ignore set no longer names, so a `git add -A` in that window picks them up.
39
36
 
40
37
  The verb ships with the change that split the roots and is not in a published release yet, so an installed binary answers `unknown command` until one carries it. Run it out of a canon checkout in the meantime, as `bun src/cli.ts migrate records --root <project> --write`, and read the `ok` field out of `--json` rather than the exit code, which a shell wrapper around `canon` can flatten.
41
38
 
@@ -49,16 +46,6 @@ Convert by hand, once per project:
49
46
  2. Run `canon indexes regen --no-stage --root . .canon/tasks/<any-task>.md` to build the catalog.
50
47
  3. Delete `.claude/TASKS.md`, and swap its `.gitignore` entry for `.canon/tasks/`.
51
48
 
52
- ## Upgrading a hand-appended memory index
53
-
54
- A project installed before the memory folder gained a generated index still holds `.canon/memory/MEMORY.md`, and its entries still carry `name` and `type` frontmatter. Nothing migrates it. `memory-capture` stops appending rows once the new seed lands, so the old file freezes at whatever it held while the folder keeps growing past it.
55
-
56
- Convert by hand, once per project:
57
-
58
- 1. Rewrite each entry's `name` key to `title` and its `type` key to a sentence-case `category`, quoting any `description` that opens with a backtick or a colon so the frontmatter parses.
59
- 2. Replace `MEMORY.md` with an `index.md` carrying `title` and `subtitle` frontmatter and nothing else.
60
- 3. Run `canon indexes regen --no-stage --root . .canon/memory/index.md` to build the catalog, and compare its entry count against the file count before deleting anything.
61
-
62
49
  ## Gitignore
63
50
 
64
51
  - `# Claude`: `.canon/`, `.claude/worktrees/`, `.claude/.tmp/` <!-- canon-keep-record-root -->
@@ -76,8 +63,7 @@ The first entry covers the whole record root, so a record folder added later nee
76
63
  ## CLAUDE.md
77
64
 
78
65
  - Ships as a seed with placeholder project name, description, and key paths. Fill these in after init.
79
- - Section layout: `Context`, `Indexes`, `Markdown`, `Key paths`, `Spelling`, `Tasks`, `Memory`. Each section groups rules that share a surface so skills can detect, extend, or skip by heading.
80
- - The memory rules favor signal over volume. Saving only after a second occurrence or an explicit user correction keeps entries focused on patterns worth preventing, not first-occurrence slips. The 3-line cap stops the built-in auto-memory from drifting into narrative writeups that bury the rule underneath the recovery story.
66
+ - Section layout: `Context`, `Commands`, `Key paths`. Each section groups rules that share a surface so skills can detect, extend, or skip by heading.
81
67
  - The `Context` section points at `.claude/` state docs one line. `plan-feature` does the parallel read when invoked. The seed intentionally does not re-list every file.
82
68
 
83
69
  ## Seed docs
@@ -53,5 +53,5 @@ marker="$marker_dir/$key"
53
53
  mkdir -p "$marker_dir"
54
54
  : >"$marker"
55
55
 
56
- msg=$(printf 'An index.md exists at %s. Read it before searching this folder, it catalogs the sibling files faster than a blind search. For a cross-folder answer, run canon indexes list --json or invoke the index-lookup skill.' "$index")
56
+ msg=$(printf 'An index.md exists at %s. Read it before searching this folder, it catalogs the sibling files faster than a blind search. For a cross-folder answer, run canon indexes list --json.' "$index")
57
57
  jq -nc --arg msg "$msg" '{hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:$msg}}'
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- # Regenerates the index.md of a gitignored record folder, `tasks` or `memory`,
4
- # after a file in it changes.
3
+ # Regenerates the index.md of the gitignored `tasks` record folder after a
4
+ # file in it changes.
5
5
  #
6
- # These folders are gitignored, so the whole-repo walk in `bun run check` drops
7
- # them and never regenerates their index. Naming the file as a positional
6
+ # That folder is gitignored, so the whole-repo walk in `bun run check` drops
7
+ # it and never regenerates its index. Naming the file as a positional
8
8
  # argument to `canon indexes regen` below bypasses that filter, which makes this
9
- # hook the only trigger that reaches either folder.
9
+ # hook the only trigger that reaches the folder.
10
10
 
11
11
  # Claude Code sends a payload and closes stdin. A bare read with nothing feeding
12
12
  # it blocks forever and holds the session open, so the read is bounded. `read`
@@ -31,11 +31,9 @@ file_path=$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty')
31
31
  # said. The index then goes stale while every save reports success.
32
32
  #
33
33
  # A shell `case` `*` crosses `/`, so each arm also matches a file in a subfolder
34
- # the index does not render: an archived or declined task, a memory receipt, a
35
- # retired memory entry, or the index itself. Those exit here, before the regen
36
- # call. The exclusions are per folder, since a task under `review/` is indexed
37
- # and a memory `declined/` is not special. The arms are ordered tasks first,
38
- # and no path carries both segments today.
34
+ # the index does not render: an archived or declined task, or the index itself.
35
+ # Those exit here, before the regen call. A task under `review/` is
36
+ # indexed, and no other folder is read.
39
37
  #
40
38
  # The walk-up boundary has to come from the path, not from the session. Shared
41
39
  # scratch resolves at the main worktree root, so a session inside a linked
@@ -45,8 +43,6 @@ file_path=$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty')
45
43
  case "$file_path" in
46
44
  */.canon/tasks/index.md | */.canon/tasks/archive/* | */.canon/tasks/declined/*) exit 0 ;;
47
45
  */.claude/tasks/index.md | */.claude/tasks/archive/* | */.claude/tasks/declined/*) exit 0 ;;
48
- */.canon/memory/index.md | */.canon/memory/review/* | */.canon/memory/archive/*) exit 0 ;;
49
- */.claude/memory/index.md | */.claude/memory/review/* | */.claude/memory/archive/*) exit 0 ;;
50
46
  */.canon/tasks/*.md)
51
47
  folder=tasks
52
48
  base=.canon
@@ -55,14 +51,6 @@ case "$file_path" in
55
51
  folder=tasks
56
52
  base=.claude
57
53
  ;;
58
- */.canon/memory/*.md)
59
- folder=memory
60
- base=.canon
61
- ;;
62
- */.claude/memory/*.md)
63
- folder=memory
64
- base=.claude
65
- ;;
66
54
  *) exit 0 ;;
67
55
  esac
68
56
  root="${file_path%/"$base/$folder"/*}"
@@ -18,12 +18,12 @@ case "$file" in
18
18
  *) exit 0 ;;
19
19
  esac
20
20
 
21
- # Four record folders, at either root. A skip list fixed at the old spelling
21
+ # Three record folders, at either root. A skip list fixed at the old spelling
22
22
  # audits a project's own session records the moment the move reaches it, which
23
23
  # reports findings against prose nobody publishes.
24
24
  case "$file" in
25
- *.claude/.tmp/* | *.claude/memory/* | *.claude/review/* | *.claude/plans/*) exit 0 ;;
26
- *.canon/tmp/* | *.canon/memory/* | *.canon/review/* | *.canon/plans/*) exit 0 ;;
25
+ *.claude/.tmp/* | *.claude/review/* | *.claude/plans/*) exit 0 ;;
26
+ *.canon/tmp/* | *.canon/review/* | *.canon/plans/*) exit 0 ;;
27
27
  esac
28
28
 
29
29
  [ -f "$file" ] || exit 0
@@ -4,12 +4,10 @@
4
4
 
5
5
  ## Context
6
6
 
7
- - Before non-trivial work in a domain read `canon/context/<domain>.md`, and before touching a UI surface read `canon/wireframes/<surface>.md`. Pick which from the index anchors below.
7
+ - Before non-trivial work in a domain read `canon/context/<domain>.md`. Pick which from the index anchor below.
8
8
 
9
9
  @canon/REQUIREMENTS.md
10
- @canon/ARCHITECTURE.md
11
10
  @canon/context/index.md
12
- @canon/wireframes/index.md
13
11
 
14
12
  ## Commands
15
13
 
@@ -1,18 +1,11 @@
1
1
  # Requirements
2
2
 
3
+ [One line: the problem and who has it]
4
+
3
5
  Authoring guidance: the requirements standard.
4
6
 
5
7
  This record holds at most 600 words.
6
8
 
7
- ## Problem
8
-
9
9
  ## Goals
10
10
 
11
11
  ## Non-goals
12
-
13
- ## MVP features
14
-
15
- 1. Feature: description
16
- 2. Feature: description
17
-
18
- ## Constraints
@@ -58,7 +58,6 @@ const HOME_SECTIONS: CaptureSection[] = [
58
58
  { name: 'dispatch', selector: '#dispatch' },
59
59
  { name: 'workers', selector: '#workers' },
60
60
  { name: 'gate', selector: '#gate' },
61
- { name: 'memory', selector: '#memory' },
62
61
  { name: 'evidence', selector: '#evidence' },
63
62
  { name: 'loop', selector: '#loop' },
64
63
  { name: 'merge', selector: '#merge' },
@@ -1,20 +0,0 @@
1
- ---
2
- title: Review findings
3
- description: How auto-ship Step 7 splits the review receipt's findings by origin, which ones it repairs in place and which stop the chain, and the one-pass bound on the repair
4
- ---
5
-
6
- # Evaluate the review findings
7
-
8
- Step 7 of `auto-ship`. The session reads this file when Step 6 ran review rather than skipping it.
9
-
10
- Read `.canon/review/branch-<slug>.md` at the main worktree root. Split every finding by origin before parsing the summary line (`X critical, Y should-fix, Z minor`), since the stop exists for a defect the branch inherited.
11
-
12
- - **This run caused it, at any severity.** Fix it, re-run the Step 3 verify commands, re-read the fixed file against what the finding claimed, and continue. Do not report it as a stop or offer the fix as a choice.
13
- - **It predates this run, critical or should-fix.** Stop: `❌ Review found non-minor issues that predate this run. See .canon/review/branch-<slug>.md. Fix and run /git-ship.`
14
- - **It predates this run, minor only.** Continue. The minor findings stay in the on-disk review receipt. Fold any a reviewer needs into the PR's `## Technical Context`. Do not add a separate review-notes section to the PR body.
15
-
16
- Read origin as causation rather than authorship, so staleness this run induced in a file it never opened is a finding it caused.
17
-
18
- Bound the repair at one pass, the way Step 3 bounds verify. When that re-read shows the finding still standing, stop: `❌ A self-introduced finding survived one fix pass. See .canon/review/branch-<slug>.md. Fix and run /git-ship.`
19
-
20
- This chain owns the receipt's lifetime. The `context-fold` sweep under Step 8 reaches only reports whose branch is gone, so it collects this one a branch later.
@@ -1,43 +0,0 @@
1
- ---
2
- name: bash-cli-script
3
- description: What a small non-interactive shell wrapper owes its caller, and the 100-line threshold past which the work belongs in TypeScript on Bun
4
- ---
5
-
6
- # Bash CLI script requirement
7
-
8
- ## Gap
9
-
10
- Without this skill, a wrapper is written with an interactive tool's habits. Progress lines, icons, and color land on stdout, so the script stops composing in a pipe and the caller parses a spinner as data. The failure is invisible in a terminal and total in CI.
11
-
12
- The robustness failures are the ones that reach production. Without strict mode a failed stage inside a pipe exits zero and the script reports success on work that did not happen. An unset variable expands to nothing and a path built from it points somewhere nobody meant.
13
-
14
- The size failure is the slow one. A shell script that keeps growing past a wrapper's job turns into the long file nobody will touch, and the [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html) puts the line at 100: past it, the script is rewritten in a more structured language. Without a stop before generating, a session writes the long script first and the rewrite never happens.
15
-
16
- ## Must
17
-
18
- - Stop before generating when the script will run past 100 lines, and route the work to TypeScript on Bun citing the style guide
19
- - Stop the same way on a request for prompts or a terminal UI, saying why
20
- - Open with the strict-mode preamble, so a failed stage stops the script
21
- - Keep data on stdout and put every log line, progress message, and error on stderr
22
- - Exit non-zero with actionable context through one error helper
23
- - Default every variable expansion rather than relying on it being set
24
- - Guard a command that returns non-zero on a valid empty result
25
- - Run the validation list before responding
26
-
27
- ## Must not
28
-
29
- - Emit timeline frames, icons, color, or an interactive prompt
30
- - Put a log or progress line on stdout
31
- - Comment what the code already states
32
- - Rewrite an existing long shell file on contact, which is a rewrite decision rather than an edit
33
-
34
- ## Guards
35
-
36
- - A script that will run past 100 lines stops before any of it is written, and the session writes it in TypeScript on Bun instead.
37
- - A request for prompts, a framed timeline, icons, or color stops with the same route.
38
-
39
- ## Out of scope
40
-
41
- - A tool a person drives through prompts or a terminal UI, which is written in TypeScript on Bun
42
- - A GitHub Actions workflow file, which `ci-workflow` owns
43
- - Running, installing, or scheduling what it generates
@@ -1,53 +0,0 @@
1
- ---
2
- name: bash-cli-script
3
- description: Generates a small non-interactive Bash wrapper for automation, CI, and agent-run tasks, with strict mode, logs on stderr, a clean stdout, and explicit exit codes. Stops at 100 lines and routes the work to TypeScript on Bun. Use when asked for "a shell script", "a wrapper script", an automation or CI script, a cron job, or a pipeline helper. Do NOT use for a tool that prompts a person or draws a terminal UI, or for a script that will run past 100 lines. Both are written in TypeScript on Bun.
4
- metadata:
5
- family: generate
6
- ---
7
-
8
- # Bash CLI script
9
-
10
- Generate small non-interactive Bash wrappers for automation, CI, and agent-run workflows. Shell is for small utilities and simple wrappers, and anything larger is written in TypeScript on Bun, which runs a script about as fast as bash starts one.
11
-
12
- Load `${CLAUDE_SKILL_DIR}/references/template.md` for the base skeleton. Copy it and keep only what the task needs.
13
-
14
- ## Guards
15
-
16
- - Estimate the script's length before writing any of it. When it will run past 100 lines, stop and write it in TypeScript on Bun instead, saying the threshold is the one the [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html) sets: "If you are writing a script that is more than 100 lines long ... you should rewrite it in a more structured language now". Stopping after generating wastes the draft and leaves a long script to argue against.
17
- - A request for interactive prompts, a framed timeline, icons, or color stops the same way. Say that a tool a person drives is past what a wrapper is for, and offer the TypeScript route rather than generating a script with prompts.
18
- - Editing an existing shell file already over 100 lines is not a new script. Edit it in place without growing it, and flag it for a rewrite rather than rewriting it on contact.
19
-
20
- ## Script setup
21
-
22
- - Start with `#!/usr/bin/env bash` and `set -euo pipefail`.
23
- - Do not rely on unset variables. Use `${VAR:-default}`.
24
-
25
- ## Output contract
26
-
27
- - Write data to stdout. Write logs, progress, and errors to stderr.
28
- - Keep stdout clean so the script composes in a pipe.
29
- - Do not emit timeline frames, icons, or color.
30
-
31
- ## Error handling
32
-
33
- - Define `die()` that prints an error to stderr and exits non-zero.
34
- - Include actionable context in error messages.
35
- - Guard commands that return non-zero on a valid empty result with `|| true`.
36
- - Set explicit exit codes. Reserve 0 for success.
37
- - Read a called command's machine-readable record where it emits one. An exit status separates success from failure and never names which failure, so a script routing on the reason reads the record and keeps the exit for the pass-fail decision alone.
38
-
39
- ## Code style
40
-
41
- - Quote variables in expansions and test brackets.
42
- - Comment only a fact the reader cannot recover from the code, and follow the code-comment rule in `.claude/rules/` when the project installs it.
43
- - Use 2-space indentation.
44
-
45
- ## Validation
46
-
47
- Before responding, verify:
48
-
49
- - The script is 100 lines or fewer.
50
- - File starts with `#!/usr/bin/env bash` and `set -euo pipefail`.
51
- - Data goes to stdout, logs and errors go to stderr.
52
- - No timeline frames, icons, or interactive prompts.
53
- - Errors exit non-zero with context through `die()`.