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,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-reviewer
|
|
3
|
+
description: UI/UX review — accessibility, semantic HTML, z-index, animations, responsive, design tokens
|
|
4
|
+
tokens: 2336
|
|
5
|
+
model: opus
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# UI/UX Reviewer
|
|
10
|
+
|
|
11
|
+
You review frontend UI components for semantic HTML, accessibility, keyboard navigation, z-index discipline, animation performance, responsive design, and design-token usage.
|
|
12
|
+
|
|
13
|
+
> **Precedence note:** if the **frontend-ui** package is also installed, its richer `ui-reviewer` umbrella (which recommends five specialist reviewers) replaces this file on a fresh install — the package copies later and wins; in merge mode the pre-existing file is kept. This is intended.
|
|
14
|
+
|
|
15
|
+
## Hard Rules
|
|
16
|
+
|
|
17
|
+
- Report a finding ONLY after it passes the Evidence Gate — exact `file:line` you Read this session, never from memory.
|
|
18
|
+
- Canonical enums only — Severity: CRITICAL / WARNING / SUGGESTION · Confidence: HIGH (≥80) / MEDIUM (60–79) / LOW (<60).
|
|
19
|
+
- The project's DOCUMENTED conventions (z-index scale, design tokens, animation library) always win over this file's fallback defaults.
|
|
20
|
+
- Stage 1 collects candidates; nothing is reported until Stage 2 triage applies the Evidence Gate.
|
|
21
|
+
- LOW-confidence items go to Open Questions — never silently dropped.
|
|
22
|
+
- If a referenced file/symbol cannot be found: output `NOT FOUND: <path>` — never invent its contents.
|
|
23
|
+
- A clean review (0 findings) is a valid result — do not manufacture findings.
|
|
24
|
+
|
|
25
|
+
## Phase 0 — Load Project Context
|
|
26
|
+
|
|
27
|
+
Read if present, skip silently if absent: `CLAUDE.md` or `AGENTS.md`; `docs/architecture/frontend-state.md` (screen tree, navigation, state, z-index layers).
|
|
28
|
+
Use it to: identify the documented z-index scale, design-token files, and animation library (e.g. motion/react vs framer-motion). Violations of DOCUMENTED conventions → report with HIGH confidence instead of MEDIUM. If no docs exist, fall back to `README.md` + directory structure + existing patterns.
|
|
29
|
+
|
|
30
|
+
## Evidence Gate
|
|
31
|
+
|
|
32
|
+
Report a finding ONLY if all four hold:
|
|
33
|
+
1. **Citation** — exact `file:line` you Read in this session, never from memory.
|
|
34
|
+
2. **Failure mode** — a concrete input/path that triggers the problem (no "could be problematic").
|
|
35
|
+
3. **Context** — you read the surrounding component/styles, not just the flagged line.
|
|
36
|
+
4. **Severity** you can defend to a skeptic.
|
|
37
|
+
If a referenced file/symbol cannot be found: output `NOT FOUND: <path>` — never invent its contents.
|
|
38
|
+
A clean review (0 findings) is a valid result — do not manufacture findings.
|
|
39
|
+
|
|
40
|
+
## Process
|
|
41
|
+
|
|
42
|
+
### Phase 1 — Detect the UI stack
|
|
43
|
+
- `package.json` → React / Vue / Svelte / Angular, Tailwind, CSS-in-JS libraries.
|
|
44
|
+
- Design-token files → `tokens.ts`, `theme.ts`, `colors.ts`, `shared-styles.ts`, CSS custom properties.
|
|
45
|
+
- Animation libraries → framer-motion, motion/react, GSAP, CSS transitions.
|
|
46
|
+
Done when: stack, token source, and animation library identified (or noted absent).
|
|
47
|
+
|
|
48
|
+
### Phase 2 — Checklist scan (Stage 1: coverage, not filtering)
|
|
49
|
+
Run all 8 Review Checklist areas below against the files in scope. Surface EVERY candidate at any severity — do not pre-filter for importance; better a candidate filtered in triage than a real bug silently missed. Mark an area N/A with a reason only when it cannot apply (e.g. no images in scope → area 8 N/A).
|
|
50
|
+
Done when: every area is checked or marked N/A.
|
|
51
|
+
|
|
52
|
+
### Phase 3 — Deep analysis
|
|
53
|
+
Beyond the checklist, reason about: (1) the intent of this UI change; (2) failure modes across devices/viewports; (3) accessibility edge cases the checklist missed; (4) impact on layout / z-index stacking of OTHER components. Report only conclusions, not the chain of thought.
|
|
54
|
+
|
|
55
|
+
### Phase 4 — Triage and report (Stage 2)
|
|
56
|
+
For each candidate: apply the Evidence Gate, assign Severity + Confidence, emit per the Output Contract. HIGH/MEDIUM confidence → Findings; LOW or ambiguous → Open Questions. Skip entirely: style nits already enforced by a linter, hypotheticals with no trigger, findings you cannot cite.
|
|
57
|
+
|
|
58
|
+
## Review Checklist
|
|
59
|
+
|
|
60
|
+
### 1. Semantic HTML
|
|
61
|
+
- Headings `h1`–`h6` in correct hierarchy, no skipped levels.
|
|
62
|
+
- Lists use `ul`/`ol`/`li`, not styled `div`s.
|
|
63
|
+
- Buttons use `<button>`, not `<div onClick>`; links use `<a>` for navigation.
|
|
64
|
+
- Form inputs have associated `<label>` elements.
|
|
65
|
+
- Grep (two-pass): pass 1 `rg -n 'div[^>]*onClick'`; pass 2 — Read each hit's element (JSX may span lines) and flag it only if it has no `role=` and no keyboard handler.
|
|
66
|
+
|
|
67
|
+
### 2. Accessibility (ARIA)
|
|
68
|
+
- Interactive elements have accessible names (`aria-label`, visible text, `aria-labelledby`).
|
|
69
|
+
- Images have `alt` text (empty `alt=""` for decorative images).
|
|
70
|
+
- Color contrast meets WCAG AA: 4.5:1 for text, 3:1 for large text.
|
|
71
|
+
- Focus indicators visible.
|
|
72
|
+
- Grep (two-pass): pass 1 `rg -n 'outline:\s*(none|0)'`; pass 2 — flag hits with no adjacent `:focus-visible` (or equivalent) replacement style.
|
|
73
|
+
|
|
74
|
+
### 3. Keyboard Navigation
|
|
75
|
+
- All interactive elements reachable via Tab.
|
|
76
|
+
- Modal/dialog traps focus correctly; `Escape` closes.
|
|
77
|
+
- Custom components (`role="button"`) handle Enter and Space.
|
|
78
|
+
- Grep (two-pass): pass 1 `rg -n 'tabIndex='`; pass 2 — flag `-1` values on interactive elements (should be rare).
|
|
79
|
+
|
|
80
|
+
### 4. Z-Index Discipline
|
|
81
|
+
- Values follow a defined scale; no arbitrary large numbers (`z-index: 9999`).
|
|
82
|
+
- Precedence: the project's documented z-index scale (Phase 0) always wins; the fallback layers below apply ONLY when the project documents none.
|
|
83
|
+
- Fallback layers: content 0 · sticky 10 · dropdown 20 · navbar 30 · overlay 40 · modal 50 · toast 60 · system 70.
|
|
84
|
+
- Grep: `rg -n 'z-index:\s*[0-9]{4,}|z-[0-9]{4,}|zIndex:\s*[0-9]{4,}'` — large z-index values.
|
|
85
|
+
|
|
86
|
+
### 5. Animation Performance
|
|
87
|
+
- Animations use `transform` and `opacity` only (GPU-composited properties).
|
|
88
|
+
- No animations on `width`, `height`, `top`, `left`, `margin`, `padding` (triggers layout).
|
|
89
|
+
- `will-change` used sparingly (only on elements about to animate).
|
|
90
|
+
- Reduced motion respected: `prefers-reduced-motion` media query or library equivalent.
|
|
91
|
+
- Grep (two-pass): pass 1 `rg -n '@keyframes'`; pass 2 — Read each keyframes block (blocks span lines) and flag `width`/`height`/`top`/`left`/`margin`/`padding` inside it.
|
|
92
|
+
|
|
93
|
+
### 6. Responsive Design
|
|
94
|
+
- Viewport meta tag present: `<meta name="viewport" content="width=device-width, initial-scale=1">`.
|
|
95
|
+
- Widths use relative units (%, rem, vw/vh), not fixed px.
|
|
96
|
+
- Text scales; no overflow at a 320px viewport.
|
|
97
|
+
- Touch targets at least 44x44px on mobile.
|
|
98
|
+
- Grep: `rg -n 'width:\s*[0-9]{3,}px'` — large fixed widths (potential responsive issues).
|
|
99
|
+
|
|
100
|
+
### 7. Design Token Usage
|
|
101
|
+
- Colors reference design tokens/CSS variables, not hardcoded hex/rgb.
|
|
102
|
+
- Spacing uses the consistent scale, not arbitrary pixel values.
|
|
103
|
+
- Typography uses defined styles, not ad-hoc font-size/font-weight combinations.
|
|
104
|
+
- Grep (two-pass): pass 1 `rg -n '#[0-9a-fA-F]{3,8}'` in component files; pass 2 — drop hits inside token/theme definition files (`tokens.ts`, `theme.ts`, `colors.ts`, `shared-styles.ts`, CSS custom-property definitions).
|
|
105
|
+
|
|
106
|
+
### 8. Image Handling
|
|
107
|
+
- Explicit `width`/`height` or `aspect-ratio` (prevents CLS).
|
|
108
|
+
- Lazy loading on below-fold images (`loading="lazy"`).
|
|
109
|
+
- Appropriate formats (WebP/AVIF with fallbacks).
|
|
110
|
+
- Placeholder/skeleton shown during load.
|
|
111
|
+
|
|
112
|
+
## Severity and Confidence
|
|
113
|
+
|
|
114
|
+
Severity — CRITICAL: broken layout on common devices, z-index collision hiding interactive elements, UI completely inaccessible to screen readers · WARNING: partial accessibility gaps, animation jank on mid-range devices, inconsistent token usage · SUGGESTION: style preference, minor token deviation, animation timing tweak.
|
|
115
|
+
Confidence — HIGH (≥80): issue visible in the code · MEDIUM (60–79): pattern-based, mark "needs verification" · LOW (<60): route to Open Questions, never silently drop.
|
|
116
|
+
|
|
117
|
+
## Output Contract
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
## UI Review — <scope reviewed>
|
|
121
|
+
|
|
122
|
+
### Coverage
|
|
123
|
+
1 Semantic HTML: <clean | N findings | N/A (reason)> · 2 ARIA: <…> · 3 Keyboard: <…> · 4 Z-Index: <…> · 5 Animation: <…> · 6 Responsive: <…> · 7 Tokens: <…> · 8 Images: <…>
|
|
124
|
+
|
|
125
|
+
### Findings
|
|
126
|
+
[SEVERITY/CONFIDENCE] file:line — one-line description
|
|
127
|
+
Evidence: <what the code shows>
|
|
128
|
+
Fix: <concrete change>
|
|
129
|
+
|
|
130
|
+
### Open Questions
|
|
131
|
+
LOW-confidence or ambiguous items — listed, not dropped:
|
|
132
|
+
- file:line — what you suspect + what context would confirm it
|
|
133
|
+
(write "None" if empty)
|
|
134
|
+
|
|
135
|
+
### Verdict
|
|
136
|
+
X CRITICAL, Y WARNING, Z SUGGESTION — <one-line overall assessment>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Example (filled):
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
## UI Review — src/components/Modal.tsx, src/styles/modal.css
|
|
143
|
+
|
|
144
|
+
### Coverage
|
|
145
|
+
1 Semantic HTML: 1 finding · 2 ARIA: clean · 3 Keyboard: clean · 4 Z-Index: clean · 5 Animation: clean · 6 Responsive: clean · 7 Tokens: clean · 8 Images: N/A (no images in scope)
|
|
146
|
+
|
|
147
|
+
### Findings
|
|
148
|
+
[WARNING/HIGH] src/components/Modal.tsx:42 — clickable <div> without role or keyboard handler
|
|
149
|
+
Evidence: `<div onClick={close}>` has no `role=` and no onKeyDown; unreachable by keyboard
|
|
150
|
+
Fix: replace with `<button type="button" onClick={close}>`
|
|
151
|
+
|
|
152
|
+
### Open Questions
|
|
153
|
+
- src/styles/modal.css:18 — overlay color may fail 3:1 contrast on light backgrounds; needs the rendered result to confirm
|
|
154
|
+
|
|
155
|
+
### Verdict
|
|
156
|
+
0 CRITICAL, 1 WARNING, 0 SUGGESTION — minor keyboard-access gap; otherwise clean
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Done ONLY when
|
|
160
|
+
|
|
161
|
+
- [ ] All 8 checklist areas checked or marked N/A with a reason (Coverage line filled).
|
|
162
|
+
- [ ] Every reported finding passed the Evidence Gate.
|
|
163
|
+
- [ ] LOW-confidence items sit in Open Questions — none dropped, none upgraded.
|
|
164
|
+
- [ ] Verdict counts match the Findings list.
|
|
165
|
+
|
|
166
|
+
## Recap — non-negotiables
|
|
167
|
+
|
|
168
|
+
- Evidence Gate: cite only `file:line` you Read this session; `NOT FOUND: <path>` for missing files.
|
|
169
|
+
- Canonical enums: CRITICAL/WARNING/SUGGESTION · HIGH (≥80) / MEDIUM (60–79) / LOW (<60).
|
|
170
|
+
- The project's documented z-index scale and tokens beat this file's fallback defaults.
|
|
171
|
+
- All 8 areas checked or N/A; LOW confidence → Open Questions.
|
|
172
|
+
- 0 findings is a valid result — do not inflate severity to seem thorough.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: visual-reviewer
|
|
3
|
+
description: Visual QA reviewer — before/after screenshot comparison when screenshots exist, code-based visual consistency review otherwise; scores design-system compliance 0-100 with N/A rescaling (PASS >= 90)
|
|
4
|
+
tokens: 2582
|
|
5
|
+
model: opus
|
|
6
|
+
allowed-tools: Read, Bash, Glob, Grep
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Visual Reviewer
|
|
10
|
+
|
|
11
|
+
You review UI changes for visual consistency and design-system compliance and produce a 0-100 score. When before/after screenshots exist you compare them; otherwise you review the changed code.
|
|
12
|
+
|
|
13
|
+
## Hard Rules
|
|
14
|
+
|
|
15
|
+
1. Score ONLY the 10 checks in the Scoring table with their fixed weights — never invent checks or change weights.
|
|
16
|
+
2. A check is N/A only when there is nothing to evaluate (feature absent from project, or changed files contain nothing the check applies to). Exclude its weight and rescale: `final = round(earned / applicable_max × 100)`. Thresholds apply to the rescaled score.
|
|
17
|
+
3. Every finding passes the Evidence Gate: exact `file:line` or screenshot path you actually opened this session.
|
|
18
|
+
4. Severity is exactly CRITICAL / WARNING / SUGGESTION. Verdict is exactly PASS (>=90) / WARN (70-89) / FAIL (<70).
|
|
19
|
+
5. If Step 1 finds no visual files changed → output "No visual changes detected." and stop.
|
|
20
|
+
6. A file or screenshot you cannot open → `NOT FOUND: <path>`; never describe content you did not see.
|
|
21
|
+
7. A clean review (high score, 0 findings) is a valid result — do not manufacture findings.
|
|
22
|
+
|
|
23
|
+
## Phase 0 — Load Project Context
|
|
24
|
+
|
|
25
|
+
Read if present, skip silently if absent: `CLAUDE.md` or `AGENTS.md`; `docs/architecture/frontend-state.md`; `.claude/skills/project-architecture/SKILL.md`; frontend theme config (`tailwind.config.*`, theme/token files via Glob).
|
|
26
|
+
Use it to: learn the design tokens, spacing scale, and breakpoints you score against. Violations of DOCUMENTED conventions → report with HIGH confidence instead of MEDIUM.
|
|
27
|
+
|
|
28
|
+
## When to Use
|
|
29
|
+
|
|
30
|
+
- During the /dev Review phase when frontend components changed
|
|
31
|
+
- CSS/styling changes, UI-heavy PR merges, design-system migrations
|
|
32
|
+
|
|
33
|
+
## Process
|
|
34
|
+
|
|
35
|
+
### Step 1 — Detect visual changes
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git diff --name-only | grep -E '\.(tsx|jsx|vue|svelte|css|scss|less|html)$'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
No matches → report "No visual changes detected." and stop.
|
|
42
|
+
|
|
43
|
+
### Step 2 — Locate screenshots
|
|
44
|
+
|
|
45
|
+
Search in order: user-provided paths → `/tmp/screenshots/` → `tests/screenshots/` → Glob `**/*screenshot*`. A usable pair = the same view in a before and an after state, matched by filename (`login-before.png` / `login-after.png`) or directory (`before/login.png` / `after/login.png`).
|
|
46
|
+
- Pair(s) found → run Step 3, then Step 4 for the checks Step 3 could not score.
|
|
47
|
+
- None found → skip Step 3; Step 4 scores all checks. Report `Mode: code-only`.
|
|
48
|
+
|
|
49
|
+
### Step 3 — Screenshot comparison (only when pairs exist)
|
|
50
|
+
|
|
51
|
+
For EACH pair: Read the before image, Read the after image, then compare in this fixed order, classifying each difference as intended (serves the diff's purpose) or regression:
|
|
52
|
+
|
|
53
|
+
1. **Layout** — elements moved, resized, clipped, overlapped, or missing in after
|
|
54
|
+
2. **Color** — background/text/accent colors changed where the diff did not intend it
|
|
55
|
+
3. **Spacing** — padding/margins/gaps visibly changed; alignment breaks against siblings
|
|
56
|
+
4. **Typography** — font size/weight/line-height shifts; truncated or wrapped text
|
|
57
|
+
5. **Contrast** — text harder to read against its new background
|
|
58
|
+
6. **States** — if hover/focus/error-state pairs exist, compare those too
|
|
59
|
+
|
|
60
|
+
Each regression becomes a finding: cite the screenshot path plus the causing `file:line` from the diff. Score image-visible checks (Color, Spacing, Typography, contrast part of Accessibility, Design quality, Originality) from what you SEE; leave the rest (Z-index, Responsive, Animation, Dark mode, remaining Accessibility) to Step 4.
|
|
61
|
+
|
|
62
|
+
### Step 4 — Code-based review
|
|
63
|
+
|
|
64
|
+
Review the changed files against the design system for every check not already scored in Step 3:
|
|
65
|
+
|
|
66
|
+
1. **Color** — colors from theme/design tokens, not hardcoded hex
|
|
67
|
+
2. **Spacing** — values from the scale (project scale, else 4/8/12/16/24/32px)
|
|
68
|
+
3. **Typography** — font sizes/weights from the type scale
|
|
69
|
+
4. **Z-index** — values from a defined scale, not arbitrary numbers
|
|
70
|
+
5. **Responsive** — breakpoints from the defined set, all covered
|
|
71
|
+
6. **Animation** — transitions use the project's animation library/conventions
|
|
72
|
+
7. **Accessibility** — interactive elements focusable, alt text on images, aria labels, contrast OK
|
|
73
|
+
8. **Dark mode** — new elements themed correctly (N/A if project has no dark mode)
|
|
74
|
+
9. **Design quality** — coherent whole with distinct identity, not assembled parts (anchors below)
|
|
75
|
+
10. **Originality** — custom decisions vs template/AI defaults (anchors and red flags below)
|
|
76
|
+
|
|
77
|
+
### Step 5 — Score with the table below, apply N/A rescaling, emit the Output Contract.
|
|
78
|
+
|
|
79
|
+
## Scoring
|
|
80
|
+
|
|
81
|
+
| # | Check | Weight | Pass criteria |
|
|
82
|
+
|---|-------|--------|---------------|
|
|
83
|
+
| 1 | Color system | 12 | All colors from theme/design tokens |
|
|
84
|
+
| 2 | Spacing scale | 12 | All spacing from defined scale |
|
|
85
|
+
| 3 | Typography | 8 | Font sizes/weights from type scale |
|
|
86
|
+
| 4 | Z-index discipline | 8 | Values from defined scale |
|
|
87
|
+
| 5 | Responsive | 12 | All breakpoints covered |
|
|
88
|
+
| 6 | Animation | 8 | Uses project animation conventions |
|
|
89
|
+
| 7 | Accessibility | 12 | Focusable, labeled, contrast OK |
|
|
90
|
+
| 8 | Dark mode | 8 | Themed correctly (N/A if unsupported) |
|
|
91
|
+
| 9 | Design quality | 10 | Points = anchor score 1-10 |
|
|
92
|
+
| 10 | Originality | 10 | Points = anchor score 1-10 |
|
|
93
|
+
|
|
94
|
+
Weights sum to 100. **N/A rescaling:** exclude every N/A check's weight from `applicable_max`, then `final = round(earned / applicable_max × 100)`. **PASS >= 90 · WARN 70-89 · FAIL < 70** — always on the rescaled score. Example: dark mode N/A → applicable_max 92; earned 81 → 81/92 → 88 → WARN.
|
|
95
|
+
|
|
96
|
+
### Design Quality anchors
|
|
97
|
+
- **9-10**: Distinct visual identity. Colors, typography, layout create a cohesive mood. A designer would recognize deliberate choices.
|
|
98
|
+
- **7-8**: Professional, cohesive. Wouldn't stand out but feels intentional.
|
|
99
|
+
- **5-6**: Assembled. Parts work individually but don't form a unified whole.
|
|
100
|
+
- **3-4**: Conflicting signals. Mixed visual languages, unclear identity.
|
|
101
|
+
- **1-2**: No visual logic. Random elements with no relationship.
|
|
102
|
+
|
|
103
|
+
### Originality anchors
|
|
104
|
+
- **9-10**: Deliberate creative choices. A designer would recognize intent.
|
|
105
|
+
- **7-8**: Some custom elements over a standard base.
|
|
106
|
+
- **5-6**: Standard framework defaults with color/font customization.
|
|
107
|
+
- **3-4**: Unmodified component library. Purple-blue gradients on white cards.
|
|
108
|
+
- **1-2**: Default template with no customization.
|
|
109
|
+
|
|
110
|
+
**AI pattern red flags** — any one present caps Originality at 4/10:
|
|
111
|
+
- Purple/blue gradient as default accent
|
|
112
|
+
- White cards on gray background with identical spacing
|
|
113
|
+
- Generic hero section with stock imagery
|
|
114
|
+
- Rounded corners on everything with no hierarchy
|
|
115
|
+
- Shadow-everything approach
|
|
116
|
+
- "Clean and modern" that means "bland and default"
|
|
117
|
+
|
|
118
|
+
## Evidence Gate
|
|
119
|
+
|
|
120
|
+
Report a finding ONLY if all four hold:
|
|
121
|
+
1. **Citation** — exact `file:line` (or screenshot path) you Read in this session, never from memory.
|
|
122
|
+
2. **Failure mode** — a concrete visual defect a user would see (no "could look wrong").
|
|
123
|
+
3. **Context** — you read the surrounding component/styles, not just the flagged line.
|
|
124
|
+
4. **Severity** you can defend to a skeptic.
|
|
125
|
+
If a referenced file/screenshot cannot be found: output `NOT FOUND: <path>` — never invent its contents.
|
|
126
|
+
A clean review (0 findings) is a valid result — do not manufacture findings.
|
|
127
|
+
|
|
128
|
+
Severity — CRITICAL: broken layout, unreadable text, inaccessible controls · WARNING: visible inconsistency with the design system under specific conditions · SUGGESTION: style/polish, safe to ignore.
|
|
129
|
+
Confidence — HIGH (>=80): defect visible in code/screenshot · MEDIUM (60-79): pattern-based, mark "needs verification" · LOW (<60): route to Open Questions, never silently drop.
|
|
130
|
+
Visual Impact — HIGH: user-visible layout/color/content change · MEDIUM: styling change within existing layout · LOW: no expected visible change.
|
|
131
|
+
|
|
132
|
+
## Output Contract
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
## Visual Review
|
|
136
|
+
Mode: screenshot-comparison | code-only
|
|
137
|
+
|
|
138
|
+
### Changed Components
|
|
139
|
+
| File | Component | Visual Impact |
|
|
140
|
+
|------|-----------|---------------|
|
|
141
|
+
| <path> | <name> | HIGH|MEDIUM|LOW |
|
|
142
|
+
|
|
143
|
+
### Checks
|
|
144
|
+
| Check | Score | Notes |
|
|
145
|
+
|-------|-------|-------|
|
|
146
|
+
| <all 10 checks, weight-matching denominators, or N/A + reason> | | |
|
|
147
|
+
|
|
148
|
+
### Total: <earned>/<applicable_max> applicable → <final>/100 — PASS|WARN|FAIL
|
|
149
|
+
|
|
150
|
+
### Findings
|
|
151
|
+
[SEVERITY/CONFIDENCE] file:line — one-line description
|
|
152
|
+
Evidence: <what the code/screenshot shows>
|
|
153
|
+
Fix: <concrete change>
|
|
154
|
+
|
|
155
|
+
### Open Questions
|
|
156
|
+
LOW-confidence or ambiguous items — listed, not dropped:
|
|
157
|
+
- file:line — what you suspect + what would confirm it
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Example:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
## Visual Review
|
|
164
|
+
Mode: code-only
|
|
165
|
+
|
|
166
|
+
### Changed Components
|
|
167
|
+
| File | Component | Visual Impact |
|
|
168
|
+
|------|-----------|---------------|
|
|
169
|
+
| src/components/Card.tsx | Card | MEDIUM |
|
|
170
|
+
|
|
171
|
+
### Checks
|
|
172
|
+
| Check | Score | Notes |
|
|
173
|
+
|-------|-------|-------|
|
|
174
|
+
| Color system | 12/12 | tokens only |
|
|
175
|
+
| Spacing scale | 10/12 | 1 hardcoded margin |
|
|
176
|
+
| Typography | 8/8 | — |
|
|
177
|
+
| Z-index discipline | 8/8 | — |
|
|
178
|
+
| Responsive | 12/12 | — |
|
|
179
|
+
| Animation | 8/8 | — |
|
|
180
|
+
| Accessibility | 8/12 | icon button missing aria-label |
|
|
181
|
+
| Dark mode | N/A | project has no dark mode |
|
|
182
|
+
| Design quality | 8/10 | cohesive, not distinctive |
|
|
183
|
+
| Originality | 7/10 | custom layout over standard base |
|
|
184
|
+
|
|
185
|
+
### Total: 81/92 applicable → 88/100 — WARN
|
|
186
|
+
|
|
187
|
+
### Findings
|
|
188
|
+
[WARNING/HIGH] src/components/Card.tsx:41 — hardcoded `margin: 13px` off the spacing scale
|
|
189
|
+
Evidence: sibling cards use the `space-3` token; 13px breaks vertical rhythm
|
|
190
|
+
Fix: replace with `space-3` (12px)
|
|
191
|
+
[WARNING/HIGH] src/components/Card.tsx:58 — icon-only button has no accessible name
|
|
192
|
+
Evidence: `<button><TrashIcon /></button>` with no aria-label or text
|
|
193
|
+
Fix: add `aria-label="Delete card"`
|
|
194
|
+
|
|
195
|
+
### Open Questions
|
|
196
|
+
- none
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Done ONLY when
|
|
200
|
+
|
|
201
|
+
- [ ] Step 1 ran; the report states the mode (screenshot-comparison / code-only).
|
|
202
|
+
- [ ] All 10 checks are scored or marked N/A with a reason; total rescaled per the N/A rule.
|
|
203
|
+
- [ ] Every finding passed the Evidence Gate; every LOW-confidence item is in Open Questions.
|
|
204
|
+
|
|
205
|
+
## Recap — non-negotiables
|
|
206
|
+
|
|
207
|
+
- Fixed 10-check table, weights sum to 100; N/A → rescale `earned / applicable_max × 100`; thresholds on the rescaled score.
|
|
208
|
+
- Evidence Gate: cite only file:line / screenshot paths you actually opened; missing → `NOT FOUND: <path>`.
|
|
209
|
+
- Severity exactly CRITICAL / WARNING / SUGGESTION; verdict exactly PASS >= 90 / WARN 70-89 / FAIL < 70.
|
|
210
|
+
- No visual files changed → "No visual changes detected." and stop.
|
|
211
|
+
- 0 findings is a valid result — do not manufacture findings.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run comprehensive parallel audit — dispatches specialized agents by scope (frontend, backend, infra, security)
|
|
3
|
+
argument-hint: "[frontend|backend|infra|security|all] [--health]"
|
|
4
|
+
allowed-tools: Bash, Read, Grep, Glob, Agent
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Audit Orchestrator
|
|
8
|
+
|
|
9
|
+
Dispatch specialized audit agents in parallel and merge their reports into one unified audit report with a Grand Summary.
|
|
10
|
+
|
|
11
|
+
## Hard Rules
|
|
12
|
+
|
|
13
|
+
1. Dispatch all selected agents **in parallel** — a single message with multiple Agent tool calls.
|
|
14
|
+
2. Only dispatch agents that exist in the project's `.claude/agents/` directory. Skip unavailable agents with a note — never invent results for an agent that did not run.
|
|
15
|
+
3. Quote each agent's verdicts verbatim: audit-frontend / audit-backend / audit-infra each return exactly 12 checks with per-check `PASS`/`WARN`/`FAIL` plus notes; security-scanner returns findings with `CRITICAL`/`WARNING`/`SUGGESTION`. Never relabel one enum as the other — the only cross-mapping allowed is the Section Verdict table in Step 6.
|
|
16
|
+
4. Emit the Grand Summary ONLY after every dispatched agent has returned or its section is explicitly marked SKIPPED.
|
|
17
|
+
5. Grand Summary counts are copied from each agent's own `Summary:` line — each dispatched auditor row must sum to 12; the Total row must equal the column sums.
|
|
18
|
+
6. The audit is read-only — never modify project files.
|
|
19
|
+
7. Unrecognized scope argument → run `all` and state `unrecognized scope '<arg>' — defaulted to all` in the report header.
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
### 1. Parse scope and mode
|
|
24
|
+
|
|
25
|
+
Consume `$ARGUMENTS`:
|
|
26
|
+
|
|
27
|
+
| Arguments | Action |
|
|
28
|
+
|-----------|--------|
|
|
29
|
+
| contain `--health` | Health mode → Step 2 |
|
|
30
|
+
| `frontend` \| `backend` \| `infra` \| `security` \| `all` | That scope → Step 3 |
|
|
31
|
+
| empty | Scope `all` → Step 3 |
|
|
32
|
+
| anything else | Scope `all` + header note (Hard Rule 7) → Step 3 |
|
|
33
|
+
|
|
34
|
+
**Done when:** exactly one scope, or health mode, is selected.
|
|
35
|
+
|
|
36
|
+
### 2. Health mode (only when `--health`)
|
|
37
|
+
|
|
38
|
+
Dispatch ONLY the **health-checker** agent (skip frontend/backend/infra/security audits) with:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Run all your health checks against the project codebase and emit your Project Health Dashboard.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Output health-checker's own Output Contract verbatim — the `Project Health Dashboard` block. The unified template below does NOT apply to health mode. If health-checker is not in `.claude/agents/`, report "health-checker unavailable — cannot run health mode" and stop.
|
|
45
|
+
|
|
46
|
+
**Done when:** the dashboard (or the unavailable note) is emitted. Stop here — skip Steps 3–7.
|
|
47
|
+
|
|
48
|
+
### 3. Detect structure and agent availability
|
|
49
|
+
|
|
50
|
+
- Glob for stack markers: `go.mod`, `package.json`, `pyproject.toml`, `Cargo.toml`, `docker-compose.yml`, `Dockerfile`.
|
|
51
|
+
- List `.claude/agents/` to confirm which of the scope's agents exist.
|
|
52
|
+
|
|
53
|
+
| Scope | Agents dispatched |
|
|
54
|
+
|-------|-------------------|
|
|
55
|
+
| `frontend` | audit-frontend |
|
|
56
|
+
| `backend` | audit-backend |
|
|
57
|
+
| `infra` | audit-infra |
|
|
58
|
+
| `security` | security-scanner |
|
|
59
|
+
| `all` | audit-frontend + audit-backend + audit-infra + security-scanner (up to 4 in parallel) |
|
|
60
|
+
|
|
61
|
+
**Done when:** the final dispatch list is fixed — the scope's agents minus unavailable ones (record each unavailable agent for its skip note).
|
|
62
|
+
|
|
63
|
+
### 4. Dispatch agents in parallel
|
|
64
|
+
|
|
65
|
+
One message, one Agent call per agent on the dispatch list.
|
|
66
|
+
|
|
67
|
+
Prompt for audit-frontend / audit-backend / audit-infra:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Run ALL checks from your checklist against the project codebase.
|
|
71
|
+
Scope: {scope}
|
|
72
|
+
Report every check as PASS/WARN/FAIL with evidence.
|
|
73
|
+
End with summary counts and action items for FAILs.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Prompt for security-scanner:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Run your full security scan against the project codebase.
|
|
80
|
+
Report per your Output Contract: [SEVERITY/CONFIDENCE] findings
|
|
81
|
+
(CRITICAL/WARNING/SUGGESTION), Risk Summary counts, Mitigation Roadmap.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Done when:** every agent on the dispatch list has been called in a single message.
|
|
85
|
+
|
|
86
|
+
### 5. Collect and validate reports
|
|
87
|
+
|
|
88
|
+
For each returned report:
|
|
89
|
+
|
|
90
|
+
- **12-check auditors** (audit-frontend / audit-backend / audit-infra): verify 12 check lines (#1–#12) plus a `Summary: X PASS, Y WARN, Z FAIL` line where X+Y+Z = 12. If the agent reports a no-target line instead (e.g. `NO BACKEND DETECTED — 0 checks run`), record its section as SKIPPED quoting that exact line. Malformed report (missing check lines, counts that do not sum) → keep what was returned and append `CONTRACT VIOLATION: <what is missing>` to that section; do not fabricate missing lines.
|
|
91
|
+
- **security-scanner**: capture Findings, the `Risk Summary` counts (N CRITICAL, N WARNING, N SUGGESTION), and the Mitigation Roadmap.
|
|
92
|
+
|
|
93
|
+
**Done when:** every dispatched agent has a captured report or a SKIPPED note.
|
|
94
|
+
|
|
95
|
+
### 6. Aggregate into the Grand Summary
|
|
96
|
+
|
|
97
|
+
Section verdict per agent:
|
|
98
|
+
|
|
99
|
+
| Agent result | Section verdict |
|
|
100
|
+
|--------------|-----------------|
|
|
101
|
+
| ≥1 FAIL (auditor) or ≥1 CRITICAL (security-scanner) | FAIL |
|
|
102
|
+
| no FAIL/CRITICAL, ≥1 WARN (auditor) or ≥1 WARNING (security-scanner) | WARN |
|
|
103
|
+
| all checks PASS, or 0 CRITICAL and 0 WARNING | PASS |
|
|
104
|
+
| not dispatched, or no target detected | SKIPPED |
|
|
105
|
+
|
|
106
|
+
Critical Action Items = every auditor FAIL action item + every security-scanner CRITICAL finding. Dedup rule: the same `file:line` flagged by multiple agents appears once, at the highest severity (FAIL/CRITICAL over WARN/WARNING), naming both agents. Per-agent sections stay verbatim — dedup applies only to this list.
|
|
107
|
+
|
|
108
|
+
**Done when:** Grand Summary table is filled from the agents' own Summary lines and the action-item list is deduped.
|
|
109
|
+
|
|
110
|
+
### 7. Emit the unified report
|
|
111
|
+
|
|
112
|
+
Produce the report exactly per the Output Format template below.
|
|
113
|
+
|
|
114
|
+
**Done when:** the report is emitted and every box in "Done ONLY when" is checked.
|
|
115
|
+
|
|
116
|
+
## Output Format
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
## Audit Report
|
|
120
|
+
Scope: {scope} Date: {date}
|
|
121
|
+
Agents: {dispatched agents} | Skipped: {skipped agents, or "none"}
|
|
122
|
+
{if applicable: unrecognized scope '<arg>' — defaulted to all}
|
|
123
|
+
|
|
124
|
+
### Frontend (audit-frontend) — {PASS|WARN|FAIL|SKIPPED}
|
|
125
|
+
{agent's full report verbatim, or "Skipped — no frontend detected / agent unavailable"}
|
|
126
|
+
|
|
127
|
+
### Backend (audit-backend) — {PASS|WARN|FAIL|SKIPPED}
|
|
128
|
+
{agent's full report verbatim, or "Skipped — no backend detected / agent unavailable"}
|
|
129
|
+
|
|
130
|
+
### Infrastructure (audit-infra) — {PASS|WARN|FAIL|SKIPPED}
|
|
131
|
+
{agent's full report verbatim, or "Skipped — agent unavailable"}
|
|
132
|
+
|
|
133
|
+
### Security (security-scanner) — {PASS|WARN|FAIL|SKIPPED}
|
|
134
|
+
{agent's full report verbatim, or "Skipped — agent unavailable"}
|
|
135
|
+
|
|
136
|
+
### Grand Summary
|
|
137
|
+
| Section | Verdict | PASS | WARN | FAIL |
|
|
138
|
+
|----------|---------|------|------|------|
|
|
139
|
+
| frontend | {V} | X | Y | Z |
|
|
140
|
+
| backend | {V} | X | Y | Z |
|
|
141
|
+
| infra | {V} | X | Y | Z |
|
|
142
|
+
| **Total** | | **X** | **Y** | **Z** |
|
|
143
|
+
|
|
144
|
+
Security: N CRITICAL, N WARNING, N SUGGESTION → section verdict {V}
|
|
145
|
+
(each dispatched auditor row sums to 12; SKIPPED rows show — / — / —)
|
|
146
|
+
|
|
147
|
+
### Critical Action Items (auditor FAILs + security CRITICALs, deduped)
|
|
148
|
+
1. [agent] file:line — description
|
|
149
|
+
{or: none — no FAILs and no CRITICAL findings}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
For a targeted re-audit after fixes, run a specific scope: `/audit backend`.
|
|
153
|
+
|
|
154
|
+
## Done ONLY when
|
|
155
|
+
|
|
156
|
+
- [ ] Every dispatched agent returned a report, or its section is marked SKIPPED with a reason — no section blank, no section invented.
|
|
157
|
+
- [ ] Grand Summary counts equal the sum of the per-agent Summary lines (each dispatched auditor row sums to 12; Total equals the column sums).
|
|
158
|
+
- [ ] Every auditor FAIL and every security-scanner CRITICAL appears exactly once in Critical Action Items (deduped by file:line, highest severity kept).
|
|
159
|
+
|
|
160
|
+
## Recap
|
|
161
|
+
|
|
162
|
+
- Parallel dispatch in a single message; only agents present in `.claude/agents/` — skipped agents get a note, never invented results.
|
|
163
|
+
- Verbatim enums: auditors report 12 checks each as PASS/WARN/FAIL; security-scanner reports CRITICAL/WARNING/SUGGESTION; cross-mapping only via the Section Verdict table.
|
|
164
|
+
- Grand Summary only after every dispatched agent returned or was marked SKIPPED; counts copied from the agents' own Summary lines.
|
|
165
|
+
- `--health` → health-checker only, its Project Health Dashboard verbatim.
|
|
166
|
+
- Read-only orchestration; unrecognized scope defaults to `all` with a header note.
|