@erclx/canon 5.36.0 → 5.38.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 (165) hide show
  1. package/claude/.claude-plugin/plugin.json +1 -1
  2. package/claude/skills/api-design/SKILL.md +6 -0
  3. package/claude/skills/auto-ship/SKILL.md +1 -1
  4. package/claude/skills/backlog-triage/SKILL.md +8 -8
  5. package/claude/skills/build-in-slices/SKILL.md +7 -1
  6. package/claude/skills/build-in-slices/references/adopted.md +3 -0
  7. package/claude/skills/canon-cli/SKILL.md +3 -0
  8. package/claude/skills/canon-feedback/SKILL.md +5 -0
  9. package/claude/skills/canon-feedback-triage/SKILL.md +3 -0
  10. package/claude/skills/canvas-board/SKILL.md +3 -0
  11. package/claude/skills/canvas-board/references/canvas.md +12 -0
  12. package/claude/skills/ci-workflow/SKILL.md +5 -0
  13. package/claude/skills/code-craft/SKILL.md +6 -0
  14. package/claude/skills/context-fold/references/context.md +48 -34
  15. package/claude/skills/create-rule/SKILL.md +11 -9
  16. package/claude/skills/create-rule/references/rule.md +6 -0
  17. package/claude/skills/create-skill/SKILL.md +11 -2
  18. package/claude/skills/create-skill/references/skill-disclosure.md +26 -0
  19. package/claude/skills/create-skill/references/skill-paths.md +3 -0
  20. package/claude/skills/create-skill/references/skill-reference.md +12 -0
  21. package/claude/skills/create-skill/references/skill.md +25 -24
  22. package/claude/skills/deprecation-migration/SKILL.md +6 -0
  23. package/claude/skills/deprecation-migration/references/adopted.md +3 -0
  24. package/claude/skills/design-taste/SKILL.md +6 -0
  25. package/claude/skills/design-taste/references/craft.md +3 -0
  26. package/claude/skills/design-taste/references/preflight.md +16 -0
  27. package/claude/skills/docs-sync/references/docs.md +6 -0
  28. package/claude/skills/docs-sync/references/readme.md +15 -0
  29. package/claude/skills/draft-and-pick/SKILL.md +12 -0
  30. package/claude/skills/draft-doc/references/context.md +1 -1
  31. package/claude/skills/draft-doc/references/readme.md +3 -0
  32. package/claude/skills/draft-figure/references/mermaid.md +6 -0
  33. package/claude/skills/draft-slides/SKILL.md +3 -0
  34. package/claude/skills/git-branch/references/branch.md +16 -11
  35. package/claude/skills/git-commit/references/commit.md +19 -11
  36. package/claude/skills/git-commit/references/versioning.md +9 -0
  37. package/claude/skills/git-issue/references/issue.md +13 -9
  38. package/claude/skills/git-pr/SKILL.md +5 -0
  39. package/claude/skills/git-pr/references/pr.md +24 -6
  40. package/claude/skills/git-ship/SKILL.md +3 -0
  41. package/claude/skills/git-split/SKILL.md +6 -0
  42. package/claude/skills/git-stage/SKILL.md +3 -0
  43. package/claude/skills/git-worktree/SKILL.md +6 -6
  44. package/claude/skills/markdown-craft/references/markdown.md +25 -6
  45. package/claude/skills/plan-feature/SKILL.md +9 -0
  46. package/claude/skills/plan-feature/references/plan.md +20 -8
  47. package/claude/skills/plan-groundwork/SKILL.md +6 -0
  48. package/claude/skills/plan-groundwork/references/groundwork.md +61 -29
  49. package/claude/skills/plan-intake/references/intake.md +6 -6
  50. package/claude/skills/read-frames/SKILL.md +3 -0
  51. package/claude/skills/review-craft/SKILL.md +3 -0
  52. package/claude/skills/review-pr/references/post.md +1 -1
  53. package/claude/skills/review-ui/SKILL.md +6 -3
  54. package/claude/skills/role-orchestrator/SKILL.md +4 -1
  55. package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +7 -4
  56. package/claude/skills/role-orchestrator/references/orchestrator-parked.md +1 -1
  57. package/claude/skills/role-orchestrator/references/orchestrator-refill.md +3 -0
  58. package/claude/skills/role-planner/SKILL.md +4 -1
  59. package/claude/skills/role-worker/SKILL.md +13 -1
  60. package/claude/skills/search-craft/SKILL.md +3 -0
  61. package/claude/skills/systematic-debugging/SKILL.md +6 -0
  62. package/claude/skills/target-check/references/domains.md +5 -0
  63. package/claude/skills/target-setup/SKILL.md +8 -4
  64. package/claude/skills/target-setup/references/verify.md +6 -5
  65. package/claude/skills/task-board/references/tasks.md +12 -7
  66. package/claude/skills/task-complete/references/archive.md +3 -0
  67. package/claude/skills/teach-workspace/SKILL.md +3 -0
  68. package/claude/skills/teach-workspace/references/glossary.md +3 -0
  69. package/claude/skills/teach-workspace/references/lesson-build.md +3 -0
  70. package/claude/skills/teach-workspace/references/lesson-craft.md +3 -0
  71. package/claude/skills/teach-workspace/references/teach.md +8 -8
  72. package/claude/skills/test-craft/SKILL.md +5 -0
  73. package/claude/skills/video-craft/SKILL.md +6 -0
  74. package/claude/skills/write-human/SKILL.md +9 -0
  75. package/docs/agents/capture.md +2 -0
  76. package/docs/agents/commands.md +54 -54
  77. package/docs/agents/context-audit-checks.md +6 -0
  78. package/docs/agents/context-audit.md +8 -8
  79. package/docs/agents/context-classify.md +2 -0
  80. package/docs/agents/drift-surfaces.md +5 -5
  81. package/docs/agents/gate.md +6 -7
  82. package/docs/agents/index.md +1 -1
  83. package/docs/agents/install-and-sync.md +2 -2
  84. package/docs/agents/markdown-audit-weight.md +11 -3
  85. package/docs/agents/markdown-audit.md +2 -2
  86. package/docs/agents/pr-frames.md +17 -3
  87. package/docs/agents/sessions-transfer.md +8 -6
  88. package/docs/agents/skills-audit.md +9 -1
  89. package/docs/target/projects.md +1 -1
  90. package/docs/target/scenarios.md +2 -2
  91. package/docs/target/standards-moved.md +20 -18
  92. package/docs/workflow/ai-workflow.md +3 -0
  93. package/docs/workflow/visual-design-workflow.md +5 -0
  94. package/governance/detect.toml +6 -1
  95. package/package.json +7 -4
  96. package/scripts/core/install-check.sh +1 -1
  97. package/src/cli/help.ts +1 -1
  98. package/src/commands/claude.ts +0 -1
  99. package/src/commands/context.ts +29 -4
  100. package/src/commands/gate.ts +1 -8
  101. package/src/commands/markdown.ts +52 -0
  102. package/src/commands/pr.ts +18 -11
  103. package/src/commands/records.ts +0 -1
  104. package/src/context/audit.ts +83 -0
  105. package/src/context/classify/prompts.ts +6 -1
  106. package/src/context/gate.ts +6 -3
  107. package/src/docs/read.ts +15 -21
  108. package/src/gate/measures.ts +186 -1
  109. package/src/gate/sequencer.ts +0 -4
  110. package/src/gate/stages.ts +46 -27
  111. package/src/git/files.ts +30 -0
  112. package/src/gov/adapter.ts +2 -2
  113. package/src/gov/install.ts +2 -2
  114. package/src/gov/list.ts +1 -1
  115. package/src/gov/payload.ts +1 -1
  116. package/src/gov/stacks.ts +1 -1
  117. package/src/markdown/gate.ts +10 -0
  118. package/src/markdown/growth.ts +43 -0
  119. package/src/markdown/stacks.ts +74 -0
  120. package/src/markdown/structure.ts +73 -5
  121. package/src/migrate/rule-layout.ts +12 -12
  122. package/src/pr/frames.ts +66 -1
  123. package/src/sandbox/equivalence.ts +7 -9
  124. package/src/sync/check.ts +23 -23
  125. package/src/teach/browser/head.ts +2 -2
  126. package/src/teach/browser/sidebar.ts +3 -3
  127. package/src/teach/browser/theme.ts +2 -2
  128. package/src/tooling/inject.ts +2 -2
  129. package/src/tooling/package.ts +15 -18
  130. package/src/tooling/verify-stack.ts +6 -3
  131. package/tooling/astro/configs/.oxfmtrc.json +8 -0
  132. package/tooling/astro/configs/.prettierrc +13 -0
  133. package/tooling/astro/configs/tsconfig.json +1 -1
  134. package/tooling/astro/manifest.toml +13 -0
  135. package/tooling/astro/reference.md +17 -7
  136. package/tooling/base/configs/.oxfmtrc.json +7 -0
  137. package/tooling/base/configs/scripts/verify.json +1 -1
  138. package/tooling/base/configs/scripts/verify.ts +3 -9
  139. package/tooling/base/manifest.toml +6 -6
  140. package/tooling/base/reference.md +20 -17
  141. package/tooling/base/seeds/.lintstagedrc +1 -3
  142. package/tooling/base/seeds/canon/context/ci.md +7 -7
  143. package/tooling/base/seeds/canon/context/development.md +10 -10
  144. package/tooling/claude/manifest.toml +5 -1
  145. package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +8 -0
  146. package/tooling/go/reference.md +2 -2
  147. package/tooling/nextjs/configs/.oxlintrc.json +223 -0
  148. package/tooling/nextjs/manifest.toml +2 -5
  149. package/tooling/nextjs/reference.md +4 -4
  150. package/tooling/php/manifest.toml +6 -1
  151. package/tooling/php/reference.md +2 -2
  152. package/tooling/python/manifest.toml +6 -1
  153. package/tooling/python/reference.md +4 -4
  154. package/tooling/vite-react/configs/tsconfig.json +1 -1
  155. package/tooling/vite-react/configs/vitest.config.ts +1 -1
  156. package/tooling/vite-react/manifest.toml +1 -4
  157. package/tooling/vite-react/reference.md +5 -5
  158. package/tooling/web/configs/.oxlintrc.json +213 -0
  159. package/tooling/web/configs/src/test/setup.ts +1 -1
  160. package/tooling/web/manifest.toml +12 -16
  161. package/tooling/web/reference.md +15 -15
  162. package/tooling/base/configs/.prettierrc +0 -12
  163. package/tooling/base/seeds/.prettierignore +0 -0
  164. package/tooling/nextjs/configs/eslint.config.js +0 -91
  165. package/tooling/web/configs/eslint.config.js +0 -82
