@erclx/canon 5.34.0 → 5.36.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 (248) hide show
  1. package/README.md +15 -17
  2. package/claude/.claude-plugin/plugin.json +1 -1
  3. package/claude/skills/api-design/REQUIREMENT.md +1 -1
  4. package/claude/skills/auto-ship/references/draft-mark.md +1 -1
  5. package/claude/skills/canon-cli/REQUIREMENT.md +2 -2
  6. package/claude/skills/canon-cli/SKILL.md +12 -12
  7. package/claude/skills/canvas-board/REQUIREMENT.md +1 -1
  8. package/claude/skills/canvas-board/SKILL.md +2 -2
  9. package/claude/skills/canvas-board/references/design.md +53 -36
  10. package/claude/skills/codebase-layout/REQUIREMENT.md +1 -1
  11. package/claude/skills/codebase-layout/SKILL.md +2 -2
  12. package/claude/skills/create-rule/REQUIREMENT.md +6 -8
  13. package/claude/skills/create-rule/SKILL.md +8 -8
  14. package/claude/skills/create-rule/references/rule.md +11 -23
  15. package/claude/skills/create-skill/SKILL.md +2 -1
  16. package/claude/skills/create-skill/references/skill-paths.md +12 -15
  17. package/{standards/standard.md → claude/skills/create-skill/references/skill-reference.md} +50 -45
  18. package/claude/skills/create-skill/references/skill.md +9 -3
  19. package/claude/skills/design-taste/REQUIREMENT.md +6 -6
  20. package/claude/skills/design-taste/SKILL.md +2 -2
  21. package/claude/skills/design-taste/references/craft.md +1 -1
  22. package/claude/skills/design-taste/references/preflight.md +2 -2
  23. package/claude/skills/design-taste/references/tells.md +1 -1
  24. package/claude/skills/draft-and-pick/SKILL.md +1 -1
  25. package/claude/skills/draft-identity/SKILL.md +3 -2
  26. package/claude/skills/git-commit/references/versioning.md +13 -13
  27. package/claude/skills/git-pr/SKILL.md +1 -1
  28. package/claude/skills/git-pr/references/publish.md +1 -1
  29. package/claude/skills/markdown-craft/references/markdown.md +3 -2
  30. package/claude/skills/plan-feature/SKILL.md +1 -1
  31. package/claude/skills/review-address/REQUIREMENT.md +1 -1
  32. package/claude/skills/review-address/SKILL.md +2 -2
  33. package/claude/skills/review-craft/references/ui.md +1 -1
  34. package/claude/skills/review-pr/SKILL.md +3 -3
  35. package/claude/skills/review-pr/references/post.md +1 -1
  36. package/claude/skills/review-ui/REQUIREMENT.md +1 -1
  37. package/claude/skills/review-ui/SKILL.md +1 -1
  38. package/claude/skills/role-orchestrator/REQUIREMENT.md +2 -2
  39. package/claude/skills/role-orchestrator/SKILL.md +11 -12
  40. package/claude/skills/role-orchestrator/references/orchestrator-cloud-launch.md +3 -1
  41. package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +11 -8
  42. package/claude/skills/role-orchestrator/references/orchestrator-handback.md +10 -4
  43. package/claude/skills/role-orchestrator/references/orchestrator-launch.md +2 -2
  44. package/claude/skills/role-orchestrator/references/orchestrator-poll.md +11 -12
  45. package/claude/skills/role-orchestrator/references/orchestrator-review-dispatch.md +12 -15
  46. package/claude/skills/role-orchestrator/references/orchestrator-reviewer-launch.md +6 -4
  47. package/claude/skills/role-orchestrator/scripts/poll.ts +50 -1
  48. package/claude/skills/role-reviewer/REQUIREMENT.md +17 -7
  49. package/claude/skills/role-reviewer/SKILL.md +17 -10
  50. package/claude/skills/role-worker/REQUIREMENT.md +1 -1
  51. package/claude/skills/role-worker/SKILL.md +6 -6
  52. package/claude/skills/session-compact/references/handoff-note.md +1 -1
  53. package/claude/skills/target-setup/SKILL.md +2 -2
  54. package/claude/skills/target-setup/references/detect.md +3 -3
  55. package/claude/skills/test-craft/SKILL.md +2 -2
  56. package/claude/skills/ux-audit/REQUIREMENT.md +1 -1
  57. package/claude/skills/ux-audit/SKILL.md +2 -2
  58. package/claude/skills/ux-measure/REQUIREMENT.md +1 -1
  59. package/claude/skills/write-human/references/machine-tells.md +12 -0
  60. package/docs/agents/audits.md +1 -1
  61. package/docs/agents/commands.md +14 -13
  62. package/docs/agents/comments.md +1 -1
  63. package/docs/agents/counts.md +5 -6
  64. package/docs/agents/drift-surfaces.md +15 -19
  65. package/docs/agents/gov-detect.md +1 -1
  66. package/docs/agents/index.md +2 -3
  67. package/docs/agents/install-and-sync.md +10 -34
  68. package/docs/agents/markdown-audit.md +22 -12
  69. package/docs/agents/migrate.md +1 -1
  70. package/docs/agents/output-shape.md +1 -1
  71. package/docs/agents/overview.md +2 -2
  72. package/docs/agents/records-stale.md +1 -1
  73. package/docs/agents/records-validate.md +11 -23
  74. package/docs/agents/records.md +1 -1
  75. package/docs/agents/routing.md +1 -1
  76. package/docs/agents/rule-citations.md +9 -17
  77. package/docs/agents/scripting.md +2 -20
  78. package/docs/agents/state-scoped-risk.md +1 -1
  79. package/docs/agents/tasks-validate.md +1 -1
  80. package/docs/agents/teach.md +1 -1
  81. package/docs/target/index.md +1 -0
  82. package/docs/target/migrations.md +4 -0
  83. package/docs/target/projects.md +10 -10
  84. package/docs/target/scenarios.md +5 -6
  85. package/docs/target/standards-moved.md +32 -0
  86. package/docs/target/sync.md +5 -5
  87. package/docs/workflow/ai-workflow.md +1 -1
  88. package/docs/workflow/operating-model.md +16 -18
  89. package/docs/workflow/skill-map.md +1 -1
  90. package/docs/workflow/visual-design-workflow.md +3 -3
  91. package/governance/detect.toml +32 -36
  92. package/governance/renames.toml +44 -1
  93. package/governance/rules/lib/{305-e2e-reliability.md → e2e-reliability.md} +1 -1
  94. package/governance/rules/lib/{306-test-scope.md → test-scope.md} +2 -2
  95. package/governance/rules/ui/{410-a11y.md → a11y.md} +1 -1
  96. package/governance/rules/ui/{440-surface-capture.md → surface-capture.md} +3 -3
  97. package/governance/stacks/base.toml +15 -8
  98. package/governance/stacks/go.toml +2 -0
  99. package/governance/stacks/node.toml +1 -1
  100. package/governance/stacks/php.toml +2 -0
  101. package/governance/stacks/python.toml +1 -1
  102. package/package.json +1 -4
  103. package/scripts/core/install-check.sh +4 -10
  104. package/src/audits/catalog.ts +0 -9
  105. package/src/capture/frame-values.ts +3 -6
  106. package/src/claude/routing.ts +1 -1
  107. package/src/claude/skills-reach.ts +4 -6
  108. package/src/cli/help-all.ts +96 -0
  109. package/src/cli/help.ts +29 -29
  110. package/src/cli.ts +8 -3
  111. package/src/commands/claude.ts +29 -0
  112. package/src/commands/design.ts +22 -1
  113. package/src/commands/gov.ts +29 -11
  114. package/src/commands/init.ts +10 -1
  115. package/src/commands/labels.ts +4 -44
  116. package/src/commands/markdown.ts +96 -3
  117. package/src/commands/migrate.ts +1 -1
  118. package/src/commands/records.ts +5 -21
  119. package/src/commands/sync.ts +11 -0
  120. package/src/commands/tooling.ts +10 -4
  121. package/src/counts/catalogs.ts +0 -6
  122. package/src/design/budget.ts +14 -10
  123. package/src/design/document.ts +5 -5
  124. package/src/design/parse.ts +21 -4
  125. package/src/design/render.ts +3 -3
  126. package/src/gate/boundaries.ts +2 -2
  127. package/src/gate/measures.ts +7 -29
  128. package/src/gate/sequencer.ts +51 -2
  129. package/src/gate/stages.ts +0 -18
  130. package/src/gov/citations.ts +16 -71
  131. package/src/gov/stacks.ts +3 -3
  132. package/src/inventory/subjects.ts +1 -1
  133. package/src/markdown/bans.ts +1 -1
  134. package/src/markdown/ceiling.ts +6 -1
  135. package/src/markdown/colons.ts +86 -0
  136. package/src/markdown/gate.ts +15 -0
  137. package/src/markdown/heading-case.ts +74 -0
  138. package/src/migrate/scratch-evidence.ts +2 -2
  139. package/src/records/validate.ts +6 -194
  140. package/src/sandbox/provision.ts +0 -5
  141. package/src/secrets/shipped.ts +1 -2
  142. package/src/serve/static.ts +1 -2
  143. package/src/shipped/references.ts +42 -93
  144. package/src/sync/check.ts +18 -14
  145. package/src/sync/copy.ts +4 -5
  146. package/src/tooling/inject.ts +6 -37
  147. package/src/tooling/read.ts +2 -3
  148. package/src/tooling/scan.ts +4 -17
  149. package/src/tooling/subfolder.ts +2 -66
  150. package/tooling/astro/manifest.toml +0 -1
  151. package/tooling/astro/reference.md +0 -8
  152. package/tooling/base/configs/scripts/verify.json +1 -1
  153. package/tooling/base/configs/scripts/verify.ts +22 -17
  154. package/tooling/base/manifest.toml +7 -7
  155. package/tooling/base/reference.md +19 -32
  156. package/tooling/base/seeds/.github/workflows/verify.yml +0 -9
  157. package/tooling/base/seeds/.lintstagedrc +2 -4
  158. package/tooling/base/seeds/canon/context/ci.md +4 -6
  159. package/tooling/base/seeds/canon/context/development.md +2 -2
  160. package/tooling/claude/reference.md +1 -1
  161. package/tooling/claude/seeds/.claude/hooks/review-post-scan.sh +13 -1
  162. package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +1 -1
  163. package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +27 -2
  164. package/tooling/claude/seeds/CLAUDE.md +1 -1
  165. package/tooling/claude/seeds/canon/DESIGN.md +24 -37
  166. package/tooling/go/reference.md +1 -1
  167. package/tooling/php/reference.md +1 -1
  168. package/tooling/python/reference.md +2 -2
  169. package/tooling/shell/configs/.github/workflows/shell.yml +30 -0
  170. package/tooling/shell/manifest.toml +12 -0
  171. package/tooling/shell/reference.md +46 -0
  172. package/tooling/vite-react/manifest.toml +0 -1
  173. package/tooling/vite-react/reference.md +0 -8
  174. package/tooling/web/configs/.github/workflows/readme-screenshot.yml +3 -5
  175. package/tooling/web/configs/.github/workflows/verify.yml +0 -9
  176. package/tooling/web/manifest.toml +1 -2
  177. package/tooling/web/reference.md +4 -6
  178. package/docs/agents/standards-audit.md +0 -40
  179. package/governance/rules/tooling/765-spelling.md +0 -19
  180. package/governance/stacks/astro.toml +0 -2
  181. package/governance/stacks/nextjs.toml +0 -2
  182. package/governance/stacks/node-server.toml +0 -2
  183. package/governance/stacks/python-fastapi.toml +0 -2
  184. package/governance/stacks/react.toml +0 -2
  185. package/src/commands/standards.ts +0 -278
  186. package/src/labels/spelling.ts +0 -120
  187. package/src/standards/audit.ts +0 -146
  188. package/src/standards/list.ts +0 -33
  189. package/src/standards/read.ts +0 -177
  190. package/src/standards/scope.ts +0 -56
  191. package/standards/index.md +0 -10
  192. package/tooling/base/configs/.vscode/extensions.json +0 -9
  193. package/tooling/base/configs/.vscode/settings.json +0 -3
  194. package/tooling/base/configs/scripts/verify.sh +0 -2
  195. package/tooling/base/seeds/.cspell/project-terms.txt +0 -0
  196. package/tooling/base/seeds/.cspell/tech-stack.txt +0 -25
  197. package/tooling/base/seeds/cspell.json +0 -20
  198. package/tooling/go/seeds/.cspell/tech-stack.txt +0 -16
  199. package/tooling/nextjs/seeds/.cspell/tech-stack.txt +0 -3
  200. package/tooling/php/seeds/.cspell/tech-stack.txt +0 -5
  201. package/tooling/python/seeds/.cspell/tech-stack.txt +0 -18
  202. package/tooling/vite-react/seeds/.cspell/project-terms.txt +0 -1
  203. package/tooling/vite-react/seeds/.cspell/tech-stack.txt +0 -2
  204. package/tooling/web/configs/.vscode/extensions.json +0 -13
  205. package/tooling/web/configs/.vscode/settings.json +0 -10
  206. package/tooling/web/seeds/.cspell/tech-stack.txt +0 -21
  207. /package/governance/rules/canon/{606-git.md → git.md} +0 -0
  208. /package/governance/rules/canon/{611-indexes.md → indexes.md} +0 -0
  209. /package/governance/rules/canon/{604-scratch.md → scratch.md} +0 -0
  210. /package/governance/rules/canon/{602-tasks.md → task-scope.md} +0 -0
  211. /package/governance/rules/canon/{605-worktrees.md → worktrees.md} +0 -0
  212. /package/governance/rules/claude/{566-output.md → output.md} +0 -0
  213. /package/governance/rules/code/{000-code.md → routing.md} +0 -0
  214. /package/governance/rules/code/{010-testing.md → testing.md} +0 -0
  215. /package/governance/rules/framework/{210-astro.md → astro.md} +0 -0
  216. /package/governance/rules/framework/{220-fastapi.md → fastapi.md} +0 -0
  217. /package/governance/rules/framework/{230-nextjs.md → nextjs.md} +0 -0
  218. /package/governance/rules/framework/{200-react.md → react.md} +0 -0
  219. /package/governance/rules/framework/{260-shadcn.md → shadcn.md} +0 -0
  220. /package/governance/rules/framework/{250-tailwind.md → tailwind.md} +0 -0
  221. /package/governance/rules/lang/{130-go.md → go.md} +0 -0
  222. /package/governance/rules/lang/{140-php.md → php.md} +0 -0
  223. /package/governance/rules/lang/{110-python.md → python.md} +0 -0
  224. /package/governance/rules/lang/{100-typescript.md → typescript.md} +0 -0
  225. /package/governance/rules/lib/{370-database.md → database.md} +0 -0
  226. /package/governance/rules/lib/{340-pydantic.md → pydantic.md} +0 -0
  227. /package/governance/rules/lib/{360-security-server.md → security-server.md} +0 -0
  228. /package/governance/rules/lib/{350-security-web.md → security-web.md} +0 -0
  229. /package/governance/rules/lib/{320-tanstack-query.md → tanstack-query.md} +0 -0
  230. /package/governance/rules/lib/{335-testing-go.md → testing-go.md} +0 -0
  231. /package/governance/rules/lib/{336-testing-php.md → testing-php.md} +0 -0
  232. /package/governance/rules/lib/{330-testing-py.md → testing-py.md} +0 -0
  233. /package/governance/rules/lib/{300-testing-ts.md → testing-ts.md} +0 -0
  234. /package/governance/rules/lib/{310-zod.md → zod.md} +0 -0
  235. /package/governance/rules/tooling/{700-ci-workflow.md → ci-workflow.md} +0 -0
  236. /package/governance/rules/tooling/{790-code-comments.md → code-comments.md} +0 -0
  237. /package/governance/rules/tooling/{780-config-comments.md → config-comments.md} +0 -0
  238. /package/governance/rules/tooling/{775-dependencies.md → dependencies.md} +0 -0
  239. /package/governance/rules/ui/{480-canvas.md → canvas.md} +0 -0
  240. /package/governance/rules/ui/{400-ui.md → copy.md} +0 -0
  241. /package/governance/rules/ui/{460-design-taste.md → design-taste.md} +0 -0
  242. /package/governance/rules/ui/{420-forms.md → forms.md} +0 -0
  243. /package/governance/rules/ui/{465-interface-casing.md → interface-casing.md} +0 -0
  244. /package/governance/rules/ui/{450-link-behavior.md → link-behavior.md} +0 -0
  245. /package/governance/rules/ui/{470-motion.md → motion.md} +0 -0
  246. /package/governance/rules/ui/{430-ux-completeness.md → ux-completeness.md} +0 -0
  247. /package/tooling/{base → shell}/configs/.editorconfig +0 -0
  248. /package/tooling/{base → shell}/configs/.shellcheckrc +0 -0
