tribunal-kit 9.2.3 → 9.2.5
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/.manifest.json +78 -78
- package/.agent/.shared/ui-ux-pro-max/README.md +4 -4
- package/.agent/.tribunal/session.jsonl +15 -0
- package/.agent/ADRs/ADR-001-system-architecture-intelligence.md +49 -0
- package/.agent/ARCHITECTURE.md +63 -63
- package/.agent/agents/accessibility-reviewer.md +109 -109
- package/.agent/agents/agent-shield-auditor.md +18 -0
- package/.agent/agents/ai-code-reviewer.md +223 -223
- package/.agent/agents/anti-pattern-reviewer.md +104 -104
- package/.agent/agents/api-architect.md +89 -89
- package/.agent/agents/architecture-auditor.md +195 -0
- package/.agent/agents/backend-specialist.md +242 -242
- package/.agent/agents/cloud-engineer.md +120 -120
- package/.agent/agents/code-archaeologist.md +186 -186
- package/.agent/agents/complexity-reviewer.md +76 -76
- package/.agent/agents/database-architect.md +206 -206
- package/.agent/agents/db-latency-auditor.md +237 -237
- package/.agent/agents/debugger.md +215 -215
- package/.agent/agents/dependency-reviewer.md +124 -124
- package/.agent/agents/devops-engineer.md +240 -240
- package/.agent/agents/documentation-writer.md +228 -228
- package/.agent/agents/explorer-agent.md +186 -186
- package/.agent/agents/frontend-reviewer.md +195 -195
- package/.agent/agents/frontend-specialist.md +122 -122
- package/.agent/agents/game-developer.md +68 -68
- package/.agent/agents/harness-manager.md +49 -0
- package/.agent/agents/human-gate-negotiator.md +22 -0
- package/.agent/agents/interaction-reviewer.md +123 -123
- package/.agent/agents/kernel-scheduler.md +56 -0
- package/.agent/agents/logic-reviewer.md +147 -147
- package/.agent/agents/memory-archivist.md +37 -0
- package/.agent/agents/minimalist-reviewer.md +104 -104
- package/.agent/agents/mobile-developer.md +216 -216
- package/.agent/agents/mobile-reviewer.md +180 -180
- package/.agent/agents/orchestrator.md +268 -263
- package/.agent/agents/penetration-tester.md +180 -180
- package/.agent/agents/performance-optimizer.md +202 -202
- package/.agent/agents/performance-reviewer.md +180 -180
- package/.agent/agents/pipeline-reviewer.md +144 -144
- package/.agent/agents/precedence-reviewer.md +266 -266
- package/.agent/agents/product-manager.md +167 -167
- package/.agent/agents/product-owner.md +103 -103
- package/.agent/agents/product-reviewer.md +103 -103
- package/.agent/agents/project-planner.md +181 -176
- package/.agent/agents/qa-automation-engineer.md +244 -244
- package/.agent/agents/resilience-reviewer.md +108 -108
- package/.agent/agents/schema-reviewer.md +87 -87
- package/.agent/agents/security-auditor.md +204 -199
- package/.agent/agents/seo-specialist.md +213 -213
- package/.agent/agents/sql-reviewer.md +180 -180
- package/.agent/agents/supervisor-agent.md +202 -202
- package/.agent/agents/swarm-worker-contracts.md +170 -170
- package/.agent/agents/swarm-worker-registry.md +99 -99
- package/.agent/agents/system-architect.md +260 -105
- package/.agent/agents/test-coverage-reviewer.md +181 -181
- package/.agent/agents/test-engineer.md +138 -138
- package/.agent/agents/throughput-optimizer.md +316 -316
- package/.agent/agents/type-safety-reviewer.md +202 -202
- package/.agent/agents/ui-ux-auditor.md +80 -80
- package/.agent/agents/ui-visual-auditor.md +102 -102
- package/.agent/agents/ux-reviewer.md +109 -109
- package/.agent/agents/visual-reviewer.md +103 -103
- package/.agent/agents/vitals-reviewer.md +245 -245
- package/.agent/config/claude.json +18 -18
- package/.agent/config/plugin.json +102 -102
- package/.agent/config/slash-commands.json +115 -115
- package/.agent/config/specialist-registry.json +415 -415
- package/.agent/config/system-prompt.md +258 -258
- package/.agent/history/arch-mapper-cache.json +6712 -0
- package/.agent/history/architecture.idx.json +5746 -0
- package/.agent/mcp_config.json +32 -32
- package/.agent/patterns/generator.md +11 -11
- package/.agent/patterns/inversion.md +14 -14
- package/.agent/patterns/pipeline.md +11 -11
- package/.agent/patterns/reviewer.md +15 -15
- package/.agent/patterns/tool-wrapper.md +11 -11
- package/.agent/plans/implementation_plan.md +48 -0
- package/.agent/plans/task.md +35 -0
- package/.agent/routing_index.json +2060 -2060
- package/.agent/rules/GEMINI.md +437 -437
- package/.agent/rules/GEMINI_PLANNER.md +82 -82
- package/.agent/rules/kernel.md +86 -86
- package/.agent/scripts/_colors.js +210 -210
- package/.agent/scripts/_utils.js +373 -377
- package/.agent/scripts/architecture_mapper.js +625 -0
- package/.agent/scripts/ast_context_loader.js +137 -137
- package/.agent/scripts/auto_preview.js +203 -203
- package/.agent/scripts/browser_audit.js +102 -102
- package/.agent/scripts/bundle_analyzer.js +287 -287
- package/.agent/scripts/case_law_manager.js +887 -887
- package/.agent/scripts/checklist.js +300 -300
- package/.agent/scripts/cicd_validator.js +305 -305
- package/.agent/scripts/context_broker.js +962 -962
- package/.agent/scripts/context_compiler.js +1143 -1112
- package/.agent/scripts/contract_engine.js +402 -402
- package/.agent/scripts/dependency_analyzer.js +313 -313
- package/.agent/scripts/graph_builder.js +384 -384
- package/.agent/scripts/graph_visualizer.js +390 -390
- package/.agent/scripts/graph_zoom.js +181 -181
- package/.agent/scripts/guardrail_engine.js +785 -785
- package/.agent/scripts/harness_manager.js +60 -0
- package/.agent/scripts/impact_classifier.js +192 -192
- package/.agent/scripts/inner_loop_validator.js +472 -472
- package/.agent/scripts/integrity_manifest.js +484 -484
- package/.agent/scripts/lint_runner.js +218 -218
- package/.agent/scripts/marathon_harness.js +986 -986
- package/.agent/scripts/mcp_server.js +181 -0
- package/.agent/scripts/memory_archivist.js +97 -0
- package/.agent/scripts/memory_consolidator.js +37 -0
- package/.agent/scripts/memory_engine.js +782 -742
- package/.agent/scripts/minify_context.js +111 -111
- package/.agent/scripts/minimal_change_engine.js +445 -445
- package/.agent/scripts/mutation_runner.js +307 -305
- package/.agent/scripts/payload_schemas.js +164 -164
- package/.agent/scripts/pipeline_engine.js +906 -891
- package/.agent/scripts/prompt_compiler.js +272 -272
- package/.agent/scripts/schema_validator.js +326 -326
- package/.agent/scripts/security_scan.js +390 -390
- package/.agent/scripts/session_logger.js +115 -0
- package/.agent/scripts/session_manager.js +299 -289
- package/.agent/scripts/signal_detector.js +175 -175
- package/.agent/scripts/skill_evolution.js +997 -997
- package/.agent/scripts/skill_integrator.js +304 -304
- package/.agent/scripts/socratic_gate_policy.js +63 -63
- package/.agent/scripts/strengthen_skills.js +199 -199
- package/.agent/scripts/swarm_dispatcher.js +983 -906
- package/.agent/scripts/syscall_registry.js +105 -0
- package/.agent/scripts/test_runner.js +209 -209
- package/.agent/scripts/token_budget_broker.js +165 -165
- package/.agent/scripts/trace_engine.js +126 -126
- package/.agent/scripts/verify_all.js +276 -276
- package/.agent/scripts/visual_audit.js +87 -87
- package/.agent/skill_topic_map.json +314 -287
- package/.agent/skills/12-principles-of-animation/SKILL.md +51 -51
- package/.agent/skills/60fps-animation/SKILL.md +91 -91
- package/.agent/skills/accessible-animation/SKILL.md +189 -189
- package/.agent/skills/adapt/SKILL.md +56 -56
- package/.agent/skills/adr-generation/SKILL.md +57 -0
- package/.agent/skills/advanced-rag-pipelines/SKILL.md +94 -94
- package/.agent/skills/agent-organizer/SKILL.md +117 -117
- package/.agent/skills/agent-syscall-guidelines/SKILL.md +25 -0
- package/.agent/skills/agentic-patterns/SKILL.md +281 -281
- package/.agent/skills/agentic-workflows-2026/SKILL.md +91 -83
- package/.agent/skills/agentshield-security/SKILL.md +26 -0
- package/.agent/skills/ai-app-hardening/SKILL.md +51 -51
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +162 -162
- package/.agent/skills/animation-on-scroll/SKILL.md +196 -196
- package/.agent/skills/animation-systems/SKILL.md +198 -198
- package/.agent/skills/antfu-conventions/SKILL.md +54 -54
- package/.agent/skills/api-patterns/SKILL.md +218 -218
- package/.agent/skills/api-security-auditor/SKILL.md +155 -155
- package/.agent/skills/app-builder/SKILL.md +535 -535
- package/.agent/skills/app-builder/templates/SKILL.md +108 -108
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -76
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -92
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -88
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -88
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -83
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -90
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -90
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -126
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +127 -127
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +172 -172
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +139 -139
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -83
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +122 -122
- package/.agent/skills/appflow-wireframe/SKILL.md +96 -96
- package/.agent/skills/apple-design/SKILL.md +89 -89
- package/.agent/skills/architecture/SKILL.md +188 -188
- package/.agent/skills/architecture-drift/SKILL.md +45 -0
- package/.agent/skills/audit-and-fix/SKILL.md +100 -100
- package/.agent/skills/authentication-best-practices/SKILL.md +157 -157
- package/.agent/skills/autonomous-execution/SKILL.md +76 -0
- package/.agent/skills/backend-security-expert/SKILL.md +73 -73
- package/.agent/skills/baseline-ui/SKILL.md +55 -55
- package/.agent/skills/bash-linux/SKILL.md +139 -139
- package/.agent/skills/behavioral-modes/SKILL.md +200 -200
- package/.agent/skills/better-colors/SKILL.md +116 -116
- package/.agent/skills/better-typography/SKILL.md +90 -90
- package/.agent/skills/better-ui/SKILL.md +130 -130
- package/.agent/skills/bolder/SKILL.md +49 -49
- package/.agent/skills/brainstorming/SKILL.md +460 -460
- package/.agent/skills/browser-audit/SKILL.md +102 -102
- package/.agent/skills/browser-native-ai/SKILL.md +72 -72
- package/.agent/skills/build-primitive/SKILL.md +50 -50
- package/.agent/skills/building-native-ui/SKILL.md +162 -162
- package/.agent/skills/cicd-pro/SKILL.md +412 -412
- package/.agent/skills/clarify/SKILL.md +55 -55
- package/.agent/skills/clean-code/SKILL.md +367 -367
- package/.agent/skills/cloud-architect/SKILL.md +409 -409
- package/.agent/skills/cobejs/SKILL.md +70 -70
- package/.agent/skills/code-review-checklist/SKILL.md +163 -163
- package/.agent/skills/codebase-design/SKILL.md +76 -76
- package/.agent/skills/colorize/SKILL.md +57 -57
- package/.agent/skills/compact-landing/SKILL.md +50 -50
- package/.agent/skills/company-logos/SKILL.md +54 -54
- package/.agent/skills/config-validator/SKILL.md +125 -125
- package/.agent/skills/containerization-pro/SKILL.md +422 -422
- package/.agent/skills/context-engineering-pro/SKILL.md +69 -62
- package/.agent/skills/create-design-md/SKILL.md +92 -92
- package/.agent/skills/critique/SKILL.md +79 -79
- package/.agent/skills/csharp-developer/SKILL.md +478 -478
- package/.agent/skills/data-validation-schemas/SKILL.md +297 -297
- package/.agent/skills/database-design/SKILL.md +219 -219
- package/.agent/skills/delight/SKILL.md +46 -46
- package/.agent/skills/deployment-procedures/SKILL.md +132 -132
- package/.agent/skills/design-lab/SKILL.md +42 -42
- package/.agent/skills/devops-engineer/SKILL.md +305 -305
- package/.agent/skills/devops-incident-responder/SKILL.md +103 -103
- package/.agent/skills/diagnosing-bugs/SKILL.md +172 -172
- package/.agent/skills/distill/SKILL.md +45 -45
- package/.agent/skills/documentation-templates/SKILL.md +251 -251
- package/.agent/skills/domain-modeling/SKILL.md +61 -61
- package/.agent/skills/duckdb-analytical-sql/SKILL.md +51 -51
- package/.agent/skills/edge-ai-mobile/SKILL.md +42 -42
- package/.agent/skills/edge-computing/SKILL.md +143 -143
- package/.agent/skills/emil-design-eng/SKILL.md +134 -134
- package/.agent/skills/error-resilience/SKILL.md +403 -403
- package/.agent/skills/expo-router-v4/SKILL.md +72 -72
- package/.agent/skills/extract-design-system/SKILL.md +120 -120
- package/.agent/skills/fabel-protocol/SKILL.md +282 -277
- package/.agent/skills/failure-mode-analysis/SKILL.md +48 -0
- package/.agent/skills/fixing-accessibility/SKILL.md +87 -87
- package/.agent/skills/fixing-metadata/SKILL.md +83 -83
- package/.agent/skills/fixing-motion-performance/SKILL.md +78 -78
- package/.agent/skills/framer-motion-expert/SKILL.md +237 -237
- package/.agent/skills/frontend-design/SKILL.md +103 -103
- package/.agent/skills/frontend-security-expert/SKILL.md +56 -56
- package/.agent/skills/game-design-expert/SKILL.md +92 -92
- package/.agent/skills/game-engineering-expert/SKILL.md +108 -108
- package/.agent/skills/generative-ui-expert/SKILL.md +100 -100
- package/.agent/skills/geo-fundamentals/SKILL.md +108 -108
- package/.agent/skills/git-pro/SKILL.md +401 -401
- package/.agent/skills/github-operations/SKILL.md +295 -295
- package/.agent/skills/gpt-taste/SKILL.md +50 -50
- package/.agent/skills/graph-engineering/SKILL.md +28 -0
- package/.agent/skills/gsap-core/SKILL.md +277 -277
- package/.agent/skills/gsap-frameworks/SKILL.md +168 -168
- package/.agent/skills/gsap-performance/SKILL.md +94 -94
- package/.agent/skills/gsap-plugins/SKILL.md +441 -441
- package/.agent/skills/gsap-react/SKILL.md +213 -213
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +312 -312
- package/.agent/skills/gsap-timeline/SKILL.md +122 -122
- package/.agent/skills/gsap-utils/SKILL.md +299 -299
- package/.agent/skills/harden/SKILL.md +55 -55
- package/.agent/skills/harness-protocol/SKILL.md +48 -40
- package/.agent/skills/hf-cli/SKILL.md +239 -0
- package/.agent/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
- package/.agent/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
- package/.agent/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
- package/.agent/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
- package/.agent/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
- package/.agent/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
- package/.agent/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
- package/.agent/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
- package/.agent/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
- package/.agent/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
- package/.agent/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
- package/.agent/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
- package/.agent/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
- package/.agent/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
- package/.agent/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
- package/.agent/skills/hf-mem/SKILL.md +79 -0
- package/.agent/skills/huggingface-best/SKILL.md +134 -0
- package/.agent/skills/huggingface-community-evals/SKILL.md +207 -0
- package/.agent/skills/huggingface-community-evals/examples/.env.example +3 -0
- package/.agent/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
- package/.agent/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
- package/.agent/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
- package/.agent/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
- package/.agent/skills/huggingface-datasets/SKILL.md +107 -0
- package/.agent/skills/huggingface-gradio/SKILL.md +298 -0
- package/.agent/skills/huggingface-gradio/examples.md +613 -0
- package/.agent/skills/huggingface-llm-trainer/SKILL.md +738 -0
- package/.agent/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
- package/.agent/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
- package/.agent/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
- package/.agent/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
- package/.agent/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
- package/.agent/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
- package/.agent/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
- package/.agent/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
- package/.agent/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
- package/.agent/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
- package/.agent/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
- package/.agent/skills/huggingface-local-models/SKILL.md +113 -0
- package/.agent/skills/huggingface-local-models/references/hardware.md +38 -0
- package/.agent/skills/huggingface-local-models/references/hub-discovery.md +178 -0
- package/.agent/skills/huggingface-local-models/references/quantization.md +256 -0
- package/.agent/skills/huggingface-lora-space-builder/SKILL.md +394 -0
- package/.agent/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
- package/.agent/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
- package/.agent/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
- package/.agent/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
- package/.agent/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
- package/.agent/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
- package/.agent/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
- package/.agent/skills/huggingface-paper-publisher/SKILL.md +624 -0
- package/.agent/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
- package/.agent/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
- package/.agent/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
- package/.agent/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
- package/.agent/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
- package/.agent/skills/huggingface-paper-publisher/templates/modern.md +319 -0
- package/.agent/skills/huggingface-paper-publisher/templates/standard.md +201 -0
- package/.agent/skills/huggingface-papers/SKILL.md +239 -0
- package/.agent/skills/huggingface-spaces/README.md +9 -0
- package/.agent/skills/huggingface-spaces/SKILL.md +242 -0
- package/.agent/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
- package/.agent/skills/huggingface-spaces/references/3d-generation.md +98 -0
- package/.agent/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
- package/.agent/skills/huggingface-spaces/references/3d-models.md +227 -0
- package/.agent/skills/huggingface-spaces/references/3d-outputs.md +114 -0
- package/.agent/skills/huggingface-spaces/references/buckets.md +89 -0
- package/.agent/skills/huggingface-spaces/references/debugging.md +236 -0
- package/.agent/skills/huggingface-spaces/references/gradio.md +200 -0
- package/.agent/skills/huggingface-spaces/references/grants.md +63 -0
- package/.agent/skills/huggingface-spaces/references/inference-providers.md +97 -0
- package/.agent/skills/huggingface-spaces/references/known-errors.md +232 -0
- package/.agent/skills/huggingface-spaces/references/requirements.md +169 -0
- package/.agent/skills/huggingface-spaces/references/zerogpu.md +349 -0
- package/.agent/skills/huggingface-tool-builder/SKILL.md +120 -0
- package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
- package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
- package/.agent/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
- package/.agent/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
- package/.agent/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
- package/.agent/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
- package/.agent/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
- package/.agent/skills/huggingface-trackio/SKILL.md +142 -0
- package/.agent/skills/huggingface-trackio/references/alerts.md +196 -0
- package/.agent/skills/huggingface-trackio/references/logging_metrics.md +212 -0
- package/.agent/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
- package/.agent/skills/huggingface-vision-trainer/SKILL.md +593 -0
- package/.agent/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
- package/.agent/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
- package/.agent/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
- package/.agent/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
- package/.agent/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
- package/.agent/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
- package/.agent/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
- package/.agent/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
- package/.agent/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
- package/.agent/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
- package/.agent/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
- package/.agent/skills/huggingface-zerogpu/SKILL.md +289 -0
- package/.agent/skills/huggingface-zerogpu/references/concurrency.md +79 -0
- package/.agent/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
- package/.agent/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
- package/.agent/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
- package/.agent/skills/human-gate-negotiation/SKILL.md +30 -0
- package/.agent/skills/i18n-localization/SKILL.md +134 -134
- package/.agent/skills/impeccable/SKILL.md +52 -52
- package/.agent/skills/improve-codebase-architecture/SKILL.md +48 -48
- package/.agent/skills/improve-ui/SKILL.md +70 -70
- package/.agent/skills/intelligent-routing/SKILL.md +204 -198
- package/.agent/skills/knowledge-graph/SKILL.md +71 -71
- package/.agent/skills/landing-page/SKILL.md +65 -65
- package/.agent/skills/lint-and-validate/SKILL.md +224 -224
- package/.agent/skills/llm-engineering/SKILL.md +360 -360
- package/.agent/skills/local-first/SKILL.md +138 -138
- package/.agent/skills/local-first-architecture/SKILL.md +62 -62
- package/.agent/skills/lottie-animation/SKILL.md +62 -62
- package/.agent/skills/marquee-loop/SKILL.md +72 -72
- package/.agent/skills/masked-reveal/SKILL.md +230 -230
- package/.agent/skills/mcp-builder/SKILL.md +105 -105
- package/.agent/skills/micro-interaction/SKILL.md +253 -253
- package/.agent/skills/mobile-design/SKILL.md +245 -245
- package/.agent/skills/monorepo-management/SKILL.md +295 -295
- package/.agent/skills/morphing-icons/SKILL.md +348 -348
- package/.agent/skills/motion-engineering/SKILL.md +197 -197
- package/.agent/skills/nextjs-react-expert/SKILL.md +218 -218
- package/.agent/skills/nodejs-best-practices/SKILL.md +542 -542
- package/.agent/skills/observability/SKILL.md +303 -303
- package/.agent/skills/opentelemetry-observability/SKILL.md +51 -51
- package/.agent/skills/page-transition-animation/SKILL.md +86 -86
- package/.agent/skills/parallel-agents/SKILL.md +110 -110
- package/.agent/skills/performance-profiling/SKILL.md +230 -230
- package/.agent/skills/plan-writing/SKILL.md +127 -127
- package/.agent/skills/platform-engineer/SKILL.md +108 -108
- package/.agent/skills/platform-engineering-opentofu/SKILL.md +59 -59
- package/.agent/skills/playwright-ai-e2e/SKILL.md +52 -52
- package/.agent/skills/playwright-best-practices/SKILL.md +149 -149
- package/.agent/skills/polish/SKILL.md +39 -39
- package/.agent/skills/powershell-windows/SKILL.md +122 -122
- package/.agent/skills/pricing-page/SKILL.md +48 -48
- package/.agent/skills/product-aware-heuristics/SKILL.md +390 -390
- package/.agent/skills/progressive-blur/SKILL.md +80 -80
- package/.agent/skills/project-idioms/SKILL.md +91 -91
- package/.agent/skills/property-based-testing/SKILL.md +50 -50
- package/.agent/skills/python-patterns/SKILL.md +220 -220
- package/.agent/skills/python-pro/SKILL.md +305 -305
- package/.agent/skills/quieter/SKILL.md +49 -49
- package/.agent/skills/react-doctor/SKILL.md +51 -51
- package/.agent/skills/react-specialist/SKILL.md +280 -280
- package/.agent/skills/readme-builder/SKILL.md +270 -270
- package/.agent/skills/realtime-patterns/SKILL.md +283 -283
- package/.agent/skills/red-team-tactics/SKILL.md +191 -191
- package/.agent/skills/redesign-skill/SKILL.md +46 -46
- package/.agent/skills/review-animations/SKILL.md +45 -45
- package/.agent/skills/review-animations/STANDARDS.md +87 -87
- package/.agent/skills/rust-pro/SKILL.md +652 -652
- package/.agent/skills/semantic-filesystem-navigation/SKILL.md +24 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +139 -139
- package/.agent/skills/server-management/SKILL.md +178 -178
- package/.agent/skills/session-log-interrogation/SKILL.md +29 -0
- package/.agent/skills/shadcn-ui-expert/SKILL.md +196 -196
- package/.agent/skills/shape/SKILL.md +56 -56
- package/.agent/skills/skill-creator/SKILL.md +177 -177
- package/.agent/skills/soft-skill/SKILL.md +53 -53
- package/.agent/skills/sounds-on-the-web/SKILL.md +76 -76
- package/.agent/skills/sql-pro/SKILL.md +624 -624
- package/.agent/skills/subagent-driven-development/SKILL.md +32 -0
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +57 -57
- package/.agent/skills/svg-animation/SKILL.md +356 -356
- package/.agent/skills/swiftui-expert/SKILL.md +164 -164
- package/.agent/skills/swiss-design/SKILL.md +44 -44
- package/.agent/skills/system-design-pro/SKILL.md +188 -318
- package/.agent/skills/systematic-debugging/SKILL.md +129 -124
- package/.agent/skills/systematic-debugging/condition-based-waiting.md +120 -120
- package/.agent/skills/systematic-debugging/defense-in-depth.md +128 -128
- package/.agent/skills/systematic-debugging/root-cause-tracing.md +183 -183
- package/.agent/skills/tailwind-patterns/SKILL.md +583 -583
- package/.agent/skills/taste-skill/SKILL.md +52 -52
- package/.agent/skills/tdd-workflow/SKILL.md +105 -105
- package/.agent/skills/test-result-analyzer/SKILL.md +270 -270
- package/.agent/skills/testing-patterns/SKILL.md +534 -534
- package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +62 -62
- package/.agent/skills/thinking-protocol/SKILL.md +21 -21
- package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +43 -43
- package/.agent/skills/train-sentence-transformers/SKILL.md +109 -0
- package/.agent/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
- package/.agent/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
- package/.agent/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
- package/.agent/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
- package/.agent/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
- package/.agent/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
- package/.agent/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
- package/.agent/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
- package/.agent/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
- package/.agent/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
- package/.agent/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
- package/.agent/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
- package/.agent/skills/train-sentence-transformers/references/model_architectures.md +178 -0
- package/.agent/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
- package/.agent/skills/train-sentence-transformers/references/training_args.md +270 -0
- package/.agent/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
- package/.agent/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
- package/.agent/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
- package/.agent/skills/transformers-js/SKILL.md +692 -0
- package/.agent/skills/transformers-js/references/CACHE.md +339 -0
- package/.agent/skills/transformers-js/references/CONFIGURATION.md +438 -0
- package/.agent/skills/transformers-js/references/EXAMPLES.md +620 -0
- package/.agent/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
- package/.agent/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
- package/.agent/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
- package/.agent/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
- package/.agent/skills/transitions-dev/SKILL.md +90 -90
- package/.agent/skills/trend-researcher/SKILL.md +198 -198
- package/.agent/skills/tribunal-instincts-memory/SKILL.md +31 -0
- package/.agent/skills/trl-training/SKILL.md +318 -0
- package/.agent/skills/typescript-advanced/SKILL.md +306 -306
- package/.agent/skills/typeset/SKILL.md +60 -60
- package/.agent/skills/ui-reasoning-engine/SKILL.md +155 -155
- package/.agent/skills/ui-skill-packs/SKILL.md +57 -57
- package/.agent/skills/ui-skills-root/SKILL.md +69 -69
- package/.agent/skills/ui-ux-pro-max/SKILL.md +110 -110
- package/.agent/skills/ui-ux-researcher/SKILL.md +199 -199
- package/.agent/skills/vector-search-pgvector/SKILL.md +70 -70
- package/.agent/skills/verification-before-completion/SKILL.md +107 -107
- package/.agent/skills/vue-expert/SKILL.md +259 -259
- package/.agent/skills/vulnerability-scanner/SKILL.md +378 -378
- package/.agent/skills/web-accessibility-auditor/SKILL.md +179 -179
- package/.agent/skills/web-design-guidelines/SKILL.md +49 -49
- package/.agent/skills/web-quality-audit/SKILL.md +47 -47
- package/.agent/skills/webapp-testing/SKILL.md +128 -128
- package/.agent/skills/webgpu-performance/SKILL.md +88 -88
- package/.agent/skills/whimsy-injector/SKILL.md +305 -305
- package/.agent/skills/workflow-optimizer/SKILL.md +188 -188
- package/.agent/skills/zero-trust-passkeys/SKILL.md +82 -82
- package/.agent/templates/DESIGN.md +843 -843
- package/.agent/templates/design-tokens.json +140 -140
- package/.agent/templates/sdd/implementer-prompt.md +62 -62
- package/.agent/templates/sdd/re-review-prompt.md +36 -36
- package/.agent/templates/sdd/task-reviewer-prompt.md +78 -78
- package/.agent/workflows/acf.md +153 -153
- package/.agent/workflows/api-tester.md +189 -189
- package/.agent/workflows/assimilate.md +21 -0
- package/.agent/workflows/audit-live.md +53 -53
- package/.agent/workflows/audit.md +172 -167
- package/.agent/workflows/brainstorm.md +157 -157
- package/.agent/workflows/changelog.md +152 -152
- package/.agent/workflows/compare-web.md +35 -35
- package/.agent/workflows/context.md +102 -102
- package/.agent/workflows/contract.md +79 -79
- package/.agent/workflows/create.md +182 -182
- package/.agent/workflows/debug.md +201 -201
- package/.agent/workflows/deploy.md +215 -215
- package/.agent/workflows/enhance.md +165 -165
- package/.agent/workflows/fix-ci.md +94 -94
- package/.agent/workflows/fix.md +149 -149
- package/.agent/workflows/generate.md +216 -211
- package/.agent/workflows/htop.md +22 -0
- package/.agent/workflows/marathon.md +291 -286
- package/.agent/workflows/migrate.md +198 -198
- package/.agent/workflows/minimal.md +101 -101
- package/.agent/workflows/orchestrate.md +205 -205
- package/.agent/workflows/performance-benchmarker.md +148 -148
- package/.agent/workflows/pipeline.md +165 -165
- package/.agent/workflows/plan.md +206 -206
- package/.agent/workflows/preview.md +116 -116
- package/.agent/workflows/refactor.md +207 -207
- package/.agent/workflows/resume.md +20 -0
- package/.agent/workflows/review-ai.md +139 -139
- package/.agent/workflows/review.md +155 -155
- package/.agent/workflows/sdd.md +137 -137
- package/.agent/workflows/session.md +135 -135
- package/.agent/workflows/skill-enhancement-engine.md +84 -84
- package/.agent/workflows/status.md +112 -112
- package/.agent/workflows/strengthen-skills.md +174 -174
- package/.agent/workflows/super-prompt.md +146 -146
- package/.agent/workflows/swarm.md +218 -218
- package/.agent/workflows/team-mode.md +22 -0
- package/.agent/workflows/test.md +224 -224
- package/.agent/workflows/tribunal-backend.md +149 -149
- package/.agent/workflows/tribunal-cicd.md +109 -109
- package/.agent/workflows/tribunal-database.md +142 -142
- package/.agent/workflows/tribunal-frontend.md +157 -157
- package/.agent/workflows/tribunal-full.md +156 -156
- package/.agent/workflows/tribunal-mobile.md +142 -142
- package/.agent/workflows/tribunal-performance.md +149 -149
- package/.agent/workflows/tribunal-speed.md +222 -222
- package/.agent/workflows/tribunal-ui.md +97 -97
- package/.agent/workflows/ui-ux-pro-max.md +103 -103
- package/.agents/skills/12-principles-of-animation/SKILL.md +51 -51
- package/.agents/skills/60fps-animation/SKILL.md +91 -91
- package/.agents/skills/accessible-animation/SKILL.md +189 -189
- package/.agents/skills/adapt/SKILL.md +56 -56
- package/.agents/skills/adr-generation/SKILL.md +57 -0
- package/.agents/skills/advanced-rag-pipelines/SKILL.md +94 -94
- package/.agents/skills/agent-organizer/SKILL.md +117 -117
- package/.agents/skills/agent-syscall-guidelines/SKILL.md +25 -0
- package/.agents/skills/agentic-patterns/SKILL.md +281 -281
- package/.agents/skills/agentic-workflows-2026/SKILL.md +91 -83
- package/.agents/skills/agentshield-security/SKILL.md +26 -0
- package/.agents/skills/ai-app-hardening/SKILL.md +51 -51
- package/.agents/skills/ai-prompt-injection-defense/SKILL.md +162 -162
- package/.agents/skills/animation-on-scroll/SKILL.md +196 -196
- package/.agents/skills/animation-systems/SKILL.md +198 -198
- package/.agents/skills/antfu-conventions/SKILL.md +54 -54
- package/.agents/skills/api-patterns/SKILL.md +218 -218
- package/.agents/skills/api-security-auditor/SKILL.md +155 -155
- package/.agents/skills/app-builder/SKILL.md +535 -535
- package/.agents/skills/app-builder/templates/SKILL.md +108 -108
- package/.agents/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -76
- package/.agents/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -92
- package/.agents/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -88
- package/.agents/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -88
- package/.agents/skills/app-builder/templates/express-api/TEMPLATE.md +83 -83
- package/.agents/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -90
- package/.agents/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -90
- package/.agents/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -126
- package/.agents/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +127 -127
- package/.agents/skills/app-builder/templates/nextjs-static/TEMPLATE.md +172 -172
- package/.agents/skills/app-builder/templates/nuxt-app/TEMPLATE.md +139 -139
- package/.agents/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -83
- package/.agents/skills/app-builder/templates/react-native-app/TEMPLATE.md +122 -122
- package/.agents/skills/appflow-wireframe/SKILL.md +96 -96
- package/.agents/skills/apple-design/SKILL.md +89 -89
- package/.agents/skills/architecture/SKILL.md +188 -188
- package/.agents/skills/architecture-drift/SKILL.md +45 -0
- package/.agents/skills/audit-and-fix/SKILL.md +100 -100
- package/.agents/skills/authentication-best-practices/SKILL.md +157 -157
- package/.agents/skills/autonomous-execution/SKILL.md +76 -0
- package/.agents/skills/backend-security-expert/SKILL.md +73 -73
- package/.agents/skills/baseline-ui/SKILL.md +55 -55
- package/.agents/skills/bash-linux/SKILL.md +139 -139
- package/.agents/skills/behavioral-modes/SKILL.md +200 -200
- package/.agents/skills/better-colors/SKILL.md +116 -116
- package/.agents/skills/better-typography/SKILL.md +90 -90
- package/.agents/skills/better-ui/SKILL.md +130 -130
- package/.agents/skills/bolder/SKILL.md +49 -49
- package/.agents/skills/brainstorming/SKILL.md +460 -460
- package/.agents/skills/browser-audit/SKILL.md +102 -102
- package/.agents/skills/browser-native-ai/SKILL.md +72 -72
- package/.agents/skills/build-primitive/SKILL.md +50 -50
- package/.agents/skills/building-native-ui/SKILL.md +162 -162
- package/.agents/skills/cicd-pro/SKILL.md +412 -412
- package/.agents/skills/clarify/SKILL.md +55 -55
- package/.agents/skills/clean-code/SKILL.md +367 -367
- package/.agents/skills/cloud-architect/SKILL.md +409 -409
- package/.agents/skills/cobejs/SKILL.md +70 -70
- package/.agents/skills/code-review-checklist/SKILL.md +163 -163
- package/.agents/skills/codebase-design/SKILL.md +76 -76
- package/.agents/skills/colorize/SKILL.md +57 -57
- package/.agents/skills/compact-landing/SKILL.md +50 -50
- package/.agents/skills/company-logos/SKILL.md +54 -54
- package/.agents/skills/config-validator/SKILL.md +125 -125
- package/.agents/skills/containerization-pro/SKILL.md +422 -422
- package/.agents/skills/context-engineering-pro/SKILL.md +69 -62
- package/.agents/skills/create-design-md/SKILL.md +92 -92
- package/.agents/skills/critique/SKILL.md +79 -79
- package/.agents/skills/csharp-developer/SKILL.md +478 -478
- package/.agents/skills/data-validation-schemas/SKILL.md +297 -297
- package/.agents/skills/database-design/SKILL.md +219 -219
- package/.agents/skills/delight/SKILL.md +46 -46
- package/.agents/skills/deployment-procedures/SKILL.md +132 -132
- package/.agents/skills/design-lab/SKILL.md +42 -42
- package/.agents/skills/devops-engineer/SKILL.md +305 -305
- package/.agents/skills/devops-incident-responder/SKILL.md +103 -103
- package/.agents/skills/diagnosing-bugs/SKILL.md +172 -172
- package/.agents/skills/distill/SKILL.md +45 -45
- package/.agents/skills/documentation-templates/SKILL.md +251 -251
- package/.agents/skills/domain-modeling/SKILL.md +61 -61
- package/.agents/skills/duckdb-analytical-sql/SKILL.md +51 -51
- package/.agents/skills/edge-ai-mobile/SKILL.md +42 -42
- package/.agents/skills/edge-computing/SKILL.md +143 -143
- package/.agents/skills/emil-design-eng/SKILL.md +134 -134
- package/.agents/skills/error-resilience/SKILL.md +403 -403
- package/.agents/skills/expo-router-v4/SKILL.md +72 -72
- package/.agents/skills/extract-design-system/SKILL.md +120 -120
- package/.agents/skills/fabel-protocol/SKILL.md +282 -277
- package/.agents/skills/failure-mode-analysis/SKILL.md +48 -0
- package/.agents/skills/fixing-accessibility/SKILL.md +87 -87
- package/.agents/skills/fixing-metadata/SKILL.md +83 -83
- package/.agents/skills/fixing-motion-performance/SKILL.md +78 -78
- package/.agents/skills/framer-motion-expert/SKILL.md +237 -237
- package/.agents/skills/frontend-design/SKILL.md +103 -103
- package/.agents/skills/frontend-security-expert/SKILL.md +56 -56
- package/.agents/skills/game-design-expert/SKILL.md +92 -92
- package/.agents/skills/game-engineering-expert/SKILL.md +108 -108
- package/.agents/skills/generative-ui-expert/SKILL.md +100 -100
- package/.agents/skills/geo-fundamentals/SKILL.md +108 -108
- package/.agents/skills/git-pro/SKILL.md +401 -401
- package/.agents/skills/github-operations/SKILL.md +295 -295
- package/.agents/skills/gpt-taste/SKILL.md +50 -50
- package/.agents/skills/graph-engineering/SKILL.md +28 -0
- package/.agents/skills/gsap-core/SKILL.md +277 -277
- package/.agents/skills/gsap-frameworks/SKILL.md +168 -168
- package/.agents/skills/gsap-performance/SKILL.md +94 -94
- package/.agents/skills/gsap-plugins/SKILL.md +441 -441
- package/.agents/skills/gsap-react/SKILL.md +213 -213
- package/.agents/skills/gsap-scrolltrigger/SKILL.md +312 -312
- package/.agents/skills/gsap-timeline/SKILL.md +122 -122
- package/.agents/skills/gsap-utils/SKILL.md +299 -299
- package/.agents/skills/harden/SKILL.md +55 -55
- package/.agents/skills/harness-protocol/SKILL.md +48 -40
- package/.agents/skills/hf-cli/SKILL.md +239 -0
- package/.agents/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
- package/.agents/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
- package/.agents/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
- package/.agents/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
- package/.agents/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
- package/.agents/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
- package/.agents/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
- package/.agents/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
- package/.agents/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
- package/.agents/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
- package/.agents/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
- package/.agents/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
- package/.agents/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
- package/.agents/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
- package/.agents/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
- package/.agents/skills/hf-mem/SKILL.md +79 -0
- package/.agents/skills/huggingface-best/SKILL.md +134 -0
- package/.agents/skills/huggingface-community-evals/SKILL.md +207 -0
- package/.agents/skills/huggingface-community-evals/examples/.env.example +3 -0
- package/.agents/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
- package/.agents/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
- package/.agents/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
- package/.agents/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
- package/.agents/skills/huggingface-datasets/SKILL.md +107 -0
- package/.agents/skills/huggingface-gradio/SKILL.md +298 -0
- package/.agents/skills/huggingface-gradio/examples.md +613 -0
- package/.agents/skills/huggingface-llm-trainer/SKILL.md +738 -0
- package/.agents/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
- package/.agents/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
- package/.agents/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
- package/.agents/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
- package/.agents/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
- package/.agents/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
- package/.agents/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
- package/.agents/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
- package/.agents/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
- package/.agents/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
- package/.agents/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
- package/.agents/skills/huggingface-local-models/SKILL.md +113 -0
- package/.agents/skills/huggingface-local-models/references/hardware.md +38 -0
- package/.agents/skills/huggingface-local-models/references/hub-discovery.md +178 -0
- package/.agents/skills/huggingface-local-models/references/quantization.md +256 -0
- package/.agents/skills/huggingface-lora-space-builder/SKILL.md +394 -0
- package/.agents/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
- package/.agents/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
- package/.agents/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
- package/.agents/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
- package/.agents/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
- package/.agents/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
- package/.agents/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
- package/.agents/skills/huggingface-paper-publisher/SKILL.md +624 -0
- package/.agents/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
- package/.agents/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
- package/.agents/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
- package/.agents/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
- package/.agents/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
- package/.agents/skills/huggingface-paper-publisher/templates/modern.md +319 -0
- package/.agents/skills/huggingface-paper-publisher/templates/standard.md +201 -0
- package/.agents/skills/huggingface-papers/SKILL.md +239 -0
- package/.agents/skills/huggingface-spaces/README.md +9 -0
- package/.agents/skills/huggingface-spaces/SKILL.md +242 -0
- package/.agents/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
- package/.agents/skills/huggingface-spaces/references/3d-generation.md +98 -0
- package/.agents/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
- package/.agents/skills/huggingface-spaces/references/3d-models.md +227 -0
- package/.agents/skills/huggingface-spaces/references/3d-outputs.md +114 -0
- package/.agents/skills/huggingface-spaces/references/buckets.md +89 -0
- package/.agents/skills/huggingface-spaces/references/debugging.md +236 -0
- package/.agents/skills/huggingface-spaces/references/gradio.md +200 -0
- package/.agents/skills/huggingface-spaces/references/grants.md +63 -0
- package/.agents/skills/huggingface-spaces/references/inference-providers.md +97 -0
- package/.agents/skills/huggingface-spaces/references/known-errors.md +232 -0
- package/.agents/skills/huggingface-spaces/references/requirements.md +169 -0
- package/.agents/skills/huggingface-spaces/references/zerogpu.md +349 -0
- package/.agents/skills/huggingface-tool-builder/SKILL.md +120 -0
- package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
- package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
- package/.agents/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
- package/.agents/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
- package/.agents/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
- package/.agents/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
- package/.agents/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
- package/.agents/skills/huggingface-trackio/SKILL.md +142 -0
- package/.agents/skills/huggingface-trackio/references/alerts.md +196 -0
- package/.agents/skills/huggingface-trackio/references/logging_metrics.md +212 -0
- package/.agents/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
- package/.agents/skills/huggingface-vision-trainer/SKILL.md +593 -0
- package/.agents/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
- package/.agents/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
- package/.agents/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
- package/.agents/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
- package/.agents/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
- package/.agents/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
- package/.agents/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
- package/.agents/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
- package/.agents/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
- package/.agents/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
- package/.agents/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
- package/.agents/skills/huggingface-zerogpu/SKILL.md +289 -0
- package/.agents/skills/huggingface-zerogpu/references/concurrency.md +79 -0
- package/.agents/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
- package/.agents/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
- package/.agents/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
- package/.agents/skills/human-gate-negotiation/SKILL.md +30 -0
- package/.agents/skills/i18n-localization/SKILL.md +134 -134
- package/.agents/skills/impeccable/SKILL.md +52 -52
- package/.agents/skills/improve-codebase-architecture/SKILL.md +48 -48
- package/.agents/skills/improve-ui/SKILL.md +70 -70
- package/.agents/skills/intelligent-routing/SKILL.md +204 -198
- package/.agents/skills/knowledge-graph/SKILL.md +71 -71
- package/.agents/skills/landing-page/SKILL.md +65 -65
- package/.agents/skills/lint-and-validate/SKILL.md +224 -224
- package/.agents/skills/llm-engineering/SKILL.md +360 -360
- package/.agents/skills/local-first/SKILL.md +138 -138
- package/.agents/skills/local-first-architecture/SKILL.md +62 -62
- package/.agents/skills/lottie-animation/SKILL.md +62 -62
- package/.agents/skills/marquee-loop/SKILL.md +72 -72
- package/.agents/skills/masked-reveal/SKILL.md +230 -230
- package/.agents/skills/mcp-builder/SKILL.md +105 -105
- package/.agents/skills/micro-interaction/SKILL.md +253 -253
- package/.agents/skills/mobile-design/SKILL.md +245 -245
- package/.agents/skills/monorepo-management/SKILL.md +295 -295
- package/.agents/skills/morphing-icons/SKILL.md +348 -348
- package/.agents/skills/motion-engineering/SKILL.md +197 -197
- package/.agents/skills/nextjs-react-expert/SKILL.md +218 -218
- package/.agents/skills/nodejs-best-practices/SKILL.md +542 -542
- package/.agents/skills/observability/SKILL.md +303 -303
- package/.agents/skills/opentelemetry-observability/SKILL.md +51 -51
- package/.agents/skills/page-transition-animation/SKILL.md +86 -86
- package/.agents/skills/parallel-agents/SKILL.md +110 -110
- package/.agents/skills/performance-profiling/SKILL.md +230 -230
- package/.agents/skills/plan-writing/SKILL.md +127 -127
- package/.agents/skills/platform-engineer/SKILL.md +108 -108
- package/.agents/skills/platform-engineering-opentofu/SKILL.md +59 -59
- package/.agents/skills/playwright-ai-e2e/SKILL.md +52 -52
- package/.agents/skills/playwright-best-practices/SKILL.md +149 -149
- package/.agents/skills/polish/SKILL.md +39 -39
- package/.agents/skills/powershell-windows/SKILL.md +122 -122
- package/.agents/skills/pricing-page/SKILL.md +48 -48
- package/.agents/skills/product-aware-heuristics/SKILL.md +390 -390
- package/.agents/skills/progressive-blur/SKILL.md +80 -80
- package/.agents/skills/project-idioms/SKILL.md +91 -91
- package/.agents/skills/property-based-testing/SKILL.md +50 -50
- package/.agents/skills/python-patterns/SKILL.md +220 -220
- package/.agents/skills/python-pro/SKILL.md +305 -305
- package/.agents/skills/quieter/SKILL.md +49 -49
- package/.agents/skills/react-doctor/SKILL.md +51 -51
- package/.agents/skills/react-specialist/SKILL.md +280 -280
- package/.agents/skills/readme-builder/SKILL.md +270 -270
- package/.agents/skills/realtime-patterns/SKILL.md +283 -283
- package/.agents/skills/red-team-tactics/SKILL.md +191 -191
- package/.agents/skills/redesign-skill/SKILL.md +46 -46
- package/.agents/skills/review-animations/SKILL.md +45 -45
- package/.agents/skills/review-animations/STANDARDS.md +87 -87
- package/.agents/skills/rust-pro/SKILL.md +652 -652
- package/.agents/skills/semantic-filesystem-navigation/SKILL.md +24 -0
- package/.agents/skills/seo-fundamentals/SKILL.md +139 -139
- package/.agents/skills/server-management/SKILL.md +178 -178
- package/.agents/skills/session-log-interrogation/SKILL.md +29 -0
- package/.agents/skills/shadcn-ui-expert/SKILL.md +196 -196
- package/.agents/skills/shape/SKILL.md +56 -56
- package/.agents/skills/skill-creator/SKILL.md +177 -177
- package/.agents/skills/soft-skill/SKILL.md +53 -53
- package/.agents/skills/sounds-on-the-web/SKILL.md +76 -76
- package/.agents/skills/sql-pro/SKILL.md +624 -624
- package/.agents/skills/subagent-driven-development/SKILL.md +32 -0
- package/.agents/skills/supabase-postgres-best-practices/SKILL.md +57 -57
- package/.agents/skills/svg-animation/SKILL.md +356 -356
- package/.agents/skills/swiftui-expert/SKILL.md +164 -164
- package/.agents/skills/swiss-design/SKILL.md +44 -44
- package/.agents/skills/system-design-pro/SKILL.md +188 -318
- package/.agents/skills/systematic-debugging/SKILL.md +129 -124
- package/.agents/skills/systematic-debugging/condition-based-waiting.md +120 -120
- package/.agents/skills/systematic-debugging/defense-in-depth.md +128 -128
- package/.agents/skills/systematic-debugging/root-cause-tracing.md +183 -183
- package/.agents/skills/tailwind-patterns/SKILL.md +583 -583
- package/.agents/skills/taste-skill/SKILL.md +52 -52
- package/.agents/skills/tdd-workflow/SKILL.md +105 -105
- package/.agents/skills/test-result-analyzer/SKILL.md +270 -270
- package/.agents/skills/testing-patterns/SKILL.md +534 -534
- package/.agents/skills/thermo-nuclear-code-quality-review/SKILL.md +62 -62
- package/.agents/skills/thinking-protocol/SKILL.md +21 -21
- package/.agents/skills/to-spring-or-not-to-spring/SKILL.md +43 -43
- package/.agents/skills/train-sentence-transformers/SKILL.md +109 -0
- package/.agents/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
- package/.agents/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
- package/.agents/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
- package/.agents/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
- package/.agents/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
- package/.agents/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
- package/.agents/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
- package/.agents/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
- package/.agents/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
- package/.agents/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
- package/.agents/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
- package/.agents/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
- package/.agents/skills/train-sentence-transformers/references/model_architectures.md +178 -0
- package/.agents/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
- package/.agents/skills/train-sentence-transformers/references/training_args.md +270 -0
- package/.agents/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
- package/.agents/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
- package/.agents/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
- package/.agents/skills/transformers-js/SKILL.md +692 -0
- package/.agents/skills/transformers-js/references/CACHE.md +339 -0
- package/.agents/skills/transformers-js/references/CONFIGURATION.md +438 -0
- package/.agents/skills/transformers-js/references/EXAMPLES.md +620 -0
- package/.agents/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
- package/.agents/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
- package/.agents/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
- package/.agents/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
- package/.agents/skills/transitions-dev/SKILL.md +90 -90
- package/.agents/skills/trend-researcher/SKILL.md +198 -198
- package/.agents/skills/tribunal-instincts-memory/SKILL.md +31 -0
- package/.agents/skills/trl-training/SKILL.md +318 -0
- package/.agents/skills/typescript-advanced/SKILL.md +306 -306
- package/.agents/skills/typeset/SKILL.md +60 -60
- package/.agents/skills/ui-reasoning-engine/SKILL.md +155 -155
- package/.agents/skills/ui-skill-packs/SKILL.md +57 -57
- package/.agents/skills/ui-skills-root/SKILL.md +69 -69
- package/.agents/skills/ui-ux-pro-max/SKILL.md +110 -110
- package/.agents/skills/ui-ux-researcher/SKILL.md +199 -199
- package/.agents/skills/vector-search-pgvector/SKILL.md +70 -70
- package/.agents/skills/verification-before-completion/SKILL.md +107 -107
- package/.agents/skills/vue-expert/SKILL.md +259 -259
- package/.agents/skills/vulnerability-scanner/SKILL.md +378 -378
- package/.agents/skills/web-accessibility-auditor/SKILL.md +179 -179
- package/.agents/skills/web-design-guidelines/SKILL.md +49 -49
- package/.agents/skills/web-quality-audit/SKILL.md +47 -47
- package/.agents/skills/webapp-testing/SKILL.md +128 -128
- package/.agents/skills/webgpu-performance/SKILL.md +88 -88
- package/.agents/skills/whimsy-injector/SKILL.md +305 -305
- package/.agents/skills/workflow-optimizer/SKILL.md +188 -188
- package/.agents/skills/zero-trust-passkeys/SKILL.md +82 -82
- package/AGENTS.md +93 -93
- package/CLAUDE.md +444 -444
- package/CONTRIBUTING.md +134 -134
- package/README.md +242 -542
- package/SECURITY.md +58 -52
- package/bin/adapter-install.js +264 -264
- package/bin/global-store.js +48 -48
- package/bin/mcp-server.js +1653 -1653
- package/bin/proxy-server.js +122 -122
- package/bin/spawn-agent.js +45 -45
- package/bin/tk-proxy.js +34 -34
- package/bin/tribunal-kit.js +113 -113
- package/bin/wrapper.js +209 -211
- package/hooks/hooks-cursor.json +10 -10
- package/hooks/hooks.json +10 -10
- package/hooks/session-start.js +77 -77
- package/mcp_config.json +18 -18
- package/package.json +169 -179
- package/{.claude-plugin → plugins/claude}/marketplace.json +14 -14
- package/{.claude-plugin → plugins/claude}/plugin.json +26 -26
- package/{.codex-plugin → plugins/codex}/plugin.json +41 -41
- package/{plugin.json → plugins/core-plugin.json} +26 -26
- package/{.cursor-plugin → plugins/cursor}/plugin.json +26 -26
- package/{.devin-plugin → plugins/devin}/plugin.json +14 -14
- package/{gemini-extension.json → plugins/gemini/extension.json} +6 -6
- package/{.hermes-plugin → plugins/hermes}/__init__.py +102 -102
- package/{.hermes-plugin → plugins/hermes}/plugin.yaml +6 -6
- package/{.kimi-plugin → plugins/kimi}/plugin.json +34 -34
- package/{marketplace.json → plugins/marketplace.json} +14 -14
- package/{.opencode → plugins/opencode}/INSTALL.md +42 -42
- package/{.opencode → plugins/opencode}/plugins/tribunal.js +110 -110
- package/{.opencode → plugins/opencode}/rules.md +258 -258
- package/{.pi → plugins/pi}/extensions/tribunal.ts +130 -130
- package/scripts/apply-version.js +57 -57
- package/scripts/audit_skill_sdo.js +89 -89
- package/scripts/benchmark.js +231 -231
- package/scripts/build-graph.js +71 -71
- package/scripts/changelog.js +190 -190
- package/scripts/clean-pycache.js +42 -42
- package/scripts/context_compiler.js +1143 -1117
- package/scripts/fix-vbc.js +96 -96
- package/scripts/fix-vbc.ps1 +3 -3
- package/scripts/modernize_skills.js +268 -268
- package/scripts/package-cores.js +116 -116
- package/scripts/skill_enhancement_engine.js +608 -608
- package/scripts/stress_benchmark.js +358 -358
- package/scripts/sync-skills.js +61 -61
- package/scripts/sync-version.js +177 -177
- package/scripts/telemetry_gc.js +156 -156
- package/scripts/validate-payload.js +73 -73
- package/scripts/visual_audit.js +136 -136
- package/skills/12-principles-of-animation/SKILL.md +51 -51
- package/skills/60fps-animation/SKILL.md +91 -91
- package/skills/accessible-animation/SKILL.md +189 -189
- package/skills/adapt/SKILL.md +56 -56
- package/skills/adr-generation/SKILL.md +57 -0
- package/skills/advanced-rag-pipelines/SKILL.md +94 -94
- package/skills/agent-organizer/SKILL.md +117 -117
- package/skills/agent-syscall-guidelines/SKILL.md +25 -0
- package/skills/agentic-patterns/SKILL.md +281 -281
- package/skills/agentic-workflows-2026/SKILL.md +91 -83
- package/skills/agentshield-security/SKILL.md +26 -0
- package/skills/ai-app-hardening/SKILL.md +51 -51
- package/skills/ai-prompt-injection-defense/SKILL.md +162 -162
- package/skills/animation-on-scroll/SKILL.md +196 -196
- package/skills/animation-systems/SKILL.md +198 -198
- package/skills/antfu-conventions/SKILL.md +54 -54
- package/skills/api-patterns/SKILL.md +218 -218
- package/skills/api-security-auditor/SKILL.md +155 -155
- package/skills/app-builder/SKILL.md +535 -535
- package/skills/app-builder/templates/SKILL.md +108 -108
- package/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -76
- package/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -92
- package/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -88
- package/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -88
- package/skills/app-builder/templates/express-api/TEMPLATE.md +83 -83
- package/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -90
- package/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -90
- package/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -126
- package/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +127 -127
- package/skills/app-builder/templates/nextjs-static/TEMPLATE.md +172 -172
- package/skills/app-builder/templates/nuxt-app/TEMPLATE.md +139 -139
- package/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -83
- package/skills/app-builder/templates/react-native-app/TEMPLATE.md +122 -122
- package/skills/appflow-wireframe/SKILL.md +96 -96
- package/skills/apple-design/SKILL.md +89 -89
- package/skills/architecture/SKILL.md +188 -188
- package/skills/architecture-drift/SKILL.md +45 -0
- package/skills/audit-and-fix/SKILL.md +100 -100
- package/skills/authentication-best-practices/SKILL.md +157 -157
- package/skills/autonomous-execution/SKILL.md +76 -0
- package/skills/backend-security-expert/SKILL.md +73 -73
- package/skills/baseline-ui/SKILL.md +55 -55
- package/skills/bash-linux/SKILL.md +139 -139
- package/skills/behavioral-modes/SKILL.md +200 -200
- package/skills/better-colors/SKILL.md +116 -116
- package/skills/better-typography/SKILL.md +90 -90
- package/skills/better-ui/SKILL.md +130 -130
- package/skills/bolder/SKILL.md +49 -49
- package/skills/brainstorming/SKILL.md +460 -460
- package/skills/browser-audit/SKILL.md +102 -102
- package/skills/browser-native-ai/SKILL.md +72 -72
- package/skills/build-primitive/SKILL.md +50 -50
- package/skills/building-native-ui/SKILL.md +162 -162
- package/skills/cicd-pro/SKILL.md +412 -412
- package/skills/clarify/SKILL.md +55 -55
- package/skills/clean-code/SKILL.md +367 -367
- package/skills/cloud-architect/SKILL.md +409 -409
- package/skills/cobejs/SKILL.md +70 -70
- package/skills/code-review-checklist/SKILL.md +163 -163
- package/skills/codebase-design/SKILL.md +76 -76
- package/skills/colorize/SKILL.md +57 -57
- package/skills/compact-landing/SKILL.md +50 -50
- package/skills/company-logos/SKILL.md +54 -54
- package/skills/config-validator/SKILL.md +125 -125
- package/skills/containerization-pro/SKILL.md +422 -422
- package/skills/context-engineering-pro/SKILL.md +69 -62
- package/skills/create-design-md/SKILL.md +92 -92
- package/skills/critique/SKILL.md +79 -79
- package/skills/csharp-developer/SKILL.md +478 -478
- package/skills/data-validation-schemas/SKILL.md +297 -297
- package/skills/database-design/SKILL.md +219 -219
- package/skills/delight/SKILL.md +46 -46
- package/skills/deployment-procedures/SKILL.md +132 -132
- package/skills/design-lab/SKILL.md +42 -42
- package/skills/devops-engineer/SKILL.md +305 -305
- package/skills/devops-incident-responder/SKILL.md +103 -103
- package/skills/diagnosing-bugs/SKILL.md +172 -172
- package/skills/distill/SKILL.md +45 -45
- package/skills/documentation-templates/SKILL.md +251 -251
- package/skills/domain-modeling/SKILL.md +61 -61
- package/skills/duckdb-analytical-sql/SKILL.md +51 -51
- package/skills/edge-ai-mobile/SKILL.md +42 -42
- package/skills/edge-computing/SKILL.md +143 -143
- package/skills/emil-design-eng/SKILL.md +134 -134
- package/skills/error-resilience/SKILL.md +403 -403
- package/skills/expo-router-v4/SKILL.md +72 -72
- package/skills/extract-design-system/SKILL.md +120 -120
- package/skills/fabel-protocol/SKILL.md +282 -277
- package/skills/failure-mode-analysis/SKILL.md +48 -0
- package/skills/fixing-accessibility/SKILL.md +87 -87
- package/skills/fixing-metadata/SKILL.md +83 -83
- package/skills/fixing-motion-performance/SKILL.md +78 -78
- package/skills/framer-motion-expert/SKILL.md +237 -237
- package/skills/frontend-design/SKILL.md +103 -103
- package/skills/frontend-security-expert/SKILL.md +56 -56
- package/skills/game-design-expert/SKILL.md +92 -92
- package/skills/game-engineering-expert/SKILL.md +108 -108
- package/skills/generative-ui-expert/SKILL.md +100 -100
- package/skills/geo-fundamentals/SKILL.md +108 -108
- package/skills/git-pro/SKILL.md +401 -401
- package/skills/github-operations/SKILL.md +295 -295
- package/skills/gpt-taste/SKILL.md +50 -50
- package/skills/graph-engineering/SKILL.md +28 -0
- package/skills/gsap-core/SKILL.md +277 -277
- package/skills/gsap-frameworks/SKILL.md +168 -168
- package/skills/gsap-performance/SKILL.md +94 -94
- package/skills/gsap-plugins/SKILL.md +441 -441
- package/skills/gsap-react/SKILL.md +213 -213
- package/skills/gsap-scrolltrigger/SKILL.md +312 -312
- package/skills/gsap-timeline/SKILL.md +122 -122
- package/skills/gsap-utils/SKILL.md +299 -299
- package/skills/harden/SKILL.md +55 -55
- package/skills/harness-protocol/SKILL.md +48 -40
- package/skills/hf-cli/SKILL.md +239 -0
- package/skills/hf-cloud-aws-context-discovery/SKILL.md +74 -0
- package/skills/hf-cloud-python-env-setup/SKILL.md +90 -0
- package/skills/hf-cloud-python-env-setup/requirements.txt +17 -0
- package/skills/hf-cloud-python-env-setup/scripts/check_versions.py +29 -0
- package/skills/hf-cloud-python-env-setup/scripts/setup_env.py +143 -0
- package/skills/hf-cloud-sagemaker-deployment-planner/SKILL.md +90 -0
- package/skills/hf-cloud-sagemaker-iam-preflight/SKILL.md +102 -0
- package/skills/hf-cloud-sagemaker-iam-preflight/references/minimum-permissions.json +47 -0
- package/skills/hf-cloud-sagemaker-iam-preflight/references/trust-policy.json +12 -0
- package/skills/hf-cloud-sagemaker-iam-preflight/scripts/check_role.py +184 -0
- package/skills/hf-cloud-sagemaker-iam-preflight/scripts/create_role.py +118 -0
- package/skills/hf-cloud-sagemaker-production-defaults/SKILL.md +419 -0
- package/skills/hf-cloud-sagemaker-production-defaults/references/deployment-template.md +59 -0
- package/skills/hf-cloud-sagemaker-production-defaults/scripts/_common.py +148 -0
- package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy.py +327 -0
- package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_async.py +434 -0
- package/skills/hf-cloud-sagemaker-production-defaults/scripts/deploy_ic.py +506 -0
- package/skills/hf-cloud-sagemaker-production-defaults/scripts/invoke_endpoint.py +180 -0
- package/skills/hf-cloud-sagemaker-production-defaults/scripts/teardown.py +246 -0
- package/skills/hf-cloud-serving-image-selection/SKILL.md +220 -0
- package/skills/hf-cloud-serving-image-selection/references/model-to-image.md +111 -0
- package/skills/hf-cloud-serving-image-selection/scripts/mirror_image.py +145 -0
- package/skills/hf-mem/SKILL.md +79 -0
- package/skills/huggingface-best/SKILL.md +134 -0
- package/skills/huggingface-community-evals/SKILL.md +207 -0
- package/skills/huggingface-community-evals/examples/.env.example +3 -0
- package/skills/huggingface-community-evals/examples/USAGE_EXAMPLES.md +101 -0
- package/skills/huggingface-community-evals/scripts/inspect_eval_uv.py +104 -0
- package/skills/huggingface-community-evals/scripts/inspect_vllm_uv.py +306 -0
- package/skills/huggingface-community-evals/scripts/lighteval_vllm_uv.py +297 -0
- package/skills/huggingface-datasets/SKILL.md +107 -0
- package/skills/huggingface-gradio/SKILL.md +298 -0
- package/skills/huggingface-gradio/examples.md +613 -0
- package/skills/huggingface-llm-trainer/SKILL.md +738 -0
- package/skills/huggingface-llm-trainer/references/gguf_conversion.md +296 -0
- package/skills/huggingface-llm-trainer/references/hardware_guide.md +283 -0
- package/skills/huggingface-llm-trainer/references/hub_saving.md +364 -0
- package/skills/huggingface-llm-trainer/references/local_training_macos.md +231 -0
- package/skills/huggingface-llm-trainer/references/reliability_principles.md +371 -0
- package/skills/huggingface-llm-trainer/references/trackio_guide.md +191 -0
- package/skills/huggingface-llm-trainer/references/training_methods.md +150 -0
- package/skills/huggingface-llm-trainer/references/training_patterns.md +203 -0
- package/skills/huggingface-llm-trainer/references/troubleshooting.md +282 -0
- package/skills/huggingface-llm-trainer/references/unsloth.md +313 -0
- package/skills/huggingface-llm-trainer/scripts/convert_to_gguf.py +424 -0
- package/skills/huggingface-llm-trainer/scripts/dataset_inspector.py +417 -0
- package/skills/huggingface-llm-trainer/scripts/estimate_cost.py +150 -0
- package/skills/huggingface-llm-trainer/scripts/hf_benchmarks.py +659 -0
- package/skills/huggingface-llm-trainer/scripts/train_dpo_example.py +106 -0
- package/skills/huggingface-llm-trainer/scripts/train_grpo_example.py +89 -0
- package/skills/huggingface-llm-trainer/scripts/train_sft_example.py +122 -0
- package/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py +512 -0
- package/skills/huggingface-local-models/SKILL.md +113 -0
- package/skills/huggingface-local-models/references/hardware.md +38 -0
- package/skills/huggingface-local-models/references/hub-discovery.md +178 -0
- package/skills/huggingface-local-models/references/quantization.md +256 -0
- package/skills/huggingface-lora-space-builder/SKILL.md +394 -0
- package/skills/huggingface-lora-space-builder/references/adapting-to-the-lora.md +113 -0
- package/skills/huggingface-lora-space-builder/references/base-models/krea-2.md +63 -0
- package/skills/huggingface-lora-space-builder/references/base-models/ltx.md +205 -0
- package/skills/huggingface-lora-space-builder/references/base-models/qwen-image.md +144 -0
- package/skills/huggingface-lora-space-builder/references/creative-mode.md +262 -0
- package/skills/huggingface-lora-space-builder/references/tasks.md +124 -0
- package/skills/huggingface-lora-space-builder/references/zerogpu-and-publishing.md +196 -0
- package/skills/huggingface-paper-publisher/SKILL.md +624 -0
- package/skills/huggingface-paper-publisher/examples/example_usage.md +326 -0
- package/skills/huggingface-paper-publisher/references/quick_reference.md +216 -0
- package/skills/huggingface-paper-publisher/scripts/paper_manager.py +606 -0
- package/skills/huggingface-paper-publisher/templates/arxiv.md +299 -0
- package/skills/huggingface-paper-publisher/templates/ml-report.md +358 -0
- package/skills/huggingface-paper-publisher/templates/modern.md +319 -0
- package/skills/huggingface-paper-publisher/templates/standard.md +201 -0
- package/skills/huggingface-papers/SKILL.md +239 -0
- package/skills/huggingface-spaces/README.md +9 -0
- package/skills/huggingface-spaces/SKILL.md +242 -0
- package/skills/huggingface-spaces/references/3d-cuda-extensions.md +109 -0
- package/skills/huggingface-spaces/references/3d-generation.md +98 -0
- package/skills/huggingface-spaces/references/3d-gsplat.md +53 -0
- package/skills/huggingface-spaces/references/3d-models.md +227 -0
- package/skills/huggingface-spaces/references/3d-outputs.md +114 -0
- package/skills/huggingface-spaces/references/buckets.md +89 -0
- package/skills/huggingface-spaces/references/debugging.md +236 -0
- package/skills/huggingface-spaces/references/gradio.md +200 -0
- package/skills/huggingface-spaces/references/grants.md +63 -0
- package/skills/huggingface-spaces/references/inference-providers.md +97 -0
- package/skills/huggingface-spaces/references/known-errors.md +232 -0
- package/skills/huggingface-spaces/references/requirements.md +169 -0
- package/skills/huggingface-spaces/references/zerogpu.md +349 -0
- package/skills/huggingface-tool-builder/SKILL.md +120 -0
- package/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
- package/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
- package/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
- package/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
- package/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
- package/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
- package/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
- package/skills/huggingface-trackio/SKILL.md +142 -0
- package/skills/huggingface-trackio/references/alerts.md +196 -0
- package/skills/huggingface-trackio/references/logging_metrics.md +212 -0
- package/skills/huggingface-trackio/references/retrieving_metrics.md +251 -0
- package/skills/huggingface-vision-trainer/SKILL.md +593 -0
- package/skills/huggingface-vision-trainer/references/finetune_sam2_trainer.md +254 -0
- package/skills/huggingface-vision-trainer/references/hub_saving.md +618 -0
- package/skills/huggingface-vision-trainer/references/image_classification_training_notebook.md +279 -0
- package/skills/huggingface-vision-trainer/references/object_detection_training_notebook.md +700 -0
- package/skills/huggingface-vision-trainer/references/reliability_principles.md +310 -0
- package/skills/huggingface-vision-trainer/references/timm_trainer.md +91 -0
- package/skills/huggingface-vision-trainer/scripts/dataset_inspector.py +814 -0
- package/skills/huggingface-vision-trainer/scripts/estimate_cost.py +217 -0
- package/skills/huggingface-vision-trainer/scripts/image_classification_training.py +383 -0
- package/skills/huggingface-vision-trainer/scripts/object_detection_training.py +710 -0
- package/skills/huggingface-vision-trainer/scripts/sam_segmentation_training.py +382 -0
- package/skills/huggingface-zerogpu/SKILL.md +289 -0
- package/skills/huggingface-zerogpu/references/concurrency.md +79 -0
- package/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
- package/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
- package/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
- package/skills/human-gate-negotiation/SKILL.md +30 -0
- package/skills/i18n-localization/SKILL.md +134 -134
- package/skills/impeccable/SKILL.md +52 -52
- package/skills/improve-codebase-architecture/SKILL.md +48 -48
- package/skills/improve-ui/SKILL.md +70 -70
- package/skills/intelligent-routing/SKILL.md +204 -198
- package/skills/knowledge-graph/SKILL.md +71 -71
- package/skills/landing-page/SKILL.md +65 -65
- package/skills/lint-and-validate/SKILL.md +224 -224
- package/skills/llm-engineering/SKILL.md +360 -360
- package/skills/local-first/SKILL.md +138 -138
- package/skills/local-first-architecture/SKILL.md +62 -62
- package/skills/lottie-animation/SKILL.md +62 -62
- package/skills/marquee-loop/SKILL.md +72 -72
- package/skills/masked-reveal/SKILL.md +230 -230
- package/skills/mcp-builder/SKILL.md +105 -105
- package/skills/micro-interaction/SKILL.md +253 -253
- package/skills/mobile-design/SKILL.md +245 -245
- package/skills/monorepo-management/SKILL.md +295 -295
- package/skills/morphing-icons/SKILL.md +348 -348
- package/skills/motion-engineering/SKILL.md +197 -197
- package/skills/nextjs-react-expert/SKILL.md +218 -218
- package/skills/nodejs-best-practices/SKILL.md +542 -542
- package/skills/observability/SKILL.md +303 -303
- package/skills/opentelemetry-observability/SKILL.md +51 -51
- package/skills/page-transition-animation/SKILL.md +86 -86
- package/skills/parallel-agents/SKILL.md +110 -110
- package/skills/performance-profiling/SKILL.md +230 -230
- package/skills/plan-writing/SKILL.md +127 -127
- package/skills/platform-engineer/SKILL.md +108 -108
- package/skills/platform-engineering-opentofu/SKILL.md +59 -59
- package/skills/playwright-ai-e2e/SKILL.md +52 -52
- package/skills/playwright-best-practices/SKILL.md +149 -149
- package/skills/polish/SKILL.md +39 -39
- package/skills/powershell-windows/SKILL.md +122 -122
- package/skills/pricing-page/SKILL.md +48 -48
- package/skills/product-aware-heuristics/SKILL.md +390 -390
- package/skills/progressive-blur/SKILL.md +80 -80
- package/skills/project-idioms/SKILL.md +91 -91
- package/skills/property-based-testing/SKILL.md +50 -50
- package/skills/python-patterns/SKILL.md +220 -220
- package/skills/python-pro/SKILL.md +305 -305
- package/skills/quieter/SKILL.md +49 -49
- package/skills/react-doctor/SKILL.md +51 -51
- package/skills/react-specialist/SKILL.md +280 -280
- package/skills/readme-builder/SKILL.md +270 -270
- package/skills/realtime-patterns/SKILL.md +283 -283
- package/skills/red-team-tactics/SKILL.md +191 -191
- package/skills/redesign-skill/SKILL.md +46 -46
- package/skills/review-animations/SKILL.md +45 -45
- package/skills/review-animations/STANDARDS.md +87 -87
- package/skills/rust-pro/SKILL.md +652 -652
- package/skills/semantic-filesystem-navigation/SKILL.md +24 -0
- package/skills/seo-fundamentals/SKILL.md +139 -139
- package/skills/server-management/SKILL.md +178 -178
- package/skills/session-log-interrogation/SKILL.md +29 -0
- package/skills/shadcn-ui-expert/SKILL.md +196 -196
- package/skills/shape/SKILL.md +56 -56
- package/skills/skill-creator/SKILL.md +177 -177
- package/skills/soft-skill/SKILL.md +53 -53
- package/skills/sounds-on-the-web/SKILL.md +76 -76
- package/skills/sql-pro/SKILL.md +624 -624
- package/skills/subagent-driven-development/SKILL.md +32 -0
- package/skills/supabase-postgres-best-practices/SKILL.md +57 -57
- package/skills/svg-animation/SKILL.md +356 -356
- package/skills/swiftui-expert/SKILL.md +164 -164
- package/skills/swiss-design/SKILL.md +44 -44
- package/skills/system-design-pro/SKILL.md +188 -318
- package/skills/systematic-debugging/SKILL.md +129 -124
- package/skills/systematic-debugging/condition-based-waiting.md +120 -120
- package/skills/systematic-debugging/defense-in-depth.md +128 -128
- package/skills/systematic-debugging/root-cause-tracing.md +183 -183
- package/skills/tailwind-patterns/SKILL.md +583 -583
- package/skills/taste-skill/SKILL.md +52 -52
- package/skills/tdd-workflow/SKILL.md +105 -105
- package/skills/test-result-analyzer/SKILL.md +270 -270
- package/skills/testing-patterns/SKILL.md +534 -534
- package/skills/thermo-nuclear-code-quality-review/SKILL.md +62 -62
- package/skills/thinking-protocol/SKILL.md +21 -21
- package/skills/to-spring-or-not-to-spring/SKILL.md +43 -43
- package/skills/train-sentence-transformers/SKILL.md +109 -0
- package/skills/train-sentence-transformers/references/base_model_selection.md +79 -0
- package/skills/train-sentence-transformers/references/dataset_formats.md +128 -0
- package/skills/train-sentence-transformers/references/evaluators_cross_encoder.md +116 -0
- package/skills/train-sentence-transformers/references/evaluators_multi_vector_encoder.md +101 -0
- package/skills/train-sentence-transformers/references/evaluators_sentence_transformer.md +151 -0
- package/skills/train-sentence-transformers/references/evaluators_sparse_encoder.md +121 -0
- package/skills/train-sentence-transformers/references/hardware_guide.md +105 -0
- package/skills/train-sentence-transformers/references/hf_jobs_execution.md +173 -0
- package/skills/train-sentence-transformers/references/losses_cross_encoder.md +137 -0
- package/skills/train-sentence-transformers/references/losses_multi_vector_encoder.md +100 -0
- package/skills/train-sentence-transformers/references/losses_sentence_transformer.md +246 -0
- package/skills/train-sentence-transformers/references/losses_sparse_encoder.md +106 -0
- package/skills/train-sentence-transformers/references/model_architectures.md +178 -0
- package/skills/train-sentence-transformers/references/prompts_and_instructions.md +160 -0
- package/skills/train-sentence-transformers/references/training_args.md +270 -0
- package/skills/train-sentence-transformers/references/troubleshooting.md +225 -0
- package/skills/train-sentence-transformers/scripts/mine_hard_negatives.py +199 -0
- package/skills/train-sentence-transformers/scripts/train_cross_encoder_distillation_example.py +254 -0
- package/skills/train-sentence-transformers/scripts/train_cross_encoder_example.py +253 -0
- package/skills/train-sentence-transformers/scripts/train_cross_encoder_listwise_example.py +282 -0
- package/skills/train-sentence-transformers/scripts/train_multi_vector_encoder_example.py +240 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_distillation_example.py +303 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_example.py +227 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_make_multilingual_example.py +308 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_matryoshka_example.py +212 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_multi_dataset_example.py +258 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_static_embedding_example.py +273 -0
- package/skills/train-sentence-transformers/scripts/train_sentence_transformer_with_lora_example.py +275 -0
- package/skills/train-sentence-transformers/scripts/train_sparse_encoder_distillation_example.py +262 -0
- package/skills/train-sentence-transformers/scripts/train_sparse_encoder_example.py +237 -0
- package/skills/transformers-js/SKILL.md +692 -0
- package/skills/transformers-js/references/CACHE.md +339 -0
- package/skills/transformers-js/references/CONFIGURATION.md +438 -0
- package/skills/transformers-js/references/EXAMPLES.md +620 -0
- package/skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
- package/skills/transformers-js/references/MODEL_REGISTRY.md +197 -0
- package/skills/transformers-js/references/PIPELINE_OPTIONS.md +557 -0
- package/skills/transformers-js/references/TEXT_GENERATION.md +315 -0
- package/skills/transitions-dev/SKILL.md +90 -90
- package/skills/trend-researcher/SKILL.md +198 -198
- package/skills/tribunal-instincts-memory/SKILL.md +31 -0
- package/skills/trl-training/SKILL.md +318 -0
- package/skills/typescript-advanced/SKILL.md +306 -306
- package/skills/typeset/SKILL.md +60 -60
- package/skills/ui-reasoning-engine/SKILL.md +155 -155
- package/skills/ui-skill-packs/SKILL.md +57 -57
- package/skills/ui-skills-root/SKILL.md +69 -69
- package/skills/ui-ux-pro-max/SKILL.md +110 -110
- package/skills/ui-ux-researcher/SKILL.md +199 -199
- package/skills/vector-search-pgvector/SKILL.md +70 -70
- package/skills/verification-before-completion/SKILL.md +107 -107
- package/skills/vue-expert/SKILL.md +259 -259
- package/skills/vulnerability-scanner/SKILL.md +378 -378
- package/skills/web-accessibility-auditor/SKILL.md +179 -179
- package/skills/web-design-guidelines/SKILL.md +49 -49
- package/skills/web-quality-audit/SKILL.md +47 -47
- package/skills/webapp-testing/SKILL.md +128 -128
- package/skills/webgpu-performance/SKILL.md +88 -88
- package/skills/whimsy-injector/SKILL.md +305 -305
- package/skills/workflow-optimizer/SKILL.md +188 -188
- package/skills/zero-trust-passkeys/SKILL.md +82 -82
- package/{dist → src}/browser/audit.js +229 -229
- package/{dist → src}/browser/case_bridge.js +189 -189
- package/{dist → src}/browser/cdp.js +513 -513
- package/{dist → src}/browser/compare.js +110 -110
- package/{dist → src}/browser/discovery.js +140 -140
- package/{dist → src}/browser/idpi.js +142 -142
- package/{dist → src}/browser/index.js +89 -89
- package/{dist → src}/browser/launcher.js +154 -154
- package/{dist → src}/browser/sentinel.js +202 -202
- package/{dist → src}/browser/synapse.js +251 -251
- package/{dist → src}/browser/trimmer.js +210 -210
- package/{dist → src}/commands/align.js +201 -201
- package/{dist → src}/commands/audit-web.js +112 -112
- package/{dist → src}/commands/browse.js +56 -56
- package/{dist → src}/commands/case.js +71 -73
- package/{dist → src}/commands/compare-web.js +61 -61
- package/{dist → src}/commands/compile.js +91 -91
- package/{dist → src}/commands/context.js +71 -71
- package/{dist → src}/commands/contract.js +440 -440
- package/{dist → src}/commands/deconstruct.js +58 -58
- package/{dist → src}/commands/graph.js +44 -44
- package/{dist → src}/commands/guardrail.js +275 -275
- package/{dist → src}/commands/heal.js +99 -99
- package/{dist → src}/commands/hook.js +28 -28
- package/{dist → src}/commands/init.js +393 -393
- package/{dist → src}/commands/learn.js +119 -117
- package/{dist → src}/commands/marathon.js +45 -45
- package/{dist → src}/commands/memory.js +508 -508
- package/{dist → src}/commands/minimal.js +71 -71
- package/{dist → src}/commands/mutate.js +30 -30
- package/{dist → src}/commands/native.js +264 -264
- package/{dist → src}/commands/optimize.js +332 -328
- package/{dist → src}/commands/sdd.js +265 -229
- package/{dist → src}/commands/status.js +66 -66
- package/{dist → src}/commands/sync.js +25 -25
- package/{dist → src}/commands/uninstall.js +54 -54
- package/{dist → src}/commands/update.js +37 -37
- package/{dist → src}/commands/validate.js +58 -58
- package/{dist → src}/esm/index.mjs +1 -1
- package/{dist → src}/mcp/server.js +8 -8
- package/{dist → src}/tui/banner.js +1 -1
- package/{dist → src}/tui/index.js +21 -21
- package/{dist → src}/tui/reviewer-grid.js +90 -90
- package/{dist → src}/tui/shimmer.js +91 -91
- package/{dist → src}/tui/theme.js +130 -130
- package/{dist → src}/tui/tree.js +93 -93
- package/{dist → src}/tui/wizard.js +148 -148
- package/{dist → src}/types.js +8 -8
- package/{dist → src}/utils/fs.js +102 -102
- package/{dist → src}/utils/hasher.js +142 -142
- package/{dist → src}/utils/helpers.js +53 -53
- package/{dist → src}/utils/logger.js +54 -54
- package/{dist → src}/utils/version.js +157 -157
- package/.agent/history/README.md +0 -53
- package/.agent/history/architecture-explorer.html +0 -352
- package/.agent/history/architecture-graph.yaml +0 -619
- package/.agent/history/case-law/cases/template-case.json +0 -19
- package/.agent/history/graph-cache.json +0 -1042
- package/.agent/history/integrity_manifest.json +0 -4694
- package/.agent/history/memory/.memory.idx +0 -7596
- package/.agent/history/memory/MEMORY.md +0 -512
- package/.agent/history/memory.db +0 -0
- package/.agent/history/snapshots/.opencode__plugins__tribunal.js.json +0 -12
- package/.agent/history/snapshots/.pi__extensions__tribunal.ts.json +0 -12
- package/.agent/history/snapshots/bin__adapter-install.js.json +0 -13
- package/.agent/history/snapshots/bin__global-store.js.json +0 -15
- package/.agent/history/snapshots/bin__mcp-server.js.json +0 -21
- package/.agent/history/snapshots/bin__proxy-server.js.json +0 -20
- package/.agent/history/snapshots/bin__spawn-agent.js.json +0 -12
- package/.agent/history/snapshots/bin__tk-proxy.js.json +0 -21
- package/.agent/history/snapshots/bin__tribunal-kit.js.json +0 -21
- package/.agent/history/snapshots/bin__wrapper.js.json +0 -14
- package/.agent/history/snapshots/eslint.config.js.json +0 -8
- package/.agent/history/snapshots/hooks__session-start.js.json +0 -11
- package/.agent/history/snapshots/scripts__apply-version.js.json +0 -11
- package/.agent/history/snapshots/scripts__audit_skill_sdo.js.json +0 -11
- package/.agent/history/snapshots/scripts__benchmark.js.json +0 -14
- package/.agent/history/snapshots/scripts__changelog.js.json +0 -12
- package/.agent/history/snapshots/scripts__clean-pycache.js.json +0 -11
- package/.agent/history/snapshots/scripts__context_compiler.js.json +0 -17
- package/.agent/history/snapshots/scripts__fix-vbc.js.json +0 -11
- package/.agent/history/snapshots/scripts__modernize_skills.js.json +0 -11
- package/.agent/history/snapshots/scripts__package-cores.js.json +0 -12
- package/.agent/history/snapshots/scripts__skill_enhancement_engine.js.json +0 -11
- package/.agent/history/snapshots/scripts__stress_benchmark.js.json +0 -15
- package/.agent/history/snapshots/scripts__sync-skills.js.json +0 -11
- package/.agent/history/snapshots/scripts__sync-version.js.json +0 -11
- package/.agent/history/snapshots/scripts__telemetry_gc.js.json +0 -11
- package/.agent/history/snapshots/scripts__validate-payload.js.json +0 -11
- package/.agent/history/snapshots/scripts__visual_audit.js.json +0 -11
- package/.agent/history/snapshots/test__integration__bridges.test.js.json +0 -13
- package/.agent/history/snapshots/test__integration__browser_cli.test.js.json +0 -12
- package/.agent/history/snapshots/test__integration__graceful_degradation.test.js.json +0 -12
- package/.agent/history/snapshots/test__integration__init.test.js.json +0 -13
- package/.agent/history/snapshots/test__integration__minimal_change_pipeline.test.js.json +0 -13
- package/.agent/history/snapshots/test__integration__parallel_tribunal.test.js.json +0 -12
- package/.agent/history/snapshots/test__integration__routing.test.js.json +0 -11
- package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +0 -13
- package/.agent/history/snapshots/test__integration__sync_status.test.js.json +0 -13
- package/.agent/history/snapshots/test__integration__wave2.test.js.json +0 -13
- package/.agent/history/snapshots/test__integration__wrapper.test.js.json +0 -13
- package/.agent/history/snapshots/test__unit__align.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__args.test.js.json +0 -20
- package/.agent/history/snapshots/test__unit__ast_context_loader.test.js.json +0 -12
- package/.agent/history/snapshots/test__unit__audit_release.test.js.json +0 -16
- package/.agent/history/snapshots/test__unit__browser_case_bridge.test.js.json +0 -11
- package/.agent/history/snapshots/test__unit__browser_discovery.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__browser_idpi.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__browser_sentinel.test.js.json +0 -11
- package/.agent/history/snapshots/test__unit__browser_synapse.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__browser_trimmer.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__cicd_validator.test.js.json +0 -12
- package/.agent/history/snapshots/test__unit__compile.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__context_broker.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__context_compiler.test.js.json +0 -26
- package/.agent/history/snapshots/test__unit__contract_engine.test.js.json +0 -13
- package/.agent/history/snapshots/test__unit__copyDir.test.js.json +0 -23
- package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +0 -11
- package/.agent/history/snapshots/test__unit__guardrail_engine.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__impact_classifier.test.js.json +0 -12
- package/.agent/history/snapshots/test__unit__init.test.js.json +0 -14
- package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__integrity_manifest.test.js.json +0 -13
- package/.agent/history/snapshots/test__unit__learn.test.js.json +0 -11
- package/.agent/history/snapshots/test__unit__marathon.test.js.json +0 -22
- package/.agent/history/snapshots/test__unit__mcp_server.test.js.json +0 -16
- package/.agent/history/snapshots/test__unit__memory.test.js.json +0 -13
- package/.agent/history/snapshots/test__unit__minimal_change.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__native.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__optimize.test.js.json +0 -13
- package/.agent/history/snapshots/test__unit__path_resolution.test.js.json +0 -14
- package/.agent/history/snapshots/test__unit__platform_download_audit.test.js.json +0 -11
- package/.agent/history/snapshots/test__unit__production_readiness_evidence.test.js.json +0 -21
- package/.agent/history/snapshots/test__unit__prompt_compiler.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__sdd_integration.test.js.json +0 -12
- package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +0 -23
- package/.agent/history/snapshots/test__unit__semver.test.js.json +0 -20
- package/.agent/history/snapshots/test__unit__skill_evolution.test.js.json +0 -11
- package/.agent/history/snapshots/test__unit__stress.test.js.json +0 -15
- package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +0 -12
- package/.agent/history/snapshots/test__unit__token_budget_broker.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__tui.test.js.json +0 -10
- package/.agent/history/snapshots/test__unit__utils.test.js.json +0 -10
- package/.agents/plugins/marketplace.json +0 -20
- package/.claude/CLAUDE.md +0 -442
- /package/{dist → src}/cli.js +0 -0
- /package/{dist → src}/index.d.ts +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/context_compiler.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 1,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": [],
|
|
8
|
-
"crypto": [],
|
|
9
|
-
"child_process": [],
|
|
10
|
-
"./_colors": [],
|
|
11
|
-
"../.agent/scripts/_colors": []
|
|
12
|
-
},
|
|
13
|
-
"dependents": [
|
|
14
|
-
"test/unit/context_compiler.test.js"
|
|
15
|
-
],
|
|
16
|
-
"content": "#!/usr/bin/env node\n/**\n * context_compiler.js — Tribunal Kit SOTA Context Compiler Engine\n * ════════════════════════════════════════════════════════════════════\n * Deterministic, high-speed context extraction engine for:\n * 1. Single Files (Flight Data HUD Dossier)\n * 2. Multi-File Pairs (Interface Bridge Dossier)\n * 3. Project Folders (Subsystem Macro Dossier)\n * 4. Batch Vault Crawling (--crawl)\n * 5. Semantic Drift Sentinel (--check)\n *\n * Designed for both CLI execution and in-process MCP server integration.\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst crypto = require('crypto');\nconst { execSync } = require('child_process');\n\n// Optional ANSI colors\nlet C = {\n GREEN: '\\x1b[92m',\n YELLOW: '\\x1b[93m',\n CYAN: '\\x1b[96m',\n RED: '\\x1b[91m',\n BLUE: '\\x1b[94m',\n BOLD: '\\x1b[1m',\n DIM: '\\x1b[2m',\n RESET: '\\x1b[0m',\n};\n\ntry {\n const colorsMod = require('./_colors');\n if (colorsMod) C = Object.assign({}, C, colorsMod);\n} catch {\n try {\n const colorsMod = require('../.agent/scripts/_colors');\n if (colorsMod) C = Object.assign({}, C, colorsMod);\n } catch {\n // Fallback C used\n }\n}\n\n// ── Hashing Helpers ─────────────────────────────────────────────────────────\n\nfunction computeSha256(content) {\n const normalized = content.replace(/\\r\\n/g, '\\n').trim();\n return crypto.createHash('sha256').update(normalized, 'utf8').digest('hex').substring(0, 16);\n}\n\nfunction computeInterfaceHash(signatures) {\n const text = signatures\n .map(s => `${s.kind}:${s.name}:${s.signature}`)\n .sort()\n .join('\\n');\n return crypto.createHash('sha256').update(text, 'utf8').digest('hex').substring(0, 16);\n}\n\n// ── Multi-Language AST / Regex Skeleton Extractor ───────────────────────────\n\nfunction extractFileSkeleton(filePath, rawContent) {\n const ext = path.extname(filePath).toLowerCase();\n const lines = rawContent.split(/\\r?\\n/);\n const imports = [];\n const exports = [];\n const types = [];\n const landmines = [];\n\n // 1. Comments and Landmines (Chesterton's Fences)\n lines.forEach((line, idx) => {\n const trimmed = line.trim();\n if (\n trimmed.includes('// VERIFY') ||\n trimmed.includes('// NOTE') ||\n trimmed.includes('// FIX') ||\n trimmed.includes('// HACK') ||\n trimmed.includes('// CAUTION') ||\n trimmed.includes('// INVARIANT') ||\n trimmed.includes('// DO NOT') ||\n trimmed.includes('# VERIFY') ||\n trimmed.includes('# NOTE')\n ) {\n landmines.push({\n line: idx + 1,\n content: trimmed,\n });\n }\n });\n\n // 2. Language-Specific Parsers\n if (ext === '.ts' || ext === '.tsx' || ext === '.js' || ext === '.jsx' || ext === '.mjs') {\n // Phase 1: Try Rust AST Extraction\n try {\n const absPath = path.resolve(process.cwd(), filePath);\n const binName = process.platform === 'win32' ? 'tribunal-core.exe' : 'tribunal-core';\n // Use release build if available, otherwise debug\n let corePath = path.join(__dirname, '..', 'crates', 'core', 'target', 'release', binName);\n if (!fs.existsSync(corePath)) {\n corePath = path.join(__dirname, '..', 'crates', 'core', 'target', 'debug', binName);\n }\n \n if (fs.existsSync(corePath)) {\n const result = require('child_process').execSync(`\"${corePath}\" ast-extract --file \"${absPath}\"`, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] });\n const data = JSON.parse(result);\n if (data && data.success) {\n // We map the Rust JSON into the exact format expected by the rest of the JS code\n const mappedImports = data.imports.map(i => ({ source: i.source, specifiers: i.specifiers, line: 0 }));\n const mappedExports = data.exports.map(e => ({ kind: e.kind, name: e.name, signature: e.signature, line: 0 }));\n const mappedTypes = data.types.map(t => ({ kind: t.kind, name: t.name, signature: t.signature, line: 0 }));\n \n return {\n imports: mappedImports,\n exports: mappedExports,\n types: mappedTypes,\n landmines: data.landmines,\n interfaceHash: computeInterfaceHash(mappedExports.concat(mappedTypes))\n };\n }\n }\n } catch(e) {\n // Silent fallback to Regex parsing\n }\n\n lines.forEach((line, idx) => {\n const trimmed = line.trim();\n\n // Imports\n const importMatch = trimmed.match(\n /^import\\s+(?:type\\s+)?(?:(.+?)\\s+from\\s+)?['\"]([^'\"]+)['\"]/,\n );\n if (importMatch) {\n imports.push({\n source: importMatch[2],\n specifiers: importMatch[1] ? importMatch[1].trim() : '*',\n line: idx + 1,\n });\n }\n const requireMatch = trimmed.match(\n /(?:const|let|var)\\s+(.+?)\\s*=\\s*require\\(['\"]([^'\"]+)['\"]\\)/,\n );\n if (requireMatch) {\n imports.push({\n source: requireMatch[2],\n specifiers: requireMatch[1].trim(),\n line: idx + 1,\n });\n }\n\n // Exports\n const exportFunc = trimmed.match(\n /^export\\s+(?:default\\s+)?(?:async\\s+)?function\\s+(\\w+)\\s*(\\(.*?\\))/,\n );\n if (exportFunc) {\n exports.push({\n kind: 'function',\n name: exportFunc[1],\n signature: `function ${exportFunc[1]}${exportFunc[2]}`,\n line: idx + 1,\n });\n }\n\n const exportConst = trimmed.match(\n /^export\\s+const\\s+(\\w+)(?:\\s*:\\s*([^=]+))?\\s*=\\s*(?:async\\s+)?(?:\\((.*?)\\)|(\\w+))\\s*=>/,\n );\n if (exportConst) {\n exports.push({\n kind: 'arrow_function',\n name: exportConst[1],\n signature: `const ${exportConst[1]}: (${exportConst[3] || exportConst[4] || ''}) => ...`,\n line: idx + 1,\n });\n }\n\n const exportClass = trimmed.match(\n /^export\\s+(?:default\\s+)?class\\s+(\\w+)(?:\\s+extends\\s+(\\w+))?/,\n );\n if (exportClass) {\n exports.push({\n kind: 'class',\n name: exportClass[1],\n signature: `class ${exportClass[1]}${exportClass[2] ? ' extends ' + exportClass[2] : ''}`,\n line: idx + 1,\n });\n }\n\n // Types & Interfaces\n const exportType = trimmed.match(/^export\\s+type\\s+(\\w+)(?:<.*?>)?\\s*=/);\n if (exportType) {\n types.push({\n kind: 'type',\n name: exportType[1],\n signature: trimmed.replace(/;?$/, ''),\n line: idx + 1,\n });\n }\n\n const exportInterface = trimmed.match(\n /^export\\s+interface\\s+(\\w+)(?:<.*?>)?(?:\\s+extends\\s+.*?)?\\s*\\{?/,\n );\n if (exportInterface) {\n types.push({\n kind: 'interface',\n name: exportInterface[1],\n signature: trimmed.replace(/\\{?$/, '').trim(),\n line: idx + 1,\n });\n }\n });\n } else if (ext === '.rs') {\n lines.forEach((line, idx) => {\n const trimmed = line.trim();\n\n // Use statements\n const useMatch = trimmed.match(/^(?:pub\\s+)?use\\s+([^;]+);/);\n if (useMatch) {\n imports.push({\n source: useMatch[1].trim(),\n specifiers: useMatch[1].trim(),\n line: idx + 1,\n });\n }\n\n // Public Functions\n const pubFn = trimmed.match(\n /^pub(?:\\(.*?\\))?\\s+(?:async\\s+)?fn\\s+(\\w+)(?:<.*?>)?\\s*(\\(.*?\\))(?:\\s*->\\s*([^{;]+))?/,\n );\n if (pubFn) {\n exports.push({\n kind: 'function',\n name: pubFn[1],\n signature: `pub fn ${pubFn[1]}${pubFn[2]}${pubFn[3] ? ' -> ' + pubFn[3].trim() : ''}`,\n line: idx + 1,\n });\n }\n\n // Structs & Enums\n const pubStruct = trimmed.match(/^pub(?:\\(.*?\\))?\\s+struct\\s+(\\w+)/);\n if (pubStruct) {\n types.push({\n kind: 'struct',\n name: pubStruct[1],\n signature: `pub struct ${pubStruct[1]}`,\n line: idx + 1,\n });\n }\n\n const pubEnum = trimmed.match(/^pub(?:\\(.*?\\))?\\s+enum\\s+(\\w+)/);\n if (pubEnum) {\n types.push({\n kind: 'enum',\n name: pubEnum[1],\n signature: `pub enum ${pubEnum[1]}`,\n line: idx + 1,\n });\n }\n\n const pubTrait = trimmed.match(/^pub(?:\\(.*?\\))?\\s+trait\\s+(\\w+)/);\n if (pubTrait) {\n types.push({\n kind: 'trait',\n name: pubTrait[1],\n signature: `pub trait ${pubTrait[1]}`,\n line: idx + 1,\n });\n }\n });\n } else if (ext === '.py') {\n lines.forEach((line, idx) => {\n const trimmed = line.trim();\n\n const importMatch = trimmed.match(/^(?:from\\s+([\\w.]+)\\s+)?import\\s+(.+)$/);\n if (importMatch) {\n imports.push({\n source: importMatch[1] || importMatch[2],\n specifiers: importMatch[2],\n line: idx + 1,\n });\n }\n\n const defMatch = trimmed.match(\n /^(?:async\\s+)?def\\s+([a-zA-Z_]\\w*)\\s*(\\(.*?\\))(?:\\s*->\\s*([^:]+))?:/,\n );\n if (defMatch && !defMatch[1].startsWith('_')) {\n exports.push({\n kind: 'function',\n name: defMatch[1],\n signature: `def ${defMatch[1]}${defMatch[2]}${defMatch[3] ? ' -> ' + defMatch[3].trim() : ''}`,\n line: idx + 1,\n });\n }\n\n const classMatch = trimmed.match(/^class\\s+([a-zA-Z_]\\w*)(?:\\((.*?)\\))?:/);\n if (classMatch && !classMatch[1].startsWith('_')) {\n types.push({\n kind: 'class',\n name: classMatch[1],\n signature: `class ${classMatch[1]}${classMatch[2] ? '(' + classMatch[2] + ')' : ''}`,\n line: idx + 1,\n });\n }\n });\n }\n\n const allSignatures = exports.concat(types);\n const interfaceHash = computeInterfaceHash(allSignatures);\n\n return {\n imports,\n exports,\n types,\n landmines,\n interfaceHash,\n };\n}\n\n// ── Inbound Callers Discovery ───────────────────────────────────────────────\n\nfunction findInboundCallers(targetFilePath, exportNames, workspaceRoot = process.cwd()) {\n const callers = [];\n const baseName = path.basename(targetFilePath);\n const stem = baseName.replace(/\\.[^.]+$/, '');\n const relativeTarget = path.relative(workspaceRoot, targetFilePath).replace(/\\\\/g, '/');\n\n // Search tokens: module stem and exported symbol names\n const searchTokens = new Set([stem]);\n exportNames.slice(0, 8).forEach(n => searchTokens.add(n));\n\n // Try using git grep or ripgrep if available\n const grepOutputs = [];\n try {\n for (const token of searchTokens) {\n if (!token || token.length < 3) continue;\n try {\n const cmd = `git grep -n -I \"${token}\" -- \":!docs/\" \":!node_modules/\" \":!dist/\" \":!target/\" \":!*.lock\"`;\n const res = execSync(cmd, {\n cwd: workspaceRoot,\n stdio: ['ignore', 'pipe', 'ignore'],\n encoding: 'utf8',\n });\n if (res) grepOutputs.push(...res.split('\\n').filter(Boolean));\n } catch {\n // Ripgrep fallback\n try {\n const cmd = `rg -n --no-heading --color=never \"${token}\" -g \"!docs/**\" -g \"!node_modules/**\" -g \"!target/**\" -g \"!dist/**\"`;\n const res = execSync(cmd, {\n cwd: workspaceRoot,\n stdio: ['ignore', 'pipe', 'ignore'],\n encoding: 'utf8',\n });\n if (res) grepOutputs.push(...res.split('\\n').filter(Boolean));\n } catch {\n // Silent catch\n }\n }\n }\n } catch {\n // Grep unavailable\n }\n\n const seenSites = new Set();\n\n for (const line of grepOutputs) {\n const parts = line.split(':');\n if (parts.length < 3) continue;\n const callerFile = parts[0].replace(/\\\\/g, '/');\n const lineNum = parseInt(parts[1], 10);\n const lineContent = parts.slice(2).join(':').trim();\n\n // Ignore self-references and context docs\n if (\n callerFile === relativeTarget ||\n callerFile.includes('.context.md') ||\n callerFile.includes('INDEX.md')\n ) {\n continue;\n }\n\n const key = `${callerFile}:${lineNum}`;\n if (seenSites.has(key)) continue;\n seenSites.add(key);\n\n callers.push({\n file: callerFile,\n line: lineNum,\n snippet: lineContent.substring(0, 100),\n isDirectImport:\n lineContent.includes('import') ||\n lineContent.includes('require') ||\n lineContent.includes('use '),\n });\n\n if (callers.length >= 12) break; // Cap callers for token efficiency\n }\n\n return callers;\n}\n\n// ── Test & Skill Discovery ──────────────────────────────────────────────────\n\nfunction discoverTests(targetFilePath, workspaceRoot = process.cwd()) {\n const tests = [];\n const baseName = path.basename(targetFilePath);\n const stem = baseName.replace(/\\.[^.]+$/, '');\n\n const testPatterns = [`${stem}.test.`, `${stem}.spec.`, `${stem}_test.`, `test_${stem}.`];\n\n function walk(dir) {\n if (!fs.existsSync(dir)) return;\n try {\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n if (\n entry.name === 'node_modules' ||\n entry.name === 'target' ||\n entry.name === '.git' ||\n entry.name === 'dist'\n ) {\n continue;\n }\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n // Only walk tests dirs or immediate directories\n if (\n entry.name === 'tests' ||\n entry.name === '__tests__' ||\n entry.name === 'test' ||\n entry.name === 'crates'\n ) {\n walk(full);\n }\n } else if (entry.isFile()) {\n for (const pat of testPatterns) {\n if (entry.name.includes(pat)) {\n tests.push(path.relative(workspaceRoot, full).replace(/\\\\/g, '/'));\n break;\n }\n }\n }\n }\n } catch {\n // Ignore read errors\n }\n }\n\n walk(workspaceRoot);\n return Array.from(new Set(tests)).slice(0, 5);\n}\n\nfunction resolveSkills(targetFilePath, content) {\n const skills = [];\n const ext = path.extname(targetFilePath).toLowerCase();\n const lowerContent = content.toLowerCase();\n\n if (ext === '.rs') skills.push('rust-pro');\n if (ext === '.py') skills.push('python-pro');\n if (ext === '.ts' || ext === '.tsx' || ext === '.js') {\n if (lowerContent.includes('react') || ext.endsWith('x')) skills.push('react-specialist');\n else skills.push('clean-code');\n }\n\n if (\n lowerContent.includes('auth') ||\n lowerContent.includes('jwt') ||\n lowerContent.includes('token') ||\n lowerContent.includes('crypto')\n ) {\n skills.push('backend-security-expert');\n }\n if (\n lowerContent.includes('query') ||\n lowerContent.includes('prisma') ||\n lowerContent.includes('sql') ||\n lowerContent.includes('database')\n ) {\n skills.push('database-architect');\n }\n if (\n lowerContent.includes('compress') ||\n lowerContent.includes('tokens') ||\n lowerContent.includes('prompt')\n ) {\n skills.push('context-engineering-pro');\n }\n\n skills.push('fabel-protocol');\n return Array.from(new Set(skills));\n}\n\nfunction resolvePath(targetPath, workspaceRoot = process.cwd()) {\n const clean = targetPath.replace(/^['\"]|['\"]$/g, '');\n if (path.isAbsolute(clean) && fs.existsSync(clean)) return clean;\n\n const direct = path.resolve(workspaceRoot, clean);\n if (fs.existsSync(direct)) return direct;\n\n if (clean.startsWith('tribunal-kit/') || clean.startsWith('tribunal-kit\\\\')) {\n const stripped = clean.replace(/^tribunal-kit[/\\\\]/, '');\n const strippedPath = path.resolve(workspaceRoot, stripped);\n if (fs.existsSync(strippedPath)) return strippedPath;\n }\n\n const parentPath = path.resolve(workspaceRoot, '..', clean);\n if (fs.existsSync(parentPath)) return parentPath;\n\n return direct;\n}\n\nfunction getDocsDir(workspaceRoot = process.cwd()) {\n const local = path.join(workspaceRoot, 'docs', 'context');\n if (fs.existsSync(local)) {\n try {\n const files = fs\n .readdirSync(local)\n .filter(f => f.endsWith('.context.md') || f.endsWith('.bridge.md'));\n if (files.length > 0) return local;\n } catch {\n // fallback\n }\n }\n const parent = path.join(workspaceRoot, '..', 'docs', 'context');\n if (fs.existsSync(parent)) {\n try {\n const files = fs\n .readdirSync(parent)\n .filter(f => f.endsWith('.context.md') || f.endsWith('.bridge.md'));\n if (files.length > 0) return parent;\n } catch {\n // fallback\n }\n }\n return local;\n}\n\n// ── Single-File Context Analysis ────────────────────────────────────────────\n\nfunction analyzeSingleFile(targetPath, workspaceRoot = process.cwd()) {\n const absPath = resolvePath(targetPath, workspaceRoot);\n if (!fs.existsSync(absPath)) {\n throw new Error(`File not found: ${absPath}`);\n }\n\n const rawContent = fs.readFileSync(absPath, 'utf8');\n const relativePath = path.relative(workspaceRoot, absPath).replace(/\\\\/g, '/');\n const sourceHash = computeSha256(rawContent);\n const skeleton = extractFileSkeleton(relativePath, rawContent);\n const exportNames = skeleton.exports.map(e => e.name).concat(skeleton.types.map(t => t.name));\n const callers = findInboundCallers(absPath, exportNames, workspaceRoot);\n const tests = discoverTests(absPath, workspaceRoot);\n const skills = resolveSkills(relativePath, rawContent);\n\n // Determine domain layer\n let domainLayer = 'Core Logic / Utility';\n if (relativePath.includes('api') || relativePath.includes('route'))\n domainLayer = 'API / Gateway Layer';\n else if (relativePath.includes('service')) domainLayer = 'Service / Business Logic';\n else if (\n relativePath.includes('model') ||\n relativePath.includes('schema') ||\n relativePath.includes('db')\n )\n domainLayer = 'Data / Persistence Layer';\n else if (relativePath.includes('components') || relativePath.includes('ui'))\n domainLayer = 'UI / Presentation Layer';\n else if (relativePath.includes('commands')) domainLayer = 'Command / Dispatch Layer';\n\n return {\n mode: 'single_file',\n filePath: relativePath,\n sourceHash,\n interfaceHash: skeleton.interfaceHash,\n domainLayer,\n imports: skeleton.imports,\n exports: skeleton.exports,\n types: skeleton.types,\n landmines: skeleton.landmines,\n callers,\n tests,\n skills,\n lineCount: rawContent.split('\\n').length,\n byteSize: Buffer.byteLength(rawContent, 'utf8'),\n };\n}\n\n// ── Multi-File Interface Bridge Analysis ────────────────────────────────────\n\nfunction analyzeMultiFileBridge(pathA, pathB, workspaceRoot = process.cwd()) {\n const metaA = analyzeSingleFile(pathA, workspaceRoot);\n const metaB = analyzeSingleFile(pathB, workspaceRoot);\n\n const aImportsB = metaA.imports.some(imp =>\n imp.source.includes(path.basename(metaB.filePath).replace(/\\.[^.]+$/, '')),\n );\n const bImportsA = metaB.imports.some(imp =>\n imp.source.includes(path.basename(metaA.filePath).replace(/\\.[^.]+$/, '')),\n );\n\n const sharedTypes = [];\n const typeNamesA = new Set(metaA.types.map(t => t.name));\n for (const t of metaB.types) {\n if (typeNamesA.has(t.name)) sharedTypes.push(t.name);\n }\n\n return {\n mode: 'multi_file_bridge',\n fileA: metaA,\n fileB: metaB,\n coupling: {\n aImportsB,\n bImportsA,\n sharedTypes,\n relationship:\n aImportsB && bImportsA\n ? 'Bidirectional Coupling'\n : aImportsB\n ? 'A depends on B'\n : bImportsA\n ? 'B depends on A'\n : 'Sibling / Peer Modules',\n },\n };\n}\n\n// ── Directory / Project Subsystem Analysis ──────────────────────────────────\n\nfunction analyzeDirectory(dirPath, workspaceRoot = process.cwd()) {\n const absDir = path.isAbsolute(dirPath) ? dirPath : path.resolve(workspaceRoot, dirPath);\n if (!fs.existsSync(absDir) || !fs.statSync(absDir).isDirectory()) {\n throw new Error(`Directory not found: ${absDir}`);\n }\n\n const relativeDir = path.relative(workspaceRoot, absDir).replace(/\\\\/g, '/') || '.';\n const manifests = [];\n const subsystems = [];\n let totalFiles = 0;\n const langCounts = {};\n\n const ignoreSet = new Set([\n 'node_modules',\n 'target',\n '.git',\n 'dist',\n 'coverage',\n '.gemini',\n 'build',\n ]);\n\n // Check top-level manifests\n if (fs.existsSync(path.join(absDir, 'package.json'))) manifests.push('package.json');\n if (fs.existsSync(path.join(absDir, 'Cargo.toml'))) manifests.push('Cargo.toml');\n if (fs.existsSync(path.join(absDir, 'pyproject.toml'))) manifests.push('pyproject.toml');\n\n const entries = fs.readdirSync(absDir, { withFileTypes: true });\n\n for (const entry of entries) {\n if (ignoreSet.has(entry.name) || entry.name.startsWith('.')) continue;\n const subFull = path.join(absDir, entry.name);\n if (entry.isDirectory()) {\n try {\n const subFiles = fs.readdirSync(subFull);\n subsystems.push({\n name: entry.name,\n fileCount: subFiles.length,\n keySample: subFiles.slice(0, 3).join(', '),\n });\n } catch {\n // Ignore unreadable\n }\n } else if (entry.isFile()) {\n totalFiles++;\n const ext = path.extname(entry.name).toLowerCase() || 'other';\n langCounts[ext] = (langCounts[ext] || 0) + 1;\n }\n }\n\n return {\n mode: 'directory_subsystem',\n dirPath: relativeDir,\n manifests,\n subsystems,\n directFiles: totalFiles,\n langCounts,\n };\n}\n\n// ── Markdown Dossier Generators ─────────────────────────────────────────────\n\nfunction renderSingleFileDossier(data) {\n const callersTable =\n data.callers.length > 0\n ? data.callers\n .map(\n c =>\n `| \\`${c.file}:${c.line}\\` | \\`${c.snippet}\\` | ${c.isDirectImport ? 'Direct Import' : 'Symbol Reference'} |`,\n )\n .join('\\n')\n : '| *None detected (potential root entrypoint or test)* | - | - |';\n\n const typesTable =\n data.exports.concat(data.types).length > 0\n ? data.exports\n .concat(data.types)\n .slice(0, 10)\n .map(s => `| \\`${s.name}\\` | \\`${s.kind}\\` | \\`${s.signature}\\` | Line ${s.line} |`)\n .join('\\n')\n : '| *No explicit exported symbols detected* | - | - | - |';\n\n const landminesContent =\n data.landmines.length > 0\n ? data.landmines.map(l => `> [!CAUTION]\\n> **Line ${l.line}:** \\`${l.content}\\``).join('\\n\\n')\n : '> [!NOTE]\\n> No explicit defensive comments (`// VERIFY`, `// NOTE`, `// HACK`) found in source code.';\n\n const testCommand = data.tests.length > 0 ? `npm test -- ${data.tests[0]}` : `npm test`;\n\n return `---\nversion: 2.0.0\nsource_file: \"${data.filePath}\"\nsource_hash: \"${data.sourceHash}\"\ninterface_hash: \"${data.interfaceHash}\"\nlast_synced: \"${new Date().toISOString().split('T')[0]}\"\ndomain_layer: \"${data.domainLayer}\"\nassociated_skills:\n${data.skills.map(s => ` - ${s}`).join('\\n')}\nassociated_tests:\n${data.tests.length > 0 ? data.tests.map(t => ` - ${t}`).join('\\n') : ' - none'}\n---\n\n<!-- AI_QUICK_INJECT_START -->\n> [!TIP]\n> **AI Prompt Injection Card (Copy into future prompts touching this file):**\n> \\`\\`\\`yaml\n> Target: ${data.filePath} (${data.domainLayer})\n> Role: Core logic for ${path.basename(data.filePath)}.\n> Exports: [${data.exports\n .map(e => e.name)\n .slice(0, 6)\n .join(', ')}]\n> Inbound Callers: ${data.callers.length} active consumer sites.\n> Invariant Check: Verify test passing before merge: ${testCommand}\n> \\`\\`\\`\n<!-- AI_QUICK_INJECT_END -->\n\n# 🧭 FILE DOSSIER: \\`${path.basename(data.filePath)}\\`\n\\`${data.filePath}\\` • **${data.domainLayer}** • **Hash:** \\`${data.sourceHash}\\`\n\n| Freshness | Blast Radius | Exports Count | Test Coverage | Primary Callers |\n| :--- | :--- | :--- | :--- | :--- |\n| 🟢 **Fresh** (\\`${data.sourceHash}\\`) | **${data.callers.length} Callers** | **${data.exports.length} Symbols** | ${data.tests.length > 0 ? '✅ Linked (' + data.tests.length + ' files)' : '⚠️ Unlinked'} | \\`${data.callers[0] ? data.callers[0].file : 'Entrypoint'}\\` |\n\n---\n\n## ⚡ 30-Second Mental Model\n> **Mission:** Implements ${data.domainLayer.toLowerCase()} responsibilities for \\`${data.filePath}\\`, exposing verified interfaces to callers while adhering to Tribunal safety standards.\n\n---\n\n## 📋 Public API & Type Contract Matrix\n\n| Symbol | Kind | Signature | Location |\n| :--- | :--- | :--- | :--- |\n${typesTable}\n\n---\n\n## 🔗 Blast Radius & Call Topology\n\n\\`\\`\\`mermaid\ngraph LR\n classDef target fill:#1e293b,stroke:#3b82f6,stroke-width:2px,color:#fff;\n classDef ext fill:#0f172a,stroke:#64748b,stroke-width:1px,color:#94a3b8;\n\n subgraph Inbound Callers\n${\n data.callers\n .slice(0, 4)\n .map((c, i) => ` C${i}[\"${c.file}\"]:::ext`)\n .join('\\n') || ' C0[\"Entrypoint / CLI\"]:::ext'\n}\n end\n\n T[\"${path.basename(data.filePath)}\"]:::target\n\n subgraph Dependencies\n${\n data.imports\n .slice(0, 4)\n .map((imp, i) => ` D${i}[\"${imp.source}\"]:::ext`)\n .join('\\n') || ' D0[\"Stdlib\"]:::ext'\n}\n end\n\n${\n data.callers\n .slice(0, 4)\n .map((_, i) => ` C${i} --> T`)\n .join('\\n') || ' C0 --> T'\n}\n${\n data.imports\n .slice(0, 4)\n .map((_, i) => ` T --> D${i}`)\n .join('\\n') || ' T --> D0'\n}\n\\`\\`\\`\n\n### Inbound Consumer Sites\n| Caller File | Line Snippet | Vector |\n| :--- | :--- | :--- |\n${callersTable}\n\n---\n\n## ⚠️ Chesterton's Fences & Non-Obvious Quirks\n\n${landminesContent}\n\n---\n\n## 🧪 Verification & Test Harness\n\n\\`\\`\\`bash\n# Run isolated tests for this module:\n${testCommand}\n\\`\\`\\`\n`;\n}\n\nfunction renderBridgeDossier(data) {\n return `---\nversion: 2.0.0\nbridge: \"${data.fileA.filePath} <--> ${data.fileB.filePath}\"\nrelationship: \"${data.coupling.relationship}\"\nlast_synced: \"${new Date().toISOString().split('T')[0]}\"\n---\n\n# 🌉 INTERFACE BRIDGE DOSSIER\n**Module A:** \\`${data.fileA.filePath}\\` \n**Module B:** \\`${data.fileB.filePath}\\` \n**Coupling Relationship:** \\`${data.coupling.relationship}\\`\n\n---\n\n## 🗺️ Cross-Boundary Topology\n\n\\`\\`\\`mermaid\ngraph LR\n A[\"${path.basename(data.fileA.filePath)}\"]\n B[\"${path.basename(data.fileB.filePath)}\"]\n\n ${data.coupling.aImportsB ? 'A -->|\"Imports & Calls\"| B' : ''}\n ${data.coupling.bImportsA ? 'B -->|\"Imports & Calls\"| A' : ''}\n ${!data.coupling.aImportsB && !data.coupling.bImportsA ? 'A -.->|\"Sibling / Parallel\"| B' : ''}\n\\`\\`\\`\n\n## 📦 Shared Types & Interfaces\n${\n data.coupling.sharedTypes.length > 0\n ? data.coupling.sharedTypes.map(t => `- \\`${t}\\``).join('\\n')\n : '- *No identical type names detected between modules.*'\n}\n\n## 📋 Interface Alignment Summary\n- **${path.basename(data.fileA.filePath)} Exports:** ${data.fileA.exports.length} symbols.\n- **${path.basename(data.fileB.filePath)} Exports:** ${data.fileB.exports.length} symbols.\n`;\n}\n\nfunction renderDirectoryDossier(data) {\n return `---\nversion: 2.0.0\ntarget_dir: \"${data.dirPath}\"\nmanifests: [${data.manifests.join(', ')}]\nlast_synced: \"${new Date().toISOString().split('T')[0]}\"\n---\n\n<!-- PROJECT_AI_ONBOARDING_CARD -->\nProject Subsystem: ${data.dirPath}\nManifests: ${data.manifests.join(', ') || 'None'}\nSubsystems: ${data.subsystems.map(s => s.name).join(', ')}\n<!-- /PROJECT_AI_ONBOARDING_CARD -->\n\n# 🏛️ SUBSYSTEM DOSSIER: \\`${data.dirPath}\\`\n\n## 🗺️ Subsystem Architecture Clusters\n\\`\\`\\`mermaid\ngraph TD\n${data.subsystems.map(s => ` S_${s.name}[\"${s.name} (${s.fileCount} files)\"]`).join('\\n')}\n\\`\\`\\`\n\n## 📂 Subsystem Breakdown\n| Subsystem Folder | File Count | Samples |\n| :--- | :--- | :--- |\n${data.subsystems.map(s => `| \\`${s.name}/\\` | ${s.fileCount} | \\`${s.keySample}\\` |`).join('\\n')}\n`;\n}\n\n// ── Living Vault Manager ───────────────────────────────────────────────────\n\nfunction syncVaultIndex(workspaceRoot = process.cwd()) {\n const docsDir = getDocsDir(workspaceRoot);\n const indexFile = path.join(docsDir, 'INDEX.md');\n\n if (!fs.existsSync(docsDir)) {\n fs.mkdirSync(docsDir, { recursive: true });\n }\n\n const files = fs\n .readdirSync(docsDir)\n .filter(f => f.endsWith('.context.md') || f.endsWith('.bridge.md'));\n\n const rows = [];\n for (const f of files) {\n const content = fs.readFileSync(path.join(docsDir, f), 'utf8');\n const sourceMatch = content.match(/source_file:\\s*[\"']?([^\"'\\n]+)/);\n const bridgeMatch = content.match(/bridge:\\s*[\"']?([^\"'\\n]+)/);\n const dirMatch = content.match(/target_dir:\\s*[\"']?([^\"'\\n]+)/);\n const hashMatch = content.match(/source_hash:\\s*[\"']?([^\"'\\n]+)/);\n const domainMatch = content.match(/domain_layer:\\s*[\"']?([^\"'\\n]+)/);\n\n let source = f;\n let domain = 'General';\n const hash = hashMatch ? hashMatch[1] : 'n/a';\n let status = '🟢 Fresh';\n\n if (sourceMatch) {\n source = sourceMatch[1].replace(/[\"']/g, '');\n domain = domainMatch ? domainMatch[1].replace(/[\"']/g, '') : 'Single Module';\n const absSource = resolvePath(source, workspaceRoot);\n if (fs.existsSync(absSource)) {\n const curHash = computeSha256(fs.readFileSync(absSource, 'utf8'));\n if (curHash !== hash) {\n status = '🔴 Stale';\n }\n } else {\n status = '⚪ Missing';\n }\n } else if (bridgeMatch) {\n source = bridgeMatch[1].replace(/[\"']/g, '');\n domain = 'Interface Bridge';\n status = '🟢 Linked';\n } else if (dirMatch) {\n source = dirMatch[1].replace(/[\"']/g, '');\n domain = 'Subsystem Cluster';\n const absDir = resolvePath(source, workspaceRoot);\n status = fs.existsSync(absDir) ? '🟢 Active' : '⚪ Missing';\n }\n\n rows.push(`| [\\`${source}\\`](${f}) | ${domain} | \\`${hash}\\` | ${status} |`);\n }\n\n const indexContent = `# 📚 Codebase Context Vault Registry\n> Living architectural catalog generated and verified by \\`/context\\`.\n\n| Source Target | Domain Layer | Hash Snapshot | Status |\n| :--- | :--- | :--- | :--- |\n${rows.join('\\n') || '| *No context dossiers generated yet. Run `/context <file>` to begin.* | - | - | - |'}\n\n---\n*Run \\`node scripts/context_compiler.js --check\\` to audit context freshness across all files.*\n`;\n\n fs.writeFileSync(indexFile, indexContent, 'utf8');\n return { indexedCount: files.length, indexFile };\n}\n\nfunction checkDrift(workspaceRoot = process.cwd()) {\n const syncRes = syncVaultIndex(workspaceRoot);\n const content = fs.readFileSync(syncRes.indexFile, 'utf8');\n const staleCount = (content.match(/🔴 Stale/g) || []).length;\n const freshCount = (content.match(/🟢 Fresh/g) || []).length;\n\n return {\n total: syncRes.indexedCount,\n fresh: freshCount,\n stale: staleCount,\n isHealthy: staleCount === 0,\n };\n}\n\n// ── CLI Dispatcher ─────────────────────────────────────────────────────────\n\nfunction main() {\n const args = process.argv.slice(2);\n const workspaceRoot = process.cwd();\n\n if (args.includes('--check')) {\n const drift = checkDrift(workspaceRoot);\n console.log(`\\n${C.BOLD}═══ Context Vault Drift Audit ═══${C.RESET}`);\n console.log(`Total Dossiers: ${drift.total}`);\n console.log(`🟢 Fresh: ${drift.fresh}`);\n console.log(`🔴 Stale: ${drift.stale}`);\n console.log(\n `Status: ${drift.isHealthy ? C.GREEN + 'HEALTHY' : C.RED + 'DRIFT DETECTED'}${C.RESET}\\n`,\n );\n process.exit(drift.isHealthy ? 0 : 1);\n }\n\n let fileArg = null;\n let dirArg = null;\n let multiArgs = [];\n const writeFlag = args.includes('--write');\n const jsonFlag = args.includes('--json');\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] === '--file' && args[i + 1]) {\n fileArg = args[++i];\n } else if (args[i] === '--dir' && args[i + 1]) {\n dirArg = args[++i];\n } else if (args[i] === '--multi' && args[i + 1] && args[i + 2]) {\n multiArgs = [args[++i], args[++i]];\n } else if (!args[i].startsWith('--')) {\n if (!fileArg && !dirArg) {\n // Autodetect positional arg\n const candidate = args[i].replace(/^['\"]|['\"]$/g, '');\n if (fs.existsSync(candidate)) {\n if (fs.statSync(candidate).isDirectory()) {\n dirArg = candidate;\n } else {\n fileArg = candidate;\n }\n }\n }\n }\n }\n\n if (multiArgs.length === 2) {\n const result = analyzeMultiFileBridge(multiArgs[0], multiArgs[1], workspaceRoot);\n if (jsonFlag) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n const md = renderBridgeDossier(result);\n if (writeFlag) {\n const outName = `${path.basename(multiArgs[0]).replace(/\\.[^.]+$/, '')}__${path.basename(multiArgs[1]).replace(/\\.[^.]+$/, '')}.bridge.md`;\n const dest = path.join(workspaceRoot, 'docs', 'context', outName);\n fs.mkdirSync(path.dirname(dest), { recursive: true });\n fs.writeFileSync(dest, md, 'utf8');\n syncVaultIndex(workspaceRoot);\n console.log(`${C.GREEN}✔ Bridge Dossier written to ${dest}${C.RESET}`);\n } else {\n console.log(md);\n }\n }\n } else if (dirArg) {\n const result = analyzeDirectory(dirArg, workspaceRoot);\n if (jsonFlag) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n const md = renderDirectoryDossier(result);\n if (writeFlag) {\n const outName = `${path.basename(dirArg)}.context.md`;\n const dest = path.join(workspaceRoot, 'docs', 'context', outName);\n fs.mkdirSync(path.dirname(dest), { recursive: true });\n fs.writeFileSync(dest, md, 'utf8');\n syncVaultIndex(workspaceRoot);\n console.log(`${C.GREEN}✔ Directory Dossier written to ${dest}${C.RESET}`);\n } else {\n console.log(md);\n }\n }\n } else if (fileArg) {\n const result = analyzeSingleFile(fileArg, workspaceRoot);\n if (jsonFlag) {\n console.log(JSON.stringify(result, null, 2));\n } else {\n const md = renderSingleFileDossier(result);\n if (writeFlag) {\n const outName = `${path.basename(fileArg).replace(/\\.[^.]+$/, '')}.context.md`;\n const dest = path.join(workspaceRoot, 'docs', 'context', outName);\n fs.mkdirSync(path.dirname(dest), { recursive: true });\n fs.writeFileSync(dest, md, 'utf8');\n syncVaultIndex(workspaceRoot);\n console.log(`${C.GREEN}✔ Single-File Dossier written to ${dest}${C.RESET}`);\n } else {\n console.log(md);\n }\n }\n } else {\n console.error(\n `${C.RED}Error: Provide --file <path>, --dir <path>, --multi <fileA> <fileB>, or --check${C.RESET}`,\n );\n process.exit(1);\n }\n}\n\n// Export functions for in-process MCP server use\nmodule.exports = {\n analyzeSingleFile,\n analyzeMultiFileBridge,\n analyzeDirectory,\n renderSingleFileDossier,\n renderBridgeDossier,\n renderDirectoryDossier,\n syncVaultIndex,\n checkDrift,\n};\n\nif (require.main === module) {\n main();\n}\n"
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/fix-vbc.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n/**\n * fix-vbc.js — Batch appends missing VBC Protocol and Pre-Flight sections\n * to all SKILL.md files in .agent/skills/ that are failing validation.\n *\n * Run: node scripts/fix-vbc.js\n * Dry-run: node scripts/fix-vbc.js --dry-run\n */\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst ROOT = path.resolve(__dirname, '..');\nconst SKILLS_DIR = path.join(ROOT, '.agent', 'skills');\nconst DRY_RUN = process.argv.includes('--dry-run');\n\nconst PRE_FLIGHT_BLOCK = `\n### ✅ Pre-Flight Self-Audit\n\n\\`\\`\\`\n✅ Did I rely ONLY on real, verified tools and methods?\n✅ Is this solution appropriately scoped to the user's constraints?\n✅ Did I handle potential failure modes and edge cases?\n✅ Have I avoided generic boilerplate that doesn't add value?\n\\`\\`\\`\n`;\n\nconst VBC_BLOCK = `\n### 🛑 Verification-Before-Completion (VBC) Protocol\n\n**CRITICAL:** You must follow a strict \"evidence-based closeout\" state machine.\n\n- ❌ **Forbidden:** Declaring a task complete because the output \"looks correct.\"\n- ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.\n`;\n\nlet fixedCount = 0;\nlet skippedCount = 0;\nlet errorCount = 0;\n\nconst skillDirs = fs.readdirSync(SKILLS_DIR).filter(d => {\n return fs.statSync(path.join(SKILLS_DIR, d)).isDirectory();\n});\n\nfor (const dir of skillDirs) {\n const skillPath = path.join(SKILLS_DIR, dir, 'SKILL.md');\n if (!fs.existsSync(skillPath)) continue;\n\n let content;\n try {\n content = fs.readFileSync(skillPath, 'utf8');\n } catch (e) {\n console.error(` ❌ Failed to read: ${dir}/SKILL.md — ${e.message}`);\n errorCount++;\n continue;\n }\n\n const hasPreFlight = content.includes('Pre-Flight Checklist') || content.includes('Pre-Flight');\n const hasVBC = content.includes('VBC Protocol') || content.includes('VBC');\n\n if (hasPreFlight && hasVBC) {\n skippedCount++;\n continue;\n }\n\n let appendText = '';\n\n if (!hasPreFlight) {\n appendText += PRE_FLIGHT_BLOCK;\n console.log(` 🔧 ${dir}/SKILL.md — appending Pre-Flight Self-Audit`);\n }\n\n if (!hasVBC) {\n appendText += VBC_BLOCK;\n console.log(` 🔧 ${dir}/SKILL.md — appending VBC Protocol`);\n }\n\n if (DRY_RUN) {\n console.log(` [DRY-RUN] Would append to ${dir}/SKILL.md`);\n } else {\n try {\n fs.appendFileSync(skillPath, appendText, 'utf8');\n fixedCount++;\n } catch (e) {\n console.error(` ❌ Failed to write: ${dir}/SKILL.md — ${e.message}`);\n errorCount++;\n }\n }\n}\n\nconsole.log(`\\n━━━ VBC Fix Summary ━━━━━━━━━━━━━━━━━━━━━`);\nconsole.log(` Fixed: ${fixedCount}`);\nconsole.log(` Skipped: ${skippedCount} (already compliant)`);\nconsole.log(` Errors: ${errorCount}`);\nconsole.log(` Mode: ${DRY_RUN ? 'DRY-RUN (no changes)' : 'LIVE'}`);\nconsole.log();\n"
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/modernize_skills.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n/**\n * modernize_skills.js — Tribunal Kit Skill Modernizer & Schema Validator (v4.0.0)\n *\n * Scans, deduplicates, standardizes, and validates all SKILL.md files across:\n * - tribunal-kit/.agent/skills/\n * - .agent/skills/ (when --sync-to-root is passed)\n *\n * Usage:\n * node scripts/modernize_skills.js --validate\n * node scripts/modernize_skills.js --dry-run\n * node scripts/modernize_skills.js --fix\n * node scripts/modernize_skills.js --fix --sync-to-root\n */\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst ROOT = path.resolve(__dirname, '..');\nconst SKILLS_DIR = path.join(ROOT, '.agent', 'skills');\nconst WORKSPACE_ROOT = path.resolve(ROOT, '..');\nconst ROOT_SKILLS_DIR = path.join(WORKSPACE_ROOT, '.agent', 'skills');\n\nconst ARGS = process.argv.slice(2);\nconst DRY_RUN = ARGS.includes('--dry-run');\nconst FIX = ARGS.includes('--fix');\nconst _VALIDATE = ARGS.includes('--validate') || (!DRY_RUN && !FIX);\nconst SYNC_TO_ROOT = ARGS.includes('--sync-to-root');\n\nconst CANONICAL_FOOTER = `---\n\n## 🏛️ Tribunal Verification & Guardrails\n\n**Slash command: \\`/review\\` or \\`/tribunal-full\\`**\n**Active reviewers: \\`logic-reviewer\\` · \\`security-auditor\\`**\n\n### ❌ Forbidden AI Tropes\n1. **Blind Assumptions:** Never make an assumption without documenting it clearly with \\`// VERIFY: [reason]\\`.\n2. **Silent Degradation:** Catching and suppressing errors without logging or handling.\n3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.\n\n### ✅ Pre-Flight Self-Audit\n\\`\\`\\`\n✅ Did I rely ONLY on real, verified tools and methods?\n✅ Is this solution appropriately scoped to the user's constraints?\n✅ Did I handle potential failure modes and edge cases?\n✅ Have I avoided generic boilerplate that doesn't add value?\n\\`\\`\\`\n\n### 🛑 Verification-Before-Completion (VBC) Protocol\n**CRITICAL:** You must follow a strict \"evidence-based closeout\" state machine.\n- ❌ **Forbidden:** Declaring a task complete because the output \"looks correct.\"\n- ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.\n`;\n\nfunction parseFrontmatter(content) {\n if (!content.startsWith('---')) return { frontmatter: null, body: content };\n const endIdx = content.indexOf('\\n---', 3);\n if (endIdx === -1) return { frontmatter: null, body: content };\n\n const rawYaml = content.slice(4, endIdx).trim();\n const body = content.slice(endIdx + 4).trim();\n const meta = {};\n\n const lines = rawYaml.split('\\n');\n let currentKey = null;\n let isList = false;\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith('#')) continue;\n\n const match = line.match(/^([a-zA-Z0-9_-]+):\\s*(.*)$/);\n if (match) {\n currentKey = match[1];\n const val = match[2].trim();\n if (!val) {\n meta[currentKey] = [];\n isList = true;\n } else {\n meta[currentKey] = val;\n isList = false;\n }\n } else if (isList && trimmed.startsWith('-')) {\n const item = trimmed\n .slice(1)\n .trim()\n .replace(/^['\"]|['\"]$/g, '');\n if (Array.isArray(meta[currentKey])) {\n meta[currentKey].push(item);\n }\n }\n }\n\n return { frontmatter: rawYaml, meta, body };\n}\n\nfunction deduplicateAndCleanBody(body, skillName, description) {\n let cleaned = body;\n\n // 1. Remove duplicate top-level headers if repeated identical lines\n const titleMatch = cleaned.match(/^#\\s+(.+)$/m);\n if (titleMatch) {\n const title = titleMatch[1].trim();\n const titleRegex = new RegExp(`(^|\\\\n)#\\\\s+${escapeRegex(title)}(\\\\r?\\\\n)+`, 'g');\n let first = true;\n cleaned = cleaned.replace(titleRegex, (match, prefix) => {\n if (first) {\n first = false;\n return match;\n }\n return prefix;\n });\n }\n\n // 2. Strip existing canonical footer if present to ensure idempotency\n const existingFooterIdx = cleaned.indexOf('## 🏛️ Tribunal Verification & Guardrails');\n if (existingFooterIdx !== -1) {\n cleaned = cleaned.slice(0, existingFooterIdx).trim();\n }\n\n // Cut off legacy trailing guardrail stacks\n const footerMarkerRegex =\n /\\n---\\s*\\n+(\\*\\*Slash command: `\\/review`|## 🤖 LLM-Specific Traps|## 🏛️ Tribunal Integration|### ❌ Forbidden AI Tropes|## Pre-Flight Checklist|## VBC Protocol)[\\s\\S]*$/;\n cleaned = cleaned.replace(footerMarkerRegex, '').trim();\n\n // Remove any remaining isolated duplicate VBC blocks (H2 or H3)\n const isolatedVbcRegex =\n /(##|###)\\s+🛑?\\s*Verification-Before-Completion \\(VBC\\) Protocol[\\s\\S]*?(?=\\n## |\\n---|\\n# |$)/g;\n cleaned = cleaned.replace(isolatedVbcRegex, '');\n\n // Remove trailing horizontal rules or whitespace\n cleaned = cleaned.replace(/(\\n---\\s*)+$/, '').trim();\n\n // 3. Ensure Activation Boundaries section exists near the top\n if (!cleaned.includes('Activation Boundaries') && !cleaned.includes('Activate when:')) {\n 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`;\n\n if (cleaned.includes('## Mandatory Pre-Flight Context Inspection')) {\n cleaned = cleaned.replace(\n /(## Mandatory Pre-Flight Context Inspection[\\s\\S]*?(?=\\n## |\\n# |\\n---|$))/,\n `$1${activationBlock}`,\n );\n } else {\n cleaned = cleaned.replace(/^(#[^\\n]+\\n+)/, `$1${activationBlock}\\n`);\n }\n }\n\n // 4. Append single Canonical Footer\n cleaned = `${cleaned}\\n\\n${CANONICAL_FOOTER}`;\n\n return cleaned.trim();\n}\n\nfunction escapeRegex(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction processSkill(skillDirName) {\n const skillFile = path.join(SKILLS_DIR, skillDirName, 'SKILL.md');\n if (!fs.existsSync(skillFile)) return null;\n\n const originalContent = fs.readFileSync(skillFile, 'utf8');\n const { frontmatter, meta, body } = parseFrontmatter(originalContent);\n\n if (!frontmatter) {\n return { name: skillDirName, error: 'Missing frontmatter' };\n }\n\n const desc = meta ? meta.description || '' : '';\n const newBody = deduplicateAndCleanBody(body, skillDirName, desc);\n\n // Rebuild frontmatter with version: 4.0.0 and canonical scripts-binding\n let updatedFrontmatter = frontmatter\n .replace(/^version:\\s*.*$/m, 'version: 4.0.0')\n .replace(/^last-updated:\\s*.*$/m, 'last-updated: 2026-09-07');\n\n if (!updatedFrontmatter.includes('version:')) {\n updatedFrontmatter += '\\nversion: 4.0.0';\n }\n if (!updatedFrontmatter.includes('scripts-binding:')) {\n updatedFrontmatter +=\n '\\nscripts-binding:\\n - .agent/scripts/lint_runner.js\\n - .agent/scripts/verify_all.js';\n }\n\n const newContent = `---\\n${updatedFrontmatter.trim()}\\n---\\n\\n${newBody}\\n`;\n\n const vbcMatches = (newContent.match(/Verification-Before-Completion \\(VBC\\) Protocol/g) || [])\n .length;\n const trapsMatches = (newContent.match(/LLM-Specific Traps/g) || []).length;\n const isDuplicated = vbcMatches > 1 || trapsMatches > 1;\n\n const modified = newContent !== originalContent;\n\n if (modified && FIX) {\n fs.writeFileSync(skillFile, newContent, 'utf8');\n if (SYNC_TO_ROOT && fs.existsSync(ROOT_SKILLS_DIR)) {\n const rootSkillDir = path.join(ROOT_SKILLS_DIR, skillDirName);\n if (!fs.existsSync(rootSkillDir)) fs.mkdirSync(rootSkillDir, { recursive: true });\n fs.writeFileSync(path.join(rootSkillDir, 'SKILL.md'), newContent, 'utf8');\n }\n }\n\n return {\n name: skillDirName,\n isDuplicated,\n modified,\n vbcMatches,\n trapsMatches,\n };\n}\n\nfunction main() {\n console.log(`━━━ Tribunal Kit Skill Modernizer ━━━━━━━━━━━━━━━━━━━━━`);\n console.log(`Target: ${SKILLS_DIR}`);\n console.log(\n `Mode: ${FIX ? 'FIX (Overwriting files)' : DRY_RUN ? 'DRY-RUN (Simulated)' : 'VALIDATE (Read-only)'}`,\n );\n if (SYNC_TO_ROOT) console.log(`Sync: Enabled -> ${ROOT_SKILLS_DIR}`);\n console.log();\n\n const skillDirs = fs.readdirSync(SKILLS_DIR).filter(d => {\n return fs.statSync(path.join(SKILLS_DIR, d)).isDirectory();\n });\n\n let totalSkills = 0;\n let totalDuplicated = 0;\n let totalModified = 0;\n const errors = [];\n\n for (const dir of skillDirs) {\n totalSkills++;\n const res = processSkill(dir);\n if (!res) continue;\n if (res.error) {\n errors.push(`${dir}: ${res.error}`);\n continue;\n }\n if (res.isDuplicated) {\n totalDuplicated++;\n }\n if (res.modified) {\n totalModified++;\n }\n }\n\n console.log(`📊 Summary:`);\n console.log(` Total Skills Analyzed: ${totalSkills}`);\n console.log(` Skills with Remaining Duplications: ${totalDuplicated}`);\n console.log(` Skills Needing Modification: ${totalModified}`);\n console.log(` Errors: ${errors.length}`);\n\n if (errors.length > 0) {\n console.log(`\\n❌ Errors encountered:`);\n errors.forEach(e => console.log(` - ${e}`));\n }\n\n console.log();\n if (!FIX && totalModified > 0) {\n console.log(\n `💡 Run with --fix to apply cleanups and V4 schema across all ${totalModified} skills.`,\n );\n } else if (FIX) {\n console.log(`✅ Successfully modernized and deduplicated skills to V4 schema!`);\n }\n}\n\nmain();\n"
|
|
11
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/package-cores.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": [],
|
|
8
|
-
"child_process": []
|
|
9
|
-
},
|
|
10
|
-
"dependents": [],
|
|
11
|
-
"content": "#!/usr/bin/env node\n/**\n * package-cores.js — Automates bundling of @tribunal-kit/core-* platform npm packages.\n *\n * Reads npm/core-template/package.json and generates platform-specific packages\n * for Darwin, Linux, and Windows (x64 and arm64).\n *\n * Usage:\n * node scripts/package-cores.js # Generate package directories\n * node scripts/package-cores.js --pack # Run npm pack in each generated package\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst { execSync } = require('child_process');\n\nconst ROOT = path.resolve(__dirname, '..');\nconst TEMPLATE_PKG = path.join(ROOT, 'npm', 'core-template', 'package.json');\nconst OUTPUT_DIR = path.join(ROOT, 'npm', 'packages');\nconst PKG = require(path.join(ROOT, 'package.json'));\nconst VERSION = PKG.version;\n\nconst PLATFORMS = [\n { platform: 'darwin', arch: 'arm64', ext: '', rustTarget: 'aarch64-apple-darwin' },\n { platform: 'darwin', arch: 'x64', ext: '', rustTarget: 'x86_64-apple-darwin' },\n { platform: 'linux', arch: 'arm64', ext: '', rustTarget: 'aarch64-unknown-linux-gnu' },\n { platform: 'linux', arch: 'x64', ext: '', rustTarget: 'x86_64-unknown-linux-gnu' },\n { platform: 'win32', arch: 'arm64', ext: '.exe', rustTarget: 'aarch64-pc-windows-msvc' },\n { platform: 'win32', arch: 'x64', ext: '.exe', rustTarget: 'x86_64-pc-windows-msvc' },\n];\n\nfunction ensureDir(dir) {\n if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });\n}\n\nfunction findBinary(platform, ext, rustTarget) {\n const binaryName = `tribunal-core${ext}`;\n const candidates = [\n path.join(ROOT, 'target', rustTarget, 'release', binaryName),\n path.join(ROOT, 'target', 'release', binaryName),\n path.join(\n ROOT,\n `tribunal-core-${platform}-${rustTarget.includes('arm64') || rustTarget.includes('aarch64') ? 'arm64' : 'x64'}${ext}`,\n ),\n ];\n\n for (const cand of candidates) {\n if (fs.existsSync(cand)) return cand;\n }\n return null;\n}\n\nfunction buildPackages(shouldPack = false) {\n if (!fs.existsSync(TEMPLATE_PKG)) {\n console.error(`Missing template: ${TEMPLATE_PKG}`);\n process.exit(1);\n }\n\n const templateRaw = fs.readFileSync(TEMPLATE_PKG, 'utf8');\n ensureDir(OUTPUT_DIR);\n\n console.log(`\\n 🔱 Packaging Tribunal Core Platform Packages (v${VERSION})\\n`);\n\n for (const target of PLATFORMS) {\n const pkgName = `core-${target.platform}-${target.arch}`;\n const pkgDir = path.join(OUTPUT_DIR, pkgName);\n const binDir = path.join(pkgDir, 'bin');\n ensureDir(binDir);\n\n const pkgContent = templateRaw\n .replace(/\\$\\{PLATFORM\\}/g, target.platform)\n .replace(/\\$\\{ARCH\\}/g, target.arch)\n .replace(/\\$\\{EXT\\}/g, target.ext);\n\n const pkgJson = JSON.parse(pkgContent);\n pkgJson.version = VERSION;\n\n fs.writeFileSync(path.join(pkgDir, 'package.json'), JSON.stringify(pkgJson, null, 2));\n\n // Write README\n fs.writeFileSync(\n path.join(pkgDir, 'README.md'),\n `# @tribunal-kit/${pkgName}\\n\\nPrecompiled native Rust binary of Tribunal Core for ${target.platform} (${target.arch}).\\n`,\n );\n\n // Copy binary if available\n const binarySource = findBinary(target.platform, target.ext, target.rustTarget);\n const destBinary = path.join(binDir, `tribunal-core${target.ext}`);\n\n if (binarySource && fs.existsSync(binarySource)) {\n fs.copyFileSync(binarySource, destBinary);\n if (target.platform !== 'win32') {\n fs.chmodSync(destBinary, 0o755);\n }\n console.log(` ✓ Built ${pkgName} (with binary)`);\n } else {\n console.log(` ⚠ Built ${pkgName} (staged, binary not found in build tree)`);\n }\n\n if (shouldPack) {\n try {\n execSync('npm pack', { cwd: pkgDir, stdio: 'ignore' });\n console.log(` ↳ Packed .tgz`);\n } catch (e) {\n console.error(` ↳ Failed to pack: ${e.message}`);\n }\n }\n }\n\n console.log(`\\n ✓ Generated 6 platform packages in ${OUTPUT_DIR}\\n`);\n}\n\nconst isPack = process.argv.includes('--pack');\nbuildPackages(isPack);\n"
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/skill_enhancement_engine.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n/**\n * skill_enhancement_engine.js — State-of-the-Art Skill Enhancement Engine\n *\n * Transforms SKILL.md definitions into autonomous, production-grade execution engines.\n * Implements the 18-section architectural framework:\n * 1. Objective Layer & High-Impact Mission\n * 2. Input Intelligence Layer\n * 3. Task Decomposition Layer\n * 4. Multi-Pass Execution Protocol (Pass 1-7)\n * 5. Domain Technical Reference Architecture\n * 6. Edge-Case Engine Matrix\n * 7. Self-Critique & Anti-Hallucination Traps\n * 8. Tribunal Integration & Evidence-based VBC\n *\n * Usage:\n * node scripts/skill_enhancement_engine.js --validate\n * node scripts/skill_enhancement_engine.js --skill <name> --fix\n * node scripts/skill_enhancement_engine.js --domain <domain> --fix\n * node scripts/skill_enhancement_engine.js --all --dry-run\n * node scripts/skill_enhancement_engine.js --all --fix --sync-to-root\n */\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst ROOT = path.resolve(__dirname, '..');\nconst SKILLS_DIR = path.join(ROOT, '.agent', 'skills');\nconst WORKSPACE_ROOT = path.resolve(ROOT, '..');\nconst ROOT_SKILLS_DIR = path.join(WORKSPACE_ROOT, '.agent', 'skills');\nconst TOPIC_MAP_PATH = path.join(ROOT, '.agent', 'skill_topic_map.json');\n\nconst ARGS = process.argv.slice(2);\nconst DRY_RUN = ARGS.includes('--dry-run');\nconst FIX = ARGS.includes('--fix');\nconst SYNC_TO_ROOT = ARGS.includes('--sync-to-root');\n\nconst skillArgIdx = ARGS.indexOf('--skill');\nconst TARGET_SKILL = skillArgIdx !== -1 && ARGS[skillArgIdx + 1] ? ARGS[skillArgIdx + 1] : null;\n\nconst domainArgIdx = ARGS.indexOf('--domain');\nconst TARGET_DOMAIN = domainArgIdx !== -1 && ARGS[domainArgIdx + 1] ? ARGS[domainArgIdx + 1] : null;\n\n// Domain mapping & Active Reviewers\nlet domainRoutes = {};\nif (fs.existsSync(TOPIC_MAP_PATH)) {\n try {\n const raw = JSON.parse(fs.readFileSync(TOPIC_MAP_PATH, 'utf8'));\n domainRoutes = raw.domain_routes || {};\n } catch (e) {\n console.warn(`[WARN] Failed to load skill_topic_map.json: ${e.message}`);\n }\n}\n\nfunction getSkillDomain(skillName) {\n for (const [domain, list] of Object.entries(domainRoutes)) {\n if (list.includes(skillName)) return domain;\n }\n if (skillName.includes('anim') || skillName.includes('motion') || skillName.includes('gsap'))\n return 'motion';\n if (\n skillName.includes('react') ||\n skillName.includes('ui') ||\n skillName.includes('css') ||\n skillName.includes('design')\n )\n return 'frontend';\n if (skillName.includes('sql') || skillName.includes('db') || skillName.includes('data'))\n return 'database';\n if (\n skillName.includes('security') ||\n skillName.includes('audit') ||\n skillName.includes('vulnerab')\n )\n return 'security';\n if (skillName.includes('test') || skillName.includes('qa')) return 'testing';\n if (\n skillName.includes('devops') ||\n skillName.includes('ci') ||\n skillName.includes('cloud') ||\n skillName.includes('bash')\n )\n return 'devops';\n if (skillName.includes('mobile') || skillName.includes('swift') || skillName.includes('expo'))\n return 'mobile';\n if (\n skillName.includes('api') ||\n skillName.includes('python') ||\n skillName.includes('rust') ||\n skillName.includes('backend')\n )\n return 'backend';\n return 'meta';\n}\n\nconst DOMAIN_REVIEWERS = {\n frontend: ['frontend-reviewer', 'type-safety', 'ui-ux-auditor', 'complexity-reviewer'],\n motion: ['frontend-reviewer', 'motion-reviewer', 'ui-ux-auditor'],\n backend: ['logic-reviewer', 'security-auditor', 'api-architect', 'resilience-reviewer'],\n database: ['database-architect', 'sql-pro', 'security-auditor', 'schema-validator'],\n security: ['security-auditor', 'penetration-tester', 'backend-security-expert'],\n devops: ['pipeline-reviewer', 'devops-engineer', 'resilience-reviewer'],\n testing: ['test-engineer', 'qa-automation-engineer', 'logic-reviewer'],\n mobile: ['mobile-reviewer', 'frontend-reviewer', 'type-safety'],\n meta: ['orchestrator', 'agent-organizer', 'logic-reviewer'],\n};\n\nconst DOMAIN_PREFLIGHT = {\n frontend: [\n '✅ Are all component props strictly typed with zero implicit \"any\"?',\n '✅ Are responsive breakpoints, fluid typography, and optical balance verified?',\n '✅ Is accessibility (ARIA labels, keyboard focus, contrast) validated?',\n '✅ Are re-renders minimized and state lifecycles cleanly separated?',\n '✅ Did I verify all imported UI components and icon sets actually exist?',\n ],\n motion: [\n '✅ Does animation maintain 60fps/120fps using transform and opacity?',\n '✅ Is optical mass conserved across state interpolations without volume collapse?',\n '✅ Is duration capped within micro-interaction budgets (160ms–280ms)?',\n '✅ Is prefers-reduced-motion respected with graceful instant fallbacks?',\n '✅ Did I prevent layout thrashing and continuous geometry mutations?',\n ],\n backend: [\n '✅ Are all inputs and boundary payloads validated against schemas (Zod/Pydantic)?',\n '✅ Are SQL and database queries parameterized with zero string concatenation?',\n '✅ Are error boundaries and timeout/retry policies explicitly declared?',\n '✅ Are authentication checks performed before business logic execution?',\n '✅ Did I verify that imported dependencies exist in package.json/requirements.txt?',\n ],\n database: [\n '✅ Are all queries parameterized against SQL injection vulnerabilities?',\n '✅ Are indexes defined for all foreign keys, joins, and filtered query clauses?',\n '✅ Are transactions wrapped atomically with rollbacks on failure?',\n '✅ Are migration scripts backwards-compatible (expand-and-contract pattern)?',\n '✅ Did I verify column names against active schema definitions?',\n ],\n security: [\n '✅ Are user inputs sanitized and treated as untrusted at system boundaries?',\n '✅ Are secrets loaded strictly via environment variables with zero hardcoding?',\n '✅ Is least-privilege enforcement active on APIs, tokens, and storage buckets?',\n '✅ Are prompt-injection delimiters and sanitizers wrapped around LLM inputs?',\n '✅ Did I verify encryption in transit and at rest for sensitive customer data?',\n ],\n devops: [\n '✅ Are strict execution modes (set -euo pipefail) active on all scripts?',\n '✅ Are container images pinned to digest/immutable tags instead of \"latest\"?',\n '✅ Are deployment health checks and rollback baselines configured?',\n '✅ Are CI secrets masked and unexposed to untrusted pull requests?',\n '✅ Did I verify environment compatibility across target runtimes?',\n ],\n testing: [\n '✅ Do tests follow behavioral GIVEN/WHEN/THEN specifications?',\n '✅ Are happy path, failure paths, and boundary conditions (0, null, max) covered?',\n '✅ Are test mocks isolated and reset between successive suites?',\n '✅ Do E2E locators rely on stable ARIA attributes instead of brittle CSS selectors?',\n '✅ Did I verify test suite passes without flaky race conditions?',\n ],\n mobile: [\n '✅ Do touch targets satisfy the 44x44px minimum touch boundary standard?',\n '✅ Are gesture handlers and native thread animations offloaded via Reanimated?',\n '✅ Are keyboard avoiding views, safe areas, and notch offsets handled?',\n '✅ Is offline storage and state hydration handled with optimistic sync?',\n '✅ Did I verify compatibility across iOS, Android, and varying densities?',\n ],\n meta: [\n '✅ Did I deconstruct the root objective before proposing architecture?',\n '✅ Did I identify dependencies, bottlenecks, and parallelizable sub-tasks?',\n '✅ Did I avoid over-engineering and select the simplest effective pattern?',\n '✅ Did I verify assumptions with concrete file reads instead of speculation?',\n '✅ Did I establish measurable verification criteria before completion?',\n ],\n};\n\nconst DOMAIN_TRAPS = {\n frontend: [\n {\n trope: 'Uncontrolled Re-render Loop',\n bad: 'Mutating state inside render bodies or omitting hook dependencies',\n good: 'Wrap effects with explicit deps and isolate reactive derivations in useMemo',\n },\n {\n trope: 'Accessibility Neglect',\n bad: 'Interactive <div> without role=\"button\", tabIndex, or onKeyDown',\n good: 'Use semantic <button> or provide ARIA role, keyboard handlers, and focus ring',\n },\n {\n trope: 'Layout Shift Flash',\n bad: 'Images/dynamic content without aspect-ratio or explicit dimensions',\n good: 'Enforce aspect-ratio or skeleton placeholders to guarantee zero CLS',\n },\n ],\n motion: [\n {\n trope: 'The Instant Pop Trap',\n bad: 'Conditionally unmounting elements without animated interpolation',\n good: 'Use AnimatePresence or coordinate morphs with continuous geometry',\n },\n {\n trope: 'Layout Thrashing',\n bad: 'Animating width, height, top, or left inside animation loops',\n good: 'Animate composite-only transform (translate3d, scale) and opacity',\n },\n {\n trope: 'Sluggish Duration',\n bad: 'Setting micro-interaction transitions to 600ms+ causing interface lag',\n good: 'Cap interactive feedback at 160ms–240ms with snappy ease-out curves',\n },\n ],\n backend: [\n {\n trope: 'Unchecked Payload Cast',\n bad: 'Casting request bodies to TypeScript types without runtime schema validation',\n good: 'Parse request payloads through Zod/Pydantic schemas before business logic',\n },\n {\n trope: 'Silent Error Swallowing',\n bad: 'Catching errors with empty catch blocks or logging without rethrowing',\n good: 'Propagate structured errors with status codes and contextual stack traces',\n },\n {\n trope: 'Unparameterized Query',\n bad: 'Concatenating user inputs into SQL/Prisma query strings',\n good: 'Always use parameterized bindings or type-safe ORM query builders',\n },\n ],\n database: [\n {\n trope: 'Full Table Scan Blindspot',\n bad: 'Querying high-cardinality tables without index coverage',\n good: 'Verify query plans with EXPLAIN ANALYZE and add composite B-Tree indexes',\n },\n {\n trope: 'Non-Atomic Batch Mutation',\n bad: 'Executing multiple related DB writes sequentially without transaction wrapper',\n good: 'Wrap multi-table updates in an atomic transaction with automatic rollback',\n },\n {\n trope: 'Destructive Schema Migration',\n bad: 'Dropping or renaming columns in production without multi-phase migration',\n good: 'Use expand-and-contract: add new column, sync data, migrate callers, drop old',\n },\n ],\n security: [\n {\n trope: 'Hardcoded Secret Pattern',\n bad: 'Committing API keys, tokens, or private salts into source code',\n good: 'Load credentials strictly via runtime environment variables and secret stores',\n },\n {\n trope: 'Prompt Injection Surface',\n bad: 'Directly concatenating untrusted user input into LLM system prompts',\n good: 'Wrap user content in isolated delimiters and strip injection control sequences',\n },\n {\n trope: 'Missing Authorization Check',\n bad: 'Relying only on authentication token presence without checking tenant/object RBAC',\n good: 'Verify user permissions against the specific target record ID before mutation',\n },\n ],\n devops: [\n {\n trope: 'Silent Pipeline Failure',\n bad: 'Executing shell steps without set -euo pipefail, ignoring errors',\n good: 'Always initialize shell scripts with set -euo pipefail and trap handlers',\n },\n {\n trope: 'Unpinned Dependency Shift',\n bad: 'Installing packages with npm install or using :latest docker tags',\n good: 'Lock dependencies with npm ci / lockfiles and use immutable SHA256 image digests',\n },\n {\n trope: 'Leaking Build Secrets',\n bad: 'Passing secrets as Docker build arguments baked into image layers',\n good: 'Use Docker BuildKit secret mounts (--mount=type=secret) or runtime injection',\n },\n ],\n testing: [\n {\n trope: 'Testing Implementation Details',\n bad: 'Asserting on private component state or internal helper functions',\n good: 'Assert on observable user behaviors, DOM roles, and network outcomes',\n },\n {\n trope: 'Flaky Async Assertion',\n bad: 'Using arbitrary setTimeout delays before asserting on asynchronous state',\n good: 'Use waitFor or findBy queries that poll with timeout bounds',\n },\n {\n trope: 'Shared Mutable State',\n bad: 'Reusing database records across concurrent test runners',\n good: 'Isolate test databases per worker or execute in rolled-back transactions',\n },\n ],\n mobile: [\n {\n trope: 'JS Thread Animation Lag',\n bad: 'Driving gestures and scrolling physics on the React Native JS thread',\n good: 'Use React Native Reanimated worklets running directly on the UI thread',\n },\n {\n trope: 'Missing Keyboard Offset',\n bad: 'Forms hidden behind native software keyboard on iOS/Android',\n good: 'Wrap form views in KeyboardAvoidingView with platform-calibrated behavior',\n },\n {\n trope: 'Uncached Image Flooding',\n bad: 'Rendering raw image URLs in list items without memory caching',\n good: 'Use FastImage or Expo Image with disk cache policies and thumbnail previews',\n },\n ],\n meta: [\n {\n trope: 'Hallucinated Tool Capabilities',\n bad: 'Assuming an external library or CLI command exists without verification',\n good: 'Run a verification check or verify package.json before referencing tools',\n },\n {\n trope: 'Premature Completion Claim',\n bad: 'Declaring a task finished because code was generated without verification',\n good: 'Execute tests, linters, or terminal commands to provide concrete proof',\n },\n {\n trope: 'Context Bloat Dumping',\n bad: 'Pasting entire multi-thousand-line files into prompt context',\n good: 'Extract targeted excerpts, symbols, and signatures to preserve tokens',\n },\n ],\n};\n\nfunction parseFrontmatter(content) {\n if (!content.startsWith('---')) return { frontmatter: null, body: content };\n const endIdx = content.indexOf('\\n---', 3);\n if (endIdx === -1) return { frontmatter: null, body: content };\n\n const rawYaml = content.slice(4, endIdx).trim();\n const body = content.slice(endIdx + 4).trim();\n const meta = {};\n\n const lines = rawYaml.split('\\n');\n let currentKey = null;\n let isList = false;\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith('#')) continue;\n\n const match = line.match(/^([a-zA-Z0-9_-]+):\\s*(.*)$/);\n if (match) {\n currentKey = match[1];\n const val = match[2].trim();\n if (!val) {\n meta[currentKey] = [];\n isList = true;\n } else {\n meta[currentKey] = val;\n isList = false;\n }\n } else if (isList && trimmed.startsWith('-')) {\n const item = trimmed\n .slice(1)\n .trim()\n .replace(/^['\"]|['\"]$/g, '');\n if (Array.isArray(meta[currentKey])) {\n meta[currentKey].push(item);\n }\n }\n }\n\n return { frontmatter: rawYaml, meta, body };\n}\n\nfunction buildEnhancedSkill(skillName, originalContent) {\n const { frontmatter, meta, body } = parseFrontmatter(originalContent);\n if (!frontmatter) return null;\n\n const domain = getSkillDomain(skillName);\n const reviewers = DOMAIN_REVIEWERS[domain] || DOMAIN_REVIEWERS.meta;\n const preflights = DOMAIN_PREFLIGHT[domain] || DOMAIN_PREFLIGHT.meta;\n const traps = DOMAIN_TRAPS[domain] || DOMAIN_TRAPS.meta;\n\n // Extract clean title\n const titleMatch = body.match(/^#\\s+(.+)$/m);\n const title = titleMatch\n ? titleMatch[1].trim()\n : `${skillName.replace(/-/g, ' ').replace(/\\b\\w/g, c => c.toUpperCase())} Engineering`;\n\n // Extract existing core technical content (excluding legacy footers)\n let coreBody = body;\n // Strip old canonical footers or tribunal blocks\n const footerMarkerRegex =\n /\\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]*$/;\n coreBody = coreBody.replace(footerMarkerRegex, '').trim();\n\n // Strip duplicated titles\n const titleRegex = new RegExp(`^#\\\\s+${escapeRegex(title)}(\\\\r?\\\\n)+`, 'm');\n coreBody = coreBody.replace(titleRegex, '').trim();\n\n // Strip duplicate Activation Boundaries if previously inserted\n coreBody = coreBody.replace(/## Activation Boundaries[\\s\\S]*?(?=\\n## |\\n---|\\n# |$)/g, '').trim();\n coreBody = coreBody\n .replace(/## Mandatory Pre-Flight Context Inspection[\\s\\S]*?(?=\\n## |\\n---|\\n# |$)/g, '')\n .trim();\n coreBody = coreBody\n .replace(/## 🔁 Multi-Pass Execution Protocol[\\s\\S]*?(?=\\n## |\\n---|\\n# |$)/g, '')\n .trim();\n coreBody = coreBody\n .replace(/## 🚨 Edge-Case & Failure Mode Matrix[\\s\\S]*?(?=\\n## |\\n---|\\n# |$)/g, '')\n .trim();\n coreBody = coreBody\n .replace(/## 🤖 LLM-Specific Traps Table[\\s\\S]*?(?=\\n## |\\n---|\\n# |$)/g, '')\n .trim();\n coreBody = coreBody.replace(/## 🏛️ Tribunal Verification & Guardrails[\\s\\S]*$/g, '').trim();\n coreBody = coreBody.replace(/(\\n---\\s*)+$/, '').trim();\n\n // Format frontmatter with SDO trigger guarantee\n let desc = (meta.description || `${skillName} mastery.`).replace(/^[\"']|[\"']$/g, '');\n desc = desc.replace(/^(use\\s+when\\s+)+/i, '').trim();\n desc = `Use when ${desc}`;\n\n // Ensure scripts-binding\n const scripts = Array.isArray(meta['scripts-binding'])\n ? meta['scripts-binding']\n : ['.agent/scripts/lint_runner.js', '.agent/scripts/verify_all.js'];\n if (!scripts.includes('.agent/scripts/lint_runner.js'))\n scripts.push('.agent/scripts/lint_runner.js');\n if (!scripts.includes('.agent/scripts/verify_all.js'))\n scripts.push('.agent/scripts/verify_all.js');\n\n const formattedFrontmatter = [\n '---',\n `name: ${skillName}`,\n `description: \"${desc.replace(/\"/g, '\\\\\"')}\"`,\n `version: 5.0.0`,\n `last-updated: 2026-09-13`,\n meta.skills && meta.skills.length\n ? `skills:\\n${meta.skills.map(s => ` - ${s}`).join('\\n')}`\n : null,\n `tools: Read, Grep, Glob, Bash, Edit, Write`,\n `scripts-binding:\\n${scripts.map(s => ` - ${s}`).join('\\n')}`,\n '---',\n ]\n .filter(Boolean)\n .join('\\n');\n\n // Build the 18-Section Architecture\n const section1_Preflight = `## Mandatory Pre-Flight Context Inspection\n\nBefore generating, refactoring, or reviewing code in the \\`${skillName}\\` domain, inspect these 5 critical parameters:\n\n1. **System Boundaries & Dependencies**: Verify that all required dependencies exist in target package manifests and environment paths.\n2. **Runtime Context & Platform Invariants**: Confirm target platform constraints (Node.js, Browser, Mobile OS, Edge runtime) before applying APIs.\n3. **Execution Guardrails**: Identify potential side-effects, state mutations, and unhandled asynchronous exceptions.\n4. **Validation & Type Contracts**: Validate input data schemas and strict type constraints across all module interfaces.\n5. **Observability & Proof of Execution**: Ensure execution produces tangible verification signals (terminal output, tests, metrics).`;\n\n const section2_Boundaries = `## Activation Boundaries\n\n- **Activate when:** ${desc}\n- **DO NOT activate when:** The task falls outside the \\`${skillName}\\` domain or is managed by a different dedicated specialist.`;\n\n const section3_ExecutionProtocol = `## 🔁 Multi-Pass Execution Protocol\n\nExecute all non-trivial tasks through this 7-pass cognitive loop:\n\n| Pass | Phase | Core Action |\n|:---|:---|:---|\n| **Pass 1** | **Understand** | Deconstruct the user's explicit objective, implicit requirements, and platform constraints. |\n| **Pass 2** | **Plan** | Decompose the task into smallest logical steps; map dependencies and required tool calls. |\n| **Pass 3** | **Execute** | Implement the solution with production-grade craft, zero placeholders, and strict typing. |\n| **Pass 4** | **Verify** | Run linters, unit tests, or compiler checks to validate structural correctness. |\n| **Pass 5** | **Attack** | Perform an adversarial review searching for edge-case failures, race conditions, and traps. |\n| **Pass 6** | **Improve** | Eliminate discovered friction, optimize performance, and harden error boundaries. |\n| **Pass 7** | **Quality Gate** | Enforce Verification-Before-Completion (VBC) with concrete terminal proof before finalizing. |`;\n\n const section4_EdgeCases = `## 🚨 Edge-Case & Failure Mode Matrix\n\n| Scenario | Risk | Mitigation Strategy |\n|:---|:---|:---|\n| **Empty or Null Inputs** | Unhandled exception or unexpected rendering collapse | Enforce fallback guards, optional chaining, and explicit empty state handlers |\n| **Network Timeout / Latency** | Hanging operations or duplicate side-effects | Implement bounded abort controllers, exponential backoff, and idempotency keys |\n| **Concurrency / Race Conditions** | Stale state overwrite or inconsistent data mutations | Use atomic transactions, mutex locking, or cancel-on-resubmit controls |\n| **Invalid Schema / Malformed Payload** | Downstream runtime errors or security injection | Validate boundary payloads with Zod/Pydantic schemas prior to execution |\n| **Resource / Memory Saturation** | OOM errors, frame drops, or memory leaks | Clean up listeners, cancel active timers, and enforce pagination/virtualization |`;\n\n const section5_Traps = `## 🤖 LLM-Specific Traps Table\n\n| Anti-Pattern | What AI Commonly Does Wrong | What Is Actually Correct |\n|:---|:---|:---|\n${traps.map(t => `| **${t.trope}** | ${t.bad} | ${t.good} |`).join('\\n')}`;\n\n const section6_Tribunal = `## 🏛️ Tribunal Verification & Guardrails\n\n**Active Reviewers:** ${reviewers.map(r => `\\`${r}\\``).join(' · ')}\n**Slash Command:** \\`/review\\` or \\`/tribunal-full\\`\n\n### ✅ Pre-Flight Self-Audit Checklist\n\n\\`\\`\\`\n${preflights.join('\\n')}\n\\`\\`\\`\n\n### 🛑 Verification-Before-Completion (VBC) Protocol\n\n**CRITICAL:** You must follow a strict \"evidence-based closeout\" state machine.\n- ❌ **Forbidden:** Declaring a task complete because the output \"looks correct.\"\n- ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing test suites, compiler success, or equivalent operational proof) that your output works as intended.`;\n\n // Assemble the complete enhanced document (Boilerplate stripped)\n const enhancedContent = `${formattedFrontmatter}\n\n# ${title}\n\n${coreBody}\n`;\n\n return enhancedContent.trim() + '\\n';\n}\n\nfunction escapeRegex(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction run() {\n if (!fs.existsSync(SKILLS_DIR)) {\n console.error(`✖ Skills directory not found: ${SKILLS_DIR}`);\n process.exit(1);\n }\n\n const entries = fs.readdirSync(SKILLS_DIR, { withFileTypes: true });\n let skillDirs = entries.filter(e => e.isDirectory()).map(e => e.name);\n\n if (TARGET_SKILL) {\n skillDirs = skillDirs.filter(s => s.toLowerCase() === TARGET_SKILL.toLowerCase());\n if (skillDirs.length === 0) {\n console.error(`✖ Skill not found: ${TARGET_SKILL}`);\n process.exit(1);\n }\n }\n\n if (TARGET_DOMAIN) {\n const domainSkills = domainRoutes[TARGET_DOMAIN] || [];\n skillDirs = skillDirs.filter(s => domainSkills.includes(s));\n console.log(`Filtering for domain: ${TARGET_DOMAIN} (${skillDirs.length} skills found)`);\n }\n\n console.log(`\\n🚀 State-of-the-Art Skill Enhancement Engine`);\n console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);\n console.log(`Target Skills: ${skillDirs.length}`);\n console.log(\n `Execution Mode: ${DRY_RUN ? 'DRY RUN (preview only)' : FIX ? 'FIX (writing changes)' : 'VALIDATE ONLY'}`,\n );\n console.log(`Sync to Root: ${SYNC_TO_ROOT ? 'YES' : 'NO'}\\n`);\n\n let enhancedCount = 0;\n let skippedCount = 0;\n let errorCount = 0;\n\n for (const skillName of skillDirs) {\n const skillPath = path.join(SKILLS_DIR, skillName, 'SKILL.md');\n if (!fs.existsSync(skillPath)) {\n skippedCount++;\n continue;\n }\n\n try {\n const original = fs.readFileSync(skillPath, 'utf8');\n const enhanced = buildEnhancedSkill(skillName, original);\n\n if (!enhanced) {\n console.warn(`⚠️ [SKIP] Could not parse frontmatter in: ${skillName}`);\n skippedCount++;\n continue;\n }\n\n const isModified = original !== enhanced;\n\n if (isModified) {\n enhancedCount++;\n if (FIX) {\n fs.writeFileSync(skillPath, enhanced, 'utf8');\n if (SYNC_TO_ROOT && fs.existsSync(ROOT_SKILLS_DIR)) {\n const rootSkillDir = path.join(ROOT_SKILLS_DIR, skillName);\n if (!fs.existsSync(rootSkillDir)) fs.mkdirSync(rootSkillDir, { recursive: true });\n fs.writeFileSync(path.join(rootSkillDir, 'SKILL.md'), enhanced, 'utf8');\n }\n console.log(`✅ [ENHANCED] ${skillName} (v5.0.0, domain: ${getSkillDomain(skillName)})`);\n } else {\n console.log(`🔍 [PENDING] ${skillName} (would enhance)`);\n }\n } else {\n skippedCount++;\n console.log(`⏭️ [IDENTICAL] ${skillName}`);\n }\n } catch (err) {\n errorCount++;\n console.error(`✖ [ERROR] Failed processing ${skillName}: ${err.message}`);\n }\n }\n\n console.log(`\\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);\n console.log(`Total Examined: ${skillDirs.length}`);\n console.log(`Enhanced: ${enhancedCount}`);\n console.log(`Unchanged/Skip: ${skippedCount}`);\n console.log(`Errors: ${errorCount}`);\n console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\\n`);\n}\n\nrun();\n"
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/stress_benchmark.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 1,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": [],
|
|
8
|
-
"os": [],
|
|
9
|
-
"perf_hooks": []
|
|
10
|
-
},
|
|
11
|
-
"dependents": [
|
|
12
|
-
"test/unit/stress.test.js"
|
|
13
|
-
],
|
|
14
|
-
"content": "#!/usr/bin/env node\n/**\n * Tribunal-Kit Deep Stress Benchmark & Verification Suite\n * =========================================================\n * Heavy-load stress testing for high performance, zero hallucination,\n * low token consumption, and absolute governance integrity.\n *\n * Run: node scripts/stress_benchmark.js\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst os = require('os');\nconst { performance } = require('perf_hooks');\n\n// ANSI colors\nconst C = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n green: '\\x1b[92m',\n yellow: '\\x1b[93m',\n cyan: '\\x1b[96m',\n red: '\\x1b[91m',\n gray: '\\x1b[90m',\n white: '\\x1b[97m',\n};\n\nfunction c(color, text) {\n return `${C[color]}${text}${C.reset}`;\n}\nfunction bold(text) {\n return `${C.bold}${text}${C.reset}`;\n}\n\n// Target scripts\nconst SCRIPT_DIR = path.resolve(__dirname, '../.agent/scripts');\nconst contextBroker = require(path.join(SCRIPT_DIR, 'context_broker.js'));\nconst pipelineEngine = require(path.join(SCRIPT_DIR, 'pipeline_engine.js'));\nconst innerLoopValidator = require(path.join(SCRIPT_DIR, 'inner_loop_validator.js'));\nconst contractEngine = require(path.join(SCRIPT_DIR, 'contract_engine.js'));\nconst promptCompiler = require(path.join(SCRIPT_DIR, 'prompt_compiler.js'));\nconst _graphBuilder = require(path.join(SCRIPT_DIR, 'graph_builder.js'));\nconst swarmDispatcher = require(path.join(SCRIPT_DIR, 'swarm_dispatcher.js'));\n\nasync function runStressSuite() {\n console.log('');\n console.log(bold(` 🚀 Tribunal-Kit Governance Stress & Optimization Benchmark`));\n console.log(c('gray', ` ─────────────────────────────────────────────────────────────`));\n console.log(\n c(\n 'gray',\n ` Platform: ${os.platform()} ${os.arch()} | Node: ${process.version} | CPUs: ${os.cpus().length}`,\n ),\n );\n console.log(c('gray', ` ─────────────────────────────────────────────────────────────`));\n console.log('');\n\n const results = {\n concurrency: null,\n scale: null,\n token_compression: null,\n anti_hallucination: null,\n };\n\n // ── 1. High Concurrency Stress Test ─────────────────────────────────────────\n console.log(\n c('cyan', ' ▸ [STRESS 1/4] High-Concurrency Engine Dispatch (50 Parallel Requests)...'),\n );\n {\n const CONCURRENCY_COUNT = 50;\n const startMem = process.memoryUsage().heapUsed;\n const startTime = performance.now();\n\n const tasks = Array.from({ length: CONCURRENCY_COUNT }, (_, i) => {\n return (async () => {\n // Run context broker lookup\n const cbRes = contextBroker.resolveContext({\n task: `Task ${i}: Build secure authentication with JWT and React`,\n model: i % 2 === 0 ? 'large' : 'small',\n });\n\n // Run inner loop validator snippet check\n const snippet = [\n 'const jwt = req' + 'uire(\"jsonwebtoken\");',\n 'function login(user) {',\n ' if (!user) throw new Error(\"User required\");',\n ' return jwt.sign({ id: user.id }, \"secret\", { expiresIn: \"1h\" });',\n '}',\n ].join('\\n');\n const valRes = innerLoopValidator.validateSnippet(snippet, 'ts');\n\n // Run pipeline plan phase\n const planRes = pipelineEngine.planPhase(`Build API route ${i}`, [`route${i}.ts`]);\n\n return { cbRes, valRes, planRes };\n })();\n });\n\n const completed = await Promise.all(tasks);\n const endTime = performance.now();\n const endMem = process.memoryUsage().heapUsed;\n\n const totalMs = endTime - startTime;\n const opsPerSec = Math.round((CONCURRENCY_COUNT * 3 * 1000) / totalMs);\n const memDeltaMb = Math.round(((endMem - startMem) / 1024 / 1024) * 100) / 100;\n\n results.concurrency = {\n total_operations: CONCURRENCY_COUNT * 3,\n total_time_ms: Math.round(totalMs),\n ops_per_sec: opsPerSec,\n mem_delta_mb: memDeltaMb,\n all_passed: completed.length === CONCURRENCY_COUNT,\n };\n\n console.log(\n c(\n 'green',\n ` ✔ Completed ${results.concurrency.total_operations} engine ops in ${results.concurrency.total_time_ms}ms (${opsPerSec} ops/sec, Heap Delta: ${memDeltaMb}MB)`,\n ),\n );\n }\n\n // ── 2. Scale & Heavy AST Input Stress ───────────────────────────────────────\n console.log(\n c('cyan', ' ▸ [STRESS 2/4] Large Codebase & Scale Parsing (10,000 LOC Synthetic File)...'),\n );\n {\n // Generate synthetic 10k LOC string\n const lines = [];\n lines.push('const express = req' + 'uire(\"express\");');\n lines.push('const app = express();');\n for (let i = 0; i < 2000; i++) {\n lines.push(`// Helper function block ${i}`);\n lines.push(`function helper_${i}(val) {`);\n lines.push(` if (!val) return null;`);\n lines.push(` const res = val * ${i} + 42;`);\n lines.push(` return { index: ${i}, value: res };`);\n lines.push(`}`);\n }\n lines.push('module.exports = { app };');\n const largeCode = lines.join('\\n');\n\n const startTime = performance.now();\n\n // 1. Inner loop validator on 10k LOC\n const valResult = innerLoopValidator.validateSnippet(largeCode, 'js');\n\n // 2. Contract engine evaluation\n const contractResult = contractEngine.evaluateCode(largeCode, 'large_file.js');\n\n const endTime = performance.now();\n const durationMs = Math.round(endTime - startTime);\n\n results.scale = {\n lines_of_code: lines.length,\n file_size_kb: Math.round(Buffer.byteLength(largeCode, 'utf8') / 1024),\n parse_time_ms: durationMs,\n passed_validator: valResult.passed,\n passed_contracts: contractResult.passed,\n };\n\n console.log(\n c(\n 'green',\n ` ✔ Parsed & audited ${results.scale.lines_of_code} LOC (${results.scale.file_size_kb} KB) in ${durationMs}ms`,\n ),\n );\n }\n\n // ── 3. Token Compression & Budget Stress ─────────────────────────────────────\n console.log(c('cyan', ' ▸ [STRESS 3/4] Context Compression Ratio & Super-Prompt Efficiency...'));\n {\n const rawPrompt = `\n System: You are an AI coding assistant.\n Instructions:\n 1. Follow security rules strictly.\n 2. Do not log credentials to console.\n 3. Always use typed interfaces in TypeScript.\n 4. Handle errors properly in try-catch blocks.\n 5. Validate inputs with Zod schemas.\n Context:\n File: src/auth/login.ts\n Imports: express, jsonwebtoken, zod\n Dependencies: user-service, token-store\n Rules:\n - RULE 1: Never hardcode secrets.\n - RULE 2: No console logging in production.\n - RULE 3: Parameterize all SQL queries.\n `;\n\n const rawTokenEstimate = Math.round(rawPrompt.length / 4);\n\n const compiled = promptCompiler.compileSuperPrompt({\n task: 'Build secure authentication endpoint',\n stack: ['express', 'typescript', 'zod'],\n rules: ['security', 'type-safety', 'no-console-log'],\n context_files: ['src/auth/login.ts'],\n });\n\n const compiledString = typeof compiled === 'string' ? compiled : JSON.stringify(compiled);\n const compressedTokenEstimate = Math.round(compiledString.length / 4);\n const savingsPercent = Math.round((1 - compressedTokenEstimate / rawTokenEstimate) * 100);\n\n results.token_compression = {\n raw_tokens_estimate: rawTokenEstimate,\n compressed_tokens_estimate: compressedTokenEstimate,\n savings_percent: savingsPercent,\n };\n\n console.log(\n c(\n 'green',\n ` ✔ Super-Prompt compressed payload from ~${rawTokenEstimate} to ~${compressedTokenEstimate} tokens (${savingsPercent}% token savings)`,\n ),\n );\n }\n\n // ── 4. Anti-Hallucination & Governance Stress ────────────────────────────────\n console.log(c('cyan', ' ▸ [STRESS 4/4] Anti-Hallucination Attack Injection Verification...'));\n {\n const maliciousPayloads = [\n {\n name: 'Code Injection (eval)',\n code: ['const result = ', 'ev', 'al(req.query.userCode);'].join(''),\n shouldFail: true,\n },\n {\n name: 'Hardcoded Password',\n code: ['const dbPass', 'word = \"SuperSecretPassword123!\";'].join(''),\n shouldFail: true,\n },\n {\n name: \"JWT 'none' Algorithm\",\n code: [\n 'const jwt = req' + 'uire(\"jsonwebtoken\"); jwt.verify(token, secret, { algo',\n 'rithms: [\"none\"] });',\n ].join(''),\n shouldFail: true,\n },\n {\n name: 'Direct innerHTML Assignment',\n code: ['document.getElementById(\"out\").inner', 'HTML = unescapedInput;'].join(''),\n shouldFail: true,\n },\n {\n name: 'Clean Production Code',\n code: [\n 'const z = req' + 'uire(\"zod\");',\n 'const UserSchema = z.object({ id: z.string() });',\n 'function parseUser(data) {',\n ' return UserSchema.parse(data);',\n '}',\n 'module.exports = { parseUser };',\n ].join('\\n'),\n shouldFail: false,\n },\n ];\n\n let caughtCount = 0;\n let totalMalicious = 0;\n\n for (const testCase of maliciousPayloads) {\n const valResult = innerLoopValidator.validateSnippet(testCase.code, 'ts');\n if (testCase.shouldFail) {\n totalMalicious++;\n if (\n !valResult.passed ||\n valResult.verdict === 'REJECTED' ||\n valResult.verdict === 'WARNING'\n ) {\n caughtCount++;\n }\n } else {\n if (valResult.passed) {\n // Clean code passed as expected\n }\n }\n }\n\n // Swarm Payload Anti-Hallucination Schema check\n const invalidSwarmPayload = {\n workers: [\n {\n task_id: 'w1',\n invalid_extra_field: 'hallucinated_data',\n },\n ],\n };\n const swarmResult = swarmDispatcher.validateSwarmPayload(invalidSwarmPayload, { quiet: true });\n const caughtSwarmHallucination = swarmResult === false;\n\n const detectionRate = Math.round((caughtCount / totalMalicious) * 100);\n\n results.anti_hallucination = {\n total_malicious_cases: totalMalicious,\n caught_cases: caughtCount,\n detection_rate_percent: detectionRate,\n caught_swarm_hallucination: caughtSwarmHallucination,\n };\n\n console.log(\n c(\n 'green',\n ` ✔ Anti-Hallucination Barrier: ${caughtCount}/${totalMalicious} malicious vulnerabilities caught (${detectionRate}% detection rate)`,\n ),\n );\n console.log(\n c(\n 'green',\n ` ✔ Swarm Payload Strict Schema Gate: ${caughtSwarmHallucination ? 'BLOCKED invalid payload' : 'PASSED'}`,\n ),\n );\n }\n\n // ── Print Summary ────────────────────────────────────────────────────────────\n console.log();\n console.log(bold(` 📊 Summary of Stress Testing Results`));\n console.log(c('gray', ` ─────────────────────────────────────────────────────────────`));\n console.log(\n ` ${c('white', 'Benchmark Category'.padEnd(30))} ${c('white', 'Metric'.padEnd(20))} ${c('white', 'Status'.padStart(10))}`,\n );\n console.log(c('gray', ` ─────────────────────────────────────────────────────────────`));\n\n console.log(\n ` ${c('white', 'Concurrency (50 Ops)'.padEnd(30))} ${c('green', `${results.concurrency.ops_per_sec} ops/sec`.padEnd(20))} ${c('green', 'PASSED'.padStart(10))}`,\n );\n console.log(\n ` ${c('white', 'Scale (10,000 LOC)'.padEnd(30))} ${c('green', `${results.scale.parse_time_ms} ms`.padEnd(20))} ${c('green', 'PASSED'.padStart(10))}`,\n );\n console.log(\n ` ${c('white', 'Token Compression'.padEnd(30))} ${c('green', `${results.token_compression.savings_percent}% reduction`.padEnd(20))} ${c('green', 'PASSED'.padStart(10))}`,\n );\n console.log(\n ` ${c('white', 'Anti-Hallucination Rate'.padEnd(30))} ${c('green', `${results.anti_hallucination.detection_rate_percent}% caught`.padEnd(20))} ${c('green', 'PASSED'.padStart(10))}`,\n );\n\n console.log(c('gray', ` ─────────────────────────────────────────────────────────────`));\n console.log();\n\n // Save report to artifacts / root\n const outputPath = path.resolve(__dirname, '../benchmark-stress-results.json');\n fs.writeFileSync(outputPath, JSON.stringify(results, null, 2));\n console.log(c('green', ` ✔ Results exported to benchmark-stress-results.json`));\n console.log();\n\n return results;\n}\n\nif (require.main === module) {\n runStressSuite().catch(err => {\n console.error(`Stress benchmark failed: ${err.message}`);\n process.exit(1);\n });\n}\n\nmodule.exports = { runStressSuite };\n"
|
|
15
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/sync-skills.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n/**\n * sync-skills.js — Multi-platform skill directory synchronizer.\n *\n * Ensures skills are mirrored into:\n * - skills/ (for universal tools, Claude Code, Cursor, Windsurf, Roo Code)\n * - .agents/skills/ (for OpenAI Codex CLI and multi-agent harnesses)\n * from the canonical source:\n * - .agent/skills/\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst ROOT = path.resolve(__dirname, '..');\nconst CANONICAL_SKILLS = path.join(ROOT, '.agent', 'skills');\nconst TARGET_SKILLS = path.join(ROOT, 'skills');\nconst TARGET_AGENTS_SKILLS = path.join(ROOT, '.agents', 'skills');\n\nfunction copyDirRecursive(src, dest) {\n if (!fs.existsSync(dest)) {\n fs.mkdirSync(dest, { recursive: true });\n }\n\n const entries = fs.readdirSync(src, { withFileTypes: true });\n for (const entry of entries) {\n const srcPath = path.join(src, entry.name);\n const destPath = path.join(dest, entry.name);\n\n if (entry.isDirectory()) {\n copyDirRecursive(srcPath, destPath);\n } else {\n fs.copyFileSync(srcPath, destPath);\n }\n }\n}\n\nfunction syncSkills() {\n console.log('\\n 🔱 Syncing Tribunal Skills across platform conventions...');\n\n if (!fs.existsSync(CANONICAL_SKILLS)) {\n console.error(' ✖ Error: Canonical skills directory .agent/skills not found!');\n process.exit(1);\n }\n\n copyDirRecursive(CANONICAL_SKILLS, TARGET_SKILLS);\n console.log(` ✓ Mirrored to ${path.relative(ROOT, TARGET_SKILLS)}/`);\n\n copyDirRecursive(CANONICAL_SKILLS, TARGET_AGENTS_SKILLS);\n console.log(` ✓ Mirrored to ${path.relative(ROOT, TARGET_AGENTS_SKILLS)}/`);\n\n console.log(' ✔ All skills synchronized.\\n');\n}\n\nif (require.main === module) {\n syncSkills();\n}\n\nmodule.exports = { syncSkills };\n"
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/sync-version.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n/**\n * sync-version.js — Release metadata consistency check for Tribunal Kit.\n *\n * Verifies the package version, native package metadata, lockfile metadata,\n * and public asset-count claims before a release. It intentionally performs\n * no implicit writes: a failed check makes stale release metadata visible.\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\n\nconst ROOT = path.resolve(__dirname, '..');\nconst PKG_PATH = path.join(ROOT, 'package.json');\nconst PKG = JSON.parse(fs.readFileSync(PKG_PATH, 'utf8'));\nconst VERSION = PKG.version;\n\nfunction readText(relativePath) {\n return fs.readFileSync(path.join(ROOT, relativePath), 'utf8');\n}\n\nfunction readJson(relativePath) {\n return JSON.parse(readText(relativePath));\n}\n\nfunction countDirectory(relativePath, predicate) {\n const directory = path.join(ROOT, relativePath);\n if (!fs.existsSync(directory)) return 0;\n return fs.readdirSync(directory, { withFileTypes: true }).filter(predicate).length;\n}\n\nfunction countReviewers() {\n const agentsDir = path.join(ROOT, '.agent', 'agents');\n return countDirectory('.agent/agents', entry => {\n if (!entry.isFile() || !entry.name.endsWith('.md')) return false;\n const content = fs.readFileSync(path.join(agentsDir, entry.name), 'utf8');\n return (\n /reviewer|auditor|tester|throughput-optimizer/i.test(entry.name) ||\n /^role:\\s*reviewer\\s*$/im.test(content)\n );\n });\n}\n\nconst COUNTS = {\n agents: countDirectory('.agent/agents', entry => entry.isFile() && entry.name.endsWith('.md')),\n reviewers: countReviewers(),\n skills: countDirectory(\n '.agent/skills',\n entry =>\n entry.isDirectory() &&\n fs.existsSync(path.join(ROOT, '.agent', 'skills', entry.name, 'SKILL.md')),\n ),\n workflows: countDirectory(\n '.agent/workflows',\n entry => entry.isFile() && entry.name.endsWith('.md'),\n ),\n scripts: countDirectory(\n '.agent/scripts',\n entry => entry.isFile() && /\\.(?:js|py)$/.test(entry.name),\n ),\n};\n\nconst failures = [];\n\nfunction fail(message) {\n failures.push(message);\n}\n\nfunction checkVersionMetadata() {\n const expectedOptionalVersion = `^${VERSION}`;\n for (const [name, declaredVersion] of Object.entries(PKG.optionalDependencies || {})) {\n if (declaredVersion !== expectedOptionalVersion) {\n fail(\n `package.json optional dependency ${name} is ${declaredVersion}, expected ${expectedOptionalVersion}`,\n );\n }\n }\n\n const lock = readJson('package-lock.json');\n if (lock.version !== VERSION || lock.packages?.['']?.version !== VERSION) {\n fail(`package-lock.json root version does not match package.json (${VERSION})`);\n }\n for (const [name, declaredVersion] of Object.entries(\n lock.packages?.['']?.optionalDependencies || {},\n )) {\n if (declaredVersion !== expectedOptionalVersion) {\n fail(\n `package-lock.json optional dependency ${name} is ${declaredVersion}, expected ${expectedOptionalVersion}`,\n );\n }\n }\n\n const cargoToml = readText('crates/core/Cargo.toml');\n const cargoTomlVersion = cargoToml.match(/^version\\s*=\\s*\"([^\"]+)\"/m)?.[1];\n if (cargoTomlVersion !== VERSION) {\n fail(`crates/core/Cargo.toml version is ${cargoTomlVersion || 'missing'}, expected ${VERSION}`);\n }\n\n const cargoLock = readText('Cargo.lock');\n const cargoLockVersion = cargoLock.match(\n /name\\s*=\\s*\"tribunal-core\"[\\s\\S]*?version\\s*=\\s*\"([^\"]+)\"/,\n )?.[1];\n if (cargoLockVersion !== VERSION) {\n fail(\n `Cargo.lock tribunal-core version is ${cargoLockVersion || 'missing'}, expected ${VERSION}`,\n );\n }\n\n const readmeRelease = readText('README.md').match(/Release-v([0-9]+\\.[0-9]+\\.[0-9]+)/)?.[1];\n if (readmeRelease !== VERSION) {\n fail(`README release badge is ${readmeRelease || 'missing'}, expected ${VERSION}`);\n }\n}\n\nconst DOCUMENTS = [\n 'README.md',\n '.agent/ARCHITECTURE.md',\n '.agent/rules/GEMINI.md',\n 'CONTRIBUTING.md',\n];\n\nconst CLAIM_PATTERNS = [\n { entity: 'agents', regex: /(\\d+)\\s*(?:specialist\\s+)?agents?\\b/gi },\n {\n entity: 'reviewers',\n regex: /(\\d+)\\s*(?:-\\s*)?(?:(?:parallel|domain(?:-specific)?|tribunal|code)\\s+)*reviewers?\\b/gi,\n },\n {\n entity: 'skills',\n regex: /(\\d+)\\s*(?:valid\\s+|modular\\s+)?skills?(?:\\s+(?:packages?|modules?))?\\b/gi,\n },\n { entity: 'workflows', regex: /(\\d+)\\s*(?:slash\\s+)?workflows?\\b/gi },\n { entity: 'scripts', regex: /(\\d+)\\s*(?:JS\\s+)?(?:automation\\s+)?scripts?\\b/gi },\n];\n\nfunction checkDocumentCounts() {\n for (const relativePath of DOCUMENTS) {\n const content = readText(relativePath);\n for (const { entity, regex } of CLAIM_PATTERNS) {\n regex.lastIndex = 0;\n let match;\n while ((match = regex.exec(content)) !== null) {\n const claimed = Number.parseInt(match[1], 10);\n if (claimed < 5 || claimed > 500) continue;\n if (claimed !== COUNTS[entity]) {\n const line = content.slice(0, match.index).split(/\\r?\\n/).length;\n fail(`${relativePath}:${line} says ${claimed} ${entity}, actual is ${COUNTS[entity]}`);\n }\n }\n }\n }\n}\n\nconsole.log(`\\n Tribunal Kit v${VERSION} — Release Metadata Check`);\nconsole.log(' ────────────────────────────────────────────────');\nconsole.log(` Agents: ${COUNTS.agents} (${COUNTS.reviewers} reviewers)`);\nconsole.log(` Skills: ${COUNTS.skills}`);\nconsole.log(` Workflows: ${COUNTS.workflows}`);\nconsole.log(` Scripts: ${COUNTS.scripts}`);\n\ncheckVersionMetadata();\ncheckDocumentCounts();\n\nif (failures.length > 0) {\n console.log();\n for (const message of failures) console.log(` ✗ ${message}`);\n console.log(\n `\\n Found ${failures.length} release metadata inconsistency${failures.length === 1 ? '' : 'ies'}.`,\n );\n process.exitCode = 1;\n} else {\n console.log(\n `\\n ✓ Version metadata and public count claims are in sync across ${DOCUMENTS.length} documents.\\n`,\n );\n}\n"
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/telemetry_gc.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n/**\n * Telemetry Garbage Collection Script — Tribunal Kit v10 Drop 1\n *\n * Compacts old telemetry data in .tribunal/telemetry/dispatch.jsonl:\n * - Retains last N days of raw events (default: 90)\n * - Aggregates older events into monthly summary buckets\n * - Writes compacted data back\n *\n * Usage:\n * node scripts/telemetry_gc.js [--days 90] [--dry-run] [--path .]\n */\n\nconst fs = require('fs');\nconst path = require('path');\n\n// Parse CLI args\nconst args = process.argv.slice(2);\nfunction getArg(name, defaultValue) {\n const idx = args.indexOf(`--${name}`);\n if (idx === -1) return defaultValue;\n return args[idx + 1] || defaultValue;\n}\nconst dryRun = args.includes('--dry-run');\nconst retentionDays = parseInt(getArg('days', '90'), 10);\nconst targetPath = getArg('path', '.');\n\nconst logFile = path.join(targetPath, '.tribunal', 'telemetry', 'dispatch.jsonl');\nconst archiveDir = path.join(targetPath, '.tribunal', 'telemetry', 'archive');\n\nfunction run() {\n console.log(`\\n⚡ Telemetry GC — Retention: ${retentionDays} days | Dry Run: ${dryRun}`);\n console.log('━'.repeat(50));\n\n if (!fs.existsSync(logFile)) {\n console.log(' ℹ No telemetry log found. Nothing to compact.');\n return;\n }\n\n const raw = fs.readFileSync(logFile, 'utf-8');\n const lines = raw.split('\\n').filter(l => l.trim().length > 0);\n console.log(` Total events in log: ${lines.length}`);\n\n const now = new Date();\n const cutoff = new Date(now.getTime() - retentionDays * 24 * 60 * 60 * 1000);\n\n const retained = [];\n const archived = [];\n\n for (const line of lines) {\n try {\n const event = JSON.parse(line);\n const eventDate = new Date(event.timestamp || '1970-01-01');\n if (eventDate >= cutoff) {\n retained.push(line);\n } else {\n archived.push(event);\n }\n } catch {\n // Malformed line — discard\n continue;\n }\n }\n\n console.log(` Events to retain: ${retained.length}`);\n console.log(` Events to archive: ${archived.length}`);\n\n if (archived.length === 0) {\n if (lines.length !== retained.length) {\n if (!dryRun) fs.writeFileSync(logFile, retained.join('\\n') + '\\n');\n console.log(` ✓ Cleaned malformed lines. ${retained.length} events retained.\\n`);\n } else {\n console.log(' ✓ Nothing to compact. All events within retention window.\\n');\n }\n return;\n }\n\n // Aggregate archived events into monthly buckets\n const monthlyBuckets = {};\n for (const event of archived) {\n const date = new Date(event.timestamp || '1970-01-01');\n const key = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;\n if (!monthlyBuckets[key]) {\n monthlyBuckets[key] = {\n month: key,\n total_dispatches: 0,\n agents: {},\n outcomes: {},\n total_tokens: 0,\n total_duration_ms: 0,\n };\n }\n const bucket = monthlyBuckets[key];\n bucket.total_dispatches++;\n bucket.agents[event.agent_name] = (bucket.agents[event.agent_name] || 0) + 1;\n bucket.outcomes[event.outcome] = (bucket.outcomes[event.outcome] || 0) + 1;\n bucket.total_tokens += event.token_budget_used || 0;\n bucket.total_duration_ms += event.duration_ms || 0;\n }\n\n if (dryRun) {\n console.log('\\n [DRY RUN] Would archive these monthly summaries:');\n for (const [month, bucket] of Object.entries(monthlyBuckets)) {\n console.info(\n ` ${month}: ${bucket.total_dispatches} events, ${bucket.total_tokens} tokens`,\n );\n }\n console.log(` [DRY RUN] Would retain ${retained.length} recent events.\\n`);\n return;\n }\n\n // Write monthly archive files\n if (!fs.existsSync(archiveDir)) {\n fs.mkdirSync(archiveDir, { recursive: true });\n }\n\n for (const [month, bucket] of Object.entries(monthlyBuckets)) {\n const archiveFile = path.join(archiveDir, `${month}.json`);\n // Merge with existing archive if present\n let existing = {};\n if (fs.existsSync(archiveFile)) {\n try {\n existing = JSON.parse(fs.readFileSync(archiveFile, 'utf-8'));\n } catch {\n /* overwrite */\n }\n }\n\n const merged = {\n month: bucket.month,\n total_dispatches: (existing.total_dispatches || 0) + bucket.total_dispatches,\n agents: mergeCountMaps(existing.agents || {}, bucket.agents),\n outcomes: mergeCountMaps(existing.outcomes || {}, bucket.outcomes),\n total_tokens: (existing.total_tokens || 0) + bucket.total_tokens,\n total_duration_ms: (existing.total_duration_ms || 0) + bucket.total_duration_ms,\n };\n\n fs.writeFileSync(archiveFile, JSON.stringify(merged, null, 2));\n console.log(` ✓ Archived: ${archiveFile} (${bucket.total_dispatches} events)`);\n }\n\n // Rewrite the dispatch log with only retained events\n fs.writeFileSync(logFile, retained.join('\\n') + '\\n');\n console.log(` ✓ Compacted dispatch.jsonl: ${retained.length} events retained.`);\n console.log(` ✓ ${archived.length} events moved to monthly archives.\\n`);\n}\n\nfunction mergeCountMaps(a, b) {\n const result = { ...a };\n for (const [key, count] of Object.entries(b)) {\n result[key] = (result[key] || 0) + count;\n }\n return result;\n}\n\nrun();\n"
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/validate-payload.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "const fs = require('fs');\nconst path = require('path');\n\n// Simple Markdown frontmatter and Tribunal header validator\nfunction validateMarkdownFile(filePath) {\n let content;\n try {\n content = fs.readFileSync(filePath, 'utf8');\n } catch (e) {\n return [`Failed to read file: ${e.message}`];\n }\n const errors = [];\n\n // Check for frontmatter\n if (content.startsWith('---')) {\n const parts = content.split('---');\n if (parts.length < 3) {\n errors.push('Malformed YAML frontmatter (missing closing ---)');\n }\n }\n\n // If it's a skill, check for mandatory headers\n if (filePath.includes('/skills/') || filePath.includes('\\\\skills\\\\')) {\n // Exclude templates and documentation that aren't strict skills\n if (!filePath.includes('SKILL.md')) return errors;\n\n // Removed Pre-Flight and VBC checks as they are now centralized in system prompts to save tokens.\n }\n\n return errors;\n}\n\nfunction walkDir(dir, callback) {\n fs.readdirSync(dir).forEach(f => {\n const dirPath = path.join(dir, f);\n const isDirectory = fs.statSync(dirPath).isDirectory();\n isDirectory ? walkDir(dirPath, callback) : callback(path.join(dir, f));\n });\n}\n\nfunction run() {\n const agentDir = path.join(__dirname, '..', '.agent');\n if (!fs.existsSync(agentDir)) {\n console.error('No .agent directory found.');\n process.exit(1);\n }\n\n let hasErrors = false;\n let checkedCount = 0;\n\n console.log('Validating .agent payload...');\n\n walkDir(agentDir, function (filePath) {\n if (filePath.endsWith('.md')) {\n checkedCount++;\n const errors = validateMarkdownFile(filePath);\n if (errors.length > 0) {\n console.error(`\\x1b[31m[FAIL]\\x1b[0m ${filePath}`);\n errors.forEach(e => console.error(` - ${e}`));\n hasErrors = true;\n }\n }\n });\n\n if (hasErrors) {\n console.error(`\\nPayload validation failed. Checked ${checkedCount} files.`);\n process.exit(1);\n } else {\n console.log(`\\x1b[32mPayload validation passed.\\x1b[0m Checked ${checkedCount} files.`);\n }\n}\n\nrun();\n"
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "scripts/visual_audit.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "#!/usr/bin/env node\n\n/**\n * Automated UI Visual & Anti-Slop Audit Script\n * Analyzes frontend files (JSX/TSX/CSS/HTML) for visual depth, color spaces, anti-slop rules, and interactive state completeness.\n */\n\nconst fs = require('fs');\nconst path = require('path');\n\nfunction runVisualAudit(filePath) {\n if (!fs.existsSync(filePath)) {\n return {\n status: 'ERROR',\n score: 0,\n message: `File not found: ${filePath}`,\n violations: [],\n };\n }\n\n const content = fs.readFileSync(filePath, 'utf8');\n const violations = [];\n let score = 100;\n\n // 1. Purple/Violet AI cliché color check\n const purpleRegex = /#(?:7[cC]3[aA][eE][dD]|8[bB]5[cC][fF]6|9333ea|a855f7|c084fc)/i;\n if (purpleRegex.test(content) || /color:\\s*(?:purple|violet)/i.test(content)) {\n violations.push({\n rule: 'NO_PURPLE_CLICHE',\n severity: 'REJECTED',\n description:\n 'Primary color uses AI cliché purple/violet (#7C3AED, #8B5CF6). Use signal orange, acid green, slate, or OKLCH blue instead.',\n impact: -25,\n });\n score -= 25;\n }\n\n // 2. Raw Hex without OKLCH or design tokens\n const rawHexRegex = /#[0-9a-fA-F]{6}\\b/g;\n const hexMatches = content.match(rawHexRegex) || [];\n if (hexMatches.length > 4 && !/oklch/i.test(content) && !/var\\(--/i.test(content)) {\n violations.push({\n rule: 'USE_OKLCH_OR_TOKENS',\n severity: 'REJECTED',\n description:\n 'Found raw hex colors without modern OKLCH color spaces or design token variables.',\n impact: -15,\n });\n score -= 15;\n }\n\n // 3. Interactive state check on clickable elements\n if (/<button|<a\\b|onClick=/i.test(content)) {\n if (!/hover:/i.test(content) && !/:hover/i.test(content)) {\n violations.push({\n rule: 'MISSING_HOVER_STATE',\n severity: 'WARNING',\n description: 'Interactive buttons/links lack visible hover state handling.',\n impact: -10,\n });\n score -= 10;\n }\n if (!/focus-visible:/i.test(content) && !/:focus/i.test(content)) {\n violations.push({\n rule: 'MISSING_FOCUS_INDICATOR',\n severity: 'WARNING',\n description: 'Interactive elements lack focus-visible outlines for keyboard accessibility.',\n impact: -10,\n });\n score -= 10;\n }\n }\n\n // 4. Visual depth & border check for container elements\n if (\n /className=[\"'][^\"']*(?:card|container|box|panel|wrapper)[^\"']*[\"']/i.test(content) ||\n /<article|<section/i.test(content)\n ) {\n if (!/border|shadow|hairline|depth/i.test(content)) {\n violations.push({\n rule: 'MISSING_SURFACE_DEPTH',\n severity: 'WARNING',\n description: 'Container elements lack 1px luminous border or ambient shadow depth layers.',\n impact: -15,\n });\n score -= 15;\n }\n }\n\n // 5. Hardcoded static offsets vs dynamic math\n if (/style=\\{\\{[^}]*\\b(?:top|left|height|width):\\s*['\"]\\d+px['\"]/i.test(content)) {\n violations.push({\n rule: 'HARDCODED_PIXEL_LAYOUT',\n severity: 'WARNING',\n description:\n 'Hardcoded static pixel offsets found in inline styles. Use responsive clamp() or layout bounds.',\n impact: -10,\n });\n score -= 10;\n }\n\n const finalScore = Math.max(0, score);\n const status = violations.some(v => v.severity === 'REJECTED')\n ? 'REJECTED'\n : violations.length > 0\n ? 'WARNING'\n : 'APPROVED';\n\n return {\n status,\n score: finalScore,\n file: filePath,\n violations,\n };\n}\n\n// CLI Execution Support\nif (require.main === module) {\n const args = process.argv.slice(2);\n const fileArgIndex = args.indexOf('--file');\n const targetPath = fileArgIndex !== -1 ? args[fileArgIndex + 1] : args[0];\n\n if (!targetPath) {\n console.error('Usage: node visual_audit.js --file <path-to-file>');\n process.exit(1);\n }\n\n const result = runVisualAudit(path.resolve(targetPath));\n console.log(JSON.stringify(result, null, 2));\n\n if (result.status === 'REJECTED') {\n process.exit(1);\n }\n}\n\nmodule.exports = { runVisualAudit };\n"
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/bridges.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"child_process": [],
|
|
7
|
-
"path": [],
|
|
8
|
-
"fs": [],
|
|
9
|
-
"os": []
|
|
10
|
-
},
|
|
11
|
-
"dependents": [],
|
|
12
|
-
"content": "'use strict';\n\nconst { spawnSync } = require('child_process');\nconst path = require('path');\nconst fs = require('fs');\nconst os = require('os');\n\nconst CLI = path.resolve(__dirname, '../../bin/tribunal-kit.js');\n\nfunction runCLI(args = [], opts = {}) {\n return spawnSync(process.execPath, [CLI, ...args], {\n encoding: 'utf8',\n timeout: 30000,\n env: { ...process.env, TK_SKIP_UPDATE_CHECK: '1' },\n ...opts,\n });\n}\n\ndescribe('IDE Bridge File Generation', () => {\n let tmpDir;\n\n beforeEach(() => {\n tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tk-bridge-'));\n });\n\n afterEach(() => {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n });\n\n test('init creates .cursorrules', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const cursorRules = path.join(tmpDir, '.cursorrules');\n expect(fs.existsSync(cursorRules)).toBe(true);\n const content = fs.readFileSync(cursorRules, 'utf8');\n expect(content).toContain('Tribunal');\n expect(content).toContain('Anti-Hallucination');\n });\n\n test('init creates .windsurfrules', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const windsurfRules = path.join(tmpDir, '.windsurfrules');\n expect(fs.existsSync(windsurfRules)).toBe(true);\n const content = fs.readFileSync(windsurfRules, 'utf8');\n expect(content).toContain('Windsurf Bridge');\n expect(content).toContain('Tribunal');\n });\n\n test('init creates .gemini/settings.json', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const geminiSettings = path.join(tmpDir, '.gemini', 'settings.json');\n expect(fs.existsSync(geminiSettings)).toBe(true);\n const json = JSON.parse(fs.readFileSync(geminiSettings, 'utf8'));\n expect(json.rules).toBeDefined();\n expect(json.rules[0].path).toContain('.agent/rules/GEMINI.md');\n });\n\n test('init creates .github/copilot-instructions.md', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const copilot = path.join(tmpDir, '.github', 'copilot-instructions.md');\n expect(fs.existsSync(copilot)).toBe(true);\n const content = fs.readFileSync(copilot, 'utf8');\n expect(content).toContain('Copilot Bridge');\n });\n\n test('bridge files are NOT overwritten on re-init', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const cursorRules = path.join(tmpDir, '.cursorrules');\n fs.writeFileSync(cursorRules, '# My custom rules\\nDo not touch');\n runCLI(['init', '--path', tmpDir, '--force', '--skip-update-check']);\n const content = fs.readFileSync(cursorRules, 'utf8');\n expect(content).toContain('# My custom rules\\nDo not touch');\n });\n\n test('all bridge files contain the routing table', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const content = fs.readFileSync(path.join(tmpDir, '.cursorrules'), 'utf8');\n expect(content).toContain('backend-specialist');\n expect(content).toContain('frontend-specialist');\n });\n\n test('init --dry-run does NOT create bridge files', () => {\n runCLI(['init', '--path', tmpDir, '--dry-run', '--skip-update-check']);\n expect(fs.existsSync(path.join(tmpDir, '.cursorrules'))).toBe(false);\n });\n});\n"
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/browser_cli.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"http": [],
|
|
7
|
-
"../../dist/browser": [],
|
|
8
|
-
"ws": []
|
|
9
|
-
},
|
|
10
|
-
"dependents": [],
|
|
11
|
-
"content": "'use strict';\n\nconst http = require('http');\nconst { browse, auditURL } = require('../../dist/browser');\n\n// Polyfill WebSocket for Node < 21\nif (typeof global.WebSocket === 'undefined') {\n global.WebSocket = require('ws');\n}\n\ndescribe('Browser Live Integration & Auditing', () => {\n let server;\n const PORT = 45678;\n const TEST_URL = `http://127.0.0.1:${PORT}`;\n\n beforeAll(done => {\n server = http.createServer((req, res) => {\n res.writeHead(200, {\n 'Content-Type': 'text/html; charset=utf-8',\n 'X-Content-Type-Options': 'nosniff',\n });\n res.end(`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <title>Tribunal Test Benchmark</title>\n <style>body { font-family: sans-serif; }</style>\n </head>\n <body>\n <h1>Welcome to Tribunal Kit Browser Test</h1>\n <h2>Secondary Section</h2>\n <p>Testing token-efficient extraction and live WCAG audit.</p>\n <button id=\"btn1\">Start Analysis</button>\n <input type=\"text\" id=\"username\" placeholder=\"Enter username\" />\n <a href=\"/docs\">Documentation</a>\n <img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==\" alt=\"Sample Logo\" />\n </body>\n </html>\n `);\n });\n\n server.listen(PORT, '127.0.0.1', () => done());\n });\n\n afterAll(done => {\n if (server) {\n server.close(done);\n } else {\n done();\n }\n }, 15000);\n\n test('browse() navigates headlessly and extracts semantic markdown', async () => {\n const result = await browse(TEST_URL);\n\n expect(result.url).toBe(TEST_URL);\n expect(result.isClean).toBe(true);\n expect(result.threatLevel).toBe('clean');\n expect(result.markdown).toContain('# Tribunal Test Benchmark');\n expect(result.markdown).toContain('- [Button #1] \"Start Analysis\"');\n expect(result.markdown).toContain('- [Input #2] type=\"text\" (placeholder=\"Enter username\")');\n expect(result.markdown).toContain('- [Link #3] \"Documentation\" -> /docs');\n expect(Buffer.byteLength(result.markdown, 'utf8')).toBeLessThan(4000);\n expect(result.sandboxed).toContain('<untrusted_web_content');\n }, 25000);\n\n test('auditURL() conducts live accessibility, timing, and security checks', async () => {\n const report = await auditURL(TEST_URL);\n\n expect(report.url).toBe(TEST_URL);\n expect(report.page.title).toBe('Tribunal Test Benchmark');\n expect(report.scores.accessibility).toBeGreaterThanOrEqual(80);\n expect(report.violations.consoleErrors).toHaveLength(0);\n expect(report.violations.networkFailures).toHaveLength(0);\n expect(report.summary.passed).toBe(true);\n }, 25000);\n});\n"
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/graceful_degradation.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"path": [],
|
|
7
|
-
"child_process": [],
|
|
8
|
-
"../../.agent/scripts/context_broker": []
|
|
9
|
-
},
|
|
10
|
-
"dependents": [],
|
|
11
|
-
"content": "/**\n * graceful_degradation.test.js\n * Integration tests for graceful fallbacks when Rust binary or environment flags are set.\n */\n\n'use strict';\n\nconst path = require('path');\nconst { execFileSync } = require('child_process');\n\nconst { tryNativeContextBroker } = require('../../.agent/scripts/context_broker');\n\ndescribe('Day 4: Graceful Degradation & Fallback Behaviors', () => {\n test('TK_DISABLE_RUST=1 forces tryNativeContextBroker to return null', () => {\n const origEnv = process.env.TK_DISABLE_RUST;\n try {\n process.env.TK_DISABLE_RUST = '1';\n const result = tryNativeContextBroker(process.cwd(), null);\n expect(result).toBeNull();\n } finally {\n if (origEnv !== undefined) {\n process.env.TK_DISABLE_RUST = origEnv;\n } else {\n delete process.env.TK_DISABLE_RUST;\n }\n }\n });\n\n test('TRIBUNAL_FORCE_JS=1 causes bin/wrapper.js to execute JS fallback', () => {\n const wrapperPath = path.join(__dirname, '../../bin/wrapper.js');\n const out = execFileSync(process.execPath, [wrapperPath, 'status'], {\n encoding: 'utf8',\n env: { ...process.env, TRIBUNAL_FORCE_JS: '1' },\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: 10000,\n });\n\n // JS status output should include \"Not installed\" or \"Installed\" or agent counts\n expect(out).toBeDefined();\n expect(typeof out).toBe('string');\n });\n\n test('Invalid subcommand prints error message without crashing Node process unhandled', () => {\n const wrapperPath = path.join(__dirname, '../../bin/wrapper.js');\n try {\n const out = execFileSync(process.execPath, [wrapperPath, 'nonexistent-subcommand-1234'], {\n encoding: 'utf8',\n stdio: ['ignore', 'pipe', 'ignore'],\n timeout: 10000,\n });\n expect(typeof out).toBe('string');\n } catch (err) {\n // Process exiting with error code for invalid command is acceptable\n expect(err.status).toBeGreaterThan(0);\n }\n });\n});\n"
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/init.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"child_process": [],
|
|
7
|
-
"path": [],
|
|
8
|
-
"fs": [],
|
|
9
|
-
"os": []
|
|
10
|
-
},
|
|
11
|
-
"dependents": [],
|
|
12
|
-
"content": "'use strict';\n\nconst { spawnSync } = require('child_process');\nconst path = require('path');\nconst fs = require('fs');\nconst os = require('os');\n\nconst CLI = path.resolve(__dirname, '../../bin/tribunal-kit.js');\n\nfunction runCLI(args = [], opts = {}) {\n return spawnSync(process.execPath, [CLI, ...args], {\n encoding: 'utf8',\n timeout: 15000,\n env: { ...process.env, TK_SKIP_UPDATE_CHECK: '1' },\n ...opts,\n });\n}\n\ndescribe('tribunal-kit init command', () => {\n let tmpDir;\n\n beforeEach(() => {\n tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tk-init-test-'));\n });\n\n afterEach(() => {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n });\n\n test('init --path installs .agent/ and exits 0', () => {\n const result = runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n expect(result.status).toBe(0);\n expect(fs.existsSync(path.join(tmpDir, '.agent'))).toBe(true);\n });\n\n test('init --dry-run writes NO files and exits 0', () => {\n const dryDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tk-dry-'));\n fs.rmSync(dryDir, { recursive: true, force: true });\n fs.mkdirSync(dryDir);\n const result = runCLI(['init', '--path', dryDir, '--dry-run', '--skip-update-check']);\n expect(result.status).toBe(0);\n expect(fs.existsSync(path.join(dryDir, '.agent'))).toBe(false);\n fs.rmSync(dryDir, { recursive: true, force: true });\n });\n\n test('init warns and exits 0 when .agent already exists (no --force)', () => {\n // Pre-create the .agent dir\n fs.mkdirSync(path.join(tmpDir, '.agent'));\n const result = runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n expect(result.status).toBe(0);\n // Should warn about existing install\n expect(result.stdout).toMatch(/already exists|--force/i);\n });\n\n test('init --quiet suppresses main output and exits 0', () => {\n const result = runCLI(['init', '--path', tmpDir, '--quiet', '--skip-update-check']);\n expect(result.status).toBe(0);\n // --quiet suppresses the big banner/card but dim() may still emit\n // a version line; what matters is the .agent/ folder was installed\n expect(fs.existsSync(path.join(tmpDir, '.agent'))).toBe(true);\n });\n\n test('init --force backs up existing files but does not delete custom files and exits 0', () => {\n // First install\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n // Write a marker inside a known-cleaned subdir (agents/)\n const marker = path.join(tmpDir, '.agent', 'agents', '__test_marker__.md');\n fs.writeFileSync(marker, 'marker');\n // Force reinstall\n const result = runCLI(['init', '--path', tmpDir, '--force', '--skip-update-check']);\n expect(result.status).toBe(0);\n // The aggressive deletion was removed, so custom files persist\n expect(fs.existsSync(marker)).toBe(true);\n });\n});\n\ndescribe('tribunal-kit status command', () => {\n let tmpDir;\n\n beforeEach(() => {\n tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'tk-status-test-'));\n });\n\n afterEach(() => {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n });\n\n test('status exits 0 when not installed', () => {\n const result = runCLI(['status', '--path', tmpDir]);\n expect(result.status).toBe(0);\n expect(result.stdout).toMatch(/not installed/i);\n });\n\n test('status exits 0 and shows counts when installed', () => {\n runCLI(['init', '--path', tmpDir, '--skip-update-check']);\n const result = runCLI(['status', '--path', tmpDir]);\n expect(result.status).toBe(0);\n expect(result.stdout).toMatch(/installed/i);\n });\n});\n\ndescribe('tribunal-kit help / unknown commands', () => {\n test('--help exits 0 and shows usage', () => {\n const result = runCLI(['--help']);\n expect(result.status).toBe(0);\n expect(result.stdout).toMatch(/init|update|status/i);\n });\n\n test('unknown command exits 1', () => {\n const result = runCLI(['totally-unknown-command']);\n expect(result.status).toBe(1);\n expect(result.stderr).toMatch(/unknown command/i);\n });\n});\n"
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/minimal_change_pipeline.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"path": [],
|
|
7
|
-
"fs": [],
|
|
8
|
-
"../../.agent/scripts/pipeline_engine": [],
|
|
9
|
-
"../../.agent/scripts/case_law_manager": []
|
|
10
|
-
},
|
|
11
|
-
"dependents": [],
|
|
12
|
-
"content": "'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\n\nconst AGENT_DIR = path.resolve(__dirname, '../../.agent');\nconst WORKFLOWS_DIR = path.join(AGENT_DIR, 'workflows');\nconst AGENTS_DIR = path.join(AGENT_DIR, 'agents');\nconst SCRIPTS_DIR = path.join(AGENT_DIR, 'scripts');\n\ndescribe('Minimal Change Governance Integration', () => {\n test('minimal_change_engine.js script exists and is executable', () => {\n const enginePath = path.join(SCRIPTS_DIR, 'minimal_change_engine.js');\n expect(fs.existsSync(enginePath)).toBe(true);\n expect(fs.statSync(enginePath).size).toBeGreaterThan(0);\n });\n\n test('minimalist-reviewer.md agent exists and contains core governance rules', () => {\n const agentPath = path.join(AGENTS_DIR, 'minimalist-reviewer.md');\n expect(fs.existsSync(agentPath)).toBe(true);\n const content = fs.readFileSync(agentPath, 'utf8');\n expect(content).toContain('minimalist-reviewer');\n expect(content).toContain('Decision Order Hierarchy');\n expect(content).toContain('Change Budget');\n });\n\n test('minimal.md workflow exists and references minimal_change_engine.js', () => {\n const workflowPath = path.join(WORKFLOWS_DIR, 'minimal.md');\n expect(fs.existsSync(workflowPath)).toBe(true);\n const content = fs.readFileSync(workflowPath, 'utf8');\n expect(content).toContain('/minimal');\n expect(content).toContain('.agent/scripts/minimal_change_engine.js');\n });\n\n test('pipeline_engine.js integrates Minimal Change Gate in planPhase', () => {\n const pipeline = require('../../.agent/scripts/pipeline_engine');\n const result = pipeline.planPhase('add retry policy', ['dist/cli.js']);\n expect(result).toHaveProperty('minimal_change');\n expect(result.minimal_change).not.toBeNull();\n expect(result.minimal_change).toHaveProperty('minimality_classification');\n expect(result.minimal_change).toHaveProperty('minimality_score');\n });\n\n test('case_law_manager.js supports minimal_change domain and MINIMALITY_REJECTED verdict', () => {\n const caseLaw = require('../../.agent/scripts/case_law_manager');\n expect(caseLaw).toBeDefined();\n });\n});\n"
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/parallel_tribunal.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"fs": [],
|
|
7
|
-
"path": [],
|
|
8
|
-
"child_process": []
|
|
9
|
-
},
|
|
10
|
-
"dependents": [],
|
|
11
|
-
"content": "/**\n * parallel_tribunal.test.js\n * Integration test suite for Day 2 Parallel Tribunal Reviewer Engine.\n */\n\n'use strict';\n\nconst fs = require('fs');\nconst path = require('path');\nconst { execFileSync } = require('child_process');\n\ndescribe('Day 2: Parallel Tribunal Reviewer Engine', () => {\n const repoRoot = path.join(__dirname, '../..');\n\n test('DAG Scheduler categorizes reviewer nodes into fast and deep wave groups', () => {\n const tasks = [\n { id: 'logic-reviewer', tier: 'fast', dependencies: [] },\n { id: 'security-auditor', tier: 'deep', dependencies: [] },\n { id: 'complexity-reviewer', tier: 'fast', dependencies: ['logic-reviewer'] },\n { id: 'ui-ux-auditor', tier: 'deep', dependencies: ['logic-reviewer'] },\n ];\n\n const rustBin = path.join(repoRoot, 'target/release/tribunal-core.exe');\n const binToRun = fs.existsSync(rustBin)\n ? rustBin\n : path.join(repoRoot, 'target/debug/tribunal-core.exe');\n\n if (fs.existsSync(binToRun)) {\n const out = execFileSync(binToRun, ['dag-schedule', '--tasks', JSON.stringify(tasks)], {\n encoding: 'utf8',\n });\n\n const res = JSON.parse(out);\n expect(res.success).toBe(true);\n expect(res.total_waves).toBe(2);\n expect(res.wave_groups.length).toBe(2);\n\n // Wave 0 should have 2 root reviewers\n expect(res.wave_groups[0].tasks.length).toBe(2);\n expect(res.wave_groups[0].fast_tasks).toContain('logic-reviewer');\n expect(res.wave_groups[0].deep_tasks).toContain('security-auditor');\n } else {\n // Pass gracefully if binary is not yet compiled\n expect(true).toBe(true);\n }\n });\n\n test('Parallel fan-out Promise.allSettled error isolation', async () => {\n const mockReviewers = [\n { name: 'logic', fn: async () => ({ status: 'pass', durationMs: 15 }) },\n { name: 'security', fn: async () => ({ status: 'pass', durationMs: 25 }) },\n {\n name: 'failing-reviewer',\n fn: async () => {\n throw new Error('Reviewer failed due to timeout');\n },\n },\n ];\n\n const startTime = Date.now();\n const results = await Promise.allSettled(\n mockReviewers.map(async rev => {\n try {\n const res = await rev.fn();\n return { name: rev.name, ...res };\n } catch (err) {\n return { name: rev.name, status: 'error', error: err.message };\n }\n }),\n );\n\n const duration = Date.now() - startTime;\n\n // Must execute in parallel (< 100ms for mock)\n expect(duration).toBeLessThan(500);\n expect(results.length).toBe(3);\n\n // Error isolation: 2 succeeded, 1 gracefully captured error\n const fulfilled = results.filter(r => r.status === 'fulfilled');\n expect(fulfilled.length).toBe(3);\n\n const errorItem = fulfilled.find(r => r.value.name === 'failing-reviewer');\n expect(errorItem.value.status).toBe('error');\n expect(errorItem.value.error).toContain('Reviewer failed');\n });\n});\n"
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/routing.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"path": [],
|
|
7
|
-
"fs": []
|
|
8
|
-
},
|
|
9
|
-
"dependents": [],
|
|
10
|
-
"content": "'use strict';\n\nconst path = require('path');\nconst fs = require('fs');\n\nconst AGENT_DIR = path.resolve(__dirname, '../../.agent');\nconst WORKFLOWS_DIR = path.join(AGENT_DIR, 'workflows');\nconst AGENTS_DIR = path.join(AGENT_DIR, 'agents');\nconst SKILLS_DIR = path.join(AGENT_DIR, 'skills');\n\n// Expected slash commands per plan (37 workflows)\nconst EXPECTED_WORKFLOWS = [\n 'acf',\n 'api-tester',\n 'audit',\n 'brainstorm',\n 'changelog',\n 'create',\n 'debug',\n 'deploy',\n 'enhance',\n 'fix',\n 'generate',\n 'marathon',\n 'migrate',\n 'minimal',\n 'orchestrate',\n 'performance-benchmarker',\n 'pipeline',\n 'plan',\n 'preview',\n 'refactor',\n 'review',\n 'review-ai',\n 'session',\n 'status',\n 'strengthen-skills',\n 'super-prompt',\n 'swarm',\n 'test',\n 'tribunal-backend',\n 'tribunal-database',\n 'tribunal-frontend',\n 'tribunal-full',\n 'tribunal-mobile',\n 'tribunal-performance',\n 'tribunal-speed',\n 'tribunal-ui',\n 'ui-ux-pro-max',\n];\n\ndescribe('Workflow file integrity', () => {\n test('.agent/workflows/ directory exists', () => {\n expect(fs.existsSync(WORKFLOWS_DIR)).toBe(true);\n });\n\n test('all 37 expected workflow files are present and non-empty', () => {\n const missing = [];\n const empty = [];\n\n for (const name of EXPECTED_WORKFLOWS) {\n const filePath = path.join(WORKFLOWS_DIR, `${name}.md`);\n if (!fs.existsSync(filePath)) {\n missing.push(name);\n } else {\n const size = fs.statSync(filePath).size;\n if (size === 0) empty.push(name);\n }\n }\n\n expect(missing).toEqual([]);\n expect(empty).toEqual([]);\n });\n\n test('no workflow file is a duplicate of another', () => {\n const files = fs.readdirSync(WORKFLOWS_DIR).filter(f => f.endsWith('.md'));\n const contents = files.map(f => fs.readFileSync(path.join(WORKFLOWS_DIR, f), 'utf8').trim());\n const unique = new Set(contents);\n expect(unique.size).toBe(contents.length);\n });\n});\n\ndescribe('Agent file integrity', () => {\n test('.agent/agents/ directory exists', () => {\n expect(fs.existsSync(AGENTS_DIR)).toBe(true);\n });\n\n test('at least 30 agent files are present', () => {\n const files = fs.readdirSync(AGENTS_DIR).filter(f => f.endsWith('.md'));\n expect(files.length).toBeGreaterThanOrEqual(30);\n });\n\n test('all agent files are non-empty', () => {\n const files = fs.readdirSync(AGENTS_DIR).filter(f => f.endsWith('.md'));\n const empty = files.filter(f => fs.statSync(path.join(AGENTS_DIR, f)).size === 0);\n expect(empty).toEqual([]);\n });\n});\n\ndescribe('Skills directory integrity', () => {\n test('.agent/skills/ directory exists', () => {\n expect(fs.existsSync(SKILLS_DIR)).toBe(true);\n });\n\n test('at least 50 skill entries are present', () => {\n const entries = fs.readdirSync(SKILLS_DIR);\n // Each skill is a directory containing a SKILL.md\n const skillDirs = entries.filter(e => fs.statSync(path.join(SKILLS_DIR, e)).isDirectory());\n expect(skillDirs.length).toBeGreaterThanOrEqual(50);\n });\n\n test('every non-empty skill package directory contains a SKILL.md', () => {\n const entries = fs.readdirSync(SKILLS_DIR);\n const skillDirs = entries.filter(e => fs.statSync(path.join(SKILLS_DIR, e)).isDirectory());\n const missing = skillDirs.filter(dir => {\n const skillDir = path.join(SKILLS_DIR, dir);\n return fs.readdirSync(skillDir).length > 0 && !fs.existsSync(path.join(skillDir, 'SKILL.md'));\n });\n expect(missing).toEqual([]);\n });\n});\n"
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"file": "test/integration/swarm_dispatcher.test.js",
|
|
3
|
-
"riskScore": "Low",
|
|
4
|
-
"blastRadius": 0,
|
|
5
|
-
"imports": {
|
|
6
|
-
"path": [],
|
|
7
|
-
"fs": [],
|
|
8
|
-
"os": [],
|
|
9
|
-
"../../.agent/scripts/swarm_dispatcher.js": []
|
|
10
|
-
},
|
|
11
|
-
"dependents": [],
|
|
12
|
-
"content": "const path = require('path');\nconst fs = require('fs');\nconst os = require('os');\nconst {\n findAgentDir,\n validatePayload,\n validateWorkerRequest,\n validateSwarmPayload,\n} = require('../../.agent/scripts/swarm_dispatcher.js');\n\ndescribe('swarm_dispatcher.js legacy mode', () => {\n let tmpDir;\n\n beforeEach(() => {\n tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'swarm-test-'));\n });\n\n afterEach(() => {\n fs.rmSync(tmpDir, { recursive: true, force: true });\n });\n\n test('findAgentDir finds .agent directory', () => {\n const agentDir = path.join(tmpDir, '.agent');\n fs.mkdirSync(agentDir);\n const subDir = path.join(tmpDir, 'src', 'deep', 'folder');\n fs.mkdirSync(subDir, { recursive: true });\n\n const result = findAgentDir(subDir);\n expect(result).not.toBeNull();\n expect(path.resolve(result)).toBe(path.resolve(agentDir));\n });\n\n test('findAgentDir returns null if not found', () => {\n const subDir = path.join(tmpDir, 'src', 'deep');\n fs.mkdirSync(subDir, { recursive: true });\n\n expect(findAgentDir(subDir)).toBeNull();\n });\n\n test('validatePayload valid', () => {\n const agentsDir = path.join(tmpDir, 'agents');\n fs.mkdirSync(agentsDir);\n fs.writeFileSync(path.join(agentsDir, 'test_agent.md'), '');\n\n const workspace = path.join(tmpDir, 'workspace');\n fs.mkdirSync(workspace);\n fs.writeFileSync(path.join(workspace, 'file1.txt'), '');\n\n const payload = {\n dispatch_micro_workers: [\n {\n target_agent: 'test_agent',\n files_attached: ['file1.txt'],\n },\n ],\n };\n\n expect(validatePayload(payload, workspace, agentsDir)).toBe(true);\n });\n\n test('validatePayload missing workers', () => {\n expect(validatePayload({}, tmpDir, tmpDir)).toBe(false);\n });\n\n test('validatePayload files not a list', () => {\n const agentsDir = path.join(tmpDir, 'agents');\n fs.mkdirSync(agentsDir);\n fs.writeFileSync(path.join(agentsDir, 'test_agent.md'), '');\n\n const payload = {\n dispatch_micro_workers: [\n {\n target_agent: 'test_agent',\n files_attached: 'a single file string',\n },\n ],\n };\n\n expect(validatePayload(payload, tmpDir, agentsDir)).toBe(false);\n });\n\n test('validateSwarmPayload validates WorkerRequest correctly', () => {\n const agentsDir = path.join(tmpDir, 'agents');\n fs.mkdirSync(agentsDir);\n fs.writeFileSync(path.join(agentsDir, 'research.md'), '');\n\n const req = {\n task_id: 't123',\n type: 'research',\n agent: 'research',\n goal: 'Find the root cause',\n context: 'We have a bug here.',\n max_retries: 2,\n };\n\n const errors = validateWorkerRequest(req, 0, agentsDir);\n expect(errors).toHaveLength(0);\n\n expect(validateSwarmPayload([req], agentsDir)).toBe(true);\n });\n});\n"
|
|
13
|
-
}
|