@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
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# terms-check.sh — the terms under ontology/terms/, their homes, and the skill routing.
|
|
3
|
+
#
|
|
4
|
+
# bash lib/core/terms-check.sh [--root <dir>] [--llm]
|
|
5
|
+
#
|
|
6
|
+
# 1. Every ontology/terms/<Term>.json validates (format: ontology/README.md): exactly the seven
|
|
7
|
+
# fields id, label, definition, is_not, avoid, home, status; a sapling or a tree has a home.
|
|
8
|
+
# 2. Every home resolves: `cli` is a top-level verb of bin/cckit (the first word is checked, so
|
|
9
|
+
# `effort plan` resolves through `effort`), `skill` is a folder with a SKILL.md under skills/ or
|
|
10
|
+
# .claude/skills/, `rule` is a file. A seed's unresolved home is printed, not counted a defect.
|
|
11
|
+
# 3. kit/skills/routing.yaml parses in its strict subset (stated at the top of that file); every entry
|
|
12
|
+
# names an existing skill and an existing term or `none`; every skill under skills/ is routed;
|
|
13
|
+
# each skill's `terms:` frontmatter line equals its routing terms.
|
|
14
|
+
# 4. AGENTS.md's "Which skill does what" table has one row per routed skill, with the same tasks
|
|
15
|
+
# (joined by " · ") and terms (joined by ", ") as routing.yaml.
|
|
16
|
+
# 5. docs-site/src/content/docs/skills.mdx, when present, has one row per routed skill under the
|
|
17
|
+
# `## <Label>` heading of one of its terms (`none` → "The kit itself") and no row for an unrouted one.
|
|
18
|
+
#
|
|
19
|
+
# Prints one `x <where>: <reason>` line per defect and one line of counts; --llm prints the counts
|
|
20
|
+
# as one JSON object on stdout and the defect lines on stderr. Exit 0 with no defect, 1 with one, 2 when jq is missing or ontology/terms/ is
|
|
21
|
+
# absent. bash + jq + awk only: cckit installs no YAML parser, so terms are JSON and the routing
|
|
22
|
+
# file is a flat subset awk reads. lib/core/check.sh runs this in warn mode: it prints, never fails.
|
|
23
|
+
set -uo pipefail
|
|
24
|
+
|
|
25
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
26
|
+
OUT=human
|
|
27
|
+
while [ $# -gt 0 ]; do
|
|
28
|
+
case "$1" in
|
|
29
|
+
--root) ROOT="$(cd "${2:?--root needs a directory}" && pwd)"; shift 2 ;;
|
|
30
|
+
--json|--llm|--output=json) OUT=json; shift ;;
|
|
31
|
+
-h|--help) sed -n '2,13p' "$0"; exit 0 ;;
|
|
32
|
+
*) echo "terms-check: unknown argument '$1'" >&2; exit 2 ;;
|
|
33
|
+
esac
|
|
34
|
+
done
|
|
35
|
+
cd "$ROOT" || exit 2
|
|
36
|
+
|
|
37
|
+
command -v jq >/dev/null 2>&1 || { echo "terms-check: jq is required" >&2; exit 2; }
|
|
38
|
+
[ -d ontology/terms ] || { echo "terms-check: no ontology/terms/ under $ROOT" >&2; exit 2; }
|
|
39
|
+
# The kit's own skills live under kit/skills/ (the self-host layout); a project keeps them in skills/.
|
|
40
|
+
SK=skills; [ -d kit/skills ] && SK=kit/skills
|
|
41
|
+
|
|
42
|
+
# Defect lines and notes go to stdout for a person; with --llm they go to stderr so stdout is one JSON object.
|
|
43
|
+
defects=0
|
|
44
|
+
say() { if [ "$OUT" = json ]; then printf '%s\n' "$*" >&2; else printf '%s\n' "$*"; fi; }
|
|
45
|
+
x() { say "x $*"; defects=$((defects + 1)); }
|
|
46
|
+
|
|
47
|
+
# ── 1. every term validates ──────────────────────────────────────────────────────────────────────
|
|
48
|
+
TERM_FILTER='
|
|
49
|
+
def is_words: (type == "string" and length > 0)
|
|
50
|
+
or (type == "array" and length > 0 and all(.[]; type == "string" and length > 0));
|
|
51
|
+
def is_list: type == "array" and all(.[]; type == "string" and length > 0);
|
|
52
|
+
[ (if (.id | type) == "string" and (.id | test("^[A-Z][A-Za-z0-9]*$")) then empty
|
|
53
|
+
else "id: not PascalCase" end),
|
|
54
|
+
(if .id == $stem then empty else "id: does not equal the file name \($stem)" end),
|
|
55
|
+
(if .label | is_words then empty else "label: a word, or a list of words" end),
|
|
56
|
+
(if (.definition | type) == "string" and (.definition | length) >= 20 then empty
|
|
57
|
+
else "definition: under 20 characters" end),
|
|
58
|
+
(if (.is_not | type) == "array" and (.is_not | length) >= 1 and (.is_not | is_list) then empty
|
|
59
|
+
else "is_not: needs at least one clause" end),
|
|
60
|
+
(if .avoid | is_list then empty else "avoid: a list of words (may be empty)" end),
|
|
61
|
+
(if (.home | type) == "object" and ((.home | keys) - ["cli", "skill", "rule"] | length) == 0
|
|
62
|
+
and all(.home[]; type == "string" and length > 0) then empty
|
|
63
|
+
else "home: an object with any of cli, skill, rule" end),
|
|
64
|
+
(if (.status | type) == "string" and (.status | IN("seed", "sapling", "tree")) then empty
|
|
65
|
+
else "status: seed, sapling or tree" end),
|
|
66
|
+
(if .status != "seed" and (.home | type) == "object" and (.home | length) == 0
|
|
67
|
+
then "home: a sapling or a tree needs at least one" else empty end),
|
|
68
|
+
((keys - ["id", "label", "definition", "is_not", "avoid", "home", "status"])[]
|
|
69
|
+
| "unknown field: \(.)")
|
|
70
|
+
] | .[]'
|
|
71
|
+
|
|
72
|
+
terms=0
|
|
73
|
+
valid_terms=""
|
|
74
|
+
for f in ontology/terms/*.json; do
|
|
75
|
+
[ -e "$f" ] || break
|
|
76
|
+
terms=$((terms + 1))
|
|
77
|
+
stem="$(basename "$f" .json)"
|
|
78
|
+
if ! jq -e 'type == "object"' "$f" >/dev/null 2>&1; then
|
|
79
|
+
x "$f: not a JSON object"; continue
|
|
80
|
+
fi
|
|
81
|
+
bad=0
|
|
82
|
+
while IFS= read -r line; do
|
|
83
|
+
[ -n "$line" ] || continue
|
|
84
|
+
x "$f: $line"; bad=1
|
|
85
|
+
done < <(jq -r --arg stem "$stem" "$TERM_FILTER" "$f")
|
|
86
|
+
[ "$bad" -eq 0 ] && valid_terms="$valid_terms $stem"
|
|
87
|
+
done
|
|
88
|
+
[ "$terms" -gt 0 ] || x "ontology/terms/: no term file"
|
|
89
|
+
|
|
90
|
+
# ── 2. every home resolves ───────────────────────────────────────────────────────────────────────
|
|
91
|
+
# Top-level verbs: the two-space-indented `label)` lines of the dispatcher's case, `|`-separated.
|
|
92
|
+
verbs=""
|
|
93
|
+
if [ -f bin/cckit ]; then
|
|
94
|
+
verbs="$(grep -E '^ [a-z][a-z0-9|-]*\)' bin/cckit | sed -E 's/^ ([a-z0-9|-]*)\).*/\1/' | tr '|' '\n' | sort -u)"
|
|
95
|
+
fi
|
|
96
|
+
skill_dir() { # the folder holding <name>/SKILL.md, or nothing
|
|
97
|
+
for d in $SK .claude/skills; do [ -f "$d/$1/SKILL.md" ] && { echo "$d/$1"; return 0; }; done; return 1
|
|
98
|
+
}
|
|
99
|
+
homes=0; homes_ok=0
|
|
100
|
+
for stem in $valid_terms; do
|
|
101
|
+
f="ontology/terms/$stem.json"
|
|
102
|
+
status="$(jq -r .status "$f")"
|
|
103
|
+
while IFS=$'\t' read -r kind value; do
|
|
104
|
+
[ -n "$kind" ] || continue
|
|
105
|
+
homes=$((homes + 1)); ok=0
|
|
106
|
+
case "$kind" in
|
|
107
|
+
cli) grep -qx -- "${value%% *}" <<< "$verbs" && ok=1 ;;
|
|
108
|
+
skill) skill_dir "$value" >/dev/null && ok=1 ;;
|
|
109
|
+
rule) [ -f "$value" ] && ok=1 ;;
|
|
110
|
+
esac
|
|
111
|
+
if [ "$ok" -eq 1 ]; then homes_ok=$((homes_ok + 1))
|
|
112
|
+
elif [ "$status" = seed ]; then say " seed $stem: home $kind $value does not exist yet (allowed)"
|
|
113
|
+
else x "$f: home $kind $value does not exist"
|
|
114
|
+
fi
|
|
115
|
+
done < <(jq -r '.home | to_entries[] | "\(.key)\t\(.value)"' "$f")
|
|
116
|
+
done
|
|
117
|
+
|
|
118
|
+
# ── 3. the routing table ─────────────────────────────────────────────────────────────────────────
|
|
119
|
+
# routing.yaml → `task<TAB>skill<TAB>term` rows, or `!<line>: <reason>` for a line outside the subset.
|
|
120
|
+
routes=""
|
|
121
|
+
if [ -f $SK/routing.yaml ]; then
|
|
122
|
+
routes="$(awk '
|
|
123
|
+
function bad(why) { printf "!%d: %s\n", NR, why; expect = 0; next_ok = 0 }
|
|
124
|
+
BEGIN { expect = 0 }
|
|
125
|
+
/^[[:space:]]*(#|$)/ { next }
|
|
126
|
+
expect == 0 {
|
|
127
|
+
if ($0 ~ /^- task: "[^"]+"$/) { task = $0; sub(/^- task: "/, "", task); sub(/"$/, "", task); expect = 1; next }
|
|
128
|
+
bad("expected `- task: \"...\"`")
|
|
129
|
+
}
|
|
130
|
+
expect == 1 {
|
|
131
|
+
if ($0 ~ /^ skill: [a-z][a-z0-9-]*$/) { skill = $2; expect = 2; next }
|
|
132
|
+
bad("expected ` skill: <name>`")
|
|
133
|
+
}
|
|
134
|
+
expect == 2 {
|
|
135
|
+
if ($0 ~ /^ term: ([A-Z][A-Za-z0-9]*|none)$/) { printf "%s\t%s\t%s\n", task, skill, $2; expect = 0; next }
|
|
136
|
+
bad("expected ` term: <Term>` or ` term: none`")
|
|
137
|
+
}
|
|
138
|
+
END { if (expect != 0) printf "!%d: entry ends before its term line\n", NR }
|
|
139
|
+
' $SK/routing.yaml)"
|
|
140
|
+
while IFS= read -r line; do
|
|
141
|
+
case "$line" in '!'*) x "$SK/routing.yaml:${line#!}" ;; esac
|
|
142
|
+
done <<< "$routes"
|
|
143
|
+
routes="$(printf '%s\n' "$routes" | grep -v '^!' || true)"
|
|
144
|
+
else
|
|
145
|
+
x "$SK/routing.yaml: missing"
|
|
146
|
+
fi
|
|
147
|
+
|
|
148
|
+
all_terms="$(for f in ontology/terms/*.json; do [ -e "$f" ] && basename "$f" .json; done)"
|
|
149
|
+
routed_skills="$(printf '%s\n' "$routes" | awk -F'\t' 'NF==3{print $2}' | sort -u | grep . || true)"
|
|
150
|
+
no_term_skills="$(printf '%s\n' "$routes" | awk -F'\t' 'NF==3 && $3=="none"{print $2}' | sort -u | grep . || true)"
|
|
151
|
+
while IFS=$'\t' read -r task skill term; do
|
|
152
|
+
[ -n "$skill" ] || continue
|
|
153
|
+
skill_dir "$skill" >/dev/null || x "$SK/routing.yaml: skill $skill has no SKILL.md"
|
|
154
|
+
[ "$term" = none ] || grep -qx -- "$term" <<< "$all_terms" || x "$SK/routing.yaml: term $term is not under ontology/terms/"
|
|
155
|
+
done <<< "$routes"
|
|
156
|
+
|
|
157
|
+
skills_total=0; unrouted=0; routed=0
|
|
158
|
+
for d in $SK/*/; do
|
|
159
|
+
[ -f "${d}SKILL.md" ] || continue
|
|
160
|
+
s="$(basename "$d")"; skills_total=$((skills_total + 1))
|
|
161
|
+
if grep -qx -- "$s" <<< "$routed_skills"; then
|
|
162
|
+
routed=$((routed + 1))
|
|
163
|
+
want="$(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{print $3}' | sort -u | awk '{a = (a ? a ", " : "") $0} END{print a}')"
|
|
164
|
+
have="$(awk '/^---/{c++; if (c==2) exit; next} c==1 && /^terms:/{sub(/^terms:[[:space:]]*/, ""); print; exit}' "${d}SKILL.md" \
|
|
165
|
+
| tr ',' '\n' | sed 's/^[[:space:]]*//; s/[[:space:]]*$//' | grep . | sort -u | awk '{a = (a ? a ", " : "") $0} END{print a}')"
|
|
166
|
+
[ "$have" = "$want" ] || x "${d}SKILL.md: terms: '$have' but $SK/routing.yaml says '$want'"
|
|
167
|
+
else
|
|
168
|
+
unrouted=$((unrouted + 1)); x "$SK/$s: not routed in $SK/routing.yaml"
|
|
169
|
+
fi
|
|
170
|
+
done
|
|
171
|
+
|
|
172
|
+
# ── 4. the same table in AGENTS.md ───────────────────────────────────────────────────────────────
|
|
173
|
+
if [ -f AGENTS.md ]; then
|
|
174
|
+
# rows of the section, as `skill<TAB>tasks<TAB>terms`
|
|
175
|
+
agents_rows="$(awk -F' \\| ' '
|
|
176
|
+
/^## Which skill does what/ { in_sec = 1; next }
|
|
177
|
+
in_sec && /^## / { exit }
|
|
178
|
+
in_sec && /^\| / && !/^\| What you want/ && !/^\| ---/ {
|
|
179
|
+
line = $0; sub(/^\| /, "", line); sub(/ \|$/, "", line); n = split(line, c, / \| /)
|
|
180
|
+
if (n == 3) { gsub(/`/, "", c[2]); printf "%s\t%s\t%s\n", c[2], c[1], c[3] }
|
|
181
|
+
}' AGENTS.md)"
|
|
182
|
+
if [ -z "$agents_rows" ]; then
|
|
183
|
+
x 'AGENTS.md: no "Which skill does what" table'
|
|
184
|
+
else
|
|
185
|
+
for s in $routed_skills; do
|
|
186
|
+
want_tasks="$(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{a = (a ? a " · " : "") $1} END{print a}')"
|
|
187
|
+
want_terms="$(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{a = (a ? a ", " : "") $3} END{print a}')"
|
|
188
|
+
row="$(printf '%s\n' "$agents_rows" | awk -F'\t' -v s="$s" '$1==s{print; exit}')"
|
|
189
|
+
if [ -z "$row" ]; then x "AGENTS.md: no row for $s"; continue; fi
|
|
190
|
+
[ "$(printf '%s' "$row" | cut -f2)" = "$want_tasks" ] || x "AGENTS.md: $s tasks differ from $SK/routing.yaml"
|
|
191
|
+
[ "$(printf '%s' "$row" | cut -f3)" = "$want_terms" ] || x "AGENTS.md: $s terms differ from $SK/routing.yaml"
|
|
192
|
+
done
|
|
193
|
+
while IFS=$'\t' read -r s _; do
|
|
194
|
+
[ -n "$s" ] || continue
|
|
195
|
+
grep -qx -- "$s" <<< "$routed_skills" || x "AGENTS.md: row for $s, which $SK/routing.yaml does not route"
|
|
196
|
+
done <<< "$agents_rows"
|
|
197
|
+
fi
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
# ── 5. the skills page, grouped by term ─────────────────────────────────────────────────────────
|
|
201
|
+
# docs-site/src/content/docs/skills.mdx (when present): every routed skill has one row, each row sits
|
|
202
|
+
# under the `## <Label>` heading of one of its terms (the term's preferred label, first letter
|
|
203
|
+
# upper-cased; `none` → "The kit itself"), and no row names a skill routing.yaml does not route.
|
|
204
|
+
PAGE=docs-site/src/content/docs/skills.mdx
|
|
205
|
+
if [ -f "$PAGE" ]; then
|
|
206
|
+
heading_of() { # heading_of <Term|none>
|
|
207
|
+
if [ "$1" = none ]; then echo "The kit itself"; return; fi
|
|
208
|
+
jq -r '(if (.label | type) == "array" then .label[0] else .label end) | (.[:1] | ascii_upcase) + .[1:]' "ontology/terms/$1.json"
|
|
209
|
+
}
|
|
210
|
+
# rows as `skill<TAB>heading`, H2 headings only
|
|
211
|
+
page_rows="$(awk '
|
|
212
|
+
/^## / { h = $0; sub(/^## /, "", h); next }
|
|
213
|
+
/^\| `[a-z][a-z0-9-]*` \|/ { s = $2; gsub(/`/, "", s); printf "%s\t%s\n", s, h }' "$PAGE")"
|
|
214
|
+
for s in $routed_skills; do
|
|
215
|
+
found="$(printf '%s\n' "$page_rows" | awk -F'\t' -v s="$s" '$1==s{print $2}')"
|
|
216
|
+
n_rows="$(printf '%s\n' "$found" | grep -c . || true)"
|
|
217
|
+
if [ "$n_rows" -eq 0 ]; then x "$PAGE: no row for $s"; continue; fi
|
|
218
|
+
[ "$n_rows" -eq 1 ] || x "$PAGE: $s has $n_rows rows"
|
|
219
|
+
ok=0
|
|
220
|
+
for term in $(printf '%s\n' "$routes" | awk -F'\t' -v s="$s" '$2==s{print $3}' | sort -u); do
|
|
221
|
+
[ "$found" = "$(heading_of "$term")" ] && ok=1
|
|
222
|
+
done
|
|
223
|
+
[ "$ok" -eq 1 ] || x "$PAGE: $s is under \"$found\", not under a heading of its terms"
|
|
224
|
+
done
|
|
225
|
+
while IFS=$'\t' read -r s _; do
|
|
226
|
+
[ -n "$s" ] || continue
|
|
227
|
+
[ -f "$SK/$s/SKILL.md" ] || continue # a scaffolded template skill, not one of skills/
|
|
228
|
+
grep -qx -- "$s" <<< "$routed_skills" || x "$PAGE: row for $s, which $SK/routing.yaml does not route"
|
|
229
|
+
done <<< "$page_rows"
|
|
230
|
+
fi
|
|
231
|
+
|
|
232
|
+
# ── counts ───────────────────────────────────────────────────────────────────────────────────────
|
|
233
|
+
no_term=$(printf '%s\n' "$no_term_skills" | grep -c . || true)
|
|
234
|
+
if [ "$OUT" = json ]; then
|
|
235
|
+
jq -n --argjson terms "$terms" --argjson homes "$homes" --argjson homes_ok "$homes_ok" \
|
|
236
|
+
--argjson skills "$skills_total" --argjson routed "$routed" --argjson unrouted "$unrouted" \
|
|
237
|
+
--argjson no_term "$no_term" --argjson defects "$defects" \
|
|
238
|
+
'{terms: $terms, homes: $homes, homes_resolved: $homes_ok, skills: $skills, skills_routed: $routed,
|
|
239
|
+
unrouted: $unrouted, skills_no_term: $no_term, defects: $defects, ok: ($defects == 0)}'
|
|
240
|
+
else
|
|
241
|
+
printf 'terms-check: %d terms · %d/%d homes resolved · %d/%d skills routed · %d unrouted · %d with no term · %d defects\n' \
|
|
242
|
+
"$terms" "$homes_ok" "$homes" "$routed" "$skills_total" "$unrouted" "$no_term" "$defects"
|
|
243
|
+
fi
|
|
244
|
+
[ "$defects" -eq 0 ]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# test-env-test.sh — test_env_seal removes the caller's kit environment, and only that (#369).
|
|
3
|
-
# Run: bash
|
|
3
|
+
# Run: bash lib/core/test-env-test.sh
|
|
4
4
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
5
5
|
set -u
|
|
6
6
|
LIB="$(cd "$(dirname "$0")" && pwd)"
|
|
@@ -18,7 +18,7 @@ case " $args " in *" -u KIT_CONFIG "*) echo "ok: unset args name KIT_CONFIG" ;;
|
|
|
18
18
|
case " $args " in *" -u KEEP_ME "*) echo "FAIL: unset args name a non-kit variable: $args"; fail=1 ;; *) echo "ok: unset args leave other variables alone" ;; esac
|
|
19
19
|
t "seal unsets KIT_*, CCKIT_*, EFFORT_*, CLAUDE_CODE_REMOTE and keeps the rest" "$after" "unset unset unset unset 1"
|
|
20
20
|
|
|
21
|
-
# The runner seals too: a test run under
|
|
21
|
+
# The runner seals too: a test run under lib/core/test.sh never sees the caller's KIT_CONFIG.
|
|
22
22
|
if [ -n "${KIT_CONFIG:-}" ]; then echo "FAIL: KIT_CONFIG leaked into this test"; fail=1; else echo "ok: no KIT_CONFIG reached this test"; fi
|
|
23
23
|
|
|
24
24
|
[ "$fail" -eq 0 ] && echo "test-env: all passed" || echo "test-env: FAILURES"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# CLAUDE_CODE_REMOTE) in this shell
|
|
14
14
|
# test_env_unset_args print `-u NAME` pairs for env(1), one per line (the runner uses these)
|
|
15
15
|
#
|
|
16
|
-
#
|
|
16
|
+
# lib/core/test.sh scrubs the same set before it runs each test; this covers a test run directly.
|
|
17
17
|
# errors: pure — no side effects beyond unsetting variables in the current shell
|
|
18
18
|
# bash 3.2 + zsh compatible.
|
|
19
19
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# test-runner-test.sh —
|
|
2
|
+
# test-runner-test.sh — lib/core/test.sh runs files in parallel and still reports correctly (#455).
|
|
3
3
|
#
|
|
4
|
-
# Copies the runner and
|
|
4
|
+
# Copies the runner and lib/core/test-env.sh into a throwaway tree with fixture `*-test.sh`
|
|
5
5
|
# files, then asserts on the copy's exit code and output:
|
|
6
6
|
# - a failing file fails the run, and its output is printed whole, in one block
|
|
7
7
|
# - two files really run at the same time under -j 2 (each waits for the other's marker file)
|
|
8
8
|
# - a file marked `# test-runner: serial` is held back and run after the parallel phase
|
|
9
9
|
# - --serial, a path pattern, and a bad job count behave as the header of test.sh says
|
|
10
10
|
# - every test is sealed from KIT_* variables and runs with commit signing off
|
|
11
|
-
# Run: bash
|
|
11
|
+
# Run: bash lib/core/test-runner-test.sh
|
|
12
12
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
13
13
|
set -u
|
|
14
|
-
ROOT="$(cd "$(dirname "$0")
|
|
14
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
15
15
|
fail=0
|
|
16
16
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
17
17
|
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> '[$2]' lacks '[$3]'"; fail=1 ;; esac; }
|
|
@@ -21,19 +21,19 @@ tmp="$(cd "$(mktemp -d)" && pwd -P)"; trap 'rm -rf "$tmp"' EXIT
|
|
|
21
21
|
# The caller's own runner settings must not steer the copy under test.
|
|
22
22
|
unset TEST_JOBS TEST_TIMINGS TEST_RUN_DIR
|
|
23
23
|
# shellcheck source=/dev/null
|
|
24
|
-
. "$ROOT/
|
|
24
|
+
. "$ROOT/lib/core/test-env.sh" && test_env_seal
|
|
25
25
|
|
|
26
26
|
# fixture <name> — a fresh tree holding the runner; echoes its path.
|
|
27
27
|
fixture() {
|
|
28
28
|
local d="$tmp/$1"
|
|
29
|
-
mkdir -p "$d/scripts/lib" "$d/bin" "$d/shared"
|
|
30
|
-
cp "$ROOT/
|
|
31
|
-
cp "$ROOT/
|
|
29
|
+
mkdir -p "$d/scripts/lib" "$d/lib/core" "$d/bin" "$d/shared"
|
|
30
|
+
cp "$ROOT/lib/core/test.sh" "$d/lib/core/test.sh"
|
|
31
|
+
cp "$ROOT/lib/core/test-env.sh" "$d/lib/core/test-env.sh"
|
|
32
32
|
printf '%s' "$d"
|
|
33
33
|
}
|
|
34
34
|
run() { # run <fixture dir> [runner args…] -> OUT (stdout+stderr), RC
|
|
35
35
|
local d="$1"; shift
|
|
36
|
-
OUT="$(bash "$d/
|
|
36
|
+
OUT="$(bash "$d/lib/core/test.sh" "$@" 2>&1)"; RC=$?
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
# ── 1. pass, fail, and a failing file's output in one block ────────────────────────────────────
|
|
@@ -145,13 +145,13 @@ fi
|
|
|
145
145
|
exit "$rc"
|
|
146
146
|
EOF
|
|
147
147
|
OUT="$(KIT_CONFIG=/elsewhere KEEP_ME=1 GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=test.kept GIT_CONFIG_VALUE_0=yes \
|
|
148
|
-
bash "$F/
|
|
148
|
+
bash "$F/lib/core/test.sh" 2>&1)"; RC=$?
|
|
149
149
|
t "a test is sealed, unsigned, and keeps the rest of its environment" "$RC" "0"
|
|
150
150
|
[ "$RC" -eq 0 ] || printf '%s\n' "$OUT"
|
|
151
151
|
has "the runner reports what it sealed" "$OUT" "sealed 1 inherited"
|
|
152
152
|
|
|
153
153
|
# ── 5. the result directory is removed ─────────────────────────────────────────────────────────
|
|
154
|
-
left="$(TMPDIR="$tmp/td" bash -c 'mkdir -p "$TMPDIR" && bash "$0/
|
|
154
|
+
left="$(TMPDIR="$tmp/td" bash -c 'mkdir -p "$TMPDIR" && bash "$0/lib/core/test.sh" >/dev/null 2>&1; ls "$TMPDIR" | wc -l' "$F" | tr -d ' ')"
|
|
155
155
|
t "the runner leaves nothing in TMPDIR" "$left" "0"
|
|
156
156
|
|
|
157
157
|
[ "$fail" -eq 0 ] && echo "test-runner: all passed" || echo "test-runner: FAILURES"
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
# lines). Exits non-zero if any test fails. bash 3.2 compatible (no mapfile/associative arrays,
|
|
5
5
|
# no `wait -n`).
|
|
6
6
|
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
7
|
+
# lib/core/test.sh run every discovered test, several files at a time
|
|
8
|
+
# lib/core/test.sh <pattern> run only tests whose path matches <pattern> (grep -E)
|
|
9
|
+
# lib/core/test.sh -j <N> run at most N files at once (also: --jobs N, TEST_JOBS=N)
|
|
10
|
+
# lib/core/test.sh --serial one file at a time, in sorted order (same as -j 1)
|
|
11
|
+
# lib/core/test.sh --timings print wall seconds per file, slowest first (also: TEST_TIMINGS=1)
|
|
12
12
|
#
|
|
13
13
|
# Parallelism (#455). Test files are independent: each builds its fixtures under its own `mktemp -d`
|
|
14
14
|
# and none binds a fixed port, so files run N at a time. N defaults to the CPU count, capped at 8.
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
# output is captured to its own file, so the output of a failing test is printed whole, after the
|
|
21
21
|
# run, in sorted order — never interleaved with another file's.
|
|
22
22
|
#
|
|
23
|
-
# Folded into
|
|
23
|
+
# Folded into lib/core/check.sh and run in CI (.github/workflows/test.yml).
|
|
24
24
|
set -uo pipefail
|
|
25
|
-
cd "$(cd "$(dirname "$0")
|
|
25
|
+
cd "$(cd "$(dirname "$0")/../.." && pwd)"
|
|
26
26
|
|
|
27
27
|
note() { printf '%s\n' "$*" >&2; }
|
|
28
28
|
|
|
@@ -36,7 +36,7 @@ if [ "${1:-}" = "--run-one" ]; then
|
|
|
36
36
|
# set KIT_CONFIG, exports KIT_*/CCKIT_*/EFFORT_* that would point a test at the developer's
|
|
37
37
|
# project instead of its own fixture. Each test still sets whatever it needs itself.
|
|
38
38
|
# shellcheck source=/dev/null
|
|
39
|
-
.
|
|
39
|
+
. lib/core/test-env.sh
|
|
40
40
|
seal=(-u TEST_RUN_DIR)
|
|
41
41
|
while IFS= read -r a; do [ -n "$a" ] && seal+=("$a"); done < <(test_env_unset_args)
|
|
42
42
|
# Fixture commits are never signed (#455). A developer whose global git config sets
|
|
@@ -96,7 +96,7 @@ while IFS= read -r f; do
|
|
|
96
96
|
else
|
|
97
97
|
par+=("$f")
|
|
98
98
|
fi
|
|
99
|
-
done < <(find bin scripts -type f -name '*-test.sh' 2>/dev/null | sort)
|
|
99
|
+
done < <(find bin scripts lib -type f -name '*-test.sh' 2>/dev/null | sort)
|
|
100
100
|
|
|
101
101
|
if [ "${#tests[@]}" -eq 0 ]; then
|
|
102
102
|
note "test: no *-test.sh found${PATTERN:+ matching '$PATTERN'}"
|
|
@@ -104,7 +104,7 @@ if [ "${#tests[@]}" -eq 0 ]; then
|
|
|
104
104
|
fi
|
|
105
105
|
|
|
106
106
|
# shellcheck source=/dev/null
|
|
107
|
-
.
|
|
107
|
+
. lib/core/test-env.sh
|
|
108
108
|
sealed="$(test_env_unset_args | grep -c -- '^-u$')"
|
|
109
109
|
|
|
110
110
|
RUN_DIR="$(mktemp -d "${TMPDIR:-/tmp}/cckit-test.XXXXXX")" || { note "test: mktemp failed"; exit 1; }
|
|
@@ -122,11 +122,11 @@ began=$SECONDS
|
|
|
122
122
|
i=0; list=""
|
|
123
123
|
for t in ${par[@]+"${par[@]}"}; do list="$list$i $t"$'\n'; i=$((i+1)); done
|
|
124
124
|
if [ -n "$list" ]; then
|
|
125
|
-
printf '%s' "$list" | xargs -P "$JOBS" -n 2 bash
|
|
125
|
+
printf '%s' "$list" | xargs -P "$JOBS" -n 2 bash lib/core/test.sh --run-one
|
|
126
126
|
fi
|
|
127
127
|
if [ "${#ser[@]}" -gt 0 ]; then
|
|
128
128
|
note "==> ${#ser[@]} file(s) marked serial, run alone"
|
|
129
|
-
for t in "${ser[@]}"; do bash
|
|
129
|
+
for t in "${ser[@]}"; do bash lib/core/test.sh --run-one "$i" "$t"; i=$((i+1)); done
|
|
130
130
|
fi
|
|
131
131
|
took=$((SECONDS - began))
|
|
132
132
|
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
# command on the docs page is one this file runs.
|
|
24
24
|
#
|
|
25
25
|
# Network-free: the upgrade path skips the doctor preflight; every value gh would be asked for is in
|
|
26
|
-
# the fixture config. Everything lives under one mktemp dir. Run: bash
|
|
26
|
+
# the fixture config. Everything lives under one mktemp dir. Run: bash lib/core/update-path-test.sh
|
|
27
27
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
28
28
|
set -u
|
|
29
|
-
ROOT="$(cd "$(dirname "$0")
|
|
29
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
30
30
|
# shellcheck source=/dev/null
|
|
31
|
-
. "$ROOT/
|
|
31
|
+
. "$ROOT/lib/core/test-env.sh" && test_env_seal
|
|
32
32
|
CCKIT="$ROOT/bin/cckit"
|
|
33
33
|
PAGE="$ROOT/docs-site/src/content/docs/getting-started/update.mdx"
|
|
34
34
|
fail=0
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
# verbs-gen.sh — write or check the CLI reference page's generated block (#555). The block sits
|
|
3
3
|
# between the `verbs:begin` and `verbs:end` comment markers of
|
|
4
4
|
# docs-site/src/content/docs/cli-reference.mdx and is produced by verbs_reference_md from
|
|
5
|
-
#
|
|
5
|
+
# lib/core/verbs.tsv, the one source for every verb.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
7
|
+
# lib/core/verbs-gen.sh rewrite the block from the table
|
|
8
|
+
# lib/core/verbs-gen.sh --check rc 0 when the block matches the table, 1 (and a diff) when not
|
|
9
|
+
# lib/core/verbs-gen.sh --root <dir> act on another checkout
|
|
10
10
|
# errors: strict — set -e; a page without both markers exits 1
|
|
11
11
|
set -euo pipefail
|
|
12
|
-
ROOT="$(cd "$(dirname "$0")
|
|
12
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
13
13
|
mode="write"
|
|
14
14
|
while [ $# -gt 0 ]; do
|
|
15
15
|
case "$1" in
|
|
@@ -20,9 +20,9 @@ while [ $# -gt 0 ]; do
|
|
|
20
20
|
esac
|
|
21
21
|
done
|
|
22
22
|
page="$ROOT/docs-site/src/content/docs/cli-reference.mdx"
|
|
23
|
-
VERBS_FILE="$ROOT/
|
|
23
|
+
VERBS_FILE="$ROOT/lib/core/verbs.tsv"; export VERBS_FILE
|
|
24
24
|
# shellcheck source=/dev/null
|
|
25
|
-
source "$ROOT/
|
|
25
|
+
source "$ROOT/lib/core/verbs.sh"
|
|
26
26
|
grep -q '{/\* verbs:begin' "$page" && grep -q '{/\* verbs:end' "$page" \
|
|
27
27
|
|| { echo "verbs-gen: $page lacks the verbs:begin / verbs:end markers" >&2; exit 1; }
|
|
28
28
|
|
|
@@ -34,8 +34,8 @@ awk -v blk="$tmp/block" '
|
|
|
34
34
|
!skip { print }' "$page" > "$tmp/page"
|
|
35
35
|
|
|
36
36
|
if [ "$mode" = check ]; then
|
|
37
|
-
if cmp -s "$page" "$tmp/page"; then echo "ok verbs-gen: the CLI reference block matches
|
|
38
|
-
echo "verbs-gen: the CLI reference block drifted from
|
|
37
|
+
if cmp -s "$page" "$tmp/page"; then echo "ok verbs-gen: the CLI reference block matches lib/core/verbs.tsv"; exit 0; fi
|
|
38
|
+
echo "verbs-gen: the CLI reference block drifted from lib/core/verbs.tsv (run: bash lib/core/verbs-gen.sh)" >&2
|
|
39
39
|
diff "$page" "$tmp/page" >&2 || true
|
|
40
40
|
exit 1
|
|
41
41
|
fi
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# shellcheck shell=bash
|
|
3
3
|
# verbs-help-test.sh — #556: every verb has help. `cckit <verb> --help` is answered by the dispatcher
|
|
4
|
-
# from
|
|
4
|
+
# from lib/core/verbs.tsv before the verb runs, so it exits 0, starts with the verb's usage, names
|
|
5
5
|
# its question and its prompt, and never reaches a parser that rejects --help. Runs every verb in a
|
|
6
6
|
# throwaway git repo with a stub `gh` that refuses everything, then checks the repo is untouched.
|
|
7
7
|
# No network, no port.
|
|
8
|
-
# Run: bash
|
|
8
|
+
# Run: bash lib/core/verbs-help-test.sh
|
|
9
9
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
10
10
|
set -u
|
|
11
|
-
ROOT="$(cd "$(dirname "$0")
|
|
11
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
12
12
|
fail=0
|
|
13
13
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
14
14
|
CCKIT="$ROOT/bin/cckit"
|
|
15
15
|
# shellcheck source=/dev/null
|
|
16
|
-
source "$ROOT/
|
|
16
|
+
source "$ROOT/lib/core/verbs.sh"
|
|
17
17
|
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
|
|
18
18
|
mkdir -p "$tmp/stub" "$tmp/repo" "$tmp/home"
|
|
19
19
|
printf '#!/bin/sh\necho "gh $*" >> "%s/gh.log"\nexit 1\n' "$tmp" > "$tmp/stub/gh"; chmod +x "$tmp/stub/gh"
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# shellcheck shell=bash
|
|
3
3
|
# verbs-ratchet-test.sh — #557: renames by ratchet. The top-level verb count may only go down
|
|
4
|
-
# (
|
|
4
|
+
# (lib/core/verbs-ratchet.sh against lib/core/verbs.baseline), and an old name still works: it prints a
|
|
5
5
|
# one-line notice and runs the verb it was renamed to. Fixture tables check the ratchet; the real
|
|
6
6
|
# dispatcher checks the alias path. No network, no port.
|
|
7
|
-
# Run: bash
|
|
7
|
+
# Run: bash lib/core/verbs-ratchet-test.sh
|
|
8
8
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
9
9
|
set -u
|
|
10
|
-
ROOT="$(cd "$(dirname "$0")
|
|
10
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
11
11
|
fail=0
|
|
12
12
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
13
13
|
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> missing '$3'"; fail=1 ;; esac; }
|
|
14
14
|
CCKIT="$ROOT/bin/cckit"
|
|
15
15
|
# shellcheck source=/dev/null
|
|
16
|
-
source "$ROOT/
|
|
16
|
+
source "$ROOT/lib/core/verbs.sh"
|
|
17
17
|
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
|
|
18
18
|
|
|
19
19
|
# ── 1. the ratchet on the real table ──────────────────────────────────────────────────────────
|
|
20
|
-
out="$(bash "$ROOT/
|
|
20
|
+
out="$(bash "$ROOT/lib/core/verbs-ratchet.sh" 2>&1)"; rc=$?
|
|
21
21
|
t "the real table holds the baseline" "$rc" "0"
|
|
22
|
-
t "the baseline is the table's verb count" "$(awk '!/^#/ && NF { print $1; exit }' "$ROOT/
|
|
22
|
+
t "the baseline is the table's verb count" "$(awk '!/^#/ && NF { print $1; exit }' "$ROOT/lib/core/verbs.baseline")" "$(verbs_count)"
|
|
23
23
|
has "the ratchet says it only goes down" "$out" "it may only go down"
|
|
24
24
|
|
|
25
25
|
# ── 2. the ratchet on fixtures ────────────────────────────────────────────────────────────────
|
|
26
|
-
mkdir -p "$tmp/fx/
|
|
27
|
-
cp "$ROOT/
|
|
28
|
-
cp "$ROOT/
|
|
26
|
+
mkdir -p "$tmp/fx/lib/core"
|
|
27
|
+
cp "$ROOT/lib/core/verbs-ratchet.sh" "$tmp/fx/lib/core/"
|
|
28
|
+
cp "$ROOT/lib/core/verbs.sh" "$tmp/fx/lib/core/"
|
|
29
29
|
row() { printf '%s\tverb\t-\tg\tgit\t-\tno\tQ?\tP.\tcckit %s\n' "$1" "$1"; }
|
|
30
|
-
{ printf 'g\tgroup\t-\t-\t-\t-\t-\tWhat?\t-\t-\n'; row one; row two; } > "$tmp/fx/
|
|
31
|
-
ratchet() { bash "$tmp/fx/
|
|
30
|
+
{ printf 'g\tgroup\t-\t-\t-\t-\t-\tWhat?\t-\t-\n'; row one; row two; } > "$tmp/fx/lib/core/verbs.tsv"
|
|
31
|
+
ratchet() { bash "$tmp/fx/lib/core/verbs-ratchet.sh" --root "$tmp/fx" 2>&1; }
|
|
32
32
|
|
|
33
|
-
printf '# c\n2\n' > "$tmp/fx/
|
|
33
|
+
printf '# c\n2\n' > "$tmp/fx/lib/core/verbs.baseline"
|
|
34
34
|
ratchet >/dev/null; t "fixture: count equal to the baseline passes" "$?" "0"
|
|
35
|
-
row three >> "$tmp/fx/
|
|
35
|
+
row three >> "$tmp/fx/lib/core/verbs.tsv"
|
|
36
36
|
out="$(ratchet)"; rc=$?
|
|
37
37
|
t "fixture: a new top-level verb fails" "$rc" "1"
|
|
38
38
|
has "fixture: the refusal says where a new verb goes" "$out" "goes under an existing one"
|
|
39
|
-
printf '# c\n4\n' > "$tmp/fx/
|
|
39
|
+
printf '# c\n4\n' > "$tmp/fx/lib/core/verbs.baseline"
|
|
40
40
|
out="$(ratchet)"; rc=$?
|
|
41
41
|
t "fixture: a count below the baseline fails until the baseline drops" "$rc" "1"
|
|
42
|
-
has "fixture: the refusal names the number to write" "$out" "Lower
|
|
43
|
-
printf 'old\talias\tone\t-\tgit\t-\t-\t-\t-\t-\n' >> "$tmp/fx/
|
|
44
|
-
printf '3\n' > "$tmp/fx/
|
|
42
|
+
has "fixture: the refusal names the number to write" "$out" "Lower lib/core/verbs.baseline to 3"
|
|
43
|
+
printf 'old\talias\tone\t-\tgit\t-\t-\t-\t-\t-\n' >> "$tmp/fx/lib/core/verbs.tsv"
|
|
44
|
+
printf '3\n' > "$tmp/fx/lib/core/verbs.baseline"
|
|
45
45
|
ratchet >/dev/null; t "fixture: an alias row does not count" "$?" "0"
|
|
46
|
-
printf '# no number\n' > "$tmp/fx/
|
|
46
|
+
printf '# no number\n' > "$tmp/fx/lib/core/verbs.baseline"
|
|
47
47
|
ratchet >/dev/null; t "fixture: a baseline with no number is rc 2" "$?" "2"
|
|
48
48
|
|
|
49
49
|
# ── 3. the alias readers ──────────────────────────────────────────────────────────────────────
|
|
@@ -57,8 +57,13 @@ for a in $(verbs_names alias); do
|
|
|
57
57
|
target="$(verbs_alias_target "$a")"
|
|
58
58
|
err="$("$CCKIT" "$a" --help 2>&1 >/dev/null)"
|
|
59
59
|
t "cckit $a: one notice line on stderr" "$err" "$(verbs_alias_notice "$a" "$target")"
|
|
60
|
-
|
|
60
|
+
# A target may carry words after its verb (`status --board`); help answers for the verb.
|
|
61
|
+
tverb="${target%% *}"
|
|
62
|
+
t "cckit $a --help is cckit $tverb --help on stdout" "$("$CCKIT" "$a" --help 2>/dev/null)" "$("$CCKIT" "$tverb" --help 2>/dev/null)"
|
|
61
63
|
done
|
|
64
|
+
# An alias with words in front: they reach the verb ahead of the typed arguments.
|
|
65
|
+
t "cckit lib runs cckit agent lib" "$("$CCKIT" lib --root "$ROOT" 2>/dev/null | sed -n 1p)" "$("$CCKIT" agent lib --root "$ROOT" 2>/dev/null | sed -n 1p)"
|
|
66
|
+
t "cckit agent with no subcommand: rc 2" "$("$CCKIT" agent >/dev/null 2>&1; echo $?)" "2"
|
|
62
67
|
|
|
63
68
|
[ "$fail" -eq 0 ] && echo "ALL OK (verbs-ratchet)" || echo "verbs-ratchet: FAILURES"
|
|
64
69
|
exit "$fail"
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# verbs-ratchet.sh — the top-level verb count may only go down (#557).
|
|
3
3
|
#
|
|
4
|
-
# Counts the `verb` rows of
|
|
5
|
-
# compares the count with the number in
|
|
4
|
+
# Counts the `verb` rows of lib/core/verbs.tsv (old names, `alias` rows, do not count) and
|
|
5
|
+
# compares the count with the number in lib/core/verbs.baseline:
|
|
6
6
|
# more than the baseline FAIL — a new top-level verb; add it as a subcommand of one that exists
|
|
7
7
|
# fewer than the baseline FAIL — lower the baseline to the new count in the same change
|
|
8
8
|
# equal ok
|
|
9
9
|
# A rename is the alias path: the old name becomes an `alias` row and keeps working, so a rename
|
|
10
10
|
# never changes the count. The ratchet only moves down.
|
|
11
11
|
#
|
|
12
|
-
# Usage: bash
|
|
12
|
+
# Usage: bash lib/core/verbs-ratchet.sh [--root <dir>]
|
|
13
13
|
# errors: strict — a gate: rc 1 on drift, rc 2 on a missing or malformed baseline
|
|
14
14
|
set -u
|
|
15
|
-
root="$(cd "$(dirname "$0")
|
|
15
|
+
root="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
16
16
|
[ "${1:-}" = "--root" ] && root="$2"
|
|
17
|
-
baseline_file="$root/
|
|
17
|
+
baseline_file="$root/lib/core/verbs.baseline"
|
|
18
18
|
# shellcheck source=/dev/null
|
|
19
|
-
source "$root/
|
|
20
|
-
export VERBS_FILE="$root/
|
|
19
|
+
source "$root/lib/core/verbs.sh"
|
|
20
|
+
export VERBS_FILE="$root/lib/core/verbs.tsv"
|
|
21
21
|
|
|
22
22
|
base="$(awk '!/^#/ && NF { print $1; exit }' "$baseline_file" 2>/dev/null)"
|
|
23
23
|
case "$base" in ''|*[!0-9]*) echo "x verbs ratchet: no number in $baseline_file" >&2; exit 2 ;; esac
|
|
@@ -28,7 +28,7 @@ if [ "$now" -gt "$base" ]; then
|
|
|
28
28
|
exit 1
|
|
29
29
|
fi
|
|
30
30
|
if [ "$now" -lt "$base" ]; then
|
|
31
|
-
echo "x verbs ratchet: $now top-level verbs, below the baseline of $base. Lower
|
|
31
|
+
echo "x verbs ratchet: $now top-level verbs, below the baseline of $base. Lower lib/core/verbs.baseline to $now in this change." >&2
|
|
32
32
|
exit 1
|
|
33
33
|
fi
|
|
34
34
|
echo "ok verbs ratchet: $now top-level verbs (baseline $base; it may only go down)"
|