@@ -14,24 +14,24 @@ Owns how the project runs on a developer machine: installing the toolchain, the
14
14
  - `scripts/` owns the shell scripts the package scripts below call
15
15
  - `.husky/` owns the git hooks
16
16
 
17
- ## Setup
17
+ ### Setup
18
18
 
19
19
  - Install [Bun](https://bun.sh): `curl -fsSL https://bun.sh/install | bash`
20
20
  - Install dependencies: `bun install`
21
21
 
22
- ## Scripts
22
+ ### Scripts
23
23
 
24
- | Command | Purpose |
25
- | ---------------- | ------------------------------------------------------------------------------ |
26
- | `bun run check` | Repairs locally. Auto-formats, then asserts what the formatters could not fix. |
27
- | `bun run format` | Auto-fix prettier formatting. |
24
+ | Command | Purpose |
25
+ | ---------------- | ---------------------------------------------------------------------------------------- |
26
+ | `bun run check` | Gates locally and writes nothing. Fails on formatting drift until `bun run format` runs. |
27
+ | `bun run format` | Auto-fix oxfmt formatting. |
28
28
 
29
- ## Shell scripts
29
+ ### Shell scripts
30
30
 
31
31
  All `.sh` files live under `scripts/`. Do not place shell scripts outside `scripts/`.
32
32
 
33
- ## Husky hooks
33
+ ### Husky hooks
34
34
 
35
- - `pre-commit` runs `lint-staged` (prettier on staged files).
35
+ - `pre-commit` runs `lint-staged` (oxfmt on staged files).
36
36
  - `commit-msg` runs `commitlint` against the conventional commit format.
37
- - `pre-push` runs `bun run check`. When a markdown-bans audit tool is on PATH, it also gates on banned characters across every tracked markdown file except `CHANGELOG.md`. After pushing, run `git status`. If files changed, commit the diff as `style(<scope>):` and push again.
37
+ - `pre-push` runs `bun run check`. When a markdown-bans audit tool is on PATH, it also gates on banned characters across every tracked markdown file except `CHANGELOG.md`. A push fails on formatting drift until `bun run format` runs, since the hook writes nothing.
@@ -21,4 +21,8 @@ scaffold = ""
21
21
  # array no longer tells it to ignore them, so the first sign is a memory file or
22
22
  # a task board appearing in someone's commit.
23
23
  [gitignore]
24
- "# Claude" = [".canon/", ".claude/worktrees/", ".claude/.tmp/"] # canon-keep-record-root
24
+ "# Claude" = [
25
+ ".canon/",
26
+ ".claude/worktrees/",
27
+ ".claude/.tmp/", # canon-keep-record-root
28
+ ]
@@ -26,6 +26,14 @@ case "$file_path" in
26
26
  */.claude/.tmp/* | */.canon/tmp/*) exit 0 ;;
27
27
  esac
28
28
 
29
+ # A background session's temp folder is the harness's own, told to the session
30
+ # and located under the home folder, outside every project. Matching its shape
31
+ # rather than reading CLAUDE_JOB_DIR holds whether or not this hook's
32
+ # environment carries the variable.
33
+ case "$file_path" in
34
+ */.claude/jobs/*/tmp/*) exit 0 ;;
35
+ esac
36
+
29
37
  # A project whose own root sits under a path carrying a tmp segment is not
30
38
  # writing to system temp, and the bare pattern below would trip on every source
31
39
  # file it holds. The project root is stripped before the match rather than
@@ -10,11 +10,11 @@ The go stack covers Go modules linted and formatted by `golangci-lint` v2, type-
10
10
 
11
11
  1. Scaffold with `go mod init <module-path>`. The module path is the project's own identity, so this stack never ships a `go.mod`.
12
12
  2. Keep `./...` out of `node_modules`: `go mod edit -ignore=./node_modules`. At a root sync the base layer installs `node_modules/` inside the module, and a package there can ship a `.go` file that `go vet`, `go test`, and `golangci-lint` would otherwise walk. The directive needs Go 1.25 or later.
13
- 3. Seed `package.json` so the base layer's bun-side tools (husky, prettier, commitlint) have a target to install into: `bun init -y`.
13
+ 3. Seed `package.json` so the base layer's bun-side tools (husky, oxfmt, commitlint) have a target to install into: `bun init -y`.
14
14
  4. Install base tooling: `canon tooling sync base . --write`
15
15
  5. Install go tooling: `canon tooling sync go . --write`
16
16
  6. Install the linter: `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest`. The manifest declares no `[dependencies.dev]`, because manifest injection runs `bun add -D`, which cannot install a Go tool. This step stays manual.
17
- 7. Run `bun run lint:fix` then `bun run check`.
17
+ 7. Run `bun run lint:fix`, then `bun run format`, then `bun run check`.
18
18
 
19
19
  The go stack also ships `smoke_test.go` at the module root as a copy-once seed. A module with no `.go` file fails `golangci-lint run`, `go vet`, and `go test` on an empty package list, so the seed is what lets `bun run check` pass on a fresh scaffold. It declares `package main`, so delete or rename it once the root package takes another name, or the build reports two packages in one folder.
20
20
 
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["typescript", "unicorn"],
4
+ "categories": {
5
+ "correctness": "off"
6
+ },
7
+ "env": {
8
+ "builtin": true
9
+ },
10
+ "ignorePatterns": [
11
+ ".next",
12
+ "next-env.d.ts",
13
+ "dist",
14
+ "dist-ssr",
15
+ "coverage",
16
+ "release",
17
+ ".claude",
18
+ ".vscode",
19
+ ".husky",
20
+ "test-results",
21
+ "playwright-report",
22
+ "blob-report",
23
+ "playwright/.cache"
24
+ ],
25
+ "rules": {
26
+ "constructor-super": "error",
27
+ "for-direction": "error",
28
+ "getter-return": "error",
29
+ "no-async-promise-executor": "error",
30
+ "no-case-declarations": "error",
31
+ "no-class-assign": "error",
32
+ "no-compare-neg-zero": "error",
33
+ "no-cond-assign": "error",
34
+ "no-const-assign": "error",
35
+ "no-constant-binary-expression": "error",
36
+ "no-constant-condition": "error",
37
+ "no-control-regex": "error",
38
+ "no-debugger": "error",
39
+ "no-delete-var": "error",
40
+ "no-dupe-class-members": "error",
41
+ "no-dupe-else-if": "error",
42
+ "no-dupe-keys": "error",
43
+ "no-duplicate-case": "error",
44
+ "no-empty": "error",
45
+ "no-empty-character-class": "error",
46
+ "no-empty-pattern": "error",
47
+ "no-empty-static-block": "error",
48
+ "no-ex-assign": "error",
49
+ "no-extra-boolean-cast": "error",
50
+ "no-fallthrough": "error",
51
+ "no-func-assign": "error",
52
+ "no-global-assign": "error",
53
+ "no-import-assign": "error",
54
+ "no-invalid-regexp": "error",
55
+ "no-irregular-whitespace": "error",
56
+ "no-loss-of-precision": "error",
57
+ "no-misleading-character-class": "error",
58
+ "no-new-native-nonconstructor": "error",
59
+ "no-nonoctal-decimal-escape": "error",
60
+ "no-obj-calls": "error",
61
+ "no-prototype-builtins": "error",
62
+ "no-redeclare": "error",
63
+ "no-regex-spaces": "error",
64
+ "no-self-assign": "error",
65
+ "no-setter-return": "error",
66
+ "no-shadow-restricted-names": "error",
67
+ "no-sparse-arrays": "error",
68
+ "no-this-before-super": "error",
69
+ "no-unassigned-vars": "error",
70
+ "no-unreachable": "error",
71
+ "no-unsafe-finally": "error",
72
+ "no-unsafe-negation": "error",
73
+ "no-unsafe-optional-chaining": "error",
74
+ "no-unused-labels": "error",
75
+ "no-unused-private-class-members": "error",
76
+ "no-unused-vars": "error",
77
+ "no-useless-backreference": "error",
78
+ "no-useless-catch": "error",
79
+ "no-useless-escape": "error",
80
+ "no-with": "error",
81
+ "preserve-caught-error": "error",
82
+ "require-yield": "error",
83
+ "use-isnan": "error",
84
+ "valid-typeof": "error",
85
+ "no-array-constructor": "error",
86
+ "no-unused-expressions": "error",
87
+ "typescript/ban-ts-comment": "error",
88
+ "typescript/no-duplicate-enum-values": "error",
89
+ "typescript/no-empty-object-type": "error",
90
+ "typescript/no-explicit-any": "error",
91
+ "typescript/no-extra-non-null-assertion": "error",
92
+ "typescript/no-misused-new": "error",
93
+ "typescript/no-namespace": "error",
94
+ "typescript/no-non-null-asserted-optional-chain": "error",
95
+ "typescript/no-require-imports": "error",
96
+ "typescript/no-this-alias": "error",
97
+ "typescript/no-unnecessary-type-constraint": "error",
98
+ "typescript/no-unsafe-declaration-merging": "error",
99
+ "typescript/no-unsafe-function-type": "error",
100
+ "typescript/no-wrapper-object-types": "error",
101
+ "typescript/prefer-as-const": "error",
102
+ "typescript/prefer-namespace-keyword": "error",
103
+ "typescript/triple-slash-reference": "error"
104
+ },
105
+ "overrides": [
106
+ {
107
+ "files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
108
+ "rules": {
109
+ "constructor-super": "off",
110
+ "getter-return": "off",
111
+ "no-class-assign": "off",
112
+ "no-const-assign": "off",
113
+ "no-dupe-class-members": "off",
114
+ "no-dupe-keys": "off",
115
+ "no-func-assign": "off",
116
+ "no-import-assign": "off",
117
+ "no-new-native-nonconstructor": "off",
118
+ "no-obj-calls": "off",
119
+ "no-redeclare": "off",
120
+ "no-setter-return": "off",
121
+ "no-this-before-super": "off",
122
+ "no-unreachable": "off",
123
+ "no-unsafe-negation": "off",
124
+ "no-var": "error",
125
+ "no-with": "off",
126
+ "prefer-const": "error",
127
+ "prefer-rest-params": "error",
128
+ "prefer-spread": "error"
129
+ }
130
+ },
131
+ {
132
+ "files": ["**/*.{ts,tsx,js,jsx}"],
133
+ "rules": {
134
+ "simple-import-sort/imports": "error",
135
+ "simple-import-sort/exports": "error",
136
+ "check-file/filename-naming-convention": [
137
+ "error",
138
+ {
139
+ "**/*.{ts,tsx}": "KEBAB_CASE"
140
+ },
141
+ {
142
+ "ignoreMiddleExtensions": true
143
+ }
144
+ ],
145
+ "check-file/folder-naming-convention": [
146
+ "error",
147
+ {
148
+ "src/**/!(__tests__)/": "KEBAB_CASE"
149
+ }
150
+ ],
151
+ "no-unused-vars": [
152
+ "error",
153
+ {
154
+ "varsIgnorePattern": "^_",
155
+ "argsIgnorePattern": "^_"
156
+ }
157
+ ],
158
+ "react/rules-of-hooks": "error",
159
+ "react/exhaustive-deps": "warn",
160
+ "react/static-components": "error",
161
+ "react/use-memo": "error",
162
+ "react/preserve-manual-memoization": "error",
163
+ "react/incompatible-library": "warn",
164
+ "react/immutability": "error",
165
+ "react/globals": "error",
166
+ "react/refs": "error",
167
+ "react/set-state-in-effect": "error",
168
+ "react/error-boundaries": "error",
169
+ "react/purity": "error",
170
+ "react/set-state-in-render": "error",
171
+ "react/unsupported-syntax": "warn",
172
+ "react/only-export-components": [
173
+ "warn",
174
+ {
175
+ "allowConstantExport": true
176
+ }
177
+ ]
178
+ },
179
+ "jsPlugins": [
180
+ "eslint-plugin-simple-import-sort",
181
+ "eslint-plugin-check-file"
182
+ ],
183
+ "plugins": ["react"],
184
+ "env": {
185
+ "browser": true
186
+ }
187
+ },
188
+ {
189
+ "files": ["src/app/**/*.{ts,tsx}"],
190
+ "rules": {
191
+ "check-file/folder-naming-convention": "off",
192
+ "react/only-export-components": "off"
193
+ },
194
+ "jsPlugins": ["eslint-plugin-check-file"],
195
+ "plugins": ["react"]
196
+ },
197
+ {
198
+ "files": ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
199
+ "rules": {
200
+ "vitest/expect-expect": "error",
201
+ "vitest/no-identical-title": "error",
202
+ "vitest/no-commented-out-tests": "error",
203
+ "vitest/valid-title": "error",
204
+ "vitest/valid-expect": "error",
205
+ "vitest/valid-describe-callback": "error",
206
+ "vitest/require-local-test-context-for-concurrent-snapshots": "error",
207
+ "vitest/no-import-node-test": "error",
208
+ "vitest/no-focused-tests": "error"
209
+ },
210
+ "plugins": ["vitest"]
211
+ },
212
+ {
213
+ "files": [
214
+ "*.config.{js,mjs,cjs,ts}",
215
+ "vitest.config.ts",
216
+ "playwright.config.ts"
217
+ ],
218
+ "env": {
219
+ "node": true
220
+ }
221
+ }
222
+ ]
223
+ }
@@ -2,13 +2,10 @@
2
2
  name = "nextjs"
