@jeiemgi/cckit 0.8.0 → 0.10.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 (309) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/AGENTS.md +169 -21
  3. package/README.md +505 -35
  4. package/SECURITY.md +5 -0
  5. package/bin/cckit +189 -20
  6. package/cckit.config.json +1 -1
  7. package/commands/kit-doctor.md +13 -5
  8. package/commands/kit-export-project.md +0 -2
  9. package/commands/kit-export-training.md +6 -9
  10. package/commands/kit-init.md +43 -13
  11. package/commands/kit-routines.md +1 -1
  12. package/commands/kit-update.md +11 -6
  13. package/databases/supabase/guide.html +106 -0
  14. package/databases/supabase/nextjs/lib/supabase/client.ts +9 -0
  15. package/databases/supabase/nextjs/lib/supabase/server.ts +29 -0
  16. package/databases/supabase.json +70 -0
  17. package/integrations/emil-design-eng.json +41 -0
  18. package/integrations/graft.json +81 -0
  19. package/integrations/impeccable.json +42 -0
  20. package/integrations/integration.schema.json +215 -0
  21. package/integrations/lavish.json +43 -0
  22. package/integrations/mempalace.json +28 -0
  23. package/integrations/mlx-lm.json +32 -0
  24. package/integrations/web-design-guidelines.json +42 -0
  25. package/kit.config.schema.json +183 -5
  26. package/package.json +4 -1
  27. package/profiles/automation.json +7 -1
  28. package/profiles/content.json +10 -2
  29. package/profiles/marketing.json +57 -0
  30. package/profiles/minimal.json +7 -1
  31. package/profiles/research.json +7 -1
  32. package/profiles/software.json +7 -1
  33. package/recipes/nextjs-shadcn.json +49 -0
  34. package/scripts/agent-skills-external.txt +45 -0
  35. package/scripts/agent-skills-lint-test.sh +131 -0
  36. package/scripts/agent-skills-lint.sh +115 -0
  37. package/scripts/agent-template-lint-test.sh +42 -0
  38. package/scripts/agent-template-lint.sh +58 -0
  39. package/scripts/annotate-setup.sh +1 -1
  40. package/scripts/autopilot-run-test.sh +338 -0
  41. package/scripts/autopilot-run.sh +448 -0
  42. package/scripts/autopilot-test.sh +8 -0
  43. package/scripts/autopilot.sh +10 -1
  44. package/scripts/benchmark/benchmark-test.sh +85 -0
  45. package/scripts/benchmark/checkpoint-test.sh +314 -0
  46. package/scripts/benchmark/checkpoint.sh +408 -0
  47. package/scripts/benchmark/lib/model.sh +31 -6
  48. package/scripts/benchmark/report.sh +17 -2
  49. package/scripts/benchmark/run-quality.sh +36 -10
  50. package/scripts/benchmark/verb-timings-test.sh +124 -0
  51. package/scripts/benchmark/verb-timings.sh +149 -0
  52. package/scripts/check.sh +29 -19
  53. package/scripts/content-skills-test.sh +144 -0
  54. package/scripts/copilot-loop-test.sh +25 -0
  55. package/scripts/database-supabase-test.sh +121 -0
  56. package/scripts/docs-marketing-words-test.sh +73 -0
  57. package/scripts/docs-record-tables-test.sh +72 -0
  58. package/scripts/guard-raw-git-ops-test.sh +8 -0
  59. package/scripts/hook-adapter-test.sh +193 -0
  60. package/scripts/init-content-test.sh +225 -0
  61. package/scripts/init-guided-test.sh +474 -0
  62. package/scripts/init-recipes-test.sh +104 -0
  63. package/scripts/init-upgrade-test.sh +341 -2
  64. package/scripts/init.sh +746 -95
  65. package/scripts/instruction-budget-baseline.txt +8 -0
  66. package/scripts/instruction-budget-lint-test.sh +166 -0
  67. package/scripts/instruction-budget-lint.sh +219 -0
  68. package/scripts/integrations-check-test.sh +200 -0
  69. package/scripts/integrations-check.sh +157 -0
  70. package/scripts/kit-add-test.sh +214 -0
  71. package/scripts/kit-add.sh +305 -5
  72. package/scripts/kit-adopt-test.sh +16 -0
  73. package/scripts/kit-adopt.sh +3 -2
  74. package/scripts/kit-digest.sh +2 -2
  75. package/scripts/kit-doctor-test.sh +293 -0
  76. package/scripts/kit-doctor.sh +272 -140
  77. package/scripts/kit-export-project-test.sh +3 -3
  78. package/scripts/kit-remove-test.sh +19 -0
  79. package/scripts/kit-routines.sh +2 -2
  80. package/scripts/kit-self-update.sh +1 -1
  81. package/scripts/kit-version-check-test.sh +4 -0
  82. package/scripts/kit-version-check.sh +4 -2
  83. package/scripts/knowledge-lint.sh +4 -4
  84. package/scripts/leak-fence-test.sh +89 -0
  85. package/scripts/lib/adapter-select-test.sh +136 -0
  86. package/scripts/lib/adapter-select.sh +158 -0
  87. package/scripts/lib/agent-def-test.sh +69 -0
  88. package/scripts/lib/agent-def.sh +106 -0
  89. package/scripts/lib/agent-launch-test.sh +212 -0
  90. package/scripts/lib/agent-launch.sh +335 -0
  91. package/scripts/lib/board-view-test.sh +11 -0
  92. package/scripts/lib/board-view.sh +42 -26
  93. package/scripts/lib/branch-owner-test.sh +26 -0
  94. package/scripts/lib/branch-owner.sh +16 -9
  95. package/scripts/lib/captain-test.sh +105 -0
  96. package/scripts/lib/captain.sh +87 -8
  97. package/scripts/lib/codex-hooks-test.sh +100 -0
  98. package/scripts/lib/codex-hooks.sh +69 -0
  99. package/scripts/lib/commitlint.sh +1 -1
  100. package/scripts/lib/content-kinds-gc-test.sh +88 -0
  101. package/scripts/lib/copilot-test.sh +70 -4
  102. package/scripts/lib/copilot.sh +66 -14
  103. package/scripts/lib/effort-dispatch-test.sh +3 -3
  104. package/scripts/lib/effort-metrics-test.sh +178 -1
  105. package/scripts/lib/effort-metrics.sh +188 -35
  106. package/scripts/lib/effort-ops-test.sh +217 -7
  107. package/scripts/lib/effort-ops.sh +281 -49
  108. package/scripts/lib/effort-parity-test.sh +49 -13
  109. package/scripts/lib/effort-plan-test.sh +337 -0
  110. package/scripts/lib/effort-plan.sh +200 -23
  111. package/scripts/lib/effort-slug.sh +16 -2
  112. package/scripts/lib/effort.sh +67 -12
  113. package/scripts/lib/errors-header-test.sh +1 -1
  114. package/scripts/lib/gh-project-test.sh +35 -1
  115. package/scripts/lib/gh-project.sh +37 -16
  116. package/scripts/lib/gh-rest-test.sh +330 -0
  117. package/scripts/lib/gh-rest.sh +304 -0
  118. package/scripts/lib/hook-refresh.sh +1 -1
  119. package/scripts/lib/init-github.sh +412 -0
  120. package/scripts/lib/init-guide.sh +630 -0
  121. package/scripts/lib/integration-install-test.sh +343 -0
  122. package/scripts/lib/integration-install.sh +257 -0
  123. package/scripts/lib/integrations-test.sh +366 -0
  124. package/scripts/lib/integrations.sh +244 -0
  125. package/scripts/lib/kinds-test.sh +125 -0
  126. package/scripts/lib/kinds.sh +66 -0
  127. package/scripts/lib/kit-brief-test.sh +22 -3
  128. package/scripts/lib/kit-brief.sh +45 -5
  129. package/scripts/lib/kit-config-resolve.sh +2 -2
  130. package/scripts/lib/kit-config-test.sh +64 -1
  131. package/scripts/lib/kit-config.sh +37 -1
  132. package/scripts/lib/kit-events.sh +7 -0
  133. package/scripts/lib/kit-gc-test.sh +173 -1
  134. package/scripts/lib/kit-gc.sh +244 -37
  135. package/scripts/lib/kit-hotfix.sh +216 -0
  136. package/scripts/lib/kit-interview-test.sh +93 -0
  137. package/scripts/lib/kit-interview.sh +117 -8
  138. package/scripts/lib/kit-lib-test.sh +1 -1
  139. package/scripts/lib/kit-lib.sh +3 -3
  140. package/scripts/lib/kit-local.sh +2 -2
  141. package/scripts/lib/kit-manifest.sh +33 -1
  142. package/scripts/lib/kit-profile-test.sh +3 -3
  143. package/scripts/lib/kit-status-test.sh +112 -4
  144. package/scripts/lib/kit-status.sh +246 -16
  145. package/scripts/lib/kit-task-ops-test.sh +37 -0
  146. package/scripts/lib/kit-task-ops.sh +362 -89
  147. package/scripts/lib/kto-hotfix-test.sh +232 -0
  148. package/scripts/lib/kto-task-close-test.sh +83 -0
  149. package/scripts/lib/kto-task-new-test.sh +95 -0
  150. package/scripts/lib/kto-task-pr-merge-test.sh +97 -6
  151. package/scripts/lib/kto-task-pr-test.sh +70 -0
  152. package/scripts/lib/leak-fence.sh +89 -0
  153. package/scripts/lib/light-task-run-test.sh +255 -0
  154. package/scripts/lib/light-task-test.sh +309 -0
  155. package/scripts/lib/light-task.sh +706 -0
  156. package/scripts/lib/next-test.sh +99 -0
  157. package/scripts/lib/next.sh +9 -3
  158. package/scripts/lib/orchestration-runtime-test.sh +72 -0
  159. package/scripts/lib/orchestration-runtime.sh +57 -5
  160. package/scripts/lib/plan-machine-test.sh +15 -2
  161. package/scripts/lib/plan-machine.sh +20 -7
  162. package/scripts/lib/plan-next-test.sh +1 -1
  163. package/scripts/lib/plan-next.sh +4 -4
  164. package/scripts/lib/pr-evidence-test.sh +3 -3
  165. package/scripts/lib/pr-evidence.sh +1 -1
  166. package/scripts/lib/qa-lane-test.sh +626 -0
  167. package/scripts/lib/qa-lane.sh +1357 -0
  168. package/scripts/lib/qa-lanes-test.sh +175 -0
  169. package/scripts/lib/react-detect.sh +1 -1
  170. package/scripts/lib/render-test.sh +1 -1
  171. package/scripts/lib/review-page-test.sh +318 -0
  172. package/scripts/lib/review-page.sh +369 -0
  173. package/scripts/lib/review-stage-test.sh +62 -11
  174. package/scripts/lib/review-stage.sh +42 -60
  175. package/scripts/lib/role-identity-test.sh +65 -0
  176. package/scripts/lib/role-identity.sh +25 -2
  177. package/scripts/lib/secret-guard.sh +3 -3
  178. package/scripts/lib/session-registry-test.sh +111 -0
  179. package/scripts/lib/session-registry.sh +233 -0
  180. package/scripts/lib/stage-receipt-test.sh +14 -1
  181. package/scripts/lib/stage-receipt.sh +13 -8
  182. package/scripts/lib/task-source-file.sh +309 -0
  183. package/scripts/lib/task-source.sh +130 -0
  184. package/scripts/lib/test-env-test.sh +3 -3
  185. package/scripts/lib/test-env.sh +7 -4
  186. package/scripts/lib/upgrade-report-test.sh +120 -0
  187. package/scripts/lib/upgrade-report.sh +138 -0
  188. package/scripts/lib/version-bump.sh +3 -3
  189. package/scripts/lib/wave-result-test.sh +80 -0
  190. package/scripts/lib/wave-result.sh +127 -0
  191. package/scripts/lib/worker-brief-test.sh +5 -0
  192. package/scripts/lib/worker-brief.sh +2 -2
  193. package/scripts/lib/worktree-issue-test.sh +30 -1
  194. package/scripts/lib/worktree-issue.sh +93 -9
  195. package/scripts/lib/worktree-ports-test.sh +57 -4
  196. package/scripts/lib/worktree-start-test.sh +197 -0
  197. package/scripts/lib/worktree-start.sh +169 -32
  198. package/scripts/lib/zsh-safety-test.sh +19 -3
  199. package/scripts/marketing-walkthrough-test.sh +152 -0
  200. package/scripts/night-grant-test.sh +37 -0
  201. package/scripts/night-grant.sh +448 -0
  202. package/scripts/night-run-test.sh +8 -0
  203. package/scripts/night-run.mjs +275 -0
  204. package/scripts/night-run.test.mjs +324 -0
  205. package/scripts/orchestrate-test.sh +190 -0
  206. package/scripts/orchestrate.sh +79 -8
  207. package/scripts/portable-test.sh +11 -2
  208. package/scripts/publish.sh +28 -3
  209. package/scripts/review-lint-test.sh +7 -7
  210. package/scripts/review-lint.sh +2 -2
  211. package/scripts/review-rules.conf +8 -0
  212. package/scripts/rule-recipes-test.sh +96 -0
  213. package/scripts/self-install-test.sh +39 -9
  214. package/scripts/setup-labels.sh +18 -1
  215. package/scripts/setup-milestones.sh +1 -1
  216. package/scripts/showcase.sh +1 -1
  217. package/scripts/skill-frontmatter-lint-test.sh +4 -4
  218. package/scripts/skill-frontmatter-lint.sh +1 -1
  219. package/scripts/status-test.sh +113 -2
  220. package/scripts/status.sh +16 -3
  221. package/scripts/task-sync-test.sh +154 -0
  222. package/scripts/task-sync.sh +243 -32
  223. package/scripts/test-runner-test.sh +158 -0
  224. package/scripts/test.sh +131 -23
  225. package/scripts/update-path-test.sh +279 -0
  226. package/scripts/ux-ds-audit.sh +1 -1
  227. package/scripts/ux-graph-scan.sh +6 -6
  228. package/scripts/wave-worker.sh +54 -0
  229. package/skills/kit-add/SKILL.md +77 -0
  230. package/skills/kit-autopilot/SKILL.md +123 -12
  231. package/skills/kit-cleanup/SKILL.md +5 -2
  232. package/skills/kit-contribute/SKILL.md +4 -4
  233. package/skills/kit-docs-writer/SKILL.md +16 -6
  234. package/skills/kit-effort-close/SKILL.md +17 -8
  235. package/skills/kit-effort-new/SKILL.md +15 -9
  236. package/skills/kit-effort-pr/SKILL.md +15 -7
  237. package/skills/kit-effort-start/SKILL.md +5 -2
  238. package/skills/kit-gc/SKILL.md +5 -2
  239. package/skills/kit-next/SKILL.md +5 -1
  240. package/skills/kit-onboard/SKILL.md +3 -3
  241. package/skills/kit-page/SKILL.md +93 -0
  242. package/skills/kit-plan-next/SKILL.md +8 -4
  243. package/skills/kit-security-sweep/SKILL.md +1 -3
  244. package/skills/kit-ship/SKILL.md +2 -3
  245. package/skills/kit-status/SKILL.md +35 -4
  246. package/skills/kit-task-new/SKILL.md +3 -3
  247. package/skills/kit-task-pr/SKILL.md +7 -2
  248. package/skills/kit-task-pr-merge/SKILL.md +7 -2
  249. package/skills/kit-task-start/SKILL.md +7 -7
  250. package/skills/kit-task-sync/SKILL.md +19 -3
  251. package/skills/kit-ux-audit/SKILL.md +3 -2
  252. package/templates/agents/auto-dev.md +5 -4
  253. package/templates/agents/backend.md +1 -1
  254. package/templates/agents/designer.md +2 -0
  255. package/templates/agents/devops.md +1 -1
  256. package/templates/agents/editor.md +9 -1
  257. package/templates/agents/frontend.md +1 -1
  258. package/templates/agents/local-delegate.md +1 -1
  259. package/templates/agents/pm.md +5 -5
  260. package/templates/agents/tech-lead.md +1 -1
  261. package/templates/benchmarks/SCHEMA.md +9 -3
  262. package/templates/codex/hooks.json.tmpl +89 -0
  263. package/templates/hooks/guard-base-branch-commit.sh.tmpl +13 -7
  264. package/templates/hooks/guard-raw-git-ops.sh.tmpl +27 -14
  265. package/templates/hooks/mempal_followup.sh.tmpl +2 -2
  266. package/templates/hooks/mempal_session_start.sh.tmpl +1 -1
  267. package/templates/hooks/prepush_gate.sh.tmpl +4 -2
  268. package/templates/hooks/repo-hygiene.sh.tmpl +3 -2
  269. package/templates/instructions.md.tmpl +174 -0
  270. package/templates/kit.config.json.tmpl +3 -3
  271. package/templates/knowledge-INDEX.md.tmpl +1 -1
  272. package/templates/lib/kit-sigil.sh.tmpl +1 -1
  273. package/templates/rules/authoring.md +106 -0
  274. package/templates/rules/branch-naming.md +40 -4
  275. package/templates/rules/code-retrieval.md +63 -0
  276. package/templates/rules/delegation-brief.md +0 -3
  277. package/templates/rules/design-routing.md +3 -3
  278. package/templates/rules/effort-model.md +14 -10
  279. package/templates/rules/gate-and-review.md +94 -0
  280. package/templates/rules/issue-lifecycle.md +88 -0
  281. package/templates/rules/knowledge-base.md +1 -1
  282. package/templates/rules/mempalace.md +1 -1
  283. package/templates/rules/merge-safety.md +108 -0
  284. package/templates/rules/naming-and-ids.md +23 -17
  285. package/templates/rules/plain-language.md +59 -0
  286. package/templates/rules/plan-next.md +9 -11
  287. package/templates/rules/react-annotate.md +6 -0
  288. package/templates/rules/review-pages.md +49 -0
  289. package/templates/rules/risk-tiered-review.md +13 -4
  290. package/templates/rules/shared-checkout.md +106 -0
  291. package/templates/rules/skill-gaps.md +2 -7
  292. package/templates/rules/task-management.md +13 -1
  293. package/templates/skills/brand-voice/SKILL.md +91 -0
  294. package/templates/skills/brand-voice/references/voice-template.md +61 -0
  295. package/templates/skills/campaign/SKILL.md +123 -0
  296. package/templates/skills/campaign/references/plan-template.md +55 -0
  297. package/templates/skills/concrete/SKILL.md +2 -2
  298. package/templates/skills/copywriting/SKILL.md +8 -1
  299. package/templates/skills/feature-build-refine/SKILL.md +2 -4
  300. package/templates/skills/morning-briefing/SKILL.md +2 -2
  301. package/templates/skills/page-design/SKILL.md +145 -0
  302. package/templates/skills/page-design/add.json +5 -0
  303. package/templates/skills/page-design/references/design-file-template.md +40 -0
  304. package/templates/skills/page-design/references/generic-page-patterns.md +43 -0
  305. package/templates/skills/page-design/references/minimum-rules.md +42 -0
  306. package/templates/skills/speckit/SKILL.md +4 -5
  307. package/templates/skills/supabase-patterns/SKILL.md +1 -1
  308. package/commands/kit-add.md +0 -42
  309. package/templates/CLAUDE.md.tmpl +0 -106
@@ -0,0 +1,225 @@
1
+ #!/usr/bin/env bash
2
+ # shellcheck shell=bash
3
+ # init-content-test.sh — what `cckit init` writes for content work (E415).
4
+ #
5
+ # - the content profile: the content-work config keys (kinds.content, pr.bodyStyle), the editor
6
+ # agent with the copywriting skill, and NO plain-language rule (its switch is off by default);
7
+ # - `--plain-language on|off`: the rule and `plainLanguage.enabled` follow the switch on any
8
+ # profile, and `--upgrade` keeps a switch the project turned off;
9
+ # - the marketing profile: content plus light tasks as the default list, plain language on, the
10
+ # brand-voice and campaign skills and the effort-model rule; selectable with `--profile
11
+ # marketing` and through the guided setup's `profile` answer; nothing rendered with a leftover
12
+ # placeholder; `--upgrade` keeps a stored tasks.default;
13
+ # - the software profile gains none of the content keys;
14
+ # - the label list (`KIT_LABELS_LIST=1 setup-labels.sh`) of a content project carries the four
15
+ # content kind labels.
16
+ # Hermetic: every project is a mktemp directory, gh is a stub that fails, no network.
17
+ # Run: bash scripts/init-content-test.sh
18
+ # errors: strict — a test runner: rc 1 on any failed assertion
19
+ set -u
20
+ ROOT="$(cd "$(dirname "$0")/.." && pwd)"
21
+ # shellcheck source=/dev/null
22
+ . "$ROOT/scripts/lib/test-env.sh" && test_env_seal
23
+ INIT="$ROOT/scripts/init.sh"
24
+ fail=0
25
+ t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
26
+ has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> output lacks '[$3]'"; fail=1 ;; esac; }
27
+ hasnt() { case "$2" in *"$3"*) echo "FAIL: $1 -> output has '[$3]'"; fail=1 ;; *) echo "ok: $1" ;; esac; }
28
+ command -v jq >/dev/null 2>&1 || { echo "init-content-test: jq absent — skipping (dependency-light gate)"; exit 0; }
29
+
30
+ tmp="$(cd "$(mktemp -d)" && pwd -P)"; trap 'rm -rf "$tmp"' EXIT
31
+ mkdir -p "$tmp/bin"
32
+ printf '#!/bin/sh\nexit 1\n' > "$tmp/bin/gh"; chmod +x "$tmp/bin/gh"
33
+ export PATH="$tmp/bin:$PATH"
34
+ export KIT_INIT_PREFLIGHT=0 # the doctor preflight needs an authenticated gh; this test has none
35
+
36
+ # init <dir> <args…> — a scaffold-only run: nothing outside <dir>, no question asked.
37
+ init() {
38
+ local d="$1"; shift
39
+ bash "$INIT" --target "$d" --no-github --owner-login o --repo o/r "$@" < /dev/null
40
+ }
41
+ cfg() { jq -c "$2" "$1/.claude/kit.config.json" 2>/dev/null; }
42
+
43
+ # ── content profile ─────────────────────────────────────────────────────────────────────────────
44
+ c="$tmp/content"; mkdir -p "$c"
45
+ out="$(init "$c" --profile content 2>&1)"; t "content: init exits 0" "$?" "0"
46
+ t "content: kinds.content is on" "$(cfg "$c" '.kinds.content')" "true"
47
+ t "content: pr.bodyStyle is content" "$(cfg "$c" '.pr.bodyStyle')" '"content"'
48
+ t "content: no plainLanguage key" "$(cfg "$c" 'has("plainLanguage")')" "false"
49
+ t "content: no tasks key" "$(cfg "$c" 'has("tasks")')" "false"
50
+ # The config is committed by the guided setup: it must not record where the folder lives (#490).
51
+ t "content: no project.path key" "$(cfg "$c" '.project | has("path")')" "false"
52
+ cfgtxt="$(cat "$c/.claude/kit.config.json")"
53
+ t "content: the config names no absolute path of the project" "$(case "$cfgtxt" in *"$c"*) echo yes ;; *) echo no ;; esac)" "no"
54
+ t "content: no plain-language rule" "$([ -e "$c/.claude/rules/plain-language.md" ] && echo yes || echo no)" "no"
55
+ t "content: no effort-model rule" "$([ -e "$c/.claude/rules/effort-model.md" ] && echo yes || echo no)" "no"
56
+ t "content: the editor agent lists copywriting" "$(sed -n '/^skills:/,/^---/p' "$c/.claude/agents/editor/AGENT.md" | grep -c '^ - copywriting$')" "1"
57
+ t "content: the copywriting skill is installed" "$([ -f "$c/.claude/skills/copywriting/SKILL.md" ] && echo yes)" "yes"
58
+ t "content: roles are unchanged" "$(cfg "$c" '.roles')" '["PM","Editor","Designer","Researcher"]'
59
+
60
+ labels="$( cd "$c" && KIT_LABELS_LIST=1 bash "$ROOT/scripts/setup-labels.sh" 2>/dev/null )"
61
+ for k in post campaign brand research; do
62
+ t "content: label list has kind:$k" "$(printf '%s\n' "$labels" | grep -c "^kind:$k ")" "1"
63
+ done
64
+ t "content: label list has role:editor" "$(printf '%s\n' "$labels" | grep -c '^role:editor ')" "1"
65
+
66
+ dry="$(init "$tmp/content-dry" --profile content --dry-run 2>&1)"
67
+ has "content dry run: names the content kinds" "$dry" "Content : kind labels post · campaign · brand · research"
68
+ has "content dry run: names the PR text" "$dry" "PR text : content"
69
+ hasnt "content dry run: no plain-language line" "$dry" "Wording :"
70
+ t "content dry run: wrote nothing" "$([ -e "$tmp/content-dry" ] && echo yes || echo no)" "no"
71
+
72
+ # ── the plain-language switch ───────────────────────────────────────────────────────────────────
73
+ p="$tmp/plain"; mkdir -p "$p"
74
+ init "$p" --profile content --plain-language on >/dev/null 2>&1; t "plain on: init exits 0" "$?" "0"
75
+ t "plain on: plainLanguage.enabled is true" "$(cfg "$p" '.plainLanguage.enabled')" "true"
76
+ t "plain on: the rule is installed" "$([ -f "$p/.claude/rules/plain-language.md" ] && echo yes)" "yes"
77
+ rule="$(cat "$p/.claude/rules/plain-language.md" 2>/dev/null)"
78
+ hasnt "plain on: the rule has no unrendered placeholder" "$rule" "{{"
79
+ has "plain on: the rule names this project's config" "$rule" '`.claude/kit.config.json`'
80
+ has "plain on: the rule says draft, review, approve" "$rule" "Say draft, review, approve."
81
+ dry="$(init "$tmp/plain-dry" --profile software --plain-language on --dry-run 2>&1)"
82
+ has "plain on: a profile that does not list the rule still plans it" "$dry" ".claude/rules/plain-language.md"
83
+ has "plain on: the dry run says so" "$dry" "Wording : plain language"
84
+
85
+ # --upgrade keeps a switch the project turned off: the rule is not written back.
86
+ jq '.plainLanguage.enabled = false | .kitVersion = "0.0.1"' "$p/.claude/kit.config.json" > "$tmp/cfg.new" \
87
+ && mv "$tmp/cfg.new" "$p/.claude/kit.config.json"
88
+ rm -f "$p/.claude/rules/plain-language.md"
89
+ CLAUDE_PLUGIN_ROOT="$ROOT" bash "$INIT" --upgrade --target "$p" --force >/dev/null 2>&1 < /dev/null; t "upgrade exits 0" "$?" "0"
90
+ t "upgrade: a switch turned off stays off" "$(cfg "$p" '.plainLanguage.enabled')" "false"
91
+ t "upgrade: the rule is not written back" "$([ -e "$p/.claude/rules/plain-language.md" ] && echo yes || echo no)" "no"
92
+ # …and re-adds the rule to a project whose switch is on and whose rule file went missing.
93
+ jq '.plainLanguage.enabled = true | .kitVersion = "0.0.1"' "$p/.claude/kit.config.json" > "$tmp/cfg.new" \
94
+ && mv "$tmp/cfg.new" "$p/.claude/kit.config.json"
95
+ CLAUDE_PLUGIN_ROOT="$ROOT" bash "$INIT" --upgrade --target "$p" --force >/dev/null 2>&1 < /dev/null
96
+ t "upgrade: a switch that is on restores a missing rule" "$([ -f "$p/.claude/rules/plain-language.md" ] && echo yes || echo no)" "yes"
97
+ # page-design follows tasks.design the same way (#504): absent from a content project, added by an
98
+ # upgrade once the project config sets the key.
99
+ t "content: no page-design without tasks.design" "$([ -e "$p/.claude/skills/page-design" ] && echo yes || echo no)" "no"
100
+ jq '.tasks.design = true | .kitVersion = "0.0.1"' "$p/.claude/kit.config.json" > "$tmp/cfg.new" \
101
+ && mv "$tmp/cfg.new" "$p/.claude/kit.config.json"
102
+ CLAUDE_PLUGIN_ROOT="$ROOT" bash "$INIT" --upgrade --target "$p" --force >/dev/null 2>&1 < /dev/null
103
+ t "upgrade: tasks.design adds the page-design skill" "$([ -f "$p/.claude/skills/page-design/SKILL.md" ] && echo yes || echo no)" "yes"
104
+ t "upgrade: tasks.design is kept" "$(cfg "$p" '.tasks.design')" "true"
105
+
106
+ # ── marketing profile ───────────────────────────────────────────────────────────────────────────
107
+ m="$tmp/marketing"; mkdir -p "$m"
108
+ out="$(init "$m" --profile marketing 2>&1)"; t "marketing: init exits 0" "$?" "0"
109
+ t "marketing: profile is recorded" "$(cfg "$m" '.profile')" '"marketing"'
110
+ t "marketing: light tasks are the default" "$(cfg "$m" '.tasks.default')" '"light"'
111
+ t "marketing: plain language is on" "$(cfg "$m" '.plainLanguage.enabled')" "true"
112
+ t "marketing: kinds.content is on" "$(cfg "$m" '.kinds.content')" "true"
113
+ t "marketing: pr.bodyStyle is content" "$(cfg "$m" '.pr.bodyStyle')" '"content"'
114
+ t "marketing: the four roles" "$(cfg "$m" '.roles')" '["PM","Editor","Designer","Researcher"]'
115
+ for a in pm editor designer researcher; do
116
+ t "marketing: agent $a" "$([ -f "$m/.claude/agents/$a/AGENT.md" ] && echo yes)" "yes"
117
+ done
118
+ for r in plain-language effort-model task-management review-pages plan-output-format; do
119
+ t "marketing: rule $r" "$([ -f "$m/.claude/rules/$r.md" ] && echo yes)" "yes"
120
+ done
121
+ for s in copywriting brand-voice campaign page-design concrete; do
122
+ t "marketing: skill $s" "$([ -f "$m/.claude/skills/$s/SKILL.md" ] && echo yes)" "yes"
123
+ done
124
+ t "marketing: brand-voice ships its template" "$([ -f "$m/.claude/skills/brand-voice/references/voice-template.md" ] && echo yes)" "yes"
125
+ t "marketing: page-design ships its references" "$(ls "$m/.claude/skills/page-design/references" 2>/dev/null | tr '\n' ' ')" "design-file-template.md generic-page-patterns.md minimum-rules.md "
126
+ has "marketing: the three design integrations are offered" "$out" "cckit add impeccable && cckit add emil-design-eng && cckit add web-design-guidelines && cckit doctor --fix"
127
+ for s in impeccable emil-design-eng web-design-guidelines; do
128
+ t "marketing: init installs no third-party skill ($s)" "$([ -e "$m/.claude/skills/$s" ] && echo yes || echo no)" "no"
129
+ done
130
+ t "marketing: campaign ships its plan template" "$([ -f "$m/.claude/skills/campaign/references/plan-template.md" ] && echo yes)" "yes"
131
+ left="$(grep -rlE '\{\{|IF:[A-Z_]+' "$m/CLAUDE.md" "$m/.claude/rules" "$m/.claude/skills" "$m/.claude/agents" 2>/dev/null | sed "s#^$m/##" | tr '\n' ' ')"
132
+ t "marketing: nothing rendered with a leftover placeholder" "$left" ""
133
+ has "marketing: the campaign skill names this project's plans folder" "$(cat "$m/.claude/skills/campaign/SKILL.md")" '`docs/plans/marketing-pm-campaign-<name>.md`'
134
+ has "marketing: CLAUDE.md opens the task section with light tasks" "$(cat "$m/CLAUDE.md")" "## Work is tracked as light tasks"
135
+ has "marketing: CLAUDE.md names the finish verb, with --all for new files" "$(cat "$m/CLAUDE.md")" 'cckit task finish <id> "<summary>" --all'
136
+ has "marketing: task-management says the default list is light" "$(cat "$m/.claude/rules/task-management.md")" "default list is light tasks"
137
+ has "marketing: the closing summary says so" "$out" "Tasks : light tasks are the default list"
138
+ has "marketing: the closing summary names the first command" "$out" 'Add the first task: cckit task new "<title>"'
139
+ # #487: the next steps of a light-task project do not send the reader to the label scripts.
140
+ hasnt "marketing: no label or milestone script in the next steps" "$out" "setup-labels.sh"
141
+ has "software keeps them" "$(init "$tmp/sw-steps" --profile software 2>&1)" "./scripts/setup-labels.sh && ./scripts/setup-milestones.sh"
142
+ # #487: the instruction file. A folded `description: >` is read; the base branch is the project's;
143
+ # the task section does not contradict the light-task section; the credit names this repository.
144
+ md="$(cat "$m/CLAUDE.md")"
145
+ has "marketing CLAUDE.md: brand-voice has its description" "$md" '| `brand-voice` | Record the brand'
146
+ has "marketing CLAUDE.md: campaign has its description" "$md" '| `campaign` | Turn one marketing goal'
147
+ hasnt "marketing CLAUDE.md: no bare > in the skills table" "$md" '| > |'
148
+ has "marketing CLAUDE.md: the task files are the source of truth" "$md" '**Source of truth:** the task files under `tasks/`'
149
+ hasnt "marketing CLAUDE.md: does not call GitHub issues the source of truth" "$md" "**Source of truth:** GitHub issues"
150
+ hasnt "marketing CLAUDE.md: does not forbid task lists in markdown" "$md" "maintain task lists in markdown"
151
+ has "marketing CLAUDE.md: credits the kit's repository" "$md" "[cckit](https://github.com/jeiemgi/cckit)"
152
+ has "content CLAUDE.md: GitHub issues stay the source of truth" "$(cat "$c/CLAUDE.md")" "**Source of truth:** GitHub issues"
153
+ bb="$tmp/base"; mkdir -p "$bb"
154
+ KIT_BASE_BRANCH=develop init "$bb" --profile marketing >/dev/null 2>&1
155
+ has "CLAUDE.md names the project's base branch" "$(cat "$bb/CLAUDE.md")" 'lands on `develop` through a Pull Request'
156
+ hasnt "CLAUDE.md does not say main when the base is develop" "$(cat "$bb/CLAUDE.md")" '`main`'
157
+ # #487: every state `cckit task list` can print has a plain wording in the rule.
158
+ rule="$(cat "$m/.claude/rules/plain-language.md")"
159
+ for st in draft todo shared doing review 'done' dropped; do
160
+ has "plain-language: names the task state $st" "$rule" "\`$st\`"
161
+ done
162
+ has "plain-language: says what the draft state is" "$rule" "nobody has started the task and it is not on the shared list"
163
+ hasnt "content: CLAUDE.md has no light-task section" "$(cat "$c/CLAUDE.md")" "Work is tracked as light tasks"
164
+ hasnt "content: task-management does not mention light tasks" "$(cat "$c/.claude/rules/task-management.md")" "light tasks"
165
+ t "marketing: the installed cckit reads the default" "$(cd "$m" && "$ROOT/bin/cckit" task default)" "light"
166
+
167
+ dry="$(init "$tmp/marketing-dry" --profile marketing --dry-run 2>&1)"
168
+ for line in "Profile : marketing" "Tasks : light tasks are the default list" "Wording : plain language" \
169
+ ".claude/rules/plain-language.md" ".claude/rules/effort-model.md" \
170
+ ".claude/skills/brand-voice/SKILL.md" ".claude/skills/campaign/SKILL.md" ".claude/skills/copywriting/SKILL.md" \
171
+ ".claude/agents/pm/AGENT.md" ".claude/agents/editor/AGENT.md" ".claude/agents/designer/AGENT.md" ".claude/agents/researcher/AGENT.md"; do
172
+ has "marketing dry run: $line" "$dry" "$line"
173
+ done
174
+ t "marketing dry run: wrote nothing" "$([ -e "$tmp/marketing-dry" ] && echo yes || echo no)" "no"
175
+
176
+ # --plain-language off wins over the profile default.
177
+ mo="$tmp/marketing-off"; mkdir -p "$mo"
178
+ init "$mo" --profile marketing --plain-language off >/dev/null 2>&1
179
+ t "marketing --plain-language off: no key" "$(cfg "$mo" 'has("plainLanguage")')" "false"
180
+ t "marketing --plain-language off: no rule" "$([ -e "$mo/.claude/rules/plain-language.md" ] && echo yes || echo no)" "no"
181
+ t "marketing --plain-language off: light tasks stay the default" "$(cfg "$mo" '.tasks.default')" '"light"'
182
+
183
+ # The guided setup: the `profile` answer selects it, with no --profile flag.
184
+ g="$tmp/guided"; mkdir -p "$g"; echo "notes" > "$g/notes.md"
185
+ echo '{"profile":"marketing"}' > "$tmp/answers.json"
186
+ gout="$(bash "$INIT" "$g" --answers "$tmp/answers.json" --no-github --owner-login o --repo o/r 2>&1 < /dev/null)"; t "guided: init exits 0" "$?" "0"
187
+ has "guided: the profile question was answered from the file" "$gout" "What kind of work is this project? -> marketing (answers file)"
188
+ t "guided: the marketing profile was installed" "$(cfg "$g" '[.profile, .tasks.default, .plainLanguage.enabled]')" '["marketing","light",true]'
189
+ bad="$(bash "$INIT" --target "$tmp/nope" --no-github --profile nope 2>&1 < /dev/null)"; t "an unknown profile is refused" "$?" "1"
190
+ has "the refusal lists marketing" "$bad" "marketing"
191
+
192
+ # --upgrade keeps the stored default list: a project that moved to issues is not moved back.
193
+ jq '.tasks.default = "issues" | .kitVersion = "0.0.1"' "$m/.claude/kit.config.json" > "$tmp/cfg.new" \
194
+ && mv "$tmp/cfg.new" "$m/.claude/kit.config.json"
195
+ CLAUDE_PLUGIN_ROOT="$ROOT" bash "$INIT" --upgrade --target "$m" --force >/dev/null 2>&1 < /dev/null; t "marketing upgrade exits 0" "$?" "0"
196
+ t "upgrade: a stored tasks.default is kept" "$(cfg "$m" '.tasks.default')" '"issues"'
197
+ t "upgrade: plain language stays on" "$(cfg "$m" '.plainLanguage.enabled')" "true"
198
+
199
+ # The data form: marketing has the keys every profile has, and is content plus named additions.
200
+ keys() { jq -c 'keys' "$ROOT/profiles/$1.json"; }
201
+ t "marketing has the same top-level keys as content" "$(keys marketing)" "$(keys content)"
202
+ t "marketing agents == content agents" "$(jq -c .agents "$ROOT/profiles/marketing.json")" "$(jq -c .agents "$ROOT/profiles/content.json")"
203
+ t "marketing skills = content + brand-voice + campaign + page-design" \
204
+ "$(jq -c '.skills - ["brand-voice","campaign","page-design"]' "$ROOT/profiles/marketing.json")" "$(jq -c '.skills' "$ROOT/profiles/content.json")"
205
+ t "marketing rules = content + plain-language + effort-model" \
206
+ "$(jq -c '.rules - ["plain-language","effort-model"]' "$ROOT/profiles/marketing.json")" "$(jq -c '.rules' "$ROOT/profiles/content.json")"
207
+ for f in "$ROOT"/profiles/*.json; do
208
+ n="$(basename "$f" .json)"
209
+ miss=""
210
+ for s in $(jq -r '.skills[]' "$f"); do [ -f "$ROOT/templates/skills/$s/SKILL.md" ] || miss="$miss skill:$s"; done
211
+ for r in $(jq -r '.rules[]' "$f"); do [ -f "$ROOT/templates/rules/$r.md" ] || miss="$miss rule:$r"; done
212
+ for a in $(jq -r '.agents[]' "$f"); do [ -f "$ROOT/templates/agents/$a.md" ] || miss="$miss agent:$a"; done
213
+ t "profile $n: every skill, rule and agent it lists has a template" "$miss" ""
214
+ done
215
+
216
+ # ── software profile: none of it ────────────────────────────────────────────────────────────────
217
+ s="$tmp/software"; mkdir -p "$s"
218
+ init "$s" --profile software >/dev/null 2>&1; t "software: init exits 0" "$?" "0"
219
+ t "software: no content-work keys" "$(cfg "$s" '[has("kinds"), has("pr"), has("plainLanguage"), has("tasks")]')" "[false,false,false,false]"
220
+ t "software: no plain-language rule" "$([ -e "$s/.claude/rules/plain-language.md" ] && echo yes || echo no)" "no"
221
+ labels="$( cd "$s" && KIT_LABELS_LIST=1 bash "$ROOT/scripts/setup-labels.sh" 2>/dev/null )"
222
+ t "software: no content kind label" "$(printf '%s\n' "$labels" | grep -c -E '^kind:(post|campaign|brand|research) ')" "0"
223
+
224
+ [ "$fail" -eq 0 ] && echo "ALL OK (init content)" || echo "init content: FAILURES"
225
+ exit "$fail"