tribunal-kit 9.0.1 → 9.2.1
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/agents/backend-specialist.md +1 -1
- package/.agent/agents/code-archaeologist.md +1 -1
- package/.agent/agents/database-architect.md +1 -1
- package/.agent/agents/debugger.md +1 -1
- package/.agent/agents/devops-engineer.md +1 -1
- package/.agent/agents/documentation-writer.md +1 -1
- package/.agent/agents/explorer-agent.md +1 -1
- package/.agent/agents/game-developer.md +1 -1
- package/.agent/agents/minimalist-reviewer.md +1 -1
- package/.agent/agents/mobile-developer.md +1 -1
- package/.agent/agents/orchestrator.md +42 -2
- package/.agent/agents/penetration-tester.md +1 -1
- package/.agent/agents/performance-optimizer.md +1 -1
- package/.agent/agents/product-manager.md +1 -1
- package/.agent/agents/product-owner.md +1 -1
- package/.agent/agents/project-planner.md +1 -1
- package/.agent/agents/qa-automation-engineer.md +1 -1
- package/.agent/agents/seo-specialist.md +1 -1
- package/.agent/agents/test-engineer.md +1 -1
- package/.agent/routing_index.json +265 -1530
- package/.agent/scripts/browser_audit.js +13 -5
- package/.agent/scripts/bundle_analyzer.js +7 -3
- package/.agent/scripts/dependency_analyzer.js +16 -16
- package/.agent/scripts/inner_loop_validator.js +1 -1
- package/.agent/scripts/payload_schemas.js +18 -0
- package/.agent/scripts/pipeline_engine.js +3 -2
- package/.agent/scripts/schema_validator.js +2 -1
- package/.agent/scripts/swarm_dispatcher.js +29 -2
- package/.agent/scripts/test_runner.js +1 -2
- package/.agent/skills/12-principles-of-animation/SKILL.md +21 -21
- package/.agent/skills/60fps-animation/SKILL.md +24 -22
- package/.agent/skills/accessible-animation/SKILL.md +29 -31
- package/.agent/skills/adapt/SKILL.md +21 -21
- package/.agent/skills/advanced-rag-pipelines/SKILL.md +21 -21
- package/.agent/skills/agent-organizer/SKILL.md +21 -21
- package/.agent/skills/agentic-patterns/SKILL.md +21 -21
- package/.agent/skills/agentic-workflows-2026/SKILL.md +21 -20
- package/.agent/skills/ai-app-hardening/SKILL.md +21 -20
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +21 -21
- package/.agent/skills/animation-on-scroll/SKILL.md +36 -32
- package/.agent/skills/animation-systems/SKILL.md +35 -35
- package/.agent/skills/antfu-conventions/SKILL.md +21 -21
- package/.agent/skills/api-patterns/SKILL.md +21 -21
- package/.agent/skills/api-security-auditor/SKILL.md +21 -21
- package/.agent/skills/app-builder/SKILL.md +21 -21
- package/.agent/skills/appflow-wireframe/SKILL.md +21 -23
- package/.agent/skills/apple-design/SKILL.md +21 -21
- package/.agent/skills/architecture/SKILL.md +21 -21
- package/.agent/skills/audit-and-fix/SKILL.md +21 -21
- package/.agent/skills/authentication-best-practices/SKILL.md +21 -21
- package/.agent/skills/backend-security-expert/SKILL.md +21 -21
- package/.agent/skills/baseline-ui/SKILL.md +21 -21
- package/.agent/skills/bash-linux/SKILL.md +20 -20
- package/.agent/skills/behavioral-modes/SKILL.md +21 -21
- package/.agent/skills/better-colors/SKILL.md +21 -21
- package/.agent/skills/better-typography/SKILL.md +21 -20
- package/.agent/skills/better-ui/SKILL.md +38 -26
- package/.agent/skills/bolder/SKILL.md +21 -21
- package/.agent/skills/brainstorming/SKILL.md +21 -20
- package/.agent/skills/browser-audit/SKILL.md +35 -28
- package/.agent/skills/browser-native-ai/SKILL.md +21 -21
- package/.agent/skills/build-primitive/SKILL.md +21 -21
- package/.agent/skills/building-native-ui/SKILL.md +21 -21
- package/.agent/skills/cicd-pro/SKILL.md +20 -20
- package/.agent/skills/clarify/SKILL.md +21 -21
- package/.agent/skills/clean-code/SKILL.md +21 -21
- package/.agent/skills/cloud-architect/SKILL.md +20 -20
- package/.agent/skills/cobejs/SKILL.md +21 -21
- package/.agent/skills/code-review-checklist/SKILL.md +21 -21
- package/.agent/skills/codebase-design/SKILL.md +21 -21
- package/.agent/skills/colorize/SKILL.md +21 -21
- package/.agent/skills/compact-landing/SKILL.md +21 -21
- package/.agent/skills/company-logos/SKILL.md +21 -21
- package/.agent/skills/config-validator/SKILL.md +21 -21
- package/.agent/skills/containerization-pro/SKILL.md +20 -20
- package/.agent/skills/context-engineering-pro/SKILL.md +21 -20
- package/.agent/skills/create-design-md/SKILL.md +21 -21
- package/.agent/skills/critique/SKILL.md +21 -21
- package/.agent/skills/csharp-developer/SKILL.md +21 -21
- package/.agent/skills/data-validation-schemas/SKILL.md +21 -21
- package/.agent/skills/database-design/SKILL.md +21 -21
- package/.agent/skills/delight/SKILL.md +21 -21
- package/.agent/skills/deployment-procedures/SKILL.md +20 -20
- package/.agent/skills/design-lab/SKILL.md +22 -22
- package/.agent/skills/devops-engineer/SKILL.md +20 -20
- package/.agent/skills/devops-incident-responder/SKILL.md +20 -20
- package/.agent/skills/diagnosing-bugs/SKILL.md +22 -22
- package/.agent/skills/distill/SKILL.md +21 -21
- package/.agent/skills/documentation-templates/SKILL.md +21 -21
- package/.agent/skills/domain-modeling/SKILL.md +21 -21
- package/.agent/skills/duckdb-analytical-sql/SKILL.md +21 -20
- package/.agent/skills/edge-ai-mobile/SKILL.md +21 -20
- package/.agent/skills/edge-computing/SKILL.md +21 -21
- package/.agent/skills/emil-design-eng/SKILL.md +21 -21
- package/.agent/skills/error-resilience/SKILL.md +21 -21
- package/.agent/skills/expo-router-v4/SKILL.md +21 -20
- package/.agent/skills/extract-design-system/SKILL.md +21 -21
- package/.agent/skills/fabel-protocol/SKILL.md +21 -21
- package/.agent/skills/fixing-accessibility/SKILL.md +21 -21
- package/.agent/skills/fixing-metadata/SKILL.md +21 -21
- package/.agent/skills/fixing-motion-performance/SKILL.md +21 -21
- package/.agent/skills/framer-motion-expert/SKILL.md +21 -21
- package/.agent/skills/frontend-design/SKILL.md +21 -21
- package/.agent/skills/frontend-security-expert/SKILL.md +21 -21
- package/.agent/skills/game-design-expert/SKILL.md +21 -21
- package/.agent/skills/game-engineering-expert/SKILL.md +21 -21
- package/.agent/skills/generative-ui-expert/SKILL.md +21 -21
- package/.agent/skills/geo-fundamentals/SKILL.md +21 -21
- package/.agent/skills/git-pro/SKILL.md +21 -21
- package/.agent/skills/github-operations/SKILL.md +21 -21
- package/.agent/skills/gpt-taste/SKILL.md +21 -21
- package/.agent/skills/gsap-core/SKILL.md +21 -21
- package/.agent/skills/gsap-frameworks/SKILL.md +21 -21
- package/.agent/skills/gsap-performance/SKILL.md +21 -21
- package/.agent/skills/gsap-plugins/SKILL.md +21 -21
- package/.agent/skills/gsap-react/SKILL.md +21 -21
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +21 -21
- package/.agent/skills/gsap-timeline/SKILL.md +21 -21
- package/.agent/skills/gsap-utils/SKILL.md +21 -21
- package/.agent/skills/harden/SKILL.md +21 -21
- package/.agent/skills/harness-protocol/SKILL.md +21 -21
- package/.agent/skills/i18n-localization/SKILL.md +21 -21
- package/.agent/skills/impeccable/SKILL.md +21 -21
- package/.agent/skills/improve-codebase-architecture/SKILL.md +21 -21
- package/.agent/skills/improve-ui/SKILL.md +21 -21
- package/.agent/skills/intelligent-routing/SKILL.md +21 -20
- package/.agent/skills/knowledge-graph/SKILL.md +21 -21
- package/.agent/skills/landing-page/SKILL.md +21 -21
- package/.agent/skills/lint-and-validate/SKILL.md +21 -21
- package/.agent/skills/llm-engineering/SKILL.md +21 -21
- package/.agent/skills/local-first/SKILL.md +21 -21
- package/.agent/skills/local-first-architecture/SKILL.md +21 -21
- package/.agent/skills/lottie-animation/SKILL.md +21 -21
- package/.agent/skills/marquee-loop/SKILL.md +21 -21
- package/.agent/skills/masked-reveal/SKILL.md +21 -21
- package/.agent/skills/mcp-builder/SKILL.md +21 -21
- package/.agent/skills/micro-interaction/SKILL.md +39 -32
- package/.agent/skills/mobile-design/SKILL.md +21 -21
- package/.agent/skills/monorepo-management/SKILL.md +21 -21
- package/.agent/skills/morphing-icons/SKILL.md +21 -21
- package/.agent/skills/motion-engineering/SKILL.md +21 -21
- package/.agent/skills/nextjs-react-expert/SKILL.md +21 -21
- package/.agent/skills/nodejs-best-practices/SKILL.md +21 -21
- package/.agent/skills/observability/SKILL.md +21 -21
- package/.agent/skills/opentelemetry-observability/SKILL.md +20 -19
- package/.agent/skills/page-transition-animation/SKILL.md +21 -21
- package/.agent/skills/parallel-agents/SKILL.md +21 -21
- package/.agent/skills/performance-profiling/SKILL.md +21 -21
- package/.agent/skills/plan-writing/SKILL.md +21 -21
- package/.agent/skills/platform-engineer/SKILL.md +20 -20
- package/.agent/skills/platform-engineering-opentofu/SKILL.md +20 -19
- package/.agent/skills/playwright-ai-e2e/SKILL.md +21 -20
- package/.agent/skills/playwright-best-practices/SKILL.md +21 -21
- package/.agent/skills/polish/SKILL.md +21 -21
- package/.agent/skills/powershell-windows/SKILL.md +20 -20
- package/.agent/skills/pricing-page/SKILL.md +21 -21
- package/.agent/skills/product-aware-heuristics/SKILL.md +21 -21
- package/.agent/skills/progressive-blur/SKILL.md +21 -21
- package/.agent/skills/project-idioms/SKILL.md +21 -21
- package/.agent/skills/property-based-testing/SKILL.md +21 -20
- package/.agent/skills/python-patterns/SKILL.md +21 -21
- package/.agent/skills/python-pro/SKILL.md +21 -21
- package/.agent/skills/quieter/SKILL.md +21 -21
- package/.agent/skills/react-doctor/SKILL.md +21 -21
- package/.agent/skills/react-specialist/SKILL.md +21 -21
- package/.agent/skills/readme-builder/SKILL.md +21 -21
- package/.agent/skills/realtime-patterns/SKILL.md +21 -21
- package/.agent/skills/red-team-tactics/SKILL.md +21 -21
- package/.agent/skills/redesign-skill/SKILL.md +21 -21
- package/.agent/skills/review-animations/SKILL.md +21 -21
- package/.agent/skills/rust-pro/SKILL.md +21 -21
- package/.agent/skills/seo-fundamentals/SKILL.md +21 -21
- package/.agent/skills/server-management/SKILL.md +20 -20
- package/.agent/skills/shadcn-ui-expert/SKILL.md +21 -21
- package/.agent/skills/shape/SKILL.md +21 -21
- package/.agent/skills/skill-creator/SKILL.md +28 -21
- package/.agent/skills/soft-skill/SKILL.md +21 -21
- package/.agent/skills/sounds-on-the-web/SKILL.md +21 -21
- package/.agent/skills/sql-pro/SKILL.md +21 -21
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +21 -21
- package/.agent/skills/svg-animation/SKILL.md +21 -21
- package/.agent/skills/swiftui-expert/SKILL.md +21 -21
- package/.agent/skills/swiss-design/SKILL.md +21 -21
- package/.agent/skills/system-design-pro/SKILL.md +21 -21
- package/.agent/skills/systematic-debugging/SKILL.md +22 -21
- package/.agent/skills/systematic-debugging/condition-based-waiting.md +14 -9
- package/.agent/skills/systematic-debugging/defense-in-depth.md +9 -3
- package/.agent/skills/systematic-debugging/root-cause-tracing.md +14 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +21 -21
- package/.agent/skills/taste-skill/SKILL.md +21 -21
- package/.agent/skills/tdd-workflow/SKILL.md +28 -27
- package/.agent/skills/test-result-analyzer/SKILL.md +21 -21
- package/.agent/skills/testing-patterns/SKILL.md +21 -21
- package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +21 -21
- package/.agent/skills/thinking-protocol/SKILL.md +21 -20
- package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +21 -21
- package/.agent/skills/transitions-dev/SKILL.md +21 -21
- package/.agent/skills/trend-researcher/SKILL.md +21 -21
- package/.agent/skills/typescript-advanced/SKILL.md +21 -21
- package/.agent/skills/typeset/SKILL.md +21 -21
- package/.agent/skills/ui-reasoning-engine/SKILL.md +21 -21
- package/.agent/skills/ui-skill-packs/SKILL.md +21 -21
- package/.agent/skills/ui-skills-root/SKILL.md +21 -21
- package/.agent/skills/ui-ux-pro-max/SKILL.md +21 -21
- package/.agent/skills/ui-ux-researcher/SKILL.md +21 -21
- package/.agent/skills/vector-search-pgvector/SKILL.md +21 -20
- package/.agent/skills/verification-before-completion/SKILL.md +40 -36
- package/.agent/skills/vue-expert/SKILL.md +21 -21
- package/.agent/skills/vulnerability-scanner/SKILL.md +21 -21
- package/.agent/skills/web-accessibility-auditor/SKILL.md +21 -21
- package/.agent/skills/web-design-guidelines/SKILL.md +21 -21
- package/.agent/skills/web-quality-audit/SKILL.md +21 -21
- package/.agent/skills/webapp-testing/SKILL.md +21 -21
- package/.agent/skills/webgpu-performance/SKILL.md +21 -21
- package/.agent/skills/whimsy-injector/SKILL.md +21 -21
- package/.agent/skills/workflow-optimizer/SKILL.md +21 -21
- package/.agent/skills/zero-trust-passkeys/SKILL.md +21 -20
- package/.agent/templates/DESIGN.md +312 -290
- package/.agent/templates/sdd/task-reviewer-prompt.md +2 -2
- package/.agent/workflows/audit-live.md +4 -3
- package/.agent/workflows/brainstorm.md +1 -0
- package/.agent/workflows/context.md +9 -7
- package/.agent/workflows/minimal.md +3 -2
- package/.agent/workflows/plan.md +1 -1
- package/.agent/workflows/sdd.md +15 -0
- package/.agent/workflows/skill-enhancement-engine.md +11 -11
- package/.agent/workflows/super-prompt.md +25 -24
- package/.agents/skills/12-principles-of-animation/SKILL.md +21 -21
- package/.agents/skills/60fps-animation/SKILL.md +24 -22
- package/.agents/skills/accessible-animation/SKILL.md +29 -31
- package/.agents/skills/adapt/SKILL.md +21 -21
- package/.agents/skills/advanced-rag-pipelines/SKILL.md +21 -21
- package/.agents/skills/agent-organizer/SKILL.md +21 -21
- package/.agents/skills/agentic-patterns/SKILL.md +21 -21
- package/.agents/skills/agentic-workflows-2026/SKILL.md +21 -20
- package/.agents/skills/ai-app-hardening/SKILL.md +21 -20
- package/.agents/skills/ai-prompt-injection-defense/SKILL.md +21 -21
- package/.agents/skills/animation-on-scroll/SKILL.md +36 -32
- package/.agents/skills/animation-systems/SKILL.md +35 -35
- package/.agents/skills/antfu-conventions/SKILL.md +21 -21
- package/.agents/skills/api-patterns/SKILL.md +21 -21
- package/.agents/skills/api-security-auditor/SKILL.md +21 -21
- package/.agents/skills/app-builder/SKILL.md +21 -21
- package/.agents/skills/appflow-wireframe/SKILL.md +21 -23
- package/.agents/skills/apple-design/SKILL.md +21 -21
- package/.agents/skills/architecture/SKILL.md +21 -21
- package/.agents/skills/audit-and-fix/SKILL.md +21 -21
- package/.agents/skills/authentication-best-practices/SKILL.md +21 -21
- package/.agents/skills/backend-security-expert/SKILL.md +21 -21
- package/.agents/skills/baseline-ui/SKILL.md +21 -21
- package/.agents/skills/bash-linux/SKILL.md +20 -20
- package/.agents/skills/behavioral-modes/SKILL.md +21 -21
- package/.agents/skills/better-colors/SKILL.md +21 -21
- package/.agents/skills/better-typography/SKILL.md +21 -20
- package/.agents/skills/better-ui/SKILL.md +38 -26
- package/.agents/skills/bolder/SKILL.md +21 -21
- package/.agents/skills/brainstorming/SKILL.md +21 -20
- package/.agents/skills/browser-audit/SKILL.md +35 -28
- package/.agents/skills/browser-native-ai/SKILL.md +21 -21
- package/.agents/skills/build-primitive/SKILL.md +21 -21
- package/.agents/skills/building-native-ui/SKILL.md +21 -21
- package/.agents/skills/cicd-pro/SKILL.md +20 -20
- package/.agents/skills/clarify/SKILL.md +21 -21
- package/.agents/skills/clean-code/SKILL.md +21 -21
- package/.agents/skills/cloud-architect/SKILL.md +20 -20
- package/.agents/skills/cobejs/SKILL.md +21 -21
- package/.agents/skills/code-review-checklist/SKILL.md +21 -21
- package/.agents/skills/codebase-design/SKILL.md +21 -21
- package/.agents/skills/colorize/SKILL.md +21 -21
- package/.agents/skills/compact-landing/SKILL.md +21 -21
- package/.agents/skills/company-logos/SKILL.md +21 -21
- package/.agents/skills/config-validator/SKILL.md +21 -21
- package/.agents/skills/containerization-pro/SKILL.md +20 -20
- package/.agents/skills/context-engineering-pro/SKILL.md +21 -20
- package/.agents/skills/create-design-md/SKILL.md +21 -21
- package/.agents/skills/critique/SKILL.md +21 -21
- package/.agents/skills/csharp-developer/SKILL.md +21 -21
- package/.agents/skills/data-validation-schemas/SKILL.md +21 -21
- package/.agents/skills/database-design/SKILL.md +21 -21
- package/.agents/skills/delight/SKILL.md +21 -21
- package/.agents/skills/deployment-procedures/SKILL.md +20 -20
- package/.agents/skills/design-lab/SKILL.md +22 -22
- package/.agents/skills/devops-engineer/SKILL.md +20 -20
- package/.agents/skills/devops-incident-responder/SKILL.md +20 -20
- package/.agents/skills/diagnosing-bugs/SKILL.md +22 -22
- package/.agents/skills/distill/SKILL.md +21 -21
- package/.agents/skills/documentation-templates/SKILL.md +21 -21
- package/.agents/skills/domain-modeling/SKILL.md +21 -21
- package/.agents/skills/duckdb-analytical-sql/SKILL.md +21 -20
- package/.agents/skills/edge-ai-mobile/SKILL.md +21 -20
- package/.agents/skills/edge-computing/SKILL.md +21 -21
- package/.agents/skills/emil-design-eng/SKILL.md +21 -21
- package/.agents/skills/error-resilience/SKILL.md +21 -21
- package/.agents/skills/expo-router-v4/SKILL.md +21 -20
- package/.agents/skills/extract-design-system/SKILL.md +21 -21
- package/.agents/skills/fabel-protocol/SKILL.md +21 -21
- package/.agents/skills/fixing-accessibility/SKILL.md +21 -21
- package/.agents/skills/fixing-metadata/SKILL.md +21 -21
- package/.agents/skills/fixing-motion-performance/SKILL.md +21 -21
- package/.agents/skills/framer-motion-expert/SKILL.md +21 -21
- package/.agents/skills/frontend-design/SKILL.md +21 -21
- package/.agents/skills/frontend-security-expert/SKILL.md +21 -21
- package/.agents/skills/game-design-expert/SKILL.md +21 -21
- package/.agents/skills/game-engineering-expert/SKILL.md +21 -21
- package/.agents/skills/generative-ui-expert/SKILL.md +21 -21
- package/.agents/skills/geo-fundamentals/SKILL.md +21 -21
- package/.agents/skills/git-pro/SKILL.md +21 -21
- package/.agents/skills/github-operations/SKILL.md +21 -21
- package/.agents/skills/gpt-taste/SKILL.md +21 -21
- package/.agents/skills/gsap-core/SKILL.md +21 -21
- package/.agents/skills/gsap-frameworks/SKILL.md +21 -21
- package/.agents/skills/gsap-performance/SKILL.md +21 -21
- package/.agents/skills/gsap-plugins/SKILL.md +21 -21
- package/.agents/skills/gsap-react/SKILL.md +21 -21
- package/.agents/skills/gsap-scrolltrigger/SKILL.md +21 -21
- package/.agents/skills/gsap-timeline/SKILL.md +21 -21
- package/.agents/skills/gsap-utils/SKILL.md +21 -21
- package/.agents/skills/harden/SKILL.md +21 -21
- package/.agents/skills/harness-protocol/SKILL.md +21 -21
- package/.agents/skills/i18n-localization/SKILL.md +21 -21
- package/.agents/skills/impeccable/SKILL.md +21 -21
- package/.agents/skills/improve-codebase-architecture/SKILL.md +21 -21
- package/.agents/skills/improve-ui/SKILL.md +21 -21
- package/.agents/skills/intelligent-routing/SKILL.md +21 -20
- package/.agents/skills/knowledge-graph/SKILL.md +21 -21
- package/.agents/skills/landing-page/SKILL.md +21 -21
- package/.agents/skills/lint-and-validate/SKILL.md +21 -21
- package/.agents/skills/llm-engineering/SKILL.md +21 -21
- package/.agents/skills/local-first/SKILL.md +21 -21
- package/.agents/skills/local-first-architecture/SKILL.md +21 -21
- package/.agents/skills/lottie-animation/SKILL.md +21 -21
- package/.agents/skills/marquee-loop/SKILL.md +21 -21
- package/.agents/skills/masked-reveal/SKILL.md +21 -21
- package/.agents/skills/mcp-builder/SKILL.md +21 -21
- package/.agents/skills/micro-interaction/SKILL.md +39 -32
- package/.agents/skills/mobile-design/SKILL.md +21 -21
- package/.agents/skills/monorepo-management/SKILL.md +21 -21
- package/.agents/skills/morphing-icons/SKILL.md +21 -21
- package/.agents/skills/motion-engineering/SKILL.md +21 -21
- package/.agents/skills/nextjs-react-expert/SKILL.md +21 -21
- package/.agents/skills/nodejs-best-practices/SKILL.md +21 -21
- package/.agents/skills/observability/SKILL.md +21 -21
- package/.agents/skills/opentelemetry-observability/SKILL.md +20 -19
- package/.agents/skills/page-transition-animation/SKILL.md +21 -21
- package/.agents/skills/parallel-agents/SKILL.md +21 -21
- package/.agents/skills/performance-profiling/SKILL.md +21 -21
- package/.agents/skills/plan-writing/SKILL.md +21 -21
- package/.agents/skills/platform-engineer/SKILL.md +20 -20
- package/.agents/skills/platform-engineering-opentofu/SKILL.md +20 -19
- package/.agents/skills/playwright-ai-e2e/SKILL.md +21 -20
- package/.agents/skills/playwright-best-practices/SKILL.md +21 -21
- package/.agents/skills/polish/SKILL.md +21 -21
- package/.agents/skills/powershell-windows/SKILL.md +20 -20
- package/.agents/skills/pricing-page/SKILL.md +21 -21
- package/.agents/skills/product-aware-heuristics/SKILL.md +21 -21
- package/.agents/skills/progressive-blur/SKILL.md +21 -21
- package/.agents/skills/project-idioms/SKILL.md +21 -21
- package/.agents/skills/property-based-testing/SKILL.md +21 -20
- package/.agents/skills/python-patterns/SKILL.md +21 -21
- package/.agents/skills/python-pro/SKILL.md +21 -21
- package/.agents/skills/quieter/SKILL.md +21 -21
- package/.agents/skills/react-doctor/SKILL.md +21 -21
- package/.agents/skills/react-specialist/SKILL.md +21 -21
- package/.agents/skills/readme-builder/SKILL.md +21 -21
- package/.agents/skills/realtime-patterns/SKILL.md +21 -21
- package/.agents/skills/red-team-tactics/SKILL.md +21 -21
- package/.agents/skills/redesign-skill/SKILL.md +21 -21
- package/.agents/skills/review-animations/SKILL.md +21 -21
- package/.agents/skills/rust-pro/SKILL.md +21 -21
- package/.agents/skills/seo-fundamentals/SKILL.md +21 -21
- package/.agents/skills/server-management/SKILL.md +20 -20
- package/.agents/skills/shadcn-ui-expert/SKILL.md +21 -21
- package/.agents/skills/shape/SKILL.md +21 -21
- package/.agents/skills/skill-creator/SKILL.md +28 -21
- package/.agents/skills/soft-skill/SKILL.md +21 -21
- package/.agents/skills/sounds-on-the-web/SKILL.md +21 -21
- package/.agents/skills/sql-pro/SKILL.md +21 -21
- package/.agents/skills/supabase-postgres-best-practices/SKILL.md +21 -21
- package/.agents/skills/svg-animation/SKILL.md +21 -21
- package/.agents/skills/swiftui-expert/SKILL.md +21 -21
- package/.agents/skills/swiss-design/SKILL.md +21 -21
- package/.agents/skills/system-design-pro/SKILL.md +21 -21
- package/.agents/skills/systematic-debugging/SKILL.md +22 -21
- package/.agents/skills/systematic-debugging/condition-based-waiting.md +14 -9
- package/.agents/skills/systematic-debugging/defense-in-depth.md +9 -3
- package/.agents/skills/systematic-debugging/root-cause-tracing.md +14 -0
- package/.agents/skills/tailwind-patterns/SKILL.md +21 -21
- package/.agents/skills/taste-skill/SKILL.md +21 -21
- package/.agents/skills/tdd-workflow/SKILL.md +28 -27
- package/.agents/skills/test-result-analyzer/SKILL.md +21 -21
- package/.agents/skills/testing-patterns/SKILL.md +21 -21
- package/.agents/skills/thermo-nuclear-code-quality-review/SKILL.md +21 -21
- package/.agents/skills/thinking-protocol/SKILL.md +21 -20
- package/.agents/skills/to-spring-or-not-to-spring/SKILL.md +21 -21
- package/.agents/skills/transitions-dev/SKILL.md +21 -21
- package/.agents/skills/trend-researcher/SKILL.md +21 -21
- package/.agents/skills/typescript-advanced/SKILL.md +21 -21
- package/.agents/skills/typeset/SKILL.md +21 -21
- package/.agents/skills/ui-reasoning-engine/SKILL.md +21 -21
- package/.agents/skills/ui-skill-packs/SKILL.md +21 -21
- package/.agents/skills/ui-skills-root/SKILL.md +21 -21
- package/.agents/skills/ui-ux-pro-max/SKILL.md +21 -21
- package/.agents/skills/ui-ux-researcher/SKILL.md +21 -21
- package/.agents/skills/vector-search-pgvector/SKILL.md +21 -20
- package/.agents/skills/verification-before-completion/SKILL.md +40 -36
- package/.agents/skills/vue-expert/SKILL.md +21 -21
- package/.agents/skills/vulnerability-scanner/SKILL.md +21 -21
- package/.agents/skills/web-accessibility-auditor/SKILL.md +21 -21
- package/.agents/skills/web-design-guidelines/SKILL.md +21 -21
- package/.agents/skills/web-quality-audit/SKILL.md +21 -21
- package/.agents/skills/webapp-testing/SKILL.md +21 -21
- package/.agents/skills/webgpu-performance/SKILL.md +21 -21
- package/.agents/skills/whimsy-injector/SKILL.md +21 -21
- package/.agents/skills/workflow-optimizer/SKILL.md +21 -21
- package/.agents/skills/zero-trust-passkeys/SKILL.md +21 -20
- package/.codex-plugin/plugin.json +1 -5
- package/.kimi-plugin/plugin.json +1 -5
- package/.opencode/INSTALL.md +1 -0
- package/.opencode/plugins/tribunal.js +15 -6
- package/.pi/extensions/tribunal.ts +26 -29
- package/AGENTS.md +15 -13
- package/CLAUDE.md +3 -1
- package/README.md +542 -535
- package/bin/adapter-install.js +263 -263
- package/bin/mcp-server.js +17 -12
- package/bin/wrapper.js +12 -1
- package/dist/tui/banner.js +77 -77
- package/gemini-extension.json +1 -1
- package/package.json +176 -176
- package/plugin.json +1 -1
- package/scripts/apply-version.js +57 -0
- package/scripts/audit_skill_sdo.js +6 -4
- package/scripts/context_compiler.js +207 -83
- package/scripts/modernize_skills.js +25 -11
- package/scripts/package-cores.js +4 -1
- package/scripts/skill_enhancement_engine.js +211 -50
- package/scripts/telemetry_gc.js +154 -0
- package/skills/12-principles-of-animation/SKILL.md +21 -21
- package/skills/60fps-animation/SKILL.md +24 -22
- package/skills/accessible-animation/SKILL.md +29 -31
- package/skills/adapt/SKILL.md +21 -21
- package/skills/advanced-rag-pipelines/SKILL.md +21 -21
- package/skills/agent-organizer/SKILL.md +21 -21
- package/skills/agentic-patterns/SKILL.md +21 -21
- package/skills/agentic-workflows-2026/SKILL.md +21 -20
- package/skills/ai-app-hardening/SKILL.md +21 -20
- package/skills/ai-prompt-injection-defense/SKILL.md +21 -21
- package/skills/animation-on-scroll/SKILL.md +36 -32
- package/skills/animation-systems/SKILL.md +35 -35
- package/skills/antfu-conventions/SKILL.md +21 -21
- package/skills/api-patterns/SKILL.md +21 -21
- package/skills/api-security-auditor/SKILL.md +21 -21
- package/skills/app-builder/SKILL.md +21 -21
- package/skills/appflow-wireframe/SKILL.md +21 -23
- package/skills/apple-design/SKILL.md +21 -21
- package/skills/architecture/SKILL.md +21 -21
- package/skills/audit-and-fix/SKILL.md +21 -21
- package/skills/authentication-best-practices/SKILL.md +21 -21
- package/skills/backend-security-expert/SKILL.md +21 -21
- package/skills/baseline-ui/SKILL.md +21 -21
- package/skills/bash-linux/SKILL.md +20 -20
- package/skills/behavioral-modes/SKILL.md +21 -21
- package/skills/better-colors/SKILL.md +21 -21
- package/skills/better-typography/SKILL.md +21 -20
- package/skills/better-ui/SKILL.md +38 -26
- package/skills/bolder/SKILL.md +21 -21
- package/skills/brainstorming/SKILL.md +21 -20
- package/skills/browser-audit/SKILL.md +35 -28
- package/skills/browser-native-ai/SKILL.md +21 -21
- package/skills/build-primitive/SKILL.md +21 -21
- package/skills/building-native-ui/SKILL.md +21 -21
- package/skills/cicd-pro/SKILL.md +20 -20
- package/skills/clarify/SKILL.md +21 -21
- package/skills/clean-code/SKILL.md +21 -21
- package/skills/cloud-architect/SKILL.md +20 -20
- package/skills/cobejs/SKILL.md +21 -21
- package/skills/code-review-checklist/SKILL.md +21 -21
- package/skills/codebase-design/SKILL.md +21 -21
- package/skills/colorize/SKILL.md +21 -21
- package/skills/compact-landing/SKILL.md +21 -21
- package/skills/company-logos/SKILL.md +21 -21
- package/skills/config-validator/SKILL.md +21 -21
- package/skills/containerization-pro/SKILL.md +20 -20
- package/skills/context-engineering-pro/SKILL.md +21 -20
- package/skills/create-design-md/SKILL.md +21 -21
- package/skills/critique/SKILL.md +21 -21
- package/skills/csharp-developer/SKILL.md +21 -21
- package/skills/data-validation-schemas/SKILL.md +21 -21
- package/skills/database-design/SKILL.md +21 -21
- package/skills/delight/SKILL.md +21 -21
- package/skills/deployment-procedures/SKILL.md +20 -20
- package/skills/design-lab/SKILL.md +22 -22
- package/skills/devops-engineer/SKILL.md +20 -20
- package/skills/devops-incident-responder/SKILL.md +20 -20
- package/skills/diagnosing-bugs/SKILL.md +22 -22
- package/skills/distill/SKILL.md +21 -21
- package/skills/documentation-templates/SKILL.md +21 -21
- package/skills/domain-modeling/SKILL.md +21 -21
- package/skills/duckdb-analytical-sql/SKILL.md +21 -20
- package/skills/edge-ai-mobile/SKILL.md +21 -20
- package/skills/edge-computing/SKILL.md +21 -21
- package/skills/emil-design-eng/SKILL.md +21 -21
- package/skills/error-resilience/SKILL.md +21 -21
- package/skills/expo-router-v4/SKILL.md +21 -20
- package/skills/extract-design-system/SKILL.md +21 -21
- package/skills/fabel-protocol/SKILL.md +21 -21
- package/skills/fixing-accessibility/SKILL.md +21 -21
- package/skills/fixing-metadata/SKILL.md +21 -21
- package/skills/fixing-motion-performance/SKILL.md +21 -21
- package/skills/framer-motion-expert/SKILL.md +21 -21
- package/skills/frontend-design/SKILL.md +21 -21
- package/skills/frontend-security-expert/SKILL.md +21 -21
- package/skills/game-design-expert/SKILL.md +21 -21
- package/skills/game-engineering-expert/SKILL.md +21 -21
- package/skills/generative-ui-expert/SKILL.md +21 -21
- package/skills/geo-fundamentals/SKILL.md +21 -21
- package/skills/git-pro/SKILL.md +21 -21
- package/skills/github-operations/SKILL.md +21 -21
- package/skills/gpt-taste/SKILL.md +21 -21
- package/skills/gsap-core/SKILL.md +21 -21
- package/skills/gsap-frameworks/SKILL.md +21 -21
- package/skills/gsap-performance/SKILL.md +21 -21
- package/skills/gsap-plugins/SKILL.md +21 -21
- package/skills/gsap-react/SKILL.md +21 -21
- package/skills/gsap-scrolltrigger/SKILL.md +21 -21
- package/skills/gsap-timeline/SKILL.md +21 -21
- package/skills/gsap-utils/SKILL.md +21 -21
- package/skills/harden/SKILL.md +21 -21
- package/skills/harness-protocol/SKILL.md +21 -21
- package/skills/i18n-localization/SKILL.md +21 -21
- package/skills/impeccable/SKILL.md +21 -21
- package/skills/improve-codebase-architecture/SKILL.md +21 -21
- package/skills/improve-ui/SKILL.md +21 -21
- package/skills/intelligent-routing/SKILL.md +21 -20
- package/skills/knowledge-graph/SKILL.md +21 -21
- package/skills/landing-page/SKILL.md +21 -21
- package/skills/lint-and-validate/SKILL.md +21 -21
- package/skills/llm-engineering/SKILL.md +21 -21
- package/skills/local-first/SKILL.md +21 -21
- package/skills/local-first-architecture/SKILL.md +21 -21
- package/skills/lottie-animation/SKILL.md +21 -21
- package/skills/marquee-loop/SKILL.md +21 -21
- package/skills/masked-reveal/SKILL.md +21 -21
- package/skills/mcp-builder/SKILL.md +21 -21
- package/skills/micro-interaction/SKILL.md +39 -32
- package/skills/mobile-design/SKILL.md +21 -21
- package/skills/monorepo-management/SKILL.md +21 -21
- package/skills/morphing-icons/SKILL.md +21 -21
- package/skills/motion-engineering/SKILL.md +21 -21
- package/skills/nextjs-react-expert/SKILL.md +21 -21
- package/skills/nodejs-best-practices/SKILL.md +21 -21
- package/skills/observability/SKILL.md +21 -21
- package/skills/opentelemetry-observability/SKILL.md +20 -19
- package/skills/page-transition-animation/SKILL.md +21 -21
- package/skills/parallel-agents/SKILL.md +21 -21
- package/skills/performance-profiling/SKILL.md +21 -21
- package/skills/plan-writing/SKILL.md +21 -21
- package/skills/platform-engineer/SKILL.md +20 -20
- package/skills/platform-engineering-opentofu/SKILL.md +20 -19
- package/skills/playwright-ai-e2e/SKILL.md +21 -20
- package/skills/playwright-best-practices/SKILL.md +21 -21
- package/skills/polish/SKILL.md +21 -21
- package/skills/powershell-windows/SKILL.md +20 -20
- package/skills/pricing-page/SKILL.md +21 -21
- package/skills/product-aware-heuristics/SKILL.md +21 -21
- package/skills/progressive-blur/SKILL.md +21 -21
- package/skills/project-idioms/SKILL.md +21 -21
- package/skills/property-based-testing/SKILL.md +21 -20
- package/skills/python-patterns/SKILL.md +21 -21
- package/skills/python-pro/SKILL.md +21 -21
- package/skills/quieter/SKILL.md +21 -21
- package/skills/react-doctor/SKILL.md +21 -21
- package/skills/react-specialist/SKILL.md +21 -21
- package/skills/readme-builder/SKILL.md +21 -21
- package/skills/realtime-patterns/SKILL.md +21 -21
- package/skills/red-team-tactics/SKILL.md +21 -21
- package/skills/redesign-skill/SKILL.md +21 -21
- package/skills/review-animations/SKILL.md +21 -21
- package/skills/rust-pro/SKILL.md +21 -21
- package/skills/seo-fundamentals/SKILL.md +21 -21
- package/skills/server-management/SKILL.md +20 -20
- package/skills/shadcn-ui-expert/SKILL.md +21 -21
- package/skills/shape/SKILL.md +21 -21
- package/skills/skill-creator/SKILL.md +28 -21
- package/skills/soft-skill/SKILL.md +21 -21
- package/skills/sounds-on-the-web/SKILL.md +21 -21
- package/skills/sql-pro/SKILL.md +21 -21
- package/skills/supabase-postgres-best-practices/SKILL.md +21 -21
- package/skills/svg-animation/SKILL.md +21 -21
- package/skills/swiftui-expert/SKILL.md +21 -21
- package/skills/swiss-design/SKILL.md +21 -21
- package/skills/system-design-pro/SKILL.md +21 -21
- package/skills/systematic-debugging/SKILL.md +22 -21
- package/skills/systematic-debugging/condition-based-waiting.md +14 -9
- package/skills/systematic-debugging/defense-in-depth.md +9 -3
- package/skills/systematic-debugging/root-cause-tracing.md +14 -0
- package/skills/tailwind-patterns/SKILL.md +21 -21
- package/skills/taste-skill/SKILL.md +21 -21
- package/skills/tdd-workflow/SKILL.md +28 -27
- package/skills/test-result-analyzer/SKILL.md +21 -21
- package/skills/testing-patterns/SKILL.md +21 -21
- package/skills/thermo-nuclear-code-quality-review/SKILL.md +21 -21
- package/skills/thinking-protocol/SKILL.md +21 -20
- package/skills/to-spring-or-not-to-spring/SKILL.md +21 -21
- package/skills/transitions-dev/SKILL.md +21 -21
- package/skills/trend-researcher/SKILL.md +21 -21
- package/skills/typescript-advanced/SKILL.md +21 -21
- package/skills/typeset/SKILL.md +21 -21
- package/skills/ui-reasoning-engine/SKILL.md +21 -21
- package/skills/ui-skill-packs/SKILL.md +21 -21
- package/skills/ui-skills-root/SKILL.md +21 -21
- package/skills/ui-ux-pro-max/SKILL.md +21 -21
- package/skills/ui-ux-researcher/SKILL.md +21 -21
- package/skills/vector-search-pgvector/SKILL.md +21 -20
- package/skills/verification-before-completion/SKILL.md +40 -36
- package/skills/vue-expert/SKILL.md +21 -21
- package/skills/vulnerability-scanner/SKILL.md +21 -21
- package/skills/web-accessibility-auditor/SKILL.md +21 -21
- package/skills/web-design-guidelines/SKILL.md +21 -21
- package/skills/web-quality-audit/SKILL.md +21 -21
- package/skills/webapp-testing/SKILL.md +21 -21
- package/skills/webgpu-performance/SKILL.md +21 -21
- package/skills/whimsy-injector/SKILL.md +21 -21
- package/skills/workflow-optimizer/SKILL.md +21 -21
- package/skills/zero-trust-passkeys/SKILL.md +21 -20
|
@@ -82,7 +82,10 @@ function parseFrontmatter(content) {
|
|
|
82
82
|
isList = false;
|
|
83
83
|
}
|
|
84
84
|
} else if (isList && trimmed.startsWith('-')) {
|
|
85
|
-
const item = trimmed
|
|
85
|
+
const item = trimmed
|
|
86
|
+
.slice(1)
|
|
87
|
+
.trim()
|
|
88
|
+
.replace(/^['"]|['"]$/g, '');
|
|
86
89
|
if (Array.isArray(meta[currentKey])) {
|
|
87
90
|
meta[currentKey].push(item);
|
|
88
91
|
}
|
|
@@ -117,11 +120,13 @@ function deduplicateAndCleanBody(body, skillName, description) {
|
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
// Cut off legacy trailing guardrail stacks
|
|
120
|
-
const footerMarkerRegex =
|
|
123
|
+
const footerMarkerRegex =
|
|
124
|
+
/\n---\s*\n+(\*\*Slash command: `\/review`|## 🤖 LLM-Specific Traps|## 🏛️ Tribunal Integration|### ❌ Forbidden AI Tropes|## Pre-Flight Checklist|## VBC Protocol)[\s\S]*$/;
|
|
121
125
|
cleaned = cleaned.replace(footerMarkerRegex, '').trim();
|
|
122
126
|
|
|
123
127
|
// Remove any remaining isolated duplicate VBC blocks (H2 or H3)
|
|
124
|
-
const isolatedVbcRegex =
|
|
128
|
+
const isolatedVbcRegex =
|
|
129
|
+
/(##|###)\s+🛑?\s*Verification-Before-Completion \(VBC\) Protocol[\s\S]*?(?=\n## |\n---|\n# |$)/g;
|
|
125
130
|
cleaned = cleaned.replace(isolatedVbcRegex, '');
|
|
126
131
|
|
|
127
132
|
// Remove trailing horizontal rules or whitespace
|
|
@@ -130,9 +135,12 @@ function deduplicateAndCleanBody(body, skillName, description) {
|
|
|
130
135
|
// 3. Ensure Activation Boundaries section exists near the top
|
|
131
136
|
if (!cleaned.includes('Activation Boundaries') && !cleaned.includes('Activate when:')) {
|
|
132
137
|
const activationBlock = `\n\n## Activation Boundaries\n\n- **Activate when:** Operating in tasks requiring ${description || skillName}.\n- **DO NOT activate when:** The task falls strictly outside ${skillName} domain or belongs to a different dedicated specialist.\n`;
|
|
133
|
-
|
|
138
|
+
|
|
134
139
|
if (cleaned.includes('## Mandatory Pre-Flight Context Inspection')) {
|
|
135
|
-
cleaned = cleaned.replace(
|
|
140
|
+
cleaned = cleaned.replace(
|
|
141
|
+
/(## Mandatory Pre-Flight Context Inspection[\s\S]*?(?=\n## |\n# |\n---|$))/,
|
|
142
|
+
`$1${activationBlock}`,
|
|
143
|
+
);
|
|
136
144
|
} else {
|
|
137
145
|
cleaned = cleaned.replace(/^(#[^\n]+\n+)/, `$1${activationBlock}\n`);
|
|
138
146
|
}
|
|
@@ -159,7 +167,7 @@ function processSkill(skillDirName) {
|
|
|
159
167
|
return { name: skillDirName, error: 'Missing frontmatter' };
|
|
160
168
|
}
|
|
161
169
|
|
|
162
|
-
const desc = meta ?
|
|
170
|
+
const desc = meta ? meta.description || '' : '';
|
|
163
171
|
const newBody = deduplicateAndCleanBody(body, skillDirName, desc);
|
|
164
172
|
|
|
165
173
|
// Rebuild frontmatter with version: 4.0.0 and canonical scripts-binding
|
|
@@ -171,12 +179,14 @@ function processSkill(skillDirName) {
|
|
|
171
179
|
updatedFrontmatter += '\nversion: 4.0.0';
|
|
172
180
|
}
|
|
173
181
|
if (!updatedFrontmatter.includes('scripts-binding:')) {
|
|
174
|
-
updatedFrontmatter +=
|
|
182
|
+
updatedFrontmatter +=
|
|
183
|
+
'\nscripts-binding:\n - .agent/scripts/lint_runner.js\n - .agent/scripts/verify_all.js';
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
const newContent = `---\n${updatedFrontmatter.trim()}\n---\n\n${newBody}\n`;
|
|
178
187
|
|
|
179
|
-
const vbcMatches = (newContent.match(/Verification-Before-Completion \(VBC\) Protocol/g) || [])
|
|
188
|
+
const vbcMatches = (newContent.match(/Verification-Before-Completion \(VBC\) Protocol/g) || [])
|
|
189
|
+
.length;
|
|
180
190
|
const trapsMatches = (newContent.match(/LLM-Specific Traps/g) || []).length;
|
|
181
191
|
const isDuplicated = vbcMatches > 1 || trapsMatches > 1;
|
|
182
192
|
|
|
@@ -196,14 +206,16 @@ function processSkill(skillDirName) {
|
|
|
196
206
|
isDuplicated,
|
|
197
207
|
modified,
|
|
198
208
|
vbcMatches,
|
|
199
|
-
trapsMatches
|
|
209
|
+
trapsMatches,
|
|
200
210
|
};
|
|
201
211
|
}
|
|
202
212
|
|
|
203
213
|
function main() {
|
|
204
214
|
console.log(`━━━ Tribunal Kit Skill Modernizer ━━━━━━━━━━━━━━━━━━━━━`);
|
|
205
215
|
console.log(`Target: ${SKILLS_DIR}`);
|
|
206
|
-
console.log(
|
|
216
|
+
console.log(
|
|
217
|
+
`Mode: ${FIX ? 'FIX (Overwriting files)' : DRY_RUN ? 'DRY-RUN (Simulated)' : 'VALIDATE (Read-only)'}`,
|
|
218
|
+
);
|
|
207
219
|
if (SYNC_TO_ROOT) console.log(`Sync: Enabled -> ${ROOT_SKILLS_DIR}`);
|
|
208
220
|
console.log();
|
|
209
221
|
|
|
@@ -245,7 +257,9 @@ function main() {
|
|
|
245
257
|
|
|
246
258
|
console.log();
|
|
247
259
|
if (!FIX && totalModified > 0) {
|
|
248
|
-
console.log(
|
|
260
|
+
console.log(
|
|
261
|
+
`💡 Run with --fix to apply cleanups and V4 schema across all ${totalModified} skills.`,
|
|
262
|
+
);
|
|
249
263
|
} else if (FIX) {
|
|
250
264
|
console.log(`✅ Successfully modernized and deduplicated skills to V4 schema!`);
|
|
251
265
|
}
|
package/scripts/package-cores.js
CHANGED
|
@@ -40,7 +40,10 @@ function findBinary(platform, ext, rustTarget) {
|
|
|
40
40
|
const candidates = [
|
|
41
41
|
path.join(ROOT, 'target', rustTarget, 'release', binaryName),
|
|
42
42
|
path.join(ROOT, 'target', 'release', binaryName),
|
|
43
|
-
path.join(
|
|
43
|
+
path.join(
|
|
44
|
+
ROOT,
|
|
45
|
+
`tribunal-core-${platform}-${rustTarget.includes('arm64') || rustTarget.includes('aarch64') ? 'arm64' : 'x64'}${ext}`,
|
|
46
|
+
),
|
|
44
47
|
];
|
|
45
48
|
|
|
46
49
|
for (const cand of candidates) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* skill_enhancement_engine.js — State-of-the-Art Skill Enhancement Engine
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
5
|
* Transforms SKILL.md definitions into autonomous, production-grade execution engines.
|
|
6
6
|
* Implements the 18-section architectural framework:
|
|
7
7
|
* 1. Objective Layer & High-Impact Mission
|
|
@@ -56,14 +56,40 @@ function getSkillDomain(skillName) {
|
|
|
56
56
|
for (const [domain, list] of Object.entries(domainRoutes)) {
|
|
57
57
|
if (list.includes(skillName)) return domain;
|
|
58
58
|
}
|
|
59
|
-
if (skillName.includes('anim') || skillName.includes('motion') || skillName.includes('gsap'))
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
59
|
+
if (skillName.includes('anim') || skillName.includes('motion') || skillName.includes('gsap'))
|
|
60
|
+
return 'motion';
|
|
61
|
+
if (
|
|
62
|
+
skillName.includes('react') ||
|
|
63
|
+
skillName.includes('ui') ||
|
|
64
|
+
skillName.includes('css') ||
|
|
65
|
+
skillName.includes('design')
|
|
66
|
+
)
|
|
67
|
+
return 'frontend';
|
|
68
|
+
if (skillName.includes('sql') || skillName.includes('db') || skillName.includes('data'))
|
|
69
|
+
return 'database';
|
|
70
|
+
if (
|
|
71
|
+
skillName.includes('security') ||
|
|
72
|
+
skillName.includes('audit') ||
|
|
73
|
+
skillName.includes('vulnerab')
|
|
74
|
+
)
|
|
75
|
+
return 'security';
|
|
63
76
|
if (skillName.includes('test') || skillName.includes('qa')) return 'testing';
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
if (
|
|
78
|
+
skillName.includes('devops') ||
|
|
79
|
+
skillName.includes('ci') ||
|
|
80
|
+
skillName.includes('cloud') ||
|
|
81
|
+
skillName.includes('bash')
|
|
82
|
+
)
|
|
83
|
+
return 'devops';
|
|
84
|
+
if (skillName.includes('mobile') || skillName.includes('swift') || skillName.includes('expo'))
|
|
85
|
+
return 'mobile';
|
|
86
|
+
if (
|
|
87
|
+
skillName.includes('api') ||
|
|
88
|
+
skillName.includes('python') ||
|
|
89
|
+
skillName.includes('rust') ||
|
|
90
|
+
skillName.includes('backend')
|
|
91
|
+
)
|
|
92
|
+
return 'backend';
|
|
67
93
|
return 'meta';
|
|
68
94
|
}
|
|
69
95
|
|
|
@@ -147,49 +173,157 @@ const DOMAIN_PREFLIGHT = {
|
|
|
147
173
|
|
|
148
174
|
const DOMAIN_TRAPS = {
|
|
149
175
|
frontend: [
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
176
|
+
{
|
|
177
|
+
trope: 'Uncontrolled Re-render Loop',
|
|
178
|
+
bad: 'Mutating state inside render bodies or omitting hook dependencies',
|
|
179
|
+
good: 'Wrap effects with explicit deps and isolate reactive derivations in useMemo',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
trope: 'Accessibility Neglect',
|
|
183
|
+
bad: 'Interactive <div> without role="button", tabIndex, or onKeyDown',
|
|
184
|
+
good: 'Use semantic <button> or provide ARIA role, keyboard handlers, and focus ring',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
trope: 'Layout Shift Flash',
|
|
188
|
+
bad: 'Images/dynamic content without aspect-ratio or explicit dimensions',
|
|
189
|
+
good: 'Enforce aspect-ratio or skeleton placeholders to guarantee zero CLS',
|
|
190
|
+
},
|
|
153
191
|
],
|
|
154
192
|
motion: [
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
193
|
+
{
|
|
194
|
+
trope: 'The Instant Pop Trap',
|
|
195
|
+
bad: 'Conditionally unmounting elements without animated interpolation',
|
|
196
|
+
good: 'Use AnimatePresence or coordinate morphs with continuous geometry',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
trope: 'Layout Thrashing',
|
|
200
|
+
bad: 'Animating width, height, top, or left inside animation loops',
|
|
201
|
+
good: 'Animate composite-only transform (translate3d, scale) and opacity',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
trope: 'Sluggish Duration',
|
|
205
|
+
bad: 'Setting micro-interaction transitions to 600ms+ causing interface lag',
|
|
206
|
+
good: 'Cap interactive feedback at 160ms–240ms with snappy ease-out curves',
|
|
207
|
+
},
|
|
158
208
|
],
|
|
159
209
|
backend: [
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
-
|
|
210
|
+
{
|
|
211
|
+
trope: 'Unchecked Payload Cast',
|
|
212
|
+
bad: 'Casting request bodies to TypeScript types without runtime schema validation',
|
|
213
|
+
good: 'Parse request payloads through Zod/Pydantic schemas before business logic',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
trope: 'Silent Error Swallowing',
|
|
217
|
+
bad: 'Catching errors with empty catch blocks or logging without rethrowing',
|
|
218
|
+
good: 'Propagate structured errors with status codes and contextual stack traces',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
trope: 'Unparameterized Query',
|
|
222
|
+
bad: 'Concatenating user inputs into SQL/Prisma query strings',
|
|
223
|
+
good: 'Always use parameterized bindings or type-safe ORM query builders',
|
|
224
|
+
},
|
|
163
225
|
],
|
|
164
226
|
database: [
|
|
165
|
-
{
|
|
166
|
-
|
|
167
|
-
|
|
227
|
+
{
|
|
228
|
+
trope: 'Full Table Scan Blindspot',
|
|
229
|
+
bad: 'Querying high-cardinality tables without index coverage',
|
|
230
|
+
good: 'Verify query plans with EXPLAIN ANALYZE and add composite B-Tree indexes',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
trope: 'Non-Atomic Batch Mutation',
|
|
234
|
+
bad: 'Executing multiple related DB writes sequentially without transaction wrapper',
|
|
235
|
+
good: 'Wrap multi-table updates in an atomic transaction with automatic rollback',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
trope: 'Destructive Schema Migration',
|
|
239
|
+
bad: 'Dropping or renaming columns in production without multi-phase migration',
|
|
240
|
+
good: 'Use expand-and-contract: add new column, sync data, migrate callers, drop old',
|
|
241
|
+
},
|
|
168
242
|
],
|
|
169
243
|
security: [
|
|
170
|
-
{
|
|
171
|
-
|
|
172
|
-
|
|
244
|
+
{
|
|
245
|
+
trope: 'Hardcoded Secret Pattern',
|
|
246
|
+
bad: 'Committing API keys, tokens, or private salts into source code',
|
|
247
|
+
good: 'Load credentials strictly via runtime environment variables and secret stores',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
trope: 'Prompt Injection Surface',
|
|
251
|
+
bad: 'Directly concatenating untrusted user input into LLM system prompts',
|
|
252
|
+
good: 'Wrap user content in isolated delimiters and strip injection control sequences',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
trope: 'Missing Authorization Check',
|
|
256
|
+
bad: 'Relying only on authentication token presence without checking tenant/object RBAC',
|
|
257
|
+
good: 'Verify user permissions against the specific target record ID before mutation',
|
|
258
|
+
},
|
|
173
259
|
],
|
|
174
260
|
devops: [
|
|
175
|
-
{
|
|
176
|
-
|
|
177
|
-
|
|
261
|
+
{
|
|
262
|
+
trope: 'Silent Pipeline Failure',
|
|
263
|
+
bad: 'Executing shell steps without set -euo pipefail, ignoring errors',
|
|
264
|
+
good: 'Always initialize shell scripts with set -euo pipefail and trap handlers',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
trope: 'Unpinned Dependency Shift',
|
|
268
|
+
bad: 'Installing packages with npm install or using :latest docker tags',
|
|
269
|
+
good: 'Lock dependencies with npm ci / lockfiles and use immutable SHA256 image digests',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
trope: 'Leaking Build Secrets',
|
|
273
|
+
bad: 'Passing secrets as Docker build arguments baked into image layers',
|
|
274
|
+
good: 'Use Docker BuildKit secret mounts (--mount=type=secret) or runtime injection',
|
|
275
|
+
},
|
|
178
276
|
],
|
|
179
277
|
testing: [
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
|
|
278
|
+
{
|
|
279
|
+
trope: 'Testing Implementation Details',
|
|
280
|
+
bad: 'Asserting on private component state or internal helper functions',
|
|
281
|
+
good: 'Assert on observable user behaviors, DOM roles, and network outcomes',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
trope: 'Flaky Async Assertion',
|
|
285
|
+
bad: 'Using arbitrary setTimeout delays before asserting on asynchronous state',
|
|
286
|
+
good: 'Use waitFor or findBy queries that poll with timeout bounds',
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
trope: 'Shared Mutable State',
|
|
290
|
+
bad: 'Reusing database records across concurrent test runners',
|
|
291
|
+
good: 'Isolate test databases per worker or execute in rolled-back transactions',
|
|
292
|
+
},
|
|
183
293
|
],
|
|
184
294
|
mobile: [
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
|
|
295
|
+
{
|
|
296
|
+
trope: 'JS Thread Animation Lag',
|
|
297
|
+
bad: 'Driving gestures and scrolling physics on the React Native JS thread',
|
|
298
|
+
good: 'Use React Native Reanimated worklets running directly on the UI thread',
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
trope: 'Missing Keyboard Offset',
|
|
302
|
+
bad: 'Forms hidden behind native software keyboard on iOS/Android',
|
|
303
|
+
good: 'Wrap form views in KeyboardAvoidingView with platform-calibrated behavior',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
trope: 'Uncached Image Flooding',
|
|
307
|
+
bad: 'Rendering raw image URLs in list items without memory caching',
|
|
308
|
+
good: 'Use FastImage or Expo Image with disk cache policies and thumbnail previews',
|
|
309
|
+
},
|
|
188
310
|
],
|
|
189
311
|
meta: [
|
|
190
|
-
{
|
|
191
|
-
|
|
192
|
-
|
|
312
|
+
{
|
|
313
|
+
trope: 'Hallucinated Tool Capabilities',
|
|
314
|
+
bad: 'Assuming an external library or CLI command exists without verification',
|
|
315
|
+
good: 'Run a verification check or verify package.json before referencing tools',
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
trope: 'Premature Completion Claim',
|
|
319
|
+
bad: 'Declaring a task finished because code was generated without verification',
|
|
320
|
+
good: 'Execute tests, linters, or terminal commands to provide concrete proof',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
trope: 'Context Bloat Dumping',
|
|
324
|
+
bad: 'Pasting entire multi-thousand-line files into prompt context',
|
|
325
|
+
good: 'Extract targeted excerpts, symbols, and signatures to preserve tokens',
|
|
326
|
+
},
|
|
193
327
|
],
|
|
194
328
|
};
|
|
195
329
|
|
|
@@ -222,7 +356,10 @@ function parseFrontmatter(content) {
|
|
|
222
356
|
isList = false;
|
|
223
357
|
}
|
|
224
358
|
} else if (isList && trimmed.startsWith('-')) {
|
|
225
|
-
const item = trimmed
|
|
359
|
+
const item = trimmed
|
|
360
|
+
.slice(1)
|
|
361
|
+
.trim()
|
|
362
|
+
.replace(/^['"]|['"]$/g, '');
|
|
226
363
|
if (Array.isArray(meta[currentKey])) {
|
|
227
364
|
meta[currentKey].push(item);
|
|
228
365
|
}
|
|
@@ -243,12 +380,15 @@ function buildEnhancedSkill(skillName, originalContent) {
|
|
|
243
380
|
|
|
244
381
|
// Extract clean title
|
|
245
382
|
const titleMatch = body.match(/^#\s+(.+)$/m);
|
|
246
|
-
const title = titleMatch
|
|
383
|
+
const title = titleMatch
|
|
384
|
+
? titleMatch[1].trim()
|
|
385
|
+
: `${skillName.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase())} Engineering`;
|
|
247
386
|
|
|
248
387
|
// Extract existing core technical content (excluding legacy footers)
|
|
249
388
|
let coreBody = body;
|
|
250
389
|
// Strip old canonical footers or tribunal blocks
|
|
251
|
-
const footerMarkerRegex =
|
|
390
|
+
const footerMarkerRegex =
|
|
391
|
+
/\n---\s*\n+(\*\*Slash command: `\/review`|## 🏛️ Tribunal Verification & Guardrails|## 🏛️ Tribunal Integration|### ❌ Forbidden AI Tropes|## 🤖 LLM-Specific Traps|AI coding assistants often fall into specific bad habits)[\s\S]*$/;
|
|
252
392
|
coreBody = coreBody.replace(footerMarkerRegex, '').trim();
|
|
253
393
|
|
|
254
394
|
// Strip duplicated titles
|
|
@@ -257,23 +397,38 @@ function buildEnhancedSkill(skillName, originalContent) {
|
|
|
257
397
|
|
|
258
398
|
// Strip duplicate Activation Boundaries if previously inserted
|
|
259
399
|
coreBody = coreBody.replace(/## Activation Boundaries[\s\S]*?(?=\n## |\n---|\n# |$)/g, '').trim();
|
|
260
|
-
coreBody = coreBody
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
coreBody = coreBody
|
|
400
|
+
coreBody = coreBody
|
|
401
|
+
.replace(/## Mandatory Pre-Flight Context Inspection[\s\S]*?(?=\n## |\n---|\n# |$)/g, '')
|
|
402
|
+
.trim();
|
|
403
|
+
coreBody = coreBody
|
|
404
|
+
.replace(/## 🔁 Multi-Pass Execution Protocol[\s\S]*?(?=\n## |\n---|\n# |$)/g, '')
|
|
405
|
+
.trim();
|
|
406
|
+
coreBody = coreBody
|
|
407
|
+
.replace(/## 🚨 Edge-Case & Failure Mode Matrix[\s\S]*?(?=\n## |\n---|\n# |$)/g, '')
|
|
408
|
+
.trim();
|
|
409
|
+
coreBody = coreBody
|
|
410
|
+
.replace(/## 🤖 LLM-Specific Traps Table[\s\S]*?(?=\n## |\n---|\n# |$)/g, '')
|
|
411
|
+
.trim();
|
|
264
412
|
coreBody = coreBody.replace(/## 🏛️ Tribunal Verification & Guardrails[\s\S]*$/g, '').trim();
|
|
265
413
|
coreBody = coreBody.replace(/(\n---\s*)+$/, '').trim();
|
|
266
414
|
|
|
267
415
|
// Format frontmatter with SDO trigger guarantee
|
|
268
416
|
let desc = meta.description || `${skillName} mastery.`;
|
|
269
|
-
if (
|
|
417
|
+
if (
|
|
418
|
+
!desc.toLowerCase().startsWith('use when') &&
|
|
419
|
+
!desc.toLowerCase().startsWith('activate when')
|
|
420
|
+
) {
|
|
270
421
|
desc = `Use when ${desc.replace(/^["']|["']$/g, '')}`;
|
|
271
422
|
}
|
|
272
423
|
|
|
273
424
|
// Ensure scripts-binding
|
|
274
|
-
const scripts = Array.isArray(meta['scripts-binding'])
|
|
275
|
-
|
|
276
|
-
|
|
425
|
+
const scripts = Array.isArray(meta['scripts-binding'])
|
|
426
|
+
? meta['scripts-binding']
|
|
427
|
+
: ['.agent/scripts/lint_runner.js', '.agent/scripts/verify_all.js'];
|
|
428
|
+
if (!scripts.includes('.agent/scripts/lint_runner.js'))
|
|
429
|
+
scripts.push('.agent/scripts/lint_runner.js');
|
|
430
|
+
if (!scripts.includes('.agent/scripts/verify_all.js'))
|
|
431
|
+
scripts.push('.agent/scripts/verify_all.js');
|
|
277
432
|
|
|
278
433
|
const formattedFrontmatter = [
|
|
279
434
|
'---',
|
|
@@ -281,11 +436,15 @@ function buildEnhancedSkill(skillName, originalContent) {
|
|
|
281
436
|
`description: ${desc}`,
|
|
282
437
|
`version: 5.0.0`,
|
|
283
438
|
`last-updated: 2026-09-13`,
|
|
284
|
-
meta.skills && meta.skills.length
|
|
439
|
+
meta.skills && meta.skills.length
|
|
440
|
+
? `skills:\n${meta.skills.map(s => ` - ${s}`).join('\n')}`
|
|
441
|
+
: null,
|
|
285
442
|
`tools: Read, Grep, Glob, Bash, Edit, Write`,
|
|
286
443
|
`scripts-binding:\n${scripts.map(s => ` - ${s}`).join('\n')}`,
|
|
287
|
-
'---'
|
|
288
|
-
]
|
|
444
|
+
'---',
|
|
445
|
+
]
|
|
446
|
+
.filter(Boolean)
|
|
447
|
+
.join('\n');
|
|
289
448
|
|
|
290
449
|
// Build the 18-Section Architecture
|
|
291
450
|
const section1_Preflight = `## Mandatory Pre-Flight Context Inspection
|
|
@@ -413,7 +572,9 @@ function run() {
|
|
|
413
572
|
console.log(`\n🚀 State-of-the-Art Skill Enhancement Engine`);
|
|
414
573
|
console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);
|
|
415
574
|
console.log(`Target Skills: ${skillDirs.length}`);
|
|
416
|
-
console.log(
|
|
575
|
+
console.log(
|
|
576
|
+
`Execution Mode: ${DRY_RUN ? 'DRY RUN (preview only)' : FIX ? 'FIX (writing changes)' : 'VALIDATE ONLY'}`,
|
|
577
|
+
);
|
|
417
578
|
console.log(`Sync to Root: ${SYNC_TO_ROOT ? 'YES' : 'NO'}\n`);
|
|
418
579
|
|
|
419
580
|
let enhancedCount = 0;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Telemetry Garbage Collection Script — Tribunal Kit v10 Drop 1
|
|
4
|
+
*
|
|
5
|
+
* Compacts old telemetry data in .tribunal/telemetry/dispatch.jsonl:
|
|
6
|
+
* - Retains last N days of raw events (default: 90)
|
|
7
|
+
* - Aggregates older events into monthly summary buckets
|
|
8
|
+
* - Writes compacted data back
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* node scripts/telemetry_gc.js [--days 90] [--dry-run] [--path .]
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
|
|
17
|
+
// Parse CLI args
|
|
18
|
+
const args = process.argv.slice(2);
|
|
19
|
+
function getArg(name, defaultValue) {
|
|
20
|
+
const idx = args.indexOf(`--${name}`);
|
|
21
|
+
if (idx === -1) return defaultValue;
|
|
22
|
+
return args[idx + 1] || defaultValue;
|
|
23
|
+
}
|
|
24
|
+
const dryRun = args.includes('--dry-run');
|
|
25
|
+
const retentionDays = parseInt(getArg('days', '90'), 10);
|
|
26
|
+
const targetPath = getArg('path', '.');
|
|
27
|
+
|
|
28
|
+
const logFile = path.join(targetPath, '.tribunal', 'telemetry', 'dispatch.jsonl');
|
|
29
|
+
const archiveDir = path.join(targetPath, '.tribunal', 'telemetry', 'archive');
|
|
30
|
+
|
|
31
|
+
function run() {
|
|
32
|
+
console.log(`\n⚡ Telemetry GC — Retention: ${retentionDays} days | Dry Run: ${dryRun}`);
|
|
33
|
+
console.log('━'.repeat(50));
|
|
34
|
+
|
|
35
|
+
if (!fs.existsSync(logFile)) {
|
|
36
|
+
console.log(' ℹ No telemetry log found. Nothing to compact.');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const raw = fs.readFileSync(logFile, 'utf-8');
|
|
41
|
+
const lines = raw.split('\n').filter(l => l.trim().length > 0);
|
|
42
|
+
console.log(` Total events in log: ${lines.length}`);
|
|
43
|
+
|
|
44
|
+
const now = new Date();
|
|
45
|
+
const cutoff = new Date(now.getTime() - retentionDays * 24 * 60 * 60 * 1000);
|
|
46
|
+
|
|
47
|
+
const retained = [];
|
|
48
|
+
const archived = [];
|
|
49
|
+
|
|
50
|
+
for (const line of lines) {
|
|
51
|
+
try {
|
|
52
|
+
const event = JSON.parse(line);
|
|
53
|
+
const eventDate = new Date(event.timestamp || '1970-01-01');
|
|
54
|
+
if (eventDate >= cutoff) {
|
|
55
|
+
retained.push(line);
|
|
56
|
+
} else {
|
|
57
|
+
archived.push(event);
|
|
58
|
+
}
|
|
59
|
+
} catch {
|
|
60
|
+
// Malformed line — discard
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
console.log(` Events to retain: ${retained.length}`);
|
|
66
|
+
console.log(` Events to archive: ${archived.length}`);
|
|
67
|
+
|
|
68
|
+
if (archived.length === 0) {
|
|
69
|
+
if (lines.length !== retained.length) {
|
|
70
|
+
if (!dryRun) fs.writeFileSync(logFile, retained.join('\n') + '\n');
|
|
71
|
+
console.log(` ✓ Cleaned malformed lines. ${retained.length} events retained.\n`);
|
|
72
|
+
} else {
|
|
73
|
+
console.log(' ✓ Nothing to compact. All events within retention window.\n');
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Aggregate archived events into monthly buckets
|
|
79
|
+
const monthlyBuckets = {};
|
|
80
|
+
for (const event of archived) {
|
|
81
|
+
const date = new Date(event.timestamp || '1970-01-01');
|
|
82
|
+
const key = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
|
|
83
|
+
if (!monthlyBuckets[key]) {
|
|
84
|
+
monthlyBuckets[key] = {
|
|
85
|
+
month: key,
|
|
86
|
+
total_dispatches: 0,
|
|
87
|
+
agents: {},
|
|
88
|
+
outcomes: {},
|
|
89
|
+
total_tokens: 0,
|
|
90
|
+
total_duration_ms: 0,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const bucket = monthlyBuckets[key];
|
|
94
|
+
bucket.total_dispatches++;
|
|
95
|
+
bucket.agents[event.agent_name] = (bucket.agents[event.agent_name] || 0) + 1;
|
|
96
|
+
bucket.outcomes[event.outcome] = (bucket.outcomes[event.outcome] || 0) + 1;
|
|
97
|
+
bucket.total_tokens += event.token_budget_used || 0;
|
|
98
|
+
bucket.total_duration_ms += event.duration_ms || 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (dryRun) {
|
|
102
|
+
console.log('\n [DRY RUN] Would archive these monthly summaries:');
|
|
103
|
+
for (const [month, bucket] of Object.entries(monthlyBuckets)) {
|
|
104
|
+
console.log(` ${month}: ${bucket.total_dispatches} events, ${bucket.total_tokens} tokens`);
|
|
105
|
+
}
|
|
106
|
+
console.log(` [DRY RUN] Would retain ${retained.length} recent events.\n`);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Write monthly archive files
|
|
111
|
+
if (!fs.existsSync(archiveDir)) {
|
|
112
|
+
fs.mkdirSync(archiveDir, { recursive: true });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
for (const [month, bucket] of Object.entries(monthlyBuckets)) {
|
|
116
|
+
const archiveFile = path.join(archiveDir, `${month}.json`);
|
|
117
|
+
// Merge with existing archive if present
|
|
118
|
+
let existing = {};
|
|
119
|
+
if (fs.existsSync(archiveFile)) {
|
|
120
|
+
try {
|
|
121
|
+
existing = JSON.parse(fs.readFileSync(archiveFile, 'utf-8'));
|
|
122
|
+
} catch {
|
|
123
|
+
/* overwrite */
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const merged = {
|
|
128
|
+
month: bucket.month,
|
|
129
|
+
total_dispatches: (existing.total_dispatches || 0) + bucket.total_dispatches,
|
|
130
|
+
agents: mergeCountMaps(existing.agents || {}, bucket.agents),
|
|
131
|
+
outcomes: mergeCountMaps(existing.outcomes || {}, bucket.outcomes),
|
|
132
|
+
total_tokens: (existing.total_tokens || 0) + bucket.total_tokens,
|
|
133
|
+
total_duration_ms: (existing.total_duration_ms || 0) + bucket.total_duration_ms,
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
fs.writeFileSync(archiveFile, JSON.stringify(merged, null, 2));
|
|
137
|
+
console.log(` ✓ Archived: ${archiveFile} (${bucket.total_dispatches} events)`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Rewrite the dispatch log with only retained events
|
|
141
|
+
fs.writeFileSync(logFile, retained.join('\n') + '\n');
|
|
142
|
+
console.log(` ✓ Compacted dispatch.jsonl: ${retained.length} events retained.`);
|
|
143
|
+
console.log(` ✓ ${archived.length} events moved to monthly archives.\n`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function mergeCountMaps(a, b) {
|
|
147
|
+
const result = { ...a };
|
|
148
|
+
for (const [key, count] of Object.entries(b)) {
|
|
149
|
+
result[key] = (result[key] || 0) + count;
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
run();
|