claude-code-superkit 0.0.0-stage → 1.5.3
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/LICENSE +21 -0
- package/README.md +374 -2
- package/bin/cli.js +153 -0
- package/bin/inject-tokens.js +224 -0
- package/bin/measure-tokens.js +17 -0
- package/bin/superkit-counts-verify.sh +30 -0
- package/lib/codex.js +246 -0
- package/lib/docs-scaffold.js +147 -0
- package/lib/installer.js +499 -0
- package/lib/prompts.js +51 -0
- package/lib/settings-builder.js +51 -0
- package/lib/superpowers.js +99 -0
- package/lib/utils.js +117 -0
- package/lib/validator.js +84 -0
- package/package.json +49 -4
- package/packages/codex/AGENTS.md +396 -0
- package/packages/codex/INSTALL.md +342 -0
- package/packages/codex/config.toml +22 -0
- package/packages/codex/hooks/superkit.mjs +203 -0
- package/packages/codex/hooks.json +30 -0
- package/packages/codex/legacy-baseline.json +88 -0
- package/packages/codex/native-skills.txt +65 -0
- package/packages/codex/rules/default.rules +565 -0
- package/packages/codex/skills/ai-slop-cleaner/SKILL.md +44 -0
- package/packages/codex/skills/api-contract-sync/SKILL.md +96 -0
- package/packages/codex/skills/architect/SKILL.md +49 -0
- package/packages/codex/skills/audit-backend/SKILL.md +80 -0
- package/packages/codex/skills/audit-frontend/SKILL.md +82 -0
- package/packages/codex/skills/audit-infra/SKILL.md +87 -0
- package/packages/codex/skills/audit-orchestrator/SKILL.md +114 -0
- package/packages/codex/skills/behavioral-nudge-engine/SKILL.md +110 -0
- package/packages/codex/skills/benchmark/SKILL.md +49 -0
- package/packages/codex/skills/bot-reviewer/SKILL.md +94 -0
- package/packages/codex/skills/code-reviewer/SKILL.md +67 -0
- package/packages/codex/skills/codebase-onboarding-engineer/SKILL.md +46 -0
- package/packages/codex/skills/comment-rot-analyzer/SKILL.md +75 -0
- package/packages/codex/skills/commit-helper/SKILL.md +101 -0
- package/packages/codex/skills/critic/SKILL.md +56 -0
- package/packages/codex/skills/database-reviewer/SKILL.md +79 -0
- package/packages/codex/skills/debug-observer/SKILL.md +107 -0
- package/packages/codex/skills/dependency-checker/SKILL.md +69 -0
- package/packages/codex/skills/design-system-reviewer/SKILL.md +121 -0
- package/packages/codex/skills/dev-orchestrator/SKILL.md +304 -0
- package/packages/codex/skills/docs-reviewer/SKILL.md +86 -0
- package/packages/codex/skills/drizzle-orm-expert/SKILL.md +246 -0
- package/packages/codex/skills/e2e-test-generator/SKILL.md +95 -0
- package/packages/codex/skills/evaluator/SKILL.md +63 -0
- package/packages/codex/skills/frontend-perf-reviewer/SKILL.md +95 -0
- package/packages/codex/skills/frontend-ui-color-reviewer/SKILL.md +68 -0
- package/packages/codex/skills/frontend-ui-design-critic/SKILL.md +99 -0
- package/packages/codex/skills/frontend-ui-interaction-reviewer/SKILL.md +102 -0
- package/packages/codex/skills/frontend-ui-motion-reviewer/SKILL.md +85 -0
- package/packages/codex/skills/frontend-ui-reviewer/SKILL.md +81 -0
- package/packages/codex/skills/frontend-ui-typography-reviewer/SKILL.md +62 -0
- package/packages/codex/skills/gltf-debugging/SKILL.md +128 -0
- package/packages/codex/skills/go-benchmark/SKILL.md +217 -0
- package/packages/codex/skills/go-concurrency-reviewer/SKILL.md +113 -0
- package/packages/codex/skills/go-error-reviewer/SKILL.md +107 -0
- package/packages/codex/skills/go-grpc-patterns/SKILL.md +285 -0
- package/packages/codex/skills/go-modernizer/SKILL.md +111 -0
- package/packages/codex/skills/go-observability-reviewer/SKILL.md +121 -0
- package/packages/codex/skills/go-performance-reviewer/SKILL.md +112 -0
- package/packages/codex/skills/go-reviewer/SKILL.md +109 -0
- package/packages/codex/skills/go-samber-do/SKILL.md +158 -0
- package/packages/codex/skills/go-samber-lo/SKILL.md +178 -0
- package/packages/codex/skills/go-samber-oops/SKILL.md +174 -0
- package/packages/codex/skills/goal-verifier/SKILL.md +53 -0
- package/packages/codex/skills/health-checker/SKILL.md +109 -0
- package/packages/codex/skills/html-to-3d-texture/SKILL.md +153 -0
- package/packages/codex/skills/impeccable-craft/SKILL.md +101 -0
- package/packages/codex/skills/lint-runner/SKILL.md +85 -0
- package/packages/codex/skills/migrate/SKILL.md +60 -0
- package/packages/codex/skills/migration-reviewer/SKILL.md +88 -0
- package/packages/codex/skills/minimal-change-engineer/SKILL.md +44 -0
- package/packages/codex/skills/new-migration/SKILL.md +59 -0
- package/packages/codex/skills/nextjs-supabase-auth/SKILL.md +227 -0
- package/packages/codex/skills/output-enforcement/SKILL.md +71 -0
- package/packages/codex/skills/plan-checker/SKILL.md +53 -0
- package/packages/codex/skills/postgresql-optimization/SKILL.md +159 -0
- package/packages/codex/skills/pre-deploy-validator/SKILL.md +111 -0
- package/packages/codex/skills/presentation-reviewer/SKILL.md +88 -0
- package/packages/codex/skills/product-3d-lighting/SKILL.md +137 -0
- package/packages/codex/skills/project-architecture/SKILL.md +52 -0
- package/packages/codex/skills/py-reviewer/SKILL.md +100 -0
- package/packages/codex/skills/r3f-scene-reviewer/SKILL.md +88 -0
- package/packages/codex/skills/r3f-scroll-driven-3d/SKILL.md +162 -0
- package/packages/codex/skills/reality-checker/SKILL.md +61 -0
- package/packages/codex/skills/redis-patterns/SKILL.md +260 -0
- package/packages/codex/skills/review-orchestrator/SKILL.md +151 -0
- package/packages/codex/skills/rs-reviewer/SKILL.md +98 -0
- package/packages/codex/skills/ru-text/SKILL.md +132 -0
- package/packages/codex/skills/scaffold-endpoint/SKILL.md +44 -0
- package/packages/codex/skills/security-scanner/SKILL.md +94 -0
- package/packages/codex/skills/silent-failure-hunter/SKILL.md +176 -0
- package/packages/codex/skills/telegram-bot-builder/SKILL.md +120 -0
- package/packages/codex/skills/test-generator/SKILL.md +79 -0
- package/packages/codex/skills/test-runner/SKILL.md +101 -0
- package/packages/codex/skills/threejs-color-management/SKILL.md +97 -0
- package/packages/codex/skills/tree-generator/SKILL.md +63 -0
- package/packages/codex/skills/ts-reviewer/SKILL.md +90 -0
- package/packages/codex/skills/ui-design-reviewer/SKILL.md +89 -0
- package/packages/codex/skills/ui-reviewer/SKILL.md +103 -0
- package/packages/codex/skills/visual-reviewer/SKILL.md +85 -0
- package/packages/codex/skills/writing-agents/SKILL.md +165 -0
- package/packages/codex/skills/writing-commands/SKILL.md +173 -0
- package/packages/core/CLAUDE.md +118 -0
- package/packages/core/INTERNAL-FILES +16 -0
- package/packages/core/agents/ai-slop-cleaner.md +187 -0
- package/packages/core/agents/api-contract-sync.md +127 -0
- package/packages/core/agents/architect.md +205 -0
- package/packages/core/agents/audit-backend.md +137 -0
- package/packages/core/agents/audit-frontend.md +129 -0
- package/packages/core/agents/audit-infra.md +182 -0
- package/packages/core/agents/behavioral-nudge-engine.md +170 -0
- package/packages/core/agents/code-reviewer.md +195 -0
- package/packages/core/agents/codebase-onboarding-engineer.md +172 -0
- package/packages/core/agents/comment-rot-analyzer.md +115 -0
- package/packages/core/agents/critic.md +172 -0
- package/packages/core/agents/database-reviewer.md +201 -0
- package/packages/core/agents/debug-observer.md +261 -0
- package/packages/core/agents/dependency-checker.md +199 -0
- package/packages/core/agents/docs-reviewer.md +206 -0
- package/packages/core/agents/e2e-test-generator.md +261 -0
- package/packages/core/agents/evaluator.md +141 -0
- package/packages/core/agents/goal-verifier.md +130 -0
- package/packages/core/agents/health-checker.md +194 -0
- package/packages/core/agents/migration-reviewer.md +161 -0
- package/packages/core/agents/minimal-change-engineer.md +219 -0
- package/packages/core/agents/plan-checker.md +139 -0
- package/packages/core/agents/pre-deploy-validator.md +189 -0
- package/packages/core/agents/reality-checker.md +175 -0
- package/packages/core/agents/scaffold-endpoint.md +162 -0
- package/packages/core/agents/security-scanner.md +236 -0
- package/packages/core/agents/silent-failure-hunter.md +276 -0
- package/packages/core/agents/test-generator.md +146 -0
- package/packages/core/agents/tree-generator.md +141 -0
- package/packages/core/agents/ui-reviewer.md +172 -0
- package/packages/core/agents/visual-reviewer.md +211 -0
- package/packages/core/commands/audit.md +166 -0
- package/packages/core/commands/benchmark.md +130 -0
- package/packages/core/commands/commit.md +148 -0
- package/packages/core/commands/dev.md +302 -0
- package/packages/core/commands/docs-init.md +75 -0
- package/packages/core/commands/lint.md +137 -0
- package/packages/core/commands/migrate.md +146 -0
- package/packages/core/commands/new-migration.md +182 -0
- package/packages/core/commands/pair.md +209 -0
- package/packages/core/commands/review.md +195 -0
- package/packages/core/commands/security-scan.md +142 -0
- package/packages/core/commands/superkit-evolve.md +231 -0
- package/packages/core/commands/superkit-init.md +274 -0
- package/packages/core/commands/test.md +108 -0
- package/packages/core/commands/workflow.md +150 -0
- package/packages/core/docs/guide/01-getting-started.md +41 -0
- package/packages/core/docs-templates/README.md +33 -0
- package/packages/core/docs-templates/adr-template.md +62 -0
- package/packages/core/docs-templates/architecture/api-contracts.md +26 -0
- package/packages/core/docs-templates/architecture/api-reference.md +48 -0
- package/packages/core/docs-templates/architecture/auth-and-sessions.md +38 -0
- package/packages/core/docs-templates/architecture/backend-layers.md +42 -0
- package/packages/core/docs-templates/architecture/data-flow.md +26 -0
- package/packages/core/docs-templates/architecture/database-schema.md +51 -0
- package/packages/core/docs-templates/architecture/deployment.md +41 -0
- package/packages/core/docs-templates/architecture/frontend-state.md +46 -0
- package/packages/core/helpers/statusline.cjs +370 -0
- package/packages/core/hooks/CHAIN-SEMANTICS.md +84 -0
- package/packages/core/hooks/audit-settings-source.sh +98 -0
- package/packages/core/hooks/audit-trail.sh +120 -0
- package/packages/core/hooks/block-dangerous-git.sh +189 -0
- package/packages/core/hooks/bundle-import-check.sh +64 -0
- package/packages/core/hooks/compact-state-inject.sh +84 -0
- package/packages/core/hooks/config-protection.sh +68 -0
- package/packages/core/hooks/console-log-warning.sh +28 -0
- package/packages/core/hooks/context-monitor.sh +35 -0
- package/packages/core/hooks/dev-edit-counter.sh +59 -0
- package/packages/core/hooks/dev-marker-set.sh +55 -0
- package/packages/core/hooks/dev-required-on-commit.sh +426 -0
- package/packages/core/hooks/doc-check-on-commit.sh +396 -0
- package/packages/core/hooks/edit-streak-check.sh +63 -0
- package/packages/core/hooks/evolve-check.sh +78 -0
- package/packages/core/hooks/gateguard-pre-edit.sh +154 -0
- package/packages/core/hooks/gateguard-record-facts.sh +37 -0
- package/packages/core/hooks/intake-classifier.py +449 -0
- package/packages/core/hooks/lib/profile.sh +141 -0
- package/packages/core/hooks/loop-guard.sh +75 -0
- package/packages/core/hooks/migration-safety.sh +56 -0
- package/packages/core/hooks/plan-completion-gate.sh +61 -0
- package/packages/core/hooks/pre-compact-save.sh +89 -0
- package/packages/core/hooks/security-patterns.sh +119 -0
- package/packages/core/hooks/session-context-restore.sh +76 -0
- package/packages/core/hooks/subagent-stop-validate.sh +73 -0
- package/packages/core/hooks/superkit-counts-verify.sh +346 -0
- package/packages/core/hooks/superkit-update.sh +367 -0
- package/packages/core/hooks/tests/README.md +42 -0
- package/packages/core/hooks/tests/audit-trail-chain_test.sh +62 -0
- package/packages/core/hooks/tests/block-dangerous-git_test.sh +144 -0
- package/packages/core/hooks/tests/chain-semantics/h1.sh +11 -0
- package/packages/core/hooks/tests/chain-semantics/h2.sh +9 -0
- package/packages/core/hooks/tests/chain-semantics/h3.sh +11 -0
- package/packages/core/hooks/tests/chain-semantics/run-experiment.sh +65 -0
- package/packages/core/hooks/tests/chain-semantics/settings-experiment.json +15 -0
- package/packages/core/hooks/tests/counts-verify_test.sh +118 -0
- package/packages/core/hooks/tests/dev-required-on-commit_test.sh +207 -0
- package/packages/core/hooks/tests/dev-required-wip-on-main_test.sh +20 -0
- package/packages/core/hooks/tests/doc-check-on-commit_test.sh +122 -0
- package/packages/core/hooks/tests/edit-streak-check_test.sh +106 -0
- package/packages/core/hooks/tests/internal-manifest_test.sh +130 -0
- package/packages/core/hooks/tests/json-path_test.sh +108 -0
- package/packages/core/hooks/tests/mirror-invariants_test.sh +139 -0
- package/packages/core/hooks/tests/nudge-throttle_test.sh +95 -0
- package/packages/core/hooks/tests/profile-helper_test.sh +21 -0
- package/packages/core/hooks/tests/run-all.sh +47 -0
- package/packages/core/hooks/tests/session-key-helper_test.sh +17 -0
- package/packages/core/hooks/tests/superkit-update_test.sh +311 -0
- package/packages/core/hooks/tests/warn-visibility_test.sh +59 -0
- package/packages/core/hooks/user-intent-detect.sh +44 -0
- package/packages/core/hooks/verify-hooks.sh +69 -0
- package/packages/core/rules/auto-commands.md +124 -0
- package/packages/core/rules/coding-style.md +68 -0
- package/packages/core/rules/dev-workflow.md +77 -0
- package/packages/core/rules/documentation.md +106 -0
- package/packages/core/rules/frontend-aesthetics.md +53 -0
- package/packages/core/rules/git-workflow.md +14 -0
- package/packages/core/rules/security.md +29 -0
- package/packages/core/rules/superkit-integrity.md +114 -0
- package/packages/core/settings.json +229 -0
- package/packages/core/skills/drizzle-orm-expert/SKILL.md +260 -0
- package/packages/core/skills/nextjs-supabase-auth/SKILL.md +259 -0
- package/packages/core/skills/postgresql-optimization/SKILL.md +150 -0
- package/packages/core/skills/project-architecture/SKILL.md +31 -0
- package/packages/core/skills/project-scanner/SKILL.md +132 -0
- package/packages/core/skills/redis-patterns/SKILL.md +261 -0
- package/packages/core/skills/ru-text/SKILL.md +156 -0
- package/packages/core/skills/telegram-bot-builder/SKILL.md +145 -0
- package/packages/core/skills/writing-agents/SKILL.md +220 -0
- package/packages/core/skills/writing-commands/SKILL.md +176 -0
- package/packages/core/skills/writing-hooks/SKILL.md +335 -0
- package/packages/extras/bot-reviewer.md +279 -0
- package/packages/extras/design-system-reviewer.md +234 -0
- package/packages/extras/red-blue-auditor/README.md +117 -0
- package/packages/extras/red-blue-auditor/agent.md +128 -0
- package/packages/extras/red-blue-auditor/patterns/agent-config.txt +4 -0
- package/packages/extras/red-blue-auditor/patterns/hook-injection.txt +8 -0
- package/packages/extras/red-blue-auditor/patterns/mcp-risk.txt +5 -0
- package/packages/extras/red-blue-auditor/patterns/permission-abuse.txt +6 -0
- package/packages/extras/red-blue-auditor/patterns/secrets.txt +17 -0
- package/packages/extras/red-blue-auditor/scan.sh +88 -0
- package/packages/extras/skillsmp-search/SKILL.md +134 -0
- package/packages/frontend-3d/README.md +62 -0
- package/packages/frontend-3d/agents/frontend-perf-reviewer.md +164 -0
- package/packages/frontend-3d/agents/presentation-reviewer.md +146 -0
- package/packages/frontend-3d/agents/r3f-scene-reviewer.md +128 -0
- package/packages/frontend-3d/agents/ui-design-reviewer.md +169 -0
- package/packages/frontend-3d/commands/capture-screen.md +166 -0
- package/packages/frontend-3d/hooks/bundle-size-warn.sh +93 -0
- package/packages/frontend-3d/hooks/gsap-pattern-check.sh +74 -0
- package/packages/frontend-3d/hooks/r3f-color-check.sh +76 -0
- package/packages/frontend-3d/hooks/tailwind-version-guard.sh +98 -0
- package/packages/frontend-3d/rules/frontend-aesthetics-3d.md +81 -0
- package/packages/frontend-3d/rules/gsap-conventions.md +129 -0
- package/packages/frontend-3d/rules/threejs-conventions.md +116 -0
- package/packages/frontend-3d/skills/gltf-debugging/SKILL.md +145 -0
- package/packages/frontend-3d/skills/html-to-3d-texture/SKILL.md +183 -0
- package/packages/frontend-3d/skills/output-enforcement/SKILL.md +79 -0
- package/packages/frontend-3d/skills/product-3d-lighting/SKILL.md +166 -0
- package/packages/frontend-3d/skills/r3f-scroll-driven-3d/SKILL.md +209 -0
- package/packages/frontend-3d/skills/threejs-color-management/SKILL.md +111 -0
- package/packages/frontend-ui/NOTICE.md +99 -0
- package/packages/frontend-ui/README.md +59 -0
- package/packages/frontend-ui/agents/ui-color-reviewer.md +174 -0
- package/packages/frontend-ui/agents/ui-design-critic.md +198 -0
- package/packages/frontend-ui/agents/ui-interaction-reviewer.md +259 -0
- package/packages/frontend-ui/agents/ui-motion-reviewer.md +266 -0
- package/packages/frontend-ui/agents/ui-reviewer.md +251 -0
- package/packages/frontend-ui/agents/ui-typography-reviewer.md +222 -0
- package/packages/frontend-ui/hooks/tests/ui-animation-easing-check_test.sh +78 -0
- package/packages/frontend-ui/hooks/tests/ui-banned-fonts-check_test.sh +77 -0
- package/packages/frontend-ui/hooks/tests/ui-color-check_test.sh +75 -0
- package/packages/frontend-ui/hooks/ui-animation-easing-check.sh +86 -0
- package/packages/frontend-ui/hooks/ui-banned-fonts-check.sh +90 -0
- package/packages/frontend-ui/hooks/ui-color-check.sh +102 -0
- package/packages/frontend-ui/rules/color-and-contrast.md +230 -0
- package/packages/frontend-ui/rules/frontend-design-aesthetics.md +124 -0
- package/packages/frontend-ui/rules/interaction-polish.md +335 -0
- package/packages/frontend-ui/rules/motion-and-animation.md +283 -0
- package/packages/frontend-ui/rules/spatial-and-layout.md +212 -0
- package/packages/frontend-ui/rules/typography-guidelines.md +185 -0
- package/packages/frontend-ui/rules/ui-anti-patterns.md +309 -0
- package/packages/frontend-ui/settings.json +24 -0
- package/packages/frontend-ui/skills/impeccable-craft/SKILL.md +187 -0
- package/packages/gan/README.md +232 -0
- package/packages/gan/agents/gan-evaluator.md +214 -0
- package/packages/gan/agents/gan-generator.md +171 -0
- package/packages/gan/agents/gan-planner.md +206 -0
- package/packages/gan/rubrics/functionality.md +66 -0
- package/packages/gan/rubrics/ui-quality.md +77 -0
- package/packages/gan/skills/gan-evaluator/SKILL.md +91 -0
- package/packages/gan/skills/gan-generator/SKILL.md +72 -0
- package/packages/gan/skills/gan-planner/SKILL.md +93 -0
- package/packages/stack-agents/go/go-concurrency-reviewer.md +210 -0
- package/packages/stack-agents/go/go-error-reviewer.md +187 -0
- package/packages/stack-agents/go/go-modernizer.md +160 -0
- package/packages/stack-agents/go/go-observability-reviewer.md +185 -0
- package/packages/stack-agents/go/go-performance-reviewer.md +160 -0
- package/packages/stack-agents/go/go-reviewer.md +277 -0
- package/packages/stack-agents/go/references/benchmark-methodology.md +280 -0
- package/packages/stack-agents/go/references/channel-patterns.md +384 -0
- package/packages/stack-agents/go/references/cli-cobra-viper.md +190 -0
- package/packages/stack-agents/go/references/code-style.md +262 -0
- package/packages/stack-agents/go/references/context-propagation.md +317 -0
- package/packages/stack-agents/go/references/data-structures.md +315 -0
- package/packages/stack-agents/go/references/database-patterns.md +334 -0
- package/packages/stack-agents/go/references/design-patterns.md +411 -0
- package/packages/stack-agents/go/references/di-frameworks.md +146 -0
- package/packages/stack-agents/go/references/error-creation.md +251 -0
- package/packages/stack-agents/go/references/error-inspection.md +348 -0
- package/packages/stack-agents/go/references/error-wrapping.md +230 -0
- package/packages/stack-agents/go/references/gopls-driving.md +62 -0
- package/packages/stack-agents/go/references/goroutine-lifecycle.md +351 -0
- package/packages/stack-agents/go/references/graphql-patterns.md +221 -0
- package/packages/stack-agents/go/references/grpc-patterns.md +373 -0
- package/packages/stack-agents/go/references/modernize-guide.md +522 -0
- package/packages/stack-agents/go/references/module-management.md +191 -0
- package/packages/stack-agents/go/references/naming-conventions.md +176 -0
- package/packages/stack-agents/go/references/observability-pipeline.md +352 -0
- package/packages/stack-agents/go/references/performance-profiling.md +250 -0
- package/packages/stack-agents/go/references/refactoring-mechanics.md +127 -0
- package/packages/stack-agents/go/references/rest-openapi-patterns.md +160 -0
- package/packages/stack-agents/go/references/samber-do.md +201 -0
- package/packages/stack-agents/go/references/samber-libraries.md +363 -0
- package/packages/stack-agents/go/references/samber-lo.md +260 -0
- package/packages/stack-agents/go/references/samber-oops.md +200 -0
- package/packages/stack-agents/go/references/security-checklist.md +441 -0
- package/packages/stack-agents/go/references/standard-stdlib-now.md +181 -0
- package/packages/stack-agents/go/references/stay-updated.md +147 -0
- package/packages/stack-agents/go/references/structs-interfaces.md +312 -0
- package/packages/stack-agents/go/references/sync-primitives.md +395 -0
- package/packages/stack-agents/go/references/testing-patterns.md +483 -0
- package/packages/stack-agents/go/references/troubleshooting.md +98 -0
- package/packages/stack-agents/python/py-reviewer.md +194 -0
- package/packages/stack-agents/rust/rs-reviewer.md +188 -0
- package/packages/stack-agents/typescript/ts-reviewer.md +135 -0
- package/packages/stack-hooks/go/go-context-check-on-edit.sh +56 -0
- package/packages/stack-hooks/go/go-error-check-on-edit.sh +54 -0
- package/packages/stack-hooks/go/go-format-on-edit.sh +32 -0
- package/packages/stack-hooks/go/go-safety-check-on-edit.sh +54 -0
- package/packages/stack-hooks/go/go-vet-on-edit.sh +61 -0
- package/packages/stack-hooks/go/golangci-lint-on-edit.sh +54 -0
- package/packages/stack-hooks/python/ruff-on-edit.sh +67 -0
- package/packages/stack-hooks/rust/cargo-check-on-edit.sh +64 -0
- package/packages/stack-hooks/typescript/typecheck-on-edit.sh +76 -0
- package/packages/stack-rules/go/go-conventions.md +44 -0
- package/packages/stack-rules/go/go-safety.md +35 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# subagent-stop-validate.sh — per-agent post-run validation
|
|
3
|
+
# Triggers on: SubagentStop
|
|
4
|
+
# Profile: standard, strict
|
|
5
|
+
#
|
|
6
|
+
# When a reviewer / security / test subagent finishes, peek at
|
|
7
|
+
# `last_assistant_message` (already in the payload — no transcript
|
|
8
|
+
# parsing needed) and:
|
|
9
|
+
# - `go-reviewer` / `ts-reviewer` / `py-reviewer` / `rs-reviewer`
|
|
10
|
+
# → warn if `CRITICAL` or `SEVERITY: CRITICAL` markers exist
|
|
11
|
+
# that were not followed by "acknowledged" / "fixed" / "will fix"
|
|
12
|
+
# - `security-scanner` / `red-blue-auditor` → warn on any HIGH / CRITICAL
|
|
13
|
+
# severity finding (advisory here, not a block — a full block would
|
|
14
|
+
# need a session-global acknowledgement workflow)
|
|
15
|
+
# - `test-generator` → warn if the final message contains
|
|
16
|
+
# "Generated N tests" but no evidence the tests were actually run
|
|
17
|
+
# (no "pass" / "PASS" / "FAIL" / "running" / "go test" in output)
|
|
18
|
+
#
|
|
19
|
+
# This is always advisory (exit 0). Blocking the parent session
|
|
20
|
+
# requires a heavier follow-up (Task 16 v2) to give the user a way
|
|
21
|
+
# to acknowledge findings.
|
|
22
|
+
#
|
|
23
|
+
# Opt-out: CLAUDE_DISABLE_SUBAGENT_VALIDATE=1
|
|
24
|
+
|
|
25
|
+
# Unified profile + disable check
|
|
26
|
+
SUPERKIT_PROFILE_LIB="$(dirname "$0")/lib/profile.sh"
|
|
27
|
+
[ -f "$SUPERKIT_PROFILE_LIB" ] || SUPERKIT_PROFILE_LIB="$(dirname "$0")/../lib/profile.sh"
|
|
28
|
+
# shellcheck source=/dev/null
|
|
29
|
+
[ -f "$SUPERKIT_PROFILE_LIB" ] && source "$SUPERKIT_PROFILE_LIB" && should_skip_hook "$(basename "$0" .sh)" && exit 0
|
|
30
|
+
|
|
31
|
+
PROFILE="${CLAUDE_HOOK_PROFILE:-standard}"
|
|
32
|
+
if [ "$PROFILE" = "fast" ] || [ "${CLAUDE_DISABLE_SUBAGENT_VALIDATE:-}" = "1" ]; then
|
|
33
|
+
exit 0
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
INPUT=$(cat 2>/dev/null || echo '{}')
|
|
37
|
+
EVENT=$(echo "$INPUT" | jq -r '.hook_event_name // empty' 2>/dev/null)
|
|
38
|
+
[ "$EVENT" = "SubagentStop" ] || exit 0
|
|
39
|
+
|
|
40
|
+
AGENT_TYPE=$(echo "$INPUT" | jq -r '.agent_type // empty' 2>/dev/null)
|
|
41
|
+
MSG=$(echo "$INPUT" | jq -r '.last_assistant_message // empty' 2>/dev/null)
|
|
42
|
+
[ -z "$AGENT_TYPE" ] || [ -z "$MSG" ] && exit 0
|
|
43
|
+
|
|
44
|
+
warn() {
|
|
45
|
+
# Print to stderr with a consistent banner
|
|
46
|
+
printf '\n[subagent-stop-validate] %s: %s\n' "$AGENT_TYPE" "$1" >&2
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
case "$AGENT_TYPE" in
|
|
50
|
+
go-reviewer|ts-reviewer|py-reviewer|rs-reviewer|code-reviewer)
|
|
51
|
+
# CRITICAL finding without an acknowledgement?
|
|
52
|
+
if printf '%s' "$MSG" | grep -qE '(CRITICAL|SEVERITY:\s*CRITICAL|severity:\s*CRITICAL)'; then
|
|
53
|
+
if ! printf '%s' "$MSG" | grep -qiE 'acknowledg|will fix|fixed|resolved|deferr|out of scope'; then
|
|
54
|
+
warn "CRITICAL findings present but not acknowledged / fixed / deferred. Review recommended before proceeding."
|
|
55
|
+
fi
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
security-scanner|red-blue-auditor)
|
|
59
|
+
# Match the severity token only — confidence "HIGH" (e.g. "[WARNING/HIGH]") must not trigger this
|
|
60
|
+
if printf '%s' "$MSG" | grep -qE '\bCRITICAL\b'; then
|
|
61
|
+
warn "CRITICAL security finding reported. Do NOT merge until resolved or explicitly waived."
|
|
62
|
+
fi
|
|
63
|
+
;;
|
|
64
|
+
test-generator|e2e-test-generator)
|
|
65
|
+
if printf '%s' "$MSG" | grep -qiE 'Generated [0-9]+ tests'; then
|
|
66
|
+
if ! printf '%s' "$MSG" | grep -qiE '(\b(pass|fail|running|go test|npm test|pytest|cargo test|PASS|FAIL)\b|tests? (ran|passed|failed))'; then
|
|
67
|
+
warn "Tests were generated but there is no evidence they were executed. Run them before committing."
|
|
68
|
+
fi
|
|
69
|
+
fi
|
|
70
|
+
;;
|
|
71
|
+
esac
|
|
72
|
+
|
|
73
|
+
exit 0
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# superkit-counts-verify.sh — PreToolUse hook (Bash)
|
|
3
|
+
# Verifies file counts, versions, and documentation consistency before git commit/push
|
|
4
|
+
# Profile: standard, strict
|
|
5
|
+
# SUPERKIT-INTERNAL: only runs in the superkit repo itself
|
|
6
|
+
#
|
|
7
|
+
# FLAGS:
|
|
8
|
+
# --check-remote Also verify the GitHub About description via `gh repo view`
|
|
9
|
+
# (a network call). Off by default so every local commit
|
|
10
|
+
# stays offline-fast; the network check auto-enables on a
|
|
11
|
+
# `git push` command, where the remote About actually
|
|
12
|
+
# matters. Set SUPERKIT_VERIFY_CHECK_REMOTE=1 to force it on.
|
|
13
|
+
#
|
|
14
|
+
# EXIT CODES:
|
|
15
|
+
# 0 = allow (everything matches)
|
|
16
|
+
# 2 = BLOCK (mismatch detected)
|
|
17
|
+
|
|
18
|
+
# ── Flag parsing ────────────────────────────────────────────────────
|
|
19
|
+
CHECK_REMOTE="${SUPERKIT_VERIFY_CHECK_REMOTE:-0}"
|
|
20
|
+
for arg in "$@"; do
|
|
21
|
+
case "$arg" in
|
|
22
|
+
--check-remote) CHECK_REMOTE=1 ;;
|
|
23
|
+
esac
|
|
24
|
+
done
|
|
25
|
+
|
|
26
|
+
# ── Internal-file ship-list (derived from the manifest) ─────────────
|
|
27
|
+
# packages/core/INTERNAL-FILES is the single source of truth for repo-only files
|
|
28
|
+
# that are NEVER installed into a user's .claude/. They must be subtracted from
|
|
29
|
+
# the on-disk core counts to get the public "shipped" counts. We DERIVE the
|
|
30
|
+
# per-category lists (and thus the subtraction amounts) from that manifest so
|
|
31
|
+
# this hook, lib/installer.js, and superkit-update.sh never drift.
|
|
32
|
+
MANIFEST_FILE="packages/core/INTERNAL-FILES"
|
|
33
|
+
|
|
34
|
+
# manifest_category <hooks|rules> — echo space-separated basenames for the
|
|
35
|
+
# manifest entries whose dirname matches the category. Silent when the manifest
|
|
36
|
+
# is absent (the caller applies the FALLBACK below).
|
|
37
|
+
manifest_category() {
|
|
38
|
+
local category="$1" line dir base
|
|
39
|
+
[ -f "$MANIFEST_FILE" ] || return 0
|
|
40
|
+
while IFS= read -r line || [ -n "$line" ]; do
|
|
41
|
+
line="${line#"${line%%[![:space:]]*}"}" # ltrim
|
|
42
|
+
line="${line%"${line##*[![:space:]]}"}" # rtrim
|
|
43
|
+
[ -z "$line" ] && continue
|
|
44
|
+
case "$line" in \#*) continue ;; esac
|
|
45
|
+
dir="${line%/*}"; base="${line##*/}"
|
|
46
|
+
[ "$dir" = "$category" ] && printf '%s ' "$base"
|
|
47
|
+
done < "$MANIFEST_FILE"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
SUPERKIT_INTERNAL_HOOKS="$(manifest_category hooks)"
|
|
51
|
+
SUPERKIT_INTERNAL_RULES="$(manifest_category rules)"
|
|
52
|
+
# FALLBACK: if the manifest is missing/unreadable, fall back to the previous
|
|
53
|
+
# hard-coded values — a broken verifier is worse than a stale list. These
|
|
54
|
+
# literals live ONLY inside this clearly-marked fallback.
|
|
55
|
+
if [ -z "${SUPERKIT_INTERNAL_HOOKS// }" ] && [ -z "${SUPERKIT_INTERNAL_RULES// }" ]; then
|
|
56
|
+
SUPERKIT_INTERNAL_HOOKS="superkit-counts-verify.sh verify-hooks.sh" # FALLBACK
|
|
57
|
+
SUPERKIT_INTERNAL_RULES="superkit-integrity.md" # FALLBACK
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# count_internal_present <dir> <space-separated-basenames>
|
|
61
|
+
# Counts how many of the named internal files actually exist in <dir>, so the
|
|
62
|
+
# subtraction tracks reality (and the manifest's per-category line count)
|
|
63
|
+
# instead of a magic constant. Renaming/removing an internal file in the
|
|
64
|
+
# manifest keeps the shipped count correct automatically.
|
|
65
|
+
count_internal_present() {
|
|
66
|
+
local dir="$1"; shift
|
|
67
|
+
local n=0 f
|
|
68
|
+
for f in "$@"; do
|
|
69
|
+
[ -f "$dir/$f" ] && n=$((n + 1))
|
|
70
|
+
done
|
|
71
|
+
printf '%s' "$n"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# Only run inside the superkit repo
|
|
75
|
+
if [ ! -f "packages/core/settings.json" ] || [ ! -d "packages/core/agents" ]; then
|
|
76
|
+
exit 0
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# Read the tool input (PreToolUse payload: .tool_input.command).
|
|
80
|
+
# See doc-check-on-commit.sh for the historical-bug context — same JSON shape.
|
|
81
|
+
INPUT=$(cat)
|
|
82
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // .command // empty' 2>/dev/null)
|
|
83
|
+
|
|
84
|
+
# Only trigger on git commit or git push
|
|
85
|
+
if ! echo "$COMMAND" | grep -qE 'git\s+(commit|push)'; then
|
|
86
|
+
exit 0
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# Network About check runs on push (where it matters) or when --check-remote
|
|
90
|
+
# / SUPERKIT_VERIFY_CHECK_REMOTE=1 is given — not on every local commit.
|
|
91
|
+
if echo "$COMMAND" | grep -qE 'git\s+push'; then
|
|
92
|
+
CHECK_REMOTE=1
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
ERRORS=""
|
|
96
|
+
|
|
97
|
+
# ── Label-anchored table-cell extractor ─────────────────────────────
|
|
98
|
+
# claude_col <row-label> <pipe-field-number> — pull one cell from the
|
|
99
|
+
# CLAUDE.md "Current Counts" table by anchoring on the row label, then
|
|
100
|
+
# selecting the Nth pipe-delimited field. Robust against column/row reorders
|
|
101
|
+
# and embedded numbers in neighbouring cells (unlike `grep -oE | sed -n Np`).
|
|
102
|
+
# Field map for `| Component | Core | Stack | … | Showcase | Codex |`:
|
|
103
|
+
# 2=Label 3=Core 4=Stack 5=Frontend-3D 6=Frontend-UI 7=GAN 8=Extras 9=Showcase 10=Codex
|
|
104
|
+
# Returns the first integer in the cell, or empty if the cell holds no digits
|
|
105
|
+
# (e.g. a "—" placeholder) — callers skip the check when the result is empty.
|
|
106
|
+
claude_col() {
|
|
107
|
+
local label="$1" field="$2"
|
|
108
|
+
grep -E "^\| ${label} \|" CLAUDE.md 2>/dev/null | head -1 \
|
|
109
|
+
| cut -d'|' -f"$field" | grep -oE '[0-9]+' | head -1
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
# readme_count <row-label> — pull the first integer from a README "What's
|
|
113
|
+
# Inside" table row, anchored on its bold label (e.g. `| **Core Agents** |`).
|
|
114
|
+
# Anchoring on the label means a row reorder can't silently shift the number.
|
|
115
|
+
readme_count() {
|
|
116
|
+
local label="$1"
|
|
117
|
+
grep -E "^\| \*\*${label}\*\* \|" README.md 2>/dev/null | head -1 \
|
|
118
|
+
| cut -d'|' -f3 | grep -oE '[0-9]+' | head -1
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# ── Count actual files ──────────────────────────────────────────────
|
|
122
|
+
|
|
123
|
+
# Core
|
|
124
|
+
CORE_AGENTS=$(ls packages/core/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
125
|
+
CORE_COMMANDS=$(ls packages/core/commands/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
126
|
+
CORE_HOOKS=$(ls packages/core/hooks/*.sh packages/core/hooks/*.py 2>/dev/null | wc -l | tr -d ' ')
|
|
127
|
+
CORE_RULES=$(ls packages/core/rules/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
128
|
+
|
|
129
|
+
# Stack (per-language packages under packages/stack-*/)
|
|
130
|
+
STACK_AGENTS=0
|
|
131
|
+
STACK_HOOKS=0
|
|
132
|
+
STACK_RULES=0
|
|
133
|
+
for lang in go typescript python rust; do
|
|
134
|
+
if [ -d "packages/stack-agents/$lang" ]; then
|
|
135
|
+
COUNT=$(ls packages/stack-agents/$lang/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
136
|
+
STACK_AGENTS=$((STACK_AGENTS + COUNT))
|
|
137
|
+
fi
|
|
138
|
+
if [ -d "packages/stack-hooks/$lang" ]; then
|
|
139
|
+
COUNT=$(ls packages/stack-hooks/$lang/*.sh 2>/dev/null | wc -l | tr -d ' ')
|
|
140
|
+
STACK_HOOKS=$((STACK_HOOKS + COUNT))
|
|
141
|
+
fi
|
|
142
|
+
if [ -d "packages/stack-rules/$lang" ]; then
|
|
143
|
+
COUNT=$(ls packages/stack-rules/$lang/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
144
|
+
STACK_RULES=$((STACK_RULES + COUNT))
|
|
145
|
+
fi
|
|
146
|
+
done
|
|
147
|
+
|
|
148
|
+
# Self-contained packages (agents/hooks/rules/commands colocated in packages/<pkg>/)
|
|
149
|
+
PKG_AGENTS=0
|
|
150
|
+
PKG_HOOKS=0
|
|
151
|
+
PKG_RULES=0
|
|
152
|
+
PKG_COMMANDS=0
|
|
153
|
+
for pkg in frontend-3d frontend-ui gan; do
|
|
154
|
+
if [ -d "packages/$pkg/agents" ]; then
|
|
155
|
+
COUNT=$(ls packages/$pkg/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
156
|
+
PKG_AGENTS=$((PKG_AGENTS + COUNT))
|
|
157
|
+
fi
|
|
158
|
+
if [ -d "packages/$pkg/hooks" ]; then
|
|
159
|
+
COUNT=$(ls packages/$pkg/hooks/*.sh 2>/dev/null | wc -l | tr -d ' ')
|
|
160
|
+
PKG_HOOKS=$((PKG_HOOKS + COUNT))
|
|
161
|
+
fi
|
|
162
|
+
if [ -d "packages/$pkg/rules" ]; then
|
|
163
|
+
COUNT=$(ls packages/$pkg/rules/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
164
|
+
PKG_RULES=$((PKG_RULES + COUNT))
|
|
165
|
+
fi
|
|
166
|
+
if [ -d "packages/$pkg/commands" ]; then
|
|
167
|
+
COUNT=$(ls packages/$pkg/commands/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
168
|
+
PKG_COMMANDS=$((PKG_COMMANDS + COUNT))
|
|
169
|
+
fi
|
|
170
|
+
done
|
|
171
|
+
|
|
172
|
+
# Extras
|
|
173
|
+
EXTRAS_AGENTS=$({ ls packages/extras/*.md 2>/dev/null; ls packages/extras/*/agent.md 2>/dev/null; } | wc -l | tr -d ' ')
|
|
174
|
+
|
|
175
|
+
# Codex
|
|
176
|
+
CODEX_SKILLS=$(find packages/codex/skills -name "SKILL.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
177
|
+
|
|
178
|
+
# Showcase
|
|
179
|
+
SHOWCASE_AGENTS=$(ls packages/showcase/.claude/agents/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
180
|
+
SHOWCASE_COMMANDS=$(ls packages/showcase/.claude/commands/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
181
|
+
|
|
182
|
+
# References
|
|
183
|
+
REFERENCE_DOCS=$(ls packages/stack-agents/go/references/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
184
|
+
|
|
185
|
+
# Totals — include frontend-3d (and any future self-contained pkg) in stack sums
|
|
186
|
+
TOTAL_AGENTS=$((CORE_AGENTS + STACK_AGENTS + PKG_AGENTS + EXTRAS_AGENTS))
|
|
187
|
+
# Internal-only core hooks/rules aren't shipped to users — subtract the ones
|
|
188
|
+
# that actually exist on disk (manifest-derived ship-list above) so TOTAL_*
|
|
189
|
+
# matches the public README/GitHub/CLAUDE.md counts. No magic constant: the
|
|
190
|
+
# count tracks the manifest's per-category entries against reality.
|
|
191
|
+
INTERNAL_HOOKS_PRESENT=$(count_internal_present "packages/core/hooks" $SUPERKIT_INTERNAL_HOOKS)
|
|
192
|
+
INTERNAL_RULES_PRESENT=$(count_internal_present "packages/core/rules" $SUPERKIT_INTERNAL_RULES)
|
|
193
|
+
SHIPPED_CORE_HOOKS=$((CORE_HOOKS - INTERNAL_HOOKS_PRESENT))
|
|
194
|
+
TOTAL_HOOKS=$((SHIPPED_CORE_HOOKS + STACK_HOOKS + PKG_HOOKS))
|
|
195
|
+
SHIPPED_CORE_RULES=$((CORE_RULES - INTERNAL_RULES_PRESENT))
|
|
196
|
+
TOTAL_RULES=$((SHIPPED_CORE_RULES + STACK_RULES + PKG_RULES))
|
|
197
|
+
TOTAL_COMMANDS=$((CORE_COMMANDS + PKG_COMMANDS))
|
|
198
|
+
|
|
199
|
+
# ── Check VERSION vs package.json ───────────────────────────────────
|
|
200
|
+
VERSION_FILE=$(cat VERSION 2>/dev/null | tr -d '[:space:]')
|
|
201
|
+
PKG_VERSION=$(node -e "console.log(require('./package.json').version)" 2>/dev/null)
|
|
202
|
+
|
|
203
|
+
if [ "$VERSION_FILE" != "$PKG_VERSION" ]; then
|
|
204
|
+
ERRORS="${ERRORS}\n - VERSION ($VERSION_FILE) != package.json ($PKG_VERSION)"
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
# ── Check CLAUDE.md counts table (label-anchored, column-precise) ────
|
|
208
|
+
# Field map: 3=Core 4=Stack 9=Showcase 10=Codex (see claude_col header).
|
|
209
|
+
|
|
210
|
+
# Core agents (Agents row, Core column)
|
|
211
|
+
CLAUDE_CORE_AGENTS=$(claude_col "Agents" 3)
|
|
212
|
+
if [ -n "$CLAUDE_CORE_AGENTS" ] && [ "$CLAUDE_CORE_AGENTS" != "$CORE_AGENTS" ]; then
|
|
213
|
+
ERRORS="${ERRORS}\n - CLAUDE.md Core Agents ($CLAUDE_CORE_AGENTS) != actual ($CORE_AGENTS)"
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
# Stack agents (Agents row, Stack column)
|
|
217
|
+
CLAUDE_STACK_AGENTS=$(claude_col "Agents" 4)
|
|
218
|
+
if [ -n "$CLAUDE_STACK_AGENTS" ] && [ "$CLAUDE_STACK_AGENTS" != "$STACK_AGENTS" ]; then
|
|
219
|
+
ERRORS="${ERRORS}\n - CLAUDE.md Stack Agents ($CLAUDE_STACK_AGENTS) != actual ($STACK_AGENTS)"
|
|
220
|
+
fi
|
|
221
|
+
|
|
222
|
+
# Core commands (Commands row, Core column)
|
|
223
|
+
CLAUDE_COMMANDS=$(claude_col "Commands" 3)
|
|
224
|
+
if [ -n "$CLAUDE_COMMANDS" ] && [ "$CLAUDE_COMMANDS" != "$CORE_COMMANDS" ]; then
|
|
225
|
+
ERRORS="${ERRORS}\n - CLAUDE.md Commands ($CLAUDE_COMMANDS) != actual ($CORE_COMMANDS)"
|
|
226
|
+
fi
|
|
227
|
+
|
|
228
|
+
# Codex skills (Skills row, Codex column)
|
|
229
|
+
CLAUDE_CODEX=$(claude_col "Skills" 10)
|
|
230
|
+
if [ -n "$CLAUDE_CODEX" ] && [ "$CLAUDE_CODEX" != "$CODEX_SKILLS" ]; then
|
|
231
|
+
ERRORS="${ERRORS}\n - CLAUDE.md Codex Skills ($CLAUDE_CODEX) != actual ($CODEX_SKILLS)"
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
# Showcase commands (Commands row, Showcase column)
|
|
235
|
+
CLAUDE_SHOWCASE_CMD=$(claude_col "Commands" 9)
|
|
236
|
+
if [ -n "$CLAUDE_SHOWCASE_CMD" ] && [ "$CLAUDE_SHOWCASE_CMD" != "$SHOWCASE_COMMANDS" ]; then
|
|
237
|
+
ERRORS="${ERRORS}\n - CLAUDE.md Showcase Commands ($CLAUDE_SHOWCASE_CMD) != actual ($SHOWCASE_COMMANDS)"
|
|
238
|
+
fi
|
|
239
|
+
|
|
240
|
+
# ── Check README total agent count (badge / "N agents" free text) ────
|
|
241
|
+
README_TOTAL_AGENTS=$(grep -oE '[0-9]+_agents|[0-9]+ agents' README.md 2>/dev/null | grep -oE '[0-9]+' | head -1)
|
|
242
|
+
if [ -n "$README_TOTAL_AGENTS" ] && [ "$README_TOTAL_AGENTS" != "$TOTAL_AGENTS" ]; then
|
|
243
|
+
ERRORS="${ERRORS}\n - README total agents ($README_TOTAL_AGENTS) != actual ($TOTAL_AGENTS)"
|
|
244
|
+
fi
|
|
245
|
+
|
|
246
|
+
# ── Check README "What's Inside" table (label-anchored by row) ───────
|
|
247
|
+
# Anchored on the bold row label so a row reorder can't shift the parse.
|
|
248
|
+
README_CORE_AGENTS=$(readme_count "Core Agents")
|
|
249
|
+
if [ -n "$README_CORE_AGENTS" ] && [ "$README_CORE_AGENTS" != "$CORE_AGENTS" ]; then
|
|
250
|
+
ERRORS="${ERRORS}\n - README Core Agents ($README_CORE_AGENTS) != actual ($CORE_AGENTS)"
|
|
251
|
+
fi
|
|
252
|
+
|
|
253
|
+
README_COMMANDS=$(readme_count "Commands")
|
|
254
|
+
if [ -n "$README_COMMANDS" ] && [ "$README_COMMANDS" != "$TOTAL_COMMANDS" ]; then
|
|
255
|
+
ERRORS="${ERRORS}\n - README Commands ($README_COMMANDS) != actual ($TOTAL_COMMANDS)"
|
|
256
|
+
fi
|
|
257
|
+
|
|
258
|
+
README_HOOKS=$(readme_count "Hooks")
|
|
259
|
+
if [ -n "$README_HOOKS" ] && [ "$README_HOOKS" != "$TOTAL_HOOKS" ]; then
|
|
260
|
+
ERRORS="${ERRORS}\n - README Hooks ($README_HOOKS) != actual ($TOTAL_HOOKS)"
|
|
261
|
+
fi
|
|
262
|
+
|
|
263
|
+
README_RULES=$(readme_count "Rules")
|
|
264
|
+
if [ -n "$README_RULES" ] && [ "$README_RULES" != "$TOTAL_RULES" ]; then
|
|
265
|
+
ERRORS="${ERRORS}\n - README Rules ($README_RULES) != actual ($TOTAL_RULES)"
|
|
266
|
+
fi
|
|
267
|
+
|
|
268
|
+
# ── Check README Codex skill count (look for "N skills" near "Codex" context) ──
|
|
269
|
+
README_CODEX=$(grep -i 'codex' README.md 2>/dev/null | grep -oE '[0-9]+ skills' | grep -oE '^[0-9]+' | head -1)
|
|
270
|
+
if [ -n "$README_CODEX" ] && [ "$README_CODEX" != "$CODEX_SKILLS" ]; then
|
|
271
|
+
ERRORS="${ERRORS}\n - README Codex skills ($README_CODEX) != actual ($CODEX_SKILLS)"
|
|
272
|
+
fi
|
|
273
|
+
|
|
274
|
+
# ── Check GitHub About description (network; gated by --check-remote) ──
|
|
275
|
+
# Off for local commits (offline-fast); auto-enabled on `git push` or via
|
|
276
|
+
# --check-remote / SUPERKIT_VERIFY_CHECK_REMOTE=1.
|
|
277
|
+
if [ "$CHECK_REMOTE" = "1" ] && command -v gh &>/dev/null; then
|
|
278
|
+
GH_DESC=$(gh repo view --json description -q '.description' 2>/dev/null)
|
|
279
|
+
if [ -n "$GH_DESC" ]; then
|
|
280
|
+
# Extract numbers from description: "agents (N), commands (N), hooks (N), skills (N), rules (N)"
|
|
281
|
+
GH_AGENTS=$(echo "$GH_DESC" | grep -oE 'agents \([0-9]+\)' | grep -oE '[0-9]+')
|
|
282
|
+
GH_COMMANDS=$(echo "$GH_DESC" | grep -oE 'commands \([0-9]+\)' | grep -oE '[0-9]+')
|
|
283
|
+
GH_HOOKS=$(echo "$GH_DESC" | grep -oE 'hooks \([0-9]+\)' | grep -oE '[0-9]+')
|
|
284
|
+
GH_RULES=$(echo "$GH_DESC" | grep -oE 'rules \([0-9]+\)' | grep -oE '[0-9]+')
|
|
285
|
+
|
|
286
|
+
if [ -n "$GH_AGENTS" ] && [ "$GH_AGENTS" != "$TOTAL_AGENTS" ]; then
|
|
287
|
+
ERRORS="${ERRORS}\n - GitHub About agents ($GH_AGENTS) != actual ($TOTAL_AGENTS)"
|
|
288
|
+
fi
|
|
289
|
+
if [ -n "$GH_COMMANDS" ] && [ "$GH_COMMANDS" != "$TOTAL_COMMANDS" ]; then
|
|
290
|
+
ERRORS="${ERRORS}\n - GitHub About commands ($GH_COMMANDS) != actual ($TOTAL_COMMANDS)"
|
|
291
|
+
fi
|
|
292
|
+
if [ -n "$GH_HOOKS" ] && [ "$GH_HOOKS" != "$TOTAL_HOOKS" ]; then
|
|
293
|
+
ERRORS="${ERRORS}\n - GitHub About hooks ($GH_HOOKS) != actual ($TOTAL_HOOKS)"
|
|
294
|
+
fi
|
|
295
|
+
if [ -n "$GH_RULES" ] && [ "$GH_RULES" != "$TOTAL_RULES" ]; then
|
|
296
|
+
ERRORS="${ERRORS}\n - GitHub About rules ($GH_RULES) != actual ($TOTAL_RULES)"
|
|
297
|
+
fi
|
|
298
|
+
fi
|
|
299
|
+
fi
|
|
300
|
+
|
|
301
|
+
# ── Check CHANGELOG has current version ─────────────────────────────
|
|
302
|
+
if [ -n "$VERSION_FILE" ]; then
|
|
303
|
+
if ! grep -q "$VERSION_FILE" CHANGELOG.md 2>/dev/null; then
|
|
304
|
+
ERRORS="${ERRORS}\n - CHANGELOG.md has no entry for version $VERSION_FILE"
|
|
305
|
+
fi
|
|
306
|
+
fi
|
|
307
|
+
|
|
308
|
+
# ── Check Codex AGENTS.md skill count ───────────────────────────────
|
|
309
|
+
if [ -f "packages/codex/AGENTS.md" ]; then
|
|
310
|
+
CODEX_AGENTS_LISTED=$(grep -oE '[0-9]+ skills' packages/codex/AGENTS.md 2>/dev/null | grep -oE '^[0-9]+' | head -1)
|
|
311
|
+
if [ -n "$CODEX_AGENTS_LISTED" ] && [ "$CODEX_AGENTS_LISTED" != "$CODEX_SKILLS" ]; then
|
|
312
|
+
ERRORS="${ERRORS}\n - Codex AGENTS.md skill count ($CODEX_AGENTS_LISTED) != actual ($CODEX_SKILLS)"
|
|
313
|
+
fi
|
|
314
|
+
fi
|
|
315
|
+
|
|
316
|
+
# ── Check Codex INSTALL.md skill count ──────────────────────────────
|
|
317
|
+
if [ -f "packages/codex/INSTALL.md" ]; then
|
|
318
|
+
CODEX_INSTALL_COUNT=$(grep -oE '[0-9]+ skills' packages/codex/INSTALL.md 2>/dev/null | grep -oE '^[0-9]+' | head -1)
|
|
319
|
+
if [ -n "$CODEX_INSTALL_COUNT" ] && [ "$CODEX_INSTALL_COUNT" != "$CODEX_SKILLS" ]; then
|
|
320
|
+
ERRORS="${ERRORS}\n - Codex INSTALL.md skill count ($CODEX_INSTALL_COUNT) != actual ($CODEX_SKILLS)"
|
|
321
|
+
fi
|
|
322
|
+
fi
|
|
323
|
+
|
|
324
|
+
# ── Output result ───────────────────────────────────────────────────
|
|
325
|
+
if [ -n "$ERRORS" ]; then
|
|
326
|
+
echo "" >&2
|
|
327
|
+
echo "BLOCKED: Superkit count/version mismatch detected" >&2
|
|
328
|
+
echo "" >&2
|
|
329
|
+
echo -e " Mismatches:${ERRORS}" >&2
|
|
330
|
+
echo "" >&2
|
|
331
|
+
echo " Actual counts:" >&2
|
|
332
|
+
echo " Core: agents=$CORE_AGENTS commands=$CORE_COMMANDS hooks=$CORE_HOOKS rules=$CORE_RULES" >&2
|
|
333
|
+
echo " Stack: agents=$STACK_AGENTS hooks=$STACK_HOOKS rules=$STACK_RULES" >&2
|
|
334
|
+
echo " Packages: agents=$PKG_AGENTS hooks=$PKG_HOOKS rules=$PKG_RULES commands=$PKG_COMMANDS" >&2
|
|
335
|
+
echo " Total: agents=$TOTAL_AGENTS commands=$TOTAL_COMMANDS hooks=$TOTAL_HOOKS rules=$TOTAL_RULES" >&2
|
|
336
|
+
echo " Codex: skills=$CODEX_SKILLS" >&2
|
|
337
|
+
echo " Showcase: agents=$SHOWCASE_AGENTS commands=$SHOWCASE_COMMANDS" >&2
|
|
338
|
+
echo " References: $REFERENCE_DOCS" >&2
|
|
339
|
+
echo " VERSION=$VERSION_FILE package.json=$PKG_VERSION" >&2
|
|
340
|
+
echo "" >&2
|
|
341
|
+
echo " Fix: update documented counts to match, then run gh repo edit --description if GitHub About is wrong." >&2
|
|
342
|
+
echo "" >&2
|
|
343
|
+
exit 2
|
|
344
|
+
fi
|
|
345
|
+
|
|
346
|
+
exit 0
|