@jeiemgi/cckit 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +4 -2
- package/AGENTS.md +22 -238
- package/README.md +66 -56
- package/SECURITY.md +4 -4
- package/bin/PROMPTS.md +12 -0
- package/bin/cckit +181 -140
- package/cckit.config.json +1 -1
- package/kit/PROMPTS.md +14 -0
- package/{commands → kit/commands}/kit-doctor.md +3 -4
- package/{commands → kit/commands}/kit-export-project.md +1 -1
- package/{commands → kit/commands}/kit-init.md +8 -20
- package/{commands → kit/commands}/kit-routines.md +1 -1
- package/{commands → kit/commands}/kit-update.md +3 -3
- package/kit/completions/cckit.bash +9 -0
- package/{databases → kit/databases}/supabase.json +1 -1
- package/{integrations → kit/integrations}/integration.schema.json +3 -3
- package/kit/interview/global.json +54 -0
- package/kit/interview/project.json +133 -0
- package/kit/modules/qa.json +63 -0
- package/kit/modules/software.json +48 -0
- package/{profiles → kit/profiles}/automation.json +1 -3
- package/{profiles → kit/profiles}/content.json +0 -2
- package/{profiles → kit/profiles}/marketing.json +0 -2
- package/{profiles → kit/profiles}/minimal.json +1 -3
- package/{profiles → kit/profiles}/research.json +1 -3
- package/{profiles → kit/profiles}/software.json +0 -2
- package/kit/routines/catalogue.json +84 -0
- package/{skills → kit/skills}/kit-add/SKILL.md +4 -4
- package/kit/skills/kit-advisor/SKILL.md +75 -0
- package/kit/skills/kit-advisor/references/close.md +53 -0
- package/kit/skills/kit-advisor/references/grill.md +69 -0
- package/kit/skills/kit-advisor/references/orchestrate.md +56 -0
- package/kit/skills/kit-advisor/references/plan.md +64 -0
- package/kit/skills/kit-advisor/references/review.md +47 -0
- package/kit/skills/kit-advisor/references/step-report.md +61 -0
- package/{skills → kit/skills}/kit-annotate/SKILL.md +2 -4
- package/{skills → kit/skills}/kit-autopilot/SKILL.md +7 -7
- package/{skills → kit/skills}/kit-cleanup/SKILL.md +4 -4
- package/{skills → kit/skills}/kit-contribute/SKILL.md +8 -12
- package/{skills → kit/skills}/kit-customize/SKILL.md +5 -8
- package/{skills → kit/skills}/kit-dev/SKILL.md +1 -1
- package/{skills → kit/skills}/kit-digest/SKILL.md +3 -3
- package/{skills → kit/skills}/kit-effort-close/SKILL.md +20 -12
- package/{skills → kit/skills}/kit-effort-new/SKILL.md +17 -14
- package/{skills → kit/skills}/kit-effort-pr/SKILL.md +7 -7
- package/{skills → kit/skills}/kit-effort-start/SKILL.md +3 -3
- package/{skills → kit/skills}/kit-gc/SKILL.md +3 -3
- package/{skills → kit/skills}/kit-next/SKILL.md +7 -7
- package/{skills → kit/skills}/kit-page/SKILL.md +1 -1
- package/{skills → kit/skills}/kit-plan-next/SKILL.md +10 -11
- package/{skills → kit/skills}/kit-status/SKILL.md +6 -6
- package/{skills → kit/skills}/kit-task-close/SKILL.md +5 -5
- package/{skills → kit/skills}/kit-task-new/SKILL.md +5 -5
- package/{skills → kit/skills}/kit-task-pr/SKILL.md +5 -5
- package/{skills → kit/skills}/kit-task-pr-auto/SKILL.md +1 -1
- package/{skills → kit/skills}/kit-task-pr-merge/SKILL.md +10 -10
- package/{skills → kit/skills}/kit-task-start/SKILL.md +1 -1
- package/{skills → kit/skills}/kit-task-sync/SKILL.md +5 -3
- package/{skills → kit/skills}/kit-ux-audit/SKILL.md +16 -35
- package/{skills → kit/skills}/kit-ux-audit/references/graph-model.md +7 -26
- package/{skills → kit/skills}/kit-ux-audit/references/report.md +2 -3
- package/{skills → kit/skills}/routing.yaml +6 -1
- package/kit/statusline/kit-statusline.sh +82 -0
- package/{templates → kit/templates}/agents/analyst.md +0 -11
- package/{templates → kit/templates}/agents/auto-dev.md +0 -13
- package/{templates → kit/templates}/agents/backend.md +0 -11
- package/{templates → kit/templates}/agents/designer.md +0 -11
- package/{templates → kit/templates}/agents/devops.md +0 -11
- package/{templates → kit/templates}/agents/editor.md +0 -11
- package/{templates → kit/templates}/agents/frontend.md +0 -11
- package/{templates → kit/templates}/agents/generalist.md +0 -11
- package/{templates → kit/templates}/agents/local-delegate.md +0 -13
- package/{templates → kit/templates}/agents/n8n.md +0 -11
- package/{templates → kit/templates}/agents/pm.md +0 -11
- package/{templates → kit/templates}/agents/qa.md +0 -11
- package/{templates → kit/templates}/agents/researcher.md +0 -11
- package/{templates → kit/templates}/agents/security.md +0 -11
- package/{templates → kit/templates}/agents/tech-lead.md +0 -11
- package/{templates → kit/templates}/agents/ux.md +3 -14
- package/{templates → kit/templates}/hooks/kit-mail-check.sh.tmpl +1 -1
- package/{templates → kit/templates}/instructions.md.tmpl +4 -21
- package/{templates → kit/templates}/kit.config.json.tmpl +0 -6
- package/{templates → kit/templates}/rules/authoring.md +7 -3
- package/{templates → kit/templates}/rules/branch-naming.md +3 -2
- package/{templates → kit/templates}/rules/delegation-brief.md +4 -0
- package/{templates → kit/templates}/rules/effort-model.md +34 -31
- package/{templates → kit/templates}/rules/gate-and-review.md +1 -1
- package/{templates → kit/templates}/rules/merge-safety.md +12 -9
- package/{templates → kit/templates}/rules/naming-and-ids.md +20 -24
- package/{templates → kit/templates}/rules/plan-next.md +5 -5
- package/{templates → kit/templates}/rules/react-annotate.md +0 -8
- package/{templates → kit/templates}/skills/campaign/SKILL.md +2 -2
- package/kit.config.schema.json +11 -11
- package/lib/PROMPTS.md +14 -0
- package/{scripts/lib → lib/core}/adapter-select-test.sh +7 -7
- package/lib/core/advisor-test.sh +55 -0
- package/{scripts/lib → lib/core}/agent-def-test.sh +1 -1
- package/{scripts/lib → lib/core}/agent-def.sh +2 -2
- package/{scripts/lib → lib/core}/agent-launch-test.sh +3 -3
- package/{scripts/lib → lib/core}/agent-profile-test.sh +2 -2
- package/{scripts/lib → lib/core}/agent-resolve-test.sh +4 -2
- package/{scripts/lib → lib/core}/agent-resolve.sh +5 -4
- package/{scripts → lib/core}/agent-skills-external.txt +3 -3
- package/{scripts → lib/core}/agent-skills-lint-test.sh +17 -17
- package/lib/core/agent-skills-lint.sh +115 -0
- package/{scripts → lib/core}/agent-template-lint-test.sh +7 -7
- package/lib/core/agent-template-lint.sh +58 -0
- package/{scripts/lib → lib/core}/board-view-test.sh +3 -3
- package/lib/core/board-view.sh +97 -0
- package/{scripts/lib → lib/core}/branch-owner-test.sh +3 -3
- package/lib/core/branch-owner.sh +201 -0
- package/lib/core/check.sh +125 -0
- package/{scripts/lib → lib/core}/codex-hooks-test.sh +3 -3
- package/{scripts → lib/core}/commitlint-test.sh +6 -6
- package/lib/core/commitlint.sh +54 -0
- package/{scripts/config-path-test.sh → lib/core/config-path-scan-test.sh} +2 -2
- package/{scripts/lib → lib/core}/config-path-test.sh +3 -3
- package/lib/core/config-path.sh +30 -0
- package/{scripts → lib/core}/content-skills-test.sh +17 -17
- package/{scripts → lib/core}/docs-marketing-words-test.sh +2 -2
- package/{scripts → lib/core}/docs-record-tables-test.sh +2 -2
- package/{scripts/lib → lib/core}/effort-metrics-test.sh +6 -6
- package/lib/core/effort-metrics.sh +591 -0
- package/{scripts/lib → lib/core}/effort-slug-test.sh +8 -4
- package/{scripts/lib → lib/core}/effort-slug.sh +8 -7
- package/lib/core/effort.sh +339 -0
- package/{scripts/lib → lib/core}/errors-header-test.sh +19 -9
- package/lib/core/errors-header.exempt +49 -0
- package/{scripts → lib/core}/exec-targets-test.sh +3 -3
- package/lib/core/feature-map.sh +76 -0
- package/lib/core/force-push-fence-test.sh +44 -0
- package/lib/core/force-push-fence.baseline +1 -0
- package/lib/core/force-push-fence.sh +51 -0
- package/{scripts → lib/core}/forge-fence-test.sh +13 -13
- package/{scripts → lib/core}/forge-fence.sh +14 -14
- package/{scripts → lib/core}/forge-report-test.sh +5 -5
- package/{scripts → lib/core}/forge-report.sh +18 -14
- package/{scripts/lib → lib/core}/git-core-test.sh +7 -7
- package/{scripts/lib → lib/core}/git-remote-test.sh +3 -3
- package/{scripts → lib/core}/guard-raw-git-ops-test.sh +4 -4
- package/{scripts → lib/core}/hook-adapter-test.sh +5 -5
- package/{scripts/lib → lib/core}/hook-refresh-test.sh +5 -5
- package/{scripts → lib/core}/instruction-budget-baseline.txt +2 -2
- package/lib/core/instruction-budget-lint.sh +238 -0
- package/{scripts/lib → lib/core}/integration-install-test.sh +12 -12
- package/lib/core/integration-install.sh +257 -0
- package/{scripts/lib → lib/core}/integrations-test.sh +38 -45
- package/lib/core/integrations.sh +244 -0
- package/{scripts/lib → lib/core}/kinds-test.sh +5 -5
- package/lib/core/kinds.sh +66 -0
- package/{scripts/lib → lib/core}/kit-cli-test.sh +1 -1
- package/{scripts/lib → lib/core}/kit-cli.sh +1 -1
- package/{scripts/lib → lib/core}/kit-config-resolve.sh +2 -2
- package/{scripts/lib → lib/core}/kit-config-test.sh +11 -11
- package/lib/core/kit-config.sh +164 -0
- package/{scripts/lib → lib/core}/kit-engine-test.sh +1 -1
- package/lib/core/kit-events.sh +72 -0
- package/lib/core/kit-local.sh +87 -0
- package/{scripts/lib → lib/core}/kit-manifest.sh +1 -1
- package/{scripts/lib → lib/core}/kit-mode-test.sh +1 -1
- package/{scripts/lib → lib/core}/kit-mode.sh +3 -3
- package/{scripts/lib → lib/core}/kit-operate.sh +1 -1
- package/{scripts/lib → lib/core}/kit-profile-test.sh +1 -1
- package/{scripts/lib → lib/core}/kit-profile.sh +2 -2
- package/{scripts/lib → lib/core}/kit-state-test.sh +1 -1
- package/lib/core/knowledge-lint.sh +106 -0
- package/lib/core/layout-fence-test.sh +35 -0
- package/lib/core/layout-fence.allow +15 -0
- package/lib/core/layout-fence.baseline +4 -0
- package/lib/core/layout-fence.sh +50 -0
- package/{scripts → lib/core}/leak-fence-test.sh +10 -10
- package/{scripts/lib → lib/core}/leak-fence.sh +1 -1
- package/lib/core/loose-issues-test.sh +102 -0
- package/lib/core/loose-issues.baseline +5 -0
- package/lib/core/loose-issues.sh +65 -0
- package/{scripts → lib/core}/marketing-walkthrough-test.sh +7 -7
- package/lib/core/naming-test.sh +112 -0
- package/lib/core/naming-verbs-test.sh +126 -0
- package/lib/core/naming.sh +172 -0
- package/{scripts/lib → lib/core}/orchestration-runtime-test.sh +4 -4
- package/{scripts → lib/core}/portable-test.sh +11 -7
- package/{scripts/lib → lib/core}/pr-evidence-test.sh +5 -5
- package/lib/core/pr-evidence.sh +361 -0
- package/{scripts/lib → lib/core}/qa-lane-test.sh +7 -7
- package/{scripts/lib → lib/core}/qa-lane.sh +4 -4
- package/{scripts/lib → lib/core}/qa-lanes-test.sh +5 -5
- package/lib/core/react-detect.sh +79 -0
- package/{scripts/lib → lib/core}/render-test.sh +1 -1
- package/lib/core/resident-context-test.sh +42 -0
- package/lib/core/resident-context.baseline +1 -0
- package/lib/core/resident-context.sh +56 -0
- package/lib/core/review-lint-baseline.txt +28 -0
- package/lib/core/review-lint.sh +266 -0
- package/{scripts → lib/core}/review-rules.conf +1 -1
- package/{scripts/lib → lib/core}/review-stage-test.sh +2 -2
- package/{scripts/lib → lib/core}/role-identity-test.sh +3 -3
- package/lib/core/role-identity.sh +71 -0
- package/{scripts → lib/core}/rule-recipes-test.sh +5 -5
- package/lib/core/secret-guard.sh +116 -0
- package/{scripts → lib/core}/self-install-test.sh +15 -16
- package/{scripts/lib → lib/core}/session-registry-test.sh +1 -1
- package/lib/core/session-registry.sh +233 -0
- package/{scripts → lib/core}/skill-frontmatter-baseline.txt +1 -1
- package/lib/core/skill-frontmatter-lint.sh +189 -0
- package/lib/core/spec-lint-test.sh +63 -0
- package/lib/core/spec-lint.sh +95 -0
- package/{scripts/lib → lib/core}/stage-receipt-test.sh +136 -4
- package/{scripts/lib → lib/core}/stage-receipt.sh +186 -7
- package/{scripts → lib/core}/terms-check-test.sh +6 -6
- package/lib/core/terms-check.sh +244 -0
- package/{scripts/lib → lib/core}/test-env-test.sh +2 -2
- package/{scripts/lib → lib/core}/test-env.sh +1 -1
- package/{scripts → lib/core}/test-runner-test.sh +11 -11
- package/{scripts → lib/core}/test.sh +12 -12
- package/{scripts → lib/core}/update-path-test.sh +3 -3
- package/{scripts → lib/core}/verbs-gen.sh +9 -9
- package/{scripts → lib/core}/verbs-help-test.sh +4 -4
- package/{scripts → lib/core}/verbs-ratchet-test.sh +24 -19
- package/{scripts → lib/core}/verbs-ratchet.sh +8 -8
- package/{scripts → lib/core}/verbs-test.sh +23 -23
- package/lib/core/verbs.baseline +5 -0
- package/{scripts/lib → lib/core}/verbs.sh +3 -3
- package/{scripts/lib → lib/core}/verbs.tsv +22 -20
- package/{scripts/lib → lib/core}/version-bump-test.sh +29 -8
- package/{scripts/lib → lib/core}/version-bump.sh +15 -2
- package/{scripts/lib → lib/core}/wave-result-test.sh +2 -2
- package/{scripts/lib → lib/core}/wave-result.sh +1 -1
- package/{scripts/lib → lib/core}/worker-brief-test.sh +4 -4
- package/{scripts/lib → lib/core}/worker-brief.sh +1 -1
- package/{scripts/lib → lib/core}/worktree-bootstrap-test.sh +1 -1
- package/{scripts/lib → lib/core}/worktree-issue-test.sh +2 -2
- package/lib/core/worktree-issue.sh +172 -0
- package/{scripts/lib → lib/core}/worktree-ports-test.sh +1 -1
- package/{scripts/lib → lib/core}/worktree-start-test.sh +2 -2
- package/lib/core/worktree-start.sh +790 -0
- package/{scripts/lib → lib/core}/zsh-safety-test.sh +11 -11
- package/{scripts/lib → lib/forge}/forge-github.sh +18 -7
- package/{scripts/lib → lib/forge}/forge-test.sh +4 -4
- package/{scripts/lib → lib/forge}/forge.sh +1 -1
- package/lib/forge/gh-board-add-test.sh +118 -0
- package/lib/forge/gh-log.sh +59 -0
- package/lib/forge/gh-project-test.sh +251 -0
- package/lib/forge/gh-project.sh +379 -0
- package/{scripts/lib → lib/forge}/gh-rest-test.sh +17 -13
- package/{scripts/lib → lib/forge}/gh-rest.sh +190 -16
- package/{scripts/lib → lib/forge}/init-github.sh +18 -8
- package/{scripts/lib → lib/forge}/test-forge-shim.sh +2 -1
- package/lib/verbs/PROMPTS.md +146 -0
- package/lib/verbs/annotate-setup.sh +149 -0
- package/{scripts → lib/verbs}/autopilot-run-test.sh +9 -9
- package/{scripts → lib/verbs}/autopilot-run.sh +9 -9
- package/{scripts → lib/verbs}/autopilot-test.sh +7 -6
- package/{scripts → lib/verbs}/autopilot.sh +7 -7
- package/{scripts/lib → lib/verbs}/captain-test.sh +1 -1
- package/{scripts/lib → lib/verbs}/captain.sh +8 -8
- package/lib/verbs/capture-project-ids.sh +99 -0
- package/{scripts/lib → lib/verbs}/content-kinds-gc-test.sh +7 -7
- package/{scripts/lib → lib/verbs}/contribute-root-test.sh +4 -4
- package/{scripts/lib → lib/verbs}/contribute-root.sh +1 -1
- package/{scripts → lib/verbs}/contribute.sh +8 -8
- package/{scripts → lib/verbs}/copilot-loop-test.sh +12 -12
- package/{scripts/lib → lib/verbs}/copilot-test.sh +15 -14
- package/{scripts/lib → lib/verbs}/copilot.sh +19 -19
- package/{scripts → lib/verbs}/database-supabase-test.sh +6 -6
- package/lib/verbs/effort-close-subs-test.sh +96 -0
- package/{scripts/lib → lib/verbs}/effort-dispatch-test.sh +5 -5
- package/{scripts/lib → lib/verbs}/effort-flows-test.sh +5 -5
- package/{scripts/lib → lib/verbs}/effort-ops-test.sh +111 -22
- package/lib/verbs/effort-ops.sh +1571 -0
- package/{scripts/lib → lib/verbs}/effort-parity-test.sh +47 -41
- package/{scripts/lib → lib/verbs}/effort-plan-test.sh +7 -7
- package/lib/verbs/effort-plan.sh +289 -0
- package/lib/verbs/effort-review-test.sh +107 -0
- package/lib/verbs/effort-review.sh +93 -0
- package/lib/verbs/grill-record-test.sh +49 -0
- package/lib/verbs/grill-record.sh +88 -0
- package/{scripts/lib → lib/verbs}/handoff.sh +3 -3
- package/{scripts → lib/verbs}/init-content-test.sh +14 -14
- package/{scripts/lib → lib/verbs}/init-guide.sh +6 -6
- package/{scripts → lib/verbs}/init-guided-test.sh +9 -9
- package/{scripts → lib/verbs}/init-recipes-test.sh +7 -7
- package/{scripts → lib/verbs}/init-upgrade-test.sh +9 -10
- package/lib/verbs/init.sh +1598 -0
- package/{scripts → lib/verbs}/install-test.sh +5 -5
- package/lib/verbs/install.sh +31 -0
- package/{scripts → lib/verbs}/integrations-check-test.sh +9 -9
- package/lib/verbs/integrations-check.sh +157 -0
- package/{scripts → lib/verbs}/kit-add-test.sh +8 -8
- package/lib/verbs/kit-add.sh +415 -0
- package/{scripts → lib/verbs}/kit-adopt-test.sh +4 -4
- package/{scripts → lib/verbs}/kit-adopt.sh +6 -6
- package/{scripts/lib → lib/verbs}/kit-brief-test.sh +44 -15
- package/{scripts/lib → lib/verbs}/kit-brief.sh +101 -16
- package/lib/verbs/kit-bump-version.sh +79 -0
- package/lib/verbs/kit-digest.sh +126 -0
- package/{scripts → lib/verbs}/kit-doctor-test.sh +57 -32
- package/lib/verbs/kit-doctor.sh +991 -0
- package/{scripts → lib/verbs}/kit-export-project-test.sh +4 -4
- package/lib/verbs/kit-export-project.sh +245 -0
- package/{scripts → lib/verbs}/kit-export-training-test.sh +3 -3
- package/lib/verbs/kit-export-training.sh +175 -0
- package/{scripts/lib → lib/verbs}/kit-gc-test.sh +5 -5
- package/lib/verbs/kit-gc.sh +804 -0
- package/{scripts/lib → lib/verbs}/kit-hotfix.sh +3 -3
- package/{scripts/lib → lib/verbs}/kit-interview-test.sh +2 -2
- package/lib/verbs/kit-interview.sh +319 -0
- package/{scripts/lib → lib/verbs}/kit-lib-test.sh +2 -2
- package/{scripts/lib → lib/verbs}/kit-lib.sh +10 -10
- package/{scripts → lib/verbs}/kit-migrate-test.sh +4 -4
- package/{scripts → lib/verbs}/kit-migrate.sh +5 -5
- package/{scripts/lib → lib/verbs}/kit-msg-test.sh +2 -2
- package/{scripts/lib → lib/verbs}/kit-msg.sh +5 -5
- package/{scripts → lib/verbs}/kit-onboard-test.sh +2 -3
- package/lib/verbs/kit-onboard.sh +69 -0
- package/{scripts → lib/verbs}/kit-promote-test.sh +4 -4
- package/{scripts → lib/verbs}/kit-promote.sh +4 -4
- package/{scripts → lib/verbs}/kit-remove-test.sh +4 -4
- package/{scripts → lib/verbs}/kit-remove.sh +5 -5
- package/lib/verbs/kit-routines.sh +322 -0
- package/lib/verbs/kit-self-update.sh +55 -0
- package/{scripts/lib → lib/verbs}/kit-status-test.sh +2 -2
- package/lib/verbs/kit-status.sh +650 -0
- package/{scripts/lib → lib/verbs}/kit-task-ops-test.sh +25 -2
- package/lib/verbs/kit-task-ops.sh +793 -0
- package/{scripts → lib/verbs}/kit-version-check-test.sh +3 -3
- package/lib/verbs/kit-version-check.sh +121 -0
- package/{scripts → lib/verbs}/kit-wire-test.sh +6 -6
- package/{scripts → lib/verbs}/kit-wire.sh +8 -8
- package/{scripts/lib → lib/verbs}/kto-hotfix-test.sh +3 -3
- package/{scripts/lib → lib/verbs}/kto-task-close-test.sh +2 -2
- package/{scripts/lib → lib/verbs}/kto-task-new-test.sh +20 -2
- package/{scripts/lib → lib/verbs}/kto-task-pr-merge-test.sh +46 -2
- package/{scripts/lib → lib/verbs}/kto-task-pr-test.sh +6 -6
- package/{scripts/lib → lib/verbs}/light-task-run-test.sh +4 -4
- package/{scripts/lib → lib/verbs}/light-task-test.sh +9 -9
- package/{scripts/lib → lib/verbs}/light-task.sh +26 -11
- package/{scripts/lib → lib/verbs}/next-test.sh +3 -3
- package/{scripts/lib → lib/verbs}/next.sh +10 -10
- package/{scripts → lib/verbs}/night-grant-test.sh +4 -4
- package/lib/verbs/night-grant.sh +454 -0
- package/{scripts → lib/verbs}/night-run-test.sh +3 -3
- package/{scripts → lib/verbs}/night-run.mjs +2 -2
- package/{scripts → lib/verbs}/orchestrate-test.sh +5 -5
- package/{scripts → lib/verbs}/orchestrate.sh +15 -15
- package/{scripts/lib → lib/verbs}/plan-machine-test.sh +1 -1
- package/{scripts/lib → lib/verbs}/plan-machine.sh +13 -13
- package/{scripts/lib → lib/verbs}/plan-next-test.sh +1 -1
- package/lib/verbs/plan-next.sh +213 -0
- package/{scripts → lib/verbs}/publish.sh +10 -10
- package/{scripts/lib → lib/verbs}/review-page-test.sh +4 -4
- package/lib/verbs/review-page.sh +375 -0
- package/lib/verbs/setup-labels.sh +96 -0
- package/lib/verbs/setup-milestones.sh +34 -0
- package/{scripts → lib/verbs}/showcase.sh +2 -2
- package/lib/verbs/sprint-test.sh +96 -0
- package/lib/verbs/sprint.sh +216 -0
- package/{scripts → lib/verbs}/status-test.sh +8 -8
- package/{scripts → lib/verbs}/status.sh +16 -16
- package/{scripts → lib/verbs}/task-sync-test.sh +40 -6
- package/lib/verbs/task-sync.sh +462 -0
- package/{scripts/lib → lib/verbs}/upgrade-report-test.sh +4 -4
- package/lib/verbs/ux-a11y-scan.sh +96 -0
- package/lib/verbs/ux-ds-audit.sh +146 -0
- package/lib/verbs/ux-graph-scan.sh +188 -0
- package/{scripts → lib/verbs}/wave-worker.sh +2 -2
- package/lib/verbs/web-install.sh +22 -0
- package/package.json +3 -10
- package/scripts/PROMPTS.md +13 -0
- package/scripts/agent-skills-lint.sh +12 -113
- package/scripts/agent-template-lint.sh +12 -56
- package/scripts/annotate-setup.sh +11 -151
- package/scripts/benchmark/checkpoint-test.sh +1 -1
- package/scripts/benchmark/checkpoint.sh +1 -1
- package/scripts/benchmark/gate.sh +2 -2
- package/scripts/benchmark/lib/bench-common.sh +1 -1
- package/scripts/capture-project-ids.sh +12 -70
- package/scripts/check.sh +12 -106
- package/scripts/force-push-fence.sh +14 -0
- package/scripts/init.sh +13 -1637
- package/scripts/install.sh +12 -29
- package/scripts/instruction-budget-lint.sh +13 -218
- package/scripts/integrations-check.sh +12 -155
- package/scripts/kit-add.sh +12 -413
- package/scripts/kit-bump-version.sh +13 -78
- package/scripts/kit-digest.sh +13 -125
- package/scripts/kit-doctor.sh +13 -971
- package/scripts/kit-export-project.sh +12 -243
- package/scripts/kit-export-training.sh +12 -173
- package/scripts/kit-onboard.sh +12 -67
- package/scripts/kit-routines.sh +12 -320
- package/scripts/kit-self-update.sh +12 -53
- package/scripts/kit-version-check.sh +12 -106
- package/scripts/knowledge-lint.sh +13 -98
- package/scripts/lib/board-view.sh +13 -96
- package/scripts/lib/branch-owner.sh +12 -199
- package/scripts/lib/commitlint.sh +12 -52
- package/scripts/lib/config-path.sh +13 -29
- package/scripts/lib/effort-metrics.sh +12 -589
- package/scripts/lib/effort-ops.sh +13 -1243
- package/scripts/lib/effort-plan.sh +12 -287
- package/scripts/lib/effort.sh +13 -365
- package/scripts/lib/gh-log.sh +14 -59
- package/scripts/lib/gh-project.sh +13 -254
- package/scripts/lib/grill-record.sh +14 -0
- package/scripts/lib/integration-install.sh +12 -255
- package/scripts/lib/integrations.sh +12 -242
- package/scripts/lib/kinds.sh +13 -65
- package/scripts/lib/kit-config.sh +12 -165
- package/scripts/lib/kit-events.sh +13 -71
- package/scripts/lib/kit-gc.sh +12 -802
- package/scripts/lib/kit-interview.sh +11 -316
- package/scripts/lib/kit-local.sh +12 -85
- package/scripts/lib/kit-status.sh +12 -648
- package/scripts/lib/kit-task-ops.sh +13 -738
- package/scripts/lib/naming.sh +14 -0
- package/scripts/lib/plan-next.sh +13 -212
- package/scripts/lib/pr-evidence.sh +12 -359
- package/scripts/lib/react-detect.sh +12 -77
- package/scripts/lib/review-page.sh +11 -372
- package/scripts/lib/role-identity.sh +13 -70
- package/scripts/lib/secret-guard.sh +12 -114
- package/scripts/lib/session-registry.sh +13 -232
- package/scripts/lib/spec-lint.sh +14 -0
- package/scripts/lib/worktree-issue.sh +12 -170
- package/scripts/lib/worktree-start.sh +13 -748
- package/scripts/night-grant.sh +12 -452
- package/scripts/review-lint.sh +13 -258
- package/scripts/setup-labels.sh +11 -82
- package/scripts/setup-milestones.sh +12 -21
- package/scripts/skill-frontmatter-lint.sh +13 -181
- package/scripts/task-sync.sh +13 -370
- package/scripts/terms-check.sh +13 -241
- package/scripts/ux-a11y-scan.sh +13 -95
- package/scripts/ux-ds-audit.sh +12 -144
- package/scripts/ux-graph-scan.sh +12 -186
- package/scripts/web-install.sh +16 -20
- package/docs/kit-annotate/01-explainer.html +0 -225
- package/docs/kit-annotate/02-implementation-plan.html +0 -196
- package/docs/media/.onboarding-capture.cast +0 -5
- package/docs/media/README.md +0 -43
- package/docs/media/build-demo.sh +0 -63
- package/docs/media/build-kit-init.sh +0 -51
- package/docs/media/build-onboarding.sh +0 -51
- package/docs/media/kit-dry-run.cast +0 -107
- package/docs/media/kit-dry-run.gif +0 -0
- package/docs/media/kit-init.cast +0 -56
- package/docs/media/kit-init.gif +0 -0
- package/docs/media/kit-onboarding.cast +0 -148
- package/docs/media/kit-onboarding.gif +0 -0
- package/integrations/mempalace.json +0 -28
- package/scripts/lib/gh-project-test.sh +0 -135
- package/scripts/review-lint-baseline.txt +0 -28
- package/scripts/verbs.baseline +0 -5
- package/templates/hooks/mempal_followup.sh.tmpl +0 -97
- package/templates/hooks/mempal_precompact.sh.tmpl +0 -4
- package/templates/hooks/mempal_save.sh.tmpl +0 -4
- package/templates/hooks/mempal_session_start.sh.tmpl +0 -42
- package/templates/rules/mempalace.md +0 -111
- /package/{commands → kit/commands}/kit-docs.md +0 -0
- /package/{commands → kit/commands}/kit-export-training.md +0 -0
- /package/{databases → kit/databases}/supabase/guide.html +0 -0
- /package/{databases → kit/databases}/supabase/nextjs/lib/supabase/client.ts +0 -0
- /package/{databases → kit/databases}/supabase/nextjs/lib/supabase/server.ts +0 -0
- /package/{githooks → kit/githooks}/pre-commit +0 -0
- /package/{integrations → kit/integrations}/emil-design-eng.json +0 -0
- /package/{integrations → kit/integrations}/graft.json +0 -0
- /package/{integrations → kit/integrations}/impeccable.json +0 -0
- /package/{integrations → kit/integrations}/lavish.json +0 -0
- /package/{integrations → kit/integrations}/mlx-lm.json +0 -0
- /package/{integrations → kit/integrations}/web-design-guidelines.json +0 -0
- /package/{recipes → kit/recipes}/nextjs-shadcn.json +0 -0
- /package/{skills → kit/skills}/kit-docs-writer/SKILL.md +0 -0
- /package/{skills → kit/skills}/kit-onboard/SKILL.md +0 -0
- /package/{skills → kit/skills}/kit-security-sweep/SKILL.md +0 -0
- /package/{skills → kit/skills}/kit-ship/SKILL.md +0 -0
- /package/{skills → kit/skills}/kit-ux-audit/references/a11y.md +0 -0
- /package/{skills → kit/skills}/kit-ux-audit/references/consistency.md +0 -0
- /package/{skills → kit/skills}/kit-ux-audit/references/heuristics.md +0 -0
- /package/{templates → kit/templates}/benchmarks/SCHEMA.md +0 -0
- /package/{templates → kit/templates}/benchmarks/abstain.jsonl +0 -0
- /package/{templates → kit/templates}/benchmarks/adversarial.jsonl +0 -0
- /package/{templates → kit/templates}/benchmarks/benchmark.config.json +0 -0
- /package/{templates → kit/templates}/benchmarks/quality.jsonl +0 -0
- /package/{templates → kit/templates}/benchmarks/retrieval.jsonl +0 -0
- /package/{templates → kit/templates}/codex/hooks.json.tmpl +0 -0
- /package/{templates → kit/templates}/hooks/guard-base-branch-commit.sh.tmpl +0 -0
- /package/{templates → kit/templates}/hooks/guard-raw-git-ops.sh.tmpl +0 -0
- /package/{templates → kit/templates}/hooks/kit-local-status.sh.tmpl +0 -0
- /package/{templates → kit/templates}/hooks/kit_version_check.sh.tmpl +0 -0
- /package/{templates → kit/templates}/hooks/prepush_gate.sh.tmpl +0 -0
- /package/{templates → kit/templates}/hooks/repo-hygiene.sh.tmpl +0 -0
- /package/{templates → kit/templates}/knowledge-INDEX.md.tmpl +0 -0
- /package/{templates → kit/templates}/lib/kit-sigil.sh.tmpl +0 -0
- /package/{templates → kit/templates}/rules/code-retrieval.md +0 -0
- /package/{templates → kit/templates}/rules/communication-style.md +0 -0
- /package/{templates → kit/templates}/rules/design-routing.md +0 -0
- /package/{templates → kit/templates}/rules/issue-lifecycle.md +0 -0
- /package/{templates → kit/templates}/rules/knowledge-base.md +0 -0
- /package/{templates → kit/templates}/rules/plain-language.md +0 -0
- /package/{templates → kit/templates}/rules/plan-output-format.md +0 -0
- /package/{templates → kit/templates}/rules/review-pages.md +0 -0
- /package/{templates → kit/templates}/rules/risk-tiered-review.md +0 -0
- /package/{templates → kit/templates}/rules/shared-checkout.md +0 -0
- /package/{templates → kit/templates}/rules/skill-gaps.md +0 -0
- /package/{templates → kit/templates}/rules/task-management.md +0 -0
- /package/{templates → kit/templates}/settings/settings.json.tmpl +0 -0
- /package/{templates → kit/templates}/settings/settings.local.json.tmpl +0 -0
- /package/{templates → kit/templates}/skills/NAMESPACED +0 -0
- /package/{templates → kit/templates}/skills/brand-voice/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/brand-voice/references/voice-template.md +0 -0
- /package/{templates → kit/templates}/skills/campaign/references/plan-template.md +0 -0
- /package/{templates → kit/templates}/skills/concrete/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/copywriting/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/copywriting/references/copy-frameworks.md +0 -0
- /package/{templates → kit/templates}/skills/copywriting/references/natural-transitions.md +0 -0
- /package/{templates → kit/templates}/skills/feature-build-refine/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/karpathy-guidelines/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/morning-briefing/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/page-design/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/page-design/add.json +0 -0
- /package/{templates → kit/templates}/skills/page-design/references/design-file-template.md +0 -0
- /package/{templates → kit/templates}/skills/page-design/references/generic-page-patterns.md +0 -0
- /package/{templates → kit/templates}/skills/page-design/references/minimum-rules.md +0 -0
- /package/{templates → kit/templates}/skills/speckit/SKILL.md +0 -0
- /package/{templates → kit/templates}/skills/supabase-patterns/SKILL.md +0 -0
- /package/{scripts/lib → lib/core}/adapter-select.sh +0 -0
- /package/{scripts/lib → lib/core}/agent-launch.sh +0 -0
- /package/{scripts/lib → lib/core}/agent-profile.sh +0 -0
- /package/{scripts/lib → lib/core}/cckit-output.sh +0 -0
- /package/{scripts/lib → lib/core}/codex-hooks.sh +0 -0
- /package/{scripts → lib/core}/forge-fence.baseline +0 -0
- /package/{scripts/lib → lib/core}/git-remote.sh +0 -0
- /package/{scripts/lib → lib/core}/hook-refresh.sh +0 -0
- /package/{scripts → lib/core}/instruction-budget-lint-test.sh +0 -0
- /package/{scripts/lib → lib/core}/kit-state.sh +0 -0
- /package/{scripts/lib → lib/core}/orchestration-runtime.sh +0 -0
- /package/{scripts/lib → lib/core}/project-scan.sh +0 -0
- /package/{scripts/lib → lib/core}/render.sh +0 -0
- /package/{scripts → lib/core}/review-lint-test.sh +0 -0
- /package/{scripts/lib → lib/core}/review-stage.sh +0 -0
- /package/{scripts → lib/core}/skill-frontmatter-lint-test.sh +0 -0
- /package/{scripts/lib → lib/core}/task-source-file.sh +0 -0
- /package/{scripts/lib → lib/core}/task-source.sh +0 -0
- /package/{scripts/lib → lib/core}/toon.sh +0 -0
- /package/{scripts/lib → lib/core}/ui.sh +0 -0
- /package/{scripts/lib → lib/forge}/forge-none.sh +0 -0
- /package/{scripts → lib/verbs}/debug.sh +0 -0
- /package/{scripts → lib/verbs}/night-run.test.mjs +0 -0
- /package/{scripts/lib → lib/verbs}/upgrade-report.sh +0 -0
|
@@ -1,245 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# kit-export-project.sh
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# needs a transform is claude.ai, because it has no filesystem: we FLATTEN CLAUDE.md (resolving its
|
|
12
|
-
# @-imports of .claude/rules/*) into ONE instructions file, and COPY the knowledge corpus into an
|
|
13
|
-
# upload-ready folder. We also VERIFY Cowork compat (every file the project leans on is tier-A
|
|
14
|
-
# portable, not a tier-B CLI-only shim) and print a support matrix.
|
|
15
|
-
#
|
|
16
|
-
# TIER MODEL (#373, recorded in .claude/kit.manifest.json):
|
|
17
|
-
# tier A = portable — skills/rules/agents/commands; meaningful in Cowork AND claude.ai.
|
|
18
|
-
# tier B = CLI-only — statusline.sh / settings.json / hooks/ / lib/ ; need a terminal+filesystem.
|
|
19
|
-
# The export carries ONLY tier-A semantics to claude.ai; a tier-B file the project REQUIRES to
|
|
20
|
-
# function is a portability defect we flag (it would silently no-op off-terminal).
|
|
21
|
-
#
|
|
22
|
-
# OUTPUT (default .kit-export/, override with --out DIR):
|
|
23
|
-
# claude-instructions.md the flattened CLAUDE.md + inlined @.claude/rules/* — paste into the
|
|
24
|
-
# claude.ai Project's "custom instructions" box.
|
|
25
|
-
# project-knowledge/ knowledge/** (+ agents/ + rules/ as reference) — upload as Project knowledge.
|
|
26
|
-
# SUPPORT-MATRIX.md terminal / Cowork / claude.ai feature support, generated from the manifest.
|
|
27
|
-
#
|
|
28
|
-
# Run:
|
|
29
|
-
# scripts/kit-export-project.sh # full export to .kit-export/
|
|
30
|
-
# scripts/kit-export-project.sh --out build/x # custom output dir
|
|
31
|
-
# scripts/kit-export-project.sh --verify # Cowork+claude.ai compat check only, write nothing (rc 1 on defect)
|
|
32
|
-
# scripts/kit-export-project.sh --matrix # print the support matrix to stdout, write nothing
|
|
33
|
-
# scripts/kit-export-project.sh --dry-run # report what it would write, write nothing
|
|
34
|
-
# Requires: jq + a sha256 tool (for tier lookups via the manifest).
|
|
35
|
-
|
|
36
|
-
set -uo pipefail
|
|
37
|
-
_export_dir="$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
38
|
-
# shellcheck source=/dev/null
|
|
39
|
-
. "$_export_dir/lib/kit-cli.sh" # kit_is_main
|
|
40
|
-
# shellcheck source=/dev/null
|
|
41
|
-
. "$_export_dir/lib/kit-manifest.sh" # tier lookups
|
|
42
|
-
|
|
43
|
-
_kex_say() { printf '%s\n' "$*" >&2; }
|
|
44
|
-
|
|
45
|
-
# Tier-classify a kit-shaped path the same way kit-wire/kit-adopt do — manifest first (authoritative,
|
|
46
|
-
# carries the tier the file was wired with), heuristic fallback when the file isn't manifest-tracked
|
|
47
|
-
# (e.g. a hand-imported project that never ran kit-adopt).
|
|
48
|
-
kit_export_tier() {
|
|
49
|
-
local p="$1" t
|
|
50
|
-
t="$(kit_manifest_get "$p" 2>/dev/null | jq -r '.tier // empty' 2>/dev/null || true)"
|
|
51
|
-
if [ -n "$t" ]; then printf '%s\n' "$t"; return 0; fi
|
|
52
|
-
case "$p" in
|
|
53
|
-
.claude/statusline.sh|.claude/settings.json|.claude/settings.local.json|.claude/hooks/*|.claude/lib/*) printf 'B\n' ;;
|
|
54
|
-
*) printf 'A\n' ;;
|
|
55
|
-
esac
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
# Resolve a Claude `@path` import to a relpath. Claude Code imports are written `@.claude/rules/x.md`
|
|
59
|
-
# or `@./KIT.md`; strip the leading @ and any ./ — return empty for a non-import line.
|
|
60
|
-
_kex_import_path() {
|
|
61
|
-
case "$1" in
|
|
62
|
-
@*) printf '%s\n' "${1#@}" | sed 's#^\./##' ;;
|
|
63
|
-
*) printf '\n' ;;
|
|
64
|
-
esac
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
# Flatten CLAUDE.md into a single instructions document for claude.ai. We INLINE every @-import
|
|
68
|
-
# (the .claude/rules/* and any @./KIT.md) so the one text box carries the whole instruction set —
|
|
69
|
-
# claude.ai can't follow an @ to a file it doesn't have. Imports are inlined ONCE (dedup) and only
|
|
70
|
-
# tier-A files are inlined (a tier-B shim has no meaning without a terminal). Non-import lines pass
|
|
71
|
-
# through verbatim. Recurses one level into imported rule files (they rarely chain, but we guard a
|
|
72
|
-
# seen-set so a cycle can't loop).
|
|
73
|
-
kit_export_flatten_instructions() {
|
|
74
|
-
local claude_md="${1:-CLAUDE.md}"
|
|
75
|
-
[ -f "$claude_md" ] || { _kex_say "kit-export: $claude_md not found"; return 1; }
|
|
76
|
-
|
|
77
|
-
# seen-set for dedup/cycle-guard (newline-delimited paths already inlined)
|
|
78
|
-
local seen=""
|
|
79
|
-
_kex_emit_file() { # <relpath> <depth>
|
|
80
|
-
local f="$1" depth="$2" line ip tier
|
|
81
|
-
case "$seen" in *"|$f|"*) return 0 ;; esac
|
|
82
|
-
seen="$seen|$f|"
|
|
83
|
-
while IFS= read -r line || [ -n "$line" ]; do
|
|
84
|
-
ip="$(_kex_import_path "$line")"
|
|
85
|
-
if [ -n "$ip" ] && [ -f "$ip" ] && [ "$depth" -lt 4 ]; then
|
|
86
|
-
tier="$(kit_export_tier "$ip")"
|
|
87
|
-
if [ "$tier" = "A" ]; then
|
|
88
|
-
printf '\n<!-- inlined from %s (tier A) -->\n' "$ip"
|
|
89
|
-
_kex_emit_file "$ip" $((depth + 1))
|
|
90
|
-
else
|
|
91
|
-
printf '\n<!-- skipped %s (tier B — CLI-only, no meaning on claude.ai) -->\n' "$ip"
|
|
92
|
-
fi
|
|
93
|
-
else
|
|
94
|
-
printf '%s\n' "$line"
|
|
95
|
-
fi
|
|
96
|
-
done < "$f"
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
printf '<!-- Generated by kit-export-project (#376) — paste into the claude.ai Project custom-instructions box. -->\n'
|
|
100
|
-
printf '<!-- Source: %s + inlined @.claude/rules/* (tier-A). Terminal/Cowork read the repo directly. -->\n\n' "$claude_md"
|
|
101
|
-
_kex_emit_file "$claude_md" 0
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# Cowork + claude.ai compat verdict. Cowork runs Claude Code natively, so the question is: does the
|
|
105
|
-
# project FUNCTION when only the portable (tier-A) surface is honored? Any file CLAUDE.md imports
|
|
106
|
-
# that is tier-B is a portability defect (it silently no-ops off-terminal). rc 0 = portable, 1 = defect.
|
|
107
|
-
kit_export_verify() {
|
|
108
|
-
local claude_md="${1:-CLAUDE.md}" defects=0 line ip tier
|
|
109
|
-
if [ ! -f "$claude_md" ]; then _kex_say "kit-export --verify: $claude_md not found"; return 1; fi
|
|
110
|
-
_kex_say "kit-export --verify: checking that the portable surface is self-sufficient..."
|
|
111
|
-
while IFS= read -r line || [ -n "$line" ]; do
|
|
112
|
-
ip="$(_kex_import_path "$line")"
|
|
113
|
-
[ -n "$ip" ] || continue
|
|
114
|
-
if [ ! -f "$ip" ]; then
|
|
115
|
-
_kex_say " ! CLAUDE.md imports $ip but it is MISSING — broken on every surface"
|
|
116
|
-
defects=$((defects + 1)); continue
|
|
117
|
-
fi
|
|
118
|
-
tier="$(kit_export_tier "$ip")"
|
|
119
|
-
if [ "$tier" = "B" ]; then
|
|
120
|
-
_kex_say " ! CLAUDE.md requires $ip (tier B / CLI-only) — silently no-ops in Cowork/claude.ai"
|
|
121
|
-
defects=$((defects + 1))
|
|
122
|
-
else
|
|
123
|
-
_kex_say " ok $ip (tier A — portable)"
|
|
124
|
-
fi
|
|
125
|
-
done < "$claude_md"
|
|
126
|
-
if [ "$defects" -eq 0 ]; then
|
|
127
|
-
_kex_say "kit-export --verify: PORTABLE — the same project runs in terminal / Cowork / claude.ai with no hand edits."
|
|
128
|
-
return 0
|
|
129
|
-
fi
|
|
130
|
-
_kex_say "kit-export --verify: $defects portability defect(s) — fix before relying on the non-terminal surfaces."
|
|
131
|
-
return 1
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
# The support matrix — what each surface can do, generated from the manifest tiers present.
|
|
135
|
-
kit_export_matrix() {
|
|
136
|
-
local a_count b_count
|
|
137
|
-
a_count="$(kit_manifest_list A 2>/dev/null | grep -c . || true)"
|
|
138
|
-
b_count="$(kit_manifest_list B 2>/dev/null | grep -c . || true)"
|
|
139
|
-
cat <<MATRIX
|
|
140
|
-
# claude-kit surface support matrix
|
|
141
|
-
|
|
142
|
-
Generated by kit-export-project (#376). The kit project runs on three Claude surfaces; this table
|
|
143
|
-
records what each supports and how the project gets there.
|
|
144
|
-
|
|
145
|
-
| Capability | Terminal (Claude Code) | Cowork (cloud Claude Code) | claude.ai Project |
|
|
146
|
-
| ----------------------------------- | :--------------------: | :------------------------: | :---------------: |
|
|
147
|
-
| Reads CLAUDE.md + .claude/ natively | yes | yes | no (no FS) |
|
|
148
|
-
| Tier-A skills / rules / agents | yes | yes | via export* |
|
|
149
|
-
| Tier-B statusline / hooks / settings| yes | partial** | no |
|
|
150
|
-
| Runs \`kit\` / \`scripts/*\` verbs | yes | yes | no (can't shell) |
|
|
151
|
-
| GitHub lifecycle (gh, worktrees) | yes | yes | no |
|
|
152
|
-
| Knowledge corpus available | in repo | in repo | via export* |
|
|
153
|
-
|
|
154
|
-
\* claude.ai has no filesystem: run \`kit-export-project\` → paste \`claude-instructions.md\` into the
|
|
155
|
-
Project custom-instructions box and upload \`project-knowledge/\` as Project knowledge.
|
|
156
|
-
\*\* Cowork runs Claude Code but a shim like the statusline / a guard hook may be inert in that
|
|
157
|
-
environment; the PROJECT still functions because tier-B files are conveniences, not requirements
|
|
158
|
-
(verified by \`kit-export-project --verify\`).
|
|
159
|
-
|
|
160
|
-
## This project's manifest tiering
|
|
161
|
-
- Tier A (portable): ${a_count} file(s)
|
|
162
|
-
- Tier B (CLI-only): ${b_count} file(s)
|
|
163
|
-
|
|
164
|
-
Tier A = portable to Cowork AND claude.ai. Tier B = needs a terminal + filesystem. The export
|
|
165
|
-
carries only tier-A semantics off-terminal; a tier-B file the project *requires* is a defect
|
|
166
|
-
\`--verify\` flags.
|
|
167
|
-
MATRIX
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
# Copy the knowledge corpus + portable reference files into an upload-ready folder for claude.ai.
|
|
171
|
-
# Honors KIT_DRY_RUN. Knowledge dir is config-resolved (defaults to knowledge/).
|
|
172
|
-
kit_export_knowledge() {
|
|
173
|
-
local out="$1" kdir="${2:-knowledge}" copied=0
|
|
174
|
-
local dest="$out/project-knowledge"
|
|
175
|
-
if [ -n "${KIT_DRY_RUN:-}" ]; then
|
|
176
|
-
[ -d "$kdir" ] && _kex_say " [dry-run] would copy $kdir/** -> $dest/"
|
|
177
|
-
_kex_say " [dry-run] would copy .claude/rules/ + .claude/agents/ (tier-A reference) -> $dest/"
|
|
178
|
-
return 0
|
|
179
|
-
fi
|
|
180
|
-
mkdir -p "$dest"
|
|
181
|
-
if [ -d "$kdir" ]; then
|
|
182
|
-
# -R preserves the knowledge/ tree under the dest; portable on bash + zsh, macOS + linux cp.
|
|
183
|
-
cp -R "$kdir" "$dest/" && copied=1
|
|
184
|
-
fi
|
|
185
|
-
# Carry tier-A reference material (rules + agents) so a claude.ai Project has the same context.
|
|
186
|
-
[ -d .claude/rules ] && cp -R .claude/rules "$dest/" 2>/dev/null && copied=1
|
|
187
|
-
[ -d .claude/agents ] && cp -R .claude/agents "$dest/" 2>/dev/null && copied=1
|
|
188
|
-
if [ "$copied" -eq 1 ]; then
|
|
189
|
-
_kex_say " knowledge + tier-A reference copied -> $dest/"
|
|
190
|
-
else
|
|
191
|
-
_kex_say " (no knowledge/ or tier-A reference found to copy)"
|
|
192
|
-
fi
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
# Full export: instructions + knowledge + matrix into OUT.
|
|
196
|
-
kit_export_all() {
|
|
197
|
-
local out="$1" kdir="${2:-knowledge}"
|
|
198
|
-
command -v jq >/dev/null 2>&1 || { _kex_say "kit-export: jq required"; return 1; }
|
|
199
|
-
[ -f CLAUDE.md ] || { _kex_say "kit-export: no CLAUDE.md here — run from the project root (or /kit-init first)."; return 1; }
|
|
200
|
-
|
|
201
|
-
_kex_say "kit-export: exporting to $out/ (terminal/Cowork read the repo directly; this is for claude.ai)"
|
|
202
|
-
|
|
203
|
-
if [ -n "${KIT_DRY_RUN:-}" ]; then
|
|
204
|
-
_kex_say " [dry-run] would write $out/claude-instructions.md (flattened CLAUDE.md + tier-A rules)"
|
|
205
|
-
kit_export_knowledge "$out" "$kdir"
|
|
206
|
-
_kex_say " [dry-run] would write $out/SUPPORT-MATRIX.md"
|
|
207
|
-
return 0
|
|
208
|
-
fi
|
|
209
|
-
|
|
210
|
-
mkdir -p "$out"
|
|
211
|
-
kit_export_flatten_instructions CLAUDE.md > "$out/claude-instructions.md" \
|
|
212
|
-
&& _kex_say " wrote $out/claude-instructions.md"
|
|
213
|
-
kit_export_knowledge "$out" "$kdir"
|
|
214
|
-
kit_export_matrix > "$out/SUPPORT-MATRIX.md" && _kex_say " wrote $out/SUPPORT-MATRIX.md"
|
|
215
|
-
|
|
216
|
-
_kex_say "kit-export: done."
|
|
217
|
-
_kex_say " -> paste $out/claude-instructions.md into the claude.ai Project custom-instructions box"
|
|
218
|
-
_kex_say " -> upload $out/project-knowledge/ as the Project's knowledge"
|
|
219
|
-
# A portability nudge: report (don't fail) if the verify check finds defects.
|
|
220
|
-
kit_export_verify CLAUDE.md >/dev/null 2>&1 || _kex_say " note: run --verify — the portable surface has defect(s)."
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
# CLI (direct execution only; sourcing exposes the functions for tests)
|
|
224
|
-
if kit_is_main; then
|
|
225
|
-
_mode=export _out=".kit-export" _kdir="knowledge"
|
|
226
|
-
# config-resolve the knowledge dir if available (kit-config.sh ships alongside in scripts/lib)
|
|
227
|
-
if [ -f "$_export_dir/lib/kit-config.sh" ]; then
|
|
228
|
-
# shellcheck source=/dev/null
|
|
229
|
-
. "$_export_dir/lib/kit-config.sh"
|
|
230
|
-
load_kit_config >/dev/null 2>&1 && _kdir="${KIT_KNOWLEDGE_DIR:-knowledge}" || true
|
|
231
|
-
fi
|
|
232
|
-
while [ $# -gt 0 ]; do case "$1" in
|
|
233
|
-
--out) _out="${2:?--out needs a dir}"; shift 2;;
|
|
234
|
-
--verify) _mode=verify; shift;;
|
|
235
|
-
--matrix) _mode=matrix; shift;;
|
|
236
|
-
--dry-run) export KIT_DRY_RUN=1; shift;;
|
|
237
|
-
-h|--help) sed -n '/^# Run:/,/^# Requires:/p' "$0" | sed 's/^# \{0,1\}//'; exit 0;;
|
|
238
|
-
*) echo "unknown arg: $1" >&2; exit 2;;
|
|
239
|
-
esac; done
|
|
240
|
-
case "$_mode" in
|
|
241
|
-
verify) kit_export_verify CLAUDE.md;;
|
|
242
|
-
matrix) kit_export_matrix;;
|
|
243
|
-
*) kit_export_all "$_out" "$_kdir";;
|
|
244
|
-
esac
|
|
2
|
+
# cckit-forwarding-stub: scripts/kit-export-project.sh moved to lib/verbs/kit-export-project.sh (#602). Installed projects call this path, so
|
|
3
|
+
# the stub stays until the release after 0.13 (decision 66). Sourced (bash or zsh) or run, it forwards.
|
|
4
|
+
_cckit_self="${BASH_SOURCE[0]:-$0}"
|
|
5
|
+
_cckit_fwd="$(cd "$(dirname "$_cckit_self")" 2>/dev/null && pwd)/../lib/verbs/kit-export-project.sh"
|
|
6
|
+
_cckit_sourced=0
|
|
7
|
+
if [ -n "${ZSH_VERSION:-}" ]; then
|
|
8
|
+
case "${ZSH_EVAL_CONTEXT:-}" in *file*) _cckit_sourced=1 ;; esac
|
|
9
|
+
elif [ "$_cckit_self" != "$0" ]; then
|
|
10
|
+
_cckit_sourced=1
|
|
245
11
|
fi
|
|
12
|
+
# shellcheck source=/dev/null
|
|
13
|
+
if [ "$_cckit_sourced" = 1 ]; then unset _cckit_self _cckit_sourced; . "$_cckit_fwd" "$@"; return $?; fi
|
|
14
|
+
exec bash "$_cckit_fwd" "$@"
|
|
@@ -1,175 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# kit-export-training.sh
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Nothing here is automatic — it runs only when explicitly invoked, and it never uploads anything.
|
|
12
|
-
# The output is plain JSONL on disk for the training pipeline; what you do with it is your call.
|
|
13
|
-
#
|
|
14
|
-
# Run:
|
|
15
|
-
# scripts/kit-export-training.sh [--builder PATH] [--match KEY ...] [--dirs DIR ...]
|
|
16
|
-
# [--sessions FILE ...] [--out PATH] [--split FRAC]
|
|
17
|
-
# [--final-only] [--drop-narration]
|
|
18
|
-
# Selection (pick one; default = the current git project, matched by its slug):
|
|
19
|
-
# --match KEY ... project-dir name substrings under ~/.claude/projects (e.g. my-app acme)
|
|
20
|
-
# --dirs DIR ... explicit ~/.claude/projects/<dir> session directories
|
|
21
|
-
# --sessions FILE ... individual *.jsonl transcript files to export (symlinked into a temp dir)
|
|
22
|
-
# Options:
|
|
23
|
-
# --builder PATH path to build_dataset.py (overrides KIT_DATASET_BUILDER + auto-discovery)
|
|
24
|
-
# --out PATH output JSONL (default: ~/.claude/exports/<slug>-training.jsonl)
|
|
25
|
-
# --split FRAC also emit train.jsonl/valid.jsonl with FRAC held out (e.g. 0.1)
|
|
26
|
-
# --final-only keep only the last assistant message per turn
|
|
27
|
-
# --drop-narration drop short process-narration openers
|
|
28
|
-
# Env:
|
|
29
|
-
# KIT_DATASET_BUILDER path to build_dataset.py (used when --builder is not given)
|
|
30
|
-
# KIT_PROJECTS_ROOT sessions root (default: ~/.claude/projects)
|
|
31
|
-
# KIT_ASSUME_YES skip the final confirm (for batch/CI).
|
|
32
|
-
#
|
|
33
|
-
# Builder discovery (config-driven, NO hardcoded user path): --builder > KIT_DATASET_BUILDER >
|
|
34
|
-
# a sibling `chat-datasets/build_dataset.py` next to the git repo root (then $PWD). If none resolve,
|
|
35
|
-
# the script stops and tells you to pass --builder or set KIT_DATASET_BUILDER.
|
|
36
|
-
#
|
|
37
|
-
# Redaction is ALWAYS on here — the builder masks by default and this script never passes --no-redact.
|
|
38
|
-
set -uo pipefail
|
|
39
|
-
|
|
40
|
-
# ---- locate self + optional shared cli helpers ----------------------------
|
|
41
|
-
_kxt_dir="$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
42
|
-
# shellcheck source=/dev/null
|
|
43
|
-
[ -f "$_kxt_dir/lib/kit-cli.sh" ] && . "$_kxt_dir/lib/kit-cli.sh" # provides kit_is_main (optional)
|
|
44
|
-
|
|
45
|
-
PROJECTS_ROOT="${KIT_PROJECTS_ROOT:-$HOME/.claude/projects}"
|
|
46
|
-
|
|
47
|
-
# Staged-sessions temp dir, cleaned on exit. Script-global so the EXIT trap can read it
|
|
48
|
-
# after _kxt_main returns (a function-local would be out of scope under `set -u`).
|
|
49
|
-
_KXT_TMP_SEL=""
|
|
50
|
-
_kxt_cleanup() { [ -n "${_KXT_TMP_SEL:-}" ] && rm -rf "$_KXT_TMP_SEL"; return 0; }
|
|
51
|
-
|
|
52
|
-
# ---- minimal logging ------------------------------------------------------
|
|
53
|
-
if [ -t 2 ]; then _AZ=$'\033[38;2;201;122;44m'; _RD=$'\033[38;2;194;87;56m'; _GR=$'\033[38;2;120;160;90m'; _DM=$'\033[2m'; _RS=$'\033[0m'
|
|
54
|
-
else _AZ=''; _RD=''; _GR=''; _DM=''; _RS=''; fi
|
|
55
|
-
_kxt_say() { printf '%s->%s %s\n' "$_AZ" "$_RS" "$*" >&2; }
|
|
56
|
-
_kxt_warn() { printf '%s!%s %s\n' "$_RD" "$_RS" "$*" >&2; }
|
|
57
|
-
_kxt_err() { printf '%sx%s %s\n' "$_RD" "$_RS" "$*" >&2; }
|
|
58
|
-
_kxt_die() { _kxt_err "$*"; exit 1; }
|
|
59
|
-
|
|
60
|
-
# ---- builder resolution (config-driven, generalized off any one machine) ---
|
|
61
|
-
# $1 = explicit --builder value (may be empty). Priority: explicit > env > sibling discovery.
|
|
62
|
-
_kxt_resolve_builder() {
|
|
63
|
-
local explicit="${1:-}"
|
|
64
|
-
[ -n "$explicit" ] && { printf '%s\n' "$explicit"; return 0; }
|
|
65
|
-
[ -n "${KIT_DATASET_BUILDER:-}" ] && { printf '%s\n' "$KIT_DATASET_BUILDER"; return 0; }
|
|
66
|
-
local rel="chat-datasets/build_dataset.py" root="" rootp="" base="" cand=""
|
|
67
|
-
root="$(git -C "$PWD" rev-parse --show-toplevel 2>/dev/null || true)"
|
|
68
|
-
[ -n "$root" ] && rootp="$(dirname "$root")"
|
|
69
|
-
for base in "$rootp" "$PWD" "$(dirname "$PWD")"; do
|
|
70
|
-
[ -n "$base" ] || continue
|
|
71
|
-
cand="$base/$rel"
|
|
72
|
-
[ -f "$cand" ] && { printf '%s\n' "$cand"; return 0; }
|
|
73
|
-
done
|
|
74
|
-
return 1
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
# ---- main (direct execution only; sourcing exposes the functions for tests) ---
|
|
78
|
-
_kxt_main() {
|
|
79
|
-
local BUILDER_FLAG="" OUT="" SPLIT="" SLUG="export" BUILDER="" _root=""
|
|
80
|
-
local -a MATCH=() DIRS=() SESSIONS=() EXTRA=() SEL=() SPLIT_ARGS=()
|
|
81
|
-
while [ $# -gt 0 ]; do case "$1" in
|
|
82
|
-
--builder) BUILDER_FLAG="${2:-}"; shift 2 ;;
|
|
83
|
-
--match) shift; while [ $# -gt 0 ] && [ "${1#--}" = "$1" ]; do MATCH+=("$1"); shift; done ;;
|
|
84
|
-
--dirs) shift; while [ $# -gt 0 ] && [ "${1#--}" = "$1" ]; do DIRS+=("$1"); shift; done ;;
|
|
85
|
-
--sessions) shift; while [ $# -gt 0 ] && [ "${1#--}" = "$1" ]; do SESSIONS+=("$1"); shift; done ;;
|
|
86
|
-
--out) OUT="${2:-}"; shift 2 ;;
|
|
87
|
-
--split) SPLIT="${2:-}"; shift 2 ;;
|
|
88
|
-
--final-only) EXTRA+=(--final-only); shift ;;
|
|
89
|
-
--drop-narration) EXTRA+=(--drop-narration); shift ;;
|
|
90
|
-
-h|--help) sed -n '13,33p' "$0" | sed 's/^# \{0,1\}//'; return 0 ;;
|
|
91
|
-
*) _kxt_die "unknown flag: $1" ;;
|
|
92
|
-
esac; done
|
|
93
|
-
|
|
94
|
-
# ---- preflight ----------------------------------------------------------
|
|
95
|
-
command -v python3 >/dev/null 2>&1 || _kxt_die "python3 is required."
|
|
96
|
-
BUILDER="$(_kxt_resolve_builder "$BUILDER_FLAG")" || _kxt_die \
|
|
97
|
-
"dataset builder not found — pass --builder PATH or set KIT_DATASET_BUILDER (looked for chat-datasets/build_dataset.py beside the repo root)."
|
|
98
|
-
[ -f "$BUILDER" ] || _kxt_die "dataset builder not found: $BUILDER"
|
|
99
|
-
|
|
100
|
-
# ---- resolve a default selection from the current git project -----------
|
|
101
|
-
if [ ${#MATCH[@]} -eq 0 ] && [ ${#DIRS[@]} -eq 0 ] && [ ${#SESSIONS[@]} -eq 0 ]; then
|
|
102
|
-
_root="$(git -C "$PWD" rev-parse --show-toplevel 2>/dev/null || true)"
|
|
103
|
-
[ -n "$_root" ] || _kxt_die "no selection given and not inside a git repo — pass --match/--dirs/--sessions."
|
|
104
|
-
SLUG="$(basename "$_root" | tr '[:upper:]' '[:lower:]')"
|
|
105
|
-
MATCH=("$SLUG")
|
|
106
|
-
_kxt_say "no selection given — defaulting to the current project (match: $SLUG)"
|
|
107
|
-
elif [ ${#MATCH[@]} -gt 0 ]; then
|
|
108
|
-
SLUG="$(printf '%s' "${MATCH[0]}" | tr '[:upper:]' '[:lower:]')"
|
|
109
|
-
fi
|
|
110
|
-
|
|
111
|
-
# ---- default output path ------------------------------------------------
|
|
112
|
-
if [ -z "$OUT" ]; then
|
|
113
|
-
mkdir -p "$HOME/.claude/exports"
|
|
114
|
-
OUT="$HOME/.claude/exports/${SLUG}-training.jsonl"
|
|
115
|
-
fi
|
|
116
|
-
mkdir -p "$(dirname "$OUT")"
|
|
117
|
-
|
|
118
|
-
# ---- build the selection args for the builder ---------------------------
|
|
119
|
-
# --sessions: stage the chosen transcript files into a temp dir and pass via --dirs,
|
|
120
|
-
# since build_dataset.py selects at directory granularity.
|
|
121
|
-
local f=""
|
|
122
|
-
trap _kxt_cleanup EXIT
|
|
123
|
-
|
|
124
|
-
if [ ${#SESSIONS[@]} -gt 0 ]; then
|
|
125
|
-
_KXT_TMP_SEL="$(mktemp -d)"
|
|
126
|
-
for f in "${SESSIONS[@]}"; do
|
|
127
|
-
[ -f "$f" ] || _kxt_die "session file not found: $f"
|
|
128
|
-
ln -s "$(cd "$(dirname "$f")" && pwd)/$(basename "$f")" "$_KXT_TMP_SEL/$(basename "$f")"
|
|
129
|
-
done
|
|
130
|
-
SEL=(--dirs "$_KXT_TMP_SEL")
|
|
131
|
-
_kxt_say "exporting ${#SESSIONS[@]} selected session file(s)"
|
|
132
|
-
elif [ ${#DIRS[@]} -gt 0 ]; then
|
|
133
|
-
SEL=(--dirs "${DIRS[@]}")
|
|
134
|
-
_kxt_say "exporting from ${#DIRS[@]} session director(ies)"
|
|
135
|
-
else
|
|
136
|
-
SEL=(--match "${MATCH[@]}")
|
|
137
|
-
_kxt_say "exporting sessions matching: ${MATCH[*]}"
|
|
138
|
-
fi
|
|
139
|
-
|
|
140
|
-
[ -d "$PROJECTS_ROOT" ] || _kxt_warn "sessions root $PROJECTS_ROOT not found — the export may be empty."
|
|
141
|
-
|
|
142
|
-
# ---- confirm (opt-in) ---------------------------------------------------
|
|
143
|
-
if [ -z "${KIT_ASSUME_YES:-}" ] && [ -t 0 ]; then
|
|
144
|
-
printf '%sExport redacted training JSONL to %s ? [y/N] %s' "$_DM" "$OUT" "$_RS" >&2
|
|
145
|
-
local _c=""; read -r _c < /dev/tty || true
|
|
146
|
-
case "$_c" in y|Y|yes|YES) ;; *) _kxt_die "aborted — nothing was written." ;; esac
|
|
147
|
-
fi
|
|
148
|
-
|
|
149
|
-
# ---- run the builder with redaction ON (always) -------------------------
|
|
150
|
-
[ -n "$SPLIT" ] && SPLIT_ARGS=(--split "$SPLIT")
|
|
151
|
-
_kxt_say "running build_dataset.py (redaction ON): $BUILDER"
|
|
152
|
-
python3 "$BUILDER" "${SEL[@]}" --out "$OUT" ${EXTRA[@]+"${EXTRA[@]}"} ${SPLIT_ARGS[@]+"${SPLIT_ARGS[@]}"} \
|
|
153
|
-
|| _kxt_die "build_dataset.py failed — nothing trustworthy was written."
|
|
154
|
-
|
|
155
|
-
# ---- report -------------------------------------------------------------
|
|
156
|
-
local STATS="${OUT%.jsonl}.stats.json"
|
|
157
|
-
printf '\n' >&2
|
|
158
|
-
_kxt_say "Wrote training data:"
|
|
159
|
-
printf ' %sJSONL:%s %s\n' "$_GR" "$_RS" "$OUT" >&2
|
|
160
|
-
[ -f "$STATS" ] && printf ' %sstats:%s %s\n' "$_GR" "$_RS" "$STATS" >&2
|
|
161
|
-
if [ -n "$SPLIT" ]; then
|
|
162
|
-
printf ' %ssplit:%s %s/train.jsonl + valid.jsonl\n' "$_GR" "$_RS" "$(dirname "$OUT")" >&2
|
|
163
|
-
fi
|
|
164
|
-
printf '\n' >&2
|
|
165
|
-
_kxt_warn "Redaction was applied automatically, but it is NOT a guarantee."
|
|
166
|
-
_kxt_warn "VERIFY the output for any leftover secrets, tokens, private names, or customer data"
|
|
167
|
-
_kxt_warn "BEFORE sharing it or feeding it into the training pipeline."
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
# Run only on direct execution; `source`-ing the file just defines the functions (for tests).
|
|
171
|
-
if command -v kit_is_main >/dev/null 2>&1; then
|
|
172
|
-
kit_is_main && _kxt_main "$@"
|
|
173
|
-
else
|
|
174
|
-
[ "${BASH_SOURCE[0]:-$0}" = "${0}" ] && _kxt_main "$@"
|
|
2
|
+
# cckit-forwarding-stub: scripts/kit-export-training.sh moved to lib/verbs/kit-export-training.sh (#602). Installed projects call this path, so
|
|
3
|
+
# the stub stays until the release after 0.13 (decision 66). Sourced (bash or zsh) or run, it forwards.
|
|
4
|
+
_cckit_self="${BASH_SOURCE[0]:-$0}"
|
|
5
|
+
_cckit_fwd="$(cd "$(dirname "$_cckit_self")" 2>/dev/null && pwd)/../lib/verbs/kit-export-training.sh"
|
|
6
|
+
_cckit_sourced=0
|
|
7
|
+
if [ -n "${ZSH_VERSION:-}" ]; then
|
|
8
|
+
case "${ZSH_EVAL_CONTEXT:-}" in *file*) _cckit_sourced=1 ;; esac
|
|
9
|
+
elif [ "$_cckit_self" != "$0" ]; then
|
|
10
|
+
_cckit_sourced=1
|
|
175
11
|
fi
|
|
12
|
+
# shellcheck source=/dev/null
|
|
13
|
+
if [ "$_cckit_sourced" = 1 ]; then unset _cckit_self _cckit_sourced; . "$_cckit_fwd" "$@"; return $?; fi
|
|
14
|
+
exec bash "$_cckit_fwd" "$@"
|
package/scripts/kit-onboard.sh
CHANGED
|
@@ -1,69 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# kit-onboard.sh
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# scripts/kit-onboard.sh global --answers FILE [--user U]
|
|
12
|
-
# scripts/kit-onboard.sh project --answers FILE [--dir DIR]
|
|
13
|
-
# scripts/kit-onboard.sh status # has the global profile been created?
|
|
14
|
-
# Env: KIT_ASSUME_YES / KIT_DRY_RUN (project tier, via kit-operate). Requires: jq.
|
|
15
|
-
|
|
16
|
-
set -uo pipefail
|
|
17
|
-
_ob_dir="$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
18
|
-
# shellcheck source=/dev/null
|
|
19
|
-
. "$_ob_dir/lib/kit-interview.sh" # catalog/apply (pulls kit-cli + kit-profile)
|
|
20
|
-
# shellcheck source=/dev/null
|
|
21
|
-
. "$_ob_dir/lib/kit-operate.sh" # four-beat machine + manifest (project tier)
|
|
22
|
-
|
|
23
|
-
# kit_onboard_global <answersfile> [user]
|
|
24
|
-
# Ensure the profile exists (schema + user + slug), then merge the global-tier answers onto it.
|
|
25
|
-
kit_onboard_global() {
|
|
26
|
-
command -v jq >/dev/null 2>&1 || kit_die "jq required"
|
|
27
|
-
local answers="$1" user="${2:-}"
|
|
28
|
-
[ -f "$answers" ] || kit_die "answers file missing: $answers"
|
|
29
|
-
kit_profile_init "$user" || kit_die "could not init profile"
|
|
30
|
-
local p merged tmp; p="$(kit_profile_path "$user")"
|
|
31
|
-
merged="$(kit_interview_apply global "$answers" "$p")" || kit_die "deriving global profile failed"
|
|
32
|
-
tmp="$(mktemp)"; printf '%s\n' "$merged" > "$tmp" && mv "$tmp" "$p" || { rm -f "$tmp"; kit_die "write failed"; }
|
|
33
|
-
kit_say "global profile updated: $p"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
# kit_onboard_project <answersfile> [targetdir]
|
|
37
|
-
# Merge the project-tier answers onto ./.claude/kit.config.json through kit-operate (manifest).
|
|
38
|
-
kit_onboard_project() {
|
|
39
|
-
command -v jq >/dev/null 2>&1 || kit_die "jq required"
|
|
40
|
-
local answers="$1" target="${2:-$PWD}"
|
|
41
|
-
[ -f "$answers" ] || kit_die "answers file missing: $answers"
|
|
42
|
-
target="$(cd "$target" 2>/dev/null && pwd)" || kit_die "no such dir: $target"
|
|
43
|
-
cd "$target" || kit_die "cannot enter $target"
|
|
44
|
-
local cfg=".claude/kit.config.json" base merged
|
|
45
|
-
base=""; [ -f "$cfg" ] && base="$cfg"
|
|
46
|
-
merged="$(kit_interview_apply project "$answers" "$base")" || kit_die "deriving project config failed"
|
|
47
|
-
kit_say "kit onboard project -> $target/$cfg"
|
|
48
|
-
printf '%s\n' "$merged" | kit_op_write_content "$cfg" A onboard
|
|
49
|
-
case $? in 0|10) return 0;; *) kit_die "failed to write $cfg";; esac
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
# CLI
|
|
53
|
-
if kit_is_main; then
|
|
54
|
-
_sub="${1:-}"; shift 2>/dev/null || true
|
|
55
|
-
_answers=""; _user=""; _dir="$PWD"
|
|
56
|
-
while [ $# -gt 0 ]; do case "$1" in
|
|
57
|
-
--answers) _answers="$2"; shift 2;;
|
|
58
|
-
--user) _user="$2"; shift 2;;
|
|
59
|
-
--dir) _dir="$2"; shift 2;;
|
|
60
|
-
-h|--help) echo "usage: kit-onboard.sh global|project|status [--answers F] [--user U] [--dir D]"; exit 0;;
|
|
61
|
-
*) kit_die "unknown arg: $1";;
|
|
62
|
-
esac; done
|
|
63
|
-
case "$_sub" in
|
|
64
|
-
global) kit_onboard_global "$_answers" "$_user";;
|
|
65
|
-
project) kit_onboard_project "$_answers" "$_dir";;
|
|
66
|
-
status) if kit_profile_exists "$_user"; then echo "profile: $(kit_profile_path "$_user") (exists)"; else echo "profile: none yet — run the global interview"; exit 1; fi;;
|
|
67
|
-
*) kit_die "usage: kit-onboard.sh global|project|status ...";;
|
|
68
|
-
esac
|
|
2
|
+
# cckit-forwarding-stub: scripts/kit-onboard.sh moved to lib/verbs/kit-onboard.sh (#602). Installed projects call this path, so
|
|
3
|
+
# the stub stays until the release after 0.13 (decision 66). Sourced (bash or zsh) or run, it forwards.
|
|
4
|
+
_cckit_self="${BASH_SOURCE[0]:-$0}"
|
|
5
|
+
_cckit_fwd="$(cd "$(dirname "$_cckit_self")" 2>/dev/null && pwd)/../lib/verbs/kit-onboard.sh"
|
|
6
|
+
_cckit_sourced=0
|
|
7
|
+
if [ -n "${ZSH_VERSION:-}" ]; then
|
|
8
|
+
case "${ZSH_EVAL_CONTEXT:-}" in *file*) _cckit_sourced=1 ;; esac
|
|
9
|
+
elif [ "$_cckit_self" != "$0" ]; then
|
|
10
|
+
_cckit_sourced=1
|
|
69
11
|
fi
|
|
12
|
+
# shellcheck source=/dev/null
|
|
13
|
+
if [ "$_cckit_sourced" = 1 ]; then unset _cckit_self _cckit_sourced; . "$_cckit_fwd" "$@"; return $?; fi
|
|
14
|
+
exec bash "$_cckit_fwd" "$@"
|