tribunal-kit 6.0.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/ARCHITECTURE.md +9 -6
- package/.agent/agents/accessibility-reviewer.md +23 -16
- package/.agent/agents/ai-code-reviewer.md +25 -21
- package/.agent/agents/anti-pattern-reviewer.md +12 -7
- package/.agent/agents/api-architect.md +1 -0
- package/.agent/agents/backend-specialist.md +23 -22
- package/.agent/agents/cloud-engineer.md +1 -0
- package/.agent/agents/code-archaeologist.md +1 -0
- package/.agent/agents/complexity-reviewer.md +10 -7
- package/.agent/agents/database-architect.md +3 -2
- package/.agent/agents/db-latency-auditor.md +6 -2
- package/.agent/agents/debugger.md +3 -2
- package/.agent/agents/dependency-reviewer.md +1 -0
- package/.agent/agents/devops-engineer.md +9 -8
- package/.agent/agents/documentation-writer.md +6 -5
- package/.agent/agents/explorer-agent.md +1 -0
- package/.agent/agents/frontend-reviewer.md +21 -17
- package/.agent/agents/frontend-specialist.md +23 -20
- package/.agent/agents/game-developer.md +1 -0
- package/.agent/agents/interaction-reviewer.md +10 -5
- package/.agent/agents/logic-reviewer.md +3 -0
- package/.agent/agents/minimalist-reviewer.md +6 -0
- package/.agent/agents/mobile-developer.md +7 -6
- package/.agent/agents/mobile-reviewer.md +14 -13
- package/.agent/agents/orchestrator.md +3 -0
- package/.agent/agents/penetration-tester.md +1 -0
- package/.agent/agents/performance-optimizer.md +6 -5
- package/.agent/agents/performance-reviewer.md +6 -6
- package/.agent/agents/pipeline-reviewer.md +144 -0
- package/.agent/agents/precedence-reviewer.md +1 -0
- package/.agent/agents/product-manager.md +1 -0
- package/.agent/agents/product-owner.md +1 -0
- package/.agent/agents/product-reviewer.md +12 -7
- package/.agent/agents/project-planner.md +3 -0
- package/.agent/agents/qa-automation-engineer.md +50 -43
- package/.agent/agents/resilience-reviewer.md +1 -0
- package/.agent/agents/schema-reviewer.md +1 -0
- package/.agent/agents/security-auditor.md +24 -24
- package/.agent/agents/seo-specialist.md +33 -23
- package/.agent/agents/sql-reviewer.md +5 -4
- package/.agent/agents/supervisor-agent.md +12 -2
- package/.agent/agents/swarm-worker-contracts.md +13 -13
- package/.agent/agents/swarm-worker-registry.md +51 -51
- package/.agent/agents/system-architect.md +1 -0
- package/.agent/agents/test-coverage-reviewer.md +25 -22
- package/.agent/agents/test-engineer.md +12 -11
- package/.agent/agents/throughput-optimizer.md +45 -40
- package/.agent/agents/type-safety-reviewer.md +5 -4
- package/.agent/agents/ui-ux-auditor.md +6 -4
- package/.agent/agents/ui-visual-auditor.md +3 -0
- package/.agent/agents/ux-reviewer.md +11 -6
- package/.agent/agents/visual-reviewer.md +11 -6
- package/.agent/agents/vitals-reviewer.md +5 -4
- package/.agent/history/memory/.memory.idx +1532 -1
- package/.agent/history/memory/MEMORY.md +102 -1
- package/.agent/mcp_config.json +1 -6
- package/.agent/routing_index.json +2033 -263
- package/.agent/rules/GEMINI.md +11 -9
- package/.agent/rules/GEMINI_PLANNER.md +19 -21
- package/.agent/scripts/_colors.js +52 -54
- package/.agent/scripts/_utils.js +52 -53
- package/.agent/scripts/auto_preview.js +39 -43
- package/.agent/scripts/bundle_analyzer.js +47 -60
- package/.agent/scripts/case_law_manager.js +200 -294
- package/.agent/scripts/checklist.js +73 -94
- package/.agent/scripts/cicd_validator.js +305 -0
- package/.agent/scripts/compile_router.py +4 -111
- package/.agent/scripts/context_broker.js +317 -412
- package/.agent/scripts/contract_engine.js +402 -0
- package/.agent/scripts/dependency_analyzer.js +112 -124
- package/.agent/scripts/graph_builder.js +75 -103
- package/.agent/scripts/graph_visualizer.js +10 -12
- package/.agent/scripts/graph_zoom.js +38 -55
- package/.agent/scripts/guardrail_engine.js +195 -145
- package/.agent/scripts/impact_classifier.js +55 -30
- package/.agent/scripts/inner_loop_validator.js +108 -159
- package/.agent/scripts/integrity_manifest.js +59 -67
- package/.agent/scripts/lint_runner.js +65 -75
- package/.agent/scripts/marathon_harness.js +131 -208
- package/.agent/scripts/migrate_skills_frontmatter.py +4 -63
- package/.agent/scripts/minify_context.js +29 -33
- package/.agent/scripts/minimal_change_engine.js +95 -87
- package/.agent/scripts/mutation_runner.js +46 -62
- package/.agent/scripts/pipeline_engine.js +320 -209
- package/.agent/scripts/prompt_compiler.js +118 -93
- package/.agent/scripts/schema_validator.js +73 -121
- package/.agent/scripts/security_scan.js +88 -117
- package/.agent/scripts/session_manager.js +52 -69
- package/.agent/scripts/signal_detector.js +24 -22
- package/.agent/scripts/skill_evolution.js +184 -245
- package/.agent/scripts/skill_integrator.js +35 -48
- package/.agent/scripts/socratic_gate_policy.js +15 -12
- package/.agent/scripts/strengthen_skills.js +29 -33
- package/.agent/scripts/swarm_dispatcher.js +120 -151
- package/.agent/scripts/test_runner.js +54 -56
- package/.agent/scripts/token_budget_broker.js +9 -7
- package/.agent/scripts/trace_engine.js +126 -0
- package/.agent/scripts/verify_all.js +76 -93
- package/.agent/scripts/visual_audit.js +16 -21
- package/.agent/skill_topic_map.json +22 -3
- package/.agent/skills/12-principles-of-animation/SKILL.md +7 -0
- package/.agent/skills/60fps-animation/SKILL.md +7 -0
- package/.agent/skills/accessible-animation/SKILL.md +5 -1
- package/.agent/skills/adapt/SKILL.md +7 -1
- package/.agent/skills/advanced-rag-pipelines/SKILL.md +1 -0
- package/.agent/skills/agent-organizer/SKILL.md +1 -0
- package/.agent/skills/agentic-patterns/SKILL.md +33 -25
- package/.agent/skills/agentic-workflows-2026/SKILL.md +6 -2
- package/.agent/skills/ai-app-hardening/SKILL.md +9 -8
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +7 -6
- package/.agent/skills/animation-on-scroll/SKILL.md +24 -15
- package/.agent/skills/animation-systems/SKILL.md +11 -10
- package/.agent/skills/antfu-conventions/SKILL.md +7 -2
- package/.agent/skills/api-patterns/SKILL.md +14 -10
- package/.agent/skills/api-security-auditor/SKILL.md +15 -14
- package/.agent/skills/app-builder/SKILL.md +1 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +2 -2
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +12 -12
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +3 -3
- package/.agent/skills/apple-design/SKILL.md +8 -7
- package/.agent/skills/architecture/SKILL.md +3 -2
- package/.agent/skills/audit-and-fix/SKILL.md +8 -5
- package/.agent/skills/authentication-best-practices/SKILL.md +9 -8
- package/.agent/skills/backend-security-expert/SKILL.md +1 -0
- package/.agent/skills/baseline-ui/SKILL.md +8 -7
- package/.agent/skills/bash-linux/SKILL.md +1 -0
- package/.agent/skills/behavioral-modes/SKILL.md +1 -0
- package/.agent/skills/better-colors/SKILL.md +11 -7
- package/.agent/skills/better-typography/SKILL.md +30 -16
- package/.agent/skills/better-ui/SKILL.md +17 -10
- package/.agent/skills/bolder/SKILL.md +6 -0
- package/.agent/skills/brainstorming/SKILL.md +6 -4
- package/.agent/skills/browser-native-ai/SKILL.md +5 -4
- package/.agent/skills/build-primitive/SKILL.md +5 -0
- package/.agent/skills/building-native-ui/SKILL.md +1 -0
- package/.agent/skills/cicd-pro/SKILL.md +2 -1
- package/.agent/skills/clarify/SKILL.md +19 -14
- package/.agent/skills/clean-code/SKILL.md +16 -15
- package/.agent/skills/cloud-architect/SKILL.md +1 -0
- package/.agent/skills/cobejs/SKILL.md +7 -9
- package/.agent/skills/code-review-checklist/SKILL.md +1 -0
- package/.agent/skills/codebase-design/SKILL.md +7 -2
- package/.agent/skills/colorize/SKILL.md +8 -3
- package/.agent/skills/compact-landing/SKILL.md +8 -3
- package/.agent/skills/company-logos/SKILL.md +6 -0
- package/.agent/skills/config-validator/SKILL.md +10 -9
- package/.agent/skills/containerization-pro/SKILL.md +6 -5
- package/.agent/skills/context-engineering-pro/SKILL.md +5 -4
- package/.agent/skills/create-design-md/SKILL.md +13 -5
- package/.agent/skills/critique/SKILL.md +10 -8
- package/.agent/skills/csharp-developer/SKILL.md +1 -0
- package/.agent/skills/data-validation-schemas/SKILL.md +28 -23
- package/.agent/skills/database-design/SKILL.md +2 -1
- package/.agent/skills/delight/SKILL.md +6 -0
- package/.agent/skills/deployment-procedures/SKILL.md +2 -1
- package/.agent/skills/design-lab/SKILL.md +5 -0
- package/.agent/skills/devops-engineer/SKILL.md +3 -2
- package/.agent/skills/devops-incident-responder/SKILL.md +2 -1
- package/.agent/skills/diagnosing-bugs/SKILL.md +12 -2
- package/.agent/skills/distill/SKILL.md +7 -2
- package/.agent/skills/documentation-templates/SKILL.md +3 -2
- package/.agent/skills/domain-modeling/SKILL.md +12 -4
- package/.agent/skills/duckdb-analytical-sql/SKILL.md +7 -3
- package/.agent/skills/edge-ai-mobile/SKILL.md +5 -1
- package/.agent/skills/edge-computing/SKILL.md +9 -8
- package/.agent/skills/emil-design-eng/SKILL.md +43 -27
- package/.agent/skills/error-resilience/SKILL.md +34 -16
- package/.agent/skills/expo-router-v4/SKILL.md +2 -1
- package/.agent/skills/extract-design-system/SKILL.md +12 -11
- package/.agent/skills/fabel-protocol/SKILL.md +24 -17
- package/.agent/skills/fixing-accessibility/SKILL.md +23 -16
- package/.agent/skills/fixing-metadata/SKILL.md +24 -13
- package/.agent/skills/fixing-motion-performance/SKILL.md +7 -5
- package/.agent/skills/framer-motion-expert/SKILL.md +29 -15
- package/.agent/skills/frontend-design/SKILL.md +21 -13
- package/.agent/skills/frontend-security-expert/SKILL.md +1 -0
- package/.agent/skills/game-design-expert/SKILL.md +1 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +1 -0
- package/.agent/skills/generative-ui-expert/SKILL.md +3 -2
- package/.agent/skills/geo-fundamentals/SKILL.md +2 -1
- package/.agent/skills/git-pro/SKILL.md +10 -9
- package/.agent/skills/github-operations/SKILL.md +2 -1
- package/.agent/skills/gpt-taste/SKILL.md +7 -0
- package/.agent/skills/gsap-core/SKILL.md +26 -22
- package/.agent/skills/gsap-frameworks/SKILL.md +6 -5
- package/.agent/skills/gsap-performance/SKILL.md +4 -3
- package/.agent/skills/gsap-plugins/SKILL.md +34 -33
- package/.agent/skills/gsap-react/SKILL.md +9 -8
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +34 -33
- package/.agent/skills/gsap-timeline/SKILL.md +18 -15
- package/.agent/skills/gsap-utils/SKILL.md +25 -24
- package/.agent/skills/harden/SKILL.md +9 -3
- package/.agent/skills/harness-protocol/SKILL.md +1 -0
- package/.agent/skills/i18n-localization/SKILL.md +10 -9
- package/.agent/skills/impeccable/SKILL.md +5 -0
- package/.agent/skills/improve-codebase-architecture/SKILL.md +10 -5
- package/.agent/skills/improve-ui/SKILL.md +12 -5
- package/.agent/skills/intelligent-routing/SKILL.md +7 -6
- package/.agent/skills/knowledge-graph/SKILL.md +1 -0
- package/.agent/skills/landing-page/SKILL.md +1 -0
- package/.agent/skills/lint-and-validate/SKILL.md +9 -4
- package/.agent/skills/llm-engineering/SKILL.md +55 -54
- package/.agent/skills/local-first/SKILL.md +20 -19
- package/.agent/skills/local-first-architecture/SKILL.md +6 -1
- package/.agent/skills/lottie-animation/SKILL.md +7 -3
- package/.agent/skills/marquee-loop/SKILL.md +1 -0
- package/.agent/skills/masked-reveal/SKILL.md +17 -4
- package/.agent/skills/mcp-builder/SKILL.md +13 -10
- package/.agent/skills/micro-interaction/SKILL.md +20 -5
- package/.agent/skills/mobile-design/SKILL.md +26 -15
- package/.agent/skills/monorepo-management/SKILL.md +3 -2
- package/.agent/skills/morphing-icons/SKILL.md +16 -6
- package/.agent/skills/motion-engineering/SKILL.md +19 -15
- package/.agent/skills/nextjs-react-expert/SKILL.md +26 -21
- package/.agent/skills/nodejs-best-practices/SKILL.md +89 -76
- package/.agent/skills/observability/SKILL.md +45 -44
- package/.agent/skills/opentelemetry-observability/SKILL.md +2 -1
- package/.agent/skills/page-transition-animation/SKILL.md +6 -3
- package/.agent/skills/parallel-agents/SKILL.md +7 -2
- package/.agent/skills/performance-profiling/SKILL.md +24 -13
- package/.agent/skills/plan-writing/SKILL.md +1 -0
- package/.agent/skills/platform-engineer/SKILL.md +3 -2
- package/.agent/skills/platform-engineering-opentofu/SKILL.md +1 -0
- package/.agent/skills/playwright-ai-e2e/SKILL.md +3 -2
- package/.agent/skills/playwright-best-practices/SKILL.md +29 -28
- package/.agent/skills/polish/SKILL.md +13 -12
- package/.agent/skills/powershell-windows/SKILL.md +1 -0
- package/.agent/skills/pricing-page/SKILL.md +8 -3
- package/.agent/skills/product-aware-heuristics/SKILL.md +122 -72
- package/.agent/skills/progressive-blur/SKILL.md +9 -4
- package/.agent/skills/project-idioms/SKILL.md +1 -0
- package/.agent/skills/property-based-testing/SKILL.md +10 -12
- package/.agent/skills/python-patterns/SKILL.md +1 -0
- package/.agent/skills/python-pro/SKILL.md +1 -0
- package/.agent/skills/quieter/SKILL.md +6 -0
- package/.agent/skills/react-doctor/SKILL.md +6 -0
- package/.agent/skills/react-specialist/SKILL.md +32 -28
- package/.agent/skills/readme-builder/SKILL.md +1 -0
- package/.agent/skills/realtime-patterns/SKILL.md +34 -33
- package/.agent/skills/red-team-tactics/SKILL.md +1 -0
- package/.agent/skills/redesign-skill/SKILL.md +6 -0
- package/.agent/skills/review-animations/SKILL.md +5 -2
- package/.agent/skills/review-animations/STANDARDS.md +37 -23
- package/.agent/skills/rust-pro/SKILL.md +1 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +4 -3
- package/.agent/skills/server-management/SKILL.md +1 -0
- package/.agent/skills/shadcn-ui-expert/SKILL.md +28 -22
- package/.agent/skills/shape/SKILL.md +9 -2
- package/.agent/skills/skill-creator/SKILL.md +1 -0
- package/.agent/skills/soft-skill/SKILL.md +6 -0
- package/.agent/skills/sounds-on-the-web/SKILL.md +1 -0
- package/.agent/skills/sql-pro/SKILL.md +1 -0
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +1 -0
- package/.agent/skills/svg-animation/SKILL.md +16 -7
- package/.agent/skills/swiftui-expert/SKILL.md +1 -0
- package/.agent/skills/swiss-design/SKILL.md +5 -0
- package/.agent/skills/system-design-pro/SKILL.md +1 -0
- package/.agent/skills/systematic-debugging/SKILL.md +1 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +25 -11
- package/.agent/skills/taste-skill/SKILL.md +6 -0
- package/.agent/skills/tdd-workflow/SKILL.md +5 -0
- package/.agent/skills/test-result-analyzer/SKILL.md +1 -0
- package/.agent/skills/testing-patterns/SKILL.md +123 -115
- package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +5 -0
- package/.agent/skills/thinking-protocol/SKILL.md +3 -0
- package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +9 -8
- package/.agent/skills/transitions-dev/SKILL.md +19 -6
- package/.agent/skills/trend-researcher/SKILL.md +1 -0
- package/.agent/skills/typescript-advanced/SKILL.md +23 -18
- package/.agent/skills/typeset/SKILL.md +10 -1
- package/.agent/skills/ui-reasoning-engine/SKILL.md +67 -48
- package/.agent/skills/ui-skill-packs/SKILL.md +6 -1
- package/.agent/skills/ui-skills-root/SKILL.md +39 -38
- package/.agent/skills/ui-ux-pro-max/SKILL.md +34 -26
- package/.agent/skills/ui-ux-researcher/SKILL.md +1 -0
- package/.agent/skills/vector-search-pgvector/SKILL.md +3 -2
- package/.agent/skills/vue-expert/SKILL.md +22 -19
- package/.agent/skills/vulnerability-scanner/SKILL.md +22 -21
- package/.agent/skills/web-accessibility-auditor/SKILL.md +2 -1
- package/.agent/skills/web-design-guidelines/SKILL.md +16 -10
- package/.agent/skills/web-quality-audit/SKILL.md +5 -0
- package/.agent/skills/webapp-testing/SKILL.md +14 -13
- package/.agent/skills/webgpu-performance/SKILL.md +1 -0
- package/.agent/skills/whimsy-injector/SKILL.md +9 -5
- package/.agent/skills/workflow-optimizer/SKILL.md +1 -0
- package/.agent/skills/zero-trust-passkeys/SKILL.md +11 -6
- package/.agent/templates/DESIGN.md +119 -110
- package/.agent/templates/design-tokens.json +9 -6
- package/.agent/workflows/acf.md +1 -0
- package/.agent/workflows/api-tester.md +1 -0
- package/.agent/workflows/audit.md +1 -0
- package/.agent/workflows/brainstorm.md +1 -0
- package/.agent/workflows/changelog.md +1 -0
- package/.agent/workflows/contract.md +60 -0
- package/.agent/workflows/create.md +1 -0
- package/.agent/workflows/debug.md +1 -0
- package/.agent/workflows/deploy.md +1 -0
- package/.agent/workflows/enhance.md +1 -0
- package/.agent/workflows/fix-ci.md +89 -0
- package/.agent/workflows/fix.md +1 -0
- package/.agent/workflows/generate.md +1 -0
- package/.agent/workflows/marathon.md +1 -0
- package/.agent/workflows/migrate.md +1 -0
- package/.agent/workflows/minimal.md +9 -7
- package/.agent/workflows/orchestrate.md +1 -0
- package/.agent/workflows/performance-benchmarker.md +1 -0
- package/.agent/workflows/pipeline.md +26 -21
- package/.agent/workflows/plan.md +1 -0
- package/.agent/workflows/preview.md +1 -0
- package/.agent/workflows/refactor.md +3 -2
- package/.agent/workflows/review-ai.md +4 -3
- package/.agent/workflows/review.md +1 -0
- package/.agent/workflows/session.md +1 -0
- package/.agent/workflows/status.md +1 -0
- package/.agent/workflows/strengthen-skills.md +1 -0
- package/.agent/workflows/super-prompt.md +1 -0
- package/.agent/workflows/swarm.md +15 -3
- package/.agent/workflows/test.md +8 -7
- package/.agent/workflows/tribunal-backend.md +3 -2
- package/.agent/workflows/tribunal-cicd.md +104 -0
- package/.agent/workflows/tribunal-database.md +1 -0
- package/.agent/workflows/tribunal-frontend.md +8 -6
- package/.agent/workflows/tribunal-full.md +2 -1
- package/.agent/workflows/tribunal-mobile.md +6 -5
- package/.agent/workflows/tribunal-performance.md +1 -0
- package/.agent/workflows/tribunal-speed.md +1 -0
- package/.agent/workflows/tribunal-ui.md +29 -21
- package/.agent/workflows/ui-ux-pro-max.md +19 -15
- package/CONTRIBUTING.md +3 -3
- package/README.md +94 -44
- package/SECURITY.md +10 -10
- package/bin/mcp-server.js +385 -252
- package/bin/tribunal-kit.js +29 -30
- package/bin/wrapper.js +40 -46
- package/dist/cli.js +6 -0
- package/dist/commands/case.js +2 -0
- package/dist/commands/contract.js +440 -0
- package/dist/commands/status.js +6 -0
- package/dist/index.d.ts +8 -1
- package/package.json +13 -12
- package/scripts/benchmark.js +62 -86
- package/scripts/changelog.js +67 -73
- package/scripts/fix-vbc.js +13 -15
- package/scripts/fix-vbc.ps1 +2 -118
- package/scripts/stress_benchmark.js +358 -0
- package/scripts/sync-version.js +71 -41
- package/scripts/validate-payload.js +23 -30
- package/scripts/visual_audit.js +23 -13
package/.agent/ARCHITECTURE.md
CHANGED
|
@@ -37,23 +37,26 @@ flowchart TD
|
|
|
37
37
|
## 2. Option A + Option C Hybrid Architecture (v3.0.0 Standard)
|
|
38
38
|
|
|
39
39
|
### Subsystem A: 2-Tier Lazy Skill Routing Engine
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
- **Lightweight Index (`skill_topic_map.json`):** 183 skills indexed across 9 domain routes and file extensions (~500 tokens).
|
|
41
42
|
- **Startup Overhead:** ~2,500 – 3,500 startup tokens vs 85,000 tokens previously (95% token reduction).
|
|
42
|
-
- **Zero Exclusions:** All
|
|
43
|
+
- **Zero Exclusions:** All 183 skills remain indexed on disk; target skills are fetched dynamically on-demand via `view_file`.
|
|
43
44
|
|
|
44
45
|
### Subsystem C: Stage-Partitioned Tribunal Pipeline
|
|
45
|
-
|
|
46
|
-
- **
|
|
46
|
+
|
|
47
|
+
- **52 Specialist Agents** (28 Parallel Reviewers + 24 Domain Specialists).
|
|
48
|
+
- **3 Execution Waves:** Replaces monolithic fan-out with 3 partitioned passes (28 reviewers total):
|
|
47
49
|
- **Wave 1 (Core Integrity):** `precedence-reviewer`, `logic-reviewer`, `schema-reviewer`, `resilience-reviewer`
|
|
48
|
-
- **Wave 2 (Security & Types):** `security-auditor`, `dependency-reviewer`, `type-safety-reviewer`, `complexity-reviewer`, `sql-reviewer`
|
|
50
|
+
- **Wave 2 (Security & Types):** `security-auditor`, `dependency-reviewer`, `type-safety-reviewer`, `complexity-reviewer`, `sql-reviewer`, `pipeline-reviewer`
|
|
49
51
|
- **Wave 3 (Domain & Performance):** `frontend-reviewer`, `performance-reviewer`, `mobile-reviewer`, `ai-code-reviewer`, `test-coverage-reviewer`, `accessibility-reviewer`, `ui-ux-auditor`, `review-animations`, `vitals-reviewer`, `db-latency-auditor`, `throughput-optimizer`
|
|
50
|
-
- **Attention Preservation:** Reviewers execute in scoped 4
|
|
52
|
+
- **Attention Preservation:** Reviewers execute in scoped evaluation pairs of 4 to 8 specialists, eliminating hallucination risks and attention dilution.
|
|
51
53
|
|
|
52
54
|
---
|
|
53
55
|
|
|
54
56
|
## 3. Skill-Script Binding Standard
|
|
55
57
|
|
|
56
58
|
Every skill in `.agent/skills/` conforms to the Option A+C Hybrid v3.0.0 frontmatter standard:
|
|
59
|
+
|
|
57
60
|
- `version`: `3.0.0`
|
|
58
61
|
- `script`: Primary executable script path in `.agent/scripts/`
|
|
59
62
|
- `scripts-binding`: Array of executable CLI tools (`security_scan.js`, `test_runner.js`, `schema_validator.js`, etc.)
|
|
@@ -18,6 +18,7 @@ skills:
|
|
|
18
18
|
## Mandatory Pre-Flight Context Inspection
|
|
19
19
|
|
|
20
20
|
Before auditing accessibility, you MUST inspect:
|
|
21
|
+
|
|
21
22
|
1. Target size bounds → Verify touch targets on mobile/touch interfaces meet 44x44px minimum (WCAG 2.2 SC 2.5.8)
|
|
22
23
|
2. Interactive element markup → Check for native `<button>` and `<a>` elements instead of unsemantic `<div onClick>`
|
|
23
24
|
3. Form input & Icon-only buttons → Verify `<label htmlFor="...">` bindings and `aria-label` declarations
|
|
@@ -27,39 +28,44 @@ Before auditing accessibility, you MUST inspect:
|
|
|
27
28
|
## What This Reviewer Catches
|
|
28
29
|
|
|
29
30
|
### 1. Target Size (Minimum) (WCAG 2.2 SC 2.5.8 - Level AA)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
|
|
32
|
+
- **Criterion:** All interactive targets (buttons, links, form fields, checkboxes) must be at least **24x24 CSS pixels** in size.
|
|
33
|
+
- **Coarse Pointers (Touch):** If the UI is used on touch devices (pointer: coarse), targets must meet a minimum size of **44x44px** (Apple HIG) or **48x48dp** (Material Design).
|
|
34
|
+
- **Exception:** Inline text links (e.g., links in paragraphs) are exempt, but must have sufficient visual distinction (e.g., underline).
|
|
35
|
+
- **Spacing Buffer:** Targets smaller than 24x24px must have surrounding spacing buffer so that a 24px diameter circle centered on the target does not intersect another target.
|
|
34
36
|
|
|
35
37
|
### 2. APCA Contrast Guidelines (WCAG 3.0 APCA Base)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
|
|
39
|
+
- **Lightness Contrast (Lc):** Ensure readability using the APCA scale instead of flat 4.5:1 ratios:
|
|
40
|
+
- **Body text (small size):** Must achieve Lc > 75.
|
|
41
|
+
- **Large display headings (large size):** Must achieve Lc > 60.
|
|
42
|
+
- **Interactive indicators & borders:** Must achieve Lc > 45.
|
|
40
43
|
|
|
41
44
|
### 3. Keyboard Navigation & Focus Visibility
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
|
|
46
|
+
- **Focus Ring (WCAG 2.4.13 - Level AA):** Visible focus rings must achieve 3:1 contrast and cannot be hidden (`outline: none` is forbidden).
|
|
47
|
+
- **Focus Trap (WCAG 2.1.2):** All overlay modals, slide-out panels, and drawers must trap focus internally and return it to the trigger element on close.
|
|
48
|
+
- **Semantic Tab Order:** Tab navigation must match the visual layout reading flow.
|
|
45
49
|
|
|
46
50
|
### 4. Semantic Markup & ARIA Semantics (WCAG 4.1.2)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
|
|
52
|
+
- **Interactive Tags:** Clickable elements must use native `<button>` or `<a>` tags. Avoid `<div onClick>`.
|
|
53
|
+
- **Label Association (WCAG 1.3.1):** All input elements must be linked to a `<label htmlFor="...">`. Placeholders are not labels.
|
|
54
|
+
- **Accessible Name:** Icon-only buttons must declare an `aria-label` or `aria-labelledby` property.
|
|
50
55
|
|
|
51
56
|
---
|
|
52
57
|
|
|
53
58
|
## Code Comparison Examples
|
|
54
59
|
|
|
55
60
|
### Target Size (Minimum) Violation
|
|
61
|
+
|
|
56
62
|
```tsx
|
|
57
63
|
// ❌ REJECTED: Small 14x14px click area, no padding buffer. Fails WCAG 2.5.8.
|
|
58
64
|
<button onClick={onClose} className="w-3.5 h-3.5 bg-red-500 rounded-full" />
|
|
59
65
|
|
|
60
66
|
// ✅ APPROVED: Visual area remains small (w-3.5 h-3.5), but absolute touch target is expanded to 44x44px
|
|
61
|
-
<button
|
|
62
|
-
onClick={onClose}
|
|
67
|
+
<button
|
|
68
|
+
onClick={onClose}
|
|
63
69
|
aria-label="Close alert"
|
|
64
70
|
className="relative p-3 hover:bg-[var(--bg-surface-raised)] rounded-full transition-all"
|
|
65
71
|
>
|
|
@@ -68,6 +74,7 @@ Before auditing accessibility, you MUST inspect:
|
|
|
68
74
|
```
|
|
69
75
|
|
|
70
76
|
### Contrast Violation
|
|
77
|
+
|
|
71
78
|
```tsx
|
|
72
79
|
// ❌ REJECTED: Gray text on white background yields contrast ratio of 2.2:1 (Lc <40).
|
|
73
80
|
<p className="text-gray-300 bg-white text-xs">Secondary description</p>
|
|
@@ -21,6 +21,7 @@ Every piece of code that calls an LLM API must be verified against the actual pr
|
|
|
21
21
|
## Mandatory Pre-Flight Context Inspection
|
|
22
22
|
|
|
23
23
|
Before auditing LLM integration code, you MUST inspect:
|
|
24
|
+
|
|
24
25
|
1. `package.json` / `requirements.txt` → Check LLM SDK versions (`openai`, `@anthropic-ai/sdk`, `@google/genai`, `ai` Vercel AI SDK)
|
|
25
26
|
2. Environment configs → Confirm model name strings are parameterized (`process.env.MODEL_NAME`) rather than hardcoded strings
|
|
26
27
|
3. Prompt templates → Audit user input sanitization delimiters (`<user_input>`) and prompt injection boundaries
|
|
@@ -48,21 +49,21 @@ Flag any model name that cannot be verified in the provider's current model docu
|
|
|
48
49
|
```typescript
|
|
49
50
|
// ❌ HALLUCINATED: Parameters that don't exist in OpenAI SDK
|
|
50
51
|
const response = await openai.chat.completions.create({
|
|
51
|
-
model:
|
|
52
|
+
model: 'gpt-4o',
|
|
52
53
|
messages,
|
|
53
54
|
max_length: 1000, // Hallucinated — use max_tokens
|
|
54
|
-
format:
|
|
55
|
+
format: 'json', // Hallucinated — use response_format: { type: 'json_object' }
|
|
55
56
|
memory: true, // Doesn't exist
|
|
56
|
-
plugins: [
|
|
57
|
-
instructions:
|
|
57
|
+
plugins: ['web-search'], // Doesn't exist in API
|
|
58
|
+
instructions: 'Be helpful', // Hallucinated — belongs in system message
|
|
58
59
|
});
|
|
59
60
|
|
|
60
61
|
// ✅ REAL OpenAI API parameters
|
|
61
62
|
const response = await openai.chat.completions.create({
|
|
62
|
-
model:
|
|
63
|
+
model: 'gpt-4o',
|
|
63
64
|
messages,
|
|
64
65
|
max_tokens: 1000,
|
|
65
|
-
response_format: { type:
|
|
66
|
+
response_format: { type: 'json_object' },
|
|
66
67
|
temperature: 0.7,
|
|
67
68
|
stream: false,
|
|
68
69
|
});
|
|
@@ -71,17 +72,17 @@ const response = await openai.chat.completions.create({
|
|
|
71
72
|
```typescript
|
|
72
73
|
// ❌ HALLUCINATED: Anthropic SDK parameters
|
|
73
74
|
const message = await anthropic.messages.create({
|
|
74
|
-
model:
|
|
75
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
75
76
|
messages,
|
|
76
77
|
max_response: 1024, // Hallucinated — use max_tokens
|
|
77
|
-
system_prompt:
|
|
78
|
+
system_prompt: '...', // Hallucinated — 'system' is a top-level param
|
|
78
79
|
});
|
|
79
80
|
|
|
80
81
|
// ✅ REAL Anthropic API
|
|
81
82
|
const message = await anthropic.messages.create({
|
|
82
|
-
model:
|
|
83
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
83
84
|
max_tokens: 1024,
|
|
84
|
-
system:
|
|
85
|
+
system: 'You are a helpful assistant.',
|
|
85
86
|
messages,
|
|
86
87
|
});
|
|
87
88
|
```
|
|
@@ -97,13 +98,16 @@ const systemPrompt = `You are a helpful assistant. Context: ${userInput}`;
|
|
|
97
98
|
|
|
98
99
|
// ❌ CRITICAL: User content in system role message
|
|
99
100
|
const messages = [
|
|
100
|
-
{ role:
|
|
101
|
+
{ role: 'system', content: userQuery }, // User can override system behavior
|
|
101
102
|
];
|
|
102
103
|
|
|
103
104
|
// ✅ SAFE: Strict role separation
|
|
104
105
|
const messages = [
|
|
105
|
-
{
|
|
106
|
-
|
|
106
|
+
{
|
|
107
|
+
role: 'system',
|
|
108
|
+
content: 'You are a helpful assistant. Only answer questions about our product.',
|
|
109
|
+
},
|
|
110
|
+
{ role: 'user', content: userQuery }, // User input isolated to user role
|
|
107
111
|
];
|
|
108
112
|
|
|
109
113
|
// ✅ SAFE: XML delimiting when injection context unavoidable
|
|
@@ -155,14 +159,14 @@ try {
|
|
|
155
159
|
const allUsers = await prisma.user.findMany(); // 50,000 users
|
|
156
160
|
const response = await openai.chat.completions.create({
|
|
157
161
|
messages: [
|
|
158
|
-
{ role:
|
|
162
|
+
{ role: 'user', content: `Users: ${JSON.stringify(allUsers)}\n${userQuery}` },
|
|
159
163
|
// This could be 200,000 tokens per request!
|
|
160
164
|
],
|
|
161
165
|
});
|
|
162
166
|
|
|
163
167
|
// ❌ COST EXPLOSION: No max_tokens limit on user-facing endpoint
|
|
164
168
|
const response = await anthropic.messages.create({
|
|
165
|
-
model:
|
|
169
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
166
170
|
// Missing max_tokens — model can run indefinitely
|
|
167
171
|
messages,
|
|
168
172
|
});
|
|
@@ -170,11 +174,11 @@ const response = await anthropic.messages.create({
|
|
|
170
174
|
// ✅ APPROVED: Token budgeting + RAG for large datasets
|
|
171
175
|
const relevantChunks = await vectorStore.similaritySearch(userQuery, 5); // Retrieve top 5
|
|
172
176
|
const response = await openai.chat.completions.create({
|
|
173
|
-
model:
|
|
177
|
+
model: 'gpt-4o-mini', // Cost-efficient model for routing
|
|
174
178
|
max_tokens: 500, // Hard cap prevents runaway responses
|
|
175
179
|
messages: [
|
|
176
|
-
{ role:
|
|
177
|
-
{ role:
|
|
180
|
+
{ role: 'system', content: `Context:\n${relevantChunks.map(c => c.content).join('\n')}` },
|
|
181
|
+
{ role: 'user', content: userQuery },
|
|
178
182
|
],
|
|
179
183
|
});
|
|
180
184
|
```
|
|
@@ -186,12 +190,12 @@ const response = await openai.chat.completions.create({
|
|
|
186
190
|
```typescript
|
|
187
191
|
// ❌ REJECTED: Conversation history appended unbounded — will eventually overflow
|
|
188
192
|
const messages = conversationHistory; // Can grow to 100k+ tokens
|
|
189
|
-
messages.push({ role:
|
|
193
|
+
messages.push({ role: 'user', content: newMessage });
|
|
190
194
|
const response = await client.chat(messages);
|
|
191
195
|
|
|
192
196
|
// ✅ APPROVED: Sliding window with token counting
|
|
193
|
-
import { encoding_for_model } from
|
|
194
|
-
const enc = encoding_for_model(
|
|
197
|
+
import { encoding_for_model } from 'tiktoken';
|
|
198
|
+
const enc = encoding_for_model('gpt-4o');
|
|
195
199
|
|
|
196
200
|
function trimToTokenLimit(messages: Message[], limit: number = 100_000): Message[] {
|
|
197
201
|
let totalTokens = 0;
|
|
@@ -17,6 +17,7 @@ You enforce originality and build quality. You systematically block generic AI a
|
|
|
17
17
|
## Mandatory Pre-Flight Context Inspection
|
|
18
18
|
|
|
19
19
|
Before auditing UI aesthetics, you MUST inspect:
|
|
20
|
+
|
|
20
21
|
1. `index.css` / CSS variables / Tailwind config → Check color palette definitions (verify non-purple primary colors and custom design tokens)
|
|
21
22
|
2. UI component library configs (`components.json`, `theme/`) → Verify customized radius, typography, and shadow tokens
|
|
22
23
|
3. Visual layout files → Check for asymmetrical column balance vs generic repetitive cards
|
|
@@ -26,21 +27,24 @@ Before auditing UI aesthetics, you MUST inspect:
|
|
|
26
27
|
## What This Reviewer Catches
|
|
27
28
|
|
|
28
29
|
### ❌ REJECTED Criteria (Blocking)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
|
|
31
|
+
- **The Purple Primary Cliché:** Using purple/violet (`#7C3AED`, `#8B5CF6`, `oklch(... 280 ... / 290Hue)`) as the primary brand/interaction color.
|
|
32
|
+
- **Mesh Gradient Cliché:** Using radial mesh gradients with multiple high-saturation blur stops as hero backgrounds.
|
|
33
|
+
- **Bento Grid Overuse:** Structuring an entire page layout as a grid of identical rounded cards without visual break or tension.
|
|
34
|
+
- **Glassmorphism Overuse:** Applying backdrop-blur panels and translucent layers for primary containers instead of clean solid surfaces.
|
|
35
|
+
- **Card-inside-Card Overlap:** Embedding cards within cards without distinct backgrounds or border elevations, resulting in muddy visual hierarchy.
|
|
34
36
|
|
|
35
37
|
### ⚠️ WARNING Criteria (Non-blocking)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
- _Default Library Styles:_ Using default, uncustomized colors/radii from tailwind or shadcn/ui.
|
|
40
|
+
- _Centered Hero:_ Uninspired "centered title + centered paragraph + centered CTA button" layouts.
|
|
38
41
|
|
|
39
42
|
---
|
|
40
43
|
|
|
41
44
|
## Code Comparison Examples
|
|
42
45
|
|
|
43
46
|
### Purple Gradient vs. Sophisticated Tinted Depth
|
|
47
|
+
|
|
44
48
|
```css
|
|
45
49
|
/* ❌ REJECTED: Overused purple gradient background */
|
|
46
50
|
.card-ai {
|
|
@@ -56,6 +60,7 @@ Before auditing UI aesthetics, you MUST inspect:
|
|
|
56
60
|
```
|
|
57
61
|
|
|
58
62
|
### Bento Overuse vs. Asymmetrical Grid Balance
|
|
63
|
+
|
|
59
64
|
```tsx
|
|
60
65
|
// ❌ REJECTED: Repetitive, identical rounded bento boxes for layout
|
|
61
66
|
<div className="grid grid-cols-3 gap-4">
|
|
@@ -21,6 +21,7 @@ You are the master designer of APIs. You do not merely write controllers; you de
|
|
|
21
21
|
## Mandatory Pre-Flight Context Inspection
|
|
22
22
|
|
|
23
23
|
Before designing API contracts, you MUST inspect:
|
|
24
|
+
|
|
24
25
|
1. `openapi.json` / `routes/` / `api/` → Review existing API endpoints, path versioning standards (`/v1/`), and route naming conventions
|
|
25
26
|
2. `package.json` → Check web framework (Hono, Express, Fastify, Next.js Route Handlers) and schema validation engine (Zod, Pydantic)
|
|
26
27
|
3. Client consumption contracts → Confirm response envelope formats (`data`, `meta`, `error`) across active frontend components
|
|
@@ -22,6 +22,7 @@ last-updated: 2026-07-29
|
|
|
22
22
|
## Mandatory Pre-Flight Context Inspection
|
|
23
23
|
|
|
24
24
|
Before generating API routes, server actions, or middleware, you MUST inspect:
|
|
25
|
+
|
|
25
26
|
1. `package.json` → Check Node.js framework (Express, Fastify, Hono, Next.js Server Actions), validation library (Zod, Valibot), and ORM (Prisma v6, Drizzle, Kysely)
|
|
26
27
|
2. `env.mjs` / `.env.example` → Verify required environment variable schemas and secret keys
|
|
27
28
|
3. Auth configuration (`lib/auth.ts`, `middleware.ts`) → Inspect active session management, JWT algorithms, and RBAC roles
|
|
@@ -48,16 +49,16 @@ Every route handler starts with schema validation. Never trust incoming data.
|
|
|
48
49
|
|
|
49
50
|
```typescript
|
|
50
51
|
// ✅ APPROVED: Zod validates at the boundary before any business logic
|
|
51
|
-
import { z } from
|
|
52
|
+
import { z } from 'zod';
|
|
52
53
|
|
|
53
54
|
const CreateUserSchema = z.object({
|
|
54
55
|
email: z.string().email(),
|
|
55
56
|
name: z.string().min(2).max(100),
|
|
56
|
-
role: z.enum([
|
|
57
|
+
role: z.enum(['user', 'admin']).default('user'),
|
|
57
58
|
});
|
|
58
59
|
|
|
59
60
|
// Hono route with validation
|
|
60
|
-
app.post(
|
|
61
|
+
app.post('/users', async c => {
|
|
61
62
|
const raw = await c.req.json();
|
|
62
63
|
const result = CreateUserSchema.safeParse(raw);
|
|
63
64
|
|
|
@@ -88,11 +89,11 @@ async function updateProfile(req: Request) {
|
|
|
88
89
|
async function updateProfile(req: Request) {
|
|
89
90
|
// 1. Authentication — verify identity
|
|
90
91
|
const session = await auth.verifySession(req);
|
|
91
|
-
if (!session) return Response.json({ error:
|
|
92
|
+
if (!session) return Response.json({ error: 'Unauthorized' }, { status: 401 });
|
|
92
93
|
|
|
93
94
|
// 2. Authorization — verify permission
|
|
94
|
-
if (session.userId !== req.params.id && session.role !==
|
|
95
|
-
return Response.json({ error:
|
|
95
|
+
if (session.userId !== req.params.id && session.role !== 'admin') {
|
|
96
|
+
return Response.json({ error: 'Forbidden' }, { status: 403 });
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
// 3. Input validation
|
|
@@ -111,29 +112,29 @@ async function updateProfile(req: Request) {
|
|
|
111
112
|
|
|
112
113
|
```typescript
|
|
113
114
|
// ❌ BAD: Leaks internal details, no type contract
|
|
114
|
-
app.get(
|
|
115
|
+
app.get('/users/:id', async (req, res) => {
|
|
115
116
|
const user = await db.query(`SELECT * FROM users WHERE id = ${req.params.id}`);
|
|
116
117
|
res.json(user.rows[0]); // Could throw and send HTML error page with stack trace
|
|
117
118
|
});
|
|
118
119
|
|
|
119
120
|
// ✅ APPROVED: Typed error response, no information leak
|
|
120
|
-
app.get(
|
|
121
|
+
app.get('/users/:id', async (req, res) => {
|
|
121
122
|
try {
|
|
122
123
|
const id = IdSchema.parse(req.params.id);
|
|
123
124
|
const user = await db.users.findUnique({ where: { id } });
|
|
124
125
|
|
|
125
126
|
if (!user) {
|
|
126
|
-
return res.status(404).json({ error:
|
|
127
|
+
return res.status(404).json({ error: 'User not found', code: 'NOT_FOUND' });
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
return res.json(user);
|
|
130
131
|
} catch (error) {
|
|
131
132
|
if (error instanceof z.ZodError) {
|
|
132
|
-
return res.status(400).json({ error:
|
|
133
|
+
return res.status(400).json({ error: 'Invalid ID format', code: 'VALIDATION_ERROR' });
|
|
133
134
|
}
|
|
134
135
|
// Log internally, never expose internal details
|
|
135
|
-
logger.error({ error, userId: req.params.id },
|
|
136
|
-
return res.status(500).json({ error:
|
|
136
|
+
logger.error({ error, userId: req.params.id }, 'Failed to fetch user');
|
|
137
|
+
return res.status(500).json({ error: 'Internal server error', code: 'INTERNAL_ERROR' });
|
|
137
138
|
}
|
|
138
139
|
});
|
|
139
140
|
```
|
|
@@ -176,7 +177,7 @@ return res.json({
|
|
|
176
177
|
const user = await db.query(`SELECT * FROM users WHERE email = '${email}'`);
|
|
177
178
|
|
|
178
179
|
// ❌ Hardcoded secret
|
|
179
|
-
const JWT_SECRET =
|
|
180
|
+
const JWT_SECRET = 'mysecretkey123';
|
|
180
181
|
|
|
181
182
|
// ❌ Algorithm bypass-risk
|
|
182
183
|
jwt.verify(token, secret); // Missing: { algorithms: ['HS256'] }
|
|
@@ -187,17 +188,17 @@ await db.users.update({ where: { id }, data: req.body }); // User could set role
|
|
|
187
188
|
|
|
188
189
|
```typescript
|
|
189
190
|
// ✅ Parameterized query
|
|
190
|
-
const user = await db.execute(
|
|
191
|
+
const user = await db.execute('SELECT * FROM users WHERE email = $1', [email]);
|
|
191
192
|
|
|
192
193
|
// ✅ Environment variable
|
|
193
194
|
const JWT_SECRET =
|
|
194
195
|
process.env.JWT_SECRET ??
|
|
195
196
|
(() => {
|
|
196
|
-
throw new Error(
|
|
197
|
+
throw new Error('JWT_SECRET not set');
|
|
197
198
|
})();
|
|
198
199
|
|
|
199
200
|
// ✅ Algorithm enforced
|
|
200
|
-
jwt.verify(token, secret, { algorithms: [
|
|
201
|
+
jwt.verify(token, secret, { algorithms: ['HS256'] });
|
|
201
202
|
|
|
202
203
|
// ✅ Explicit field allowlist
|
|
203
204
|
const { name, bio } = UpdateProfileSchema.parse(req.body); // Only allowed fields
|
|
@@ -209,21 +210,21 @@ await db.users.update({ where: { id }, data: { name, bio } });
|
|
|
209
210
|
## 7. Rate Limiting — Required on All Public Endpoints
|
|
210
211
|
|
|
211
212
|
```typescript
|
|
212
|
-
import { Ratelimit } from
|
|
213
|
-
import { Redis } from
|
|
213
|
+
import { Ratelimit } from '@upstash/ratelimit';
|
|
214
|
+
import { Redis } from '@upstash/redis';
|
|
214
215
|
|
|
215
216
|
const ratelimit = new Ratelimit({
|
|
216
217
|
redis: Redis.fromEnv(),
|
|
217
|
-
limiter: Ratelimit.slidingWindow(10,
|
|
218
|
+
limiter: Ratelimit.slidingWindow(10, '10 s'), // 10 requests per 10 seconds
|
|
218
219
|
});
|
|
219
220
|
|
|
220
221
|
// Apply to every public auth endpoint at minimum
|
|
221
|
-
app.post(
|
|
222
|
-
const identifier = c.req.header(
|
|
222
|
+
app.post('/auth/login', async c => {
|
|
223
|
+
const identifier = c.req.header('CF-Connecting-IP') ?? 'anonymous';
|
|
223
224
|
const { success, remaining } = await ratelimit.limit(identifier);
|
|
224
225
|
|
|
225
226
|
if (!success) {
|
|
226
|
-
return c.json({ error:
|
|
227
|
+
return c.json({ error: 'Too many requests' }, 429);
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
// ... rest of login logic
|
|
@@ -17,6 +17,7 @@ last-updated: 2026-07-29
|
|
|
17
17
|
## Mandatory Pre-Flight Context Inspection
|
|
18
18
|
|
|
19
19
|
Before generating IaC, Dockerfiles, or CI/CD pipelines, you MUST inspect:
|
|
20
|
+
|
|
20
21
|
1. `Dockerfile` / `.dockerignore` / `.github/workflows/` / `terraform/` → Inspect existing infra declarations
|
|
21
22
|
2. `package.json` / `requirements.txt` / `Cargo.toml` → Determine runtime language, version, and build steps
|
|
22
23
|
3. Secrets & AWS IAM configuration → Verify OIDC auth setup for GitHub Actions and S3 state backend configuration
|
|
@@ -17,6 +17,7 @@ last-updated: 2026-07-29
|
|
|
17
17
|
## Mandatory Pre-Flight Context Inspection
|
|
18
18
|
|
|
19
19
|
Before auditing legacy codebases, you MUST inspect:
|
|
20
|
+
|
|
20
21
|
1. `package.json` / `requirements.txt` → Read project dependencies, deprecated library usages, and version ages
|
|
21
22
|
2. Entry point files (`server.ts`, `index.js`, `app/`) → Locate active listeners, API routers, and scheduled jobs
|
|
22
23
|
3. Test suite directory (`tests/`, `__tests__/`, `spec/`) → Check baseline test coverage before recommending refactors
|
|
@@ -21,6 +21,7 @@ You have one job: enforce the **Dependency Ladder** and prevent over-engineering
|
|
|
21
21
|
## Mandatory Pre-Flight Context Inspection
|
|
22
22
|
|
|
23
23
|
Before auditing complexity, you MUST inspect:
|
|
24
|
+
|
|
24
25
|
1. `package.json` / `requirements.txt` → Verify existing dependencies before permitting new package imports
|
|
25
26
|
2. Project directory structure → Check if similar utility functions or abstractions already exist in the codebase
|
|
26
27
|
3. Native platform features → Determine if browser/Node/Python native standard library APIs can solve the task without extra code
|
|
@@ -44,13 +45,13 @@ Before code is accepted, you must verify that the implementation sits at the low
|
|
|
44
45
|
|
|
45
46
|
## Section 1: Common Over-Engineering Patterns to Reject
|
|
46
47
|
|
|
47
|
-
| Anti-Pattern
|
|
48
|
-
|
|
|
49
|
-
| Importing `lodash` or similar utility library
|
|
50
|
-
| Custom React/Vue slider/carousel component
|
|
51
|
-
| Hand-rolling custom cryptographic / hashing utils | Prone to security vulnerabilities and bugs
|
|
52
|
-
| Elaborate helper/wrapper layers for simple APIs
|
|
53
|
-
| Adding new NPM packages for simple tasks
|
|
48
|
+
| Anti-Pattern | Why It's Rejected | Real Alternative (Lower Rung) |
|
|
49
|
+
| :------------------------------------------------ | :------------------------------------------------ | :--------------------------------------------------------- |
|
|
50
|
+
| Importing `lodash` or similar utility library | Standard library handles most collections/strings | Use native `Array.prototype` methods or modern JS features |
|
|
51
|
+
| Custom React/Vue slider/carousel component | Heavy, complex, prone to accessibility bugs | Native CSS Scroll Snap or standard platform elements |
|
|
52
|
+
| Hand-rolling custom cryptographic / hashing utils | Prone to security vulnerabilities and bugs | Use standard Node.js `crypto` or Web Crypto API |
|
|
53
|
+
| Elaborate helper/wrapper layers for simple APIs | Wastes context, adds cognitive overhead | Direct API consumption (Keep It Simple) |
|
|
54
|
+
| Adding new NPM packages for simple tasks | Bloats bundle, introduces supply-chain risk | Write a simple pure function locally |
|
|
54
55
|
|
|
55
56
|
---
|
|
56
57
|
|
|
@@ -59,9 +60,11 @@ Before code is accepted, you must verify that the implementation sits at the low
|
|
|
59
60
|
Your review should output one of two verdicts:
|
|
60
61
|
|
|
61
62
|
### 1. `✅ APPROVED`
|
|
63
|
+
|
|
62
64
|
The code is simple, uses native platform capabilities, does not introduce unnecessary dependencies, and follows the Dependency Ladder.
|
|
63
65
|
|
|
64
66
|
### 2. `❌ REJECTED`
|
|
67
|
+
|
|
65
68
|
The code is over-engineered, introduces a redundant dependency, or implements custom logic where a standard library/platform API exists. Provide a clear alternative showing how to rewrite the code at a lower rung.
|
|
66
69
|
|
|
67
70
|
---
|
|
@@ -19,6 +19,7 @@ last-updated: 2026-07-29
|
|
|
19
19
|
## Mandatory Pre-Flight Context Inspection
|
|
20
20
|
|
|
21
21
|
Before generating schemas, migrations, or database queries, you MUST inspect:
|
|
22
|
+
|
|
22
23
|
1. `schema.prisma` / `drizzle.schema.ts` / `migrations/` → Read existing database models and active migration history
|
|
23
24
|
2. `package.json` / `requirements.txt` → Check ORM version (Prisma v6 vs v5, Drizzle, SQLAlchemy) and database engine (PostgreSQL, SQLite, MySQL)
|
|
24
25
|
3. Foreign key constraints & Indexes → Check existing composite indices and foreign key constraints to prevent duplicate or missing index definitions
|
|
@@ -146,7 +147,7 @@ const user = await prisma.user.create({ data: userData });
|
|
|
146
147
|
const account = await prisma.account.create({ data: { userId: user.id } });
|
|
147
148
|
|
|
148
149
|
// ✅ ATOMIC: Both succeed or both rollback
|
|
149
|
-
const result = await prisma.$transaction(async
|
|
150
|
+
const result = await prisma.$transaction(async tx => {
|
|
150
151
|
const user = await tx.user.create({ data: userData });
|
|
151
152
|
const account = await tx.account.create({ data: { userId: user.id } });
|
|
152
153
|
return { user, account };
|
|
@@ -167,7 +168,7 @@ const users = await prisma.user.findMany({
|
|
|
167
168
|
include: {
|
|
168
169
|
posts: {
|
|
169
170
|
where: { published: true },
|
|
170
|
-
orderBy: { createdAt:
|
|
171
|
+
orderBy: { createdAt: 'desc' },
|
|
171
172
|
take: 5,
|
|
172
173
|
},
|
|
173
174
|
},
|
|
@@ -21,6 +21,7 @@ You audit **database layer files only** — `.sql`, `schema.prisma`, and source
|
|
|
21
21
|
## Mandatory Pre-Flight Context Inspection
|
|
22
22
|
|
|
23
23
|
Before auditing database latency, you MUST inspect:
|
|
24
|
+
|
|
24
25
|
1. `schema.prisma` / `drizzle.schema.ts` → Read existing model indexes, foreign key declarations, and connection pool string settings
|
|
25
26
|
2. `package.json` → Check ORM driver type (pg, postgres-js, sqlite3, @libsql/client) and pool configuration settings
|
|
26
27
|
3. Direct DB call loops → Scan for `.findMany()`, `select()`, or `.query()` executed inside loops or resolvers
|
|
@@ -70,7 +71,10 @@ for (const user of users) {
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
// ✅ APPROVED: Drizzle with join
|
|
73
|
-
const result = await db
|
|
74
|
+
const result = await db
|
|
75
|
+
.select()
|
|
76
|
+
.from(usersTable)
|
|
77
|
+
.leftJoin(ordersTable, eq(usersTable.id, ordersTable.userId));
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
---
|
|
@@ -177,7 +181,7 @@ if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
|
|
177
181
|
|
|
178
182
|
```typescript
|
|
179
183
|
// ❌ OVER-SCOPED TRANSACTION: Lock held during external API call
|
|
180
|
-
await prisma.$transaction(async
|
|
184
|
+
await prisma.$transaction(async tx => {
|
|
181
185
|
const order = await tx.order.create({ data: orderData });
|
|
182
186
|
const payment = await stripe.charges.create({ amount: order.total }); // 2-5 sec external call!
|
|
183
187
|
await tx.order.update({ where: { id: order.id }, data: { paymentId: payment.id } });
|
|
@@ -16,6 +16,7 @@ last-updated: 2026-07-29
|
|
|
16
16
|
## Mandatory Pre-Flight Context Inspection
|
|
17
17
|
|
|
18
18
|
Before beginning a debugging session, you MUST inspect:
|
|
19
|
+
|
|
19
20
|
1. Exact error logs / stack trace output → Read full un-truncated error traceback and exception frames
|
|
20
21
|
2. Git status / recent commits (`git log -n 5`) → Identify recent changes, file edits, or dependency updates
|
|
21
22
|
3. Runtime environment configs (`package.json`, `.env.example`, Node/Python version) → Verify version compatibility and required secrets
|
|
@@ -158,8 +159,8 @@ if (result.name) {
|
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
// Error swallowed — exception disappears
|
|
161
|
-
fetch(
|
|
162
|
-
.then(
|
|
162
|
+
fetch('/api')
|
|
163
|
+
.then(r => r.json())
|
|
163
164
|
.catch(() => {}); // Error silently discarded
|
|
164
165
|
|
|
165
166
|
// Promise in useEffect without cleanup
|
|
@@ -18,6 +18,7 @@ You are the last line of defense against fabricated dependencies. An AI model wi
|
|
|
18
18
|
## Mandatory Pre-Flight Context Inspection
|
|
19
19
|
|
|
20
20
|
Before auditing package imports, you MUST inspect:
|
|
21
|
+
|
|
21
22
|
1. `package.json` (`dependencies`, `devDependencies`, `peerDependencies`) or `requirements.txt` / `pyproject.toml`
|
|
22
23
|
2. `node_modules` structure or import maps (if present)
|
|
23
24
|
3. Framework sub-package export maps (e.g. Next.js 15 subpath exports `@tanstack/react-query`, `lucide-react`, `framer-motion`)
|
|
@@ -21,6 +21,7 @@ last-updated: 2026-07-29
|
|
|
21
21
|
## Mandatory Pre-Flight Context Inspection
|
|
22
22
|
|
|
23
23
|
Before generating DevOps pipelines or infrastructure manifests, you MUST inspect:
|
|
24
|
+
|
|
24
25
|
1. `Dockerfile` / `.github/workflows/` / `k8s/` → Review existing CI/CD automation and container configurations
|
|
25
26
|
2. `package.json` / runtime dependency lockfiles → Inspect Node/Python version, build commands, and script targets
|
|
26
27
|
3. Production deployment targets → Verify GitOps setup (ArgoCD vs GitHub Actions vs Terraform) and cluster readiness probes
|
|
@@ -100,8 +101,8 @@ jobs:
|
|
|
100
101
|
- name: Setup Node
|
|
101
102
|
uses: actions/setup-node@v4
|
|
102
103
|
with:
|
|
103
|
-
node-version:
|
|
104
|
-
cache:
|
|
104
|
+
node-version: '22'
|
|
105
|
+
cache: 'npm'
|
|
105
106
|
|
|
106
107
|
- run: npm ci
|
|
107
108
|
- run: npm run type-check # tsc --noEmit
|
|
@@ -141,11 +142,11 @@ metadata:
|
|
|
141
142
|
spec:
|
|
142
143
|
project: default
|
|
143
144
|
source:
|
|
144
|
-
repoURL:
|
|
145
|
+
repoURL: 'https://github.com/mycorp/k8s-manifests'
|
|
145
146
|
path: apps/api-service
|
|
146
147
|
targetRevision: HEAD
|
|
147
148
|
destination:
|
|
148
|
-
server:
|
|
149
|
+
server: 'https://kubernetes.default.svc'
|
|
149
150
|
namespace: production
|
|
150
151
|
syncPolicy:
|
|
151
152
|
automated:
|
|
@@ -189,11 +190,11 @@ spec:
|
|
|
189
190
|
# Resource limits — ALWAYS set in production
|
|
190
191
|
resources:
|
|
191
192
|
requests:
|
|
192
|
-
memory:
|
|
193
|
-
cpu:
|
|
193
|
+
memory: '128Mi'
|
|
194
|
+
cpu: '100m'
|
|
194
195
|
limits:
|
|
195
|
-
memory:
|
|
196
|
-
cpu:
|
|
196
|
+
memory: '512Mi'
|
|
197
|
+
cpu: '500m'
|
|
197
198
|
```
|
|
198
199
|
|
|
199
200
|
---
|