3
3
  extends = "web"
4
4
  runtime = "bun"
5
- scaffold = "bunx create-next-app@latest {{name}} --typescript --tailwind --eslint --app --src-dir --import-alias \"@/*\" --use-bun --skip-install --disable-git --no-agents-md --yes"
5
+ scaffold = "bunx create-next-app@latest {{name}} --typescript --tailwind --no-linter --app --src-dir --import-alias \"@/*\" --use-bun --skip-install --disable-git --no-agents-md --yes"
6
6
 
7
7
  [dependencies.dev]
8
- packages = [
9
- "next",
10
- "@tailwindcss/postcss",
11
- ]
8
+ packages = ["next", "@tailwindcss/postcss"]
12
9
 
13
10
  [scripts]
14
11
  "preview" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && next start --port $((3000 + WORKTREE_PORT_OFFSET))"
@@ -4,22 +4,22 @@
4
4
 
5
5
  ## Overview
6
6
 
7
- The nextjs stack covers Next.js + TypeScript projects using the App Router. It ships golden configs for `next.config.ts`, `vitest.config.ts` (plain `defineConfig`, no bundler merge), `playwright.config.ts` (build-then-preview), and an `eslint.config.js` that extends the web layer's config with `.next` ignores and an App Router override. Shared web tooling (ESLint base, screenshot template, VS Code, CI, verify script) comes from the `web` layer.
7
+ The nextjs stack covers Next.js + TypeScript projects using the App Router. It ships golden configs for `next.config.ts`, `vitest.config.ts` (plain `defineConfig`, no bundler merge), `playwright.config.ts` (build-then-preview), and an `.oxlintrc.json` that replaces the web layer's with `.next` ignores and an App Router override. Shared web tooling (oxlint base, screenshot template, VS Code, CI, verify script) comes from the `web` layer.
8
8
 
