@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,81 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/ui.sh"
9
+
10
+ ZSHRC="${ZDOTDIR:-$HOME}/.zshrc"
11
+ MARKER_OPEN="# >>> aitk aliases >>>"
12
+ MARKER_CLOSE="# <<< aitk aliases <<<"
13
+
14
+ check_dependencies() {
15
+ command -v bun >/dev/null 2>&1 || log_error "bun is not installed. See https://bun.sh, then re-run."
16
+ }
17
+
18
+ install_cli() {
19
+ log_step "Installing the aitk CLI"
20
+ bun install --cwd "$PROJECT_ROOT" >/dev/null
21
+ bun link --cwd "$PROJECT_ROOT" >/dev/null
22
+ log_info "Dependencies installed and aitk linked"
23
+ }
24
+
25
+ alias_block() {
26
+ cat <<EOF
27
+ $MARKER_OPEN
28
+ TOOLKIT="$PROJECT_ROOT"
29
+
30
+ alias cl='claude'
31
+ alias clr='cl -r'
32
+ alias clc='cl -c'
33
+ alias clw='cl -w'
34
+ alias cls='cl --model sonnet'
35
+
36
+ alias clp='claude --plugin-dir \$TOOLKIT/claude'
37
+ alias clpc='clp -c'
38
+ alias clps='clp --model sonnet'
39
+ $MARKER_CLOSE
40
+ EOF
41
+ }
42
+
43
+ install_aliases() {
44
+ log_step "Installing Claude Code shell aliases"
45
+
46
+ if [ -f "$ZSHRC" ] && grep -qF "$MARKER_OPEN" "$ZSHRC"; then
47
+ log_info "Aliases already present in $ZSHRC, skipping"
48
+ return
49
+ fi
50
+
51
+ if [ -f "$ZSHRC" ] && grep -qE "^alias clp=" "$ZSHRC"; then
52
+ log_warn "An unmanaged clp alias is already in $ZSHRC. Leaving it untouched."
53
+ log_warn "Remove it and re-run to switch to the managed block."
54
+ return
55
+ fi
56
+
57
+ printf '\n%s\n' "$(alias_block)" >>"$ZSHRC"
58
+ log_add "Appended aitk alias block to $ZSHRC"
59
+ log_info "Run 'source $ZSHRC' or open a new shell to load them"
60
+ }
61
+
62
+ verify_cli() {
63
+ log_step "Verifying the install"
64
+ if aitk --help >/dev/null 2>&1; then
65
+ log_info "aitk resolves on PATH"
66
+ else
67
+ log_warn "aitk not on PATH yet. Ensure \$BUN_INSTALL/bin is exported, then re-open your shell."
68
+ fi
69
+ }
70
+
71
+ main() {
72
+ open_timeline "aitk bootstrap"
73
+ trap close_timeline EXIT
74
+
75
+ check_dependencies
76
+ install_cli
77
+ install_aliases
78
+ verify_cli
79
+ }
80
+
81
+ main "$@"
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ INTERNAL_ROOT="$PROJECT_ROOT/internal"
9
+ PLUGIN_ROOT="$PROJECT_ROOT/claude"
10
+
11
+ # `find` writes to stderr and returns non-zero for a missing root, inside a
12
+ # process substitution whose status nothing reads. Without this the walk covers
13
+ # nothing and the check reports the boundary clean having never measured it.
14
+ if [ ! -d "$PLUGIN_ROOT" ]; then
15
+ echo "No plugin root at ${PLUGIN_ROOT#"$PROJECT_ROOT/"}, boundary unverifiable." >&2
16
+ exit 1
17
+ fi
18
+
19
+ # `realpath` resolves each walked path below. Absent, `set -e` aborts on the
20
+ # substitution and the stage reports a leak for a tool that is not installed,
21
+ # which is the same unmeasured-tree-with-a-verdict shape the guard above closes.
22
+ if ! command -v realpath >/dev/null 2>&1; then
23
+ echo "realpath is not installed, boundary unverifiable." >&2
24
+ exit 1
25
+ fi
26
+
27
+ # The plugin reaches `standards/` and `snippets/` through symlinks, which an
28
+ # installer dereferences with no code in the path to filter. Walking the plugin
29
+ # tree with symlinks followed is what an install actually copies, so resolving
30
+ # each file and rejecting anything under `internal/` asserts the boundary at the
31
+ # only place it can be measured.
32
+ leaked=""
33
+ while IFS= read -r file; do
34
+ resolved=$(realpath "$file")
35
+ case "$resolved" in
36
+ "$INTERNAL_ROOT"/*) leaked="$leaked ${file#"$PROJECT_ROOT/"} -> ${resolved#"$PROJECT_ROOT/"}"$'\n' ;;
37
+ esac
38
+ done < <(find -L "$PLUGIN_ROOT" -type f)
39
+
40
+ if [ -n "$leaked" ]; then
41
+ echo "Plugin ships toolkit-internal content:" >&2
42
+ printf '%s' "$leaked" >&2
43
+ echo "Author internal content under internal/, which nothing under claude/ reaches." >&2
44
+ exit 1
45
+ fi
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ SKILLS_DIR="$PROJECT_ROOT/claude/skills"
9
+
10
+ # A shipped skill runs from a target project, where the toolkit's own wiki/ does
11
+ # not exist. Anchoring on a non-path character keeps a target's .claude/wiki/ legal.
12
+ BANNED_PATH_PATTERN='(^|[^[:alnum:]._/-])wiki/'
13
+
14
+ [ -d "$SKILLS_DIR" ] || exit 0
15
+
16
+ matches=$(grep -rnE "$BANNED_PATH_PATTERN" "$SKILLS_DIR" || true)
17
+
18
+ [ -z "$matches" ] && exit 0
19
+
20
+ echo "Shipped skills reference a repo-local path that does not exist in a target project:"
21
+ echo "$matches" | sed "s|^$PROJECT_ROOT/||"
22
+ echo
23
+ echo "Reach supporting prose through an aitk docs command, a bundled reference, or inlined text."
24
+ echo "A match inside a references/ folder is a generated copy. Fix the source under standards/bundled/."
25
+ exit 1
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/ui.sh"
9
+
10
+ check_dependencies() {
11
+ command -v bun >/dev/null 2>&1 || log_error "bun is not installed"
12
+ }
13
+
14
+ main() {
15
+ check_dependencies
16
+
17
+ echo -e "${GREY}┌${NC}"
18
+
19
+ echo -e "${GREY}├${NC} ${WHITE}Cleaning artifacts${NC}"
20
+ rm -rf node_modules
21
+
22
+ log_rem "node_modules/"
23
+
24
+ log_step "Cleaning cache"
25
+ bun pm cache rm
26
+ log_info "Package manager cache cleared"
27
+
28
+ log_step "Rehydrating project"
29
+ bun install
30
+ log_info "Dependencies installed"
31
+
32
+ echo -e "${GREY}└${NC}\n"
33
+ echo -e "${GREEN}✓ Clean complete${NC}"
34
+ }
35
+
36
+ main "$@"
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/ui.sh"
9
+
10
+ TMP_ROOT="$PROJECT_ROOT/.claude/.tmp/install-check"
11
+ CLONE_DIR="$TMP_ROOT/clone"
12
+ TARGET_DIR="$TMP_ROOT/target"
13
+ KEEP=0
14
+
15
+ for arg in "$@"; do
16
+ case "$arg" in
17
+ --keep) KEEP=1 ;;
18
+ --help | -h)
19
+ cat <<HELP
20
+ Usage: scripts/core/install-check.sh [--keep]
21
+
22
+ Verifies the README install path end to end:
23
+ 1. Clones this repo into .claude/.tmp/install-check/clone
24
+ 2. Runs bun install in the clone
25
+ 3. Runs the CLI with --help to confirm it executes
26
+ 4. Scaffolds a fresh project in .claude/.tmp/install-check/target
27
+ 5. Runs aitk init and asserts a scaffold landed
28
+
29
+ Flags:
30
+ --keep Keep the tmp tree on exit for inspection
31
+ HELP
32
+ exit 0
33
+ ;;
34
+ esac
35
+ done
36
+
37
+ cleanup() {
38
+ if [ "$KEEP" = "1" ]; then
39
+ log_info "Kept artifacts at $TMP_ROOT"
40
+ else
41
+ rm -rf "$TMP_ROOT"
42
+ fi
43
+ close_timeline
44
+ }
45
+ trap cleanup EXIT
46
+
47
+ rm -rf "$TMP_ROOT"
48
+ mkdir -p "$TMP_ROOT"
49
+
50
+ open_timeline "Install verification"
51
+
52
+ log_step "Clone"
53
+ git clone --quiet "$PROJECT_ROOT" "$CLONE_DIR" 2>&1 | pipe_output || true
54
+ log_info "Cloned to $CLONE_DIR"
55
+
56
+ log_step "Install dependencies"
57
+ (cd "$CLONE_DIR" && bun install --silent 2>&1 | pipe_output) || log_error "bun install failed"
58
+ log_info "Dependencies installed"
59
+
60
+ log_step "Confirm CLI runs"
61
+ (cd "$CLONE_DIR" && bun run src/cli.ts --help >/dev/null) || log_error "aitk --help failed"
62
+ log_info "aitk --help ran clean"
63
+
64
+ log_step "Scaffold fresh project"
65
+ mkdir -p "$TARGET_DIR"
66
+ (cd "$TARGET_DIR" && git init --quiet)
67
+ log_info "Initialized git in $TARGET_DIR"
68
+
69
+ log_step "Run aitk init"
70
+ (cd "$TARGET_DIR" && AITK_NON_INTERACTIVE=1 bun run "$CLONE_DIR/src/cli.ts" init --stack base 2>&1 | pipe_output) || log_error "aitk init failed"
71
+ log_info "aitk init completed"
72
+
73
+ log_step "Assert scaffold"
74
+ # Every domain aitk init installs needs at least one path here. A domain with
75
+ # no assertion can truncate silently: init still exits 0 because run_domain
76
+ # catches a failed domain, and the gate stays green while the target is
77
+ # missing everything that domain provides.
78
+ for path in "CLAUDE.md" ".claude/snippets/compact-summary.md" ".claude/standards/prose.md" ".claude/wiki/index.md" ".claude" ".claude/context/index.md" ".claude/wireframes/index.md" \
79
+ ".prettierrc" ".editorconfig" ".lintstagedrc" ".husky/pre-commit" ".github/workflows/verify.yml" "scripts/verify.sh" \
80
+ ".claude/rules/core/000-constitution.md"; do
81
+ if [ ! -e "$TARGET_DIR/$path" ]; then
82
+ log_error "Missing after aitk init: $path"
83
+ fi
84
+ log_info "Found: $path"
85
+ done
86
+
87
+ if [ ! -x "$TARGET_DIR/scripts/verify.sh" ]; then
88
+ log_error "Not executable after aitk init: scripts/verify.sh"
89
+ fi
90
+ log_info "Executable: scripts/verify.sh"
91
+
92
+ log_step "Verification passed"
93
+ log_info "Manual check still needed: bun link and global aitk invocation"
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ mirror_dir() {
9
+ local src="$1"
10
+ local dest="$2"
11
+ local find_args=("${@:3}")
12
+
13
+ rm -rf "$dest"
14
+ while IFS= read -r file; do
15
+ local rel="${file#"$src"/}"
16
+ mkdir -p "$dest/$(dirname "$rel")"
17
+ cp "$file" "$dest/$rel"
18
+ done < <(find "$src" -type f "${find_args[@]}" | sort)
19
+ }
20
+
21
+ mirror_dir "$PROJECT_ROOT/standards" "$PROJECT_ROOT/.claude/standards" -name "*.md" -not -path "*/bundled/*"
22
+ mirror_dir "$PROJECT_ROOT/snippets" "$PROJECT_ROOT/.claude/snippets" -name "*.md"
23
+
24
+ # `internal/` is the surface the plugin does not symlink. Mirrored on its own so
25
+ # toolkit sessions read it at a `.claude/` path like every other consumed copy.
26
+ mirror_dir "$PROJECT_ROOT/internal" "$PROJECT_ROOT/.claude/internal" -name "*.md"
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/ui.sh"
9
+
10
+ bun "$PROJECT_ROOT/src/cli.ts" indexes regen --root "$PROJECT_ROOT" --json >/dev/null
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/frontmatter.sh"
9
+
10
+ BUNDLED_DIR="$PROJECT_ROOT/standards/bundled"
11
+ SKILLS_DIR="$PROJECT_ROOT/claude/skills"
12
+
13
+ [ -d "$BUNDLED_DIR" ] || exit 0
14
+
15
+ while IFS= read -r file; do
16
+ filename="$(basename "$file")"
17
+ consumers="$(read_frontmatter_field "$file" "consumers")"
18
+ [ -z "$consumers" ] && continue
19
+ IFS=',' read -ra skills <<<"$consumers"
20
+ for skill in "${skills[@]}"; do
21
+ skill="${skill// /}"
22
+ [ -z "$skill" ] && continue
23
+ dest_dir="$SKILLS_DIR/$skill/references"
24
+ mkdir -p "$dest_dir"
25
+ cp "$file" "$dest_dir/$filename"
26
+ done
27
+ done < <(find "$BUNDLED_DIR" -type f -name "*.md" | sort)
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env 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
+
19
+ OUTPUT_FILE=".claude/.tmp/project/PROJECT-SNAPSHOT.md"
20
+
21
+ check_dependencies() {
22
+ command -v find >/dev/null 2>&1 || log_error "find not installed"
23
+ }
24
+
25
+ load_gitignore_patterns() {
26
+ if [ ! -f ".gitignore" ]; then
27
+ echo ""
28
+ return
29
+ fi
30
+ grep -v '^\s*#' .gitignore | grep -v '^\s*$' | sed 's|/$||'
31
+ }
32
+
33
+ is_ignored() {
34
+ local name="$1"
35
+ local patterns="$2"
36
+
37
+ [ "$name" = ".git" ] && return 0
38
+ [ "$name" = "_" ] && return 0
39
+
40
+ while IFS= read -r pattern; do
41
+ [ -z "$pattern" ] && continue
42
+ # shellcheck disable=SC2053
43
+ if [[ "$name" == $pattern ]]; then
44
+ return 0
45
+ fi
46
+ done <<<"$patterns"
47
+
48
+ return 1
49
+ }
50
+
51
+ build_tree() {
52
+ local dir="${1:-.}"
53
+ local prefix="${2:-}"
54
+ local patterns="${3:-}"
55
+ local entries=()
56
+
57
+ while IFS= read -r entry; do
58
+ local name
59
+ name=$(basename "$entry")
60
+ is_ignored "$name" "$patterns" && continue
61
+ entries+=("$entry")
62
+ done < <(find "$dir" -maxdepth 1 -mindepth 1 | sort)
63
+
64
+ local count=${#entries[@]}
65
+ local i=0
66
+
67
+ for entry in "${entries[@]}"; do
68
+ i=$((i + 1))
69
+ local name
70
+ name=$(basename "$entry")
71
+ local connector="├──"
72
+ local child_prefix="${prefix}│ "
73
+
74
+ if [ "$i" -eq "$count" ]; then
75
+ connector="└──"
76
+ child_prefix="${prefix} "
77
+ fi
78
+
79
+ if [ -d "$entry" ]; then
80
+ echo "${prefix}${connector} ${name}/"
81
+ build_tree "$entry" "$child_prefix" "$patterns"
82
+ else
83
+ echo "${prefix}${connector} ${name}"
84
+ fi
85
+ done
86
+ }
87
+
88
+ write_snapshot() {
89
+ local project_name
90
+ project_name=$(basename "$PWD")
91
+ local patterns
92
+ patterns=$(load_gitignore_patterns)
93
+
94
+ mkdir -p "$(dirname "$OUTPUT_FILE")"
95
+
96
+ {
97
+ echo "# Project Snapshot: $project_name"
98
+ echo ""
99
+ echo "## Structure"
100
+ echo ""
101
+ echo '```'
102
+ build_tree "." "" "$patterns"
103
+ echo '```'
104
+ echo ""
105
+
106
+ if [ -f "package.json" ]; then
107
+ echo "## package.json"
108
+ echo ""
109
+ echo '```json'
110
+ cat package.json
111
+ echo '```'
112
+ echo ""
113
+ fi
114
+ } >"$OUTPUT_FILE"
115
+ }
116
+
117
+ main() {
118
+ check_dependencies
119
+
120
+ if [ "$NESTED" = false ]; then echo -e "${GREY}┌${NC}"; fi
121
+
122
+ echo -e "${GREY}├${NC} ${WHITE}Snapshot${NC}"
123
+ write_snapshot
124
+ log_info "Written to $OUTPUT_FILE"
125
+
126
+ if [ "$NESTED" = false ]; then
127
+ echo -e "${GREY}└${NC}\n"
128
+ echo -e "${GREEN}✓ Snapshot complete${NC}"
129
+ fi
130
+ }
131
+
132
+ main "$@"
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ set -o pipefail
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
7
+
8
+ source "$PROJECT_ROOT/scripts/lib/ui.sh"
9
+
10
+ check_dependencies() {
11
+ command -v bun >/dev/null 2>&1 || log_error "bun is not installed"
12
+ }
13
+
14
+ main() {
15
+ check_dependencies
16
+
17
+ echo -e "${GREY}┌${NC}"
18
+
19
+ echo -e "${GREY}├${NC} ${WHITE}Interactive dependency update${NC}"
20
+ echo -e "${GREY}│${NC}"
21
+ bun update --interactive
22
+
23
+ log_step "Verifying project health"
24
+ if [ -f "$SCRIPT_DIR/verify.sh" ]; then
25
+ VERIFY_NESTED=true "$SCRIPT_DIR/verify.sh"
26
+ log_info "All checks passed"
27
+ else
28
+ log_warn "Verification script not found, skipping."
29
+ fi
30
+
31
+ echo -e "${GREY}└${NC}\n"
32
+ echo -e "${GREEN}✓ Update complete${NC}"
33
+ }
34
+
35
+ main "$@"