tribunal-kit 7.0.0 ā 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/ARCHITECTURE.md +2 -2
- package/.agent/config/claude.json +18 -0
- package/.agent/config/plugin.json +102 -0
- package/.agent/config/slash-commands.json +103 -0
- package/.agent/config/specialist-registry.json +415 -0
- package/.agent/config/system-prompt.md +244 -0
- package/.agent/history/architecture-graph.yaml +302 -3
- package/.agent/history/graph-cache.json +515 -45
- package/.agent/history/memory.db +0 -0
- package/.agent/history/snapshots/bin__adapter-install.js.json +13 -0
- package/.agent/history/snapshots/bin__global-store.js.json +15 -0
- package/.agent/history/snapshots/bin__mcp-server.js.json +19 -0
- package/.agent/history/snapshots/bin__proxy-server.js.json +20 -0
- package/.agent/history/snapshots/bin__spawn-agent.js.json +12 -0
- package/.agent/history/snapshots/bin__tk-proxy.js.json +21 -0
- package/.agent/history/snapshots/bin__tribunal-kit.js.json +9 -7
- package/.agent/history/snapshots/bin__wrapper.js.json +14 -0
- package/.agent/history/snapshots/eslint.config.js.json +1 -2
- package/.agent/history/snapshots/scripts__benchmark.js.json +14 -0
- package/.agent/history/snapshots/scripts__changelog.js.json +1 -2
- package/.agent/history/snapshots/scripts__fix-vbc.js.json +11 -0
- package/.agent/history/snapshots/scripts__stress_benchmark.js.json +15 -0
- package/.agent/history/snapshots/scripts__sync-version.js.json +1 -2
- package/.agent/history/snapshots/scripts__validate-payload.js.json +1 -2
- package/.agent/history/snapshots/scripts__visual_audit.js.json +11 -0
- package/.agent/history/snapshots/test__integration__bridges.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__graceful_degradation.test.js.json +12 -0
- package/.agent/history/snapshots/test__integration__init.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__minimal_change_pipeline.test.js.json +13 -0
- package/.agent/history/snapshots/test__integration__parallel_tribunal.test.js.json +12 -0
- package/.agent/history/snapshots/test__integration__routing.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__sync_status.test.js.json +13 -0
- package/.agent/history/snapshots/test__integration__wave2.test.js.json +1 -2
- package/.agent/history/snapshots/test__integration__wrapper.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__align.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__args.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__audit_release.test.js.json +16 -0
- package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__cicd_validator.test.js.json +12 -0
- package/.agent/history/snapshots/test__unit__compile.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__context_broker.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__contract_engine.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__copyDir.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__guardrail_engine.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__impact_classifier.test.js.json +12 -0
- package/.agent/history/snapshots/test__unit__init.test.js.json +14 -0
- package/.agent/history/snapshots/test__unit__inner_loop_validator.test.js.json +1 -2
- package/.agent/history/snapshots/test__unit__integrity_manifest.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__learn.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__marathon.test.js.json +22 -0
- package/.agent/history/snapshots/test__unit__mcp_server.test.js.json +16 -0
- package/.agent/history/snapshots/test__unit__memory.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__minimal_change.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__native.test.js.json +10 -0
- package/.agent/history/snapshots/test__unit__optimize.test.js.json +13 -0
- package/.agent/history/snapshots/test__unit__path_resolution.test.js.json +14 -0
- package/.agent/history/snapshots/test__unit__production_readiness_evidence.test.js.json +21 -0
- package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__semver.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__skill_evolution.test.js.json +11 -0
- package/.agent/history/snapshots/test__unit__stress.test.js.json +15 -0
- package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +3 -3
- package/.agent/history/snapshots/test__unit__utils.test.js.json +10 -0
- package/.agent/routing_index.json +2 -2
- package/.agent/scripts/ast_context_loader.js +137 -0
- package/.agent/scripts/memory_engine.js +581 -0
- package/.agent/scripts/payload_schemas.js +146 -0
- package/.agent/scripts/prompt_compiler.js +59 -11
- package/.agent/scripts/swarm_dispatcher.js +295 -67
- package/.agent/scripts/token_budget_broker.js +117 -6
- package/.agent/skills/12-principles-of-animation/SKILL.md +19 -16
- package/.agent/skills/60fps-animation/SKILL.md +47 -21
- package/.agent/skills/accessible-animation/SKILL.md +19 -16
- package/.agent/skills/adapt/SKILL.md +19 -16
- package/.agent/skills/advanced-rag-pipelines/SKILL.md +41 -40
- package/.agent/skills/agent-organizer/SKILL.md +9 -59
- package/.agent/skills/agentic-patterns/SKILL.md +9 -57
- package/.agent/skills/agentic-workflows-2026/SKILL.md +45 -8
- package/.agent/skills/ai-app-hardening/SKILL.md +31 -5
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +28 -66
- package/.agent/skills/animation-on-scroll/SKILL.md +19 -16
- package/.agent/skills/animation-systems/SKILL.md +19 -15
- package/.agent/skills/antfu-conventions/SKILL.md +19 -18
- package/.agent/skills/api-patterns/SKILL.md +8 -58
- package/.agent/skills/api-security-auditor/SKILL.md +8 -58
- package/.agent/skills/app-builder/SKILL.md +9 -59
- package/.agent/skills/appflow-wireframe/SKILL.md +13 -57
- package/.agent/skills/apple-design/SKILL.md +22 -14
- package/.agent/skills/architecture/SKILL.md +9 -59
- package/.agent/skills/audit-and-fix/SKILL.md +19 -16
- package/.agent/skills/authentication-best-practices/SKILL.md +8 -58
- package/.agent/skills/backend-security-expert/SKILL.md +32 -65
- package/.agent/skills/baseline-ui/SKILL.md +22 -14
- package/.agent/skills/bash-linux/SKILL.md +9 -59
- package/.agent/skills/behavioral-modes/SKILL.md +9 -57
- package/.agent/skills/better-colors/SKILL.md +22 -14
- package/.agent/skills/better-typography/SKILL.md +26 -14
- package/.agent/skills/better-ui/SKILL.md +54 -19
- package/.agent/skills/bolder/SKILL.md +19 -16
- package/.agent/skills/brainstorming/SKILL.md +9 -57
- package/.agent/skills/browser-native-ai/SKILL.md +9 -28
- package/.agent/skills/build-primitive/SKILL.md +19 -16
- package/.agent/skills/building-native-ui/SKILL.md +9 -59
- package/.agent/skills/cicd-pro/SKILL.md +21 -28
- package/.agent/skills/clarify/SKILL.md +19 -16
- package/.agent/skills/clean-code/SKILL.md +18 -61
- package/.agent/skills/cloud-architect/SKILL.md +21 -28
- package/.agent/skills/cobejs/SKILL.md +19 -15
- package/.agent/skills/code-review-checklist/SKILL.md +8 -58
- package/.agent/skills/codebase-design/SKILL.md +33 -22
- package/.agent/skills/colorize/SKILL.md +19 -16
- package/.agent/skills/compact-landing/SKILL.md +19 -16
- package/.agent/skills/company-logos/SKILL.md +19 -16
- package/.agent/skills/config-validator/SKILL.md +9 -59
- package/.agent/skills/containerization-pro/SKILL.md +21 -28
- package/.agent/skills/context-engineering-pro/SKILL.md +31 -5
- package/.agent/skills/create-design-md/SKILL.md +22 -14
- package/.agent/skills/critique/SKILL.md +20 -11
- package/.agent/skills/csharp-developer/SKILL.md +8 -58
- package/.agent/skills/data-validation-schemas/SKILL.md +9 -59
- package/.agent/skills/database-design/SKILL.md +27 -67
- package/.agent/skills/delight/SKILL.md +19 -16
- package/.agent/skills/deployment-procedures/SKILL.md +9 -59
- package/.agent/skills/design-lab/SKILL.md +19 -16
- package/.agent/skills/devops-engineer/SKILL.md +8 -58
- package/.agent/skills/devops-incident-responder/SKILL.md +9 -59
- package/.agent/skills/diagnosing-bugs/SKILL.md +20 -21
- package/.agent/skills/distill/SKILL.md +19 -16
- package/.agent/skills/documentation-templates/SKILL.md +9 -59
- package/.agent/skills/domain-modeling/SKILL.md +19 -18
- package/.agent/skills/duckdb-analytical-sql/SKILL.md +31 -5
- package/.agent/skills/edge-ai-mobile/SKILL.md +31 -5
- package/.agent/skills/edge-computing/SKILL.md +9 -59
- package/.agent/skills/emil-design-eng/SKILL.md +21 -24
- package/.agent/skills/error-resilience/SKILL.md +31 -66
- package/.agent/skills/expo-router-v4/SKILL.md +31 -5
- package/.agent/skills/extract-design-system/SKILL.md +9 -59
- package/.agent/skills/fabel-protocol/SKILL.md +26 -8
- package/.agent/skills/fixing-accessibility/SKILL.md +22 -14
- package/.agent/skills/fixing-metadata/SKILL.md +19 -16
- package/.agent/skills/fixing-motion-performance/SKILL.md +22 -14
- package/.agent/skills/framer-motion-expert/SKILL.md +9 -57
- package/.agent/skills/frontend-design/SKILL.md +27 -7
- package/.agent/skills/frontend-security-expert/SKILL.md +8 -58
- package/.agent/skills/game-design-expert/SKILL.md +9 -59
- package/.agent/skills/game-engineering-expert/SKILL.md +9 -59
- package/.agent/skills/generative-ui-expert/SKILL.md +9 -28
- package/.agent/skills/geo-fundamentals/SKILL.md +9 -59
- package/.agent/skills/git-pro/SKILL.md +19 -30
- package/.agent/skills/github-operations/SKILL.md +8 -58
- package/.agent/skills/gpt-taste/SKILL.md +19 -16
- package/.agent/skills/gsap-core/SKILL.md +8 -78
- package/.agent/skills/gsap-frameworks/SKILL.md +8 -78
- package/.agent/skills/gsap-performance/SKILL.md +9 -77
- package/.agent/skills/gsap-plugins/SKILL.md +9 -77
- package/.agent/skills/gsap-react/SKILL.md +9 -21
- package/.agent/skills/gsap-scrolltrigger/SKILL.md +8 -78
- package/.agent/skills/gsap-timeline/SKILL.md +9 -77
- package/.agent/skills/gsap-utils/SKILL.md +9 -77
- package/.agent/skills/harden/SKILL.md +19 -16
- package/.agent/skills/harness-protocol/SKILL.md +9 -21
- package/.agent/skills/i18n-localization/SKILL.md +9 -59
- package/.agent/skills/impeccable/SKILL.md +19 -18
- package/.agent/skills/improve-codebase-architecture/SKILL.md +19 -17
- package/.agent/skills/improve-ui/SKILL.md +22 -14
- package/.agent/skills/intelligent-routing/SKILL.md +9 -23
- package/.agent/skills/knowledge-graph/SKILL.md +9 -21
- package/.agent/skills/landing-page/SKILL.md +19 -16
- package/.agent/skills/lint-and-validate/SKILL.md +9 -59
- package/.agent/skills/llm-engineering/SKILL.md +8 -58
- package/.agent/skills/local-first/SKILL.md +9 -59
- package/.agent/skills/local-first-architecture/SKILL.md +37 -20
- package/.agent/skills/lottie-animation/SKILL.md +19 -15
- package/.agent/skills/marquee-loop/SKILL.md +19 -16
- package/.agent/skills/masked-reveal/SKILL.md +19 -15
- package/.agent/skills/mcp-builder/SKILL.md +9 -59
- package/.agent/skills/micro-interaction/SKILL.md +19 -16
- package/.agent/skills/mobile-design/SKILL.md +8 -58
- package/.agent/skills/monorepo-management/SKILL.md +9 -59
- package/.agent/skills/morphing-icons/SKILL.md +19 -15
- package/.agent/skills/motion-engineering/SKILL.md +22 -15
- package/.agent/skills/nextjs-react-expert/SKILL.md +35 -67
- package/.agent/skills/nodejs-best-practices/SKILL.md +34 -61
- package/.agent/skills/observability/SKILL.md +8 -58
- package/.agent/skills/opentelemetry-observability/SKILL.md +31 -5
- package/.agent/skills/page-transition-animation/SKILL.md +19 -16
- package/.agent/skills/parallel-agents/SKILL.md +9 -59
- package/.agent/skills/performance-profiling/SKILL.md +8 -58
- package/.agent/skills/plan-writing/SKILL.md +36 -69
- package/.agent/skills/platform-engineer/SKILL.md +9 -59
- package/.agent/skills/platform-engineering-opentofu/SKILL.md +31 -5
- package/.agent/skills/playwright-ai-e2e/SKILL.md +31 -5
- package/.agent/skills/playwright-best-practices/SKILL.md +9 -59
- package/.agent/skills/polish/SKILL.md +19 -16
- package/.agent/skills/powershell-windows/SKILL.md +8 -58
- package/.agent/skills/pricing-page/SKILL.md +19 -16
- package/.agent/skills/product-aware-heuristics/SKILL.md +27 -8
- package/.agent/skills/progressive-blur/SKILL.md +19 -16
- package/.agent/skills/project-idioms/SKILL.md +9 -59
- package/.agent/skills/property-based-testing/SKILL.md +31 -5
- package/.agent/skills/python-patterns/SKILL.md +9 -59
- package/.agent/skills/python-pro/SKILL.md +35 -67
- package/.agent/skills/quieter/SKILL.md +19 -16
- package/.agent/skills/react-doctor/SKILL.md +19 -16
- package/.agent/skills/react-specialist/SKILL.md +26 -65
- package/.agent/skills/readme-builder/SKILL.md +9 -59
- package/.agent/skills/realtime-patterns/SKILL.md +8 -58
- package/.agent/skills/red-team-tactics/SKILL.md +9 -59
- package/.agent/skills/redesign-skill/SKILL.md +19 -16
- package/.agent/skills/review-animations/SKILL.md +21 -25
- package/.agent/skills/rust-pro/SKILL.md +30 -61
- package/.agent/skills/seo-fundamentals/SKILL.md +9 -59
- package/.agent/skills/server-management/SKILL.md +9 -59
- package/.agent/skills/shadcn-ui-expert/SKILL.md +9 -59
- package/.agent/skills/shape/SKILL.md +19 -16
- package/.agent/skills/skill-creator/SKILL.md +36 -86
- package/.agent/skills/soft-skill/SKILL.md +19 -16
- package/.agent/skills/sounds-on-the-web/SKILL.md +19 -16
- package/.agent/skills/sql-pro/SKILL.md +47 -62
- package/.agent/skills/supabase-postgres-best-practices/SKILL.md +9 -59
- package/.agent/skills/svg-animation/SKILL.md +19 -15
- package/.agent/skills/swiftui-expert/SKILL.md +9 -59
- package/.agent/skills/swiss-design/SKILL.md +19 -16
- package/.agent/skills/system-design-pro/SKILL.md +21 -26
- package/.agent/skills/systematic-debugging/SKILL.md +19 -60
- package/.agent/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/.agent/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/.agent/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +8 -58
- package/.agent/skills/taste-skill/SKILL.md +19 -16
- package/.agent/skills/tdd-workflow/SKILL.md +65 -25
- package/.agent/skills/test-result-analyzer/SKILL.md +9 -59
- package/.agent/skills/testing-patterns/SKILL.md +8 -58
- package/.agent/skills/thermo-nuclear-code-quality-review/SKILL.md +19 -18
- package/.agent/skills/thinking-protocol/SKILL.md +33 -2
- package/.agent/skills/to-spring-or-not-to-spring/SKILL.md +19 -15
- package/.agent/skills/transitions-dev/SKILL.md +19 -15
- package/.agent/skills/trend-researcher/SKILL.md +9 -59
- package/.agent/skills/typescript-advanced/SKILL.md +21 -64
- package/.agent/skills/typeset/SKILL.md +19 -16
- package/.agent/skills/ui-reasoning-engine/SKILL.md +27 -8
- package/.agent/skills/ui-skill-packs/SKILL.md +26 -16
- package/.agent/skills/ui-skills-root/SKILL.md +22 -14
- package/.agent/skills/ui-ux-pro-max/SKILL.md +38 -12
- package/.agent/skills/ui-ux-researcher/SKILL.md +9 -59
- package/.agent/skills/vector-search-pgvector/SKILL.md +31 -5
- package/.agent/skills/verification-before-completion/SKILL.md +125 -0
- package/.agent/skills/vue-expert/SKILL.md +9 -57
- package/.agent/skills/vulnerability-scanner/SKILL.md +8 -58
- package/.agent/skills/web-accessibility-auditor/SKILL.md +9 -59
- package/.agent/skills/web-design-guidelines/SKILL.md +27 -7
- package/.agent/skills/web-quality-audit/SKILL.md +19 -16
- package/.agent/skills/webapp-testing/SKILL.md +9 -59
- package/.agent/skills/webgpu-performance/SKILL.md +9 -28
- package/.agent/skills/whimsy-injector/SKILL.md +9 -57
- package/.agent/skills/workflow-optimizer/SKILL.md +9 -57
- package/.agent/skills/zero-trust-passkeys/SKILL.md +31 -5
- package/.agent/templates/DESIGN.md +680 -160
- package/.agent/templates/sdd/implementer-prompt.md +53 -0
- package/.agent/templates/sdd/re-review-prompt.md +28 -0
- package/.agent/templates/sdd/task-reviewer-prompt.md +59 -0
- package/.agent/workflows/acf.md +4 -0
- package/.agent/workflows/api-tester.md +5 -0
- package/.agent/workflows/audit.md +5 -0
- package/.agent/workflows/brainstorm.md +17 -1
- package/.agent/workflows/changelog.md +5 -0
- package/.agent/workflows/contract.md +19 -0
- package/.agent/workflows/create.md +6 -1
- package/.agent/workflows/debug.md +5 -0
- package/.agent/workflows/deploy.md +6 -1
- package/.agent/workflows/enhance.md +6 -1
- package/.agent/workflows/fix-ci.md +5 -0
- package/.agent/workflows/fix.md +5 -0
- package/.agent/workflows/generate.md +5 -0
- package/.agent/workflows/marathon.md +6 -1
- package/.agent/workflows/migrate.md +5 -0
- package/.agent/workflows/minimal.md +4 -0
- package/.agent/workflows/orchestrate.md +6 -1
- package/.agent/workflows/performance-benchmarker.md +6 -1
- package/.agent/workflows/pipeline.md +5 -0
- package/.agent/workflows/plan.md +6 -1
- package/.agent/workflows/preview.md +6 -1
- package/.agent/workflows/refactor.md +6 -0
- package/.agent/workflows/review-ai.md +5 -0
- package/.agent/workflows/review.md +5 -0
- package/.agent/workflows/sdd.md +122 -0
- package/.agent/workflows/session.md +5 -0
- package/.agent/workflows/status.md +4 -0
- package/.agent/workflows/super-prompt.md +4 -0
- package/.agent/workflows/swarm.md +6 -1
- package/.agent/workflows/test.md +6 -1
- package/.agent/workflows/tribunal-backend.md +5 -0
- package/.agent/workflows/tribunal-cicd.md +5 -0
- package/.agent/workflows/tribunal-database.md +5 -0
- package/.agent/workflows/tribunal-full.md +8 -0
- package/.agent/workflows/tribunal-mobile.md +5 -0
- package/.agent/workflows/tribunal-performance.md +5 -0
- package/.agent/workflows/tribunal-speed.md +5 -0
- package/.agent/workflows/tribunal-ui.md +7 -0
- package/.agents/plugins/marketplace.json +20 -0
- package/.claude/CLAUDE.md +442 -0
- package/.claude-plugin/marketplace.json +17 -0
- package/.claude-plugin/plugin.json +26 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/plugin.json +26 -0
- package/.devin-plugin/plugin.json +14 -0
- package/.hermes-plugin/__init__.py +102 -0
- package/.hermes-plugin/plugin.yaml +6 -0
- package/.kimi-plugin/plugin.json +38 -0
- package/.opencode/INSTALL.md +41 -0
- package/.opencode/plugins/tribunal.js +101 -0
- package/.pi/extensions/tribunal.ts +133 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +253 -218
- package/SECURITY.md +3 -3
- package/bin/adapter-install.js +240 -0
- package/bin/global-store.js +48 -0
- package/bin/mcp-server.js +568 -252
- package/bin/proxy-server.js +113 -0
- package/bin/spawn-agent.js +39 -0
- package/bin/tk-proxy.js +34 -0
- package/bin/wrapper.js +1 -0
- package/dist/cli.js +355 -355
- package/dist/commands/init.js +8 -51
- package/dist/commands/status.js +61 -36
- package/dist/commands/validate.js +22 -31
- package/dist/esm/index.mjs +142 -142
- package/dist/index.d.ts +349 -343
- package/dist/tui/banner.js +77 -0
- package/dist/tui/index.js +21 -0
- package/dist/tui/reviewer-grid.js +90 -0
- package/dist/tui/shimmer.js +91 -0
- package/dist/tui/theme.js +130 -0
- package/dist/tui/tree.js +93 -0
- package/dist/tui/wizard.js +148 -0
- package/dist/utils/helpers.js +5 -41
- package/gemini-extension.json +6 -0
- package/hooks/hooks-cursor.json +16 -0
- package/hooks/hooks.json +16 -0
- package/hooks/session-start.js +77 -0
- package/package.json +165 -129
- package/scripts/audit_skill_sdo.js +87 -0
- package/scripts/build-graph.js +71 -0
- package/scripts/modernize_skills.js +254 -0
- package/.agent/history/snapshots/migrate_refs.js.json +0 -11
- package/.agent/scripts/compile_router.py +0 -5
- package/.agent/scripts/migrate_skills_frontmatter.py +0 -5
package/dist/utils/helpers.js
CHANGED
|
@@ -43,47 +43,11 @@ function getKitAgent() {
|
|
|
43
43
|
}
|
|
44
44
|
return agentDir;
|
|
45
45
|
}
|
|
46
|
+
const { renderBanner } = require('../tui/banner');
|
|
47
|
+
|
|
46
48
|
function banner(quiet) {
|
|
47
|
-
if (quiet)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const art = String.raw `
|
|
51
|
-
āāāāāāāāāāāāāāāā āāāāāāāāāā āāā āāāāāāā āāā āāāāāā āāā āāā āāāāāāāāāāāāāāā
|
|
52
|
-
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāāāā āāāāāāāāāāāāāā āāā āāāāāāāāāāāāāāāā
|
|
53
|
-
āāā āāāāāāāāāāāāāāāāāāāāāā āāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāā āāā āāā
|
|
54
|
-
āāā āāāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā āāā āāā
|
|
55
|
-
āāā āāā āāāāāāāāāāāāāāāāāāāāāāāāāā āāāāāāāāā āāāāāāāāāāā āāā āāāāāā āāā
|
|
56
|
-
āāā āāā āāāāāāāāāāāāā āāāāāāā āāā āāāāāāāā āāāāāāāāāāā āāā āāāāāā āāā `.split('\n').filter(Boolean);
|
|
57
|
-
console.log();
|
|
58
|
-
for (const line of art) {
|
|
59
|
-
let gradientLine = ' \x1b[1m';
|
|
60
|
-
const len = line.length;
|
|
61
|
-
for (let i = 0; i < len; i++) {
|
|
62
|
-
const char = line[i];
|
|
63
|
-
if (char === ' ') {
|
|
64
|
-
gradientLine += ' ';
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
// Horizontal gradient: flame red (left) to coral/orange (right)
|
|
68
|
-
const ratio = i / len;
|
|
69
|
-
const r = 255;
|
|
70
|
-
const g = Math.floor(30 + ratio * 100);
|
|
71
|
-
const b = Math.floor(60 - ratio * 40);
|
|
72
|
-
gradientLine += `\x1b[38;2;${r};${g};${b}m${char}`;
|
|
73
|
-
}
|
|
74
|
-
gradientLine += '\x1b[0m';
|
|
75
|
-
(0, logger_1.log)(gradientLine);
|
|
76
|
-
}
|
|
77
|
-
console.log();
|
|
78
|
-
// Subtitle strip
|
|
79
|
-
const W = 84;
|
|
80
|
-
const plainSub = 'š”ļø ANTI-HALLUCINATION AGENT SYSTEM';
|
|
81
|
-
const coloredSub = `${(0, logger_1.bold)((0, logger_1.c)('white', 'š”ļø ANTI-HALLUCINATION AGENT SYSTEM'))}`;
|
|
82
|
-
const sp = Math.max(0, W - plainSub.length);
|
|
83
|
-
const centred = ' '.repeat(Math.floor(sp / 2)) + coloredSub + ' '.repeat(Math.ceil(sp / 2));
|
|
84
|
-
(0, logger_1.log)(` ${(0, logger_1.c)('gray', `⦠${'ā'.repeat(W - 6)} ā¦`)}`);
|
|
85
|
-
(0, logger_1.log)(` ${centred}`);
|
|
86
|
-
(0, logger_1.log)(` ${(0, logger_1.c)('gray', `⦠${'ā'.repeat(W - 6)} ā¦`)}`);
|
|
87
|
-
console.log();
|
|
49
|
+
if (quiet) return;
|
|
50
|
+
const PKG = require('../../package.json');
|
|
51
|
+
renderBanner(PKG.version, quiet);
|
|
88
52
|
}
|
|
89
53
|
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Cross-Platform SessionStart Hook for Tribunal Kit
|
|
4
|
+
*
|
|
5
|
+
* Injects Tribunal Kit master governance instructions into the host agent session
|
|
6
|
+
* on startup, clear, and context compaction.
|
|
7
|
+
*
|
|
8
|
+
* Supports:
|
|
9
|
+
* - Cursor Agent (emits additional_context)
|
|
10
|
+
* - Claude Code (emits hookSpecificOutput.additionalContext)
|
|
11
|
+
* - GitHub Copilot CLI / Standard Agent SDK (emits additionalContext)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
|
|
17
|
+
function getPluginRoot() {
|
|
18
|
+
if (process.env.CURSOR_PLUGIN_ROOT) return process.env.CURSOR_PLUGIN_ROOT;
|
|
19
|
+
if (process.env.CLAUDE_PLUGIN_ROOT) return process.env.CLAUDE_PLUGIN_ROOT;
|
|
20
|
+
return path.resolve(__dirname, '..');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function loadMasterRules(pluginRoot) {
|
|
24
|
+
const candidates = [
|
|
25
|
+
path.join(pluginRoot, '.agent', 'rules', 'GEMINI.md'),
|
|
26
|
+
path.join(pluginRoot, '.agent', 'config', 'system-prompt.md'),
|
|
27
|
+
path.join(pluginRoot, '.cursorrules'),
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
for (const candidate of candidates) {
|
|
31
|
+
if (fs.existsSync(candidate)) {
|
|
32
|
+
try {
|
|
33
|
+
return fs.readFileSync(candidate, 'utf8');
|
|
34
|
+
} catch (_err) {
|
|
35
|
+
// Continue to next candidate
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return '# Tribunal Kit Master Governance Active\nEnforce strict TDD, out-of-band context isolation, and parallel reviewer waves.';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function main() {
|
|
44
|
+
const pluginRoot = getPluginRoot();
|
|
45
|
+
const rules = loadMasterRules(pluginRoot);
|
|
46
|
+
|
|
47
|
+
const sessionContext = [
|
|
48
|
+
'<EXTREMELY_IMPORTANT>',
|
|
49
|
+
'Tribunal Kit Master Governance is active.',
|
|
50
|
+
'You are operating under the Tribunal Anti-Hallucination & Subagent-Driven Development (SDD) protocol.',
|
|
51
|
+
'Enforce: Iron Law of TDD (Red-Green-Refactor), 28-Specialist Review Waves, Out-of-Band Context Isolation, and Zero Placeholders.',
|
|
52
|
+
'',
|
|
53
|
+
rules,
|
|
54
|
+
'</EXTREMELY_IMPORTANT>',
|
|
55
|
+
].join('\n');
|
|
56
|
+
|
|
57
|
+
let outputObj;
|
|
58
|
+
if (process.env.CURSOR_PLUGIN_ROOT) {
|
|
59
|
+
// Cursor expects snake_case additional_context
|
|
60
|
+
outputObj = { additional_context: sessionContext };
|
|
61
|
+
} else if (process.env.CLAUDE_PLUGIN_ROOT && !process.env.COPILOT_CLI) {
|
|
62
|
+
// Claude Code expects nested hookSpecificOutput
|
|
63
|
+
outputObj = {
|
|
64
|
+
hookSpecificOutput: {
|
|
65
|
+
hookEventName: 'SessionStart',
|
|
66
|
+
additionalContext: sessionContext,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
} else {
|
|
70
|
+
// Standard SDK / Copilot CLI
|
|
71
|
+
outputObj = { additionalContext: sessionContext };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
process.stdout.write(JSON.stringify(outputObj, null, 2) + '\n');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,129 +1,165 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tribunal-kit",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Your AI writes code that doesn't exist. Tribunal Kit stops it. The governance layer for AI coding agents ā 52 specialists, 28 parallel reviewers,
|
|
5
|
-
"keywords": [
|
|
6
|
-
"ai",
|
|
7
|
-
"ai-agent",
|
|
8
|
-
"long-running-agents",
|
|
9
|
-
"agent",
|
|
10
|
-
"agents",
|
|
11
|
-
"multi-agent",
|
|
12
|
-
"agentic",
|
|
13
|
-
"swarm",
|
|
14
|
-
"orchestration",
|
|
15
|
-
"llm",
|
|
16
|
-
"anti-hallucination",
|
|
17
|
-
"hallucination",
|
|
18
|
-
"code-review",
|
|
19
|
-
"code-quality",
|
|
20
|
-
"cursor",
|
|
21
|
-
"cursor-rules",
|
|
22
|
-
"cursorrules",
|
|
23
|
-
"windsurf",
|
|
24
|
-
"copilot",
|
|
25
|
-
"cline",
|
|
26
|
-
"gemini",
|
|
27
|
-
"antigravity",
|
|
28
|
-
"tribunal",
|
|
29
|
-
"mcp",
|
|
30
|
-
"model-context-protocol",
|
|
31
|
-
"cli",
|
|
32
|
-
"devtools",
|
|
33
|
-
"ai-coding",
|
|
34
|
-
"autonomous-agents",
|
|
35
|
-
"coding-assistant",
|
|
36
|
-
"automation",
|
|
37
|
-
"model-context-protocol-server",
|
|
38
|
-
"mcp-server",
|
|
39
|
-
"claude-code",
|
|
40
|
-
"aider",
|
|
41
|
-
"cursor-rules-generator",
|
|
42
|
-
"agentic-ai",
|
|
43
|
-
"ai-code-reviewer",
|
|
44
|
-
"hallucination-mitigation",
|
|
45
|
-
"autonomous-workflows",
|
|
46
|
-
"code-correctness"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
".
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "tribunal-kit",
|
|
3
|
+
"version": "9.0.0",
|
|
4
|
+
"description": "Your AI writes code that doesn't exist. Tribunal Kit stops it. The governance layer for AI coding agents ā 52 specialists, 28 parallel reviewers, 184 skills, Rust core, MCP server. Works with Cursor, VSCode, Windsurf, Claude Code, and Aider.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"ai-agent",
|
|
8
|
+
"long-running-agents",
|
|
9
|
+
"agent",
|
|
10
|
+
"agents",
|
|
11
|
+
"multi-agent",
|
|
12
|
+
"agentic",
|
|
13
|
+
"swarm",
|
|
14
|
+
"orchestration",
|
|
15
|
+
"llm",
|
|
16
|
+
"anti-hallucination",
|
|
17
|
+
"hallucination",
|
|
18
|
+
"code-review",
|
|
19
|
+
"code-quality",
|
|
20
|
+
"cursor",
|
|
21
|
+
"cursor-rules",
|
|
22
|
+
"cursorrules",
|
|
23
|
+
"windsurf",
|
|
24
|
+
"copilot",
|
|
25
|
+
"cline",
|
|
26
|
+
"gemini",
|
|
27
|
+
"antigravity",
|
|
28
|
+
"tribunal",
|
|
29
|
+
"mcp",
|
|
30
|
+
"model-context-protocol",
|
|
31
|
+
"cli",
|
|
32
|
+
"devtools",
|
|
33
|
+
"ai-coding",
|
|
34
|
+
"autonomous-agents",
|
|
35
|
+
"coding-assistant",
|
|
36
|
+
"automation",
|
|
37
|
+
"model-context-protocol-server",
|
|
38
|
+
"mcp-server",
|
|
39
|
+
"claude-code",
|
|
40
|
+
"aider",
|
|
41
|
+
"cursor-rules-generator",
|
|
42
|
+
"agentic-ai",
|
|
43
|
+
"ai-code-reviewer",
|
|
44
|
+
"hallucination-mitigation",
|
|
45
|
+
"autonomous-workflows",
|
|
46
|
+
"code-correctness",
|
|
47
|
+
"claude-code-plugin",
|
|
48
|
+
"claude-plugin"
|
|
49
|
+
],
|
|
50
|
+
"homepage": "https://github.com/Harmitx7/tribunal-kit",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/Harmitx7/tribunal-kit.git"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/Harmitx7/tribunal-kit/issues"
|
|
57
|
+
},
|
|
58
|
+
"author": "Harmitx7",
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"types": "dist/index.d.ts",
|
|
61
|
+
"main": "dist/cli.js",
|
|
62
|
+
"exports": {
|
|
63
|
+
".": {
|
|
64
|
+
"types": "./dist/index.d.ts",
|
|
65
|
+
"import": "./dist/esm/index.mjs",
|
|
66
|
+
"require": "./dist/cli.js"
|
|
67
|
+
},
|
|
68
|
+
"./package.json": "./package.json"
|
|
69
|
+
},
|
|
70
|
+
"bin": {
|
|
71
|
+
"tribunal-kit": "bin/wrapper.js",
|
|
72
|
+
"tk": "bin/wrapper.js",
|
|
73
|
+
"tk-proxy": "bin/tk-proxy.js",
|
|
74
|
+
"tk-adapt": "bin/adapter-install.js"
|
|
75
|
+
},
|
|
76
|
+
"files": [
|
|
77
|
+
"bin/",
|
|
78
|
+
"dist/",
|
|
79
|
+
"scripts/",
|
|
80
|
+
"hooks/",
|
|
81
|
+
".claude-plugin/",
|
|
82
|
+
".cursor-plugin/",
|
|
83
|
+
".codex-plugin/",
|
|
84
|
+
".devin-plugin/",
|
|
85
|
+
".hermes-plugin/",
|
|
86
|
+
".kimi-plugin/",
|
|
87
|
+
".opencode/",
|
|
88
|
+
".agents/",
|
|
89
|
+
".pi/",
|
|
90
|
+
"gemini-extension.json",
|
|
91
|
+
".agent/",
|
|
92
|
+
".claude/CLAUDE.md",
|
|
93
|
+
"README.md",
|
|
94
|
+
"LICENSE",
|
|
95
|
+
"SECURITY.md",
|
|
96
|
+
"CONTRIBUTING.md",
|
|
97
|
+
"mcp_config.json",
|
|
98
|
+
".agent/config/plugin.json",
|
|
99
|
+
".agent/config/system-prompt.md",
|
|
100
|
+
".agent/config/slash-commands.json",
|
|
101
|
+
".agent/config/specialist-registry.json"
|
|
102
|
+
],
|
|
103
|
+
"pi": {
|
|
104
|
+
"extensions": [
|
|
105
|
+
"./.pi/extensions/tribunal.ts"
|
|
106
|
+
],
|
|
107
|
+
"skills": [
|
|
108
|
+
"./.agent/skills"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"engines": {
|
|
112
|
+
"node": ">=18.0.0"
|
|
113
|
+
},
|
|
114
|
+
"scripts": {
|
|
115
|
+
"test": "npm run validate-payload && jest --runInBand --coverage --forceExit",
|
|
116
|
+
"test:unit": "jest test/unit --coverage --forceExit",
|
|
117
|
+
"test:integration": "jest test/integration --coverage --forceExit",
|
|
118
|
+
"preversion": "node scripts/sync-version.js",
|
|
119
|
+
"version": "node scripts/changelog.js && git add CHANGELOG.md",
|
|
120
|
+
"changelog": "node scripts/changelog.js",
|
|
121
|
+
"changelog:preview": "node scripts/changelog.js --preview",
|
|
122
|
+
"sync": "node scripts/sync-version.js",
|
|
123
|
+
"validate-payload": "node scripts/validate-payload.js",
|
|
124
|
+
"benchmark": "node scripts/benchmark.js",
|
|
125
|
+
"benchmark:stress": "node scripts/stress_benchmark.js",
|
|
126
|
+
"benchmark:rust": "cargo build --release && node scripts/benchmark.js",
|
|
127
|
+
"build:rust": "cargo build --release",
|
|
128
|
+
"build:core": "cargo build --release --manifest-path crates/core/Cargo.toml",
|
|
129
|
+
"test:rust": "cargo test --manifest-path crates/core/Cargo.toml",
|
|
130
|
+
"test:all": "npm run validate-payload && npm run test:rust && jest --runInBand --coverage --forceExit",
|
|
131
|
+
"format": "prettier --write .",
|
|
132
|
+
"format:check": "prettier --check .",
|
|
133
|
+
"build": "npm run build:rust"
|
|
134
|
+
},
|
|
135
|
+
"devDependencies": {
|
|
136
|
+
"eslint": "^9.1.1",
|
|
137
|
+
"jest": "^30.4.2",
|
|
138
|
+
"prettier": "^3.2.5",
|
|
139
|
+
"typescript": "^5.4.5"
|
|
140
|
+
},
|
|
141
|
+
"optionalDependencies": {
|
|
142
|
+
"@tribunal-kit/core-darwin-arm64": "^9.0.0",
|
|
143
|
+
"@tribunal-kit/core-darwin-x64": "^9.0.0",
|
|
144
|
+
"@tribunal-kit/core-linux-arm64": "^9.0.0",
|
|
145
|
+
"@tribunal-kit/core-linux-x64": "^9.0.0",
|
|
146
|
+
"@tribunal-kit/core-win32-arm64": "^9.0.0",
|
|
147
|
+
"@tribunal-kit/core-win32-x64": "^9.0.0"
|
|
148
|
+
},
|
|
149
|
+
"jest": {
|
|
150
|
+
"testMatch": [
|
|
151
|
+
"**/test/**/*.test.js"
|
|
152
|
+
],
|
|
153
|
+
"testEnvironment": "node",
|
|
154
|
+
"coverageDirectory": "coverage",
|
|
155
|
+
"collectCoverageFrom": [
|
|
156
|
+
"bin/**/*.js",
|
|
157
|
+
".agent/scripts/**/*.js",
|
|
158
|
+
"dist/**/*.js"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"dependencies": {
|
|
162
|
+
"better-sqlite3": "^13.0.3",
|
|
163
|
+
"zod": "^4.5.4"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Skill Discovery Optimization (SDO) Linter for Tribunal-Kit
|
|
4
|
+
*
|
|
5
|
+
* Scans all skills in .agent/skills/ to ensure their frontmatter descriptions
|
|
6
|
+
* follow the SDO invariant:
|
|
7
|
+
* - Must describe *when to trigger* (symptoms, contexts, conditions)
|
|
8
|
+
* - Must NOT summarize the internal workflow or process (which causes LLMs to skim/hallucinate)
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
const SKILLS_DIR = path.resolve(__dirname, '..', '.agent', 'skills');
|
|
15
|
+
|
|
16
|
+
function parseFrontmatter(content) {
|
|
17
|
+
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
18
|
+
if (!match) return null;
|
|
19
|
+
|
|
20
|
+
const yamlBlock = match[1];
|
|
21
|
+
const nameMatch = yamlBlock.match(/^name:\s*(.+)$/m);
|
|
22
|
+
const descMatch = yamlBlock.match(/^description:\s*(.+)$/m);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
name: nameMatch ? nameMatch[1].trim().replace(/^["']|["']$/g, '') : null,
|
|
26
|
+
description: descMatch ? descMatch[1].trim().replace(/^["']|["']$/g, '') : null,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function auditSkills() {
|
|
31
|
+
if (!fs.existsSync(SKILLS_DIR)) {
|
|
32
|
+
console.error(`ā Skills directory not found: ${SKILLS_DIR}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const entries = fs.readdirSync(SKILLS_DIR, { withFileTypes: true });
|
|
37
|
+
const skillDirs = entries.filter(e => e.isDirectory()).map(e => e.name);
|
|
38
|
+
|
|
39
|
+
let totalSkills = 0;
|
|
40
|
+
let validSkills = 0;
|
|
41
|
+
const warnings = [];
|
|
42
|
+
|
|
43
|
+
for (const dir of skillDirs) {
|
|
44
|
+
const skillMdPath = path.join(SKILLS_DIR, dir, 'SKILL.md');
|
|
45
|
+
if (!fs.existsSync(skillMdPath)) continue;
|
|
46
|
+
|
|
47
|
+
totalSkills++;
|
|
48
|
+
const content = fs.readFileSync(skillMdPath, 'utf8');
|
|
49
|
+
const fm = parseFrontmatter(content);
|
|
50
|
+
|
|
51
|
+
if (!fm || !fm.description) {
|
|
52
|
+
warnings.push({ skill: dir, issue: 'Missing frontmatter description' });
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const desc = fm.description;
|
|
57
|
+
const isTriggerFocused = desc.toLowerCase().includes('use when') ||
|
|
58
|
+
desc.toLowerCase().includes('activate when') ||
|
|
59
|
+
desc.toLowerCase().includes('when ');
|
|
60
|
+
|
|
61
|
+
if (!isTriggerFocused) {
|
|
62
|
+
warnings.push({
|
|
63
|
+
skill: dir,
|
|
64
|
+
issue: 'Description does not explicitly specify trigger condition (should start with "Use when...")',
|
|
65
|
+
description: desc.slice(0, 80) + '...',
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
validSkills++;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
console.log(`\nš Skill Discovery Optimization (SDO) Audit Results:`);
|
|
73
|
+
console.log(` Total Skills Analyzed: ${totalSkills}`);
|
|
74
|
+
console.log(` SDO Trigger-Compliant: ${validSkills}`);
|
|
75
|
+
console.log(` Advisory Warnings: ${warnings.length}\n`);
|
|
76
|
+
|
|
77
|
+
if (warnings.length > 0) {
|
|
78
|
+
console.log(`ā ļø Advisory Sample (first 5):`);
|
|
79
|
+
for (const w of warnings.slice(0, 5)) {
|
|
80
|
+
console.log(` - [${w.skill}]: ${w.issue}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
console.log(`\nā SDO audit complete. System has ${totalSkills} searchable skills.\n`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
auditSkills();
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const { spawn } = require('child_process');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
async function buildSemanticGraph(targetPath = process.cwd()) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
// Determine platform-specific binary
|
|
9
|
+
const platform = os.platform();
|
|
10
|
+
const _arch = os.arch();
|
|
11
|
+
|
|
12
|
+
let binaryName = 'tribunal-core';
|
|
13
|
+
if (platform === 'win32') binaryName += '.exe';
|
|
14
|
+
|
|
15
|
+
// For development, try to use the locally compiled debug/release binary
|
|
16
|
+
let binaryPath = path.join(__dirname, '..', 'target', 'release', binaryName);
|
|
17
|
+
if (!fs.existsSync(binaryPath)) {
|
|
18
|
+
binaryPath = path.join(__dirname, '..', 'target', 'debug', binaryName);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!fs.existsSync(binaryPath)) {
|
|
22
|
+
console.error("Tribunal Core binary not found. Please run 'npm run build:core'.");
|
|
23
|
+
return reject(new Error('Tribunal Core binary not found.'));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
console.log(`Building Semantic Context Graph for ${targetPath}...`);
|
|
27
|
+
|
|
28
|
+
const coreProcess = spawn(binaryPath, ['graph', targetPath], {
|
|
29
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
let stdoutData = '';
|
|
33
|
+
let stderrData = '';
|
|
34
|
+
|
|
35
|
+
coreProcess.stdout.on('data', data => {
|
|
36
|
+
stdoutData += data.toString();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
coreProcess.stderr.on('data', data => {
|
|
40
|
+
stderrData += data.toString();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
coreProcess.on('close', code => {
|
|
44
|
+
if (code !== 0) {
|
|
45
|
+
console.error(`Graph generation failed with code ${code}`);
|
|
46
|
+
console.error(stderrData);
|
|
47
|
+
return reject(new Error(`Graph generation failed: ${stderrData}`));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
const result = JSON.parse(stdoutData.trim());
|
|
52
|
+
console.log(`Graph built successfully: ${result.nodes} nodes parsed.`);
|
|
53
|
+
console.log(`Graph saved to: ${result.graph_path}`);
|
|
54
|
+
resolve(result);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error('Failed to parse core engine output:', stdoutData);
|
|
57
|
+
reject(err);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Allow running directly from CLI
|
|
64
|
+
if (require.main === module) {
|
|
65
|
+
const targetDir = process.argv[2] || process.cwd();
|
|
66
|
+
buildSemanticGraph(targetDir).catch(_err => {
|
|
67
|
+
process.exit(1);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = { buildSemanticGraph };
|