9
9
  ## Scaffold checklist
10
10
 
11
- 1. Scaffold with `bunx create-next-app@latest <name> --typescript --tailwind --eslint --app --src-dir --import-alias "@/*" --use-bun --skip-install --disable-git --no-agents-md --yes`. `--no-agents-md` skips the scaffold-time `AGENTS.md`/`CLAUDE.md` write, which otherwise duplicates the root `CLAUDE.md`.
11
+ 1. Scaffold with `bunx create-next-app@latest <name> --typescript --tailwind --no-linter --app --src-dir --import-alias "@/*" --use-bun --skip-install --disable-git --no-agents-md --yes`. `--no-agents-md` skips the scaffold-time `AGENTS.md`/`CLAUDE.md` write, which otherwise duplicates the root `CLAUDE.md`. `--no-linter` skips the scaffold's `eslint.config.mjs` and `lint` script, and is accepted though `--help` lists only `--eslint` and `--biome`.
12
12
  2. Install web tooling: `canon tooling sync web . --write`
13
13
  3. Install nextjs configs: `canon tooling sync nextjs . --write`
14
14
  4. Extend the `ci` and `development` context entries under `canon/context/` per the web reference's extend sections plus the nextjs rows below.
15
- 5. Run `bun run lint:fix` then `bun run check`.
15
+ 5. Run `bun run lint:fix`, then `bun run format`, then `bun run check`.
16
16
 
