@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.
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +169 -21
- package/README.md +505 -35
- package/SECURITY.md +5 -0
- package/bin/cckit +189 -20
- 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/guard-raw-git-ops-test.sh +8 -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 +188 -35
- package/scripts/lib/effort-ops-test.sh +217 -7
- package/scripts/lib/effort-ops.sh +281 -49
- 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-slug.sh +16 -2
- package/scripts/lib/effort.sh +67 -12
- package/scripts/lib/errors-header-test.sh +1 -1
- package/scripts/lib/gh-project-test.sh +35 -1
- package/scripts/lib/gh-project.sh +37 -16
- package/scripts/lib/gh-rest-test.sh +330 -0
- package/scripts/lib/gh-rest.sh +304 -0
- 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 +244 -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 +362 -89
- package/scripts/lib/kto-hotfix-test.sh +232 -0
- package/scripts/lib/kto-task-close-test.sh +83 -0
- package/scripts/lib/kto-task-new-test.sh +95 -0
- package/scripts/lib/kto-task-pr-merge-test.sh +97 -6
- 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/test-env-test.sh +3 -3
- package/scripts/lib/test-env.sh +7 -4
- 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 +93 -9
- package/scripts/lib/worktree-ports-test.sh +57 -4
- package/scripts/lib/worktree-start-test.sh +197 -0
- package/scripts/lib/worktree-start.sh +169 -32
- 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 +27 -14
- 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,157 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# integrations-check.sh — run every integration descriptor's recipe for real and say which step
|
|
3
|
+
# broke (E303.8). A descriptor hardcodes upstream facts: a package name, an installer's flags, a
|
|
4
|
+
# binary's name. Nothing in the gate notices when one drifts, because the gate never installs
|
|
5
|
+
# anything. This script does, and .github/workflows/integrations-check.yml runs it every month on
|
|
6
|
+
# a clean runner.
|
|
7
|
+
#
|
|
8
|
+
# It holds no recipe of its own. Every command comes from the descriptor and runs through the
|
|
9
|
+
# shared runner (scripts/lib/integration-install.sh), so what is checked is what `cckit doctor`
|
|
10
|
+
# would run.
|
|
11
|
+
#
|
|
12
|
+
# Steps per descriptor, in order; the first that fails ends that descriptor:
|
|
13
|
+
# validate the descriptor matches integrations/integration.schema.json
|
|
14
|
+
# platform `appliesWhen.platform` matches this machine — a mismatch is a skip, not a failure.
|
|
15
|
+
# `appliesWhen.anyExtension` is satisfied on purpose: the scratch repo is seeded with
|
|
16
|
+
# one file of the first listed extension, because the recipe is under test, not a repo
|
|
17
|
+
# install integration_install, with consent recorded in the scratch repo only. A tool already
|
|
18
|
+
# on the machine is reported and its install recipe is NOT exercised
|
|
19
|
+
# detect `detect.run` exits 0 afterwards
|
|
20
|
+
# verify `verify.run` exits 0
|
|
21
|
+
# wire integration_wire in the scratch repo, when the descriptor has a wire step
|
|
22
|
+
#
|
|
23
|
+
# Not exercised: install candidates after the one that worked (the runner stops at the first), a
|
|
24
|
+
# `bootstrap` on a machine that already holds one of the managers, `uninstall`, and `build.deep`.
|
|
25
|
+
#
|
|
26
|
+
# Usage: integrations-check.sh [--yes] [id|file ...]
|
|
27
|
+
# no ids every descriptor in integrations/ ($KIT_INTEGRATIONS_DIR overrides)
|
|
28
|
+
# --yes install for real. Without it nothing runs: each descriptor is validated and its plan
|
|
29
|
+
# is printed. Meant for a throwaway machine — it installs tools on the machine it runs on.
|
|
30
|
+
# Output: one `ok|skip|FAIL <id>: <step>: <detail>` line per step on stdout, runner progress on
|
|
31
|
+
# stderr, then a one-line count.
|
|
32
|
+
# Requires: jq, git.
|
|
33
|
+
# errors: strict — rc 1 when any descriptor fails a step, rc 2 on a usage error; rc 0 otherwise,
|
|
34
|
+
# including the plan-only run without --yes
|
|
35
|
+
|
|
36
|
+
set -u
|
|
37
|
+
_ic_dir="$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
38
|
+
# shellcheck source=/dev/null
|
|
39
|
+
. "$_ic_dir/lib/integration-install.sh" # integration_install, integration_wire, integrations.sh
|
|
40
|
+
|
|
41
|
+
_ic_usage() { kit_warn "usage: integrations-check.sh [--yes] [id|file ...]"; }
|
|
42
|
+
|
|
43
|
+
ic_yes=0
|
|
44
|
+
ic_args=""
|
|
45
|
+
while [ $# -gt 0 ]; do
|
|
46
|
+
case "$1" in
|
|
47
|
+
--yes) ic_yes=1 ;;
|
|
48
|
+
-h|--help) _ic_usage; exit 0 ;;
|
|
49
|
+
-*) _ic_usage; exit 2 ;;
|
|
50
|
+
*) ic_args="$ic_args $1" ;;
|
|
51
|
+
esac
|
|
52
|
+
shift
|
|
53
|
+
done
|
|
54
|
+
|
|
55
|
+
command -v jq >/dev/null 2>&1 || kit_die "integrations-check: jq is required"
|
|
56
|
+
|
|
57
|
+
# Consent for this run goes into the scratch repo and nowhere else: an inherited KIT_STATE_DIR
|
|
58
|
+
# would point the consent file at a real project.
|
|
59
|
+
unset KIT_STATE_DIR
|
|
60
|
+
[ "$ic_yes" -eq 1 ] && unset KIT_DRY_RUN
|
|
61
|
+
|
|
62
|
+
ic_tmp="$(mktemp -d)" || kit_die "integrations-check: cannot create a scratch dir"
|
|
63
|
+
trap 'rm -rf "$ic_tmp"' EXIT
|
|
64
|
+
ic_tmp="$(cd "$ic_tmp" && pwd -P)"
|
|
65
|
+
|
|
66
|
+
ic_checked=0; ic_failed=0; ic_skipped=0
|
|
67
|
+
|
|
68
|
+
_ic_line() { printf '%-4s %s: %s\n' "$1" "$2" "$3"; }
|
|
69
|
+
_ic_fail() {
|
|
70
|
+
_ic_line FAIL "$1" "$2: $3"
|
|
71
|
+
# The captured output of the failing step, indented, so the issue body carries the evidence.
|
|
72
|
+
if [ -s "${4:-}" ]; then tail -n 20 "$4" | sed 's/^/ /'; fi
|
|
73
|
+
ic_failed=$((ic_failed + 1))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# _ic_scratch <id> <file> -> a fresh git repo for one descriptor, seeded so that an
|
|
77
|
+
# `anyExtension` predicate holds.
|
|
78
|
+
_ic_scratch() {
|
|
79
|
+
local d="$ic_tmp/$1" ext
|
|
80
|
+
mkdir -p "$d" || return 1
|
|
81
|
+
git -C "$d" init -q >/dev/null 2>&1 || true
|
|
82
|
+
ext="$(jq -r '.appliesWhen.anyExtension[0] // ""' "$2" 2>/dev/null)"
|
|
83
|
+
if [ -n "$ext" ]; then : > "$d/seed$ext"; fi
|
|
84
|
+
printf '%s\n' "$d"
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
_ic_one() {
|
|
88
|
+
local f="$1" id d log st cmd
|
|
89
|
+
id="$(basename "$f" .json)"
|
|
90
|
+
log="$ic_tmp/$id.log"
|
|
91
|
+
ic_checked=$((ic_checked + 1))
|
|
92
|
+
|
|
93
|
+
if ! integration_validate "$f" >"$log" 2>&1; then
|
|
94
|
+
_ic_fail "$id" validate "the descriptor does not match the schema" "$log"; return 0
|
|
95
|
+
fi
|
|
96
|
+
_ic_line ok "$id" "validate"
|
|
97
|
+
|
|
98
|
+
d="$(_ic_scratch "$id" "$f")" || { _ic_fail "$id" platform "cannot create a scratch repo"; return 0; }
|
|
99
|
+
if ! integration_applies "$f" "$d"; then
|
|
100
|
+
_ic_line skip "$id" "platform: needs $(integration_applies_needs "$f"); this is $(uname -s) $(uname -m)"
|
|
101
|
+
ic_skipped=$((ic_skipped + 1)); return 0
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
if [ "$ic_yes" -ne 1 ]; then
|
|
105
|
+
KIT_DRY_RUN=1 integration_install_plan "$f" "$d" | sed 's/^/ /'
|
|
106
|
+
_ic_line skip "$id" "install: plan only — pass --yes to run it"
|
|
107
|
+
ic_skipped=$((ic_skipped + 1)); return 0
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
if integration_detect "$f" "$d"; then
|
|
111
|
+
_ic_line skip "$id" "install: already on this machine, so the install recipe was not exercised"
|
|
112
|
+
else
|
|
113
|
+
integration_consent_record "$id" "$d" || { _ic_fail "$id" install "cannot record consent in $d"; return 0; }
|
|
114
|
+
st="$(integration_install "$f" "$d" 2>"$log")" || { _ic_fail "$id" install "no candidate installed the tool" "$log"; return 0; }
|
|
115
|
+
case "$st" in
|
|
116
|
+
installed*) _ic_line ok "$id" "install: ${st#installed } — $(jq -r --arg m "${st#installed }" '[.install[] | select(.manager == $m)][0].run' "$f")" ;;
|
|
117
|
+
*) _ic_fail "$id" install "the runner answered '$st' instead of installing" "$log"; return 0 ;;
|
|
118
|
+
esac
|
|
119
|
+
if ! integration_detect "$f" "$d"; then
|
|
120
|
+
_ic_fail "$id" detect "'$(jq -r '.detect.run' "$f")' fails after a successful install"; return 0
|
|
121
|
+
fi
|
|
122
|
+
fi
|
|
123
|
+
_ic_line ok "$id" "detect: $(jq -r '.detect.run' "$f")"
|
|
124
|
+
|
|
125
|
+
cmd="$(jq -r '.verify.run // ""' "$f")"
|
|
126
|
+
if [ -n "$cmd" ]; then
|
|
127
|
+
if ! _kit_ii_sh "$d" "$cmd" >"$log" 2>&1; then
|
|
128
|
+
_ic_fail "$id" verify "'$cmd' exited non-zero" "$log"; return 0
|
|
129
|
+
fi
|
|
130
|
+
_ic_line ok "$id" "verify: $cmd"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
if cmd="$(integration_wire_command "$f")"; then
|
|
134
|
+
integration_consent_record "$id" "$d" || { _ic_fail "$id" wire "cannot record consent in $d"; return 0; }
|
|
135
|
+
st="$(integration_wire "$f" "$d" 2>"$log")" || st="failed"
|
|
136
|
+
if [ "$st" != "wired" ]; then
|
|
137
|
+
_ic_fail "$id" wire "'$cmd' did not complete (runner answered '$st')" "$log"; return 0
|
|
138
|
+
fi
|
|
139
|
+
_ic_line ok "$id" "wire: $cmd"
|
|
140
|
+
fi
|
|
141
|
+
return 0
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if [ -z "$ic_args" ]; then ic_args="$(integrations_list)"; fi
|
|
145
|
+
for ic_a in $ic_args; do
|
|
146
|
+
if [ -f "$ic_a" ]; then ic_f="$ic_a"
|
|
147
|
+
elif ic_f="$(integration_file "$ic_a")"; then :
|
|
148
|
+
else
|
|
149
|
+
ic_checked=$((ic_checked + 1))
|
|
150
|
+
_ic_fail "$ic_a" validate "no descriptor with that id in $(integrations_dir)"
|
|
151
|
+
continue
|
|
152
|
+
fi
|
|
153
|
+
_ic_one "$ic_f"
|
|
154
|
+
done
|
|
155
|
+
|
|
156
|
+
printf 'integrations-check: %s checked, %s failed, %s skipped\n' "$ic_checked" "$ic_failed" "$ic_skipped"
|
|
157
|
+
[ "$ic_failed" -eq 0 ]
|
package/scripts/kit-add-test.sh
CHANGED
|
@@ -47,6 +47,220 @@ if [ -n "${KIT_ADD_TEST_INNER:-}" ]; then
|
|
|
47
47
|
t "dry-run no write" "$([ -f "$fresh/app/.claude/kit.config.json" ] && echo wrote || echo clean)" "clean"
|
|
48
48
|
rm -rf "$fresh"
|
|
49
49
|
|
|
50
|
+
# ── integrations (E303.2): the same entry lists descriptors and switches one on ────────────
|
|
51
|
+
has() { if grep -qF -- "$3" <<<"$2"; then echo "ok($KIT_ADD_TEST_INNER): $1"; else echo "FAIL($KIT_ADD_TEST_INNER): $1 -> '$3' not in: $2"; fail=1; fi; }
|
|
52
|
+
CCKIT="$dir/../bin/cckit"
|
|
53
|
+
reg="$ws/integrations"; mkdir -p "$reg"
|
|
54
|
+
cp "$dir/../integrations/integration.schema.json" "$reg/"
|
|
55
|
+
# desc <id> <config json> <appliesWhen json|null> -> a valid fixture descriptor
|
|
56
|
+
desc() {
|
|
57
|
+
jq -n --arg id "$1" --argjson c "$2" --argjson a "$3" '
|
|
58
|
+
{ id: $id, label: ("Fixture " + $id), summary: ("Summary of " + $id + "."), config: $c,
|
|
59
|
+
detect: {run: "true"}, install: [{manager: "npm", run: "npm install -g x"}],
|
|
60
|
+
verify: {run: "true"}, docs: "https://example.invalid/docs",
|
|
61
|
+
attribution: {author: "Example Org", homepage: "https://example.invalid", affiliated: false,
|
|
62
|
+
notice: "cckit is not affiliated with Example Org."} }
|
|
63
|
+
+ (if $a == null then {} else {appliesWhen: $a} end)' > "$reg/$1.json"
|
|
64
|
+
}
|
|
65
|
+
desc alpha '{"key":"codeGraph.provider","value":"alpha-graph"}' '{"anyExtension":[".ts"]}'
|
|
66
|
+
desc beta '{"key":"memory.enabled"}' null
|
|
67
|
+
export KIT_INTEGRATIONS_DIR="$reg"
|
|
68
|
+
|
|
69
|
+
# no argument: every descriptor is listed, rc 0 — through the dispatcher, not only the script
|
|
70
|
+
out="$(cd "$ws" && "$CCKIT" add 2>/dev/null)"; t "cckit add (no arg) rc" "$?" "0"
|
|
71
|
+
has "list names alpha" "$out" "alpha"
|
|
72
|
+
has "list names beta" "$out" "beta"
|
|
73
|
+
has "list carries summary" "$out" "Summary of beta."
|
|
74
|
+
has "list names the module" "$out" "software"
|
|
75
|
+
t "list --llm ids" "$(cd "$ws" && "$CCKIT" add --llm 2>/dev/null | jq -c '[.integrations[].id]')" '["alpha","beta"]'
|
|
76
|
+
t "list --llm modules" "$(cd "$ws" && "$CCKIT" add --llm 2>/dev/null | jq -c '[.modules[].id] | index("software") != null')" 'true'
|
|
77
|
+
# an empty registry is an answer, not an error
|
|
78
|
+
emp="$ws/empty-reg"; mkdir -p "$emp"
|
|
79
|
+
out="$(KIT_INTEGRATIONS_DIR="$emp" "$ADD" 2>/dev/null)"; t "empty registry rc" "$?" "0"
|
|
80
|
+
has "empty registry says so" "$out" "none described yet"
|
|
81
|
+
|
|
82
|
+
# the module path still works through the dispatcher
|
|
83
|
+
mkdir -p "$ws/viacli"
|
|
84
|
+
( cd "$ws/viacli" && "$CCKIT" add software --set versioning=github >/dev/null 2>&1 ); t "cckit add software rc" "$?" "0"
|
|
85
|
+
t "cckit add software wrote the island" "$(jq -r .github.projectsV2 "$ws/viacli/.claude/kit.config.json" 2>/dev/null)" "true"
|
|
86
|
+
|
|
87
|
+
# a real add changes ONLY that integration's key
|
|
88
|
+
proj="$ws/proj"; mkdir -p "$proj/.claude" "$proj/src"; : > "$proj/src/a.ts"
|
|
89
|
+
printf '%s\n' '{"project":{"name":"p"},"github":{"repo":"o/r","projectsV2":false},"memory":{"enabled":false}}' > "$proj/.claude/kit.config.json"
|
|
90
|
+
pcfg="$proj/.claude/kit.config.json"; before="$(jq -S . "$pcfg")"
|
|
91
|
+
# dry-run first: nothing is written
|
|
92
|
+
raw_before="$(cat "$pcfg")"
|
|
93
|
+
KIT_DRY_RUN=1 "$ADD" alpha --dir "$proj" >/dev/null 2>&1; t "integration dry-run rc" "$?" "0"
|
|
94
|
+
t "integration dry-run writes nothing" "$(cat "$pcfg")" "$raw_before"
|
|
95
|
+
t "dry-run leaves no temp file" "$(ls -A "$proj/.claude" | tr '\n' ' ')" "kit.config.json "
|
|
96
|
+
# declining writes nothing
|
|
97
|
+
"$ADD" alpha --dir "$proj" --set enable=no >/dev/null 2>&1; t "decline rc" "$?" "0"
|
|
98
|
+
t "decline writes nothing" "$(cat "$pcfg")" "$raw_before"
|
|
99
|
+
"$ADD" alpha --dir "$proj" >/dev/null 2>&1; t "integration add rc" "$?" "0"
|
|
100
|
+
t "key is set" "$(jq -r .codeGraph.provider "$pcfg")" "alpha-graph"
|
|
101
|
+
t "every other key kept" "$(jq -S 'del(.codeGraph)' "$pcfg")" "$before"
|
|
102
|
+
t "only one key added" "$(jq -c '.codeGraph' "$pcfg")" '{"provider":"alpha-graph"}'
|
|
103
|
+
t "no temp file left" "$(ls -A "$proj/.claude" | tr '\n' ' ')" "kit.config.json "
|
|
104
|
+
# idempotent: a second run leaves the file byte-identical
|
|
105
|
+
again="$(cat "$pcfg")"
|
|
106
|
+
"$ADD" alpha --dir "$proj" >/dev/null 2>&1; t "second add rc" "$?" "0"
|
|
107
|
+
t "second add is a no-op" "$(cat "$pcfg")" "$again"
|
|
108
|
+
# a descriptor with no config.value sets boolean true, and touches only its own key
|
|
109
|
+
mid="$(jq -S . "$pcfg")"
|
|
110
|
+
"$ADD" beta --dir "$proj" >/dev/null 2>&1
|
|
111
|
+
t "boolean key set to true" "$(jq -c .memory.enabled "$pcfg")" "true"
|
|
112
|
+
t "beta changed only memory.enabled" "$(jq -S '.memory.enabled = false' "$pcfg")" "$mid"
|
|
113
|
+
# the self-host layout: a root cckit.config.json is the config kit_config_path resolves
|
|
114
|
+
selfp="$ws/selfhost"; mkdir -p "$selfp"; printf '%s\n' '{"kitVersion":"1.0.0"}' > "$selfp/cckit.config.json"
|
|
115
|
+
"$ADD" beta --dir "$selfp" >/dev/null 2>&1
|
|
116
|
+
t "self-host config gets the key" "$(jq -c . "$selfp/cckit.config.json")" '{"kitVersion":"1.0.0","memory":{"enabled":true}}'
|
|
117
|
+
t "self-host: no .claude config invented" "$([ -e "$selfp/.claude/kit.config.json" ] && echo made || echo none)" "none"
|
|
118
|
+
|
|
119
|
+
# a repo the tool cannot work on: declined, rc 0, nothing written
|
|
120
|
+
shp="$ws/shonly"; mkdir -p "$shp/.claude"; : > "$shp/run.sh"
|
|
121
|
+
printf '%s\n' '{"project":{"name":"s"}}' > "$shp/.claude/kit.config.json"
|
|
122
|
+
out="$("$ADD" alpha --dir "$shp" 2>&1)"; t "not-applicable rc" "$?" "0"
|
|
123
|
+
has "not-applicable says why" "$out" ".ts"
|
|
124
|
+
t "not-applicable writes nothing" "$(jq -c . "$shp/.claude/kit.config.json")" '{"project":{"name":"s"}}'
|
|
125
|
+
|
|
126
|
+
# no project config: refused, and none is invented
|
|
127
|
+
bare="$ws/bare"; mkdir -p "$bare"
|
|
128
|
+
out="$(KIT_CONFIG="" "$ADD" beta --dir "$bare" 2>&1)"; t "no config rc" "$?" "1"
|
|
129
|
+
has "no config names the fix" "$out" "cckit init"
|
|
130
|
+
t "no config invented" "$([ -e "$bare/.claude" ] && echo made || echo none)" "none"
|
|
131
|
+
|
|
132
|
+
# an invalid descriptor is refused before any write
|
|
133
|
+
jq 'del(.verify)' "$reg/beta.json" > "$reg/gamma.json"
|
|
134
|
+
out="$("$ADD" gamma --dir "$proj" 2>&1)"; t "invalid descriptor rc" "$?" "1"
|
|
135
|
+
has "invalid descriptor names the field" "$out" "verify"
|
|
136
|
+
rm -f "$reg/gamma.json"
|
|
137
|
+
|
|
138
|
+
# ── a descriptor that ships a rule (E303.10): the shipped Graft descriptor, with detect forced
|
|
139
|
+
# to fail so the plan is the same on a machine that has graft and one that does not ───────────
|
|
140
|
+
jq '.detect.run = "false"' "$dir/../integrations/graft.json" > "$reg/graft.json"
|
|
141
|
+
# a repo of only .sh files: declined, rc 0, nothing written and nothing installed
|
|
142
|
+
shg="$ws/sh-graft"; mkdir -p "$shg/.claude" "$shg/scripts"; : > "$shg/scripts/run.sh"
|
|
143
|
+
printf '%s\n' '{"project":{"name":"s"}}' > "$shg/.claude/kit.config.json"
|
|
144
|
+
out="$("$ADD" graft --dir "$shg" 2>&1)"; t "graft on a .sh-only repo rc" "$?" "0"
|
|
145
|
+
has "graft on a .sh-only repo: not offered" "$out" "not offered here"
|
|
146
|
+
t "graft on a .sh-only repo: config untouched" "$(jq -c . "$shg/.claude/kit.config.json")" '{"project":{"name":"s"}}'
|
|
147
|
+
t "graft on a .sh-only repo: no rule, no consent, nothing else" "$(cd "$shg" && find . -type f | sort | tr '\n' ' ')" "./.claude/kit.config.json ./scripts/run.sh "
|
|
148
|
+
# a repo with a .ts file, dry-run: the install + wire plan is printed and nothing is written
|
|
149
|
+
tsg="$ws/ts-graft"; mkdir -p "$tsg/.claude" "$tsg/src"; : > "$tsg/src/a.ts"
|
|
150
|
+
printf '%s\n' '{"project":{"name":"t"}}' > "$tsg/.claude/kit.config.json"
|
|
151
|
+
out="$(KIT_DRY_RUN=1 "$ADD" graft --dir "$tsg" 2>&1)"; t "graft dry-run rc" "$?" "0"
|
|
152
|
+
has "graft dry-run: npm is candidate 1" "$out" "1. npm install -g @nanonets/graft"
|
|
153
|
+
has "graft dry-run: pnpm is candidate 2" "$out" "2. pnpm add -g @nanonets/graft"
|
|
154
|
+
has "graft dry-run: the wire command" "$out" "graft init --agents claude --no-statusline --no-global"
|
|
155
|
+
has "graft dry-run: names the rule it would write" "$out" "would write $tsg/.claude/rules/code-retrieval.md"
|
|
156
|
+
t "graft dry-run: nothing written" "$(cd "$tsg" && find . -type f | sort | tr '\n' ' ')" "./.claude/kit.config.json ./src/a.ts "
|
|
157
|
+
# declining writes no rule
|
|
158
|
+
"$ADD" graft --dir "$tsg" --set enable=no >/dev/null 2>&1
|
|
159
|
+
t "graft declined: no rule" "$([ -e "$tsg/.claude/rules/code-retrieval.md" ] && echo made || echo none)" "none"
|
|
160
|
+
# a real add: the key and the rule, and still no install
|
|
161
|
+
out="$("$ADD" graft --dir "$tsg" 2>&1)"; t "graft add rc" "$?" "0"
|
|
162
|
+
t "graft add: the key" "$(jq -r .codeGraph.provider "$tsg/.claude/kit.config.json")" "graft"
|
|
163
|
+
t "graft add: the rule is the template, verbatim" "$(cmp -s "$dir/../templates/rules/code-retrieval.md" "$tsg/.claude/rules/code-retrieval.md" && echo same || echo differs)" "same"
|
|
164
|
+
t "graft add: writes the config and the rule, nothing else" "$(cd "$tsg" && find . -type f | sort | tr '\n' ' ')" "./.claude/kit.config.json ./.claude/rules/code-retrieval.md ./src/a.ts "
|
|
165
|
+
has "graft add: says nothing was installed" "$out" "Nothing was installed."
|
|
166
|
+
# a second run keeps an edited rule, and restores a deleted one
|
|
167
|
+
echo "# local edit" >> "$tsg/.claude/rules/code-retrieval.md"
|
|
168
|
+
"$ADD" graft --dir "$tsg" >/dev/null 2>&1
|
|
169
|
+
t "second add keeps an edited rule" "$(tail -1 "$tsg/.claude/rules/code-retrieval.md")" "# local edit"
|
|
170
|
+
rm -f "$tsg/.claude/rules/code-retrieval.md"
|
|
171
|
+
"$ADD" graft --dir "$tsg" >/dev/null 2>&1
|
|
172
|
+
t "second add restores a missing rule" "$([ -f "$tsg/.claude/rules/code-retrieval.md" ] && echo yes || echo no)" "yes"
|
|
173
|
+
rm -f "$reg/graft.json"
|
|
174
|
+
|
|
175
|
+
# --- on by default (#451): the shipped lavish descriptor. Declining is the one case that
|
|
176
|
+
# writes — the off value — and it writes no rule; switching it back on restores the default.
|
|
177
|
+
cp "$dir/../integrations/lavish.json" "$reg/lavish.json"
|
|
178
|
+
lv="$ws/lavish-proj"; mkdir -p "$lv/.claude"
|
|
179
|
+
printf '{"project":{"name":"l"}}\n' > "$lv/.claude/kit.config.json"
|
|
180
|
+
t "lavish: listed as enabled with no key in the config" \
|
|
181
|
+
"$( (cd "$lv" && CCKIT_OUTPUT=json "$ADD" 2>/dev/null) | jq -c '.integrations[] | select(.id == "lavish") | [.key, .enabled]')" '["reviewPages.enabled",true]'
|
|
182
|
+
out="$(KIT_DRY_RUN=1 "$ADD" lavish --dir "$lv" --set enable=no 2>&1)"; t "lavish off dry-run rc" "$?" "0"
|
|
183
|
+
t "lavish off dry-run: nothing written" "$(jq -c . "$lv/.claude/kit.config.json")" '{"project":{"name":"l"}}'
|
|
184
|
+
t "lavish off dry-run: no rule is announced" "$(printf '%s' "$out" | grep -c 'review-pages.md')" "0"
|
|
185
|
+
out="$("$ADD" lavish --dir "$lv" --set enable=no 2>&1)"; t "lavish off rc" "$?" "0"
|
|
186
|
+
t "lavish off: the config records false" "$(jq -c .reviewPages "$lv/.claude/kit.config.json")" '{"enabled":false}'
|
|
187
|
+
has "lavish off: says it is off and how to turn it on" "$out" "Lavish is off: reviewPages.enabled = false. Turn it back on with 'cckit add lavish'."
|
|
188
|
+
t "lavish off: no rule written" "$([ -e "$lv/.claude/rules/review-pages.md" ] && echo made || echo none)" "none"
|
|
189
|
+
t "lavish off: listed as not enabled" \
|
|
190
|
+
"$( (cd "$lv" && CCKIT_OUTPUT=json "$ADD" 2>/dev/null) | jq -c '.integrations[] | select(.id == "lavish") | .enabled')" 'false'
|
|
191
|
+
out="$("$ADD" lavish --dir "$lv" 2>&1)"; t "lavish on rc" "$?" "0"
|
|
192
|
+
t "lavish on: the config records true" "$(jq -c .reviewPages "$lv/.claude/kit.config.json")" '{"enabled":true}'
|
|
193
|
+
t "lavish on: the rule is the template, verbatim" "$(cmp -s "$dir/../templates/rules/review-pages.md" "$lv/.claude/rules/review-pages.md" && echo same || echo differs)" "same"
|
|
194
|
+
has "lavish on: the attribution notice" "$out" "cckit is not affiliated with its author"
|
|
195
|
+
rm -f "$reg/lavish.json"
|
|
196
|
+
|
|
197
|
+
# a module wins a name it shares with an integration
|
|
198
|
+
desc software '{"key":"codeGraph.provider","value":"clash"}' null
|
|
199
|
+
mkdir -p "$ws/clash"
|
|
200
|
+
"$ADD" software --dir "$ws/clash" >/dev/null 2>&1
|
|
201
|
+
t "module wins a shared name" "$(jq -c .modules "$ws/clash/.claude/kit.config.json" 2>/dev/null)" '["software"]'
|
|
202
|
+
rm -f "$reg/software.json"
|
|
203
|
+
unset KIT_INTEGRATIONS_DIR
|
|
204
|
+
|
|
205
|
+
# --- qa module (#294): `kit-add.sh qa --answers F` writes the qa block; a 2nd run is a no-op ---
|
|
206
|
+
printf '%s\n' '{"command":"pnpm dev:stack","ports":"WEB_PORT=3000, API_PORT=4000","readiness":"WEB_PORT=/, API_PORT=/health","route":"/dashboard","credentialEnv":"QA_EMAIL, QA_PASSWORD"}' > "$ws/qa.json"
|
|
207
|
+
"$ADD" qa --dir "$ws/myapp" --answers "$ws/qa.json" >/dev/null 2>&1; t "qa add rc" "$?" "0"
|
|
208
|
+
t "qa block" "$(jq -c .qa "$cfg")" '{"command":"pnpm dev:stack","ports":[{"env":"WEB_PORT","base":3000},{"env":"API_PORT","base":4000}],"readiness":[{"env":"WEB_PORT","path":"/"},{"env":"API_PORT","path":"/health"}],"route":"/dashboard","credentialEnv":["QA_EMAIL","QA_PASSWORD"]}'
|
|
209
|
+
t "qa stacks on software" "$(jq -c .modules "$cfg")" '["qa","software"]'
|
|
210
|
+
t "qa keeps software answers" "$(jq -r .deploy.target "$cfg")" "vercel"
|
|
211
|
+
before="$(cat "$cfg")"
|
|
212
|
+
"$ADD" qa --dir "$ws/myapp" --answers "$ws/qa.json" >/dev/null 2>&1; t "qa 2nd run rc" "$?" "0"
|
|
213
|
+
t "qa 2nd run no-op" "$(cat "$cfg")" "$before"
|
|
214
|
+
# a credential VALUE never reaches the config: the add fails and the file is untouched
|
|
215
|
+
printf '%s\n' '{"command":"pnpm dev:stack","credentialEnv":"QA_PASSWORD=hunter2-value"}' > "$ws/qa-leak.json"
|
|
216
|
+
"$ADD" qa --dir "$ws/myapp" --answers "$ws/qa-leak.json" >/dev/null 2>&1; t "qa value refused rc" "$?" "1"
|
|
217
|
+
t "qa value refused: file untouched" "$(cat "$cfg")" "$before"
|
|
218
|
+
# no stack command, no qa block (KIT_ASSUME_YES has no default to fall back on)
|
|
219
|
+
bare="$(mktemp -d)"; mkdir -p "$bare/app"
|
|
220
|
+
"$ADD" qa --dir "$bare/app" >/dev/null 2>&1; t "qa without a command rc" "$?" "1"
|
|
221
|
+
t "qa without a command: no write" "$([ -f "$bare/app/.claude/kit.config.json" ] && echo wrote || echo clean)" "clean"
|
|
222
|
+
# self-host layout: a root cckit.config.json is the config kit-add targets, not a second file.
|
|
223
|
+
# That file pre-exists and is not manifest-tracked, so the conffiles guard applies: an unattended
|
|
224
|
+
# run keeps it, and only an explicit yes on stdin writes.
|
|
225
|
+
printf '%s\n' '{"project":{"name":"Self"}}' > "$bare/app/cckit.config.json"
|
|
226
|
+
"$ADD" qa --dir "$bare/app" --answers "$ws/qa.json" >/dev/null 2>&1; t "qa self-host unattended rc" "$?" "0"
|
|
227
|
+
t "qa self-host unattended: kept" "$(jq -c . "$bare/app/cckit.config.json")" '{"project":{"name":"Self"}}'
|
|
228
|
+
printf 'y\n' | env -u KIT_ASSUME_YES "$ADD" qa --dir "$bare/app" --answers "$ws/qa.json" >/dev/null 2>&1; t "qa self-host confirmed rc" "$?" "0"
|
|
229
|
+
t "qa self-host: root config" "$(jq -r '[.project.name, .qa.command] | join("|")' "$bare/app/cckit.config.json")" "Self|pnpm dev:stack"
|
|
230
|
+
t "qa self-host: no scaffolded twin" "$([ -f "$bare/app/.claude/kit.config.json" ] && echo wrote || echo clean)" "clean"
|
|
231
|
+
rm -rf "$bare"
|
|
232
|
+
|
|
233
|
+
# ── a kit skill (#504): `add page-design` sets its key and copies the skill, no version bump ──
|
|
234
|
+
unset KIT_INTEGRATIONS_DIR
|
|
235
|
+
sk="$(mktemp -d)"; skc="$sk/.claude/kit.config.json"; mkdir -p "$sk/.claude"
|
|
236
|
+
printf '%s\n' '{"kitVersion":"9.9.9","adapters":["claude","codex"],"tasks":{"default":"light"},"project":{"name":"P"}}' > "$skc"
|
|
237
|
+
has "skill: listed" "$(cd "$sk" && "$ADD" 2>/dev/null)" "page-design"
|
|
238
|
+
t "skill: list --llm before" "$(cd "$sk" && "$CCKIT" add --llm 2>/dev/null | jq -c '.skills[] | select(.id=="page-design") | [.key,.enabled,.installed]')" '["tasks.design",false,false]'
|
|
239
|
+
KIT_DRY_RUN=1 "$ADD" page-design --dir "$sk" >/dev/null 2>&1; t "skill dry-run rc" "$?" "0"
|
|
240
|
+
t "skill dry-run: nothing written" "$(cd "$sk" && find . -type f | LC_ALL=C sort | tr '\n' ' ')|$(jq -r '.tasks.design // "unset"' "$skc")" "./.claude/kit.config.json |unset"
|
|
241
|
+
"$ADD" page-design --dir "$sk" >/dev/null 2>&1; t "skill add rc" "$?" "0"
|
|
242
|
+
t "skill: key set, others kept" "$(jq -c '[.tasks.design, .tasks.default, .kitVersion, .project.name]' "$skc")" '[true,"light","9.9.9","P"]'
|
|
243
|
+
t "skill: copied for each adapter, add.json left behind" "$(cd "$sk" && find .claude/skills .agents/skills -type f | LC_ALL=C sort | tr '\n' ' ')" \
|
|
244
|
+
".agents/skills/page-design/SKILL.md .agents/skills/page-design/references/design-file-template.md .agents/skills/page-design/references/generic-page-patterns.md .agents/skills/page-design/references/minimum-rules.md .claude/skills/page-design/SKILL.md .claude/skills/page-design/references/design-file-template.md .claude/skills/page-design/references/generic-page-patterns.md .claude/skills/page-design/references/minimum-rules.md "
|
|
245
|
+
t "skill: the copy is the template" "$(cmp -s "$sk/.claude/skills/page-design/SKILL.md" "$dir/../templates/skills/page-design/SKILL.md" && echo same)" "same"
|
|
246
|
+
t "skill: list --llm after" "$(cd "$sk" && "$CCKIT" add --llm 2>/dev/null | jq -c '.skills[] | select(.id=="page-design") | [.enabled,.installed]')" '[true,true]'
|
|
247
|
+
# a copy the project edited is kept; a copy missing for one adapter is restored
|
|
248
|
+
echo "edited by the project" > "$sk/.claude/skills/page-design/SKILL.md"; rm -rf "$sk/.agents/skills/page-design"
|
|
249
|
+
snap="$(cat "$skc")"
|
|
250
|
+
"$ADD" page-design --dir "$sk" >/dev/null 2>&1; t "skill re-run rc" "$?" "0"
|
|
251
|
+
t "skill re-run: the edited copy is kept" "$(cat "$sk/.claude/skills/page-design/SKILL.md")" "edited by the project"
|
|
252
|
+
t "skill re-run: the missing adapter copy is written" "$([ -f "$sk/.agents/skills/page-design/SKILL.md" ] && echo yes)" "yes"
|
|
253
|
+
t "skill re-run: config byte-identical" "$(cat "$skc")" "$snap"
|
|
254
|
+
# a claude-only project gets no .agents tree; a folder with no config is refused
|
|
255
|
+
sk2="$(mktemp -d)"; mkdir -p "$sk2/.claude"; printf '%s\n' '{"kitVersion":"9.9.9"}' > "$sk2/.claude/kit.config.json"
|
|
256
|
+
"$ADD" page-design --dir "$sk2" >/dev/null 2>&1
|
|
257
|
+
t "skill: claude-only project" "$([ -f "$sk2/.claude/skills/page-design/SKILL.md" ] && echo yes)|$([ -e "$sk2/.agents" ] && echo agents || echo none)" "yes|none"
|
|
258
|
+
sk3="$(mktemp -d)"
|
|
259
|
+
out="$("$ADD" page-design --dir "$sk3" 2>&1)"; t "skill: no config rc" "$?" "1"
|
|
260
|
+
has "skill: no config names init" "$out" "cckit init"
|
|
261
|
+
t "skill: no config writes nothing" "$(find "$sk3" -type f | wc -l | tr -d ' ')" "0"
|
|
262
|
+
rm -rf "$sk" "$sk2" "$sk3"
|
|
263
|
+
|
|
50
264
|
[ "$fail" -eq 0 ] && echo "ALL OK($KIT_ADD_TEST_INNER)"
|
|
51
265
|
exit "$fail"
|
|
52
266
|
fi
|