@jeiemgi/cckit 0.11.0 → 0.13.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 (549) hide show
  1. package/.claude-plugin/plugin.json +4 -2
  2. package/AGENTS.md +22 -238
  3. package/README.md +66 -56
  4. package/SECURITY.md +4 -4
  5. package/bin/PROMPTS.md +12 -0
  6. package/bin/cckit +181 -140
  7. package/cckit.config.json +1 -1
  8. package/kit/PROMPTS.md +14 -0
  9. package/{commands → kit/commands}/kit-doctor.md +3 -4
  10. package/{commands → kit/commands}/kit-export-project.md +1 -1
  11. package/{commands → kit/commands}/kit-init.md +8 -20
  12. package/{commands → kit/commands}/kit-routines.md +1 -1
  13. package/{commands → kit/commands}/kit-update.md +3 -3
  14. package/kit/completions/cckit.bash +9 -0
  15. package/{databases → kit/databases}/supabase.json +1 -1
  16. package/{integrations → kit/integrations}/integration.schema.json +3 -3
  17. package/kit/interview/global.json +54 -0
  18. package/kit/interview/project.json +133 -0
  19. package/kit/modules/qa.json +63 -0
  20. package/kit/modules/software.json +48 -0
  21. package/{profiles → kit/profiles}/automation.json +1 -3
  22. package/{profiles → kit/profiles}/content.json +0 -2
  23. package/{profiles → kit/profiles}/marketing.json +0 -2
  24. package/{profiles → kit/profiles}/minimal.json +1 -3
  25. package/{profiles → kit/profiles}/research.json +1 -3
  26. package/{profiles → kit/profiles}/software.json +0 -2
  27. package/kit/routines/catalogue.json +84 -0
  28. package/{skills → kit/skills}/kit-add/SKILL.md +4 -4
  29. package/kit/skills/kit-advisor/SKILL.md +75 -0
  30. package/kit/skills/kit-advisor/references/close.md +53 -0
  31. package/kit/skills/kit-advisor/references/grill.md +69 -0
  32. package/kit/skills/kit-advisor/references/orchestrate.md +56 -0
  33. package/kit/skills/kit-advisor/references/plan.md +64 -0
  34. package/kit/skills/kit-advisor/references/review.md +47 -0
  35. package/kit/skills/kit-advisor/references/step-report.md +61 -0
  36. package/{skills → kit/skills}/kit-annotate/SKILL.md +2 -4
  37. package/{skills → kit/skills}/kit-autopilot/SKILL.md +7 -7
  38. package/{skills → kit/skills}/kit-cleanup/SKILL.md +4 -4
  39. package/{skills → kit/skills}/kit-contribute/SKILL.md +8 -12
  40. package/{skills → kit/skills}/kit-customize/SKILL.md +5 -8
  41. package/{skills → kit/skills}/kit-dev/SKILL.md +1 -1
  42. package/{skills → kit/skills}/kit-digest/SKILL.md +3 -3
  43. package/{skills → kit/skills}/kit-effort-close/SKILL.md +20 -12
  44. package/{skills → kit/skills}/kit-effort-new/SKILL.md +17 -14
  45. package/{skills → kit/skills}/kit-effort-pr/SKILL.md +7 -7
  46. package/{skills → kit/skills}/kit-effort-start/SKILL.md +3 -3
  47. package/{skills → kit/skills}/kit-gc/SKILL.md +3 -3
  48. package/{skills → kit/skills}/kit-next/SKILL.md +7 -7
  49. package/{skills → kit/skills}/kit-page/SKILL.md +1 -1
  50. package/{skills → kit/skills}/kit-plan-next/SKILL.md +10 -11
  51. package/{skills → kit/skills}/kit-status/SKILL.md +6 -6
  52. package/{skills → kit/skills}/kit-task-close/SKILL.md +5 -5
  53. package/{skills → kit/skills}/kit-task-new/SKILL.md +5 -5
  54. package/{skills → kit/skills}/kit-task-pr/SKILL.md +5 -5
  55. package/{skills → kit/skills}/kit-task-pr-auto/SKILL.md +1 -1
  56. package/{skills → kit/skills}/kit-task-pr-merge/SKILL.md +10 -10
  57. package/{skills → kit/skills}/kit-task-start/SKILL.md +1 -1
  58. package/{skills → kit/skills}/kit-task-sync/SKILL.md +5 -3
  59. package/{skills → kit/skills}/kit-ux-audit/SKILL.md +16 -35
  60. package/{skills → kit/skills}/kit-ux-audit/references/graph-model.md +7 -26
  61. package/{skills → kit/skills}/kit-ux-audit/references/report.md +2 -3
  62. package/{skills → kit/skills}/routing.yaml +6 -1
  63. package/kit/statusline/kit-statusline.sh +82 -0
  64. package/{templates → kit/templates}/agents/analyst.md +0 -11
  65. package/{templates → kit/templates}/agents/auto-dev.md +0 -13
  66. package/{templates → kit/templates}/agents/backend.md +0 -11
  67. package/{templates → kit/templates}/agents/designer.md +0 -11
  68. package/{templates → kit/templates}/agents/devops.md +0 -11
  69. package/{templates → kit/templates}/agents/editor.md +0 -11
  70. package/{templates → kit/templates}/agents/frontend.md +0 -11
  71. package/{templates → kit/templates}/agents/generalist.md +0 -11
  72. package/{templates → kit/templates}/agents/local-delegate.md +0 -13
  73. package/{templates → kit/templates}/agents/n8n.md +0 -11
  74. package/{templates → kit/templates}/agents/pm.md +0 -11
  75. package/{templates → kit/templates}/agents/qa.md +0 -11
  76. package/{templates → kit/templates}/agents/researcher.md +0 -11
  77. package/{templates → kit/templates}/agents/security.md +0 -11
  78. package/{templates → kit/templates}/agents/tech-lead.md +0 -11
  79. package/{templates → kit/templates}/agents/ux.md +3 -14
  80. package/{templates → kit/templates}/hooks/kit-mail-check.sh.tmpl +1 -1
  81. package/{templates → kit/templates}/instructions.md.tmpl +4 -21
  82. package/{templates → kit/templates}/kit.config.json.tmpl +0 -6
  83. package/{templates → kit/templates}/rules/authoring.md +7 -3
  84. package/{templates → kit/templates}/rules/branch-naming.md +3 -2
  85. package/{templates → kit/templates}/rules/delegation-brief.md +4 -0
  86. package/{templates → kit/templates}/rules/effort-model.md +34 -31
  87. package/{templates → kit/templates}/rules/gate-and-review.md +1 -1
  88. package/{templates → kit/templates}/rules/merge-safety.md +12 -9
  89. package/{templates → kit/templates}/rules/naming-and-ids.md +20 -24
  90. package/{templates → kit/templates}/rules/plan-next.md +5 -5
  91. package/{templates → kit/templates}/rules/react-annotate.md +0 -8
  92. package/{templates → kit/templates}/skills/campaign/SKILL.md +2 -2
  93. package/kit.config.schema.json +11 -11
  94. package/lib/PROMPTS.md +14 -0
  95. package/{scripts/lib → lib/core}/adapter-select-test.sh +7 -7
  96. package/lib/core/advisor-test.sh +55 -0
  97. package/{scripts/lib → lib/core}/agent-def-test.sh +1 -1
  98. package/{scripts/lib → lib/core}/agent-def.sh +2 -2
  99. package/{scripts/lib → lib/core}/agent-launch-test.sh +3 -3
  100. package/{scripts/lib → lib/core}/agent-profile-test.sh +2 -2
  101. package/{scripts/lib → lib/core}/agent-resolve-test.sh +4 -2
  102. package/{scripts/lib → lib/core}/agent-resolve.sh +5 -4
  103. package/{scripts → lib/core}/agent-skills-external.txt +3 -3
  104. package/{scripts → lib/core}/agent-skills-lint-test.sh +17 -17
  105. package/lib/core/agent-skills-lint.sh +115 -0
  106. package/{scripts → lib/core}/agent-template-lint-test.sh +7 -7
  107. package/lib/core/agent-template-lint.sh +58 -0
  108. package/{scripts/lib → lib/core}/board-view-test.sh +3 -3
  109. package/lib/core/board-view.sh +97 -0
  110. package/{scripts/lib → lib/core}/branch-owner-test.sh +3 -3
  111. package/lib/core/branch-owner.sh +201 -0
  112. package/lib/core/check.sh +125 -0
  113. package/{scripts/lib → lib/core}/codex-hooks-test.sh +3 -3
  114. package/{scripts → lib/core}/commitlint-test.sh +6 -6
  115. package/lib/core/commitlint.sh +54 -0
  116. package/{scripts/config-path-test.sh → lib/core/config-path-scan-test.sh} +2 -2
  117. package/{scripts/lib → lib/core}/config-path-test.sh +3 -3
  118. package/lib/core/config-path.sh +30 -0
  119. package/{scripts → lib/core}/content-skills-test.sh +17 -17
  120. package/{scripts → lib/core}/docs-marketing-words-test.sh +2 -2
  121. package/{scripts → lib/core}/docs-record-tables-test.sh +2 -2
  122. package/{scripts/lib → lib/core}/effort-metrics-test.sh +6 -6
  123. package/lib/core/effort-metrics.sh +591 -0
  124. package/{scripts/lib → lib/core}/effort-slug-test.sh +8 -4
  125. package/{scripts/lib → lib/core}/effort-slug.sh +8 -7
  126. package/lib/core/effort.sh +339 -0
  127. package/{scripts/lib → lib/core}/errors-header-test.sh +19 -9
  128. package/lib/core/errors-header.exempt +49 -0
  129. package/{scripts → lib/core}/exec-targets-test.sh +3 -3
  130. package/lib/core/feature-map.sh +76 -0
  131. package/lib/core/force-push-fence-test.sh +44 -0
  132. package/lib/core/force-push-fence.baseline +1 -0
  133. package/lib/core/force-push-fence.sh +51 -0
  134. package/{scripts → lib/core}/forge-fence-test.sh +13 -13
  135. package/{scripts → lib/core}/forge-fence.sh +14 -14
  136. package/{scripts → lib/core}/forge-report-test.sh +5 -5
  137. package/{scripts → lib/core}/forge-report.sh +18 -14
  138. package/{scripts/lib → lib/core}/git-core-test.sh +7 -7
  139. package/{scripts/lib → lib/core}/git-remote-test.sh +3 -3
  140. package/{scripts → lib/core}/guard-raw-git-ops-test.sh +4 -4
  141. package/{scripts → lib/core}/hook-adapter-test.sh +5 -5
  142. package/{scripts/lib → lib/core}/hook-refresh-test.sh +5 -5
  143. package/{scripts → lib/core}/instruction-budget-baseline.txt +2 -2
  144. package/lib/core/instruction-budget-lint.sh +238 -0
  145. package/{scripts/lib → lib/core}/integration-install-test.sh +12 -12
  146. package/lib/core/integration-install.sh +257 -0
  147. package/{scripts/lib → lib/core}/integrations-test.sh +38 -45
  148. package/lib/core/integrations.sh +244 -0
  149. package/{scripts/lib → lib/core}/kinds-test.sh +5 -5
  150. package/lib/core/kinds.sh +66 -0
  151. package/{scripts/lib → lib/core}/kit-cli-test.sh +1 -1
  152. package/{scripts/lib → lib/core}/kit-cli.sh +1 -1
  153. package/{scripts/lib → lib/core}/kit-config-resolve.sh +2 -2
  154. package/{scripts/lib → lib/core}/kit-config-test.sh +11 -11
  155. package/lib/core/kit-config.sh +164 -0
  156. package/{scripts/lib → lib/core}/kit-engine-test.sh +1 -1
  157. package/lib/core/kit-events.sh +72 -0
  158. package/lib/core/kit-local.sh +87 -0
  159. package/{scripts/lib → lib/core}/kit-manifest.sh +1 -1
  160. package/{scripts/lib → lib/core}/kit-mode-test.sh +1 -1
  161. package/{scripts/lib → lib/core}/kit-mode.sh +3 -3
  162. package/{scripts/lib → lib/core}/kit-operate.sh +1 -1
  163. package/{scripts/lib → lib/core}/kit-profile-test.sh +1 -1
  164. package/{scripts/lib → lib/core}/kit-profile.sh +2 -2
  165. package/{scripts/lib → lib/core}/kit-state-test.sh +1 -1
  166. package/lib/core/knowledge-lint.sh +106 -0
  167. package/lib/core/layout-fence-test.sh +35 -0
  168. package/lib/core/layout-fence.allow +15 -0
  169. package/lib/core/layout-fence.baseline +4 -0
  170. package/lib/core/layout-fence.sh +50 -0
  171. package/{scripts → lib/core}/leak-fence-test.sh +10 -10
  172. package/{scripts/lib → lib/core}/leak-fence.sh +1 -1
  173. package/lib/core/loose-issues-test.sh +102 -0
  174. package/lib/core/loose-issues.baseline +5 -0
  175. package/lib/core/loose-issues.sh +65 -0
  176. package/{scripts → lib/core}/marketing-walkthrough-test.sh +7 -7
  177. package/lib/core/naming-test.sh +112 -0
  178. package/lib/core/naming-verbs-test.sh +126 -0
  179. package/lib/core/naming.sh +172 -0
  180. package/{scripts/lib → lib/core}/orchestration-runtime-test.sh +4 -4
  181. package/{scripts → lib/core}/portable-test.sh +11 -7
  182. package/{scripts/lib → lib/core}/pr-evidence-test.sh +5 -5
  183. package/lib/core/pr-evidence.sh +361 -0
  184. package/{scripts/lib → lib/core}/qa-lane-test.sh +7 -7
  185. package/{scripts/lib → lib/core}/qa-lane.sh +4 -4
  186. package/{scripts/lib → lib/core}/qa-lanes-test.sh +5 -5
  187. package/lib/core/react-detect.sh +79 -0
  188. package/{scripts/lib → lib/core}/render-test.sh +1 -1
  189. package/lib/core/resident-context-test.sh +42 -0
  190. package/lib/core/resident-context.baseline +1 -0
  191. package/lib/core/resident-context.sh +56 -0
  192. package/lib/core/review-lint-baseline.txt +28 -0
  193. package/lib/core/review-lint.sh +266 -0
  194. package/{scripts → lib/core}/review-rules.conf +1 -1
  195. package/{scripts/lib → lib/core}/review-stage-test.sh +2 -2
  196. package/{scripts/lib → lib/core}/role-identity-test.sh +3 -3
  197. package/lib/core/role-identity.sh +71 -0
  198. package/{scripts → lib/core}/rule-recipes-test.sh +5 -5
  199. package/lib/core/secret-guard.sh +116 -0
  200. package/{scripts → lib/core}/self-install-test.sh +15 -16
  201. package/{scripts/lib → lib/core}/session-registry-test.sh +1 -1
  202. package/lib/core/session-registry.sh +233 -0
  203. package/{scripts → lib/core}/skill-frontmatter-baseline.txt +1 -1
  204. package/lib/core/skill-frontmatter-lint.sh +189 -0
  205. package/lib/core/spec-lint-test.sh +63 -0
  206. package/lib/core/spec-lint.sh +95 -0
  207. package/{scripts/lib → lib/core}/stage-receipt-test.sh +136 -4
  208. package/{scripts/lib → lib/core}/stage-receipt.sh +186 -7
  209. package/{scripts → lib/core}/terms-check-test.sh +6 -6
  210. package/lib/core/terms-check.sh +244 -0
  211. package/{scripts/lib → lib/core}/test-env-test.sh +2 -2
  212. package/{scripts/lib → lib/core}/test-env.sh +1 -1
  213. package/{scripts → lib/core}/test-runner-test.sh +11 -11
  214. package/{scripts → lib/core}/test.sh +12 -12
  215. package/{scripts → lib/core}/update-path-test.sh +3 -3
  216. package/{scripts → lib/core}/verbs-gen.sh +9 -9
  217. package/{scripts → lib/core}/verbs-help-test.sh +4 -4
  218. package/{scripts → lib/core}/verbs-ratchet-test.sh +24 -19
  219. package/{scripts → lib/core}/verbs-ratchet.sh +8 -8
  220. package/{scripts → lib/core}/verbs-test.sh +23 -23
  221. package/lib/core/verbs.baseline +5 -0
  222. package/{scripts/lib → lib/core}/verbs.sh +3 -3
  223. package/{scripts/lib → lib/core}/verbs.tsv +22 -20
  224. package/{scripts/lib → lib/core}/version-bump-test.sh +29 -8
  225. package/{scripts/lib → lib/core}/version-bump.sh +15 -2
  226. package/{scripts/lib → lib/core}/wave-result-test.sh +2 -2
  227. package/{scripts/lib → lib/core}/wave-result.sh +1 -1
  228. package/{scripts/lib → lib/core}/worker-brief-test.sh +4 -4
  229. package/{scripts/lib → lib/core}/worker-brief.sh +1 -1
  230. package/{scripts/lib → lib/core}/worktree-bootstrap-test.sh +1 -1
  231. package/{scripts/lib → lib/core}/worktree-issue-test.sh +2 -2
  232. package/lib/core/worktree-issue.sh +172 -0
  233. package/{scripts/lib → lib/core}/worktree-ports-test.sh +1 -1
  234. package/{scripts/lib → lib/core}/worktree-start-test.sh +2 -2
  235. package/lib/core/worktree-start.sh +790 -0
  236. package/{scripts/lib → lib/core}/zsh-safety-test.sh +11 -11
  237. package/{scripts/lib → lib/forge}/forge-github.sh +18 -7
  238. package/{scripts/lib → lib/forge}/forge-test.sh +4 -4
  239. package/{scripts/lib → lib/forge}/forge.sh +1 -1
  240. package/lib/forge/gh-board-add-test.sh +118 -0
  241. package/lib/forge/gh-log.sh +59 -0
  242. package/lib/forge/gh-project-test.sh +251 -0
  243. package/lib/forge/gh-project.sh +379 -0
  244. package/{scripts/lib → lib/forge}/gh-rest-test.sh +17 -13
  245. package/{scripts/lib → lib/forge}/gh-rest.sh +190 -16
  246. package/{scripts/lib → lib/forge}/init-github.sh +18 -8
  247. package/{scripts/lib → lib/forge}/test-forge-shim.sh +2 -1
  248. package/lib/verbs/PROMPTS.md +146 -0
  249. package/lib/verbs/annotate-setup.sh +149 -0
  250. package/{scripts → lib/verbs}/autopilot-run-test.sh +9 -9
  251. package/{scripts → lib/verbs}/autopilot-run.sh +9 -9
  252. package/{scripts → lib/verbs}/autopilot-test.sh +7 -6
  253. package/{scripts → lib/verbs}/autopilot.sh +7 -7
  254. package/{scripts/lib → lib/verbs}/captain-test.sh +1 -1
  255. package/{scripts/lib → lib/verbs}/captain.sh +8 -8
  256. package/lib/verbs/capture-project-ids.sh +99 -0
  257. package/{scripts/lib → lib/verbs}/content-kinds-gc-test.sh +7 -7
  258. package/{scripts/lib → lib/verbs}/contribute-root-test.sh +4 -4
  259. package/{scripts/lib → lib/verbs}/contribute-root.sh +1 -1
  260. package/{scripts → lib/verbs}/contribute.sh +8 -8
  261. package/{scripts → lib/verbs}/copilot-loop-test.sh +12 -12
  262. package/{scripts/lib → lib/verbs}/copilot-test.sh +15 -14
  263. package/{scripts/lib → lib/verbs}/copilot.sh +19 -19
  264. package/{scripts → lib/verbs}/database-supabase-test.sh +6 -6
  265. package/lib/verbs/effort-close-subs-test.sh +96 -0
  266. package/{scripts/lib → lib/verbs}/effort-dispatch-test.sh +5 -5
  267. package/{scripts/lib → lib/verbs}/effort-flows-test.sh +5 -5
  268. package/{scripts/lib → lib/verbs}/effort-ops-test.sh +111 -22
  269. package/lib/verbs/effort-ops.sh +1571 -0
  270. package/{scripts/lib → lib/verbs}/effort-parity-test.sh +47 -41
  271. package/{scripts/lib → lib/verbs}/effort-plan-test.sh +7 -7
  272. package/lib/verbs/effort-plan.sh +289 -0
  273. package/lib/verbs/effort-review-test.sh +107 -0
  274. package/lib/verbs/effort-review.sh +93 -0
  275. package/lib/verbs/grill-record-test.sh +49 -0
  276. package/lib/verbs/grill-record.sh +88 -0
  277. package/{scripts/lib → lib/verbs}/handoff.sh +3 -3
  278. package/{scripts → lib/verbs}/init-content-test.sh +14 -14
  279. package/{scripts/lib → lib/verbs}/init-guide.sh +6 -6
  280. package/{scripts → lib/verbs}/init-guided-test.sh +9 -9
  281. package/{scripts → lib/verbs}/init-recipes-test.sh +7 -7
  282. package/{scripts → lib/verbs}/init-upgrade-test.sh +9 -10
  283. package/lib/verbs/init.sh +1598 -0
  284. package/{scripts → lib/verbs}/install-test.sh +5 -5
  285. package/lib/verbs/install.sh +31 -0
  286. package/{scripts → lib/verbs}/integrations-check-test.sh +9 -9
  287. package/lib/verbs/integrations-check.sh +157 -0
  288. package/{scripts → lib/verbs}/kit-add-test.sh +8 -8
  289. package/lib/verbs/kit-add.sh +415 -0
  290. package/{scripts → lib/verbs}/kit-adopt-test.sh +4 -4
  291. package/{scripts → lib/verbs}/kit-adopt.sh +6 -6
  292. package/{scripts/lib → lib/verbs}/kit-brief-test.sh +44 -15
  293. package/{scripts/lib → lib/verbs}/kit-brief.sh +101 -16
  294. package/lib/verbs/kit-bump-version.sh +79 -0
  295. package/lib/verbs/kit-digest.sh +126 -0
  296. package/{scripts → lib/verbs}/kit-doctor-test.sh +57 -32
  297. package/lib/verbs/kit-doctor.sh +991 -0
  298. package/{scripts → lib/verbs}/kit-export-project-test.sh +4 -4
  299. package/lib/verbs/kit-export-project.sh +245 -0
  300. package/{scripts → lib/verbs}/kit-export-training-test.sh +3 -3
  301. package/lib/verbs/kit-export-training.sh +175 -0
  302. package/{scripts/lib → lib/verbs}/kit-gc-test.sh +5 -5
  303. package/lib/verbs/kit-gc.sh +804 -0
  304. package/{scripts/lib → lib/verbs}/kit-hotfix.sh +3 -3
  305. package/{scripts/lib → lib/verbs}/kit-interview-test.sh +2 -2
  306. package/lib/verbs/kit-interview.sh +319 -0
  307. package/{scripts/lib → lib/verbs}/kit-lib-test.sh +2 -2
  308. package/{scripts/lib → lib/verbs}/kit-lib.sh +10 -10
  309. package/{scripts → lib/verbs}/kit-migrate-test.sh +4 -4
  310. package/{scripts → lib/verbs}/kit-migrate.sh +5 -5
  311. package/{scripts/lib → lib/verbs}/kit-msg-test.sh +2 -2
  312. package/{scripts/lib → lib/verbs}/kit-msg.sh +5 -5
  313. package/{scripts → lib/verbs}/kit-onboard-test.sh +2 -3
  314. package/lib/verbs/kit-onboard.sh +69 -0
  315. package/{scripts → lib/verbs}/kit-promote-test.sh +4 -4
  316. package/{scripts → lib/verbs}/kit-promote.sh +4 -4
  317. package/{scripts → lib/verbs}/kit-remove-test.sh +4 -4
  318. package/{scripts → lib/verbs}/kit-remove.sh +5 -5
  319. package/lib/verbs/kit-routines.sh +322 -0
  320. package/lib/verbs/kit-self-update.sh +55 -0
  321. package/{scripts/lib → lib/verbs}/kit-status-test.sh +2 -2
  322. package/lib/verbs/kit-status.sh +650 -0
  323. package/{scripts/lib → lib/verbs}/kit-task-ops-test.sh +25 -2
  324. package/lib/verbs/kit-task-ops.sh +793 -0
  325. package/{scripts → lib/verbs}/kit-version-check-test.sh +3 -3
  326. package/lib/verbs/kit-version-check.sh +121 -0
  327. package/{scripts → lib/verbs}/kit-wire-test.sh +6 -6
  328. package/{scripts → lib/verbs}/kit-wire.sh +8 -8
  329. package/{scripts/lib → lib/verbs}/kto-hotfix-test.sh +3 -3
  330. package/{scripts/lib → lib/verbs}/kto-task-close-test.sh +2 -2
  331. package/{scripts/lib → lib/verbs}/kto-task-new-test.sh +20 -2
  332. package/{scripts/lib → lib/verbs}/kto-task-pr-merge-test.sh +46 -2
  333. package/{scripts/lib → lib/verbs}/kto-task-pr-test.sh +6 -6
  334. package/{scripts/lib → lib/verbs}/light-task-run-test.sh +4 -4
  335. package/{scripts/lib → lib/verbs}/light-task-test.sh +9 -9
  336. package/{scripts/lib → lib/verbs}/light-task.sh +26 -11
  337. package/{scripts/lib → lib/verbs}/next-test.sh +3 -3
  338. package/{scripts/lib → lib/verbs}/next.sh +10 -10
  339. package/{scripts → lib/verbs}/night-grant-test.sh +4 -4
  340. package/lib/verbs/night-grant.sh +454 -0
  341. package/{scripts → lib/verbs}/night-run-test.sh +3 -3
  342. package/{scripts → lib/verbs}/night-run.mjs +2 -2
  343. package/{scripts → lib/verbs}/orchestrate-test.sh +5 -5
  344. package/{scripts → lib/verbs}/orchestrate.sh +15 -15
  345. package/{scripts/lib → lib/verbs}/plan-machine-test.sh +1 -1
  346. package/{scripts/lib → lib/verbs}/plan-machine.sh +13 -13
  347. package/{scripts/lib → lib/verbs}/plan-next-test.sh +1 -1
  348. package/lib/verbs/plan-next.sh +213 -0
  349. package/{scripts → lib/verbs}/publish.sh +10 -10
  350. package/{scripts/lib → lib/verbs}/review-page-test.sh +4 -4
  351. package/lib/verbs/review-page.sh +375 -0
  352. package/lib/verbs/setup-labels.sh +96 -0
  353. package/lib/verbs/setup-milestones.sh +34 -0
  354. package/{scripts → lib/verbs}/showcase.sh +2 -2
  355. package/lib/verbs/sprint-test.sh +96 -0
  356. package/lib/verbs/sprint.sh +216 -0
  357. package/{scripts → lib/verbs}/status-test.sh +8 -8
  358. package/{scripts → lib/verbs}/status.sh +16 -16
  359. package/{scripts → lib/verbs}/task-sync-test.sh +40 -6
  360. package/lib/verbs/task-sync.sh +462 -0
  361. package/{scripts/lib → lib/verbs}/upgrade-report-test.sh +4 -4
  362. package/lib/verbs/ux-a11y-scan.sh +96 -0
  363. package/lib/verbs/ux-ds-audit.sh +146 -0
  364. package/lib/verbs/ux-graph-scan.sh +188 -0
  365. package/{scripts → lib/verbs}/wave-worker.sh +2 -2
  366. package/lib/verbs/web-install.sh +22 -0
  367. package/package.json +3 -10
  368. package/scripts/PROMPTS.md +13 -0
  369. package/scripts/agent-skills-lint.sh +12 -113
  370. package/scripts/agent-template-lint.sh +12 -56
  371. package/scripts/annotate-setup.sh +11 -151
  372. package/scripts/benchmark/checkpoint-test.sh +1 -1
  373. package/scripts/benchmark/checkpoint.sh +1 -1
  374. package/scripts/benchmark/gate.sh +2 -2
  375. package/scripts/benchmark/lib/bench-common.sh +1 -1
  376. package/scripts/capture-project-ids.sh +12 -70
  377. package/scripts/check.sh +12 -106
  378. package/scripts/force-push-fence.sh +14 -0
  379. package/scripts/init.sh +13 -1637
  380. package/scripts/install.sh +12 -29
  381. package/scripts/instruction-budget-lint.sh +13 -218
  382. package/scripts/integrations-check.sh +12 -155
  383. package/scripts/kit-add.sh +12 -413
  384. package/scripts/kit-bump-version.sh +13 -78
  385. package/scripts/kit-digest.sh +13 -125
  386. package/scripts/kit-doctor.sh +13 -971
  387. package/scripts/kit-export-project.sh +12 -243
  388. package/scripts/kit-export-training.sh +12 -173
  389. package/scripts/kit-onboard.sh +12 -67
  390. package/scripts/kit-routines.sh +12 -320
  391. package/scripts/kit-self-update.sh +12 -53
  392. package/scripts/kit-version-check.sh +12 -106
  393. package/scripts/knowledge-lint.sh +13 -98
  394. package/scripts/lib/board-view.sh +13 -96
  395. package/scripts/lib/branch-owner.sh +12 -199
  396. package/scripts/lib/commitlint.sh +12 -52
  397. package/scripts/lib/config-path.sh +13 -29
  398. package/scripts/lib/effort-metrics.sh +12 -589
  399. package/scripts/lib/effort-ops.sh +13 -1243
  400. package/scripts/lib/effort-plan.sh +12 -287
  401. package/scripts/lib/effort.sh +13 -365
  402. package/scripts/lib/gh-log.sh +14 -59
  403. package/scripts/lib/gh-project.sh +13 -254
  404. package/scripts/lib/grill-record.sh +14 -0
  405. package/scripts/lib/integration-install.sh +12 -255
  406. package/scripts/lib/integrations.sh +12 -242
  407. package/scripts/lib/kinds.sh +13 -65
  408. package/scripts/lib/kit-config.sh +12 -165
  409. package/scripts/lib/kit-events.sh +13 -71
  410. package/scripts/lib/kit-gc.sh +12 -802
  411. package/scripts/lib/kit-interview.sh +11 -316
  412. package/scripts/lib/kit-local.sh +12 -85
  413. package/scripts/lib/kit-status.sh +12 -648
  414. package/scripts/lib/kit-task-ops.sh +13 -738
  415. package/scripts/lib/naming.sh +14 -0
  416. package/scripts/lib/plan-next.sh +13 -212
  417. package/scripts/lib/pr-evidence.sh +12 -359
  418. package/scripts/lib/react-detect.sh +12 -77
  419. package/scripts/lib/review-page.sh +11 -372
  420. package/scripts/lib/role-identity.sh +13 -70
  421. package/scripts/lib/secret-guard.sh +12 -114
  422. package/scripts/lib/session-registry.sh +13 -232
  423. package/scripts/lib/spec-lint.sh +14 -0
  424. package/scripts/lib/worktree-issue.sh +12 -170
  425. package/scripts/lib/worktree-start.sh +13 -748
  426. package/scripts/night-grant.sh +12 -452
  427. package/scripts/review-lint.sh +13 -258
  428. package/scripts/setup-labels.sh +11 -82
  429. package/scripts/setup-milestones.sh +12 -21
  430. package/scripts/skill-frontmatter-lint.sh +13 -181
  431. package/scripts/task-sync.sh +13 -370
  432. package/scripts/terms-check.sh +13 -241
  433. package/scripts/ux-a11y-scan.sh +13 -95
  434. package/scripts/ux-ds-audit.sh +12 -144
  435. package/scripts/ux-graph-scan.sh +12 -186
  436. package/scripts/web-install.sh +16 -20
  437. package/docs/kit-annotate/01-explainer.html +0 -225
  438. package/docs/kit-annotate/02-implementation-plan.html +0 -196
  439. package/docs/media/.onboarding-capture.cast +0 -5
  440. package/docs/media/README.md +0 -43
  441. package/docs/media/build-demo.sh +0 -63
  442. package/docs/media/build-kit-init.sh +0 -51
  443. package/docs/media/build-onboarding.sh +0 -51
  444. package/docs/media/kit-dry-run.cast +0 -107
  445. package/docs/media/kit-dry-run.gif +0 -0
  446. package/docs/media/kit-init.cast +0 -56
  447. package/docs/media/kit-init.gif +0 -0
  448. package/docs/media/kit-onboarding.cast +0 -148
  449. package/docs/media/kit-onboarding.gif +0 -0
  450. package/integrations/mempalace.json +0 -28
  451. package/scripts/lib/gh-project-test.sh +0 -135
  452. package/scripts/review-lint-baseline.txt +0 -28
  453. package/scripts/verbs.baseline +0 -5
  454. package/templates/hooks/mempal_followup.sh.tmpl +0 -97
  455. package/templates/hooks/mempal_precompact.sh.tmpl +0 -4
  456. package/templates/hooks/mempal_save.sh.tmpl +0 -4
  457. package/templates/hooks/mempal_session_start.sh.tmpl +0 -42
  458. package/templates/rules/mempalace.md +0 -111
  459. /package/{commands → kit/commands}/kit-docs.md +0 -0
  460. /package/{commands → kit/commands}/kit-export-training.md +0 -0
  461. /package/{databases → kit/databases}/supabase/guide.html +0 -0
  462. /package/{databases → kit/databases}/supabase/nextjs/lib/supabase/client.ts +0 -0
  463. /package/{databases → kit/databases}/supabase/nextjs/lib/supabase/server.ts +0 -0
  464. /package/{githooks → kit/githooks}/pre-commit +0 -0
  465. /package/{integrations → kit/integrations}/emil-design-eng.json +0 -0
  466. /package/{integrations → kit/integrations}/graft.json +0 -0
  467. /package/{integrations → kit/integrations}/impeccable.json +0 -0
  468. /package/{integrations → kit/integrations}/lavish.json +0 -0
  469. /package/{integrations → kit/integrations}/mlx-lm.json +0 -0
  470. /package/{integrations → kit/integrations}/web-design-guidelines.json +0 -0
  471. /package/{recipes → kit/recipes}/nextjs-shadcn.json +0 -0
  472. /package/{skills → kit/skills}/kit-docs-writer/SKILL.md +0 -0
  473. /package/{skills → kit/skills}/kit-onboard/SKILL.md +0 -0
  474. /package/{skills → kit/skills}/kit-security-sweep/SKILL.md +0 -0
  475. /package/{skills → kit/skills}/kit-ship/SKILL.md +0 -0
  476. /package/{skills → kit/skills}/kit-ux-audit/references/a11y.md +0 -0
  477. /package/{skills → kit/skills}/kit-ux-audit/references/consistency.md +0 -0
  478. /package/{skills → kit/skills}/kit-ux-audit/references/heuristics.md +0 -0
  479. /package/{templates → kit/templates}/benchmarks/SCHEMA.md +0 -0
  480. /package/{templates → kit/templates}/benchmarks/abstain.jsonl +0 -0
  481. /package/{templates → kit/templates}/benchmarks/adversarial.jsonl +0 -0
  482. /package/{templates → kit/templates}/benchmarks/benchmark.config.json +0 -0
  483. /package/{templates → kit/templates}/benchmarks/quality.jsonl +0 -0
  484. /package/{templates → kit/templates}/benchmarks/retrieval.jsonl +0 -0
  485. /package/{templates → kit/templates}/codex/hooks.json.tmpl +0 -0
  486. /package/{templates → kit/templates}/hooks/guard-base-branch-commit.sh.tmpl +0 -0
  487. /package/{templates → kit/templates}/hooks/guard-raw-git-ops.sh.tmpl +0 -0
  488. /package/{templates → kit/templates}/hooks/kit-local-status.sh.tmpl +0 -0
  489. /package/{templates → kit/templates}/hooks/kit_version_check.sh.tmpl +0 -0
  490. /package/{templates → kit/templates}/hooks/prepush_gate.sh.tmpl +0 -0
  491. /package/{templates → kit/templates}/hooks/repo-hygiene.sh.tmpl +0 -0
  492. /package/{templates → kit/templates}/knowledge-INDEX.md.tmpl +0 -0
  493. /package/{templates → kit/templates}/lib/kit-sigil.sh.tmpl +0 -0
  494. /package/{templates → kit/templates}/rules/code-retrieval.md +0 -0
  495. /package/{templates → kit/templates}/rules/communication-style.md +0 -0
  496. /package/{templates → kit/templates}/rules/design-routing.md +0 -0
  497. /package/{templates → kit/templates}/rules/issue-lifecycle.md +0 -0
  498. /package/{templates → kit/templates}/rules/knowledge-base.md +0 -0
  499. /package/{templates → kit/templates}/rules/plain-language.md +0 -0
  500. /package/{templates → kit/templates}/rules/plan-output-format.md +0 -0
  501. /package/{templates → kit/templates}/rules/review-pages.md +0 -0
  502. /package/{templates → kit/templates}/rules/risk-tiered-review.md +0 -0
  503. /package/{templates → kit/templates}/rules/shared-checkout.md +0 -0
  504. /package/{templates → kit/templates}/rules/skill-gaps.md +0 -0
  505. /package/{templates → kit/templates}/rules/task-management.md +0 -0
  506. /package/{templates → kit/templates}/settings/settings.json.tmpl +0 -0
  507. /package/{templates → kit/templates}/settings/settings.local.json.tmpl +0 -0
  508. /package/{templates → kit/templates}/skills/NAMESPACED +0 -0
  509. /package/{templates → kit/templates}/skills/brand-voice/SKILL.md +0 -0
  510. /package/{templates → kit/templates}/skills/brand-voice/references/voice-template.md +0 -0
  511. /package/{templates → kit/templates}/skills/campaign/references/plan-template.md +0 -0
  512. /package/{templates → kit/templates}/skills/concrete/SKILL.md +0 -0
  513. /package/{templates → kit/templates}/skills/copywriting/SKILL.md +0 -0
  514. /package/{templates → kit/templates}/skills/copywriting/references/copy-frameworks.md +0 -0
  515. /package/{templates → kit/templates}/skills/copywriting/references/natural-transitions.md +0 -0
  516. /package/{templates → kit/templates}/skills/feature-build-refine/SKILL.md +0 -0
  517. /package/{templates → kit/templates}/skills/karpathy-guidelines/SKILL.md +0 -0
  518. /package/{templates → kit/templates}/skills/morning-briefing/SKILL.md +0 -0
  519. /package/{templates → kit/templates}/skills/page-design/SKILL.md +0 -0
  520. /package/{templates → kit/templates}/skills/page-design/add.json +0 -0
  521. /package/{templates → kit/templates}/skills/page-design/references/design-file-template.md +0 -0
  522. /package/{templates → kit/templates}/skills/page-design/references/generic-page-patterns.md +0 -0
  523. /package/{templates → kit/templates}/skills/page-design/references/minimum-rules.md +0 -0
  524. /package/{templates → kit/templates}/skills/speckit/SKILL.md +0 -0
  525. /package/{templates → kit/templates}/skills/supabase-patterns/SKILL.md +0 -0
  526. /package/{scripts/lib → lib/core}/adapter-select.sh +0 -0
  527. /package/{scripts/lib → lib/core}/agent-launch.sh +0 -0
  528. /package/{scripts/lib → lib/core}/agent-profile.sh +0 -0
  529. /package/{scripts/lib → lib/core}/cckit-output.sh +0 -0
  530. /package/{scripts/lib → lib/core}/codex-hooks.sh +0 -0
  531. /package/{scripts → lib/core}/forge-fence.baseline +0 -0
  532. /package/{scripts/lib → lib/core}/git-remote.sh +0 -0
  533. /package/{scripts/lib → lib/core}/hook-refresh.sh +0 -0
  534. /package/{scripts → lib/core}/instruction-budget-lint-test.sh +0 -0
  535. /package/{scripts/lib → lib/core}/kit-state.sh +0 -0
  536. /package/{scripts/lib → lib/core}/orchestration-runtime.sh +0 -0
  537. /package/{scripts/lib → lib/core}/project-scan.sh +0 -0
  538. /package/{scripts/lib → lib/core}/render.sh +0 -0
  539. /package/{scripts → lib/core}/review-lint-test.sh +0 -0
  540. /package/{scripts/lib → lib/core}/review-stage.sh +0 -0
  541. /package/{scripts → lib/core}/skill-frontmatter-lint-test.sh +0 -0
  542. /package/{scripts/lib → lib/core}/task-source-file.sh +0 -0
  543. /package/{scripts/lib → lib/core}/task-source.sh +0 -0
  544. /package/{scripts/lib → lib/core}/toon.sh +0 -0
  545. /package/{scripts/lib → lib/core}/ui.sh +0 -0
  546. /package/{scripts/lib → lib/forge}/forge-none.sh +0 -0
  547. /package/{scripts → lib/verbs}/debug.sh +0 -0
  548. /package/{scripts → lib/verbs}/night-run.test.mjs +0 -0
  549. /package/{scripts/lib → lib/verbs}/upgrade-report.sh +0 -0
@@ -0,0 +1,244 @@
1
+ #!/usr/bin/env bash
2
+ # terms-check.sh — the terms under ontology/terms/, their homes, and the skill routing.
3
+ #
4
+ # bash lib/core/terms-check.sh [--root <dir>] [--llm]
5
+ #
6
+ # 1. Every ontology/terms/<Term>.json validates (format: ontology/README.md): exactly the seven
7
+ # fields id, label, definition, is_not, avoid, home, status; a sapling or a tree has a home.
8
+ # 2. Every home resolves: `cli` is a top-level verb of bin/cckit (the first word is checked, so
9
+ # `effort plan` resolves through `effort`), `skill` is a folder with a SKILL.md under skills/ or
10
+ # .claude/skills/, `rule` is a file. A seed's unresolved home is printed, not counted a defect.
11
+ # 3. kit/skills/routing.yaml parses in its strict subset (stated at the top of that file); every entry
12
+ # names an existing skill and an existing term or `none`; every skill under skills/ is routed;
13
+ # each skill's `terms:` frontmatter line equals its routing terms.
14
+ # 4. AGENTS.md's "Which skill does what" table has one row per routed skill, with the same tasks
15
+ # (joined by " · ") and terms (joined by ", ") as routing.yaml.
16
+ # 5. docs-site/src/content/docs/skills.mdx, when present, has one row per routed skill under the
17
+ # `## <Label>` heading of one of its terms (`none` → "The kit itself") and no row for an unrouted one.
18
+ #
19
+ # Prints one `x <where>: <reason>` line per defect and one line of counts; --llm prints the counts
20
+ # as one JSON object on stdout and the defect lines on stderr. Exit 0 with no defect, 1 with one, 2 when jq is missing or ontology/terms/ is
21
+ # absent. bash + jq + awk only: cckit installs no YAML parser, so terms are JSON and the routing
22
+ # file is a flat subset awk reads. lib/core/check.sh runs this in warn mode: it prints, never fails.
23
+ set -uo pipefail
24
+
25
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
26
+ OUT=human
27
+ while [ $# -gt 0 ]; do
28
+ case "$1" in
29
+ --root) ROOT="$(cd "${2:?--root needs a directory}" && pwd)"; shift 2 ;;
30
+ --json|--llm|--output=json) OUT=json; shift ;;
31
+ -h|--help) sed -n '2,13p' "$0"; exit 0 ;;
32
+ *) echo "terms-check: unknown argument '$1'" >&2; exit 2 ;;
33
+ esac
34
+ done
35
+ cd "$ROOT" || exit 2
36
+
37
+ command -v jq >/dev/null 2>&1 || { echo "terms-check: jq is required" >&2; exit 2; }
38
+ [ -d ontology/terms ] || { echo "terms-check: no ontology/terms/ under $ROOT" >&2; exit 2; }
39
+ # The kit's own skills live under kit/skills/ (the self-host layout); a project keeps them in skills/.
40
+ SK=skills; [ -d kit/skills ] && SK=kit/skills
41
+
42
+ # Defect lines and notes go to stdout for a person; with --llm they go to stderr so stdout is one JSON object.
43
+ defects=0
44
+ say() { if [ "$OUT" = json ]; then printf '%s\n' "$*" >&2; else printf '%s\n' "$*"; fi; }
45
+ x() { say "x $*"; defects=$((defects + 1)); }
46
+
47
+ # ── 1. every term validates ──────────────────────────────────────────────────────────────────────
48
+ TERM_FILTER='
49
+ def is_words: (type == "string" and length > 0)
50
+ or (type == "array" and length > 0 and all(.[]; type == "string" and length > 0));
51
+ def is_list: type == "array" and all(.[]; type == "string" and length > 0);
52
+ [ (if (.id | type) == "string" and (.id | test("^[A-Z][A-Za-z0-9]*$")) then empty
53
+ else "id: not PascalCase" end),
54
+ (if .id == $stem then empty else "id: does not equal the file name \($stem)" end),
55
+ (if .label | is_words then empty else "label: a word, or a list of words" end),
56
+ (if (.definition | type) == "string" and (.definition | length) >= 20 then empty
57
+ else "definition: under 20 characters" end),
58
+ (if (.is_not | type) == "array" and (.is_not | length) >= 1 and (.is_not | is_list) then empty
59
+ else "is_not: needs at least one clause" end),
60
+ (if .avoid | is_list then empty else "avoid: a list of words (may be empty)" end),
61
+ (if (.home | type) == "object" and ((.home | keys) - ["cli", "skill", "rule"] | length) == 0
62
+ and all(.home[]; type == "string" and length > 0) then empty
63
+ else "home: an object with any of cli, skill, rule" end),
64
+ (if (.status | type) == "string" and (.status | IN("seed", "sapling", "tree")) then empty
65
+ else "status: seed, sapling or tree" end),
66
+ (if .status != "seed" and (.home | type) == "object" and (.home | length) == 0
67
+ then "home: a sapling or a tree needs at least one" else empty end),
68
+ ((keys - ["id", "label", "definition", "is_not", "avoid", "home", "status"])[]
69
+ | "unknown field: \(.)")
70
+ ] | .[]'
71
+
72
+ terms=0
73
+ valid_terms=""
74
+ for f in ontology/terms/*.json; do
75
+ [ -e "$f" ] || break
76
+ terms=$((terms + 1))
77
+ stem="$(basename "$f" .json)"
78
+ if ! jq -e 'type == "object"' "$f" >/dev/null 2>&1; then
79
+ x "$f: not a JSON object"; continue
80
+ fi
81
+ bad=0
82
+ while IFS= read -r line; do
83
+ [ -n "$line" ] || continue
84
+ x "$f: $line"; bad=1
85
+ done < <(jq -r --arg stem "$stem" "$TERM_FILTER" "$f")
86
+ [ "$bad" -eq 0 ] && valid_terms="$valid_terms $stem"
87
+ done
88
+ [ "$terms" -gt 0 ] || x "ontology/terms/: no term file"
89
+
90
+ # ── 2. every home resolves ───────────────────────────────────────────────────────────────────────
91
+ # Top-level verbs: the two-space-indented `label)` lines of the dispatcher's case, `|`-separated.
92
+ verbs=""
93
+ if [ -f bin/cckit ]; then
94
+ verbs="$(grep -E '^ [a-z][a-z0-9|-]*\)' bin/cckit | sed -E 's/^ ([a-z0-9|-]*)\).*/\1/' | tr '|' '\n' | sort -u)"
95
+ fi
96
+ skill_dir() { # the folder holding <name>/SKILL.md, or nothing
97
+ for d in $SK .claude/skills; do [ -f "$d/$1/SKILL.md" ] && { echo "$d/$1"; return 0; }; done; return 1
98
+ }
99
+ homes=0; homes_ok=0
100
+ for stem in $valid_terms; do
101
+ f="ontology/terms/$stem.json"
102
+ status="$(jq -r .status "$f")"
103
+ while IFS=$'\t' read -r kind value; do
104
+ [ -n "$kind" ] || continue
105
+ homes=$((homes + 1)); ok=0
106
+ case "$kind" in
107
+ cli) grep -qx -- "${value%% *}" <<< "$verbs" && ok=1 ;;
108
+ skill) skill_dir "$value" >/dev/null && ok=1 ;;
109
+ rule) [ -f "$value" ] && ok=1 ;;
110
+ esac
111
+ if [ "$ok" -eq 1 ]; then homes_ok=$((homes_ok + 1))
112
+ elif [ "$status" = seed ]; then say " seed $stem: home $kind $value does not exist yet (allowed)"
113
+ else x "$f: home $kind $value does not exist"
114
+ fi
115
+ done < <(jq -r '.home | to_entries[] | "\(.key)\t\(.value)"' "$f")
116
+ done
117
+
118
+ # ── 3. the routing table ─────────────────────────────────────────────────────────────────────────
119
+ # routing.yaml → `task<TAB>skill<TAB>term` rows, or `!<line>: <reason>` for a line outside the subset.
120
+ routes=""
121
+ if [ -f $SK/routing.yaml ]; then
122
+ routes="$(awk '
123
+ function bad(why) { printf "!%d: %s\n", NR, why; expect = 0; next_ok = 0 }
124
+ BEGIN { expect = 0 }
125
+ /^[[:space:]]*(#|$)/ { next }
126
+ expect == 0 {
127
+ if ($0 ~ /^- task: "[^"]+"$/) { task = $0; sub(/^- task: "/, "", task); sub(/"$/, "", task); expect = 1; next }
128
+ bad("expected `- task: \"...\"`")
129
+ }
130
+ expect == 1 {
131
+ if ($0 ~ /^ skill: [a-z][a-z0-9-]*$/) { skill = $2; expect = 2; next }
132
+ bad("expected ` skill: <name>`")
133
+ }
134
+ expect == 2 {
135
+ if ($0 ~ /^ term: ([A-Z][A-Za-z0-9]*|none)$/) { printf "%s\t%s\t%s\n", task, skill, $2; expect = 0; next }
136
+ bad("expected ` term: <Term>` or ` term: none`")
137
+ }
138
+ END { if (expect != 0) printf "!%d: entry ends before its term line\n", NR }
139
+ ' $SK/routing.yaml)"
140
+ while IFS= read -r line; do
141
+ case "$line" in '!'*) x "$SK/routing.yaml:${line#!}" ;; esac
142
+ done <<< "$routes"
143
+ routes="$(printf '%s\n' "$routes" | grep -v '^!' || true)"
144
+ else
145
+ x "$SK/routing.yaml: missing"
146
+ fi
147
+
148
+ all_terms="$(for f in ontology/terms/*.json; do [ -e "$f" ] && basename "$f" .json; done)"
149
+ routed_skills="$(printf '%s\n' "$routes" | awk -F'\t' 'NF==3{print $2}' | sort -u | grep . || true)"
150
+ no_term_skills="$(printf '%s\n' "$routes" | awk -F'\t' 'NF==3 && $3=="none"{print $2}' | sort -u | grep . || true)"
151
+ while IFS=$'\t' read -r task skill term; do
152
+ [ -n "$skill" ] || continue
153
+ skill_dir "$skill" >/dev/null || x "$SK/routing.yaml: skill $skill has no SKILL.md"
154
+ [ "$term" = none ] || grep -qx -- "$term" <<< "$all_terms" || x "$SK/routing.yaml: term $term is not under ontology/terms/"
155
+ done <<< "$routes"
156
+
157
+ skills_total=0; unrouted=0; routed=0
158
+ for d in $SK/*/; do
159
+ [ -f "${d}SKILL.md" ] || continue
160
+ s="$(basename "$d")"; skills_total=$((skills_total + 1))
161
+ if grep -qx -- "$s" <<< "$routed_skills"; then
162
+ routed=$((routed + 1))
163
+ want="$(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{print $3}' | sort -u | awk '{a = (a ? a ", " : "") $0} END{print a}')"
164
+ have="$(awk '/^---/{c++; if (c==2) exit; next} c==1 && /^terms:/{sub(/^terms:[[:space:]]*/, ""); print; exit}' "${d}SKILL.md" \
165
+ | tr ',' '\n' | sed 's/^[[:space:]]*//; s/[[:space:]]*$//' | grep . | sort -u | awk '{a = (a ? a ", " : "") $0} END{print a}')"
166
+ [ "$have" = "$want" ] || x "${d}SKILL.md: terms: '$have' but $SK/routing.yaml says '$want'"
167
+ else
168
+ unrouted=$((unrouted + 1)); x "$SK/$s: not routed in $SK/routing.yaml"
169
+ fi
170
+ done
171
+
172
+ # ── 4. the same table in AGENTS.md ───────────────────────────────────────────────────────────────
173
+ if [ -f AGENTS.md ]; then
174
+ # rows of the section, as `skill<TAB>tasks<TAB>terms`
175
+ agents_rows="$(awk -F' \\| ' '
176
+ /^## Which skill does what/ { in_sec = 1; next }
177
+ in_sec && /^## / { exit }
178
+ in_sec && /^\| / && !/^\| What you want/ && !/^\| ---/ {
179
+ line = $0; sub(/^\| /, "", line); sub(/ \|$/, "", line); n = split(line, c, / \| /)
180
+ if (n == 3) { gsub(/`/, "", c[2]); printf "%s\t%s\t%s\n", c[2], c[1], c[3] }
181
+ }' AGENTS.md)"
182
+ if [ -z "$agents_rows" ]; then
183
+ x 'AGENTS.md: no "Which skill does what" table'
184
+ else
185
+ for s in $routed_skills; do
186
+ want_tasks="$(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{a = (a ? a " · " : "") $1} END{print a}')"
187
+ want_terms="$(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{a = (a ? a ", " : "") $3} END{print a}')"
188
+ row="$(printf '%s\n' "$agents_rows" | awk -F'\t' -v s="$s" '$1==s{print; exit}')"
189
+ if [ -z "$row" ]; then x "AGENTS.md: no row for $s"; continue; fi
190
+ [ "$(printf '%s' "$row" | cut -f2)" = "$want_tasks" ] || x "AGENTS.md: $s tasks differ from $SK/routing.yaml"
191
+ [ "$(printf '%s' "$row" | cut -f3)" = "$want_terms" ] || x "AGENTS.md: $s terms differ from $SK/routing.yaml"
192
+ done
193
+ while IFS=$'\t' read -r s _; do
194
+ [ -n "$s" ] || continue
195
+ grep -qx -- "$s" <<< "$routed_skills" || x "AGENTS.md: row for $s, which $SK/routing.yaml does not route"
196
+ done <<< "$agents_rows"
197
+ fi
198
+ fi
199
+
200
+ # ── 5. the skills page, grouped by term ─────────────────────────────────────────────────────────
201
+ # docs-site/src/content/docs/skills.mdx (when present): every routed skill has one row, each row sits
202
+ # under the `## <Label>` heading of one of its terms (the term's preferred label, first letter
203
+ # upper-cased; `none` → "The kit itself"), and no row names a skill routing.yaml does not route.
204
+ PAGE=docs-site/src/content/docs/skills.mdx
205
+ if [ -f "$PAGE" ]; then
206
+ heading_of() { # heading_of <Term|none>
207
+ if [ "$1" = none ]; then echo "The kit itself"; return; fi
208
+ jq -r '(if (.label | type) == "array" then .label[0] else .label end) | (.[:1] | ascii_upcase) + .[1:]' "ontology/terms/$1.json"
209
+ }
210
+ # rows as `skill<TAB>heading`, H2 headings only
211
+ page_rows="$(awk '
212
+ /^## / { h = $0; sub(/^## /, "", h); next }
213
+ /^\| `[a-z][a-z0-9-]*` \|/ { s = $2; gsub(/`/, "", s); printf "%s\t%s\n", s, h }' "$PAGE")"
214
+ for s in $routed_skills; do
215
+ found="$(printf '%s\n' "$page_rows" | awk -F'\t' -v s="$s" '$1==s{print $2}')"
216
+ n_rows="$(printf '%s\n' "$found" | grep -c . || true)"
217
+ if [ "$n_rows" -eq 0 ]; then x "$PAGE: no row for $s"; continue; fi
218
+ [ "$n_rows" -eq 1 ] || x "$PAGE: $s has $n_rows rows"
219
+ ok=0
220
+ for term in $(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{print $3}' | sort -u); do
221
+ [ "$found" = "$(heading_of "$term")" ] && ok=1
222
+ done
223
+ [ "$ok" -eq 1 ] || x "$PAGE: $s is under \"$found\", not under a heading of its terms"
224
+ done
225
+ while IFS=$'\t' read -r s _; do
226
+ [ -n "$s" ] || continue
227
+ [ -f "$SK/$s/SKILL.md" ] || continue # a scaffolded template skill, not one of skills/
228
+ grep -qx -- "$s" <<< "$routed_skills" || x "$PAGE: row for $s, which $SK/routing.yaml does not route"
229
+ done <<< "$page_rows"
230
+ fi
231
+
232
+ # ── counts ───────────────────────────────────────────────────────────────────────────────────────
233
+ no_term=$(printf '%s\n' "$no_term_skills" | grep -c . || true)
234
+ if [ "$OUT" = json ]; then
235
+ jq -n --argjson terms "$terms" --argjson homes "$homes" --argjson homes_ok "$homes_ok" \
236
+ --argjson skills "$skills_total" --argjson routed "$routed" --argjson unrouted "$unrouted" \
237
+ --argjson no_term "$no_term" --argjson defects "$defects" \
238
+ '{terms: $terms, homes: $homes, homes_resolved: $homes_ok, skills: $skills, skills_routed: $routed,
239
+ unrouted: $unrouted, skills_no_term: $no_term, defects: $defects, ok: ($defects == 0)}'
240
+ else
241
+ printf 'terms-check: %d terms · %d/%d homes resolved · %d/%d skills routed · %d unrouted · %d with no term · %d defects\n' \
242
+ "$terms" "$homes_ok" "$homes" "$routed" "$skills_total" "$unrouted" "$no_term" "$defects"
243
+ fi
244
+ [ "$defects" -eq 0 ]
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # test-env-test.sh — test_env_seal removes the caller's kit environment, and only that (#369).
3
- # Run: bash scripts/lib/test-env-test.sh
3
+ # Run: bash lib/core/test-env-test.sh
4
4
  # errors: strict — a test runner: rc 1 on any failed assertion
5
5
  set -u
6
6
  LIB="$(cd "$(dirname "$0")" && pwd)"
@@ -18,7 +18,7 @@ case " $args " in *" -u KIT_CONFIG "*) echo "ok: unset args name KIT_CONFIG" ;;
18
18
  case " $args " in *" -u KEEP_ME "*) echo "FAIL: unset args name a non-kit variable: $args"; fail=1 ;; *) echo "ok: unset args leave other variables alone" ;; esac
19
19
  t "seal unsets KIT_*, CCKIT_*, EFFORT_*, CLAUDE_CODE_REMOTE and keeps the rest" "$after" "unset unset unset unset 1"
20
20
 
21
- # The runner seals too: a test run under scripts/test.sh never sees the caller's KIT_CONFIG.
21
+ # The runner seals too: a test run under lib/core/test.sh never sees the caller's KIT_CONFIG.
22
22
  if [ -n "${KIT_CONFIG:-}" ]; then echo "FAIL: KIT_CONFIG leaked into this test"; fail=1; else echo "ok: no KIT_CONFIG reached this test"; fi
23
23
 
24
24
  [ "$fail" -eq 0 ] && echo "test-env: all passed" || echo "test-env: FAILURES"
@@ -13,7 +13,7 @@
13
13
  # CLAUDE_CODE_REMOTE) in this shell
14
14
  # test_env_unset_args print `-u NAME` pairs for env(1), one per line (the runner uses these)
15
15
  #
16
- # scripts/test.sh scrubs the same set before it runs each test; this covers a test run directly.
16
+ # lib/core/test.sh scrubs the same set before it runs each test; this covers a test run directly.
17
17
  # errors: pure — no side effects beyond unsetting variables in the current shell
18
18
  # bash 3.2 + zsh compatible.
19
19
 
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env bash
2
- # test-runner-test.sh — scripts/test.sh runs files in parallel and still reports correctly (#455).
2
+ # test-runner-test.sh — lib/core/test.sh runs files in parallel and still reports correctly (#455).
3
3
  #
4
- # Copies the runner and scripts/lib/test-env.sh into a throwaway tree with fixture `*-test.sh`
4
+ # Copies the runner and lib/core/test-env.sh into a throwaway tree with fixture `*-test.sh`
5
5
  # files, then asserts on the copy's exit code and output:
6
6
  # - a failing file fails the run, and its output is printed whole, in one block
7
7
  # - two files really run at the same time under -j 2 (each waits for the other's marker file)
8
8
  # - a file marked `# test-runner: serial` is held back and run after the parallel phase
9
9
  # - --serial, a path pattern, and a bad job count behave as the header of test.sh says
10
10
  # - every test is sealed from KIT_* variables and runs with commit signing off
11
- # Run: bash scripts/test-runner-test.sh
11
+ # Run: bash lib/core/test-runner-test.sh
12
12
  # errors: strict — a test runner: rc 1 on any failed assertion
13
13
  set -u
14
- ROOT="$(cd "$(dirname "$0")/.." && pwd)"
14
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
15
15
  fail=0
16
16
  t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
17
17
  has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> '[$2]' lacks '[$3]'"; fail=1 ;; esac; }
@@ -21,19 +21,19 @@ tmp="$(cd "$(mktemp -d)" && pwd -P)"; trap 'rm -rf "$tmp"' EXIT
21
21
  # The caller's own runner settings must not steer the copy under test.
22
22
  unset TEST_JOBS TEST_TIMINGS TEST_RUN_DIR
23
23
  # shellcheck source=/dev/null
24
- . "$ROOT/scripts/lib/test-env.sh" && test_env_seal
24
+ . "$ROOT/lib/core/test-env.sh" && test_env_seal
25
25
 
26
26
  # fixture <name> — a fresh tree holding the runner; echoes its path.
27
27
  fixture() {
28
28
  local d="$tmp/$1"
29
- mkdir -p "$d/scripts/lib" "$d/bin" "$d/shared"
30
- cp "$ROOT/scripts/test.sh" "$d/scripts/test.sh"
31
- cp "$ROOT/scripts/lib/test-env.sh" "$d/scripts/lib/test-env.sh"
29
+ mkdir -p "$d/scripts/lib" "$d/lib/core" "$d/bin" "$d/shared"
30
+ cp "$ROOT/lib/core/test.sh" "$d/lib/core/test.sh"
31
+ cp "$ROOT/lib/core/test-env.sh" "$d/lib/core/test-env.sh"
32
32
  printf '%s' "$d"
33
33
  }
34
34
  run() { # run <fixture dir> [runner args…] -> OUT (stdout+stderr), RC
35
35
  local d="$1"; shift
36
- OUT="$(bash "$d/scripts/test.sh" "$@" 2>&1)"; RC=$?
36
+ OUT="$(bash "$d/lib/core/test.sh" "$@" 2>&1)"; RC=$?
37
37
  }
38
38
 
39
39
  # ── 1. pass, fail, and a failing file's output in one block ────────────────────────────────────
@@ -145,13 +145,13 @@ fi
145
145
  exit "$rc"
146
146
  EOF
147
147
  OUT="$(KIT_CONFIG=/elsewhere KEEP_ME=1 GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=test.kept GIT_CONFIG_VALUE_0=yes \
148
- bash "$F/scripts/test.sh" 2>&1)"; RC=$?
148
+ bash "$F/lib/core/test.sh" 2>&1)"; RC=$?
149
149
  t "a test is sealed, unsigned, and keeps the rest of its environment" "$RC" "0"
150
150
  [ "$RC" -eq 0 ] || printf '%s\n' "$OUT"
151
151
  has "the runner reports what it sealed" "$OUT" "sealed 1 inherited"
152
152
 
153
153
  # ── 5. the result directory is removed ─────────────────────────────────────────────────────────
154
- left="$(TMPDIR="$tmp/td" bash -c 'mkdir -p "$TMPDIR" && bash "$0/scripts/test.sh" >/dev/null 2>&1; ls "$TMPDIR" | wc -l' "$F" | tr -d ' ')"
154
+ left="$(TMPDIR="$tmp/td" bash -c 'mkdir -p "$TMPDIR" && bash "$0/lib/core/test.sh" >/dev/null 2>&1; ls "$TMPDIR" | wc -l' "$F" | tr -d ' ')"
155
155
  t "the runner leaves nothing in TMPDIR" "$left" "0"
156
156
 
157
157
  [ "$fail" -eq 0 ] && echo "test-runner: all passed" || echo "test-runner: FAILURES"
@@ -4,11 +4,11 @@
4
4
  # lines). Exits non-zero if any test fails. bash 3.2 compatible (no mapfile/associative arrays,
5
5
  # no `wait -n`).
6
6
  #
7
- # scripts/test.sh run every discovered test, several files at a time
8
- # scripts/test.sh <pattern> run only tests whose path matches <pattern> (grep -E)
9
- # scripts/test.sh -j <N> run at most N files at once (also: --jobs N, TEST_JOBS=N)
10
- # scripts/test.sh --serial one file at a time, in sorted order (same as -j 1)
11
- # scripts/test.sh --timings print wall seconds per file, slowest first (also: TEST_TIMINGS=1)
7
+ # lib/core/test.sh run every discovered test, several files at a time
8
+ # lib/core/test.sh <pattern> run only tests whose path matches <pattern> (grep -E)
9
+ # lib/core/test.sh -j <N> run at most N files at once (also: --jobs N, TEST_JOBS=N)
10
+ # lib/core/test.sh --serial one file at a time, in sorted order (same as -j 1)
11
+ # lib/core/test.sh --timings print wall seconds per file, slowest first (also: TEST_TIMINGS=1)
12
12
  #
13
13
  # Parallelism (#455). Test files are independent: each builds its fixtures under its own `mktemp -d`
14
14
  # and none binds a fixed port, so files run N at a time. N defaults to the CPU count, capped at 8.
@@ -20,9 +20,9 @@
20
20
  # output is captured to its own file, so the output of a failing test is printed whole, after the
21
21
  # run, in sorted order — never interleaved with another file's.
22
22
  #
23
- # Folded into scripts/check.sh and run in CI (.github/workflows/test.yml).
23
+ # Folded into lib/core/check.sh and run in CI (.github/workflows/test.yml).
24
24
  set -uo pipefail
25
- cd "$(cd "$(dirname "$0")/.." && pwd)"
25
+ cd "$(cd "$(dirname "$0")/../.." && pwd)"
26
26
 
27
27
  note() { printf '%s\n' "$*" >&2; }
28
28
 
@@ -36,7 +36,7 @@ if [ "${1:-}" = "--run-one" ]; then
36
36
  # set KIT_CONFIG, exports KIT_*/CCKIT_*/EFFORT_* that would point a test at the developer's
37
37
  # project instead of its own fixture. Each test still sets whatever it needs itself.
38
38
  # shellcheck source=/dev/null
39
- . scripts/lib/test-env.sh
39
+ . lib/core/test-env.sh
40
40
  seal=(-u TEST_RUN_DIR)
41
41
  while IFS= read -r a; do [ -n "$a" ] && seal+=("$a"); done < <(test_env_unset_args)
42
42
  # Fixture commits are never signed (#455). A developer whose global git config sets
@@ -96,7 +96,7 @@ while IFS= read -r f; do
96
96
  else
97
97
  par+=("$f")
98
98
  fi
99
- done < <(find bin scripts -type f -name '*-test.sh' 2>/dev/null | sort)
99
+ done < <(find bin scripts lib -type f -name '*-test.sh' 2>/dev/null | sort)
100
100
 
101
101
  if [ "${#tests[@]}" -eq 0 ]; then
102
102
  note "test: no *-test.sh found${PATTERN:+ matching '$PATTERN'}"
@@ -104,7 +104,7 @@ if [ "${#tests[@]}" -eq 0 ]; then
104
104
  fi
105
105
 
106
106
  # shellcheck source=/dev/null
107
- . scripts/lib/test-env.sh
107
+ . lib/core/test-env.sh
108
108
  sealed="$(test_env_unset_args | grep -c -- '^-u$')"
109
109
 
110
110
  RUN_DIR="$(mktemp -d "${TMPDIR:-/tmp}/cckit-test.XXXXXX")" || { note "test: mktemp failed"; exit 1; }
@@ -122,11 +122,11 @@ began=$SECONDS
122
122
  i=0; list=""
123
123
  for t in ${par[@]+"${par[@]}"}; do list="$list$i $t"$'\n'; i=$((i+1)); done
124
124
  if [ -n "$list" ]; then
125
- printf '%s' "$list" | xargs -P "$JOBS" -n 2 bash scripts/test.sh --run-one
125
+ printf '%s' "$list" | xargs -P "$JOBS" -n 2 bash lib/core/test.sh --run-one
126
126
  fi
127
127
  if [ "${#ser[@]}" -gt 0 ]; then
128
128
  note "==> ${#ser[@]} file(s) marked serial, run alone"
129
- for t in "${ser[@]}"; do bash scripts/test.sh --run-one "$i" "$t"; i=$((i+1)); done
129
+ for t in "${ser[@]}"; do bash lib/core/test.sh --run-one "$i" "$t"; i=$((i+1)); done
130
130
  fi
131
131
  took=$((SECONDS - began))
132
132
 
@@ -23,12 +23,12 @@
23
23
  # command on the docs page is one this file runs.
24
24
  #
25
25
  # Network-free: the upgrade path skips the doctor preflight; every value gh would be asked for is in
26
- # the fixture config. Everything lives under one mktemp dir. Run: bash scripts/update-path-test.sh
26
+ # the fixture config. Everything lives under one mktemp dir. Run: bash lib/core/update-path-test.sh
27
27
  # errors: strict — a test runner: rc 1 on any failed assertion
28
28
  set -u
29
- ROOT="$(cd "$(dirname "$0")/.." && pwd)"
29
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
30
30
  # shellcheck source=/dev/null
31
- . "$ROOT/scripts/lib/test-env.sh" && test_env_seal
31
+ . "$ROOT/lib/core/test-env.sh" && test_env_seal
32
32
  CCKIT="$ROOT/bin/cckit"
33
33
  PAGE="$ROOT/docs-site/src/content/docs/getting-started/update.mdx"
34
34
  fail=0
@@ -2,14 +2,14 @@
2
2
  # verbs-gen.sh — write or check the CLI reference page's generated block (#555). The block sits
3
3
  # between the `verbs:begin` and `verbs:end` comment markers of
4
4
  # docs-site/src/content/docs/cli-reference.mdx and is produced by verbs_reference_md from
5
- # scripts/lib/verbs.tsv, the one source for every verb.
5
+ # lib/core/verbs.tsv, the one source for every verb.
6
6
  #
7
- # scripts/verbs-gen.sh rewrite the block from the table
8
- # scripts/verbs-gen.sh --check rc 0 when the block matches the table, 1 (and a diff) when not
9
- # scripts/verbs-gen.sh --root <dir> act on another checkout
7
+ # lib/core/verbs-gen.sh rewrite the block from the table
8
+ # lib/core/verbs-gen.sh --check rc 0 when the block matches the table, 1 (and a diff) when not
9
+ # lib/core/verbs-gen.sh --root <dir> act on another checkout
10
10
  # errors: strict — set -e; a page without both markers exits 1
11
11
  set -euo pipefail
12
- ROOT="$(cd "$(dirname "$0")/.." && pwd)"
12
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
13
13
  mode="write"
14
14
  while [ $# -gt 0 ]; do
15
15
  case "$1" in
@@ -20,9 +20,9 @@ while [ $# -gt 0 ]; do
20
20
  esac
21
21
  done
22
22
  page="$ROOT/docs-site/src/content/docs/cli-reference.mdx"
23
- VERBS_FILE="$ROOT/scripts/lib/verbs.tsv"; export VERBS_FILE
23
+ VERBS_FILE="$ROOT/lib/core/verbs.tsv"; export VERBS_FILE
24
24
  # shellcheck source=/dev/null
25
- source "$ROOT/scripts/lib/verbs.sh"
25
+ source "$ROOT/lib/core/verbs.sh"
26
26
  grep -q '{/\* verbs:begin' "$page" && grep -q '{/\* verbs:end' "$page" \
27
27
  || { echo "verbs-gen: $page lacks the verbs:begin / verbs:end markers" >&2; exit 1; }
28
28
 
@@ -34,8 +34,8 @@ awk -v blk="$tmp/block" '
34
34
  !skip { print }' "$page" > "$tmp/page"
35
35
 
36
36
  if [ "$mode" = check ]; then
37
- if cmp -s "$page" "$tmp/page"; then echo "ok verbs-gen: the CLI reference block matches scripts/lib/verbs.tsv"; exit 0; fi
38
- echo "verbs-gen: the CLI reference block drifted from scripts/lib/verbs.tsv (run: bash scripts/verbs-gen.sh)" >&2
37
+ if cmp -s "$page" "$tmp/page"; then echo "ok verbs-gen: the CLI reference block matches lib/core/verbs.tsv"; exit 0; fi
38
+ echo "verbs-gen: the CLI reference block drifted from lib/core/verbs.tsv (run: bash lib/core/verbs-gen.sh)" >&2
39
39
  diff "$page" "$tmp/page" >&2 || true
40
40
  exit 1
41
41
  fi
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env bash
2
2
  # shellcheck shell=bash
3
3
  # verbs-help-test.sh — #556: every verb has help. `cckit <verb> --help` is answered by the dispatcher
4
- # from scripts/lib/verbs.tsv before the verb runs, so it exits 0, starts with the verb's usage, names
4
+ # from lib/core/verbs.tsv before the verb runs, so it exits 0, starts with the verb's usage, names
5
5
  # its question and its prompt, and never reaches a parser that rejects --help. Runs every verb in a
6
6
  # throwaway git repo with a stub `gh` that refuses everything, then checks the repo is untouched.
7
7
  # No network, no port.
8
- # Run: bash scripts/verbs-help-test.sh
8
+ # Run: bash lib/core/verbs-help-test.sh
9
9
  # errors: strict — a test runner: rc 1 on any failed assertion
10
10
  set -u
11
- ROOT="$(cd "$(dirname "$0")/.." && pwd)"
11
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
12
12
  fail=0
13
13
  t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
14
14
  CCKIT="$ROOT/bin/cckit"
15
15
  # shellcheck source=/dev/null
16
- source "$ROOT/scripts/lib/verbs.sh"
16
+ source "$ROOT/lib/core/verbs.sh"
17
17
  tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
18
18
  mkdir -p "$tmp/stub" "$tmp/repo" "$tmp/home"
19
19
  printf '#!/bin/sh\necho "gh $*" >> "%s/gh.log"\nexit 1\n' "$tmp" > "$tmp/stub/gh"; chmod +x "$tmp/stub/gh"
@@ -1,49 +1,49 @@
1
1
  #!/usr/bin/env bash
2
2
  # shellcheck shell=bash
3
3
  # verbs-ratchet-test.sh — #557: renames by ratchet. The top-level verb count may only go down
4
- # (scripts/verbs-ratchet.sh against scripts/verbs.baseline), and an old name still works: it prints a
4
+ # (lib/core/verbs-ratchet.sh against lib/core/verbs.baseline), and an old name still works: it prints a
5
5
  # one-line notice and runs the verb it was renamed to. Fixture tables check the ratchet; the real
6
6
  # dispatcher checks the alias path. No network, no port.
7
- # Run: bash scripts/verbs-ratchet-test.sh
7
+ # Run: bash lib/core/verbs-ratchet-test.sh
8
8
  # errors: strict — a test runner: rc 1 on any failed assertion
9
9
  set -u
10
- ROOT="$(cd "$(dirname "$0")/.." && pwd)"
10
+ ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
11
11
  fail=0
12
12
  t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
13
13
  has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> missing '$3'"; fail=1 ;; esac; }
14
14
  CCKIT="$ROOT/bin/cckit"
15
15
  # shellcheck source=/dev/null
16
- source "$ROOT/scripts/lib/verbs.sh"
16
+ source "$ROOT/lib/core/verbs.sh"
17
17
  tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
18
18
 
19
19
  # ── 1. the ratchet on the real table ──────────────────────────────────────────────────────────
20
- out="$(bash "$ROOT/scripts/verbs-ratchet.sh" 2>&1)"; rc=$?
20
+ out="$(bash "$ROOT/lib/core/verbs-ratchet.sh" 2>&1)"; rc=$?
21
21
  t "the real table holds the baseline" "$rc" "0"
22
- t "the baseline is the table's verb count" "$(awk '!/^#/ && NF { print $1; exit }' "$ROOT/scripts/verbs.baseline")" "$(verbs_count)"
22
+ t "the baseline is the table's verb count" "$(awk '!/^#/ && NF { print $1; exit }' "$ROOT/lib/core/verbs.baseline")" "$(verbs_count)"
23
23
  has "the ratchet says it only goes down" "$out" "it may only go down"
24
24
 
25
25
  # ── 2. the ratchet on fixtures ────────────────────────────────────────────────────────────────
26
- mkdir -p "$tmp/fx/scripts/lib"
27
- cp "$ROOT/scripts/verbs-ratchet.sh" "$tmp/fx/scripts/"
28
- cp "$ROOT/scripts/lib/verbs.sh" "$tmp/fx/scripts/lib/"
26
+ mkdir -p "$tmp/fx/lib/core"
27
+ cp "$ROOT/lib/core/verbs-ratchet.sh" "$tmp/fx/lib/core/"
28
+ cp "$ROOT/lib/core/verbs.sh" "$tmp/fx/lib/core/"
29
29
  row() { printf '%s\tverb\t-\tg\tgit\t-\tno\tQ?\tP.\tcckit %s\n' "$1" "$1"; }
30
- { printf 'g\tgroup\t-\t-\t-\t-\t-\tWhat?\t-\t-\n'; row one; row two; } > "$tmp/fx/scripts/lib/verbs.tsv"
31
- ratchet() { bash "$tmp/fx/scripts/verbs-ratchet.sh" --root "$tmp/fx" 2>&1; }
30
+ { printf 'g\tgroup\t-\t-\t-\t-\t-\tWhat?\t-\t-\n'; row one; row two; } > "$tmp/fx/lib/core/verbs.tsv"
31
+ ratchet() { bash "$tmp/fx/lib/core/verbs-ratchet.sh" --root "$tmp/fx" 2>&1; }
32
32
 
33
- printf '# c\n2\n' > "$tmp/fx/scripts/verbs.baseline"
33
+ printf '# c\n2\n' > "$tmp/fx/lib/core/verbs.baseline"
34
34
  ratchet >/dev/null; t "fixture: count equal to the baseline passes" "$?" "0"
35
- row three >> "$tmp/fx/scripts/lib/verbs.tsv"
35
+ row three >> "$tmp/fx/lib/core/verbs.tsv"
36
36
  out="$(ratchet)"; rc=$?
37
37
  t "fixture: a new top-level verb fails" "$rc" "1"
38
38
  has "fixture: the refusal says where a new verb goes" "$out" "goes under an existing one"
39
- printf '# c\n4\n' > "$tmp/fx/scripts/verbs.baseline"
39
+ printf '# c\n4\n' > "$tmp/fx/lib/core/verbs.baseline"
40
40
  out="$(ratchet)"; rc=$?
41
41
  t "fixture: a count below the baseline fails until the baseline drops" "$rc" "1"
42
- has "fixture: the refusal names the number to write" "$out" "Lower scripts/verbs.baseline to 3"
43
- printf 'old\talias\tone\t-\tgit\t-\t-\t-\t-\t-\n' >> "$tmp/fx/scripts/lib/verbs.tsv"
44
- printf '3\n' > "$tmp/fx/scripts/verbs.baseline"
42
+ has "fixture: the refusal names the number to write" "$out" "Lower lib/core/verbs.baseline to 3"
43
+ printf 'old\talias\tone\t-\tgit\t-\t-\t-\t-\t-\n' >> "$tmp/fx/lib/core/verbs.tsv"
44
+ printf '3\n' > "$tmp/fx/lib/core/verbs.baseline"
45
45
  ratchet >/dev/null; t "fixture: an alias row does not count" "$?" "0"
46
- printf '# no number\n' > "$tmp/fx/scripts/verbs.baseline"
46
+ printf '# no number\n' > "$tmp/fx/lib/core/verbs.baseline"
47
47
  ratchet >/dev/null; t "fixture: a baseline with no number is rc 2" "$?" "2"
48
48
 
49
49
  # ── 3. the alias readers ──────────────────────────────────────────────────────────────────────
@@ -57,8 +57,13 @@ for a in $(verbs_names alias); do
57
57
  target="$(verbs_alias_target "$a")"
58
58
  err="$("$CCKIT" "$a" --help 2>&1 >/dev/null)"
59
59
  t "cckit $a: one notice line on stderr" "$err" "$(verbs_alias_notice "$a" "$target")"
60
- t "cckit $a --help is cckit $target --help on stdout" "$("$CCKIT" "$a" --help 2>/dev/null)" "$("$CCKIT" "$target" --help 2>/dev/null)"
60
+ # A target may carry words after its verb (`status --board`); help answers for the verb.
61
+ tverb="${target%% *}"
62
+ t "cckit $a --help is cckit $tverb --help on stdout" "$("$CCKIT" "$a" --help 2>/dev/null)" "$("$CCKIT" "$tverb" --help 2>/dev/null)"
61
63
  done
64
+ # An alias with words in front: they reach the verb ahead of the typed arguments.
65
+ t "cckit lib runs cckit agent lib" "$("$CCKIT" lib --root "$ROOT" 2>/dev/null | sed -n 1p)" "$("$CCKIT" agent lib --root "$ROOT" 2>/dev/null | sed -n 1p)"
66
+ t "cckit agent with no subcommand: rc 2" "$("$CCKIT" agent >/dev/null 2>&1; echo $?)" "2"
62
67
 
63
68
  [ "$fail" -eq 0 ] && echo "ALL OK (verbs-ratchet)" || echo "verbs-ratchet: FAILURES"
64
69
  exit "$fail"
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env bash
2
2
  # verbs-ratchet.sh — the top-level verb count may only go down (#557).
3
3
  #
4
- # Counts the `verb` rows of scripts/lib/verbs.tsv (old names, `alias` rows, do not count) and
5
- # compares the count with the number in scripts/verbs.baseline:
4
+ # Counts the `verb` rows of lib/core/verbs.tsv (old names, `alias` rows, do not count) and
5
+ # compares the count with the number in lib/core/verbs.baseline:
6
6
  # more than the baseline FAIL — a new top-level verb; add it as a subcommand of one that exists
7
7
  # fewer than the baseline FAIL — lower the baseline to the new count in the same change
8
8
  # equal ok
9
9
  # A rename is the alias path: the old name becomes an `alias` row and keeps working, so a rename
10
10
  # never changes the count. The ratchet only moves down.
11
11
  #
12
- # Usage: bash scripts/verbs-ratchet.sh [--root <dir>]
12
+ # Usage: bash lib/core/verbs-ratchet.sh [--root <dir>]
13
13
  # errors: strict — a gate: rc 1 on drift, rc 2 on a missing or malformed baseline
14
14
  set -u
15
- root="$(cd "$(dirname "$0")/.." && pwd)"
15
+ root="$(cd "$(dirname "$0")/../.." && pwd)"
16
16
  [ "${1:-}" = "--root" ] && root="$2"
17
- baseline_file="$root/scripts/verbs.baseline"
17
+ baseline_file="$root/lib/core/verbs.baseline"
18
18
  # shellcheck source=/dev/null
19
- source "$root/scripts/lib/verbs.sh"
20
- export VERBS_FILE="$root/scripts/lib/verbs.tsv"
19
+ source "$root/lib/core/verbs.sh"
20
+ export VERBS_FILE="$root/lib/core/verbs.tsv"
21
21
 
22
22
  base="$(awk '!/^#/ && NF { print $1; exit }' "$baseline_file" 2>/dev/null)"
23
23
  case "$base" in ''|*[!0-9]*) echo "x verbs ratchet: no number in $baseline_file" >&2; exit 2 ;; esac
@@ -28,7 +28,7 @@ if [ "$now" -gt "$base" ]; then
28
28
  exit 1
29
29
  fi
30
30
  if [ "$now" -lt "$base" ]; then
31
- echo "x verbs ratchet: $now top-level verbs, below the baseline of $base. Lower scripts/verbs.baseline to $now in this change." >&2
31
+ echo "x verbs ratchet: $now top-level verbs, below the baseline of $base. Lower lib/core/verbs.baseline to $now in this change." >&2
32
32
  exit 1
33
33
  fi
34
34
  echo "ok verbs ratchet: $now top-level verbs (baseline $base; it may only go down)"