17
17
  ## What ships as golden configs
18
18
 
19
19
  - `next.config.ts`: `agentRules: false` stops Next from regenerating `AGENTS.md`/`CLAUDE.md` on every run, which would otherwise compete with the root `CLAUDE.md`. `turbopack.root: import.meta.dirname` pins the workspace root, silencing Next's multi-lockfile inference warning in any checkout carrying more than one lockfile above the project, a worktree included.
20
20
  - `vitest.config.ts`: plain `defineConfig`, no `mergeConfig` or `getViteConfig` since Next has no Vite config to merge from. jsdom, globals, setup file, `passWithNoTests: true`, v8 coverage, `.next/**` in test excludes.
21
21
  - `playwright.config.ts`: all browsers, `webServer` runs `bun run build && bun run preview` on port `3000` plus `WORKTREE_PORT_OFFSET`, `reuseExistingServer: false`. `DIST_PREBUILT` drops the `build` half, matching the astro stack's flag.
22
- - `eslint.config.js`: overrides the web layer with `.next` and `next-env.d.ts` added to `globalIgnores`, keeping `react-hooks`/`react-refresh` since this stack still ships React components. `react-refresh/only-export-components` is `off` for `src/app/**`, since route and layout files export non-component values the rule would otherwise flag. `check-file/folder-naming-convention` is `off` for the same subtree, since App Router's bracket, paren, and at-sign folder syntax (dynamic segments, route groups, parallel slots) fails `KEBAB_CASE`.
22
+ - `.oxlintrc.json`: replaces the web layer's whole file, since oxlint reads one config, with `.next` and `next-env.d.ts` added to `ignorePatterns`. `react/only-export-components` is `off` for `src/app/**`, since route and layout files export non-component values the rule would otherwise flag. `check-file/folder-naming-convention` is `off` for the same subtree, since App Router's bracket, paren, and at-sign folder syntax (dynamic segments, route groups, parallel slots) fails `KEBAB_CASE`.
23
23
 
