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,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: r3f-scroll-driven-3d
|
|
3
|
+
description: Connect GSAP ScrollTrigger to React Three Fiber — Zustand bridge, useFrame animation, scroll progress to 3D transforms. The pattern for scroll-driven 3D product showcases.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Scroll-Driven 3D with GSAP + R3F
|
|
8
|
+
|
|
9
|
+
Architecture pattern for connecting GSAP ScrollTrigger to React Three Fiber scenes via Zustand store.
|
|
10
|
+
|
|
11
|
+
## Why This Pattern?
|
|
12
|
+
|
|
13
|
+
**Problem:** GSAP runs in the DOM. R3F runs in WebGL. They can't communicate directly.
|
|
14
|
+
|
|
15
|
+
**Solution:** Zustand store as a bridge — GSAP writes scroll progress, R3F reads it in useFrame.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
[GSAP ScrollTrigger] → writes → [Zustand Store] → reads → [R3F useFrame]
|
|
19
|
+
(DOM) (shared state) (WebGL)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Why Zustand (Not React State/Context)?
|
|
23
|
+
|
|
24
|
+
- React state/context triggers re-renders on every scroll tick (60fps = 60 re-renders/sec)
|
|
25
|
+
- Zustand `getState()` reads directly without subscribing — zero re-renders
|
|
26
|
+
- useFrame already runs at 60fps — just read the latest value
|
|
27
|
+
|
|
28
|
+
## Implementation
|
|
29
|
+
|
|
30
|
+
### Step 1: Create the store
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
// stores/useScrollStore.ts
|
|
34
|
+
import { create } from 'zustand';
|
|
35
|
+
|
|
36
|
+
interface ScrollStore {
|
|
37
|
+
progress: number; // 0-1 scroll progress
|
|
38
|
+
currentTexture: string; // active screen texture path
|
|
39
|
+
setProgress: (p: number) => void;
|
|
40
|
+
setTexture: (t: string) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const useScrollStore = create<ScrollStore>((set) => ({
|
|
44
|
+
progress: 0,
|
|
45
|
+
currentTexture: '/textures/screen-1.png',
|
|
46
|
+
setProgress: (p) => set({ progress: p }),
|
|
47
|
+
setTexture: (t) => set({ currentTexture: t }),
|
|
48
|
+
}));
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 2: GSAP writes to store
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
// components/ScrollSection.tsx
|
|
55
|
+
import { useRef, useEffect } from 'react';
|
|
56
|
+
import gsap from 'gsap';
|
|
57
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger';
|
|
58
|
+
import { useScrollStore } from '@/stores/useScrollStore';
|
|
59
|
+
|
|
60
|
+
gsap.registerPlugin(ScrollTrigger);
|
|
61
|
+
|
|
62
|
+
export function ScrollSection() {
|
|
63
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
64
|
+
const { setProgress, setTexture } = useScrollStore();
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const ctx = gsap.context(() => {
|
|
68
|
+
const tl = gsap.timeline({
|
|
69
|
+
scrollTrigger: {
|
|
70
|
+
trigger: ref.current,
|
|
71
|
+
start: 'top top',
|
|
72
|
+
end: 'bottom bottom',
|
|
73
|
+
scrub: 1, // number, NOT true
|
|
74
|
+
invalidateOnRefresh: true, // MUST have
|
|
75
|
+
pin: true,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Animate progress 0 → 1
|
|
80
|
+
tl.to({}, {
|
|
81
|
+
duration: 1,
|
|
82
|
+
onUpdate: function() {
|
|
83
|
+
setProgress(this.progress());
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Swap texture at 50% scroll
|
|
88
|
+
tl.call(() => setTexture('/textures/screen-2.png'), [], 0.5);
|
|
89
|
+
|
|
90
|
+
// CRITICAL: extend timeline to full duration
|
|
91
|
+
tl.set({}, {}, 1.0);
|
|
92
|
+
|
|
93
|
+
}, ref);
|
|
94
|
+
|
|
95
|
+
return () => ctx.revert();
|
|
96
|
+
}, []);
|
|
97
|
+
|
|
98
|
+
return <div ref={ref} style={{ height: '300vh' }} />;
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Step 3: R3F reads in useFrame
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
// components/3d/PhoneModel.tsx
|
|
106
|
+
import { useFrame } from '@react-three/fiber';
|
|
107
|
+
import { useScrollStore } from '@/stores/useScrollStore';
|
|
108
|
+
import { useRef } from 'react';
|
|
109
|
+
import * as THREE from 'three';
|
|
110
|
+
|
|
111
|
+
export function PhoneModel() {
|
|
112
|
+
const groupRef = useRef<THREE.Group>(null);
|
|
113
|
+
|
|
114
|
+
useFrame(() => {
|
|
115
|
+
if (!groupRef.current) return;
|
|
116
|
+
|
|
117
|
+
// CRITICAL: getState() not hook — no re-renders
|
|
118
|
+
const { progress } = useScrollStore.getState();
|
|
119
|
+
|
|
120
|
+
// Rotate based on scroll
|
|
121
|
+
groupRef.current.rotation.y = progress * Math.PI * 2;
|
|
122
|
+
|
|
123
|
+
// Phase-based animation
|
|
124
|
+
if (progress < 0.3) {
|
|
125
|
+
// Entry: scale up
|
|
126
|
+
const t = progress / 0.3;
|
|
127
|
+
groupRef.current.scale.setScalar(0.5 + t * 0.5);
|
|
128
|
+
} else if (progress < 0.7) {
|
|
129
|
+
// Showcase: full size, rotate
|
|
130
|
+
groupRef.current.scale.setScalar(1);
|
|
131
|
+
} else {
|
|
132
|
+
// Exit: scale down
|
|
133
|
+
const t = (progress - 0.7) / 0.3;
|
|
134
|
+
groupRef.current.scale.setScalar(1 - t * 0.3);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<group ref={groupRef}>
|
|
140
|
+
{/* Your 3D model here */}
|
|
141
|
+
</group>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Performance Tips
|
|
147
|
+
|
|
148
|
+
- **Pre-allocate:** No `new THREE.Vector3()` inside useFrame — use refs
|
|
149
|
+
- **getState():** Always in useFrame, never hook subscription
|
|
150
|
+
- **DPR:** `dpr={[1, 2]}` — higher wastes mobile GPU
|
|
151
|
+
- **Dispose:** `dispose={null}` on reusable groups
|
|
152
|
+
|
|
153
|
+
## Dynamic Texture Swapping
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
useFrame(() => {
|
|
157
|
+
const { currentTexture } = useScrollStore.getState();
|
|
158
|
+
// Load and apply texture based on store value
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Use `tl.call(() => setTexture('/new.png'), [], timePosition)` in GSAP timeline to trigger swaps at specific scroll positions.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reality-checker
|
|
3
|
+
description: Assess completion or readiness claims against agreed scope and traceable evidence. Distinguish demonstrated defects, missing verification, and external blockers; return READY, NEEDS WORK, or BLOCKED.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
tokens: 1165
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Reality Checker
|
|
9
|
+
|
|
10
|
+
Determine which completion claims are supported and what remains mandatory. Use for requested readiness assessment, a required delivery/release gate, or when a claimed outcome exceeds its evidence. Do not impose production deployment requirements on a local prototype or routine edit.
|
|
11
|
+
|
|
12
|
+
## Input, context, and authority
|
|
13
|
+
|
|
14
|
+
Require the claimed outcome, agreed task/spec, intended environment, and supporting artifacts. Read applicable project requirements and only implementation/architecture needed to interpret those claims. If the meaning of "ready" is unspecified, identify the decision needed instead of inventing a production bar.
|
|
15
|
+
|
|
16
|
+
Assess only: do not edit implementation or criteria, deploy, modify external state, or expand the task. Authorized local checks may create disposable output. Follow explicit model/effort routing; Sol may collect and review bounded evidence, while Astra accepts consequential release, security, authority, data-loss, and irreversible decisions. Record missing acceptance as a gate, not implied approval. When no authorized independent worker is available, work inline and disclose self-review.
|
|
17
|
+
|
|
18
|
+
## Evidence assessment
|
|
19
|
+
|
|
20
|
+
Evaluate each material claim as VERIFIED, FAILED, UNVERIFIED, or N/A with rationale tied to agreed scope. FAILED means observed contradiction. UNVERIFIED means insufficient evidence, an unexecuted check, or unavailable capability; it is not a measured defect or zero score. Do not remove mandatory criteria as N/A without a valid scope basis.
|
|
21
|
+
|
|
22
|
+
Select evidence for the claim:
|
|
23
|
+
|
|
24
|
+
- Behavioral claims need relevant implementation and execution evidence. Name whether it comes from fixtures, local integration, staging, or production; one does not prove the others.
|
|
25
|
+
- Test claims need command, target/environment, result, and relevant coverage of behavior. Coverage percentages or new-test counts are not universally required and do not prove correctness.
|
|
26
|
+
- Live API claims need traceable endpoint/environment, authorized request, and observed response. Redact credentials, cookies, tokens, and private data; never require full authenticated traffic in a report.
|
|
27
|
+
- UI/design claims may need rendered capture at the relevant viewport/state. Screenshots are not a universal backend acceptance requirement.
|
|
28
|
+
- Migration, performance, recovery, and security claims need checks appropriate to specific risks and promised guarantees. State their limits; do not promise exhaustive absence of regressions.
|
|
29
|
+
|
|
30
|
+
Reuse evidence only if command/results or captured artifacts are bound to unchanged relevant code, inputs, and environment. Rerun for relevant changes or concrete uncertainty. A report, hedge word, TODO, or confidence score alone neither proves nor disproves completion. No default completion percentage and no findings quota applies.
|
|
31
|
+
|
|
32
|
+
## Verdict
|
|
33
|
+
|
|
34
|
+
- **READY:** all mandatory claims for this delivery scope are verified and required acceptance is present. Explicit non-blocking limitations may remain.
|
|
35
|
+
- **NEEDS WORK:** demonstrated defects or missing verification remain, with an actionable path within current authority/capability.
|
|
36
|
+
- **BLOCKED:** a mandatory decision, authorization, external dependency, or unavailable capability prevents closure. State what resolves it and any useful bounded work still possible.
|
|
37
|
+
|
|
38
|
+
A single consequential gap can block readiness; irrelevant observations cannot. READY never authorizes publication, deployment, or release by itself.
|
|
39
|
+
|
|
40
|
+
## Output and stop
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
READINESS — verdict: NEEDS WORK | READY | BLOCKED
|
|
44
|
+
Confidence: HIGH | MEDIUM | LOW — <basis>
|
|
45
|
+
Evidence status: COMPLETE | PARTIAL | UNAVAILABLE
|
|
46
|
+
Execution: INDEPENDENT | INLINE SELF-REVIEW
|
|
47
|
+
Requested model/effort: <task route or labeled configured default; UNSPECIFIED if absent>
|
|
48
|
+
Observed model/effort: <runtime evidence reference and values, or UNVERIFIED>
|
|
49
|
+
Subject / evaluated against: <claim, spec, scope, environment>
|
|
50
|
+
Evidence provided: <each claim, VERIFIED/FAILED/UNVERIFIED/N/A, evidence and limits>
|
|
51
|
+
Critical gaps: <observed failures separate from unavailable evidence; or none>
|
|
52
|
+
Non-blocking concerns: <scope-relevant limitations; or none>
|
|
53
|
+
Verdict justification: <what is established and what remains mandatory>
|
|
54
|
+
Path to ready: <bounded correction/check/decision and owner, or none>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Stop once each material claim has a supported status, or a specific missing contract/dependency prevents assessment. Report the blocker instead of retrying unavailable checks indefinitely.
|
|
58
|
+
|
|
59
|
+
Adapted from VKirill/codex-starter-kit (MIT).
|
|
60
|
+
|
|
61
|
+
Keep requested/configured routing separate from runtime evidence. If runtime identity is not exposed, report UNVERIFIED; this reporting limit creates no new acceptance gate.
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: redis-patterns
|
|
3
|
+
description: Redis patterns — caching (cache-aside, write-through), sessions, pub/sub, work queues, distributed locks, data structures (sorted sets, streams, hashes). Covers ioredis, node-redis, Redis 7+. Use when designing Redis usage in Node.js or Python apps
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Redis Patterns
|
|
8
|
+
|
|
9
|
+
Production patterns for Redis as a cache, session store, pub/sub bus, work queue backbone, and distributed coordination primitive.
|
|
10
|
+
|
|
11
|
+
## Use this skill when
|
|
12
|
+
|
|
13
|
+
- Implementing caching (cache-aside, write-through, write-back)
|
|
14
|
+
- Setting up pub/sub or BLPOP-based work queues
|
|
15
|
+
- Using Redis data structures (Sorted Sets, Streams, Hash, Sets)
|
|
16
|
+
- Configuring ioredis for Node.js production
|
|
17
|
+
- Designing key naming and TTL strategies
|
|
18
|
+
- Implementing distributed locks with atomic `SET NX EX`
|
|
19
|
+
|
|
20
|
+
## Do not use this skill when
|
|
21
|
+
|
|
22
|
+
- The task requires a message broker with guaranteed delivery — use BullMQ, RabbitMQ, or Kafka
|
|
23
|
+
- The task is about Redis server-level configuration / cluster setup
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
1. Identify the use case: caching, pub/sub, queue, session, or rate limiting
|
|
28
|
+
2. Choose the right data structure for the access pattern
|
|
29
|
+
3. Design keys with `namespace:entity:id` convention
|
|
30
|
+
4. Set TTL on every key (unless intentionally persistent: queues, locks-with-expiry)
|
|
31
|
+
5. Validate error handling and graceful shutdown
|
|
32
|
+
|
|
33
|
+
## Connection (ioredis — recommended for Node.js)
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import Redis from 'ioredis';
|
|
37
|
+
|
|
38
|
+
export const redis = new Redis({
|
|
39
|
+
host: process.env.REDIS_HOST,
|
|
40
|
+
port: 6379,
|
|
41
|
+
lazyConnect: true,
|
|
42
|
+
connectionName: 'api-server',
|
|
43
|
+
retryStrategy(times) {
|
|
44
|
+
return Math.min(times * 200, 2000);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
redis.on('error', (err) => logger.error({ err }, 'redis'));
|
|
49
|
+
redis.on('ready', () => logger.info('redis ready'));
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- Singleton client; `lazyConnect` defers connection until first command
|
|
53
|
+
- `retryStrategy` for exponential backoff
|
|
54
|
+
- Separate dedicated **subscriber** connection for pub/sub (can't mix with commands)
|
|
55
|
+
- **BullMQ**: `maxRetriesPerRequest: null` is mandatory
|
|
56
|
+
|
|
57
|
+
## Cache-Aside Pattern
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
async function getUser(id: string): Promise<User> {
|
|
61
|
+
const key = `cache:user:${id}`;
|
|
62
|
+
const cached = await redis.get(key);
|
|
63
|
+
if (cached) return JSON.parse(cached);
|
|
64
|
+
|
|
65
|
+
const user = await db.users.findUnique({ where: { id } });
|
|
66
|
+
if (user) await redis.set(key, JSON.stringify(user), 'EX', 300);
|
|
67
|
+
return user;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function invalidateUser(id: string) {
|
|
71
|
+
await redis.del(`cache:user:${id}`);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
TTL strategy:
|
|
76
|
+
- Volatile data (counters, hot lists): seconds
|
|
77
|
+
- Stable data (config, user profiles): minutes to hours
|
|
78
|
+
- Rarely-changing reference data: hours to days
|
|
79
|
+
|
|
80
|
+
Bulk invalidation: `SCAN` + `DEL` (NEVER `KEYS *` in production).
|
|
81
|
+
|
|
82
|
+
## Pub/Sub
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
// Publisher (regular connection)
|
|
86
|
+
await redis.publish('orders:new', JSON.stringify({ orderId: 123 }));
|
|
87
|
+
|
|
88
|
+
// Subscriber (DEDICATED connection — can't issue other commands)
|
|
89
|
+
const sub = new Redis({ ...config });
|
|
90
|
+
await sub.subscribe('orders:new');
|
|
91
|
+
sub.on('message', (channel, message) => {
|
|
92
|
+
const data = JSON.parse(message);
|
|
93
|
+
handleOrder(data);
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Pub/sub is fire-and-forget — messages dropped if no subscriber. For durable messaging use **Streams**.
|
|
98
|
+
|
|
99
|
+
## BLPOP Wake Queue
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// Producer
|
|
103
|
+
await redis.lpush('queue:emails', JSON.stringify(payload));
|
|
104
|
+
|
|
105
|
+
// Consumer (blocks until item arrives)
|
|
106
|
+
while (true) {
|
|
107
|
+
const [, raw] = await redis.brpop('queue:emails', 0);
|
|
108
|
+
await processEmail(JSON.parse(raw));
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Instant wake-up without polling. For complex queue needs use **BullMQ** built on this primitive.
|
|
113
|
+
|
|
114
|
+
## Data Structures
|
|
115
|
+
|
|
116
|
+
| Structure | Use case |
|
|
117
|
+
|-----------|----------|
|
|
118
|
+
| **Sorted Set** | Leaderboards, sliding-window rate limit, scheduled jobs by score |
|
|
119
|
+
| **Stream** (`XADD`/`XREAD`) | Event sourcing, consumer groups, persistent log |
|
|
120
|
+
| **Hash** (`HSET`/`HGETALL`) | Object storage with partial updates (user sessions) |
|
|
121
|
+
| **Set** | Unique tag membership, set operations (union, intersect, diff) |
|
|
122
|
+
| **List** | FIFO/LIFO queues; recent activity via `LPUSH` + `LTRIM` |
|
|
123
|
+
|
|
124
|
+
## Batch Operations
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
// Pipeline — multiple commands, one round-trip (no atomicity)
|
|
128
|
+
const results = await redis
|
|
129
|
+
.pipeline()
|
|
130
|
+
.get('a')
|
|
131
|
+
.get('b')
|
|
132
|
+
.incr('counter')
|
|
133
|
+
.exec();
|
|
134
|
+
|
|
135
|
+
// Multi/Exec — atomic transaction (all-or-nothing)
|
|
136
|
+
const results = await redis
|
|
137
|
+
.multi()
|
|
138
|
+
.decrby('inventory:x', 1)
|
|
139
|
+
.lpush('orders', orderId)
|
|
140
|
+
.exec();
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Pipeline for **performance**, multi/exec for **atomicity**.
|
|
144
|
+
|
|
145
|
+
## Distributed Locks
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
async function acquireLock(key: string, ttlMs: number, token: string): Promise<boolean> {
|
|
149
|
+
const r = await redis.set(key, token, 'PX', ttlMs, 'NX');
|
|
150
|
+
return r === 'OK';
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const releaseScript = `
|
|
154
|
+
if redis.call('get', KEYS[1]) == ARGV[1] then
|
|
155
|
+
return redis.call('del', KEYS[1])
|
|
156
|
+
else
|
|
157
|
+
return 0
|
|
158
|
+
end
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
async function releaseLock(key: string, token: string) {
|
|
162
|
+
await redis.eval(releaseScript, 1, key, token);
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Lua script for release prevents one process releasing another's lock. Always set expiry to prevent deadlock on crash.
|
|
167
|
+
|
|
168
|
+
For production-grade locking with renewal use **Redlock** algorithm or a hosted lock service.
|
|
169
|
+
|
|
170
|
+
## Lua Scripts
|
|
171
|
+
|
|
172
|
+
`redis.defineCommand()` caches EVALSHA automatically:
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
redis.defineCommand('rateLimit', {
|
|
176
|
+
numberOfKeys: 1,
|
|
177
|
+
lua: `
|
|
178
|
+
local current = redis.call('incr', KEYS[1])
|
|
179
|
+
if current == 1 then redis.call('expire', KEYS[1], ARGV[1]) end
|
|
180
|
+
return current
|
|
181
|
+
`,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const count = await redis.rateLimit(`rate:${userId}`, 60);
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Use for atomic read-modify-write that can't be expressed with `MULTI`/`EXEC`.
|
|
188
|
+
|
|
189
|
+
## Key Naming Convention
|
|
190
|
+
|
|
191
|
+
Pattern: `scope:entity:id`
|
|
192
|
+
|
|
193
|
+
- `session:user:123`
|
|
194
|
+
- `cache:products:featured`
|
|
195
|
+
- `lock:payment:456`
|
|
196
|
+
- `rate:api:user:789`
|
|
197
|
+
- `queue:emails:high`
|
|
198
|
+
- `stream:events:user-activity`
|
|
199
|
+
|
|
200
|
+
Consistent colon separator enables prefix-based scanning and invalidation.
|
|
201
|
+
|
|
202
|
+
## TTL Strategy Guide
|
|
203
|
+
|
|
204
|
+
| Use case | Suggested TTL |
|
|
205
|
+
|----------|---------------|
|
|
206
|
+
| User session | 24h – 7 days |
|
|
207
|
+
| API response cache | 1 min – 1 hour |
|
|
208
|
+
| Rate limit window | = window size (60s for per-minute) |
|
|
209
|
+
| Distributed lock | Slightly longer than expected op duration |
|
|
210
|
+
| BLPOP queue keys | No TTL (persistent until consumed) |
|
|
211
|
+
|
|
212
|
+
## Eviction Policies
|
|
213
|
+
|
|
214
|
+
| Policy | Behavior | Use case |
|
|
215
|
+
|--------|----------|----------|
|
|
216
|
+
| `allkeys-lru` | Evict LRU from all keys | Pure caching |
|
|
217
|
+
| `volatile-lru` | Evict LRU from keys with TTL | Protect persistent queues |
|
|
218
|
+
| `allkeys-lfu` | Evict LFU | Repeated-access patterns |
|
|
219
|
+
| `noeviction` | Error on write when full | Required for BullMQ |
|
|
220
|
+
|
|
221
|
+
## Graceful Shutdown
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
process.on('SIGTERM', async () => {
|
|
225
|
+
await redis.quit(); // waits for pending commands
|
|
226
|
+
process.exit(0);
|
|
227
|
+
});
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Use `quit()`, NOT `disconnect()` (latter drops in-flight commands).
|
|
231
|
+
|
|
232
|
+
## Behavioral Traits
|
|
233
|
+
|
|
234
|
+
- Sets TTL on every SET unless the key is intentionally persistent (queue, lock)
|
|
235
|
+
- Uses SCAN, never `KEYS *` in production
|
|
236
|
+
- Keeps subscriber connections separate from command connections
|
|
237
|
+
- Attaches error event handler before connecting
|
|
238
|
+
- Pipeline for batching, multi/exec for atomicity
|
|
239
|
+
- BullMQ clients have `maxRetriesPerRequest: null`
|
|
240
|
+
- Lua scripts for atomic read-modify-write
|
|
241
|
+
|
|
242
|
+
## Common Mistakes
|
|
243
|
+
|
|
244
|
+
- `KEYS *` in production — blocks Redis on large keyspaces
|
|
245
|
+
- Missing error handler — unhandled events crash the Node.js process
|
|
246
|
+
- Mixing subscribe + command mode on one connection
|
|
247
|
+
- No TTL on cache keys — unbounded memory growth
|
|
248
|
+
- `disconnect()` in shutdown — drops in-flight commands; use `quit()`
|
|
249
|
+
- Omitting `maxRetriesPerRequest: null` for BullMQ — connection failures under load
|
|
250
|
+
|
|
251
|
+
## Constraints
|
|
252
|
+
|
|
253
|
+
- **ALWAYS** set TTL on every SET unless intentionally persistent
|
|
254
|
+
- **NEVER** use `KEYS *` in production code — use SCAN
|
|
255
|
+
- **DEDICATED** connection for subscriber — never mix with commands
|
|
256
|
+
- **BullMQ** clients MUST have `maxRetriesPerRequest: null`
|
|
257
|
+
- **ERROR HANDLER** attached to every Redis client
|
|
258
|
+
- **GRACEFUL SHUTDOWN** uses `quit()`, not `disconnect()`
|
|
259
|
+
|
|
260
|
+
Adapted from VKirill/codex-starter-kit (community skill).
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-orchestrator
|
|
3
|
+
description: Coordinate requested code review or required review gates by identifying changed scope, selecting available reviewers, and consolidating evidence and findings.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
tokens: 2068
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Unified Orchestrated Code Review
|
|
9
|
+
|
|
10
|
+
Detect changed scope, gather relevant context, use available and authorized reviewers, and collect/deduplicate findings. Review is read-only: do not fix files, post comments, merge, or perform external writes without a separate authorized action. Follow project model/effort routing; Astra accepts high-risk decisions, while Sol may gather evidence or review bounded scope.
|
|
11
|
+
|
|
12
|
+
## Target
|
|
13
|
+
|
|
14
|
+
Parse the user's request to determine scope and parameters. Accepted formats:
|
|
15
|
+
- `PR#NNN` or a number — review a pull request
|
|
16
|
+
- A branch name — diff against that branch
|
|
17
|
+
- `--full` — review all tracked files
|
|
18
|
+
- Empty — default to the last committed change (`HEAD~1..HEAD`)
|
|
19
|
+
|
|
20
|
+
Read applicable `AGENTS.md` instructions. Resolve role files from the current skill catalog or the project's `.agents/skills/<name>/SKILL.md` / `.codex/skills/<name>/SKILL.md` and read the selected file directly. These paths may alias the same installation. Pass the resolved role path to workers; skill names are not automatically registered agent types. Discover runtime tools instead of assuming a global skill loader, a Claude plugin, or a particular delegation API. Do not recursively invoke this orchestrator to load a role.
|
|
21
|
+
|
|
22
|
+
## Step 1 — Detect Changed Files and Gather Context
|
|
23
|
+
|
|
24
|
+
Bind the file list, statistics, contents, and line references to one review target. Validate user-supplied refs/PR identifiers as data and pass them as quoted arguments, never as executable shell text.
|
|
25
|
+
- PR: use an available read-only provider tool or installed `gh` to obtain repository identity, base/head SHAs, changed files and the PR diff. Read supporting files at that head; local `HEAD` is not a substitute. If the head changes during review, refresh affected evidence or report the reviewed SHA as stale.
|
|
26
|
+
- Branch/ref: resolve it to a commit and review the merge-base-to-`HEAD` diff; use that same range for names, statistics and hunks.
|
|
27
|
+
- `--full`: review tracked files at a declared snapshot. State whether current working changes are included.
|
|
28
|
+
- Empty: review the last committed change, `HEAD~1..HEAD`, consistently for names, statistics and hunks; exclude unstaged/staged changes unless requested. If no parent exists, review the initial commit against the empty tree or ask for the intended target.
|
|
29
|
+
|
|
30
|
+
Collect relevant commit messages from that target as intent evidence. For a requested working-tree review, identify staged, unstaged and selected untracked scope separately. Missing access or unavailable diff content means incomplete coverage, not a fallback to unrelated local changes.
|
|
31
|
+
|
|
32
|
+
Build a `REVIEW_CONTEXT` block:
|
|
33
|
+
```
|
|
34
|
+
=== REVIEW CONTEXT ===
|
|
35
|
+
## Changed Files (N files, +X/-Y lines)
|
|
36
|
+
<statistics and base/head or working-snapshot identity for the selected target>
|
|
37
|
+
|
|
38
|
+
## Recent Commits (intent)
|
|
39
|
+
<relevant commit messages from the selected review target>
|
|
40
|
+
|
|
41
|
+
## Diff Hunks
|
|
42
|
+
<relevant complete diff, or exact references the reviewer can read>
|
|
43
|
+
=== END CONTEXT ===
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Step 2 — Map Files to Agents
|
|
47
|
+
|
|
48
|
+
Based on file extension and path patterns, build a dispatch plan. Each pattern maps to one or more agents:
|
|
49
|
+
|
|
50
|
+
| File Pattern | Agents |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `*.go` (excluding `*_test.go`, `migrations/`) | **go-reviewer**, **security-scanner** |
|
|
53
|
+
| `migrations/*.sql` or `db/migrate/*.sql` | **migration-reviewer** |
|
|
54
|
+
| `*.tsx` | **ts-reviewer**, **design-system-reviewer** |
|
|
55
|
+
| `*.vue`, `*.svelte` | **design-system-reviewer** |
|
|
56
|
+
| `*.ts` | **ts-reviewer** |
|
|
57
|
+
| `*.py` | **py-reviewer**, **security-scanner** |
|
|
58
|
+
| `*.rs` | **rs-reviewer** |
|
|
59
|
+
| `**/bot*/**/*.go` or `**/bot*/**/*.py` | **bot-reviewer** |
|
|
60
|
+
| `*.yaml` / `*.yml` (OpenAPI/config) | **api-contract-sync** (if available) |
|
|
61
|
+
|
|
62
|
+
Rules:
|
|
63
|
+
- A single agent is dispatched **at most once** even if multiple files match
|
|
64
|
+
- Only dispatch roles with an available resolved skill file; missing required expertise remains uncovered and blocks acceptance.
|
|
65
|
+
- If no pattern matches, report the unmatched scope and whether a suitable generic review is available; do not call unreviewed changes a clean pass.
|
|
66
|
+
- List the dispatch plan before executing (agent name + matched file count)
|
|
67
|
+
|
|
68
|
+
## Step 3 — Dispatch Agents in Parallel
|
|
69
|
+
|
|
70
|
+
Inspect available delegation tools and authorization before dispatch. For independent scopes, use supported concurrency within available slots and clean worker contexts with explicit model/effort. Supply scope, read-only authority, criteria, relevant evidence, and required output. If delegation or routing is unavailable, perform suitable skills as separate inline passes and disclose self-review; mandatory independence/Astra acceptance remains pending.
|
|
71
|
+
|
|
72
|
+
**Parallel Group 1 (code quality)**:
|
|
73
|
+
- go-reviewer (if triggered)
|
|
74
|
+
- ts-reviewer (if triggered)
|
|
75
|
+
- py-reviewer (if triggered)
|
|
76
|
+
- rs-reviewer (if triggered)
|
|
77
|
+
- bot-reviewer (if triggered)
|
|
78
|
+
- migration-reviewer (if triggered)
|
|
79
|
+
- design-system-reviewer (if triggered)
|
|
80
|
+
|
|
81
|
+
**Parallel Group 2 (cross-cutting)**:
|
|
82
|
+
- security-scanner (if triggered)
|
|
83
|
+
- api-contract-sync (if triggered)
|
|
84
|
+
|
|
85
|
+
Groups 1 and 2 can run concurrently when their assigned scopes are independent and runtime capacity permits. Reviewers may not recursively delegate unless assigned.
|
|
86
|
+
|
|
87
|
+
For each agent, inject the `REVIEW_CONTEXT` block into the prompt:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
You are reviewing code changes.
|
|
91
|
+
|
|
92
|
+
Model/effort: <explicit supported route from task/project policy>
|
|
93
|
+
Role instructions: <resolved installed SKILL.md path; read before reviewing>
|
|
94
|
+
Authority: read-only; no edits or external writes.
|
|
95
|
+
Scope/criteria: <exact diff identity, owned review scope, requested contract>
|
|
96
|
+
Existing evidence: <commands/results bound to code, inputs, and environment>
|
|
97
|
+
|
|
98
|
+
{REVIEW_CONTEXT — filtered to files relevant to this agent}
|
|
99
|
+
|
|
100
|
+
## Your Task
|
|
101
|
+
Review the diff hunks above against your checklist. The recent commits section
|
|
102
|
+
provides intent — use it to judge whether changes are complete and consistent.
|
|
103
|
+
|
|
104
|
+
Focus on:
|
|
105
|
+
- Changes that contradict the stated commit intent
|
|
106
|
+
- Missing pieces (e.g., commit says "add endpoint" but no route registration)
|
|
107
|
+
- Regressions in existing patterns
|
|
108
|
+
|
|
109
|
+
Report findings in your standard format, plus coverage (COMPLETE/PARTIAL/UNAVAILABLE), evidence references, and unresolved mandatory criteria. Zero findings is valid. Mark any unreviewed scope explicitly. Reuse results only for unchanged relevant code, inputs, environment, and recorded command/results; rerun for concrete uncertainty or relevant change.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Per-agent diff filtering** — only include relevant file hunks:
|
|
113
|
+
- **go-reviewer**: `*.go` hunks (excluding `*_test.go`, migrations)
|
|
114
|
+
- **ts-reviewer**: `*.ts` and `*.tsx` hunks
|
|
115
|
+
- **py-reviewer**: `*.py` hunks
|
|
116
|
+
- **rs-reviewer**: `*.rs` hunks
|
|
117
|
+
- **migration-reviewer**: `*.sql` migration hunks only
|
|
118
|
+
- **security-scanner**: all hunks (cross-cutting concern)
|
|
119
|
+
- **bot-reviewer**: bot-related file hunks only
|
|
120
|
+
- **design-system-reviewer**: `*.tsx` / `*.vue` / `*.svelte` UI component hunks
|
|
121
|
+
|
|
122
|
+
## Step 4 — Collect and Deduplicate Findings
|
|
123
|
+
|
|
124
|
+
After all agents complete:
|
|
125
|
+
|
|
126
|
+
1. **Merge** all findings into a unified report
|
|
127
|
+
2. **Deduplicate** by root cause and impact, preserving distinct issues on the same line and unresolved blockers from prior reviews.
|
|
128
|
+
3. **Group by severity**:
|
|
129
|
+
|
|
130
|
+
### Blocking
|
|
131
|
+
- [agent-name] file:line — description
|
|
132
|
+
|
|
133
|
+
### Important
|
|
134
|
+
- [agent-name] file:line — description
|
|
135
|
+
|
|
136
|
+
### Nit
|
|
137
|
+
- [agent-name] file:line — description
|
|
138
|
+
|
|
139
|
+
4. **Summary table**:
|
|
140
|
+
|
|
141
|
+
| Agent | Blocking | Important | Nit | Status |
|
|
142
|
+
|-------|----------|-----------|-----|--------|
|
|
143
|
+
| go-reviewer | 0 | 2 | 1 | PASS |
|
|
144
|
+
| ts-reviewer | 1 | 0 | 3 | FAIL |
|
|
145
|
+
| ... | | | | |
|
|
146
|
+
|
|
147
|
+
Status: **FAIL** if a supported blocking finding or unresolved mandatory acceptance condition prevents progression; distinguish defects from missing evidence. **WARN** for non-blocking concerns or partial optional coverage. **PASS** only when assigned coverage is complete, mandatory conditions are met, and remaining items are nits-only or clean. Carry each reviewer's coverage and evidence status into the summary; no findings is not proof of complete review.
|
|
148
|
+
|
|
149
|
+
### Overall Verdict
|
|
150
|
+
|
|
151
|
+
**PASS / WARN / FAIL** — one-line reason, coverage, and any required next action. Preserve native plan-checker/evaluator/goal-verifier/critic verdicts when included; do not translate unresolved mandatory criteria into PASS. Missing required capability ends the review with an incomplete result, not endless retries.
|