@erclx/aitk 0.8.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 (359) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +99 -0
  3. package/claude/.claude-plugin/plugin.json +19 -0
  4. package/claude/skills/bash-script/SKILL.md +96 -0
  5. package/claude/skills/bash-script/references/patterns.md +349 -0
  6. package/claude/skills/ci-workflow/SKILL.md +52 -0
  7. package/claude/skills/ci-workflow/references/workflows.md +74 -0
  8. package/claude/skills/claude-address-review/SKILL.md +107 -0
  9. package/claude/skills/claude-autoship/SKILL.md +137 -0
  10. package/claude/skills/claude-design-extract/SKILL.md +69 -0
  11. package/claude/skills/claude-design-propose/SKILL.md +75 -0
  12. package/claude/skills/claude-diagram/SKILL.md +126 -0
  13. package/claude/skills/claude-docs/SKILL.md +204 -0
  14. package/claude/skills/claude-feature/REQUIREMENT.md +35 -0
  15. package/claude/skills/claude-feature/SKILL.md +148 -0
  16. package/claude/skills/claude-groundwork/SKILL.md +148 -0
  17. package/claude/skills/claude-groundwork/references/folder-format.md +107 -0
  18. package/claude/skills/claude-memory-capture/SKILL.md +80 -0
  19. package/claude/skills/claude-memory-review/REQUIREMENT.md +37 -0
  20. package/claude/skills/claude-memory-review/SKILL.md +206 -0
  21. package/claude/skills/claude-orchestrate/SKILL.md +125 -0
  22. package/claude/skills/claude-pr-review/SKILL.md +150 -0
  23. package/claude/skills/claude-review/SKILL.md +136 -0
  24. package/claude/skills/claude-roadmap/SKILL.md +61 -0
  25. package/claude/skills/claude-roadmap/references/roadmap.md +52 -0
  26. package/claude/skills/claude-screencast/SKILL.md +160 -0
  27. package/claude/skills/claude-seed-sync/SKILL.md +141 -0
  28. package/claude/skills/claude-slides-draft/SKILL.md +62 -0
  29. package/claude/skills/claude-standards-audit/REQUIREMENT.md +33 -0
  30. package/claude/skills/claude-standards-audit/SKILL.md +79 -0
  31. package/claude/skills/claude-standards-audit/references/branch.md +49 -0
  32. package/claude/skills/claude-standards-audit/references/pr.md +124 -0
  33. package/claude/skills/claude-tasks/SKILL.md +123 -0
  34. package/claude/skills/claude-ui-test/SKILL.md +75 -0
  35. package/claude/skills/claude-ux-audit/SKILL.md +78 -0
  36. package/claude/skills/claude-worktree/SKILL.md +79 -0
  37. package/claude/skills/cli-script/SKILL.md +47 -0
  38. package/claude/skills/cli-script/references/template.md +43 -0
  39. package/claude/skills/create-rule/SKILL.md +68 -0
  40. package/claude/skills/create-skill/REQUIREMENT.md +30 -0
  41. package/claude/skills/create-skill/SKILL.md +24 -0
  42. package/claude/skills/create-snippet/SKILL.md +28 -0
  43. package/claude/skills/create-snippet/references/snippets.md +57 -0
  44. package/claude/skills/create-standard/SKILL.md +31 -0
  45. package/claude/skills/create-standard/references/standard.md +52 -0
  46. package/claude/skills/docs-sync/SKILL.md +87 -0
  47. package/claude/skills/git-branch/REQUIREMENT.md +38 -0
  48. package/claude/skills/git-branch/SKILL.md +60 -0
  49. package/claude/skills/git-branch/references/branch.md +49 -0
  50. package/claude/skills/git-commit/REQUIREMENT.md +33 -0
  51. package/claude/skills/git-commit/SKILL.md +51 -0
  52. package/claude/skills/git-commit/references/commit.md +63 -0
  53. package/claude/skills/git-followup/REQUIREMENT.md +38 -0
  54. package/claude/skills/git-followup/SKILL.md +35 -0
  55. package/claude/skills/git-issue/REQUIREMENT.md +38 -0
  56. package/claude/skills/git-issue/SKILL.md +69 -0
  57. package/claude/skills/git-issue/references/issue.md +84 -0
  58. package/claude/skills/git-pr/REQUIREMENT.md +37 -0
  59. package/claude/skills/git-pr/SKILL.md +119 -0
  60. package/claude/skills/git-pr/references/branch.md +49 -0
  61. package/claude/skills/git-pr/references/pr.md +124 -0
  62. package/claude/skills/git-ship/REQUIREMENT.md +34 -0
  63. package/claude/skills/git-ship/SKILL.md +39 -0
  64. package/claude/skills/git-split/REQUIREMENT.md +38 -0
  65. package/claude/skills/git-split/SKILL.md +160 -0
  66. package/claude/skills/git-split/references/branch.md +49 -0
  67. package/claude/skills/git-split/references/pr.md +124 -0
  68. package/claude/skills/git-stage/REQUIREMENT.md +36 -0
  69. package/claude/skills/git-stage/SKILL.md +74 -0
  70. package/claude/skills/git-stage/references/commit.md +63 -0
  71. package/claude/skills/git-worktree/REQUIREMENT.md +37 -0
  72. package/claude/skills/git-worktree/SKILL.md +120 -0
  73. package/claude/skills/migration-claude-md/SKILL.md +74 -0
  74. package/claude/skills/migration-context/SKILL.md +93 -0
  75. package/claude/skills/migration-standards/SKILL.md +75 -0
  76. package/claude/skills/project-commands/SKILL.md +73 -0
  77. package/claude/skills/session-resume/SKILL.md +36 -0
  78. package/claude/skills/setup-gov/SKILL.md +71 -0
  79. package/claude/skills/setup-indexes/SKILL.md +148 -0
  80. package/claude/skills/setup-init/SKILL.md +114 -0
  81. package/claude/skills/setup-plugins/SKILL.md +81 -0
  82. package/claude/skills/setup-plugins/references/plugin-catalog.md +53 -0
  83. package/claude/skills/setup-verify/SKILL.md +51 -0
  84. package/claude/skills/systematic-debugging/SKILL.md +70 -0
  85. package/claude/skills/toolkit-cli/SKILL.md +38 -0
  86. package/claude/skills/toolkit-feedback/SKILL.md +80 -0
  87. package/claude/skills/toolkit-operator/SKILL.md +45 -0
  88. package/claude/skills/toolkit-triage/SKILL.md +63 -0
  89. package/claude/skills/youtube-transcripts/SKILL.md +34 -0
  90. package/docs/agents.md +371 -0
  91. package/docs/ai-workflow.md +157 -0
  92. package/docs/index.md +20 -0
  93. package/docs/operating-model.md +106 -0
  94. package/docs/target-projects.md +183 -0
  95. package/docs/visual-design-workflow.md +136 -0
  96. package/docs/zshrc-aliases.md +65 -0
  97. package/governance/rules/claude/500-prose.md +12 -0
  98. package/governance/rules/claude/510-context.md +16 -0
  99. package/governance/rules/claude/520-wireframes.md +12 -0
  100. package/governance/rules/claude/530-requirements.md +11 -0
  101. package/governance/rules/claude/540-architecture.md +11 -0
  102. package/governance/rules/claude/550-design.md +11 -0
  103. package/governance/rules/claude/555-tasks.md +12 -0
  104. package/governance/rules/claude/560-diagrams.md +11 -0
  105. package/governance/rules/claude/570-skill.md +18 -0
  106. package/governance/rules/claude/580-readme.md +11 -0
  107. package/governance/rules/claude/590-rule-authoring.md +12 -0
  108. package/governance/rules/core/000-constitution.md +30 -0
  109. package/governance/rules/core/010-testing.md +35 -0
  110. package/governance/rules/core/020-concurrency.md +22 -0
  111. package/governance/rules/core/030-error-handling.md +31 -0
  112. package/governance/rules/core/040-performance.md +20 -0
  113. package/governance/rules/core/050-logging.md +20 -0
  114. package/governance/rules/core/060-naming.md +19 -0
  115. package/governance/rules/core/070-planning.md +13 -0
  116. package/governance/rules/core/080-config-comments.md +22 -0
  117. package/governance/rules/framework/200-react.md +51 -0
  118. package/governance/rules/framework/210-astro.md +41 -0
  119. package/governance/rules/framework/220-fastapi.md +43 -0
  120. package/governance/rules/framework/230-nextjs.md +48 -0
  121. package/governance/rules/framework/250-tailwind.md +32 -0
  122. package/governance/rules/framework/260-shadcn.md +34 -0
  123. package/governance/rules/lang/100-typescript.md +40 -0
  124. package/governance/rules/lang/110-python.md +42 -0
  125. package/governance/rules/lib/300-testing-ts.md +38 -0
  126. package/governance/rules/lib/310-zod.md +25 -0
  127. package/governance/rules/lib/320-tanstack-query.md +32 -0
  128. package/governance/rules/lib/330-testing-py.md +44 -0
  129. package/governance/rules/lib/340-pydantic.md +38 -0
  130. package/governance/rules/lib/350-security-web.md +31 -0
  131. package/governance/rules/ui/400-ui.md +34 -0
  132. package/governance/rules/ui/410-a11y.md +44 -0
  133. package/governance/rules/ui/420-forms.md +34 -0
  134. package/governance/rules/ui/430-ux-completeness.md +62 -0
  135. package/governance/stacks/astro.toml +2 -0
  136. package/governance/stacks/base.toml +2 -0
  137. package/governance/stacks/node.toml +2 -0
  138. package/governance/stacks/python-fastapi.toml +2 -0
  139. package/governance/stacks/python.toml +2 -0
  140. package/governance/stacks/react.toml +2 -0
  141. package/package.json +67 -0
  142. package/scripts/config.sh +11 -0
  143. package/scripts/core/bootstrap.sh +81 -0
  144. package/scripts/core/check-plugin-boundary.sh +45 -0
  145. package/scripts/core/check-skill-paths.sh +25 -0
  146. package/scripts/core/clean.sh +36 -0
  147. package/scripts/core/install-check.sh +93 -0
  148. package/scripts/core/regen-claude-copies.sh +26 -0
  149. package/scripts/core/regen-indexes.sh +10 -0
  150. package/scripts/core/regen-skill-references.sh +27 -0
  151. package/scripts/core/snapshot.sh +132 -0
  152. package/scripts/core/update.sh +35 -0
  153. package/scripts/core/verify.sh +201 -0
  154. package/scripts/docs/list.sh +129 -0
  155. package/scripts/gov/list.sh +234 -0
  156. package/scripts/lib/frontmatter.sh +30 -0
  157. package/scripts/lib/gov.sh +14 -0
  158. package/scripts/lib/sandbox-fixtures.sh +109 -0
  159. package/scripts/lib/sandbox-git.sh +73 -0
  160. package/scripts/lib/tooling.sh +24 -0
  161. package/scripts/lib/ui.sh +173 -0
  162. package/scripts/lib/worktree.sh +20 -0
  163. package/scripts/manage-sandbox.sh +453 -0
  164. package/scripts/snippets/create.sh +156 -0
  165. package/scripts/standards/list.sh +91 -0
  166. package/scripts/tooling/create.sh +109 -0
  167. package/scripts/tooling/ref.sh +141 -0
  168. package/scripts/tooling/verify.sh +179 -0
  169. package/snippets/claude/decision-memo.md +39 -0
  170. package/snippets/claude/feature-recap.md +19 -0
  171. package/snippets/claude/figma-steps.md +18 -0
  172. package/snippets/claude/orchestrator-resume.md +23 -0
  173. package/snippets/claude/orchestrator-sweep.md +10 -0
  174. package/snippets/compact-summary.md +5 -0
  175. package/snippets/create-snippet.md +7 -0
  176. package/snippets/decision-help.md +6 -0
  177. package/snippets/meta-prompt.md +14 -0
  178. package/snippets/research-prompt.md +7 -0
  179. package/snippets/session-notes.md +11 -0
  180. package/snippets/snippets.toml +6 -0
  181. package/snippets/step-by-step.md +10 -0
  182. package/snippets/web-research.md +21 -0
  183. package/src/claude/gitignore.ts +51 -0
  184. package/src/claude/seeds-list.ts +47 -0
  185. package/src/claude/seeds.ts +124 -0
  186. package/src/claude/settings.ts +151 -0
  187. package/src/cli-run.ts +43 -0
  188. package/src/cli.ts +111 -0
  189. package/src/commands/claude.ts +349 -0
  190. package/src/commands/design.ts +39 -0
  191. package/src/commands/docs.ts +59 -0
  192. package/src/commands/feedback-format.ts +23 -0
  193. package/src/commands/feedback.ts +103 -0
  194. package/src/commands/gov.ts +268 -0
  195. package/src/commands/indexes.ts +182 -0
  196. package/src/commands/init.ts +117 -0
  197. package/src/commands/pass-through.ts +39 -0
  198. package/src/commands/sandbox.ts +315 -0
  199. package/src/commands/slides.ts +106 -0
  200. package/src/commands/snippets.ts +236 -0
  201. package/src/commands/standards.ts +89 -0
  202. package/src/commands/sync.ts +211 -0
  203. package/src/commands/tasks.ts +185 -0
  204. package/src/commands/tooling.ts +432 -0
  205. package/src/commands/transcripts.ts +48 -0
  206. package/src/commands/wiki.ts +101 -0
  207. package/src/copy.ts +30 -0
  208. package/src/design/parse.ts +79 -0
  209. package/src/design/render.ts +170 -0
  210. package/src/docs/read.ts +59 -0
  211. package/src/exec.ts +17 -0
  212. package/src/frontmatter.ts +13 -0
  213. package/src/github-format.ts +13 -0
  214. package/src/github.ts +20 -0
  215. package/src/gov/adapter.ts +73 -0
  216. package/src/gov/install.ts +103 -0
  217. package/src/gov/payload.ts +39 -0
  218. package/src/gov/stacks.ts +124 -0
  219. package/src/indexes/frontmatter.ts +46 -0
  220. package/src/indexes/regen.ts +84 -0
  221. package/src/indexes/render.ts +181 -0
  222. package/src/indexes/walk.ts +111 -0
  223. package/src/init/flags.ts +66 -0
  224. package/src/init/plan.ts +128 -0
  225. package/src/init/run.ts +46 -0
  226. package/src/init/steps.ts +91 -0
  227. package/src/sandbox/coverage.ts +115 -0
  228. package/src/sandbox/expect.ts +412 -0
  229. package/src/slides/layouts.ts +391 -0
  230. package/src/slides/open.ts +18 -0
  231. package/src/slides/parse.ts +84 -0
  232. package/src/slides/render.ts +88 -0
  233. package/src/slides/styles.ts +44 -0
  234. package/src/snippets/adapter.ts +34 -0
  235. package/src/snippets/categories.ts +59 -0
  236. package/src/snippets/install.ts +125 -0
  237. package/src/snippets/list.ts +32 -0
  238. package/src/snippets/presets.ts +50 -0
  239. package/src/standards/adapter.ts +51 -0
  240. package/src/standards/index-refresh.ts +44 -0
  241. package/src/standards/install.ts +52 -0
  242. package/src/sync/check.ts +269 -0
  243. package/src/sync/engine.ts +416 -0
  244. package/src/sync/git.ts +204 -0
  245. package/src/sync/stamp.ts +202 -0
  246. package/src/sync/target.ts +79 -0
  247. package/src/sync/workflow.ts +201 -0
  248. package/src/target.ts +43 -0
  249. package/src/tasks/archive.ts +304 -0
  250. package/src/tooling/gitignore.ts +122 -0
  251. package/src/tooling/inject.ts +214 -0
  252. package/src/tooling/list.ts +39 -0
  253. package/src/tooling/manifest.ts +178 -0
  254. package/src/tooling/package.ts +166 -0
  255. package/src/tooling/scan.ts +186 -0
  256. package/src/transcripts/fetch.ts +156 -0
  257. package/src/transcripts/metadata.ts +54 -0
  258. package/src/transcripts/vtt.ts +114 -0
  259. package/src/ui.ts +187 -0
  260. package/src/wiki/init.ts +85 -0
  261. package/standards/architecture.md +41 -0
  262. package/standards/bundled/branch.md +49 -0
  263. package/standards/bundled/commit.md +63 -0
  264. package/standards/bundled/issue.md +84 -0
  265. package/standards/bundled/pr.md +124 -0
  266. package/standards/bundled/roadmap.md +52 -0
  267. package/standards/bundled/snippets.md +57 -0
  268. package/standards/bundled/standard.md +52 -0
  269. package/standards/context.md +132 -0
  270. package/standards/design.md +31 -0
  271. package/standards/diagrams.md +55 -0
  272. package/standards/index.md +21 -0
  273. package/standards/prose.md +122 -0
  274. package/standards/readme.md +163 -0
  275. package/standards/requirements.md +61 -0
  276. package/standards/rule.md +79 -0
  277. package/standards/skill.md +257 -0
  278. package/standards/tasks.md +140 -0
  279. package/standards/versioning.md +47 -0
  280. package/standards/wireframes.md +67 -0
  281. package/tooling/astro/configs/astro.config.mjs +17 -0
  282. package/tooling/astro/configs/eslint.config.js +79 -0
  283. package/tooling/astro/configs/playwright.config.ts +25 -0
  284. package/tooling/astro/configs/tsconfig.json +12 -0
  285. package/tooling/astro/configs/vitest.config.ts +22 -0
  286. package/tooling/astro/manifest.toml +32 -0
  287. package/tooling/astro/reference.md +60 -0
  288. package/tooling/base/configs/.editorconfig +5 -0
  289. package/tooling/base/configs/.github/pull_request_template.md +18 -0
  290. package/tooling/base/configs/.github/workflows/verify.yml +35 -0
  291. package/tooling/base/configs/.husky/commit-msg +1 -0
  292. package/tooling/base/configs/.husky/post-merge +61 -0
  293. package/tooling/base/configs/.husky/post-rewrite +21 -0
  294. package/tooling/base/configs/.husky/pre-commit +1 -0
  295. package/tooling/base/configs/.husky/pre-push +1 -0
  296. package/tooling/base/configs/.prettierrc +12 -0
  297. package/tooling/base/configs/.shellcheckrc +1 -0
  298. package/tooling/base/configs/.vscode/extensions.json +9 -0
  299. package/tooling/base/configs/.vscode/settings.json +3 -0
  300. package/tooling/base/configs/commitlint.config.js +11 -0
  301. package/tooling/base/configs/scripts/clean.sh +45 -0
  302. package/tooling/base/configs/scripts/update.sh +49 -0
  303. package/tooling/base/configs/scripts/verify.sh +64 -0
  304. package/tooling/base/manifest.toml +32 -0
  305. package/tooling/base/reference.md +114 -0
  306. package/tooling/base/seeds/.claude/context/ci.md +27 -0
  307. package/tooling/base/seeds/.claude/context/development.md +32 -0
  308. package/tooling/base/seeds/.cspell/project-terms.txt +0 -0
  309. package/tooling/base/seeds/.cspell/tech-stack.txt +19 -0
  310. package/tooling/base/seeds/.lintstagedrc +8 -0
  311. package/tooling/base/seeds/.prettierignore +0 -0
  312. package/tooling/base/seeds/cspell.json +20 -0
  313. package/tooling/claude/manifest.toml +11 -0
  314. package/tooling/claude/reference.md +62 -0
  315. package/tooling/claude/seeds/.claude/ARCHITECTURE.md +13 -0
  316. package/tooling/claude/seeds/.claude/DESIGN.md +62 -0
  317. package/tooling/claude/seeds/.claude/REQUIREMENTS.md +18 -0
  318. package/tooling/claude/seeds/.claude/context/index.md +8 -0
  319. package/tooling/claude/seeds/.claude/hooks/index-reminder.sh +43 -0
  320. package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +45 -0
  321. package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +61 -0
  322. package/tooling/claude/seeds/.claude/hooks/tasks-index.sh +60 -0
  323. package/tooling/claude/seeds/.claude/settings.json +39 -0
  324. package/tooling/claude/seeds/.claude/tasks/index.md +8 -0
  325. package/tooling/claude/seeds/.claude/wireframes/index.md +8 -0
  326. package/tooling/claude/seeds/CLAUDE.md +87 -0
  327. package/tooling/claude/user/settings.template.json +10 -0
  328. package/tooling/claude/user/statusline-command.sh +53 -0
  329. package/tooling/python/configs/.coveragerc +14 -0
  330. package/tooling/python/configs/.python-version +1 -0
  331. package/tooling/python/configs/mypy.ini +6 -0
  332. package/tooling/python/configs/pytest.ini +4 -0
  333. package/tooling/python/configs/ruff.toml +15 -0
  334. package/tooling/python/configs/scripts/verify.sh +77 -0
  335. package/tooling/python/manifest.toml +16 -0
  336. package/tooling/python/reference.md +66 -0
  337. package/tooling/python/seeds/.cspell/tech-stack.txt +19 -0
  338. package/tooling/python/seeds/tests/test_smoke.py +2 -0
  339. package/tooling/vite-react/configs/playwright.config.ts +25 -0
  340. package/tooling/vite-react/configs/tsconfig.json +35 -0
  341. package/tooling/vite-react/configs/vite.config.ts +14 -0
  342. package/tooling/vite-react/configs/vitest.config.ts +26 -0
  343. package/tooling/vite-react/manifest.toml +21 -0
  344. package/tooling/vite-react/reference.md +55 -0
  345. package/tooling/vite-react/seeds/.cspell/project-terms.txt +1 -0
  346. package/tooling/vite-react/seeds/.cspell/tech-stack.txt +1 -0
  347. package/tooling/web/configs/.github/workflows/verify.yml +134 -0
  348. package/tooling/web/configs/.vscode/extensions.json +13 -0
  349. package/tooling/web/configs/.vscode/settings.json +10 -0
  350. package/tooling/web/configs/e2e/home.spec.ts +6 -0
  351. package/tooling/web/configs/e2e/screenshot.ts +41 -0
  352. package/tooling/web/configs/eslint.config.js +82 -0
  353. package/tooling/web/configs/scripts/screenshot.sh +28 -0
  354. package/tooling/web/configs/scripts/verify.sh +80 -0
  355. package/tooling/web/configs/src/test/setup.ts +8 -0
  356. package/tooling/web/manifest.toml +57 -0
  357. package/tooling/web/reference.md +95 -0
  358. package/tooling/web/seeds/.cspell/tech-stack.txt +18 -0
  359. package/tsconfig.json +14 -0
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env bash
2
+
3
+ input=$(cat)
4
+
5
+ tool=$(printf '%s' "$input" | jq -r '.tool_name // empty')
6
+ case "$tool" in
7
+ Grep | Glob) ;;
8
+ *) exit 0 ;;
9
+ esac
10
+
11
+ path=$(printf '%s' "$input" | jq -r '.tool_input.path // empty')
12
+ [ -n "$path" ] || exit 0
13
+
14
+ if [ -f "$path" ]; then
15
+ dir=$(dirname "$path")
16
+ else
17
+ dir="$path"
18
+ fi
19
+
20
+ index=""
21
+ cur="$dir"
22
+ while :; do
23
+ if [ -f "$cur/index.md" ]; then
24
+ index="$cur/index.md"
25
+ break
26
+ fi
27
+ parent=$(dirname "$cur")
28
+ [ "$parent" = "$cur" ] && break
29
+ cur="$parent"
30
+ done
31
+
32
+ [ -n "$index" ] || exit 0
33
+
34
+ session=$(printf '%s' "$input" | jq -r '.session_id // "none"')
35
+ key=$(printf '%s__%s' "$session" "$index" | tr -c 'A-Za-z0-9' '_')
36
+ marker_dir="${CLAUDE_PROJECT_DIR:-.}/.claude/.tmp/index-reminder"
37
+ marker="$marker_dir/$key"
38
+ [ -f "$marker" ] && exit 0
39
+ mkdir -p "$marker_dir"
40
+ : >"$marker"
41
+
42
+ msg=$(printf 'An index.md exists at %s. Read it before searching this folder, it catalogs the sibling files faster than a blind search.' "$index")
43
+ jq -nc --arg msg "$msg" '{hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:$msg}}'
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+
3
+ input=$(cat)
4
+
5
+ tool=$(printf '%s' "$input" | jq -r '.tool_name // empty')
6
+ case "$tool" in
7
+ Write | Edit) ;;
8
+ *) exit 0 ;;
9
+ esac
10
+
11
+ file_path=$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty')
12
+ [ -n "$file_path" ] || exit 0
13
+
14
+ case "$file_path" in
15
+ */.claude/.tmp/*) exit 0 ;;
16
+ esac
17
+
18
+ # A project whose own root sits under a path carrying a tmp segment is not
19
+ # writing to system temp, and the bare pattern below trips the guard on every
20
+ # source file it holds. Anchor on the project root before the pattern match.
21
+ #
22
+ # This gives up one case on purpose: a write to <project>/tmp/ is a genuine
23
+ # scratch violation that no longer warns. The false positive fires on every
24
+ # source write in an affected project, so the trade favors the anchor.
25
+ if [ -n "${CLAUDE_PROJECT_DIR:-}" ]; then
26
+ case "$file_path" in
27
+ "$CLAUDE_PROJECT_DIR"/*) exit 0 ;;
28
+ esac
29
+ fi
30
+
31
+ case "$file_path" in
32
+ */tmp/* | *\\tmp\\* | */Temp/* | *\\Temp\\* | */var/folders/*) ;;
33
+ *) exit 0 ;;
34
+ esac
35
+
36
+ session=$(printf '%s' "$input" | jq -r '.session_id // "none"')
37
+ key=$(printf '%s' "$session" | tr -c 'A-Za-z0-9' '_')
38
+ marker_dir="${CLAUDE_PROJECT_DIR:-.}/.claude/.tmp/scratch-guard"
39
+ marker="$marker_dir/$key"
40
+ [ -f "$marker" ] && exit 0
41
+ mkdir -p "$marker_dir"
42
+ : >"$marker"
43
+
44
+ msg='Temporary file write outside .claude/.tmp/. Write temp files to .claude/.tmp/<slug>/ in the project root, not system temp. See the Scratch rule in CLAUDE.md.'
45
+ jq -nc --arg msg "$msg" '{hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:$msg}}'
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+
3
+ input=$(cat)
4
+ file=$(printf '%s' "$input" | jq -r '.tool_input.file_path // .tool_response.filePath // empty')
5
+
6
+ file="${file//\\//}"
7
+
8
+ case "$file" in
9
+ *.md) ;;
10
+ *) exit 0 ;;
11
+ esac
12
+
13
+ case "$file" in
14
+ *.claude/.tmp/* | *.claude/memory/* | *.claude/review/* | *.claude/plans/*) exit 0 ;;
15
+ esac
16
+
17
+ [ -f "$file" ] || exit 0
18
+
19
+ # Read the closed-set word bans from the standard so the hook never carries a
20
+ # second copy. Every "Do not use ... (`a`, `b`)" bullet contributes its
21
+ # single-word backticked terms, which skips the multi-word and punctuation bans.
22
+ standard="${CLAUDE_PROJECT_DIR:-.}/.claude/standards/prose.md"
23
+ words=""
24
+ if [ -f "$standard" ]; then
25
+ words=$(grep '^- Do not use ' "$standard" |
26
+ grep -o '`[^`]*`' |
27
+ tr -d '`' |
28
+ grep -x '[a-z][a-z]*' |
29
+ sort -u |
30
+ paste -sd '|' -)
31
+ fi
32
+
33
+ hits=$(awk -v words="$words" '
34
+ BEGIN { if (words != "") banned = "(^|[^a-z])(" words ")([^a-z]|$)" }
35
+ /^```/ { in_code = !in_code; next }
36
+ in_code { next }
37
+ /—/ { print NR ": em-dash: " $0 }
38
+ /;/ { print NR ": semicolon: " $0 }
39
+ banned != "" {
40
+ prose = tolower($0)
41
+ gsub(/`[^`]*`/, "", prose)
42
+ found = ""
43
+ delete seen
44
+ while (match(prose, banned)) {
45
+ word = substr(prose, RSTART, RLENGTH)
46
+ gsub(/[^a-z]/, "", word)
47
+ if (word != "" && !(word in seen)) {
48
+ seen[word] = 1
49
+ found = found (found == "" ? "" : ", ") word
50
+ }
51
+ prose = substr(prose, RSTART + RLENGTH)
52
+ }
53
+ if (found != "") print NR ": banned word (" found "): " $0
54
+ }
55
+ ' "$file")
56
+
57
+ [ -z "$hits" ] && exit 0
58
+
59
+ msg=$(printf 'Standards-audit: prose.md violations in %s. Rewrite or restructure (do not lazy-swap).\n%s' "$file" "$hits")
60
+
61
+ jq -nc --arg msg "$msg" '{hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:$msg}}'
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Regenerates .claude/tasks/index.md after a task file changes.
4
+ #
5
+ # The task folder is gitignored, so the whole-repo walk in `bun run check`
6
+ # drops it and never regenerates this index. A positional path bypasses that
7
+ # filter, which makes this hook the only trigger that reaches the folder.
8
+
9
+ input=$(cat)
10
+
11
+ tool=$(printf '%s' "$input" | jq -r '.tool_name // empty')
12
+ case "$tool" in
13
+ Write | Edit | MultiEdit) ;;
14
+ *) exit 0 ;;
15
+ esac
16
+
17
+ file_path=$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty')
18
+ [ -n "$file_path" ] || exit 0
19
+
20
+ case "$file_path" in
21
+ */.claude/tasks/*.md) ;;
22
+ *) exit 0 ;;
23
+ esac
24
+
25
+ case "$file_path" in
26
+ */.claude/tasks/index.md) exit 0 ;;
27
+ esac
28
+
29
+ # Report a missing CLI rather than exiting quietly. The path guard above already
30
+ # scopes this to a task-file edit, so the message only fires where the stale
31
+ # index it warns about is the actual outcome.
32
+ if ! command -v aitk >/dev/null 2>&1; then
33
+ jq -nc --arg msg 'aitk is not on PATH, so .claude/tasks/index.md was not regenerated and is now stale. Install the toolkit CLI or run aitk indexes regen by hand.' \
34
+ '{hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:$msg}}'
35
+ exit 0
36
+ fi
37
+
38
+ # The walk-up boundary has to come from the path, not from the session. Shared
39
+ # scratch resolves at the main worktree root, so a session inside a linked
40
+ # worktree passes a path that sits outside its own project directory and the
41
+ # default boundary would reject it.
42
+ root="${file_path%/.claude/tasks/*}"
43
+ [ -n "$root" ] || exit 0
44
+
45
+ # `--no-stage` because a hook has no business touching the index. On a project
46
+ # whose board is not gitignored, the default auto-stage would silently add task
47
+ # files to whatever commit is being assembled.
48
+ output=$(aitk indexes regen --no-stage --root "$root" "$file_path" 2>&1) && exit 0
49
+
50
+ # Regen failed, which on this folder means a task file is missing `title` or
51
+ # `description`. Report it. Nothing else can: the folder is gitignored, so the
52
+ # whole-repo walk never reaches it and no gate stage will ever fail on a stale
53
+ # index. Staying quiet here is what makes the drift permanent.
54
+ errors=$(printf '%s\n' "$output" | grep '^ERROR: ' | head -5)
55
+ [ -n "$errors" ] || errors="$output"
56
+
57
+ msg="Task index regen failed, so .claude/tasks/index.md is now stale. Fix the frontmatter and save again. $errors"
58
+ jq -nc --arg msg "$msg" \
59
+ '{hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:$msg}}'
60
+ exit 0
@@ -0,0 +1,39 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Grep|Glob",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/index-reminder.sh"
10
+ }
11
+ ]
12
+ },
13
+ {
14
+ "matcher": "Write|Edit",
15
+ "hooks": [
16
+ {
17
+ "type": "command",
18
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scratch-guard.sh"
19
+ }
20
+ ]
21
+ }
22
+ ],
23
+ "PostToolUse": [
24
+ {
25
+ "matcher": "Edit|Write|MultiEdit",
26
+ "hooks": [
27
+ {
28
+ "type": "command",
29
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/standards-audit.sh"
30
+ },
31
+ {
32
+ "type": "command",
33
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/tasks-index.sh"
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Tasks
3
+ subtitle: One file per task, ordered by phase label
4
+ ---
5
+
6
+ # Tasks
7
+
8
+ One file per task, ordered by phase label
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Wireframes
3
+ subtitle: Per-surface ASCII layouts loaded on demand
4
+ ---
5
+
6
+ # Wireframes
7
+
8
+ Per-surface ASCII layouts loaded on demand
@@ -0,0 +1,87 @@
1
+ # Project
2
+
3
+ [One-line description]
4
+
5
+ ## Context
6
+
7
+ - Before non-trivial work in a domain read `.claude/context/<domain>.md`, and before touching a UI surface read `.claude/wireframes/<surface>.md`. Pick which from the index anchors below.
8
+ - Scan `.claude/wiki/index.md` before answering a how-to question about project tooling or the shell environment, where that folder exists
9
+ - `claude-docs` populates context entries at ship time
10
+
11
+ @.claude/REQUIREMENTS.md
12
+ @.claude/ARCHITECTURE.md
13
+ @.claude/context/index.md
14
+ @.claude/wireframes/index.md
15
+
16
+ ## Behavior
17
+
18
+ - Flag concerns or alternatives when a proposed change has tradeoffs worth discussing
19
+ - When facing a judgment call with 2-3 reasonable options mid-flow, pick one and state the tradeoff in one sentence. Enumerate options only when the user's preference is the deciding factor.
20
+ - Match edit scope to the request. Ship minimal v1 and queue extensions as follow-ups.
21
+ - On simplification requests, edit only what the user named
22
+ - Do not add features the user did not ask for
23
+ - When rewriting a section, preserve existing code blocks, tables, and grouped examples unless the user asked to remove them
24
+ - When planning an edit to `CLAUDE.md`, show the proposed change as a fenced `diff` block in chat first, then wait for approval before calling `Edit`
25
+ - Edit an existing file with the file-editing tool, never a shell stream editor. An unescaped `&` in a `sed` replacement expands to the whole match, and `sed -i` exits zero when its pattern matches nothing, so both fail silently while reporting success. This governs edits you make, not stream editors written into a project's own scripts.
26
+
27
+ ## Indexes
28
+
29
+ - Check a folder's `index.md` before grepping its source or reading its files, starting with `.claude/context/` for a domain and `.claude/wireframes/` for a UI surface. It orients faster than a blind search.
30
+ - For folders where an agent browses to pick a document, `index.md` is regenerated from each file's frontmatter. Do not hand-edit `index.md`. Code folders and scratch folders do not need one.
31
+ - Every `index.md` carries its own frontmatter (`title`, `subtitle`) that the walker preserves. To keep a folder's `index.md` hand-edited, add `auto: false` to its frontmatter.
32
+
33
+ ## Commands
34
+
35
+ - Run `bun run check` before committing. Full script reference in `.claude/context/development.md`.
36
+
37
+ ## Output
38
+
39
+ - After creating or modifying a file, include its path on its own line so terminal emulators can make it clickable. Do not paraphrase paths into prose ("the seeds folder", "your CLAUDE.md").
40
+ - Use the path the user's editor can resolve. The editor is rooted at the main project root.
41
+ - In the main worktree: relative from `pwd` works because `pwd` equals the editor root
42
+ - In a linked worktree (under `.claude/worktrees/<name>/`): use absolute paths. Relative paths from worktree `pwd` would not resolve against the editor's project root.
43
+ - When the response covers multiple files, group paths under headers: `**Created:**`, `**Modified:**`, `**Deleted:**`. For single-file changes, the path on its own line is enough.
44
+
45
+ ## Key paths
46
+
47
+ - `src/`: [description]
48
+ - `.claude/`: planning docs (requirements, architecture, design, tasks)
49
+ - `.claude/context/`: per-domain narrative (how a domain is structured, decisions, gotchas), indexed via `.claude/context/index.md`
50
+ - `.claude/wireframes/`: per-surface ASCII layouts loaded on demand, indexed via `.claude/wireframes/index.md`
51
+ - `.claude/wiki/`: reference pages for tools, workflows, and concepts, indexed via `.claude/wiki/index.md`
52
+ - `.claude/rules/`: path-scoped coding standards loaded by Claude Code on file match
53
+ - `.claude/review/`: gitignored scratch for review and UI-test output, overwritten on each run
54
+
55
+ ## Spelling
56
+
57
+ - When cspell flags a word, rewrite typos. Add real terms to the appropriate dictionary in `cspell.json`.
58
+ - Keep dictionary files sorted alphabetically
59
+
60
+ ## Snippets
61
+
62
+ - When a snippet is referenced with `@`, execute its instructions immediately using available session context
63
+
64
+ ## Tasks
65
+
66
+ - `.claude/tasks/` is gitignored local session scratch, one file per task. Edit freely. No staging or revert before commits.
67
+ - Only create a task for work that spans multiple sessions or has real dependencies. Handle small edits immediately without a task entry.
68
+ - Do not add tasks retroactively for work already completed. Completed work is visible in git.
69
+ - When a task needs execution detail beyond its own file, create a plan in `.claude/plans/` and link to it from the task's intro paragraph. When that task ships, move its plan file to `.claude/.tmp/plans-archive/`. Never delete it.
70
+ - Write the plan in the same session as the task file. The session that executes the plan later inherits reasoning context it would otherwise have to re-derive.
71
+
72
+ ## Memory
73
+
74
+ - Write all memory files to `.claude/memory/`, not `~/.claude/projects/`
75
+ - Save a feedback memory only when the same mistake happens twice in the session, or when the user explicitly corrects you. First-occurrence slips are noise.
76
+ - Keep feedback memories to 3 lines: the rule, a one-line Why, and a one-line How to apply. Capture the pattern, not the recovery narrative.
77
+ - Before creating a new memory file, check for an existing one on the same topic. Update rather than duplicate.
78
+
79
+ ## Scratch
80
+
81
+ - Write temporary files to `.claude/.tmp/<slug>/<file>.md` in the project root, a nested `<slug>/` folder with a kebab-slug tied to the topic, not a flat `<slug>-<file>.md`. The scratch-guard hook enforces the location.
82
+
83
+ ## Worktrees
84
+
85
+ - Implementation work runs in a linked worktree. From the main worktree, enter one with `/claude-worktree` before editing tracked files for a feature.
86
+ - Shared session scratch (`.claude/plans/`, `.claude/review/`, `.claude/memory/`, `.claude/tasks/`) lives at the main worktree root, not inside a linked worktree. From a linked worktree, resolve these paths against the main root via `git worktree list --porcelain | grep -m 1 '^worktree ' | cut -d' ' -f2-`. Fall back to `pwd` if not a git repo.
87
+ - From a linked worktree, every `Edit` or `Write` to a tracked file (source, docs) must use a path starting with `pwd`. Only shared session scratch (`.claude/plans/`, `.claude/review/`, `.claude/memory/`, `.claude/tasks/`) resolves to the main worktree root.
@@ -0,0 +1,10 @@
1
+ {
2
+ "attribution": {
3
+ "commit": "",
4
+ "pr": ""
5
+ },
6
+ "permissions": {
7
+ "allow": ["Bash(bun run *)"],
8
+ "deny": ["Read(**/.env)", "Read(**/.env.*)"]
9
+ }
10
+ }
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env bash
2
+ input=$(cat)
3
+
4
+ {
5
+ IFS= read -r model
6
+ IFS= read -r effort
7
+ IFS= read -r remaining
8
+ IFS= read -r used_pct
9
+ IFS= read -r ctx_size
10
+ } <<<"$(
11
+ echo "$input" | jq -r '
12
+ .model.display_name // "",
13
+ .effort.level // "",
14
+ .context_window.remaining_percentage // "",
15
+ .context_window.used_percentage // "",
16
+ .context_window.context_window_size // ""'
17
+ )"
18
+
19
+ real_ctx="$ctx_size"
20
+ if [[ "${ANTHROPIC_BASE_URL:-}" == *"localhost"* ]] && command -v ollama &>/dev/null; then
21
+ ollama_ctx=$(ollama ps 2>/dev/null | awk 'NR>1 {print $7; exit}')
22
+ [ -n "$ollama_ctx" ] && real_ctx="$ollama_ctx"
23
+ fi
24
+
25
+ parts=""
26
+
27
+ [ -n "$model" ] && parts="$model"
28
+
29
+ if [ -n "$effort" ]; then
30
+ [ -n "$parts" ] && parts="$parts | $effort" || parts="$effort"
31
+ fi
32
+
33
+ if [ -n "$used_pct" ] && [ -n "$ctx_size" ]; then
34
+ used_k=$(awk "BEGIN {printf \"%.0f\", ($used_pct/100)*$ctx_size/1000}")
35
+ total_k=$(awk "BEGIN {printf \"%.0f\", $real_ctx/1000}")
36
+ tokens_part="${used_k}k / ${total_k}k"
37
+ [ -n "$parts" ] && parts="$parts | $tokens_part" || parts="$tokens_part"
38
+ fi
39
+
40
+ if [ -n "$remaining" ]; then
41
+ rounded=$(printf '%.0f' "$remaining")
42
+ reset=$'\033[0m'
43
+ if [ "$rounded" -lt 15 ]; then
44
+ ctx_part=$'\033[31m'"⚠ ${rounded}%${reset}"
45
+ elif [ "$rounded" -lt 30 ]; then
46
+ ctx_part=$'\033[33m'"${rounded}%${reset}"
47
+ else
48
+ ctx_part=$'\033[32m'"${rounded}%${reset}"
49
+ fi
50
+ [ -n "$parts" ] && parts="$parts | $ctx_part" || parts="$ctx_part"
51
+ fi
52
+
53
+ printf "%s" "$parts"
@@ -0,0 +1,14 @@
1
+ [run]
2
+ source = src
3
+ branch = True
4
+ omit =
5
+ tests/*
6
+ */__init__.py
7
+ data_file = .coverage_cache/.coverage
8
+
9
+ [report]
10
+ show_missing = True
11
+ skip_empty = True
12
+
13
+ [html]
14
+ directory = .coverage_cache/html
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,6 @@
1
+ [mypy]
2
+ python_version = 3.14
3
+ strict = True
4
+ ignore_missing_imports = True
5
+ exclude = (?x)(^tests/ | ^docs/)
6
+ mypy_path = src
@@ -0,0 +1,4 @@
1
+ [pytest]
2
+ addopts = -ra -q
3
+ testpaths = tests
4
+ pythonpath = src
@@ -0,0 +1,15 @@
1
+ indent-width = 4
2
+ line-length = 88
3
+ target-version = "py314"
4
+
5
+ [lint]
6
+ select = ["E", "W", "F", "I", "B", "C4", "UP", "N"]
7
+ ignore = ["E501", "B008"]
8
+
9
+ [format]
10
+ quote-style = "single"
11
+ indent-style = "space"
12
+ line-ending = "auto"
13
+
14
+ [lint.flake8-tidy-imports]
15
+ ban-relative-imports = "all"
@@ -0,0 +1,77 @@
1
+ #!/bin/bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ GREEN='\033[0;32m'
6
+ RED='\033[0;31m'
7
+ WHITE='\033[1;37m'
8
+ GREY='\033[0;90m'
9
+ NC='\033[0m'
10
+
11
+ NESTED="${VERIFY_NESTED:-false}"
12
+
13
+ log_info() { echo -e "${GREY}│${NC} ${GREEN}✓${NC} $1"; }
14
+ log_error() {
15
+ echo -e "${GREY}│${NC} ${RED}✗${NC} $1"
16
+ exit 1
17
+ }
18
+ log_step() { echo -e "${GREY}│${NC}\n${GREY}├${NC} ${WHITE}$1${NC}"; }
19
+
20
+ pipe_output() { while IFS= read -r line; do echo -e "${GREY}│${NC} $line"; done; }
21
+
22
+ check_dependencies() {
23
+ command -v bun >/dev/null 2>&1 || log_error "bun is not installed"
24
+ command -v uv >/dev/null 2>&1 || log_error "uv is not installed"
25
+ }
26
+
27
+ run_check() {
28
+ local cmd=$1
29
+ local err_msg=$2
30
+ local output
31
+ if ! output=$(eval "$cmd" 2>&1); then
32
+ echo "$output" | pipe_output
33
+ log_error "$err_msg"
34
+ fi
35
+ echo "$output" | pipe_output
36
+ }
37
+
38
+ main() {
39
+ check_dependencies
40
+
41
+ if [ "$NESTED" = false ]; then echo -e "${GREY}┌${NC}"; fi
42
+
43
+ echo -e "${GREY}├${NC} ${WHITE}Typecheck${NC}"
44
+ run_check "bun run typecheck" "Typecheck failed"
45
+ log_info "Typecheck passed"
46
+
47
+ log_step "Lint"
48
+ run_check "bun run lint" "Lint failed"
49
+ log_info "Lint passed"
50
+
51
+ log_step "Formatting"
52
+ run_check "bun run format" "Format failed"
53
+ log_info "Format applied"
54
+
55
+ log_step "Format check"
56
+ run_check "bun run check:format" "Format check failed"
57
+ log_info "Format check passed"
58
+
59
+ log_step "Spelling"
60
+ run_check "bun run check:spell" "Spell check failed"
61
+ log_info "Spell check passed"
62
+
63
+ log_step "Shell"
64
+ run_check "bun run check:shell" "Shell check failed"
65
+ log_info "Shell check passed"
66
+
67
+ log_step "Unit tests"
68
+ run_check "bun run test:run" "Unit tests failed"
69
+ log_info "Unit tests passed"
70
+
71
+ if [ "$NESTED" = false ]; then
72
+ echo -e "${GREY}└${NC}\n"
73
+ echo -e "${GREEN}✓ Verification passed${NC}"
74
+ fi
75
+ }
76
+
77
+ main "$@"
@@ -0,0 +1,16 @@
1
+ [stack]
2
+ name = "python"
3
+ extends = "base"
4
+ runtime = "uv"
5
+ scaffold = "uv init --app {{name}}"
6
+
7
+ [scripts]
8
+ "lint" = "uv run ruff check . && uv run ruff format --check ."
9
+ "lint:fix" = "uv run ruff check --fix . && uv run ruff format ."
10
+ "typecheck" = "uv run mypy ."
11
+ "test" = "uv run pytest"
12
+ "test:run" = "uv run pytest -v"
13
+ "test:cov" = "uv run pytest --cov --cov-report=term-missing --cov-report=html"
14
+
15
+ [gitignore]
16
+ "# Python" = [".pytest_cache/", ".mypy_cache/", ".ruff_cache/", ".coverage_cache/"]
@@ -0,0 +1,66 @@
1
+ # Tooling Python reference
2
+
3
+ > Extends: `base`. Apply base stack first.
4
+
5
+ ## Overview
6
+
7
+ The python stack covers Python 3.13+ projects managed with `uv`. It ships golden sidecar configs for `ruff`, `mypy`, `pytest`, and `coverage`, plus a `.python-version` pin and a python-aware `verify.sh`. Framework adapters layer on top with their own deps and configs.
8
+
9
+ Configs ship as sidecar files (`ruff.toml`, `mypy.ini`, `pytest.ini`, `.coveragerc`) rather than `[tool.*]` sections in `pyproject.toml`. Sync overwrites configs on every run, so keeping them sidecar avoids stomping the user-owned `[project]` block in `pyproject.toml`.
10
+
11
+ ## Scaffold checklist
12
+
13
+ 1. Scaffold with `uv init --app <name>`. This creates `pyproject.toml`, `.python-version` pinned to 3.14, `src/<name>/`, and a starter `main.py`. `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, cspell, commitlint) have a target to install into: `bun init -y`. Without this `aitk tooling sync` drops base configs but skips the dep install, since `resolve_missing_deps` short-circuits when `package.json` is absent.
15
+ 3. Install base tooling: `aitk tooling sync base .`
16
+ 4. Install python tooling: `aitk tooling sync python .`
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
+ 6. Sync the lockfile and create the venv: `uv sync`.
19
+ 7. Annotate `main()` in the scaffold-generated `main.py` with `-> None`. `uv init --app` ships an unannotated `main()` that fails strict mypy on the first run.
20
+ 8. Run `bun run lint:fix` then `bun run check`.
21
+
22
+ 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.
23
+
24
+ ## What ships as golden configs
25
+
26
+ - `ruff.toml`: line length 88, target `py314`, strict lint rules (`E`, `W`, `F`, `I`, `B`, `C4`, `UP`, `N`), single-quote format, banned relative imports.
27
+ - `mypy.ini`: strict mode, `python_version = 3.14`, `mypy_path = src`, excludes `tests/` and `docs/`.
28
+ - `pytest.ini`: tests live under `tests/`, source under `src/`.
29
+ - `.coveragerc`: branch coverage on `src/`, html report under `.coverage_cache/html`.
30
+ - `.python-version`: pinned to `3.14` to match `uv init --app` defaults.
31
+ - `scripts/verify.sh`: overrides base verify to add Typecheck (`mypy`), Lint (`ruff check && ruff format --check`), and Tests (`pytest -v`) phases.
32
+
33
+ ## Hybrid project shape
34
+
35
+ 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, cspell, 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.
36
+
37
+ ## Dependencies
38
+
39
+ The manifest declares no `[dependencies.dev]`. Manifest injection currently calls `bun add -D` for any declared deps, which would fail for Python packages. v1 sidesteps this by leaving the section empty. Framework adapters that need Python deps require the injector to branch on `runtime` or detect `pyproject.toml` and call `uv add --dev` instead.
40
+
41
+ ## Verify command
42
+
43
+ `aitk tooling verify <stack>` currently runs `bun run lint:fix` and `bun run check` against any stack with a `package.json`. Since base ships a `package.json`, those run for python too. Python's verify.sh wraps the package.json `lint`/`typecheck`/`test:run` scripts that delegate to `uv run`, so the verify path works end-to-end as long as `uv` is installed in the verify environment. The end-to-end test and screenshot phases are gated on `package.json` script keys that python does not declare, so they cleanly skip.
44
+
45
+ ## Anti-patterns
46
+
47
+ - Do not use `pip` directly. Always go through `uv add` / `uv sync` / `uv run`.
48
+ - Do not move `[tool.ruff]`, `[tool.mypy]`, `[tool.pytest.ini_options]`, or `[tool.coverage.*]` into `pyproject.toml`. Sync owns the sidecar files. Editing `pyproject.toml` tool sections will conflict with the sidecars and produce silent precedence bugs.
49
+ - Do not pin Python via `[project] requires-python` and `.python-version` independently. Treat `.python-version` as the source of truth and let `requires-python` in `pyproject.toml` track it.
50
+ - Do not add `commitizen` for conventional commits. The base stack already ships commitlint + husky. Two enforcers is one too many.
51
+ - Do not ship a `Dockerfile` or `mkdocs` config under tooling. Those are framework or deployment choices and belong in the project itself or in a future adapter stack.
52
+
53
+ ## Development docs (extend)
54
+
55
+ Append to the `## Scripts` table:
56
+
57
+ | `bun run lint` | Run `ruff check` and `ruff format --check`. |
58
+ | `bun run lint:fix` | Auto-fix with `ruff check --fix` then `ruff format`. |
59
+ | `bun run typecheck` | Run `mypy` in strict mode. |
60
+ | `bun run test` | Run `pytest`. |
61
+ | `bun run test:run` | Run `pytest -v` (used by `verify`). |
62
+ | `bun run test:cov` | Run `pytest` with branch coverage and HTML report. |
63
+
64
+ ## CI docs (extend)
65
+
66
+ In `.claude/context/ci.md`, the Typecheck row's assertion reads: `` `mypy .` passes ``. Add a Lint row whose assertion reads: `` `ruff check` and `ruff format --check` pass ``. Add a Tests row whose assertion reads: `` `pytest` exits 0 ``.
@@ -0,0 +1,19 @@
1
+ addopts
2
+ appuser
3
+ asyncio
4
+ coveragerc
5
+ dotenv
6
+ fastapi
7
+ flake8
8
+ htmlcov
9
+ mkdocs
10
+ mypy
11
+ pycache
12
+ pyproject
13
+ pytest
14
+ pythonpath
15
+ PYTHONUNBUFFERED
16
+ ruff
17
+ testpaths
18
+ venv
19
+ virtualenv
@@ -0,0 +1,2 @@
1
+ def test_smoke() -> None:
2
+ assert True