24
24
  ## Port
25
25
 
@@ -12,7 +12,12 @@ scaffold = "mkdir {{name}} && cd {{name}} && composer init -n --name example/{{n
12
12
  "test:run" = "vendor/bin/phpunit --testdox"
13
13
 
14
14
  [gitignore]
15
- "# PHP" = ["vendor/", ".php-cs-fixer.cache", ".phpunit.cache/", ".phpunit.result.cache"]
15
+ "# PHP" = [
16
+ "vendor/",
17
+ ".php-cs-fixer.cache",
18
+ ".phpunit.cache/",
19
+ ".phpunit.result.cache",
20
+ ]
16
21
 
17
22
  [verify]
18
23
  prepare = "bun init -y && composer require --dev friendsofphp/php-cs-fixer phpstan/phpstan phpunit/phpunit"
@@ -9,11 +9,11 @@ The php stack covers Composer projects on PHP 8.3 or later, formatted by PHP CS
9
9
  ## Scaffold checklist
10
10
 
11
11
  1. Scaffold with `composer init -n --name <vendor>/<name> --autoload src/`. The package name and namespace are the project's own identity, so this stack never ships a `composer.json`.
12
- 2. Seed `package.json` so the base layer's bun-side tools (husky, prettier, commitlint) have a target to install into: `bun init -y`.
12
+ 2. Seed `package.json` so the base layer's bun-side tools (husky, oxfmt, commitlint) have a target to install into: `bun init -y`.
13
13
  3. Install base tooling: `canon tooling sync base . --write`
14
14
  4. Install php tooling: `canon tooling sync php . --write`
15
15
  5. Install the dev tools: `composer require --dev friendsofphp/php-cs-fixer phpstan/phpstan phpunit/phpunit`. The manifest declares no `[dependencies.dev]`, because manifest injection runs `bun add -D`, which cannot install a Composer package. This step stays manual.
16
- 6. Run `bun run lint:fix` then `bun run check`.
16
+ 6. Run `bun run lint:fix`, then `bun run format`, then `bun run check`.
17
17
 
18
18
  Use PHP 8.3 or later, since PHPUnit 12 requires it.
19
19
 
@@ -13,7 +13,12 @@ scaffold = "uv init --package {{name}}"
13
13
  "test:cov" = "uv run pytest --cov --cov-report=term-missing --cov-report=html"
14
14
 
15
15
  [gitignore]
16
- "# Python" = [".pytest_cache/", ".mypy_cache/", ".ruff_cache/", ".coverage_cache/"]
16
+ "# Python" = [
17
+ ".pytest_cache/",
18
+ ".mypy_cache/",
19
+ ".ruff_cache/",
20
+ ".coverage_cache/",
21
+ ]
17
22
 
18
23
  [verify]
19
24
  prepare = "bun init -y && uv add --dev ruff mypy pytest pytest-cov && uv sync"
@@ -11,12 +11,12 @@ Configs ship as sidecar files (`ruff.toml`, `mypy.ini`, `pytest.ini`, `.coverage
11
11
  ## Scaffold checklist
12
12
 
13
13
  1. Scaffold with `uv init --package <name>`. This creates `pyproject.toml` with a `uv_build` backend, `.python-version` pinned to 3.14, and `src/<name with underscores>/__init__.py` holding an annotated `def main() -> None:`, so source lands under `src/` where `mypy.ini`, `pytest.ini`, and `.coveragerc` look for it. `uv init` defaults `requires-python` to `>=3.14`, which matches the `.python-version` pin this stack ships.
14
- 2. Seed `package.json` so the base layer's bun-side tools (husky, prettier, commitlint) have a target to install into: `bun init -y`. Without this the sync drops base configs but skips the dep install, since `resolve_missing_deps` short-circuits when `package.json` is absent.
14
+ 2. Seed `package.json` so the base layer's bun-side tools (husky, oxfmt, commitlint) have a target to install into: `bun init -y`. Without this the sync drops base configs but skips the dep install, since `resolve_missing_deps` short-circuits when `package.json` is absent.
15
15
  3. Install base tooling: `canon tooling sync base . --write`
16
16
  4. Install python tooling: `canon tooling sync python . --write`
17
17
  5. Install Python tooling deps: `uv add --dev ruff mypy pytest pytest-cov`. v1 of this stack does not declare these in `[dependencies.dev]` because manifest injection hardcodes `bun add -D`, which can not install Python packages. Until the injector branches on `runtime`, this step is manual.
18
18
  6. Sync the lockfile and create the venv: `uv sync`.
19
- 7. Run `bun run lint:fix` then `bun run check`.
19
+ 7. Run `bun run lint:fix`, then `bun run format`, then `bun run check`.
20
20
 
21
21
  The python stack also ships `tests/test_smoke.py` as a copy-once seed. `pytest` collects at least one test on first run, so `bun run test:run` exits 0 instead of the empty-collection exit code 5. Delete or replace the smoke test with real tests.
22
22
 
@@ -31,7 +31,7 @@ The python stack also ships `tests/test_smoke.py` as a copy-once seed. `pytest`
31
31
 
32
32
  ## Hybrid project shape
33
33
 
34
- A python project synced with this stack ends up with both `package.json` from base and `pyproject.toml` from `uv init`. The base layer brings prettier, commitlint, and husky for non-Python files. Both `node_modules/` and `.venv/` coexist at the project root. The hybrid shape gives Python projects access to the toolkit's cross-cutting tools without forking the base stack.
34
+ A python project synced with this stack ends up with both `package.json` from base and `pyproject.toml` from `uv init`. The base layer brings oxfmt, commitlint, and husky for non-Python files. Both `node_modules/` and `.venv/` coexist at the project root. The hybrid shape gives Python projects access to the toolkit's cross-cutting tools without forking the base stack.
35
35
 
36
36
  ## Dependencies
37
37
 
@@ -39,7 +39,7 @@ The manifest declares no `[dependencies.dev]`. Manifest injection currently call
39
39
 
40
40
  ## Verify command
41
41
 
42
- `canon tooling verify python` runs the manifest's `[verify] prepare` before Sync, which is checklist steps 2, 5, and 6: `bun init -y`, `uv add --dev ruff mypy pytest pytest-cov`, and `uv sync`. `uv init` writes no `package.json`, and a verify that reaches its end with none fails, so the prepare is what lets `bun run lint:fix` and `bun run check` run at all. Python's `verify.json` requires the `lint`, `typecheck`, and `test:run` scripts that delegate to `uv run`, so the run needs `uv` on the machine and a network for the installs. The end-to-end test and screenshot phases are gated on `package.json` script keys that python does not declare, so they skip.
42
+ `canon tooling verify python` runs the manifest's `[verify] prepare` before Sync, which is checklist steps 2, 5, and 6: `bun init -y`, `uv add --dev ruff mypy pytest pytest-cov`, and `uv sync`. `uv init` writes no `package.json`, and a verify that reaches its end with none fails, so the prepare is what lets `bun run lint:fix`, `bun run format`, and `bun run check` run at all. Python's `verify.json` requires the `lint`, `typecheck`, and `test:run` scripts that delegate to `uv run`, so the run needs `uv` on the machine and a network for the installs. The end-to-end test and screenshot phases are gated on `package.json` script keys that python does not declare, so they skip.
43
43
 
44
44
  ## Anti-patterns
45
45
 
@@ -18,7 +18,7 @@
18
18
  "types": [
19
19
  "vite/client",
20
20
  "vitest/globals",
21
- "@testing-library/jest-dom",
21
+ "@testing-library/jest-dom/vitest",
22
22
  "node"
23
23
  ],
24
24
  "paths": {
@@ -1,6 +1,6 @@
1
1
  import { defineConfig, mergeConfig } from 'vitest/config'
2
2
 
3
- import viteConfig from './vite.config'
3
+ import viteConfig from './vite.config.ts'
4
4
 
5
5
  export default mergeConfig(
6
6
  viteConfig,
@@ -5,10 +5,7 @@ runtime = "bun"
5
5
  scaffold = "bun create vite@latest {{name}} --template react-ts"
6
6
 
7
7
  [dependencies.dev]
8
- packages = [
9
- "vite",
10
- "@vitejs/plugin-react",
11
- ]
8
+ packages = ["vite", "@vitejs/plugin-react"]
12
9
 
13
10
  [scripts]
14
11
  "dev" = "WORKTREE_PORT_OFFSET=$(bash scripts/worktree-port.sh) && export WORKTREE_PORT_OFFSET && vite"
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Overview
6
6
 
7
- The vite-react stack covers Vite + React + TypeScript projects: web apps and Chrome extensions. It ships golden configs for `vite.config.ts`, `vitest.config.ts` (merging from vite config), `playwright.config.ts`, and a unified `tsconfig.json` with `@/` path alias. Shared web tooling (ESLint, screenshot template, VS Code, CI, verify script) comes from the `web` layer.
7
+ The vite-react stack covers Vite + React + TypeScript projects: web apps and Chrome extensions. It ships golden configs for `vite.config.ts`, `vitest.config.ts` (merging from vite config), `playwright.config.ts`, and a unified `tsconfig.json` with `@/` path alias. Shared web tooling (oxlint, screenshot template, VS Code, CI, verify script) comes from the `web` layer.
8
8
 
9
9
  ## Scaffold checklist
10
10
 
@@ -12,14 +12,14 @@ The vite-react stack covers Vite + React + TypeScript projects: web apps and Chr
12
12
  2. Install base and web tooling: `canon tooling sync web . --write`
13
13
  3. Install vite-react deps and configs: `canon tooling sync vite-react . --write`
14
14
  4. Extend the `ci` and `development` context entries under `canon/context/` per the web reference's extend sections plus the vite-react rows below.
15
- 5. Run `bun run lint:fix` then `bun run check`.
15
+ 5. Run `bun run lint:fix`, then `bun run format`, then `bun run check`.
16
16
 
17
17
  ## What ships as golden configs
18
18
 
19
19
  - `vite.config.ts`: `@vitejs/plugin-react`, `@tailwindcss/vite`, `@` path alias to `./src`, `VITE_BASE_URL` env for base path. Dev port `5173` and preview port `4173`, each plus `WORKTREE_PORT_OFFSET`, both with `strictPort`.
20
- - `vitest.config.ts`: merges from `vite.config.ts`, jsdom, globals, setup file, `passWithNoTests: true`, v8 coverage.
20
+ - `vitest.config.ts`: merges from `vite.config.ts` (imported with its `.ts` extension, which Vite 8 requires), jsdom, globals, setup file, `passWithNoTests: true`, v8 coverage.
21
21
  - `playwright.config.ts`: all browsers, `webServer` on `bun run dev` at port `5173` plus `WORKTREE_PORT_OFFSET`, `reuseExistingServer: false`, trace under `use`.
22
- - `tsconfig.json`: unified, `noEmit: true`, `skipLibCheck: true`, `@/` paths, `vitest/globals` and `@testing-library/jest-dom` in types.
22
+ - `tsconfig.json`: unified, `noEmit: true`, `skipLibCheck: true`, `@/` paths, `vitest/globals` and `@testing-library/jest-dom/vitest` in types.
23
23
 
24
24
  ## Chrome extension variant
25
25
 
@@ -28,7 +28,7 @@ When scaffolding a Chrome extension, override the installed golden configs:
28
28
  - `vite.config.ts`: use `crx({ manifest })` and `zip()` from `@crxjs/vite-plugin` instead of `react()` alone. Keep the derived `server.port` and `server.strictPort: true`, set `server.hmr.clientPort` to the same derived value, and add `chrome-extension://` to CORS origins. Drop `VITE_BASE_URL`.
29
29
  - `vitest.config.ts`: use a standalone `defineConfig` (no `mergeConfig`). crxjs plugin breaks Vitest. Declare `@vitejs/plugin-react` and `@tailwindcss/vite` directly. Add `**/release/**` to excludes and `manifest.config.ts`, `**/*.d.ts` to coverage excludes.
30
30
  - `playwright.config.ts`: chromium-only (Firefox and WebKit cannot run extensions). Bundled `chromium` channel. No `baseURL` or `webServer`. Tests load the built extension directly from `dist/`.
31
- - `e2e/fixtures.ts`: extend Playwright base `test` with `context` (persistent context loading the extension from `dist/`) and `extensionId` (extracted from service worker URL). Rename `use` to `apply` to avoid the React hooks ESLint rule. `waitForEvent('serviceworker')` blocks until the MV3 service worker registers.
31
+ - `e2e/fixtures.ts`: extend Playwright base `test` with `context` (persistent context loading the extension from `dist/`) and `extensionId` (extracted from service worker URL). Rename `use` to `apply` to avoid oxlint's `react/rules-of-hooks`. `waitForEvent('serviceworker')` blocks until the MV3 service worker registers.
32
32
  - `manifest.config.ts`: use `defineManifest` from `@crxjs/vite-plugin`. Read `name` and `version` from `package.json`. Entry points `src/popup/index.html`, `src/sidepanel/index.html`, `src/background/index.ts`, `src/content/main.tsx`. Permissions `sidePanel`, `contentSettings`, `storage`. Icon `public/logo.png` at size 48.
33
33
  - `screenshot` script: `bun run build && bun e2e/screenshot.ts` (no preview server).
34
34
  - Additional gitignore entries: `*.crx`, `*.pem`, `release/`.