@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,44 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# shellcheck shell=bash
|
|
3
|
+
# force-push-fence-test.sh — #592: the fence fails the gate on a force push in a non-test file, names
|
|
4
|
+
# the offender, ignores comments and test files, and --write records the count. Fixture tree under
|
|
5
|
+
# mktemp -d; the real tree is at its baseline of 0.
|
|
6
|
+
# Run: bash lib/core/force-push-fence-test.sh
|
|
7
|
+
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
8
|
+
set -u
|
|
9
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
10
|
+
fail=0
|
|
11
|
+
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
12
|
+
F="$ROOT/lib/core/force-push-fence.sh"
|
|
13
|
+
|
|
14
|
+
bash "$F" >/dev/null; t "the real tree is at baseline" "$?" "0"
|
|
15
|
+
t "the real baseline is 0" "$(cat "$ROOT/lib/core/force-push-fence.baseline")" "force=0"
|
|
16
|
+
|
|
17
|
+
fx="$(mktemp -d)"; trap 'rm -rf "$fx"' EXIT
|
|
18
|
+
mkdir -p "$fx/bin" "$fx/scripts/lib" "$fx/lib/core"
|
|
19
|
+
printf 'echo hi\n' > "$fx/bin/cckit"
|
|
20
|
+
printf 'sync() { git push origin "$1"; }\n' > "$fx/scripts/lib/clean.sh"
|
|
21
|
+
printf 'force=0\n' > "$fx/lib/core/force-push-fence.baseline"
|
|
22
|
+
bash "$F" --root "$fx" >/dev/null; t "a clean tree passes" "$?" "0"
|
|
23
|
+
|
|
24
|
+
for bad in 'git push --force origin x' 'git push -f origin x' 'git push origin x --force' 'git push --force-with-lease origin x' 'push_it() { git push origin x --force-with-lease; }'; do
|
|
25
|
+
printf '%s\n' "$bad" > "$fx/scripts/lib/stray.sh"
|
|
26
|
+
out="$(bash "$F" --root "$fx")"; rc=$?
|
|
27
|
+
t "fails on: $bad" "$rc" "1"
|
|
28
|
+
t " names the offender" "$(printf '%s' "$out" | grep -c 'scripts/lib/stray.sh:1:')" "1"
|
|
29
|
+
done
|
|
30
|
+
|
|
31
|
+
printf '# never git push --force here\nx=1\n' > "$fx/scripts/lib/stray.sh"
|
|
32
|
+
bash "$F" --root "$fx" >/dev/null; t "a comment is not a call" "$?" "0"
|
|
33
|
+
printf 'git push --force origin x\n' > "$fx/scripts/lib/stray-test.sh"
|
|
34
|
+
bash "$F" --root "$fx" >/dev/null; t "a test file is skipped" "$?" "0"
|
|
35
|
+
rm "$fx/scripts/lib/stray-test.sh"
|
|
36
|
+
|
|
37
|
+
printf 'git push --force origin x\n' > "$fx/scripts/lib/stray.sh"
|
|
38
|
+
bash "$F" --root "$fx" --write >/dev/null
|
|
39
|
+
t "--write records the count" "$(cat "$fx/lib/core/force-push-fence.baseline")" "force=1"
|
|
40
|
+
bash "$F" --root "$fx" >/dev/null; t "at the baseline passes" "$?" "0"
|
|
41
|
+
rm "$fx/lib/core/force-push-fence.baseline"
|
|
42
|
+
bash "$F" --root "$fx" >/dev/null 2>&1; t "no baseline is rc 1" "$?" "1"
|
|
43
|
+
|
|
44
|
+
exit "$fail"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
force=0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# force-push-fence.sh — #592: the gate fails when a non-test file under bin/ or scripts/ force-pushes.
|
|
3
|
+
# A pushed branch is brought onto its base by `git merge origin/<base>`, never by a rebase, so no
|
|
4
|
+
# push needs --force. The squash merge keeps history linear anyway.
|
|
5
|
+
#
|
|
6
|
+
# lib/core/force-push-fence.sh rc 0 when the count is at or under the baseline, 1 over it
|
|
7
|
+
# lib/core/force-push-fence.sh --root <dir> fence another checkout
|
|
8
|
+
# lib/core/force-push-fence.sh --write write the current count into the baseline
|
|
9
|
+
#
|
|
10
|
+
# Counts non-comment lines in bin/* and scripts/**/*.sh (test files `*-test.sh` and `test-*.sh`, and
|
|
11
|
+
# this script, are skipped) that hold `push` with `--force`, `--force-with-lease` or `-f`, or the
|
|
12
|
+
# `--force-with-lease` flag on its own. Ratchet against lib/core/force-push-fence.baseline (`force=<n>`).
|
|
13
|
+
# errors: strict — set -e; a missing baseline exits 1
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
16
|
+
write=0
|
|
17
|
+
while [ $# -gt 0 ]; do
|
|
18
|
+
case "$1" in
|
|
19
|
+
--root) ROOT="$(cd "${2:?--root needs a directory}" && pwd)"; shift 2 ;;
|
|
20
|
+
--write) write=1; shift ;;
|
|
21
|
+
-h|--help) sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
22
|
+
*) echo "force-push-fence: unknown argument '$1'" >&2; exit 2 ;;
|
|
23
|
+
esac
|
|
24
|
+
done
|
|
25
|
+
baseline="$ROOT/lib/core/force-push-fence.baseline"
|
|
26
|
+
|
|
27
|
+
# A forbidden push: `push` then --force / --force-with-lease / -f on one line, or a bare --force-with-lease.
|
|
28
|
+
re='push[^|;&]*(--force|[[:space:]]-f([[:space:]]|$))|--force-with-lease'
|
|
29
|
+
hits="$(cd "$ROOT" && { for f in bin/*; do [ -f "$f" ] && echo "$f"; done; for f in scripts/*.sh scripts/lib/*.sh lib/*/*.sh; do [ -f "$f" ] && echo "$f"; done; true; } \
|
|
30
|
+
| grep -vE -- '-test\.sh$|(^|/)test-[a-z-]+\.sh$|^lib/core/force-push-fence\.sh$' | sort -u | while IFS= read -r f; do
|
|
31
|
+
grep -nE "$re" "$f" | grep -vE '^[0-9]+:[[:space:]]*#' | sed "s|^|$f:|" || true
|
|
32
|
+
done)"
|
|
33
|
+
n="$(printf '%s\n' "$hits" | sed '/^$/d' | wc -l | tr -d ' ')"
|
|
34
|
+
|
|
35
|
+
if [ "$write" = 1 ]; then
|
|
36
|
+
printf 'force=%s\n' "$n" > "$baseline"
|
|
37
|
+
echo "force-push-fence: baseline written — force=$n"
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
[ -f "$baseline" ] || { echo "force-push-fence: no baseline at $baseline (run: lib/core/force-push-fence.sh --write)" >&2; exit 1; }
|
|
41
|
+
max="$(sed -n 's/^force=//p' "$baseline" | sed -n 1p)"
|
|
42
|
+
case "$max" in *[!0-9]*|'') echo "force-push-fence: the baseline must hold force=<n>" >&2; exit 1 ;; esac
|
|
43
|
+
|
|
44
|
+
if [ "$n" -gt "$max" ]; then
|
|
45
|
+
echo "x force-push fence: $n force-push line(s) (baseline $max). Update the branch with git merge origin/<base> and push plain:"
|
|
46
|
+
printf '%s\n' "$hits" | sed '/^$/d' | sed 's/^/ /'
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
echo "ok force-push fence: $n/$max force-push lines in bin/, scripts/ and lib/"
|
|
50
|
+
if [ "$n" -lt "$max" ]; then echo " the count went down — ratchet it: lib/core/force-push-fence.sh --write"; fi
|
|
51
|
+
exit 0
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
# forge-fence-test.sh — E537.5: the fence fails the gate when a file outside the forge layer calls
|
|
4
4
|
# gh or names api.github.com, passes at or under the baseline, names the offenders, and --write
|
|
5
5
|
# records the current counts. Fixture tree under mktemp -d; the real tree is at its baseline.
|
|
6
|
-
# Run: bash
|
|
6
|
+
# Run: bash lib/core/forge-fence-test.sh
|
|
7
7
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
8
8
|
set -u
|
|
9
|
-
ROOT="$(cd "$(dirname "$0")
|
|
9
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
10
10
|
fail=0
|
|
11
11
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
12
|
-
F="$ROOT/
|
|
12
|
+
F="$ROOT/lib/core/forge-fence.sh"
|
|
13
13
|
|
|
14
14
|
fx="$(mktemp -d)"; trap 'rm -rf "$fx"' EXIT
|
|
15
|
-
mkdir -p "$fx/bin" "$fx/scripts/lib"
|
|
16
|
-
cp "$ROOT/
|
|
15
|
+
mkdir -p "$fx/bin" "$fx/scripts/lib" "$fx/lib/core"
|
|
16
|
+
cp "$ROOT/lib/core/forge-report.sh" "$fx/lib/core/forge-report.sh"
|
|
17
17
|
cat > "$fx/bin/cckit" <<'CCKIT'
|
|
18
18
|
#!/usr/bin/env bash
|
|
19
|
-
LIB="$ROOT/
|
|
19
|
+
LIB="$ROOT/lib"
|
|
20
20
|
cmd="${1:-}"; shift || true
|
|
21
21
|
case "$cmd" in
|
|
22
22
|
a) source "$LIB/clean.sh"; clean_run ;;
|
|
@@ -27,7 +27,7 @@ printf 'forge_rest() { curl -sS "https://api.github.com/$1"; }\ngh auth token\n'
|
|
|
27
27
|
printf 'gh_rest_issue_json() { forge_rest "repos/$1/issues/$2"; }\n' > "$fx/scripts/lib/gh-rest.sh"
|
|
28
28
|
printf 'gh api never-counted\n' > "$fx/scripts/lib/noise-test.sh"
|
|
29
29
|
|
|
30
|
-
printf 'gh=0\napi=0\n' > "$fx/
|
|
30
|
+
printf 'gh=0\napi=0\n' > "$fx/lib/core/forge-fence.baseline"
|
|
31
31
|
out="$(bash "$F" --root "$fx")"; rc=$?
|
|
32
32
|
t "a clean tree passes at baseline 0" "$rc" "0"
|
|
33
33
|
t "the pass line carries both counts" "$(printf '%s' "$out" | grep -c '^ok forge fence: gh 0/0 · api 0/0')" "1"
|
|
@@ -48,22 +48,22 @@ bash "$F" --root "$fx" >/dev/null; t "a comment naming the host is not a call" "
|
|
|
48
48
|
rm "$fx/scripts/lib/direct.sh"
|
|
49
49
|
|
|
50
50
|
printf 'read_it() { gh issue view "$1"; }\n' > "$fx/scripts/lib/stray.sh"
|
|
51
|
-
printf 'gh=1\napi=0\n' > "$fx/
|
|
51
|
+
printf 'gh=1\napi=0\n' > "$fx/lib/core/forge-fence.baseline"
|
|
52
52
|
bash "$F" --root "$fx" >/dev/null; t "at the baseline passes" "$?" "0"
|
|
53
53
|
rm "$fx/scripts/lib/stray.sh"
|
|
54
54
|
out="$(bash "$F" --root "$fx")"
|
|
55
|
-
t "under the baseline passes and asks for the ratchet" "$(printf '%s' "$out" | grep -c 'ratchet it:
|
|
55
|
+
t "under the baseline passes and asks for the ratchet" "$(printf '%s' "$out" | grep -c 'ratchet it: lib/core/forge-fence.sh --write')" "1"
|
|
56
56
|
bash "$F" --root "$fx" --write >/dev/null
|
|
57
|
-
t "--write records the current counts" "$(tr '\n' ' ' < "$fx/
|
|
57
|
+
t "--write records the current counts" "$(tr '\n' ' ' < "$fx/lib/core/forge-fence.baseline")" "gh=0 api=0 "
|
|
58
58
|
|
|
59
|
-
rm "$fx/
|
|
59
|
+
rm "$fx/lib/core/forge-fence.baseline"
|
|
60
60
|
bash "$F" --root "$fx" >/dev/null 2>&1; t "no baseline is rc 1" "$?" "1"
|
|
61
|
-
printf 'gh=x\n' > "$fx/
|
|
61
|
+
printf 'gh=x\n' > "$fx/lib/core/forge-fence.baseline"
|
|
62
62
|
bash "$F" --root "$fx" >/dev/null 2>&1; t "a malformed baseline is rc 1" "$?" "1"
|
|
63
63
|
|
|
64
64
|
# The real tree is at its baseline.
|
|
65
65
|
bash "$F" >/dev/null; t "the repository passes its own fence" "$?" "0"
|
|
66
|
-
t "the repository's baseline is 0/0" "$(tr '\n' ' ' < "$ROOT/
|
|
66
|
+
t "the repository's baseline is 0/0" "$(tr '\n' ' ' < "$ROOT/lib/core/forge-fence.baseline")" "gh=0 api=0 "
|
|
67
67
|
|
|
68
68
|
[ "$fail" -eq 0 ] && echo "ALL OK (forge-fence)"
|
|
69
69
|
exit "$fail"
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
# other non-test file under bin/, scripts/ and scripts/lib/ (test doubles, scripts/lib/test-*.sh, are
|
|
5
5
|
# not code) reaches GitHub through forge_* / gh_rest_*.
|
|
6
6
|
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
7
|
+
# lib/core/forge-fence.sh rc 0 when the count is at or under the baseline, 1 over it
|
|
8
|
+
# lib/core/forge-fence.sh --root <dir> fence another checkout
|
|
9
|
+
# lib/core/forge-fence.sh --write write the current count into the baseline (a ratchet moves
|
|
10
10
|
# down on its own; raising it is a decision, made here on purpose)
|
|
11
11
|
#
|
|
12
|
-
# Two counts, each a ratchet against
|
|
13
|
-
# gh files outside the layer with a gh line, as
|
|
12
|
+
# Two counts, each a ratchet against lib/core/forge-fence.baseline (`gh=<n>` and `api=<n>` lines):
|
|
13
|
+
# gh files outside the layer with a gh line, as lib/core/forge-report.sh --ratchet counts them
|
|
14
14
|
# (a gh <subcommand> in command position, a `gh "$…"` form, or a `command -v gh` probe)
|
|
15
15
|
# api files outside the layer whose non-comment lines name api.github.com (a curl to the API)
|
|
16
16
|
# The baseline starts at 0 for both (the count left after E537.3). A new offender fails the gate and
|
|
17
17
|
# is named with its lines; the fix is to call the layer.
|
|
18
18
|
# errors: strict — set -e; a missing report script or baseline exits 1
|
|
19
19
|
set -euo pipefail
|
|
20
|
-
ROOT="$(cd "$(dirname "$0")
|
|
20
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
21
21
|
write=0
|
|
22
22
|
while [ $# -gt 0 ]; do
|
|
23
23
|
case "$1" in
|
|
@@ -27,21 +27,21 @@ while [ $# -gt 0 ]; do
|
|
|
27
27
|
*) echo "forge-fence: unknown argument '$1'" >&2; exit 2 ;;
|
|
28
28
|
esac
|
|
29
29
|
done
|
|
30
|
-
report="$ROOT/
|
|
31
|
-
baseline="$ROOT/
|
|
30
|
+
report="$ROOT/lib/core/forge-report.sh"
|
|
31
|
+
baseline="$ROOT/lib/core/forge-fence.baseline"
|
|
32
32
|
[ -f "$report" ] || { echo "forge-fence: $report is missing" >&2; exit 1; }
|
|
33
33
|
|
|
34
|
-
is_layer() { case "$1" in scripts/lib/forge.sh|scripts/lib/forge-*.sh|scripts/lib/gh-rest.sh) return 0 ;; *) return 1 ;; esac; }
|
|
34
|
+
is_layer() { case "$1" in scripts/lib/forge.sh|scripts/lib/forge-*.sh|scripts/lib/gh-rest.sh|lib/forge/*.sh) return 0 ;; *) return 1 ;; esac; }
|
|
35
35
|
|
|
36
36
|
# gh: the report's own file table (its GH_RE), minus the layer.
|
|
37
37
|
gh_files="$(bash "$report" --root "$ROOT" --files | awk 'NR > 1 && $2 > 0 {print $1}' | while IFS= read -r f; do is_layer "$f" || printf '%s\n' "$f"; done)"
|
|
38
38
|
gh_n="$(printf '%s\n' "$gh_files" | sed '/^$/d' | wc -l | tr -d ' ')"
|
|
39
39
|
|
|
40
40
|
# api: a non-comment line naming the API host, outside the layer.
|
|
41
|
-
api_files="$(cd "$ROOT" && { for f in bin/*; do [ -f "$f" ] && echo "$f"; done; for f in scripts/*.sh scripts/lib/*.sh; do [ -f "$f" ] && echo "$f"; done; } \
|
|
42
|
-
| grep -vE -- '-test\.sh
|
|
41
|
+
api_files="$(cd "$ROOT" && { for f in bin/*; do [ -f "$f" ] && echo "$f"; done; for f in scripts/*.sh scripts/lib/*.sh lib/*/*.sh; do [ -f "$f" ] && echo "$f"; done; true; } \
|
|
42
|
+
| grep -vE -- '-test\.sh$|(^|/)test-[a-z-]+\.sh$' | sort -u | while IFS= read -r f; do
|
|
43
43
|
is_layer "$f" && continue
|
|
44
|
-
case "$f" in
|
|
44
|
+
case "$f" in lib/core/forge-fence.sh|lib/core/forge-report.sh) continue ;; esac
|
|
45
45
|
body="$(grep -vE '^[[:space:]]*#' "$f" || true)"
|
|
46
46
|
if grep -q 'api\.github\.com' <<<"$body"; then printf '%s\n' "$f"; fi
|
|
47
47
|
done)"
|
|
@@ -52,7 +52,7 @@ if [ "$write" = 1 ]; then
|
|
|
52
52
|
echo "forge-fence: baseline written — gh=$gh_n api=$api_n"
|
|
53
53
|
exit 0
|
|
54
54
|
fi
|
|
55
|
-
[ -f "$baseline" ] || { echo "forge-fence: no baseline at $baseline (run:
|
|
55
|
+
[ -f "$baseline" ] || { echo "forge-fence: no baseline at $baseline (run: lib/core/forge-fence.sh --write)" >&2; exit 1; }
|
|
56
56
|
gh_max="$(sed -n 's/^gh=//p' "$baseline" | sed -n 1p)"; api_max="$(sed -n 's/^api=//p' "$baseline" | sed -n 1p)"
|
|
57
57
|
case "$gh_max$api_max" in *[!0-9]*|'') echo "forge-fence: the baseline must hold gh=<n> and api=<n>" >&2; exit 1 ;; esac
|
|
58
58
|
|
|
@@ -70,7 +70,7 @@ fi
|
|
|
70
70
|
if [ "$fail" = 0 ]; then
|
|
71
71
|
echo "ok forge fence: gh $gh_n/$gh_max · api $api_n/$api_max files outside the layer"
|
|
72
72
|
if [ "$gh_n" -lt "$gh_max" ] || [ "$api_n" -lt "$api_max" ]; then
|
|
73
|
-
echo " the count went down — ratchet it:
|
|
73
|
+
echo " the count went down — ratchet it: lib/core/forge-fence.sh --write"
|
|
74
74
|
fi
|
|
75
75
|
fi
|
|
76
76
|
exit "$fail"
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
# forge-report-test.sh — E537.1: forge-report.sh counts gh and git lines per file, classes each file,
|
|
4
4
|
# says per verb whether it needs a forge (following exec/source transitively), and prints the ratchet
|
|
5
5
|
# (files outside the forge layer that call gh). Fixture under its own mktemp -d; no port.
|
|
6
|
-
# Run: bash
|
|
6
|
+
# Run: bash lib/core/forge-report-test.sh
|
|
7
7
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
8
8
|
set -u
|
|
9
|
-
ROOT="$(cd "$(dirname "$0")
|
|
9
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
10
10
|
fail=0
|
|
11
11
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
12
|
-
R="$ROOT/
|
|
12
|
+
R="$ROOT/lib/core/forge-report.sh"
|
|
13
13
|
|
|
14
14
|
fx="$(mktemp -d)"; trap 'rm -rf "$fx"' EXIT
|
|
15
15
|
mkdir -p "$fx/bin" "$fx/scripts/lib"
|
|
16
16
|
cat > "$fx/bin/cckit" <<'CCKIT'
|
|
17
17
|
#!/usr/bin/env bash
|
|
18
|
-
LIB="$ROOT/
|
|
18
|
+
LIB="$ROOT/lib"
|
|
19
19
|
source "$LIB/common.sh"
|
|
20
20
|
cmd="${1:-}"; shift || true
|
|
21
21
|
case "$cmd" in
|
|
@@ -25,7 +25,7 @@ case "$cmd" in
|
|
|
25
25
|
b|bee) exec "$ROOT/scripts/local.sh" "$@" ;;
|
|
26
26
|
c) echo "nothing here" ;;
|
|
27
27
|
d) gh pr view "$1" ;;
|
|
28
|
-
e) source "$LIB/forge.sh"; forge_issue_view "$@" ;;
|
|
28
|
+
e) source "$LIB/forge/forge.sh"; forge_issue_view "$@" ;;
|
|
29
29
|
f) source "$LIB/clean.sh"; clean_run "$@" ;;
|
|
30
30
|
help|--help) echo usage ;;
|
|
31
31
|
esac
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
# needs only git. The ratchet source for effort 537 (git apart from GitHub): every later sub reads
|
|
4
4
|
# its numbers before and after.
|
|
5
5
|
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
6
|
+
# lib/core/forge-report.sh summary + the file table + the verb table
|
|
7
|
+
# lib/core/forge-report.sh --summary the two summary lines only
|
|
8
|
+
# lib/core/forge-report.sh --files per file: gh lines · git lines · class
|
|
9
|
+
# lib/core/forge-report.sh --verbs per verb of bin/cckit: needs a forge yes|no · via which files
|
|
10
|
+
# lib/core/forge-report.sh --ratchet ONE integer: files outside the forge layer that call gh
|
|
11
|
+
# lib/core/forge-report.sh --json everything as one JSON object (no jq needed to produce it)
|
|
12
|
+
# lib/core/forge-report.sh --root <dir> measure another checkout (default: this repository)
|
|
13
13
|
#
|
|
14
14
|
# What is measured (non-test files only: bin/*, scripts/*.sh, scripts/lib/*.sh; never *-test.sh nor
|
|
15
15
|
# the scripts/lib/test-*.sh test doubles):
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
# errors: strict — set -e; an unreadable root or a bin/cckit without a dispatcher exits 1
|
|
31
31
|
set -euo pipefail
|
|
32
32
|
|
|
33
|
-
ROOT="$(cd "$(dirname "$0")
|
|
33
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
34
34
|
mode="all"
|
|
35
35
|
while [ $# -gt 0 ]; do
|
|
36
36
|
case "$1" in
|
|
@@ -52,8 +52,10 @@ GIT_RE='(^|[^[:alnum:]_./-])git[[:space:]]+(-C[[:space:]]|-c[[:space:]]|[a-z][a-
|
|
|
52
52
|
fr_files() {
|
|
53
53
|
( cd "$ROOT" && {
|
|
54
54
|
for f in bin/*; do [ -f "$f" ] && echo "$f"; done
|
|
55
|
-
for f in scripts/*.sh scripts/lib/*.sh; do
|
|
56
|
-
|
|
55
|
+
for f in scripts/*.sh scripts/lib/*.sh lib/*/*.sh; do
|
|
56
|
+
[ -f "$f" ] && ! grep -q '^# cckit-forwarding-stub' "$f" && echo "$f"
|
|
57
|
+
done
|
|
58
|
+
} | grep -vE -- '-test\.sh$|(^|/)test-[a-z-]+\.sh$' | sort -u )
|
|
57
59
|
}
|
|
58
60
|
# fr_count <regex> <file>: matching non-comment lines.
|
|
59
61
|
fr_count() { grep -vE '^[[:space:]]*#' "$ROOT/$2" 2>/dev/null | grep -cE "$1" || true; }
|
|
@@ -63,7 +65,7 @@ fr_class() { # <gh> <git>
|
|
|
63
65
|
elif [ "$2" -gt 0 ]; then echo git-only
|
|
64
66
|
else echo neither; fi
|
|
65
67
|
}
|
|
66
|
-
fr_is_forge_layer() { case "$1" in scripts/lib/forge.sh|scripts/lib/forge-*.sh|scripts/lib/gh-rest.sh) return 0 ;; *) return 1 ;; esac; }
|
|
68
|
+
fr_is_forge_layer() { case "$1" in lib/forge/*.sh|scripts/lib/forge.sh|scripts/lib/forge-*.sh|scripts/lib/gh-rest.sh) return 0 ;; *) return 1 ;; esac; }
|
|
67
69
|
# fr_calls_forge <file-or-text-on-stdin>: a non-comment, non-definition line that calls the layer.
|
|
68
70
|
fr_calls_forge_text() { local t; t="$(grep -vE '^[[:space:]]*#|^[[:space:]]*[a-z_]+\(\)' || true)"; grep -qE "$FORGE_RE" <<<"$t"; }
|
|
69
71
|
|
|
@@ -73,9 +75,11 @@ fr_resolve() {
|
|
|
73
75
|
n="${n#\$ROOT/}"; n="${n#\$LIB/}"; n="${n#\$\{ROOT\}/}"; n="${n#\$\{LIB\}/}"
|
|
74
76
|
b="$(basename "$n")"
|
|
75
77
|
case "$b" in *-test.sh) return 0 ;; esac
|
|
76
|
-
if [ -f "$ROOT/$n" ] && [ "${n#scripts/}" != "$n" ]; then echo "$n"; return; fi
|
|
77
|
-
if [ -f "$ROOT/
|
|
78
|
-
|
|
78
|
+
if [ -f "$ROOT/$n" ] && { [ "${n#scripts/}" != "$n" ] || [ "${n#lib/}" != "$n" ]; }; then echo "$n"; return; fi
|
|
79
|
+
if [ -f "$ROOT/lib/$n" ]; then echo "lib/$n"; return; fi
|
|
80
|
+
for d in lib/core lib/forge lib/verbs scripts/lib scripts; do
|
|
81
|
+
if [ -f "$ROOT/$d/$b" ] && ! grep -q '^# cckit-forwarding-stub' "$ROOT/$d/$b"; then echo "$d/$b"; return; fi
|
|
82
|
+
done
|
|
79
83
|
}
|
|
80
84
|
# fr_refs_in_text: file references in a block of shell (exec/source targets, scripts paths).
|
|
81
85
|
fr_refs_in_text() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# forge provider is none and start, pr, merge, hotfix and gc each either work through git or say,
|
|
5
5
|
# once, what they skipped. Nothing is silent and nothing reaches the network: a curl stub on PATH
|
|
6
6
|
# fails loudly, so a leaked request is a red test. Hermetic: a bare origin and a clone under mktemp.
|
|
7
|
-
# Run: bash
|
|
7
|
+
# Run: bash lib/core/git-core-test.sh
|
|
8
8
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
9
9
|
set -u
|
|
10
10
|
LIB="$(cd "$(dirname "$0")" && pwd)"
|
|
@@ -51,13 +51,13 @@ git push -q origin develop; git branch -q main; git push -q origin main
|
|
|
51
51
|
export KIT_REPO="o/r" WT_START_REPO="o/r" KIT_BASE_BRANCH="develop" KIT_WT_INSTALL=0 KIT_GC_REPO="o/r" KIT_PROJECTS_V2=false
|
|
52
52
|
|
|
53
53
|
# shellcheck source=/dev/null
|
|
54
|
-
. "$LIB/forge.sh"
|
|
54
|
+
. "$LIB/../forge/forge.sh"
|
|
55
55
|
t "no token and no gh: the provider is none" "$(forge_provider)" "none"
|
|
56
56
|
|
|
57
57
|
# shellcheck source=/dev/null
|
|
58
58
|
. "$LIB/worktree-start.sh"
|
|
59
59
|
# shellcheck source=/dev/null
|
|
60
|
-
. "$LIB/kit-task-ops.sh"
|
|
60
|
+
. "$LIB/../verbs/kit-task-ops.sh"
|
|
61
61
|
|
|
62
62
|
# ── start ──────────────────────────────────────────────────────────────────────────────────────
|
|
63
63
|
out="$(wt_start 7 the-thing 2>"$tmp/err")"; rc=$?
|
|
@@ -73,7 +73,7 @@ t "start with no slug: issue-<N>" "$(printf '%s' "$out2" | cut -d'|'
|
|
|
73
73
|
echo two > "$wt/tracked.txt"
|
|
74
74
|
out="$(cd "$wt" && kto_task_pr 7 "fix: do the thing" 2>"$tmp/err")"; rc=$?
|
|
75
75
|
t "pr without a forge: rc 0" "$rc" "0"
|
|
76
|
-
t "pr: the change is committed" "$(git -C "$wt" log -1 --format=%s)" "fix: do the thing"
|
|
76
|
+
t "pr: the change is committed" "$(git -C "$wt" log -1 --format=%s)" "fix: do the thing [#7]"
|
|
77
77
|
t "pr: the branch is pushed" "$(git ls-remote --heads origin task/7-the-thing | wc -l | tr -d ' ')" "1"
|
|
78
78
|
tc "$tmp/err" '^cckit pr: no forge — issue #7 is not read and the pull request is not opened' "pr: the one line says what it skipped"
|
|
79
79
|
t "pr: says the pull request is to be opened by hand (origin is not on GitHub)" \
|
|
@@ -87,7 +87,7 @@ t "no compare page for a local origin" "$(forge_compare_url develop fix/1
|
|
|
87
87
|
out="$(cd "$wt" && kto_task_pr_merge 2>"$tmp/err")"; rc=$?
|
|
88
88
|
t "merge without a forge: rc 0" "$rc" "0"
|
|
89
89
|
tc "$tmp/err" '^cckit merge: no forge — the branch lands on develop through git; no pull request is merged and no issue is closed' "merge: the one line says what it skipped"
|
|
90
|
-
t "merge: develop on origin carries the squash commit" "$(git -C "$tmp/work" log -1 --format=%s origin/develop)" "fix: do the thing"
|
|
90
|
+
t "merge: develop on origin carries the squash commit" "$(git -C "$tmp/work" log -1 --format=%s origin/develop)" "fix: do the thing [#7]"
|
|
91
91
|
t "merge: one commit landed (a squash)" "$(git -C "$tmp/work" rev-list --count origin/develop)" "2"
|
|
92
92
|
t "merge: the worktree is removed" "$([ -d "$wt" ] && echo present || echo gone)" "gone"
|
|
93
93
|
t "merge: the local branch is deleted" "$(git -C "$tmp/work" branch --list task/7-the-thing | wc -l | tr -d ' ')" "0"
|
|
@@ -102,7 +102,7 @@ t "merge from the base branch is refused" "$rc" "1"
|
|
|
102
102
|
|
|
103
103
|
# ── hotfix: the cherry-pick lands on main and is pushed; no pull request ──────────────────────
|
|
104
104
|
# shellcheck source=/dev/null
|
|
105
|
-
. "$LIB/kit-hotfix.sh"
|
|
105
|
+
. "$LIB/../verbs/kit-hotfix.sh"
|
|
106
106
|
sha="$(git -C "$tmp/work" rev-parse origin/develop)"
|
|
107
107
|
out="$(cd "$tmp/work" && kto_hotfix "$sha" --base main 2>"$tmp/err")"; rc=$?
|
|
108
108
|
t "hotfix without a forge: rc 0" "$rc" "0"
|
|
@@ -115,7 +115,7 @@ tc "$tmp/err" 'PR #12 cannot be read; pass the merge commit' "hotfix <pr>: the r
|
|
|
115
115
|
|
|
116
116
|
# ── gc: every row UNKNOWN and kept; the note is printed once ──────────────────────────────────
|
|
117
117
|
# shellcheck source=/dev/null
|
|
118
|
-
. "$LIB/kit-gc.sh"
|
|
118
|
+
. "$LIB/../verbs/kit-gc.sh"
|
|
119
119
|
out="$(cd "$tmp/work" && unset _FORGE_NONE_SAID && kit_gc_analyze 2>"$tmp/err")"
|
|
120
120
|
t "gc: the leftover issue branch is UNKNOWN, kept" "$(printf '%s\n' "$out" | grep -c 'task/8-issue-8 .*UNKNOWN')" "1"
|
|
121
121
|
t "gc: nothing is SAFE or LANDED" "$(printf '%s\n' "$out" | grep -cE 'task/8-issue-8 .*(SAFE|LANDED)')" "0"
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
# git-remote-test.sh — covers deriving the project's repo identity from the git remote (#73), so
|
|
4
4
|
# NAME / slug / wing come from the ACTUAL repo name (not a cloned/renamed directory basename). Also
|
|
5
5
|
# checks the host-agnostic URL parsing (ssh, https, GHE/GitLab). Hermetic: a throwaway git repo with
|
|
6
|
-
# a fake remote. Run: bash
|
|
6
|
+
# a fake remote. Run: bash lib/core/git-remote-test.sh
|
|
7
7
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
8
8
|
set -u
|
|
9
9
|
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
10
|
-
LIB="$ROOT/
|
|
10
|
+
LIB="$ROOT/lib"
|
|
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
|
rc() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> rc '$2' want '$3'"; fail=1; fi; }
|
|
14
14
|
command -v git >/dev/null 2>&1 || { echo "git-remote-test: git required" >&2; exit 1; }
|
|
15
15
|
|
|
16
16
|
# shellcheck source=/dev/null
|
|
17
|
-
. "$LIB/git-remote.sh"
|
|
17
|
+
. "$LIB/core/git-remote.sh"
|
|
18
18
|
|
|
19
19
|
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
|
|
20
20
|
cd "$tmp"; git init -q proj-dir-renamed; cd proj-dir-renamed # dir name != repo name on purpose
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# guard-raw-git-ops-test.sh — end-to-end test of the raw-git guard hook (#364): feed it the
|
|
3
3
|
# PreToolUse JSON Claude Code sends, in a throwaway cckit repo and a non-cckit repo.
|
|
4
|
-
# Run: bash
|
|
4
|
+
# Run: bash lib/core/guard-raw-git-ops-test.sh
|
|
5
5
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
6
6
|
set -u
|
|
7
|
-
ROOT="$(cd "$(dirname "$0")
|
|
8
|
-
HOOK="$ROOT/templates/hooks/guard-raw-git-ops.sh.tmpl"
|
|
7
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
8
|
+
HOOK="$ROOT/kit/templates/hooks/guard-raw-git-ops.sh.tmpl"
|
|
9
9
|
fail=0
|
|
10
10
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
11
11
|
command -v jq >/dev/null 2>&1 || { echo "guard-raw-git-ops-test: jq required" >&2; exit 1; }
|
|
@@ -60,7 +60,7 @@ printf '{"kitVersion":"0.0.1","profile":"software","project":{"name":"G","slug":
|
|
|
60
60
|
# a project's own PreToolUse hooks must survive the merge
|
|
61
61
|
printf '{"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"own-guard.sh"}]}]}}\n' > "$proj/.claude/settings.json"
|
|
62
62
|
for _ in 1 2; do
|
|
63
|
-
CLAUDE_PLUGIN_ROOT="$ROOT" bash "$ROOT/
|
|
63
|
+
CLAUDE_PLUGIN_ROOT="$ROOT" bash "$ROOT/lib/verbs/init.sh" --upgrade --target "$proj" --force >/dev/null 2>&1 \
|
|
64
64
|
|| { echo "FAIL: init.sh --upgrade exited non-zero"; fail=1; }
|
|
65
65
|
done
|
|
66
66
|
S="$proj/.claude/settings.json"
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
# captured from a live session, and no agent process runs. It proves the scripts handle both
|
|
15
15
|
# documented shapes; it does not prove Codex fires the hooks or honours exit 2 (agent-compatibility
|
|
16
16
|
# .mdx records that as unverified).
|
|
17
|
-
# Run: bash
|
|
17
|
+
# Run: bash lib/core/hook-adapter-test.sh
|
|
18
18
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
19
19
|
set -u
|
|
20
|
-
ROOT="$(cd "$(dirname "$0")
|
|
20
|
+
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
21
21
|
fail=0
|
|
22
22
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
23
23
|
has() { case "$2" in *"$3"*) echo "ok: $1" ;; *) echo "FAIL: $1 -> '[$2]' lacks '[$3]'"; fail=1 ;; esac; }
|
|
24
24
|
command -v jq >/dev/null 2>&1 || { echo "SKIP: jq not available"; exit 0; }
|
|
25
25
|
command -v git >/dev/null 2>&1 || { echo "SKIP: git not available"; exit 0; }
|
|
26
26
|
# shellcheck source=/dev/null
|
|
27
|
-
. "$ROOT/
|
|
27
|
+
. "$ROOT/lib/core/codex-hooks.sh"
|
|
28
28
|
|
|
29
29
|
tmp="$(cd "$(mktemp -d)" && pwd -P)"; trap 'rm -rf "$tmp"' EXIT
|
|
30
30
|
export KIT_MAIL_DIR="$tmp/mail"
|
|
@@ -37,7 +37,7 @@ P="$tmp/proj"; W="$tmp/wt"
|
|
|
37
37
|
mkdir -p "$P" && git -C "$P" init -q -b main \
|
|
38
38
|
&& git -C "$P" config user.email kit-test@example.com && git -C "$P" config user.name kit-test \
|
|
39
39
|
&& git -C "$P" remote add origin git@github.com:example/fx.git # the mailbox is keyed by the remote slug
|
|
40
|
-
KIT_INIT_PREFLIGHT=0 KIT_BASE_BRANCH=main CLAUDE_PLUGIN_ROOT="$ROOT" bash "$ROOT/
|
|
40
|
+
KIT_INIT_PREFLIGHT=0 KIT_BASE_BRANCH=main CLAUDE_PLUGIN_ROOT="$ROOT" bash "$ROOT/lib/verbs/init.sh" \
|
|
41
41
|
--profile minimal --adapter both --target "$P" --repo example/fx --owner-login example >/dev/null 2>&1 </dev/null \
|
|
42
42
|
|| { echo "FAIL: init --adapter both exited non-zero"; exit 1; }
|
|
43
43
|
git -C "$P" add -A >/dev/null 2>&1 && git -C "$P" commit -q -m scaffold >/dev/null 2>&1
|
|
@@ -137,7 +137,7 @@ OUT="$(cd "$W" && ev claude PreToolUse "$W" 'git commit -m x' | CLAUDE_PROJECT_D
|
|
|
137
137
|
t "claude: event cwd wins over CLAUDE_PROJECT_DIR" "$?" "0"
|
|
138
138
|
|
|
139
139
|
# ── pre-push gate: either config location ──────────────────────────────────────────────────────
|
|
140
|
-
GATE="$ROOT/templates/hooks/prepush_gate.sh.tmpl"
|
|
140
|
+
GATE="$ROOT/kit/templates/hooks/prepush_gate.sh.tmpl"
|
|
141
141
|
gate() { # gate <runtime> <dir> <command> -> the .continue value
|
|
142
142
|
( cd "$2" && ev "$1" PreToolUse "$2" "$3" | bash "$GATE" 2>/dev/null ) | jq -r '.continue'
|
|
143
143
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# hook-refresh-test.sh — `init --upgrade` refreshes an unmodified kit hook and reports a customized
|
|
3
3
|
# one without touching it (#370). Part 1 drives hook_refresh_state against a fixture kit repo with
|
|
4
4
|
# two template versions in its history; part 2 runs the real init.sh --upgrade on a scratch project.
|
|
5
|
-
# Run: bash
|
|
5
|
+
# Run: bash lib/core/hook-refresh-test.sh
|
|
6
6
|
# errors: strict — a test runner: rc 1 on any failed assertion
|
|
7
7
|
set -u
|
|
8
8
|
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
@@ -10,7 +10,7 @@ fail=0
|
|
|
10
10
|
t() { if [ "$2" = "$3" ]; then echo "ok: $1"; else echo "FAIL: $1 -> got '[$2]' want '[$3]'"; fail=1; fi; }
|
|
11
11
|
command -v jq >/dev/null 2>&1 || { echo "hook-refresh-test: jq required" >&2; exit 1; }
|
|
12
12
|
# shellcheck source=/dev/null
|
|
13
|
-
. "$ROOT/
|
|
13
|
+
. "$ROOT/lib/core/hook-refresh.sh"
|
|
14
14
|
|
|
15
15
|
tmp="$(mktemp -d)"; trap 'rm -rf "$tmp"' EXIT
|
|
16
16
|
g() { git -C "$1" -c user.email=t@t -c user.name=t "${@:2}"; }
|
|
@@ -41,21 +41,21 @@ refresh"
|
|
|
41
41
|
proj="$tmp/proj"; git init -q "$proj"; g "$proj" commit -q --allow-empty -m init
|
|
42
42
|
mkdir -p "$proj/.claude/hooks"
|
|
43
43
|
printf '{"kitVersion":"0.0.1","profile":"software","project":{"name":"H","slug":"h"},"github":{"repo":"e/h","owner":"e","projectsV2":false}}\n' > "$proj/.claude/kit.config.json"
|
|
44
|
-
up() { CLAUDE_PLUGIN_ROOT="$ROOT" bash "$ROOT/
|
|
44
|
+
up() { CLAUDE_PLUGIN_ROOT="$ROOT" bash "$ROOT/lib/verbs/init.sh" --upgrade --target "$proj" --force 2>&1; }
|
|
45
45
|
up >/dev/null || { echo "FAIL: first init.sh --upgrade"; fail=1; }
|
|
46
46
|
|
|
47
47
|
old="$proj/.claude/hooks/guard-base-branch-commit.sh" # unmodified, but an OLDER kit version
|
|
48
48
|
own="$proj/.claude/hooks/repo-hygiene.sh" # customized by the project
|
|
49
49
|
printf '#!/usr/bin/env bash\n# an older kit version of this hook\nexit 0\n' > "$old"
|
|
50
50
|
( cd "$proj" && KIT_MANIFEST="$proj/.claude/kit.manifest.json" bash -c '
|
|
51
|
-
. "$1/
|
|
51
|
+
. "$1/lib/core/kit-manifest.sh"; kit_manifest_init; kit_manifest_record .claude/hooks/guard-base-branch-commit.sh B init >/dev/null' _ "$ROOT" )
|
|
52
52
|
printf '\n# project-specific tweak\n' >> "$own"
|
|
53
53
|
own_before="$(cat "$own")"
|
|
54
54
|
|
|
55
55
|
# A template fix ships with a new kit version: rewind kitVersion so the upgrade runs again.
|
|
56
56
|
jq '.kitVersion = "0.0.1"' "$proj/.claude/kit.config.json" > "$tmp/cfg" && mv "$tmp/cfg" "$proj/.claude/kit.config.json"
|
|
57
57
|
out="$(up)"
|
|
58
|
-
t "the unmodified hook now equals the template" "$(cmp -s "$old" "$ROOT/templates/hooks/guard-base-branch-commit.sh.tmpl" && echo same || echo differs)" same
|
|
58
|
+
t "the unmodified hook now equals the template" "$(cmp -s "$old" "$ROOT/kit/templates/hooks/guard-base-branch-commit.sh.tmpl" && echo same || echo differs)" same
|
|
59
59
|
case "$out" in *"~ .claude/hooks/guard-base-branch-commit.sh"*) echo "ok: the refresh is reported" ;; *) echo "FAIL: refresh not reported"; fail=1 ;; esac
|
|
60
60
|
t "the customized hook is untouched" "$(cat "$own")" "$own_before"
|
|
61
61
|
case "$out" in *"! .claude/hooks/repo-hygiene.sh"*) echo "ok: the customized hook is reported as drifted" ;; *) echo "FAIL: drift not reported"; fail=1 ;; esac
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# instruction-budget-baseline.txt — generated by
|
|
1
|
+
# instruction-budget-baseline.txt — generated by lib/core/instruction-budget-lint.sh --update
|
|
2
2
|
# Instruction files over 200 lines, and the resident total while it is over 150000 bytes.
|
|
3
3
|
# These are GRANDFATHERED: allowed to stay, but may never grow. Shrink them, scope a rule with
|
|
4
4
|
# `paths:`, or split it into a short rule + a knowledge doc, then re-run --update to tighten.
|
|
5
5
|
#
|
|
6
6
|
# <path> <lines> | @resident <bytes>
|
|
7
|
-
.claude/rules/effort-model.md
|
|
7
|
+
.claude/rules/effort-model.md 212
|
|
8
8
|
.claude/rules/naming-and-ids.md 208
|