@@ -1,177 +0,0 @@
1
- import { existsSync, readdirSync, readFileSync } from 'node:fs'
2
- import { basename, join } from 'node:path'
3
- import { stripFrontmatter } from '@/markdown/frontmatter'
4
- import { PROJECT_ROOT } from '@/roots/project'
5
-
6
- export const INDEX_FILE = 'index.md'
7
-
8
- /** The folder a repository authors standards in, toolkit or project alike. */
9
- export function standardsSourceDir(root: string): string {
10
- return join(root, 'standards')
11
- }
12
-
13
- /**
14
- * Spells the package root in a report where every other root spells a
15
- * project-relative path. The `source` field promises a path inside the project
16
- * and a package copy is the one source that promise cannot cover, so the
17
- * spelling has to be one nothing will join to a project root.
18
- */
19
- const PACKAGE_LABEL = '<canon>'
20
-
21
- export interface StandardRoot {
22
- /** Absolute directory to search. */
23
- readonly dir: string
24
- /** How a report spells a copy found under this root. */
25
- readonly label: string
26
- }
27
-
28
- export interface ResolvedStandard {
29
- readonly path: string
30
- /** The label of the root that won, joined to the filename. */
31
- readonly source: string
32
- }
33
-
34
- /**
35
- * The roots a standard resolves against. No toolkit standard installs into a
36
- * project any more, so `.claude/standards/` is gone from the list, no repository
37
- * generates one, and a target
38
- * carries neither entry below: the package corpus is the only root that
39
- * answers there, which is what leaves no precedence to reason about.
40
- *
41
- * The authoring root stays ahead of the package corpus for the repository that
42
- * writes standards, where an edit in progress has to win over the copy
43
- * `package.json` shipped. A project that authors standards of its own is the
44
- * same case under the same folder.
45
- */
46
- export function standardRoots(root: string): StandardRoot[] {
47
- return [
48
- { dir: standardsSourceDir(root), label: 'standards' },
49
- {
50
- dir: standardsSourceDir(PROJECT_ROOT),
51
- label: join(PACKAGE_LABEL, 'standards'),
52
- },
53
- ]
54
- }
55
-
56
- /**
57
- * Standards retired into the skill reference that took them, keyed by name with
58
- * a path relative to the package root. Each retirement adds one line, and the
59
- * map goes with the verb in the last slice of the retirement.
60
- */
61
- const MOVED_STANDARDS: Readonly<Record<string, string>> = {
62
- board: 'claude/skills/task-board/references/board.md',
63
- context: 'claude/skills/context-fold/references/context.md',
64
- design: 'claude/skills/canvas-board/references/design.md',
65
- docs: 'claude/skills/docs-sync/references/docs.md',
66
- figures: 'claude/skills/draft-figure/references/figures.md',
67
- readme: 'claude/skills/docs-sync/references/readme.md',
68
- rule: 'claude/skills/create-rule/references/rule.md',
69
- skill: 'claude/skills/create-skill/references/skill.md',
70
- branch: 'claude/skills/git-branch/references/branch.md',
71
- commit: 'claude/skills/git-commit/references/commit.md',
72
- pr: 'claude/skills/git-pr/references/pr.md',
73
- publish: 'claude/skills/git-pr/references/publish.md',
74
- slug: 'claude/skills/git-branch/references/slug.md',
75
- versioning: 'claude/skills/git-commit/references/versioning.md',
76
- markdown: 'claude/skills/markdown-craft/references/markdown.md',
77
- canvas: 'claude/skills/canvas-board/references/canvas.md',
78
- glossary: 'claude/skills/teach-workspace/references/glossary.md',
79
- groundwork: 'claude/skills/plan-groundwork/references/groundwork.md',
80
- 'groundwork-spikes':
81
- 'claude/skills/plan-groundwork/references/groundwork-spikes.md',
82
- intake: 'claude/skills/plan-intake/references/intake.md',
83
- mermaid: 'claude/skills/draft-figure/references/mermaid.md',
84
- plan: 'claude/skills/plan-feature/references/plan.md',
85
- 'plan-lifecycle': 'claude/skills/plan-feature/references/plan-lifecycle.md',
86
- ready: 'claude/skills/draft-ready/references/ready.md',
87
- requirements: 'claude/skills/draft-doc/references/requirements.md',
88
- 'skill-paths': 'claude/skills/create-skill/references/skill-paths.md',
89
- 'skill-practice': 'claude/skills/create-skill/references/skill-practice.md',
90
- session: 'claude/skills/session-map/references/session.md',
91
- 'skill-requirement':
92
- 'claude/skills/create-skill/references/skill-requirement.md',
93
- tasks: 'claude/skills/task-board/references/tasks.md',
94
- 'tasks-decline': 'claude/skills/task-board/references/tasks-decline.md',
95
- teach: 'claude/skills/teach-workspace/references/teach.md',
96
- wiki: 'claude/skills/draft-doc/references/wiki.md',
97
- }
98
-
99
- /**
100
- * The package-relative path a retired standard now lives at, so a caller that
101
- * resolves against a root of its own tests the same map the verb reads.
102
- */
103
- export function movedStandardPath(name: string): string | undefined {
104
- if (!Object.hasOwn(MOVED_STANDARDS, name)) return undefined
105
-
106
- return MOVED_STANDARDS[name]
107
- }
108
-
109
- function filename(name: string): string {
110
- return name.endsWith('.md') ? name : `${name}.md`
111
- }
112
-
113
- /** Resolves a standard by name, with or without the extension. */
114
- export function resolveStandard(
115
- root: string,
116
- name: string,
117
- ): ResolvedStandard | undefined {
118
- const file = filename(name)
119
-
120
- for (const { dir, label } of standardRoots(root)) {
121
- const path = join(dir, file)
122
- if (existsSync(path)) return { path, source: join(label, file) }
123
- }
124
-
125
- const movedName = basename(file, '.md')
126
- if (!Object.hasOwn(MOVED_STANDARDS, movedName)) return undefined
127
-
128
- const moved = MOVED_STANDARDS[movedName]
129
- if (!moved) return undefined
130
-
131
- const path = join(PROJECT_ROOT, moved)
132
- if (!existsSync(path)) return undefined
133
-
134
- return { path, source: join(PACKAGE_LABEL, moved) }
135
- }
136
-
137
- /**
138
- * Names every standard a resolve could reach, deduplicated across the roots and
139
- * sorted. Shown when a name misses, so it doubles as the answer to what the
140
- * caller should have typed.
141
- */
142
- export function listStandards(root: string): string[] {
143
- const names = new Set<string>()
144
-
145
- for (const { dir } of standardRoots(root)) {
146
- if (!existsSync(dir)) continue
147
-
148
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
149
- if (!entry.isFile()) continue
150
- if (!entry.name.endsWith('.md')) continue
151
- if (entry.name === INDEX_FILE) continue
152
-
153
- names.add(basename(entry.name, '.md'))
154
- }
155
- }
156
-
157
- for (const name of Object.keys(MOVED_STANDARDS)) names.add(name)
158
-
159
- return [...names].sort()
160
- }
161
-
162
- /**
163
- * Pairs each listed name with the copy a resolve would read, so a catalog shows
164
- * what `canon standards <name>` prints rather than every file a root holds.
165
- */
166
- export function resolveAllStandards(
167
- root: string,
168
- ): Array<ResolvedStandard & { readonly name: string }> {
169
- return listStandards(root).flatMap((name) => {
170
- const resolved = resolveStandard(root, name)
171
- return resolved ? [{ name, ...resolved }] : []
172
- })
173
- }
174
-
175
- export function readStandard(standard: ResolvedStandard): string {
176
- return stripFrontmatter(readFileSync(standard.path, 'utf8'))
177
- }
@@ -1,56 +0,0 @@
1
- import { linesOutsideFences } from '@/markdown/scan'
2
-
3
- const SCOPE_HEADING = /^##[ \t]+Scope[ \t]*$/
4
- const ANY_HEADING = /^#{1,6}[ \t]+\S/
5
- const CODE_SPAN = /`([^`]+)`/g
6
-
7
- /** What an attribute standard says of itself, since it names no path. */
8
- export const ATTRIBUTE_MARKER = 'attribute standard'
9
-
10
- export interface Scope {
11
- /** The first non-blank line under the heading, which is the statement. */
12
- readonly statement: string
13
- readonly lines: readonly string[]
14
- }
15
-
16
- export function readScope(text: string): Scope | undefined {
17
- const lines = linesOutsideFences(text)
18
- const opened = lines.findIndex((line) => SCOPE_HEADING.test(line.trim()))
19
- if (opened === -1) return undefined
20
-
21
- const body: string[] = []
22
-
23
- for (const line of lines.slice(opened + 1)) {
24
- if (ANY_HEADING.test(line.trim())) break
25
- body.push(line)
26
- }
27
-
28
- const statement = body.find((line) => line.trim().length > 0)
29
-
30
- return { statement: statement?.trim() ?? '', lines: body }
31
- }
32
-
33
- /**
34
- * The paths a scope statement declares: backticked spans in the first sentence
35
- * alone. The catalog's `appliesTo` field and the records gate both read the
36
- * statement through this, since one sentence read two ways would let a standard
37
- * pass the gate while publishing a different jurisdiction to every consumer.
38
- */
39
- export function governedPaths(statement: string): string[] {
40
- const [sentence] = statement.split('. ')
41
- return [...sentence.matchAll(CODE_SPAN)].map((match) => match[1])
42
- }
43
-
44
- /**
45
- * The jurisdiction a standard publishes. The marker is read only where the
46
- * first sentence backticks nothing, so a statement naming a path publishes that
47
- * path however the rest of it describes itself. An empty array means the
48
- * statement did not parse, which consumers report rather than skip.
49
- */
50
- export function appliesTo(text: string): string[] {
51
- const statement = readScope(text)?.statement ?? ''
52
- const paths = governedPaths(statement)
53
-
54
- if (paths.length === 0 && statement.includes(ATTRIBUTE_MARKER)) return ['*']
55
- return paths
56
- }
@@ -1,10 +0,0 @@
1
- ---
2
- title: Standards
3
- subtitle: Reference docs for consistent authoring across the toolkit and target projects.
4
- ---
5
-
6
- # Standards
7
-
8
- Reference docs for consistent authoring across the toolkit and target projects.
9
-
10
- - [Standard reference](standard.md): Shape and content rules for authoring a standard
@@ -1,9 +0,0 @@
1
- {
2
- "recommendations": [
3
- "esbenp.prettier-vscode",
4
- "streetsidesoftware.code-spell-checker",
5
- "mkhl.shfmt",
6
- "timonwong.shellcheck",
7
- "mads-hartmann.bash-ide-vscode"
8
- ]
9
- }
@@ -1,3 +0,0 @@
1
- {
2
- "shellcheck.customArgs": ["--severity=warning"]
3
- }
@@ -1,2 +0,0 @@
1
- #!/bin/bash
2
- exec bun "$(dirname "$0")/verify.ts" "$@"
File without changes
@@ -1,25 +0,0 @@
1
- canon
2
- bradlc
3
- bunx
4
- commitlint
5
- dbaeumer
6
- dotenv
7
- dotfolders
8
- erclx
9
- errexit
10
- esac
11
- esbenp
12
- eslintcache
13
- frontmatter
14
- lintstagedrc
15
- mkhl
16
- parallelizable
17
- regen
18
- scannability
19
- shellcheck
20
- shfmt
21
- timonwong
22
- wireframe
23
- wireframes
24
- worktree
25
- worktrees
@@ -1,20 +0,0 @@
1
- {
2
- "version": "0.2",
3
- "language": "en",
4
- "useGitignore": true,
5
- "gitignoreRoot": ["."],
6
- "dictionaryDefinitions": [
7
- {
8
- "name": "project-terms",
9
- "path": ".cspell/project-terms.txt",
10
- "addWords": true
11
- },
12
- {
13
- "name": "tech-stack",
14
- "path": ".cspell/tech-stack.txt",
15
- "addWords": true
16
- }
17
- ],
18
- "dictionaries": ["project-terms", "tech-stack"],
19
- "ignorePaths": [".cspell/**", ".git/**", ".claude/rules/canon/**"]
20
- }
@@ -1,16 +0,0 @@
1
- bodyclose
2
- Errorf
3
- errorlint
4
- Fatalf
5
- gofmt
6
- goimports
7
- golangci
8
- goroutine
9
- goroutines
10
- gosec
11
- httptest
12
- noctx
13
- nolint
14
- rowserrcheck
15
- sqlclosecheck
16
- unconvert
@@ -1,3 +0,0 @@
1
- logomark
2
- turbopack
3
- vercel
@@ -1,5 +0,0 @@
1
- analyse
2
- friendsofphp
3
- phpstan
4
- phpunit
5
- testdox
@@ -1,18 +0,0 @@
1
- addopts
2
- appuser
3
- asyncio
4
- coveragerc
5
- fastapi
6
- flake8
7
- htmlcov
8
- mkdocs
9
- mypy
10
- pycache
11
- pyproject
12
- pytest
13
- pythonpath
14
- PYTHONUNBUFFERED
15
- ruff
16
- testpaths
17
- venv
18
- virtualenv
@@ -1,2 +0,0 @@
1
- Vite
2
- tsgolint
@@ -1,13 +0,0 @@
1
- {
2
- "recommendations": [
3
- "esbenp.prettier-vscode",
4
- "streetsidesoftware.code-spell-checker",
5
- "mkhl.shfmt",
6
- "timonwong.shellcheck",
7
- "mads-hartmann.bash-ide-vscode",
8
- "dbaeumer.vscode-eslint",
9
- "bradlc.vscode-tailwindcss",
10
- "ms-playwright.playwright",
11
- "vitest.explorer"
12
- ]
13
- }
@@ -1,10 +0,0 @@
1
- {
2
- "shellcheck.customArgs": ["--severity=warning"],
3
- "editor.defaultFormatter": "esbenp.prettier-vscode",
4
- "editor.codeActionsOnSave": {
5
- "source.fixAll.eslint": "explicit"
6
- },
7
- "files.associations": {
8
- "*.css": "tailwindcss"
9
- }
10
- }
@@ -1,21 +0,0 @@
1
- axios
2
- cksum
3
- evenodd
4
- iconify
5
- jsdom
6
- jsxSingleQuote
7
- labelledby
8
- linecap
9
- linejoin
10
- networkidle
11
- njsproj
12
- noopener
13
- noreferrer
14
- ntvs
15
- serviceworker
16
- sidepanel
17
- tabindex
18
- toplevel
19
- viewports
20
- vitest
21
- xlink
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes