@jeiemgi/cckit 0.9.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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +169 -21
- package/README.md +491 -35
- package/SECURITY.md +5 -0
- package/bin/cckit +182 -17
- package/cckit.config.json +1 -1
- package/commands/kit-doctor.md +13 -5
- package/commands/kit-export-project.md +0 -2
- package/commands/kit-export-training.md +6 -9
- package/commands/kit-init.md +43 -13
- package/commands/kit-routines.md +1 -1
- package/commands/kit-update.md +11 -6
- package/databases/supabase/guide.html +106 -0
- package/databases/supabase/nextjs/lib/supabase/client.ts +9 -0
- package/databases/supabase/nextjs/lib/supabase/server.ts +29 -0
- package/databases/supabase.json +70 -0
- package/integrations/emil-design-eng.json +41 -0
- package/integrations/graft.json +81 -0
- package/integrations/impeccable.json +42 -0
- package/integrations/integration.schema.json +215 -0
- package/integrations/lavish.json +43 -0
- package/integrations/mempalace.json +28 -0
- package/integrations/mlx-lm.json +32 -0
- package/integrations/web-design-guidelines.json +42 -0
- package/kit.config.schema.json +183 -5
- package/package.json +4 -1
- package/profiles/automation.json +7 -1
- package/profiles/content.json +10 -2
- package/profiles/marketing.json +57 -0
- package/profiles/minimal.json +7 -1
- package/profiles/research.json +7 -1
- package/profiles/software.json +7 -1
- package/recipes/nextjs-shadcn.json +49 -0
- package/scripts/agent-skills-external.txt +45 -0
- package/scripts/agent-skills-lint-test.sh +131 -0
- package/scripts/agent-skills-lint.sh +115 -0
- package/scripts/agent-template-lint-test.sh +42 -0
- package/scripts/agent-template-lint.sh +58 -0
- package/scripts/annotate-setup.sh +1 -1
- package/scripts/autopilot-run-test.sh +338 -0
- package/scripts/autopilot-run.sh +448 -0
- package/scripts/autopilot-test.sh +8 -0
- package/scripts/autopilot.sh +10 -1
- package/scripts/benchmark/benchmark-test.sh +85 -0
- package/scripts/benchmark/checkpoint-test.sh +314 -0
- package/scripts/benchmark/checkpoint.sh +408 -0
- package/scripts/benchmark/lib/model.sh +31 -6
- package/scripts/benchmark/report.sh +17 -2
- package/scripts/benchmark/run-quality.sh +36 -10
- package/scripts/benchmark/verb-timings-test.sh +124 -0
- package/scripts/benchmark/verb-timings.sh +149 -0
- package/scripts/check.sh +29 -19
- package/scripts/content-skills-test.sh +144 -0
- package/scripts/copilot-loop-test.sh +25 -0
- package/scripts/database-supabase-test.sh +121 -0
- package/scripts/docs-marketing-words-test.sh +73 -0
- package/scripts/docs-record-tables-test.sh +72 -0
- package/scripts/hook-adapter-test.sh +193 -0
- package/scripts/init-content-test.sh +225 -0
- package/scripts/init-guided-test.sh +474 -0
- package/scripts/init-recipes-test.sh +104 -0
- package/scripts/init-upgrade-test.sh +341 -2
- package/scripts/init.sh +746 -95
- package/scripts/instruction-budget-baseline.txt +8 -0
- package/scripts/instruction-budget-lint-test.sh +166 -0
- package/scripts/instruction-budget-lint.sh +219 -0
- package/scripts/integrations-check-test.sh +200 -0
- package/scripts/integrations-check.sh +157 -0
- package/scripts/kit-add-test.sh +214 -0
- package/scripts/kit-add.sh +305 -5
- package/scripts/kit-adopt-test.sh +16 -0
- package/scripts/kit-adopt.sh +3 -2
- package/scripts/kit-digest.sh +2 -2
- package/scripts/kit-doctor-test.sh +293 -0
- package/scripts/kit-doctor.sh +272 -140
- package/scripts/kit-export-project-test.sh +3 -3
- package/scripts/kit-remove-test.sh +19 -0
- package/scripts/kit-routines.sh +2 -2
- package/scripts/kit-self-update.sh +1 -1
- package/scripts/kit-version-check-test.sh +4 -0
- package/scripts/kit-version-check.sh +4 -2
- package/scripts/knowledge-lint.sh +4 -4
- package/scripts/leak-fence-test.sh +89 -0
- package/scripts/lib/adapter-select-test.sh +136 -0
- package/scripts/lib/adapter-select.sh +158 -0
- package/scripts/lib/agent-def-test.sh +69 -0
- package/scripts/lib/agent-def.sh +106 -0
- package/scripts/lib/agent-launch-test.sh +212 -0
- package/scripts/lib/agent-launch.sh +335 -0
- package/scripts/lib/board-view-test.sh +11 -0
- package/scripts/lib/board-view.sh +42 -26
- package/scripts/lib/branch-owner-test.sh +26 -0
- package/scripts/lib/branch-owner.sh +16 -9
- package/scripts/lib/captain-test.sh +105 -0
- package/scripts/lib/captain.sh +87 -8
- package/scripts/lib/codex-hooks-test.sh +100 -0
- package/scripts/lib/codex-hooks.sh +69 -0
- package/scripts/lib/commitlint.sh +1 -1
- package/scripts/lib/content-kinds-gc-test.sh +88 -0
- package/scripts/lib/copilot-test.sh +70 -4
- package/scripts/lib/copilot.sh +66 -14
- package/scripts/lib/effort-dispatch-test.sh +3 -3
- package/scripts/lib/effort-metrics-test.sh +178 -1
- package/scripts/lib/effort-metrics.sh +175 -35
- package/scripts/lib/effort-ops-test.sh +205 -7
- package/scripts/lib/effort-ops.sh +198 -43
- package/scripts/lib/effort-parity-test.sh +49 -13
- package/scripts/lib/effort-plan-test.sh +337 -0
- package/scripts/lib/effort-plan.sh +200 -23
- package/scripts/lib/effort.sh +56 -11
- package/scripts/lib/errors-header-test.sh +1 -1
- package/scripts/lib/gh-project-test.sh +35 -1
- package/scripts/lib/gh-project.sh +23 -16
- package/scripts/lib/gh-rest-test.sh +32 -3
- package/scripts/lib/gh-rest.sh +17 -2
- package/scripts/lib/hook-refresh.sh +1 -1
- package/scripts/lib/init-github.sh +412 -0
- package/scripts/lib/init-guide.sh +630 -0
- package/scripts/lib/integration-install-test.sh +343 -0
- package/scripts/lib/integration-install.sh +257 -0
- package/scripts/lib/integrations-test.sh +366 -0
- package/scripts/lib/integrations.sh +244 -0
- package/scripts/lib/kinds-test.sh +125 -0
- package/scripts/lib/kinds.sh +66 -0
- package/scripts/lib/kit-brief-test.sh +22 -3
- package/scripts/lib/kit-brief.sh +45 -5
- package/scripts/lib/kit-config-resolve.sh +2 -2
- package/scripts/lib/kit-config-test.sh +64 -1
- package/scripts/lib/kit-config.sh +37 -1
- package/scripts/lib/kit-events.sh +7 -0
- package/scripts/lib/kit-gc-test.sh +173 -1
- package/scripts/lib/kit-gc.sh +226 -37
- package/scripts/lib/kit-hotfix.sh +216 -0
- package/scripts/lib/kit-interview-test.sh +93 -0
- package/scripts/lib/kit-interview.sh +117 -8
- package/scripts/lib/kit-lib-test.sh +1 -1
- package/scripts/lib/kit-lib.sh +3 -3
- package/scripts/lib/kit-local.sh +2 -2
- package/scripts/lib/kit-manifest.sh +33 -1
- package/scripts/lib/kit-profile-test.sh +3 -3
- package/scripts/lib/kit-status-test.sh +112 -4
- package/scripts/lib/kit-status.sh +246 -16
- package/scripts/lib/kit-task-ops-test.sh +37 -0
- package/scripts/lib/kit-task-ops.sh +175 -31
- package/scripts/lib/kto-hotfix-test.sh +232 -0
- package/scripts/lib/kto-task-close-test.sh +1 -1
- package/scripts/lib/kto-task-new-test.sh +95 -0
- package/scripts/lib/kto-task-pr-merge-test.sh +37 -3
- package/scripts/lib/kto-task-pr-test.sh +70 -0
- package/scripts/lib/leak-fence.sh +89 -0
- package/scripts/lib/light-task-run-test.sh +255 -0
- package/scripts/lib/light-task-test.sh +309 -0
- package/scripts/lib/light-task.sh +706 -0
- package/scripts/lib/next-test.sh +99 -0
- package/scripts/lib/next.sh +9 -3
- package/scripts/lib/orchestration-runtime-test.sh +72 -0
- package/scripts/lib/orchestration-runtime.sh +57 -5
- package/scripts/lib/plan-machine-test.sh +15 -2
- package/scripts/lib/plan-machine.sh +20 -7
- package/scripts/lib/plan-next-test.sh +1 -1
- package/scripts/lib/plan-next.sh +4 -4
- package/scripts/lib/pr-evidence-test.sh +3 -3
- package/scripts/lib/pr-evidence.sh +1 -1
- package/scripts/lib/qa-lane-test.sh +626 -0
- package/scripts/lib/qa-lane.sh +1357 -0
- package/scripts/lib/qa-lanes-test.sh +175 -0
- package/scripts/lib/react-detect.sh +1 -1
- package/scripts/lib/render-test.sh +1 -1
- package/scripts/lib/review-page-test.sh +318 -0
- package/scripts/lib/review-page.sh +369 -0
- package/scripts/lib/review-stage-test.sh +62 -11
- package/scripts/lib/review-stage.sh +42 -60
- package/scripts/lib/role-identity-test.sh +65 -0
- package/scripts/lib/role-identity.sh +25 -2
- package/scripts/lib/secret-guard.sh +3 -3
- package/scripts/lib/session-registry-test.sh +111 -0
- package/scripts/lib/session-registry.sh +233 -0
- package/scripts/lib/stage-receipt-test.sh +14 -1
- package/scripts/lib/stage-receipt.sh +13 -8
- package/scripts/lib/task-source-file.sh +309 -0
- package/scripts/lib/task-source.sh +130 -0
- package/scripts/lib/upgrade-report-test.sh +120 -0
- package/scripts/lib/upgrade-report.sh +138 -0
- package/scripts/lib/version-bump.sh +3 -3
- package/scripts/lib/wave-result-test.sh +80 -0
- package/scripts/lib/wave-result.sh +127 -0
- package/scripts/lib/worker-brief-test.sh +5 -0
- package/scripts/lib/worker-brief.sh +2 -2
- package/scripts/lib/worktree-issue-test.sh +30 -1
- package/scripts/lib/worktree-issue.sh +82 -12
- package/scripts/lib/worktree-ports-test.sh +57 -4
- package/scripts/lib/worktree-start-test.sh +197 -0
- package/scripts/lib/worktree-start.sh +153 -31
- package/scripts/lib/zsh-safety-test.sh +19 -3
- package/scripts/marketing-walkthrough-test.sh +152 -0
- package/scripts/night-grant-test.sh +37 -0
- package/scripts/night-grant.sh +448 -0
- package/scripts/night-run-test.sh +8 -0
- package/scripts/night-run.mjs +275 -0
- package/scripts/night-run.test.mjs +324 -0
- package/scripts/orchestrate-test.sh +190 -0
- package/scripts/orchestrate.sh +79 -8
- package/scripts/portable-test.sh +11 -2
- package/scripts/publish.sh +28 -3
- package/scripts/review-lint-test.sh +7 -7
- package/scripts/review-lint.sh +2 -2
- package/scripts/review-rules.conf +8 -0
- package/scripts/rule-recipes-test.sh +96 -0
- package/scripts/self-install-test.sh +39 -9
- package/scripts/setup-labels.sh +18 -1
- package/scripts/setup-milestones.sh +1 -1
- package/scripts/showcase.sh +1 -1
- package/scripts/skill-frontmatter-lint-test.sh +4 -4
- package/scripts/skill-frontmatter-lint.sh +1 -1
- package/scripts/status-test.sh +113 -2
- package/scripts/status.sh +16 -3
- package/scripts/task-sync-test.sh +154 -0
- package/scripts/task-sync.sh +243 -32
- package/scripts/test-runner-test.sh +158 -0
- package/scripts/test.sh +131 -23
- package/scripts/update-path-test.sh +279 -0
- package/scripts/ux-ds-audit.sh +1 -1
- package/scripts/ux-graph-scan.sh +6 -6
- package/scripts/wave-worker.sh +54 -0
- package/skills/kit-add/SKILL.md +77 -0
- package/skills/kit-autopilot/SKILL.md +123 -12
- package/skills/kit-cleanup/SKILL.md +5 -2
- package/skills/kit-contribute/SKILL.md +4 -4
- package/skills/kit-docs-writer/SKILL.md +16 -6
- package/skills/kit-effort-close/SKILL.md +17 -8
- package/skills/kit-effort-new/SKILL.md +15 -9
- package/skills/kit-effort-pr/SKILL.md +15 -7
- package/skills/kit-effort-start/SKILL.md +5 -2
- package/skills/kit-gc/SKILL.md +5 -2
- package/skills/kit-next/SKILL.md +5 -1
- package/skills/kit-onboard/SKILL.md +3 -3
- package/skills/kit-page/SKILL.md +93 -0
- package/skills/kit-plan-next/SKILL.md +8 -4
- package/skills/kit-security-sweep/SKILL.md +1 -3
- package/skills/kit-ship/SKILL.md +2 -3
- package/skills/kit-status/SKILL.md +35 -4
- package/skills/kit-task-new/SKILL.md +3 -3
- package/skills/kit-task-pr/SKILL.md +7 -2
- package/skills/kit-task-pr-merge/SKILL.md +7 -2
- package/skills/kit-task-start/SKILL.md +7 -7
- package/skills/kit-task-sync/SKILL.md +19 -3
- package/skills/kit-ux-audit/SKILL.md +3 -2
- package/templates/agents/auto-dev.md +5 -4
- package/templates/agents/backend.md +1 -1
- package/templates/agents/designer.md +2 -0
- package/templates/agents/devops.md +1 -1
- package/templates/agents/editor.md +9 -1
- package/templates/agents/frontend.md +1 -1
- package/templates/agents/local-delegate.md +1 -1
- package/templates/agents/pm.md +5 -5
- package/templates/agents/tech-lead.md +1 -1
- package/templates/benchmarks/SCHEMA.md +9 -3
- package/templates/codex/hooks.json.tmpl +89 -0
- package/templates/hooks/guard-base-branch-commit.sh.tmpl +13 -7
- package/templates/hooks/guard-raw-git-ops.sh.tmpl +12 -12
- package/templates/hooks/mempal_followup.sh.tmpl +2 -2
- package/templates/hooks/mempal_session_start.sh.tmpl +1 -1
- package/templates/hooks/prepush_gate.sh.tmpl +4 -2
- package/templates/hooks/repo-hygiene.sh.tmpl +3 -2
- package/templates/instructions.md.tmpl +174 -0
- package/templates/kit.config.json.tmpl +3 -3
- package/templates/knowledge-INDEX.md.tmpl +1 -1
- package/templates/lib/kit-sigil.sh.tmpl +1 -1
- package/templates/rules/authoring.md +106 -0
- package/templates/rules/branch-naming.md +40 -4
- package/templates/rules/code-retrieval.md +63 -0
- package/templates/rules/delegation-brief.md +0 -3
- package/templates/rules/design-routing.md +3 -3
- package/templates/rules/effort-model.md +14 -10
- package/templates/rules/gate-and-review.md +94 -0
- package/templates/rules/issue-lifecycle.md +88 -0
- package/templates/rules/knowledge-base.md +1 -1
- package/templates/rules/mempalace.md +1 -1
- package/templates/rules/merge-safety.md +108 -0
- package/templates/rules/naming-and-ids.md +23 -17
- package/templates/rules/plain-language.md +59 -0
- package/templates/rules/plan-next.md +9 -11
- package/templates/rules/react-annotate.md +6 -0
- package/templates/rules/review-pages.md +49 -0
- package/templates/rules/risk-tiered-review.md +13 -4
- package/templates/rules/shared-checkout.md +106 -0
- package/templates/rules/skill-gaps.md +2 -7
- package/templates/rules/task-management.md +13 -1
- package/templates/skills/brand-voice/SKILL.md +91 -0
- package/templates/skills/brand-voice/references/voice-template.md +61 -0
- package/templates/skills/campaign/SKILL.md +123 -0
- package/templates/skills/campaign/references/plan-template.md +55 -0
- package/templates/skills/concrete/SKILL.md +2 -2
- package/templates/skills/copywriting/SKILL.md +8 -1
- package/templates/skills/feature-build-refine/SKILL.md +2 -4
- package/templates/skills/morning-briefing/SKILL.md +2 -2
- package/templates/skills/page-design/SKILL.md +145 -0
- package/templates/skills/page-design/add.json +5 -0
- package/templates/skills/page-design/references/design-file-template.md +40 -0
- package/templates/skills/page-design/references/generic-page-patterns.md +43 -0
- package/templates/skills/page-design/references/minimum-rules.md +42 -0
- package/templates/skills/speckit/SKILL.md +4 -5
- package/templates/skills/supabase-patterns/SKILL.md +1 -1
- package/commands/kit-add.md +0 -42
- package/templates/CLAUDE.md.tmpl +0 -106
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# verb-timings-test.sh — wall time + gh call count per verb (#452). Offline: the measured CLI is a
|
|
3
|
+
# fake `cckit` and `gh` is a stub on PATH, so no verb of the real CLI runs and no network call is made.
|
|
4
|
+
# Run: bash scripts/benchmark/verb-timings-test.sh
|
|
5
|
+
set -uo pipefail
|
|
6
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
7
|
+
ROOT="$(cd "$HERE/../.." && pwd)"
|
|
8
|
+
VT="$HERE/verb-timings.sh"
|
|
9
|
+
|
|
10
|
+
fail=0
|
|
11
|
+
t() { if [ "$2" != "$3" ]; then echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; else echo "ok: $1"; fi; }
|
|
12
|
+
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> '[$3]' not in '[$2]'"; fail=1 ;; esac; }
|
|
13
|
+
|
|
14
|
+
command -v jq >/dev/null 2>&1 || { echo "SKIP: jq absent"; exit 0; }
|
|
15
|
+
command -v perl >/dev/null 2>&1 || { echo "SKIP: perl absent"; exit 0; }
|
|
16
|
+
|
|
17
|
+
FIX="$(mktemp -d)"; trap 'rm -rf "$FIX"' EXIT
|
|
18
|
+
FIX="$(cd "$FIX" && pwd -P)"
|
|
19
|
+
mkdir -p "$FIX/bin" "$FIX/co" "$FIX/tmp"
|
|
20
|
+
|
|
21
|
+
# The stub gh: records its arguments one per line, prints a line, exits 4 for `gh fail`.
|
|
22
|
+
cat > "$FIX/bin/gh" <<'STUB'
|
|
23
|
+
#!/bin/sh
|
|
24
|
+
for a in "$@"; do printf '[%s]' "$a" >> "$STUB_LOG"; done; printf '\n' >> "$STUB_LOG"
|
|
25
|
+
echo "stub-out:$1"
|
|
26
|
+
[ "$1" = "fail" ] && exit 4
|
|
27
|
+
exit 0
|
|
28
|
+
STUB
|
|
29
|
+
chmod +x "$FIX/bin/gh"
|
|
30
|
+
|
|
31
|
+
# The fake CLI. Every call appends "<cwd>|<args>" to FAKE_LOG.
|
|
32
|
+
cat > "$FIX/fake-cckit" <<'FAKE'
|
|
33
|
+
#!/usr/bin/env bash
|
|
34
|
+
printf '%s|%s\n' "$PWD" "$*" >> "$FAKE_LOG"
|
|
35
|
+
case "$*" in
|
|
36
|
+
alpha) gh api "repos/o/r/issues" -f "q=a b" > "$FAKE_OUT"; gh issue list >> "$FAKE_OUT"; echo "noise on stdout" ;;
|
|
37
|
+
"two words") gh pr list >/dev/null ;;
|
|
38
|
+
beta) exit 3 ;;
|
|
39
|
+
ghfail) gh fail > "$FAKE_OUT"; echo "rc=$?" >> "$FAKE_OUT" ;;
|
|
40
|
+
slow) sleep 0.3 ;;
|
|
41
|
+
vary) n="$(cat "$FAKE_COUNT" 2>/dev/null || echo 0)"; n=$((n+1)); echo "$n" > "$FAKE_COUNT"
|
|
42
|
+
case "$n" in 1) k=1 ;; 2) k=5 ;; *) k=2 ;; esac
|
|
43
|
+
i=0; while [ "$i" -lt "$k" ]; do gh api x >/dev/null; i=$((i+1)); done ;;
|
|
44
|
+
path) command -v gh > "$FAKE_OUT" ;;
|
|
45
|
+
esac
|
|
46
|
+
exit 0
|
|
47
|
+
FAKE
|
|
48
|
+
|
|
49
|
+
export STUB_LOG="$FIX/stub.log" FAKE_LOG="$FIX/fake.log" FAKE_OUT="$FIX/fake.out" FAKE_COUNT="$FIX/count"
|
|
50
|
+
: > "$STUB_LOG"; : > "$FAKE_LOG"
|
|
51
|
+
PATH_BEFORE="$FIX/bin:$PATH"
|
|
52
|
+
vt() { PATH="$FIX/bin:$PATH" TMPDIR="$FIX/tmp" bash "$VT" --checkout "$FIX/co" --cckit "$FIX/fake-cckit" "$@"; }
|
|
53
|
+
|
|
54
|
+
# ---- 1. counts, exit codes, shape -------------------------------------------
|
|
55
|
+
out="$(vt --json --verb alpha --verb "two words" --verb beta 2>/dev/null)"; t "measure exits 0" "$?" "0"
|
|
56
|
+
t "one JSON object of kind verb-timings" "$(jq -r '"\(.kind) \(.runs) \(.verbs | length)"' <<<"$out")" "verb-timings 3 3"
|
|
57
|
+
t "alpha: 2 gh calls per run" "$(jq -c '.verbs[0] | [.verb, .runs, .gh_calls, .exit]' <<<"$out")" '["alpha",3,2,0]'
|
|
58
|
+
t "a two-word verb is one row and is split into arguments" "$(jq -c '.verbs[1] | [.verb, .gh_calls]' <<<"$out")" '["two words",1]'
|
|
59
|
+
t "beta: no gh call, exit code kept" "$(jq -c '.verbs[2] | [.verb, .gh_calls, .exit]' <<<"$out")" '["beta",0,3]'
|
|
60
|
+
t "every row has integer timings, min <= median" "$(jq -c '[.verbs[] | (.min_ms | type) == "number" and .min_ms == (.min_ms | floor) and .min_ms <= .median_ms] | all' <<<"$out")" "true"
|
|
61
|
+
t "each verb ran --runs times" "$(grep -c '|alpha$' "$FAKE_LOG")" "3"
|
|
62
|
+
t "the verbs ran in the checkout" "$(sed -n 1p "$FAKE_LOG")" "$FIX/co|alpha"
|
|
63
|
+
t "the verb's own output is not in the result" "$(grep -c 'noise' <<<"$out")" "0"
|
|
64
|
+
|
|
65
|
+
# ---- 2. the shim changes nothing --------------------------------------------
|
|
66
|
+
t "the real gh got the same arguments, spaces kept" "$(sed -n 1p "$STUB_LOG")" "[api][repos/o/r/issues][-f][q=a b]"
|
|
67
|
+
t "the real gh ran once per call: 3 runs x 3 calls" "$(wc -l < "$STUB_LOG" | tr -d ' ')" "9"
|
|
68
|
+
t "gh's output reaches the verb" "$(tr '\n' ' ' < "$FAKE_OUT")" "stub-out:api stub-out:issue "
|
|
69
|
+
vt --json --runs 1 --verb ghfail >/dev/null 2>&1
|
|
70
|
+
t "gh's exit code reaches the verb" "$(tr '\n' ' ' < "$FAKE_OUT")" "stub-out:fail rc=4 "
|
|
71
|
+
vt --json --runs 1 --verb path >/dev/null 2>&1
|
|
72
|
+
shim="$(cat "$FAKE_OUT")"
|
|
73
|
+
has "inside a measured verb gh is the shim, in the temp dir" "$shim" "$FIX/tmp/"
|
|
74
|
+
t "the shim is gone after the run" "$([ -e "$shim" ] && echo present || echo gone)" "gone"
|
|
75
|
+
t "nothing is left in the temp dir" "$(find "$FIX/tmp" -mindepth 1 | wc -l | tr -d ' ')" "0"
|
|
76
|
+
t "the caller's PATH is unchanged" "$FIX/bin:$PATH" "$PATH_BEFORE"
|
|
77
|
+
t "the caller still resolves the real gh" "$(PATH="$FIX/bin:$PATH" command -v gh)" "$FIX/bin/gh"
|
|
78
|
+
|
|
79
|
+
# ---- 3. median and timing ---------------------------------------------------
|
|
80
|
+
rm -f "$FAKE_COUNT"
|
|
81
|
+
out="$(vt --json --verb vary 2>/dev/null)"
|
|
82
|
+
t "gh_calls is the median across runs (1, 5, 2 -> 2)" "$(jq -r '.verbs[0].gh_calls' <<<"$out")" "2"
|
|
83
|
+
rm -f "$FAKE_COUNT"
|
|
84
|
+
out="$(vt --json --runs 2 --verb vary 2>/dev/null)"
|
|
85
|
+
t "an even number of runs takes the mean of the middle two, rounded down (1, 5 -> 3)" "$(jq -r '.verbs[0].gh_calls' <<<"$out")" "3"
|
|
86
|
+
out="$(vt --json --runs 1 --verb slow 2>/dev/null)"
|
|
87
|
+
t "a verb that sleeps 300 ms is timed at 300 ms or more" "$(jq -r '.verbs[0].min_ms >= 300' <<<"$out")" "true"
|
|
88
|
+
t "--runs is recorded per verb" "$(jq -r '.verbs[0].runs' <<<"$out")" "1"
|
|
89
|
+
|
|
90
|
+
# ---- 4. the default list and the human table --------------------------------
|
|
91
|
+
: > "$FAKE_LOG"
|
|
92
|
+
out="$(vt --runs 1 2>/dev/null)"
|
|
93
|
+
t "the default list, in order" "$(sed 's/^.*|//' "$FAKE_LOG" | tr '\n' ',')" "status,sync,next,plan,gc,effort plan,claims,task list,qa lanes,"
|
|
94
|
+
has "the table has a header" "$(sed -n 1p <<<"$out")" "MEDIAN_MS"
|
|
95
|
+
t "the table has one row per verb" "$(wc -l <<<"$out" | tr -d ' ')" "10"
|
|
96
|
+
# No verb in the default list is one that writes: each is a read verb of bin/cckit.
|
|
97
|
+
bad=0
|
|
98
|
+
while IFS= read -r v; do
|
|
99
|
+
case "$v" in start*|pr*|close*|merge*|cleanup*|new*|"effort new"*|"effort start"*|"effort close"*|"effort pr"*|"effort chain"*|"task new"*|"task start"*|"task finish"*|"qa up"*|"qa stop"*|"qa verdict"*|release*|init*|*--prune*|*--write*|*--fix*) echo " writes: $v"; bad=1 ;; esac
|
|
100
|
+
done < <(sed 's/^.*|//' "$FAKE_LOG")
|
|
101
|
+
t "the default list holds no verb that writes" "$bad" "0"
|
|
102
|
+
|
|
103
|
+
# ---- 5. refusals ------------------------------------------------------------
|
|
104
|
+
vt --runs 0 >/dev/null 2>&1; t "--runs 0 is a usage error" "$?" "2"
|
|
105
|
+
vt --runs >/dev/null 2>&1; t "--runs with no value is a usage error" "$?" "2"
|
|
106
|
+
vt --bogus >/dev/null 2>&1; t "an unknown argument is a usage error" "$?" "2"
|
|
107
|
+
PATH="$FIX/bin:$PATH" bash "$VT" --checkout "$FIX/nowhere" --cckit "$FIX/fake-cckit" >/dev/null 2>&1; t "a missing checkout is refused" "$?" "2"
|
|
108
|
+
PATH="$FIX/bin:$PATH" bash "$VT" --checkout "$FIX/co" --cckit "$FIX/no-cckit" >/dev/null 2>&1; t "a missing cckit is refused" "$?" "2"
|
|
109
|
+
has "--help prints the usage" "$(bash "$VT" --help 2>&1)" "verb-timings.sh [--runs <N>]"
|
|
110
|
+
|
|
111
|
+
# ---- 6. the result attaches to a checkpoint, and the verb reaches the script --
|
|
112
|
+
mkdir -p "$FIX/p/benchmarks"
|
|
113
|
+
printf '%s\n' '{"id":"r1","q":"How do we release?","expect":"x.md"}' > "$FIX/p/benchmarks/retrieval.jsonl"
|
|
114
|
+
jq -n '{ kind: "retrieval-run", dry: false, total: 1, pass: 1,
|
|
115
|
+
results: [ { set: "retrieval.jsonl", tier: "retrieval", id: "r1", got: "x.md", expect: "x.md", pass: true, latency_ms: 1 } ] }' > "$FIX/run.json"
|
|
116
|
+
vt --json --runs 1 --verb alpha --verb beta > "$FIX/verbs.json" 2>/dev/null
|
|
117
|
+
BENCH_DIR="$FIX/p/benchmarks" bash "$HERE/checkpoint.sh" record 1.0.0 --from "$FIX/run.json" --verbs "$FIX/verbs.json" \
|
|
118
|
+
--date 2026-01-02 --commit abc1234 --ref develop --model test-model >/dev/null 2>&1
|
|
119
|
+
t "checkpoint record --verbs takes the script's output" "$?" "0"
|
|
120
|
+
t "the checkpoint holds both verbs" "$(jq -c '[.checkpoints[0].verbs[] | [.verb, .gh_calls]]' "$FIX/p/benchmarks/runs/1.0.0.json")" '[["alpha",2],["beta",0]]'
|
|
121
|
+
has "cckit bench verbs reaches the script" "$(bash "$ROOT/bin/cckit" bench verbs --help 2>&1)" "verb-timings.sh [--runs <N>]"
|
|
122
|
+
|
|
123
|
+
[ "$fail" -eq 0 ] && echo "ALL OK" || echo "SOME FAILED"
|
|
124
|
+
exit "$fail"
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# benchmark/verb-timings.sh — wall time and GitHub call count of cckit's read-only verbs (#452).
|
|
3
|
+
#
|
|
4
|
+
# Each verb runs --runs times (default 3) from one checkout. Per verb it records the fastest and the
|
|
5
|
+
# median wall time in milliseconds, and how many times the verb ran `gh`.
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# verb-timings.sh [--runs <N>] [--checkout <dir>] [--cckit <path>] [--verb "<verb> [args]"]… [--json]
|
|
9
|
+
# --checkout the directory the verbs run in (default: the current directory)
|
|
10
|
+
# --cckit the CLI to measure (default: <checkout>/bin/cckit, else the cckit this script ships in)
|
|
11
|
+
# --verb measure this verb and not the default list; repeatable
|
|
12
|
+
# --json print one JSON object: { kind: "verb-timings", date, commit, runs,
|
|
13
|
+
# verbs: [ { verb, runs, min_ms, median_ms, gh_calls, exit } ] }
|
|
14
|
+
# (`cckit bench checkpoint <X.Y.Z> --verbs <that file>` attaches it to a checkpoint)
|
|
15
|
+
#
|
|
16
|
+
# The default list is the verbs that change no branch, worktree, tracked file, issue, PR or board:
|
|
17
|
+
# status · sync · next · plan · gc · effort plan · claims · task list · qa lanes
|
|
18
|
+
# Three of them still touch the shared git directory: `status`, `gc` and `task list` refresh the
|
|
19
|
+
# remote-tracking refs (`git fetch --prune`), and `sync` appends two lines to kit-events.jsonl.
|
|
20
|
+
#
|
|
21
|
+
# How `gh` is counted: a shim named `gh` in a temp dir is put first on PATH of each measured verb,
|
|
22
|
+
# and only there. It appends one line to a log and execs the real `gh` with the same arguments, so
|
|
23
|
+
# the verb's behaviour and output are unchanged. The temp dir is removed when the script exits; the
|
|
24
|
+
# shell that called this script keeps its PATH. `gh_calls` is the median count across the runs.
|
|
25
|
+
#
|
|
26
|
+
# A verb that exits non-zero is still timed; its highest exit code is recorded as `exit` so a
|
|
27
|
+
# failed verb is not read as a fast one. Timings taken while other work runs on the machine are
|
|
28
|
+
# not comparable between checkpoints: take them on an idle machine.
|
|
29
|
+
#
|
|
30
|
+
# Exit: 0 measured · 2 usage error, or perl/jq missing, or no cckit to measure.
|
|
31
|
+
set -uo pipefail
|
|
32
|
+
|
|
33
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
34
|
+
KIT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
35
|
+
|
|
36
|
+
usage() { sed -n '2,30p' "$0" | sed 's/^# \{0,1\}//'; }
|
|
37
|
+
|
|
38
|
+
DEFAULT_VERBS='status
|
|
39
|
+
sync
|
|
40
|
+
next
|
|
41
|
+
plan
|
|
42
|
+
gc
|
|
43
|
+
effort plan
|
|
44
|
+
claims
|
|
45
|
+
task list
|
|
46
|
+
qa lanes'
|
|
47
|
+
|
|
48
|
+
runs=3; checkout=""; cckit=""; json=0; verbs=""
|
|
49
|
+
while [ "$#" -gt 0 ]; do
|
|
50
|
+
case "$1" in
|
|
51
|
+
--runs|--checkout|--cckit|--verb)
|
|
52
|
+
[ "$#" -ge 2 ] || { echo "verb-timings: $1 needs a value" >&2; exit 2; } ;;
|
|
53
|
+
esac
|
|
54
|
+
case "$1" in
|
|
55
|
+
--runs) runs="$2"; shift 2 ;;
|
|
56
|
+
--runs=*) runs="${1#*=}"; shift ;;
|
|
57
|
+
--checkout) checkout="$2"; shift 2 ;;
|
|
58
|
+
--checkout=*) checkout="${1#*=}"; shift ;;
|
|
59
|
+
--cckit) cckit="$2"; shift 2 ;;
|
|
60
|
+
--cckit=*) cckit="${1#*=}"; shift ;;
|
|
61
|
+
--verb) verbs="${verbs}${2}
|
|
62
|
+
"; shift 2 ;;
|
|
63
|
+
--verb=*) verbs="${verbs}${1#*=}
|
|
64
|
+
"; shift ;;
|
|
65
|
+
--json|--llm) json=1; shift ;;
|
|
66
|
+
-h|--help) usage; exit 0 ;;
|
|
67
|
+
*) echo "verb-timings: unknown argument '$1'" >&2; exit 2 ;;
|
|
68
|
+
esac
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
grep -Eq '^[1-9][0-9]*$' <<<"$runs" || { echo "verb-timings: --runs must be a positive integer" >&2; exit 2; }
|
|
72
|
+
command -v jq >/dev/null 2>&1 || { echo "verb-timings: jq is required" >&2; exit 2; }
|
|
73
|
+
command -v perl >/dev/null 2>&1 || { echo "verb-timings: perl is required (millisecond clock)" >&2; exit 2; }
|
|
74
|
+
|
|
75
|
+
[ -n "$checkout" ] || checkout="$PWD"
|
|
76
|
+
[ -d "$checkout" ] || { echo "verb-timings: no such checkout: $checkout" >&2; exit 2; }
|
|
77
|
+
checkout="$(cd "$checkout" && pwd)"
|
|
78
|
+
if [ -z "$cckit" ]; then
|
|
79
|
+
cckit="$checkout/bin/cckit"; [ -f "$cckit" ] || cckit="$KIT_ROOT/bin/cckit"
|
|
80
|
+
fi
|
|
81
|
+
[ -f "$cckit" ] || { echo "verb-timings: no cckit to measure at $cckit" >&2; exit 2; }
|
|
82
|
+
[ -n "$verbs" ] || verbs="$DEFAULT_VERBS"
|
|
83
|
+
|
|
84
|
+
# An explicit template: a bare `mktemp -d` ignores TMPDIR on macOS.
|
|
85
|
+
_td="${TMPDIR:-/tmp}"; tmp="$(mktemp -d "${_td%/}/verb-timings.XXXXXX")" || exit 2
|
|
86
|
+
# shellcheck disable=SC2064
|
|
87
|
+
trap "rm -rf '$tmp'" EXIT
|
|
88
|
+
|
|
89
|
+
# The shim. GH_SHIM_REAL is resolved here, before the shim dir is on any PATH, so the shim can
|
|
90
|
+
# never exec itself. With no gh installed the shim still counts the call and exits 127, which is
|
|
91
|
+
# what the verb would have got from the shell.
|
|
92
|
+
real_gh="$(command -v gh 2>/dev/null || true)"
|
|
93
|
+
mkdir -p "$tmp/shim"
|
|
94
|
+
cat > "$tmp/shim/gh" <<'SHIM'
|
|
95
|
+
#!/bin/sh
|
|
96
|
+
printf '%s\n' "${1:-}" >> "$GH_SHIM_LOG"
|
|
97
|
+
[ -n "${GH_SHIM_REAL:-}" ] || { echo "gh: command not found" >&2; exit 127; }
|
|
98
|
+
exec "$GH_SHIM_REAL" "$@"
|
|
99
|
+
SHIM
|
|
100
|
+
chmod +x "$tmp/shim/gh"
|
|
101
|
+
|
|
102
|
+
# One run: perl takes the clock on both sides of the verb, so the only process start inside the
|
|
103
|
+
# measured interval is the verb's own. Writes "<ms> <exit>" to the file named first; the verb's
|
|
104
|
+
# own output is discarded by the caller.
|
|
105
|
+
TIMER='my $out = shift; my $t = time; system(@ARGV);
|
|
106
|
+
my $rc = ($? & 127) ? 128 + ($? & 127) : ($? >> 8);
|
|
107
|
+
open(my $f, ">", $out) or exit 2; printf $f "%d %d\n", (time - $t) * 1000, $rc; close $f;'
|
|
108
|
+
|
|
109
|
+
rows="$tmp/rows.jsonl"; : > "$rows"
|
|
110
|
+
while IFS= read -r verb; do
|
|
111
|
+
[ -n "$verb" ] || continue
|
|
112
|
+
times=""; calls=""; worst=0; i=0
|
|
113
|
+
while [ "$i" -lt "$runs" ]; do
|
|
114
|
+
i=$((i+1))
|
|
115
|
+
log="$tmp/gh.log"; : > "$log"
|
|
116
|
+
: > "$tmp/t"
|
|
117
|
+
# shellcheck disable=SC2086 # the verb string is split into words on purpose: "effort plan"
|
|
118
|
+
( cd "$checkout" && env PATH="$tmp/shim:$PATH" GH_SHIM_LOG="$log" GH_SHIM_REAL="$real_gh" \
|
|
119
|
+
perl -MTime::HiRes=time -e "$TIMER" "$tmp/t" bash "$cckit" $verb </dev/null >/dev/null 2>&1 )
|
|
120
|
+
res="$(cat "$tmp/t")"
|
|
121
|
+
grep -Eq '^[0-9]+ [0-9]+$' <<<"$res" || { echo "verb-timings: could not time 'cckit $verb'" >&2; exit 2; }
|
|
122
|
+
ms="${res%% *}"; rc="${res##* }"
|
|
123
|
+
n="$(wc -l < "$log" | tr -d ' ')"
|
|
124
|
+
times="${times}${ms}
|
|
125
|
+
"
|
|
126
|
+
calls="${calls}${n}
|
|
127
|
+
"
|
|
128
|
+
[ "$rc" -gt "$worst" ] && worst="$rc"
|
|
129
|
+
[ "$json" -eq 1 ] || printf ' %-12s run %s/%s %s ms %s gh call(s) exit %s\n' "$verb" "$i" "$runs" "$ms" "$n" "$rc" >&2
|
|
130
|
+
done
|
|
131
|
+
jq -n -c --arg verb "$verb" --argjson runs "$runs" --argjson exit "$worst" \
|
|
132
|
+
--arg times "$times" --arg calls "$calls" '
|
|
133
|
+
def nums(s): [ s | split("\n")[] | select(length > 0) | tonumber ] | sort;
|
|
134
|
+
def median: if length % 2 == 1 then .[(length - 1) / 2] else ((.[length / 2 - 1] + .[length / 2]) / 2 | floor) end;
|
|
135
|
+
nums($times) as $t | nums($calls) as $c
|
|
136
|
+
| { verb: $verb, runs: $runs, min_ms: $t[0], median_ms: ($t | median), gh_calls: ($c | median), exit: $exit }' >> "$rows"
|
|
137
|
+
done <<<"$verbs"
|
|
138
|
+
|
|
139
|
+
commit="$(git -C "$checkout" rev-parse --short HEAD 2>/dev/null || true)"
|
|
140
|
+
doc="$(jq -s -c --arg date "$(date +%Y-%m-%d)" --arg commit "$commit" --argjson runs "$runs" \
|
|
141
|
+
'{ kind: "verb-timings", date: $date, commit: $commit, runs: $runs, verbs: . }' "$rows")" || exit 2
|
|
142
|
+
|
|
143
|
+
if [ "$json" -eq 1 ]; then
|
|
144
|
+
printf '%s\n' "$doc"
|
|
145
|
+
else
|
|
146
|
+
printf '%-14s %5s %9s %10s %9s %5s\n' "VERB" "RUNS" "MIN_MS" "MEDIAN_MS" "GH_CALLS" "EXIT"
|
|
147
|
+
printf '%s' "$doc" | jq -r '.verbs[] | [.verb, .runs, .min_ms, .median_ms, .gh_calls, .exit] | @tsv' \
|
|
148
|
+
| while IFS=' ' read -r v r mn md g x; do printf '%-14s %5s %9s %10s %9s %5s\n' "$v" "$r" "$mn" "$md" "$g" "$x"; done
|
|
149
|
+
fi
|
package/scripts/check.sh
CHANGED
|
@@ -32,24 +32,14 @@ else
|
|
|
32
32
|
note " (jq absent - skipping JSON validation)"
|
|
33
33
|
fi
|
|
34
34
|
|
|
35
|
-
# 3.
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
note "==>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
else
|
|
44
|
-
grep -rniI --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=.cckit \
|
|
45
|
-
--exclude-dir=dist --exclude=check.sh tedos .
|
|
46
|
-
fi
|
|
47
|
-
}
|
|
48
|
-
if _tedos_scan >/dev/null 2>&1; then
|
|
49
|
-
note "x found 'tedos' references - cckit must be tedos-free:"
|
|
50
|
-
_tedos_scan | head -20 >&2
|
|
51
|
-
fail=1
|
|
52
|
-
fi
|
|
35
|
+
# 3. Leak fence - no private word (the legacy brand name, a product, a client, a person) in any
|
|
36
|
+
# tracked file. One scan, three pattern sources: the built-in word, the gitignored
|
|
37
|
+
# .cckit/leak-words list, and CCKIT_LEAK_WORDS in CI. Hits print as file:line only.
|
|
38
|
+
# scripts/lib/leak-fence.sh is the single implementation; scripts/leak-fence-test.sh is its selftest.
|
|
39
|
+
note "==> leak fence (tracked files)"
|
|
40
|
+
. scripts/lib/kit-state.sh 2>/dev/null || true
|
|
41
|
+
. scripts/lib/leak-fence.sh
|
|
42
|
+
leak_fence_check || fail=1
|
|
53
43
|
|
|
54
44
|
# 4. Secret + privacy guard - no secrets, keys, env, or private data in anything publishable.
|
|
55
45
|
note "==> secret + privacy guard"
|
|
@@ -65,13 +55,33 @@ fi
|
|
|
65
55
|
note "==> skill frontmatter context budget"
|
|
66
56
|
bash scripts/skill-frontmatter-lint.sh || fail=1
|
|
67
57
|
|
|
58
|
+
# 5b. Agent templates carry a `name:` equal to their file name and a non-empty `description:` —
|
|
59
|
+
# Codex refuses a custom agent without either (#263). Skill references are step 7's.
|
|
60
|
+
note "==> agent template name + description"
|
|
61
|
+
bash scripts/agent-template-lint.sh || fail=1
|
|
62
|
+
|
|
63
|
+
# 5c. Instruction-file budget. CLAUDE.md and every `.claude/rules/*.md` without a `paths:`
|
|
64
|
+
# frontmatter load into every session; Claude Code warns once they pass 150k characters combined.
|
|
65
|
+
# Same ratchet: an over-long file or an over-limit total is grandfathered in the baseline, and only
|
|
66
|
+
# growth (or a new offender) fails the gate.
|
|
67
|
+
note "==> instruction-file budget"
|
|
68
|
+
bash scripts/instruction-budget-lint.sh || fail=1
|
|
69
|
+
|
|
68
70
|
# 6. Codified review findings. Mechanical defect classes caught in past reviews, encoded as rules
|
|
69
71
|
# in scripts/review-rules.conf so the same bug cannot land twice. Per-file ratchet: today's hits are
|
|
70
72
|
# grandfathered in the baseline, only new or grown hits fail. Rules needing intent stay with review.
|
|
71
73
|
note "==> codified review findings"
|
|
72
74
|
bash scripts/review-lint.sh || fail=1
|
|
73
75
|
|
|
74
|
-
# 7.
|
|
76
|
+
# 7. Agent skill references. Every `skills:` entry in templates/agents/*.md must resolve to a skill
|
|
77
|
+
# the kit ships or scaffolds, a `plugin:skill` reference, or a name declared third-party in
|
|
78
|
+
# scripts/agent-skills-external.txt. An unresolved entry fails silently at runtime: the agent loads
|
|
79
|
+
# with fewer skills than its frontmatter lists.
|
|
80
|
+
note "==> agent skill references"
|
|
81
|
+
bash scripts/agent-skills-lint.sh || fail=1
|
|
82
|
+
|
|
83
|
+
# 8. Behavioral tests - run every *-test.sh through the test runner (several files at a time;
|
|
84
|
+
# TEST_JOBS=1 for one at a time).
|
|
75
85
|
note "==> behavioral tests"
|
|
76
86
|
bash scripts/test.sh || fail=1
|
|
77
87
|
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# shellcheck shell=bash
|
|
3
|
+
# content-skills-test.sh — the content skills cckit scaffolds follow the skill conventions (E415).
|
|
4
|
+
#
|
|
5
|
+
# For each skill in CONTENT_SKILLS (templates/skills/<name>/SKILL.md):
|
|
6
|
+
# - `name:` equals the directory name;
|
|
7
|
+
# - `when_to_use` quotes conversational phrasings and carries an explicit SKIP clause;
|
|
8
|
+
# - description + when_to_use fit the 500-byte listing budget. The template is not under
|
|
9
|
+
# skill-frontmatter-lint.sh here, but its scaffolded copy is in every project that installs it;
|
|
10
|
+
# - the only `{{…}}` in the file are variables init exports (PLANS_DIR, PROJECT_SLUG) — init
|
|
11
|
+
# renders SKILL.md through the template engine, so any other brace pair would be left in the
|
|
12
|
+
# project as a broken placeholder;
|
|
13
|
+
# - every `cckit <verb>` it tells the agent to run is a verb `cckit commands` lists.
|
|
14
|
+
# Plus the contract between the skills: the headings brand-voice writes are the ones its template
|
|
15
|
+
# has and the ones copywriting and campaign are told to read.
|
|
16
|
+
# Offline: no network, no gh, nothing written outside mktemp.
|
|
17
|
+
# Run: bash scripts/content-skills-test.sh
|
|
18
|
+
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
19
|
+
set -u
|
|
20
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
21
|
+
fail=0
|
|
22
|
+
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
23
|
+
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> lacks '[$3]'"; fail=1 ;; esac; }
|
|
24
|
+
|
|
25
|
+
CONTENT_SKILLS="brand-voice campaign page-design"
|
|
26
|
+
|
|
27
|
+
# _field <file> <key> — a frontmatter scalar, folded (`key: >`) or inline, on one line.
|
|
28
|
+
_field() {
|
|
29
|
+
awk -v k="$2" '
|
|
30
|
+
NR == 1 && $0 == "---" { infm = 1; next }
|
|
31
|
+
infm && $0 == "---" { exit }
|
|
32
|
+
!infm { next }
|
|
33
|
+
$0 ~ "^" k ":" { on = 1; sub("^" k ":[ ]*>?[ ]*", ""); if (length($0)) printf "%s ", $0; next }
|
|
34
|
+
on && /^[a-zA-Z_]+:/ { on = 0 }
|
|
35
|
+
on { sub(/^[ ]+/, ""); printf "%s ", $0 }
|
|
36
|
+
' "$1" | sed 's/ *$//'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
verbs="$(CCKIT_OUTPUT=human "$ROOT/bin/cckit" commands 2>/dev/null)"
|
|
40
|
+
has "cckit commands lists the task verb" " $verbs " " task "
|
|
41
|
+
|
|
42
|
+
for s in $CONTENT_SKILLS; do
|
|
43
|
+
f="$ROOT/templates/skills/$s/SKILL.md"
|
|
44
|
+
t "$s: the template exists" "$([ -f "$f" ] && echo yes)" "yes"
|
|
45
|
+
[ -f "$f" ] || continue
|
|
46
|
+
t "$s: name matches its directory" "$(_field "$f" name)" "$s"
|
|
47
|
+
desc="$(_field "$f" description)"; when="$(_field "$f" when_to_use)"
|
|
48
|
+
t "$s: has a description" "$([ -n "$desc" ] && echo yes)" "yes"
|
|
49
|
+
has "$s: when_to_use carries a SKIP clause" "$when" "SKIP"
|
|
50
|
+
t "$s: when_to_use quotes at least three phrasings" "$([ "$(printf '%s' "$when" | grep -o '"[^"]*"' | grep -c .)" -ge 3 ] && echo yes)" "yes"
|
|
51
|
+
bytes="$(printf '%s%s' "$desc" "$when" | LC_ALL=C wc -c | tr -d ' ')"
|
|
52
|
+
t "$s: description + when_to_use within 500 bytes ($bytes)" "$([ "$bytes" -le 500 ] && echo yes)" "yes"
|
|
53
|
+
t "$s: no template variable init does not export" \
|
|
54
|
+
"$(sed -e 's/{{PLANS_DIR}}//g' -e 's/{{PROJECT_SLUG}}//g' "$f" | grep -c '{{' | tr -d ' ')" "0"
|
|
55
|
+
# every `cckit <verb>` named in the skill is a real verb
|
|
56
|
+
used="$(grep -oE 'cckit [a-z][a-z-]*' "$f" | awk '{print $2}' | sort -u)"
|
|
57
|
+
for v in $used; do
|
|
58
|
+
case " $verbs " in *" $v "*) echo "ok: $s: cckit $v is a verb" ;; *) echo "FAIL: $s names 'cckit $v', which cckit commands does not list"; fail=1 ;; esac
|
|
59
|
+
done
|
|
60
|
+
done
|
|
61
|
+
|
|
62
|
+
# ── brand-voice ↔ its template ↔ copywriting ────────────────────────────────────────────────────
|
|
63
|
+
bv="$ROOT/templates/skills/brand-voice/SKILL.md"
|
|
64
|
+
tpl="$ROOT/templates/skills/brand-voice/references/voice-template.md"
|
|
65
|
+
cw="$ROOT/templates/skills/copywriting/SKILL.md"
|
|
66
|
+
t "brand-voice: ships its template" "$([ -f "$tpl" ] && echo yes)" "yes"
|
|
67
|
+
has "brand-voice: names the file it writes" "$(cat "$bv")" '`brand/voice.md`'
|
|
68
|
+
has "brand-voice: points at its template" "$(cat "$bv")" 'references/voice-template.md'
|
|
69
|
+
for h in "Audience" "Voice" "Key messages" "Banned phrasings" "Words we use" "Examples" "Changes"; do
|
|
70
|
+
t "voice template has ## $h" "$(grep -c "^## $h\$" "$tpl" | tr -d ' ')" "1"
|
|
71
|
+
done
|
|
72
|
+
has "copywriting reads brand/voice.md" "$(cat "$cw")" 'If `brand/voice.md` exists'
|
|
73
|
+
for h in "Voice" "Key messages" "Banned phrasings" "Words we use"; do
|
|
74
|
+
has "copywriting reads the section ## $h" "$(cat "$cw")" "\`## $h\`"
|
|
75
|
+
done
|
|
76
|
+
# The task verbs the Change flow names take the flags it gives them.
|
|
77
|
+
help="$("$ROOT/bin/cckit" task --help 2>&1)"
|
|
78
|
+
has "cckit task new takes --kind" "$help" "cckit task new [--priority p0|p1|p2|p3] [--kind K]"
|
|
79
|
+
has "cckit task finish takes --all" "$help" 'cckit task finish [<id>] "<summary>" [--all]'
|
|
80
|
+
|
|
81
|
+
# ── campaign ↔ its template ↔ the verbs it names ────────────────────────────────────────────────
|
|
82
|
+
cp="$ROOT/templates/skills/campaign/SKILL.md"
|
|
83
|
+
ptpl="$ROOT/templates/skills/campaign/references/plan-template.md"
|
|
84
|
+
t "campaign: ships its plan template" "$([ -f "$ptpl" ] && echo yes)" "yes"
|
|
85
|
+
for h in "Goal" "Audience" "Message" "Channels" "Pieces" "Timeline" "Measure" "Deliverables" "Result"; do
|
|
86
|
+
t "plan template has ## $h" "$(grep -c "^## $h\$" "$ptpl" | tr -d ' ')" "1"
|
|
87
|
+
done
|
|
88
|
+
has "campaign reads brand/voice.md" "$(cat "$cp")" '`brand/voice.md`'
|
|
89
|
+
has "campaign asks which list the project uses" "$(cat "$cp")" 'cckit task default'
|
|
90
|
+
has "campaign has the light lane" "$(cat "$cp")" 'cckit task new --kind campaign "Campaign plan: <name>"'
|
|
91
|
+
has "campaign has the effort lane" "$(cat "$cp")" 'cckit effort new "<name>"'
|
|
92
|
+
has "campaign waits for approval" "$(cat "$cp")" "Record nothing"
|
|
93
|
+
# Every `cckit task finish` the skill names carries --all: a piece's draft is a new file, and
|
|
94
|
+
# without --all the review opens without it.
|
|
95
|
+
t "campaign: no task finish line without --all" "$(grep -c 'cckit task finish' "$cp")" "$(grep -c 'cckit task finish <id> "[^"]*" --all' "$cp")"
|
|
96
|
+
has "cckit task has the default verb" "$help" "cckit task default"
|
|
97
|
+
# The effort lane's flags are ones `effort new` parses.
|
|
98
|
+
eo="$(cat "$ROOT/scripts/lib/effort-ops.sh")"
|
|
99
|
+
for fl in --kind --goal --scope --verification; do
|
|
100
|
+
has "effort new parses $fl" "$eo" " $fl)"
|
|
101
|
+
done
|
|
102
|
+
# ── page-design names its three skills and never claims a missing one (#504) ────────────────────
|
|
103
|
+
pd="$ROOT/templates/skills/page-design/SKILL.md"; pdr="$ROOT/templates/skills/page-design/references"
|
|
104
|
+
for f in design-file-template.md generic-page-patterns.md minimum-rules.md; do
|
|
105
|
+
t "page-design: ships references/$f" "$([ -f "$pdr/$f" ] && echo yes)" "yes"
|
|
106
|
+
has "page-design: SKILL.md points at references/$f" "$(cat "$pd")" "references/$f"
|
|
107
|
+
done
|
|
108
|
+
for sk in impeccable emil-design-eng web-design-guidelines; do
|
|
109
|
+
t "page-design: $sk has an integration descriptor" "$([ -f "$ROOT/integrations/$sk.json" ] && echo yes)" "yes"
|
|
110
|
+
has "page-design: names how to add $sk" "$(cat "$pd")" "cckit add $sk"
|
|
111
|
+
has "page-design: a missing $sk is written as not installed" "$(cat "$pd")" "\`$sk: not installed\`"
|
|
112
|
+
has "page-design: the design file has a row for $sk" "$(cat "$pdr/design-file-template.md")" "| \`$sk\` | present / not installed |"
|
|
113
|
+
done
|
|
114
|
+
t "page-design: the order is direction, motion, audit" \
|
|
115
|
+
"$(grep -oE '^## [0-9] · .*' "$pd" | tr '\n' '|')" \
|
|
116
|
+
'## 0 · Find out what is installed, and where you are running|## 1 · The brief, before any code|## 2 · Direction — `impeccable`|## 3 · Interaction and motion — `emil-design-eng`|## 4 · Audit — `web-design-guidelines`|## 5 · Self-review against the brief|'
|
|
117
|
+
has "page-design: no live mode in an unattended run" "$(cat "$pd")" "Never its live mode in an unattended run."
|
|
118
|
+
has "page-design: reads CCKIT_HEADLESS, which autopilot run exports" "$(cat "$pd")" "CCKIT_HEADLESS"
|
|
119
|
+
has "autopilot run exports CCKIT_HEADLESS" "$(cat "$ROOT/scripts/autopilot-run.sh")" "export CCKIT_HEADLESS=1"
|
|
120
|
+
has "page-design: an audit with no network is not run" "$(cat "$pd")" "audit: not run (the rules could not be"
|
|
121
|
+
has "page-design: and is never reported as passed" "$(cat "$pd")" "Never write that the audit passed"
|
|
122
|
+
has "page-design: the brief names what the page refuses to look like" "$(cat "$pd")" "Refuses to look like"
|
|
123
|
+
has "page-design: the brief asks for ONE visual idea" "$(cat "$pd")" "The one visual idea"
|
|
124
|
+
has "page-design: the design file path is the one task run names" "$(cat "$pd")" 'docs/design/<task-id>.md'
|
|
125
|
+
has "task run names the same design file path" "$(cat "$ROOT/scripts/lib/light-task.sh")" "printf 'docs/design/%s.md'"
|
|
126
|
+
for sec in Direction Motion Audit; do
|
|
127
|
+
has "page-design: minimum rules have a section for $sec" "$(cat "$pdr/minimum-rules.md")" "## $sec — when"
|
|
128
|
+
done
|
|
129
|
+
# The skill holds none of the third-party text: it is not vendored under templates/.
|
|
130
|
+
t "no third-party design skill is vendored" "$(ls -d "$ROOT/templates/skills/impeccable" "$ROOT/templates/skills/emil-design-eng" "$ROOT/templates/skills/web-design-guidelines" 2>/dev/null | grep -c . || true)" "0"
|
|
131
|
+
|
|
132
|
+
# Every kind the skills tell the agent to pass is a kind `--kind` accepts.
|
|
133
|
+
# shellcheck source=/dev/null
|
|
134
|
+
. "$ROOT/scripts/lib/kinds.sh"
|
|
135
|
+
for k in post campaign brand research; do
|
|
136
|
+
kit_kind_label_valid "$k"; t "kind $k is accepted" "$?" "0"
|
|
137
|
+
done
|
|
138
|
+
# the designer agent lists page-design, in its skills and in its routing table
|
|
139
|
+
dg="$ROOT/templates/agents/designer.md"
|
|
140
|
+
t "designer: page-design is in the skills frontmatter" "$(sed -n '1,/^---$/{/^---$/!p;}' "$dg" | sed -n '2,$p' | grep -c '^ - page-design$')" "1"
|
|
141
|
+
has "designer: the routing table sends a page to page-design" "$(cat "$dg")" '| Build or change a page | `page-design`'
|
|
142
|
+
|
|
143
|
+
[ "$fail" -eq 0 ] && echo "ALL OK (content skills)" || echo "content skills: FAILURES"
|
|
144
|
+
exit "$fail"
|
|
@@ -129,6 +129,31 @@ ok "$w101" "0" "plan: #101 root in wave 0"
|
|
|
129
129
|
ok "$w103" "0" "plan: #103 root in wave 0"
|
|
130
130
|
ok "$w102" "1" "plan: #102 dependent in wave 1"
|
|
131
131
|
|
|
132
|
+
echo "== wave brief: one set of wave data, dispatch wording per adapter (E257.6) =="
|
|
133
|
+
W_CL="$(CCKIT_OUTPUT=human cckit wave --adapter claude 2>&1)"
|
|
134
|
+
W_CX="$(CCKIT_OUTPUT=human cckit wave --adapter codex 2>&1)"
|
|
135
|
+
W_BOTH="$(CCKIT_OUTPUT=human cckit wave --adapter both 2>&1)"
|
|
136
|
+
has "$W_CL" "spawn 2 parallel Task subagent(s)" "wave(claude): dispatches Task subagents"
|
|
137
|
+
no "$W_CL" "cckit orchestrate --agent codex" "wave(claude): no Codex launch line"
|
|
138
|
+
has "$W_CX" "cckit orchestrate --agent codex --detach 101 103" "wave(codex): cckit launches the wave-0 worktrees"
|
|
139
|
+
has "$W_CX" "cckit orchestrate --results" "wave(codex): results are collected by cckit"
|
|
140
|
+
no "$W_CX" "Task" "wave(codex): no Claude Task wording"
|
|
141
|
+
no "$W_CX" "/loop" "wave(codex): no Claude /loop command"
|
|
142
|
+
no "$W_CX" "#102" "wave(codex): the blocked dependent is not in wave 0"
|
|
143
|
+
has "$W_BOTH" "### Claude Code" "wave(both): carries the Claude dispatch"
|
|
144
|
+
has "$W_BOTH" "### Codex" "wave(both): carries the Codex dispatch"
|
|
145
|
+
# Everything that is not dispatch wording is identical: same issues, same prompts, same drive.
|
|
146
|
+
# (From the first per-issue heading on; the one line that differs is the Claude-only `/loop` hint.)
|
|
147
|
+
wave_data() { printf '%s\n' "$1" | sed -n '/^### #/,$p' | grep -v 'cckit watch --loop'; }
|
|
148
|
+
ok "$(wave_data "$W_CX")" "$(wave_data "$W_CL")" "wave: issue prompts + captain drive match across adapters"
|
|
149
|
+
has "$(wave_data "$W_CL")" "### #103" "wave: the compared wave data is not empty"
|
|
150
|
+
L_CL="$(cckit wave --adapter claude --llm 2>/dev/null)"
|
|
151
|
+
L_CX="$(cckit wave --adapter codex --llm 2>/dev/null)"
|
|
152
|
+
ok "$L_CX" "$L_CL" "wave --llm: byte-identical wave data for both adapters"
|
|
153
|
+
has "$L_CL" "101" "wave --llm: carries wave-0 issue #101"
|
|
154
|
+
no "$L_CL" "Task subagent" "wave --llm: the prompt names no runtime"
|
|
155
|
+
cckit wave --adapter cursor >/dev/null 2>&1; ok "$?" "2" "wave: an unknown adapter is refused"
|
|
156
|
+
|
|
132
157
|
echo "== next: surfaces the unblocked set + the top issue's start command =="
|
|
133
158
|
NEXT="$(CCKIT_OUTPUT=human cckit next 2>&1)"
|
|
134
159
|
has "$NEXT" "#101" "next: lists unblocked #101"
|