@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,80 @@
1
+ ---
2
+ name: claude-memory-capture
3
+ description: Extracts durable patterns from the current session and writes them to `.claude/memory/` as feedback, project, user, or reference memory files. Use when asked to "capture memory", "capture lessons", "wrap up the session", "end of session memory", or as the final step in autoship. Do NOT use to curate existing memory. Use `claude-memory-review` for that.
4
+ ---
5
+
6
+ # Claude memory capture
7
+
8
+ Scan the current session for patterns worth persisting, write them as memory files, and update the index. Pair with `claude-memory-review` for later curation.
9
+
10
+ ## Guards
11
+
12
+ - All `.claude/memory/` reads and writes resolve at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
13
+ - If `.claude/memory/` does not exist at the main worktree root, create it.
14
+ - If the session produced no user corrections, confirmations, or context disclosures worth persisting, stop: `✅ Nothing worth capturing.`
15
+
16
+ ## Step 1: read context
17
+
18
+ Read in parallel from the project root, skipping any that do not exist:
19
+
20
+ - `CLAUDE.md`: Memory section rules, including save thresholds and file format overrides
21
+ - `.claude/memory/MEMORY.md`: existing index, to avoid duplicates
22
+ - `.claude/standards/prose.md`: prose conventions applied to memory file bodies
23
+
24
+ Read a standard from `${CLAUDE_SKILL_DIR}/../../standards/` instead when the project does not have it.
25
+
26
+ ## Step 2: classify candidates
27
+
28
+ Scan the session and group candidate patterns into four types:
29
+
30
+ - **feedback**: explicit user corrections, stated preferences, or non-obvious confirmations
31
+ - **project**: decisions, initiatives, deadlines, or motivations not derivable from git or code
32
+ - **user**: role, expertise, responsibilities, or working preferences
33
+ - **reference**: pointers to external systems (dashboards, trackers, channels)
34
+
35
+ Apply the save threshold: a feedback memory only fires on explicit user correction, or on a pattern that repeated twice in the session. First-occurrence slips are noise. Project, user, and reference memories fire on first disclosure.
36
+
37
+ ## Step 3: dedupe
38
+
39
+ For each candidate, grep `.claude/memory/` for an existing file on the same topic. If one exists, update it in place rather than create a new file.
40
+
41
+ ## Step 4: write
42
+
43
+ For each new memory, write to `.claude/memory/<type>-<slug>.md` with this frontmatter:
44
+
45
+ ```markdown
46
+ ---
47
+ name: <memory name>
48
+ description: <one-line description per .claude/standards/prose.md § Frontmatter descriptions>
49
+ type: <feedback|project|user|reference>
50
+ ---
51
+
52
+ <memory body>
53
+ ```
54
+
55
+ Feedback and project bodies must be three lines: the rule or fact on one line, a `**Why:**` line naming the session signal, and a `**How to apply:**` line for when the rule fires next. Keep each line tight. No narrative.
56
+
57
+ User and reference bodies are a single sentence each.
58
+
59
+ Then append a row to the matching table in `.claude/memory/MEMORY.md`:
60
+
61
+ ```markdown
62
+ | <name> | <file> | <description> |
63
+ ```
64
+
65
+ ## Output
66
+
67
+ Respond with one line per memory written or updated:
68
+
69
+ - `✅ Wrote: .claude/memory/<file> (<type>)`
70
+ - `✏️ Updated: .claude/memory/<file> (<type>)`
71
+
72
+ When at least one entry was written or updated, add a closing line so the standalone caller proposes fixes while context is fresh:
73
+
74
+ `→ Run /claude-memory-review to propose fixes for the pen before the session ends.`
75
+
76
+ The ship skills run review Propose themselves, so this line is for the standalone `/claude-memory-capture` path.
77
+
78
+ If nothing was captured, output:
79
+
80
+ `✅ Nothing worth capturing.`
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: claude-memory-review
3
+ description: What memory review is for, the gaps it closes, and why every action waits on approval
4
+ ---
5
+
6
+ # Claude memory review requirement
7
+
8
+ ## Gap
9
+
10
+ Without this skill, the memory folder grows and never drains. Entries pile up restating rules a durable surface already carries, nothing decides which memory has earned a place in one, and a rule that does get promoted arrives verbatim in a file whose voice it does not match. The folder then reads as a second source of truth that no surface points at.
11
+
12
+ ## Must
13
+
14
+ - Treat the folder as a holding pen, so every entry in scope leaves it as a promotion, a handoff, or a deletion rather than surviving by default
15
+ - Verify the rule is not already stated or implied in the target before proposing a promotion, by reading the target rather than trusting the memory's claim about it
16
+ - Rewrite a rule into the destination's voice instead of moving it unchanged
17
+ - Write the proposal to a receipt on disk and take no action until the user decides per item
18
+ - Keep a promotion on its own commit, since a change to how the agent operates should not ride inside a feature a reviewer is vetting for something else
19
+
20
+ ## Must not
21
+
22
+ - Apply anything the user has not approved by item
23
+ - Author a governance rule inline. Coding-standards rules have an owner and a scaffolding path, and a rule written here bypasses both.
24
+ - Mutate tracked files from the main worktree
25
+ - Answer a question raised in a decision slot while applying. Discussion and application are separate passes so an approval is never inferred from a reply.
26
+
27
+ ## Guards
28
+
29
+ - No memory folder at the main root: stop
30
+ - The folder holds only its index: stop with a pass, not an error
31
+ - Apply invoked from the main worktree: stop and name the worktree command
32
+
33
+ ## Out of scope
34
+
35
+ - Writing memories, which `claude-memory-capture` owns
36
+ - Judging whether an entry should have been captured. That is a gate at capture time, and re-deciding it here would delete evidence the capture rule is wrong.
37
+ - Editing the governance rules a handoff points at
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: claude-memory-review
3
+ description: Reviews `.claude/memory/` and proposes per-entry actions (promote to `CLAUDE.md`, move into a skill body, hand off to governance, or delete as stale). Also runs the discuss, challenge, apply, and cleanup phases on an existing review file. Use when asked to "review memory", "discuss memory questions", "challenge the promotes", "apply memory decisions", "cleanup memory review", "promote memory", or "consolidate memories". Do NOT auto-apply. Output a grouped proposal and wait for block-by-block approval.
4
+ ---
5
+
6
+ # Claude memory review
7
+
8
+ This skill drives the full memory review lifecycle in five phases. Pick the phase from what the user said and whether a review receipt already exists at `<main-root>/.claude/review/memory-review-*.md`.
9
+
10
+ | User intent | Phase | Mutates |
11
+ | ---------------------------------------------- | --------- | ---------------------------- |
12
+ | "review memory", "promote memory" (no receipt) | Propose | review file only |
13
+ | "challenge the promotes" (receipt exists) | Challenge | review file only |
14
+ | "discuss", "respond to questions" | Discuss | review file only |
15
+ | "apply decisions", "commit", "ship the review" | Apply | tracked files + memory files |
16
+ | "cleanup", "sweep stale", "delete the receipt" | Cleanup | memory files + review file |
17
+
18
+ If the user just re-pings the skill with no new phrase and a receipt exists, default to Discuss when any `Decision:` contains `?`, otherwise Apply.
19
+
20
+ ## Guards
21
+
22
+ - All `.claude/memory/` reads, edits, and deletes resolve at the main worktree root, not the current worktree. See Worktrees in `CLAUDE.md`.
23
+ - If no `.claude/memory/` directory exists at the main worktree root, stop: `❌ No .claude/memory/ directory found.`
24
+ - If `.claude/memory/` contains no `*.md` entries other than `MEMORY.md`, stop: `✅ No memory entries to review.`
25
+ - Resolve the main root via `git worktree list --porcelain | grep -m 1 '^worktree ' | cut -d' ' -f2-`, falling back to `pwd`. All review and memory reads anchor here.
26
+
27
+ ## Propose phase
28
+
29
+ Propose is the ship-time entry point. The ship skills run it right after capture, so the fix is written while session context is fresh.
30
+
31
+ ### Scope
32
+
33
+ - **Ship-scoped:** when a ship caller (`git-ship`, `claude-autoship`) names the entries captured this session, classify only those entries. Read the full pen for merge and absorbed comparison, but do not propose actions on carried entries the captures do not touch. Each carried entry was already proposed on in its own ship cycle.
34
+ - **Full sweep:** when invoked standalone with no named set, classify every entry in the pen, including entries carried from earlier sessions, so cross-session duplicates merge into one rule.
35
+
36
+ ### Step 1: read the memory folder
37
+
38
+ Read in parallel from the project root:
39
+
40
+ - `.claude/memory/MEMORY.md`: the index
41
+ - every other `*.md` file under `.claude/memory/`: individual entries with frontmatter (`name`, `description`, `type`)
42
+
43
+ ### Step 2: read promotion targets
44
+
45
+ Read in parallel from the project root. Skip any file or folder that does not exist.
46
+
47
+ - `CLAUDE.md`: project behavior rules and Content ownership section
48
+ - every `SKILL.md` under `.claude/skills/`: domain-scoped internal skill bodies
49
+ - every `SKILL.md` under `claude/skills/`: plugin skill bodies
50
+ - every `*.md` under `.claude/standards/`: authoring references
51
+ - every `*.md` under `governance/rules/` in the toolkit repo, or `.claude/rules/` in a target project: coding-standards rules
52
+
53
+ Read any authoring reference the project does not have from `${CLAUDE_SKILL_DIR}/../../standards/` instead.
54
+
55
+ ### Step 3: classify each entry
56
+
57
+ `.claude/memory/` is a holding pen. Default every entry to promote or delete on review. Skip is the rare exception, reserved for active task overlap or user-type memories with no in-repo target.
58
+
59
+ For each in-scope entry (see Scope), pick one action:
60
+
61
+ - **Promote to `CLAUDE.md`**: the rule is cross-domain behavior or a design principle applied across the whole project.
62
+ - **Promote to a skill body**: the rule fires only when editing a specific path-scoped domain. Name the target skill.
63
+ - **Promote to a standards file**: the rule is an authoring reference that belongs in `.claude/standards/<domain>.md`.
64
+ - **Hand off to governance**: the rule is coding-standards class (typescript, testing, naming, error-handling, performance, logging, concurrency, planning). Do not author the rule file inline. In the toolkit repo, point the user at `aitk-governance` and `.claude/standards/rule.md`, which own the source-of-truth rules under `governance/rules/`. In a target project, point the user at the `create-rule` skill, which scaffolds a project-local rule under `.claude/rules/`. Never edit the synced `.claude/rules/` copies of toolkit rules, because `aitk gov sync` overwrites them. Stop at handoff.
65
+ - **Delete**: the rule is stale, already absorbed into a durable surface, too vague to phrase as a rule, or a one-time incident narrative.
66
+
67
+ When two or more memories collapse into one rule on the same target, propose them as a single merged edit under the matching promote category. The consolidate case is a variant of promote, not a separate action.
68
+
69
+ #### Absorbed-already check
70
+
71
+ Before proposing promote, grep the target surface for the rule's keywords. If the rule is already stated there, the action is **Delete**, not promote. Do not rely on memory-file claims that a rule is documented elsewhere. Verify.
72
+
73
+ The check covers implication, not only keyword match. If an adjacent bullet in the target section already implies the rule, merge into that bullet rather than append a second.
74
+
75
+ #### Crispness check
76
+
77
+ Rules that resist crisp one-line phrasing default to **Delete** over promote. Never promote a memory unchanged. Rewrite to match the destination surface's tone. Use terser phrasing for `CLAUDE.md` and imperative phrasing for skill bodies.
78
+
79
+ ### Step 4: write the proposal to the review file
80
+
81
+ Derive a slug from the current git branch: run `git branch --show-current` and replace `/` with `-`. Fall back to `latest` on empty output.
82
+
83
+ Write the full proposal to `.claude/review/memory-review-<slug>.md` at the main worktree root. Do not print it inline.
84
+
85
+ Structure: a summary block at the top, a legend, then one H2 per numbered item. Number items across all actions so the user can reference them by number. Fuse the status, action, and target into each H2. Put the memory filename on its own line, a one-line Why, the rewritten rule inline in a fenced `diff` block prefixed with `+` so reviewers see the additions in green, and a `Decision:` slot for the user. Do not include a `Take:` slot in the template. Discuss inserts one directly under `Decision:` only when responding to a question item. Status starts as 📝 pending for every item at proposal time.
86
+
87
+ ````plaintext
88
+ # Memory review: <slug>
89
+
90
+ **Pending:** <all numbers>
91
+
92
+ Legend: ✅ applied · ⏭ skipped · 🗑 deleted · 🤝 handed off · 📝 pending
93
+
94
+ How to respond: fill in `Decision:` per item (`apply`, `skip`, `defer`, or a question with `?`), then re-ping the skill. Say "discuss" for question rounds, "apply" to commit. Chat shortcut: `all`, `none`, or a list of numbers.
95
+
96
+ ## 1. 📝 Promote → `<target>`
97
+
98
+ `<memory-file>`
99
+
100
+ Why: <one-line pulled from the memory's Why>
101
+
102
+ ```diff
103
+ + <rewritten rule text>
104
+ ```
105
+
106
+ Decision:
107
+
108
+ ## 2. 📝 Delete
109
+
110
+ `<memory-file>`
111
+
112
+ Reason: <one-line reason>
113
+
114
+ Decision:
115
+ ````
116
+
117
+ For Hand off items, the body is a pointer to the governance target instead of a rewritten rule: `aitk-governance` and `.claude/standards/rule.md` in the toolkit repo, or the `create-rule` skill in a target project. For Delete items, skip the rewrite block. Every item gets a `Decision:` slot regardless of action. `Take:` is added only when a question response is needed.
118
+
119
+ Tell the user `✅ Wrote proposal to .claude/review/memory-review-<slug>.md`. Ask them to fill in `Decision:` per item, then re-ping with "discuss" for question rounds or "apply" to commit.
120
+
121
+ Rewrite the review file in place whenever the proposal changes mid-review. The file stays the source of truth for the current decisions.
122
+
123
+ ## Challenge phase
124
+
125
+ Trigger: user says "challenge the promotes", "challenge before apply", or asks for a high-bar pass. Run before Apply. No mutations to memory files or promotion targets. Review file only.
126
+
127
+ 1. Read the latest `.claude/review/memory-review-*.md` at the main root.
128
+ 2. For each promote item, apply three tests:
129
+ - **Absorbed**: grep the target surface for the rule's keywords. If already stated or implied, flip to delete.
130
+ - **Delta**: if the rule is a nice-to-have next to existing bullets, flip to delete.
131
+ - **Generality**: if the rule fires only on one literal trigger phrase, rewrite broader or flip to delete.
132
+ 3. Rewrite the review file in place with the updated actions and a one-line reason under each flip.
133
+
134
+ ## Discuss phase
135
+
136
+ Trigger: user says "discuss", "respond to questions", or any `Decision:` value contains `?` or an unrecognized verb. No mutations to memory files or targets. Review file only. Multi-round.
137
+
138
+ 1. Read the latest `.claude/review/memory-review-*.md` at the main root.
139
+ 2. For each item whose `Decision:` contains `?` or any unrecognized verb (anything other than `apply`, `skip`, `defer`):
140
+ - Write a `Take:` line under `Decision:`, separated by exactly one blank line. If a `Take:` line already exists, overwrite it.
141
+ - Format: pick + one-line reason. Max 2 sentences. Decision-help style. State the recommendation (`apply` / `skip` / `delete` / specific alternative) first, then the reason. Do not enumerate tradeoffs unless one changes the call.
142
+ - Leave the H2 emoji as 📝 pending.
143
+ 3. Skip items whose `Decision:` is `apply`, `skip`, `defer`, or empty.
144
+ 4. End with: `💬 Discussed: <nums> | ⏩ Skipped (committed or empty): <nums>`. Remind the user to refine `Decision:` lines and re-ping with "discuss" for another round, or "apply" when ready to commit.
145
+
146
+ Do not act on any item. Do not delete memory files. Do not edit MEMORY.md. Do not edit promotion targets. Discuss only.
147
+
148
+ ## Apply phase
149
+
150
+ Trigger: user says "apply", "commit", "ship the review", or re-pings with no question items remaining. Mutates tracked files (target surfaces, memory files, `MEMORY.md`).
151
+
152
+ Before applying any item, check the worktree state:
153
+
154
+ ```bash
155
+ [ "$(git rev-parse --git-dir 2>/dev/null)" = "$(git rev-parse --git-common-dir 2>/dev/null)" ] && echo "MAIN" || echo "LINKED"
156
+ ```
157
+
158
+ If the result is `MAIN`, stop and tell the user: `❌ Apply phase mutates tracked files. Run /claude-worktree first.` Discuss and Challenge phases only touch `.claude/review/` scratch and run from anywhere.
159
+
160
+ Before applying a promote to root `CLAUDE.md`, load `aitk-claude` so its seed-mirror rule fires on the edit.
161
+
162
+ Promotions are a separate concern from any feature in flight. Keep the promoted edits on their own commit. Do not fold a `CLAUDE.md` or skill-body change into a feature's commits, because a feature reviewer should not have to vet a change to how the agent operates.
163
+
164
+ For each item, parse the `Decision:` line:
165
+
166
+ - `apply` (or affirmative): run the proposed action, flip emoji to ✅.
167
+ - `skip`: leave the memory in place, flip emoji to ⏭.
168
+ - `defer` or empty: leave 📝 pending, take no action.
169
+ - Contains `?` or unrecognized verb: leave 📝 pending, take no action. Do not respond. Discussion is the Discuss phase's job.
170
+
171
+ Free-form text after the verb is a reason. Capture it in the receipt but do not let it change the action. When committing an item, strip any empty `Take:` line so the receipt stays clean. `Take:` lines with content stay as discussion history.
172
+
173
+ Action by action type:
174
+
175
+ - **Promote**: use `Edit` to insert the rewritten rule into the target surface. Then delete the memory file and remove its row from `.claude/memory/MEMORY.md`.
176
+ - **Hand off**: do not edit governance. Delete the memory file only if the user confirmed the handoff explicitly. Otherwise leave it in place.
177
+ - **Delete**: remove the memory file and its row from `.claude/memory/MEMORY.md`.
178
+
179
+ Apply edits one at a time via `Edit`. Claude Code's tool permission dialog is the confirmation gate per edit. Never rewrite a whole file.
180
+
181
+ As each item resolves, update its status in the review file: flip the H2 emoji from 📝 to ✅ for applied, ⏭ for skipped, 🗑 for deleted, or 🤝 for handed off. Refresh the summary block counts at the top. Do not delete the review file. It stays as a receipt until Cleanup runs or the next Propose pass overwrites it.
182
+
183
+ **Chat shortcut:** the user replies with `all`, `none`, or a comma-separated list of numbers. Apply only the numbered items.
184
+
185
+ End with: `✅ Applied: <nums> | ⏭ Skipped: <nums> | 📝 Pending: <nums>`. Omit empty buckets. If anything is pending, remind the user they can refine `Decision:` lines and re-ping, run "discuss" for question items, or commit a skip with `skip <nums>` in chat.
186
+
187
+ ## Cleanup phase
188
+
189
+ Trigger: user says "cleanup", "sweep stale memories", or "delete the receipt" after Apply has run.
190
+
191
+ 1. Read the latest `.claude/review/memory-review-*.md` to see which entries were skipped.
192
+ 2. Treat a `Skip` decision as terminal. Do not delete a memory just because it would Skip again next review. Target only entries whose decision value is exhausted: already-applied promotions and stale receipts.
193
+ 3. Delete the review file itself.
194
+ 4. Leave applied promotions, governance handoffs, and user-type memories alone.
195
+
196
+ Do not promote or rewrite. Cleanup only.
197
+
198
+ ## After completion
199
+
200
+ Output one line per action taken in the most recent phase:
201
+
202
+ - `✅ Promoted: .claude/memory/<memory-file> → <target>`
203
+ - `✅ Handed off: .claude/memory/<memory-file> → governance`
204
+ - `🗑 Deleted: .claude/memory/<memory-file>`
205
+
206
+ If the user accepted nothing, output: `✅ No changes applied.`
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: claude-orchestrate
3
+ description: Asserts the orchestrator role for the current session, holds the build loop and the queue-refill sweep, and dispatches to the roadmap, feature, review, and worktree skills. Use when asked to "be the orchestrator", "run the orchestrator", "orchestrate this project", or to set up the control session for parallel feature builds. Do NOT build features or merge PRs in this session.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Claude orchestrate
8
+
9
+ This session is the orchestrator: the one warm session that holds the
10
+ cross-feature picture. It plans and reviews. It does not build, and it does not
11
+ merge. Building happens in cold worker sessions the human launches. Merging is
12
+ the human's gate.
13
+
14
+ This skill holds the framing, the board procedure, and the dispatch. Every step
15
+ that builds something runs an existing skill. The queue rules below decide which
16
+ one runs and when.
17
+
18
+ Run `aitk docs operating-model` for the model this skill enacts: the two roles
19
+ and what each owns, the loop end to end, why the worker's self-review and this
20
+ session's review are different passes, and how a feature is sized.
21
+
22
+ ## On invocation
23
+
24
+ Read the board in parallel, resolving the paths at the main worktree root per Worktrees in `CLAUDE.md`:
25
+
26
+ - `.claude/tasks/priority.md`: execution order and what each task is waiting on
27
+ - `.claude/tasks/index.md`: what is queued
28
+ - `.claude/plans/*.md`: features already planned and ready to hand off
29
+ - `.claude/ROADMAP.md`: sequencing rationale, when the file exists
30
+ - open PRs via `gh pr list --json number,title,headRefName,isDraft`
31
+
32
+ Then output the state of play so the human knows what to launch, review, and merge.
33
+
34
+ `priority.md` is the ordering source. `index.md` sorts by filename and says nothing about order, so read the sequence from the first and never infer it from the second. When `priority.md` is absent, report the queue and say the order is unrecorded.
35
+
36
+ The roadmap is optional and this skill does not require it. It carries why a sequence is what it is, changes only when strategy changes, and is absent in a project whose scope has already shipped. Report what it says and name it as the source. Never assert an active version the file does not state, and say nothing about one when the file is missing.
37
+
38
+ ## Output
39
+
40
+ ```plaintext
41
+ Orchestrator ready.
42
+
43
+ Roadmap: vX.Y, <the Now row's outcome>, as of <date>.
44
+
45
+ Ready to build (hand each to its own worker):
46
+
47
+ <feature>
48
+ plan: .claude/plans/feature-<slug>.md
49
+ → /claude-autoship
50
+
51
+ <feature>
52
+ no plan yet. A handoff without a plan has no scope
53
+ → /claude-feature here first
54
+
55
+ In review (your turn):
56
+
57
+ PR #<n> <title>
58
+ → /claude-pr-review
59
+
60
+ Merge order: #<a> before #<b> (shared seam: <files>).
61
+
62
+ Next: <the single most useful action>
63
+ ```
64
+
65
+ Omit any section with nothing in it. Recommend a handoff only for a plan whose file set is disjoint from every track already in flight, per Parallelism below.
66
+
67
+ Omit the `Roadmap` line when `.claude/ROADMAP.md` is absent. Quote the `Now` row rather than restating it, and date the line from `git log -1 --format=%ad --date=short -- .claude/ROADMAP.md` so an old sequence reads as old instead of as the state of play.
68
+
69
+ That command returns nothing for a roadmap that exists but has never been committed, which is the state `claude-roadmap` leaves behind when it writes the file and declines to stage it. Write `uncommitted` as the date in that case. A blank there would read as a formatting slip rather than as the newest possible sequence.
70
+
71
+ ## The loop
72
+
73
+ 1. Own the roadmap while a scope exists to sequence. Run `claude-roadmap` to draft or resequence `.claude/ROADMAP.md` from the MVP list in `.claude/REQUIREMENTS.md`, and skip it once that list has shipped, since later work then arrives as discrete items rather than as versions. Capture a needed resequence in the plan or a task file for a worker to apply in its branch, so the tracked edit ships in a PR rather than dirtying main.
74
+ 2. Plan the next feature. Run `claude-feature` here, with the cross-feature context, to write a plan to `.claude/plans/`. Planning stays in this warm session so the plan front-loads reasoning a cold worker would otherwise re-derive.
75
+ 3. Decide parallelism and merge order. Note which plans touch a shared wiring seam so their PRs merge in sequence, not at once.
76
+ 4. Verify the plan against the tree. Reading it is not enough, since a plan goes stale from whatever merged after it was written. Grep for each construct it names and count the sites against the count it claims. Check that every phase label it cites is still open. Open each file it describes rather than trusting its account of the contents. Correct the plan before handing it over.
77
+ 5. Hand off. The human opens a worker worktree with `claude-worktree` and runs `claude-autoship` against the plan. The orchestrator does not spawn workers.
78
+ 6. Review the PR. When a worker opens a PR, run `claude-pr-review` to post findings to it. This is the deep, independent pass. The worker's autoship self-review was only the green gate.
79
+ 7. Close the loop. After the worker runs `claude-address-review`, re-review if needed, then the human merges. Tell the trailing worker to rebase when its branch shares a seam with the merged one.
80
+
81
+ ## Boundaries
82
+
83
+ - Run one orchestrator at a time. The board is gitignored, so a second session sees none of this one's writes: two task files land minutes apart under different labels for the same work, one session archives a task mid-sweep in the other, and each archives a plan the other had retargeted. An Owner column does not fix this, since neither session can read the other's rows.
84
+ - Do not implement features in this session. Hand the plan to a worker.
85
+ - Do not merge. Recommend merge or changes. The human merges.
86
+ - Do not spawn worker sessions with agents. The human launches each worktree so every build is an independent, steerable stream with its own PR.
87
+ - Do not edit tracked files from this session. Record a change identified while orchestrating against the task that owns it, so it ships from that task's branch and lands in a pull request.
88
+ - Do not hand a worker anything but a plan, since scope lives there. A plan carries exact diffs only when they are already known, otherwise it states the scope and the open questions and lets the worker write the diff.
89
+
90
+ ## Refilling the ready queue
91
+
92
+ Keep enough planned, non-conflicting tasks available that a free worker never waits, and place the findings the last merge produced before promoting anything new. Run this after every merge and whenever the ready list thins.
93
+
94
+ 1. Run `gh pr list --state open` and `git log --oneline -8`. Report any pull request whose review has not been posted and stop for that one first.
95
+ 2. For each pull request merged since the last sweep, place every finding it produced. Route a finding that changes a rule to the standard or rule that states it, one that changes another task to that task's Findings, and one that overturns a groundwork lean to that folder marked answered. Never leave a finding in a pull request thread alone.
96
+ 3. Archive what closed. A task whose outcomes are all `[x]` runs `claude-docs` for the plan sweep, then `claude-tasks` to archive. A task whose outcomes describe standing policy rather than a deliverable never closes on its own, so hand it to a worker to encode the policy where it is enforced, then cut the outcomes with the reason recorded and archive once that branch merges. Encoding it from this session would write a tracked file, which Boundaries forbids.
97
+ 4. Read `.claude/tasks/priority.md` and count entries under its `## Run now` heading that carry a written plan. Keep one in reserve beyond what is running.
98
+ 5. Promote by whether a task establishes functionality rather than by age. Prefer a task that adds or proves a mechanism over one that trims, tidies, or audits an existing surface.
99
+ 6. Before promoting a candidate, list the files it touches against every task already running, per Parallelism below. Name the overlap and serialize when the sets are not disjoint.
100
+ 7. Write a plan for each newly promoted task with `claude-feature`, then report:
101
+
102
+ ```plaintext
103
+ Findings placed: <finding> → <destination>
104
+ Archived: <task>
105
+ Promoted: <task>, touches <surfaces>, parallel with <task> because <disjoint sets>
106
+ Serialized: <task> behind <task>, both write <file>
107
+ Ready now: <tasks with plans, and what each waits on>
108
+ ```
109
+
110
+ Treat a task that edits `.claude/context/` entries wholesale as conflicting with every other task, because the root instruction file requires each task to update its own domain entry as it lands.
111
+
112
+ Do not promote a task to fill the queue when nothing qualifies. A thin queue is a real answer and it beats a plan nobody needed.
113
+
114
+ ## Parallelism
115
+
116
+ No fixed number caps worker tracks. Collision between file sets is what binds, so
117
+ list the files a candidate touches against every track already in flight and open
118
+ it only when the sets are disjoint. What thins as tracks multiply is the review
119
+ attention each output gets, so add a track while you can still review every one
120
+ properly and stop when you cannot. Serialize any track that touches a shared
121
+ wiring seam with another in flight. Merge the branch with the smallest
122
+ shared-file footprint first, and merge a branch touching `CLAUDE.md`, a Claude
123
+ context entry, or a regenerated `index.md` last. Have every sibling rebase on
124
+ the new `main` before the next merge. Assign a distinct port per track when two
125
+ workers run a server, since each session spawns its own process.
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: claude-pr-review
3
+ description: Reviews an open pull request from an independent session and posts findings as a review comment on the PR. Posts a first pass under `## Review`, and a close-out under `## Review closed` that reads only the commits added since. Reads project docs and the roadmap for cross-feature context a self-review lacks. Use when asked to "review the PR", "review this feature's PR", "post a PR review", "re-review the PR", "close out the review", "confirm the findings are fixed", or acting as the orchestrator reviewing a worker's PR. Do NOT use to review local uncommitted changes. That is `claude-review`.
4
+ ---
5
+
6
+ # Claude PR review
7
+
8
+ This is the orchestrator's independent review, distinct from `claude-review`.
9
+ `claude-review` reviews local changes for the session that wrote them and writes
10
+ to disk. This one reviews an open PR the session did not write and posts the
11
+ findings to the PR, so the vantage is independent and the output is durable.
12
+
13
+ It posts twice over a pull request's life. A first pass opens the review against
14
+ the whole change. A close-out confirms the findings are closed and reads only
15
+ the commits added since. Both are this skill, and the pass is detected from the
16
+ thread rather than named by the caller.
17
+
18
+ ## Guards
19
+
20
+ - If no open PR resolves for the target branch via `gh pr view`, stop: `❌ No open PR to review. Open one first, or use /claude-review for local changes.`
21
+ - Review and post. Do not merge. Merging is the human's gate.
22
+
23
+ ## Step 1: resolve the PR and read context
24
+
25
+ Resolve the PR: `gh pr view --json number,headRefName,headRefOid,title` for the current branch, or use a PR number the user names. The first seven characters of `headRefOid` are `<short-sha>`, which names the body file in Step 4.
26
+
27
+ Read these in parallel from the project root, skipping any that do not exist:
28
+
29
+ - `CLAUDE.md`: project type, conventions, and commands
30
+ - `.claude/REQUIREMENTS.md`: feature scope and non-goals
31
+ - `.claude/ARCHITECTURE.md`: technical design decisions
32
+ - `.claude/ROADMAP.md`: where this feature sits and what depends on it
33
+ - `.claude/plans/feature-<slug>.md` for the branch, when present: the intent the PR should satisfy
34
+
35
+ Coding standards from `.claude/rules/` are auto-loaded by Claude Code.
36
+
37
+ ## Step 2: scope the read
38
+
39
+ Find the commit the last pass covered:
40
+
41
+ ```bash
42
+ gh pr view <number> --json reviews --jq '[.reviews[] | select(.body // "" | split("\n")[0] | rtrimstr("\r") | . == "## Review" or . == "## Review closed")] | last | .commit.oid'
43
+ ```
44
+
45
+ Match the first line for equality against the two headings this skill posts. A prefix test also matches `## Review response` and any heading merely starting with those words, which would scope the close-out to whatever commit that comment carried. The `\r` trim covers a body composed in the GitHub web editor, which stores CRLF.
46
+
47
+ An empty result is a first pass. Read the whole change:
48
+
49
+ ```bash
50
+ gh pr diff <number>
51
+ ```
52
+
53
+ ```bash
54
+ gh pr diff <number> --name-only
55
+ ```
56
+
57
+ A commit is a close-out. Fetch the pull request head so both commits are local:
58
+
59
+ ```bash
60
+ git fetch -q origin pull/<number>/head
61
+ ```
62
+
63
+ A failed fetch stops the skill: `❌ Could not fetch the PR head. Retry once the remote is reachable.` Do not fall through to the full pass. A fetch failure and a rebase both leave the prior commit unreachable, and the fallback below states a rebase as fact on the pull request, so conflating the two publishes a claim the skill never checked.
64
+
65
+ Then test that the prior commit still reaches the head:
66
+
67
+ ```bash
68
+ git merge-base --is-ancestor <prior-oid> <headRefOid>
69
+ ```
70
+
71
+ On exit zero, review `<prior-oid>..<headRefOid>` and nothing else. `git diff` and `git log --oneline` over that range are the whole read, because the first pass already covered everything behind it. A non-zero exit means the branch was rebased or force-pushed, so the delta is undefined rather than empty. Fall back to the full pass above and say so in the body.
72
+
73
+ Read each changed file in scope. Skip deleted files. Run reads in parallel.
74
+
75
+ ## Step 3: review
76
+
77
+ Review the diff and files for the same axes as `claude-review` (bugs, edge cases, error handling, logic flaws, security, rule violations), then add the three lenses a self-review structurally cannot apply:
78
+
79
+ - Integration: does this fit the roadmap sequence, the shared wiring seam, and any sibling PR in flight?
80
+ - Contract: does a contract downstream features depend on land correctly, and should the plan itself be questioned?
81
+ - Consumers: when the change touches a resource with more than one consumer, enumerate them and check the rule against each. A rule written for the consumer the change targets can be wrong for a sibling that writes.
82
+
83
+ Apply the high-signal filter: flag only what will cause incorrect behavior, break a documented rule, or mislead a downstream feature. If uncertain, do not flag.
84
+
85
+ A close-out applies the same axes to the delta, and adds one check the first pass cannot make: did each prior finding land, and did the fix regress anything it touched. Findings of its own are normal findings, stated at the same severity and counted the same way.
86
+
87
+ Use severity: `critical` (blocks merge), `should-fix` (fix before merge), `minor` (visibility only).
88
+
89
+ ## Step 4: post to the PR
90
+
91
+ Write the comment to `.claude/.tmp/pr-review/body-<number>-<short-sha>.md`. The PR number stops two sessions reviewing different pull requests from overwriting each other between the write and the post. The head commit stops a second pass overwriting the first one's body, and leaves the folder a record of which commit each review covered. Derive both segments from Step 1. Never pick a suffix by hand, and never reuse a name the folder already holds.
92
+
93
+ The comment is a rendered-for-human GitHub surface, so follow `.claude/standards/prose.md` for voice, or `${CLAUDE_SKILL_DIR}/../../standards/prose.md` when the project does not have it: cut editorializing, and keep every sentence load-bearing. Match this shape on a first pass:
94
+
95
+ ```markdown
96
+ ## Review
97
+
98
+ X critical, Y should-fix, Z minor. Reviewed against project docs and roadmap.
99
+
100
+ **`path/to/file.ext`**
101
+
102
+ - **should-fix**: what breaks and the fix, in two or three sentences.
103
+ - **minor**: finding.
104
+
105
+ **What is right**
106
+
107
+ - bounded confirmation.
108
+
109
+ 🤖 Reviewed by Claude Code
110
+ ```
111
+
112
+ A close-out keeps that shape and changes the heading and the summary line:
113
+
114
+ ```markdown
115
+ ## Review closed
116
+
117
+ Re-reviewed `<short-sha>`, N commits since the prior pass. X critical, Y should-fix, Z minor.
118
+
119
+ **`path/to/file.ext`**
120
+
121
+ - **should-fix**: what breaks and the fix, in two or three sentences.
122
+
123
+ 🤖 Reviewed by Claude Code
124
+ ```
125
+
126
+ Open a first pass with `## Review` and a close-out with `## Review closed`, so a reader scanning the thread can tell an open review from a confirmation that its findings are closed without opening either. Both anchor as a section distinct from human threads. Do not invent a third heading, and do not append the PR number, which GitHub already renders above the comment.
127
+
128
+ Name the scope in the close-out summary line, since a reader cannot otherwise tell a narrow read from a full one. When the fallback in Step 2 fired, replace the commit count with `Re-reviewed the full change, the prior pass's commit is no longer on the branch`. Budget the body. State each finding as the failure and the fix in two or three sentences, not a paragraph of reasoning. Omit files with no findings. Do not lecture on process. The integration, contract, and consumer lenses stay, but as findings, not asides.
129
+
130
+ The `What is right` section is optional, capped at three bullets, and included only when it changes the merge decision. Drop it otherwise and let the summary line carry the approval.
131
+
132
+ Close the body with `🤖 Reviewed by Claude Code` on its own line so the review reads as an independent machine pass, not a human sign-off.
133
+
134
+ Before posting, scan the body for em dashes and semicolons and rewrite each, splitting into two sentences or using a comma. The standards-audit hook skips `.claude/.tmp/`, so this scan is the only gate on the published comment.
135
+
136
+ ```bash
137
+ gh pr review <number> --comment --body-file .claude/.tmp/pr-review/body-<number>-<short-sha>.md
138
+ ```
139
+
140
+ If a first pass has no findings, post this body instead, under the same `## Review` heading and with the footer included: `✅ No blocking findings. Reviewed against project docs and roadmap.` followed by the footer line.
141
+
142
+ If a close-out has no findings, post `✅ Prior findings addressed. Re-reviewed <short-sha>, N commits since the prior pass.` under `## Review closed`, again with the footer. Post it even when there is nothing to report. A first pass left with no closing comment reads as a review nobody answered.
143
+
144
+ ## Step 5: output
145
+
146
+ ```plaintext
147
+ X critical, Y should-fix, Z minor. Posted to PR #<number>.
148
+ ```
149
+
150
+ Report the merge decision as a plain recommendation in chat (merge, or address findings first). Do not merge.