PluginWorld
Tr

tribunal-kit

MCP

Your AI writes code that doesn't exist. Tribunal Kit stops it. The governance layer for AI coding agents — 52 specialists, 28 parallel reviewers, 183 skills, Rust core, MCP server. Works with Cursor, VSCode, Windsurf, Claude Code, and Aider.

@Harmitx7 · v7.0.0 · MIT · updated 11d ago

SECURITY

B

SCORE

72

INSTALLS

8.1K

PLUG IN

claude mcp add tribunal-kit -- npx -y tribunal-kit

README


TribunalKit Logo

TRIBUNAL KIT

Your AI writes code that doesn't exist. Tribunal Kit stops it.

The governance layer for AI coding agents — 52 specialists, 28 reviewers, Rust core.

NPM Version NPM Downloads GitHub Stars CI Status
License Release Version MCP Server Zero Dependencies Security Policy
The Problem AI coding agents hallucinate. Constantly.

They import packages that don't exist. They call API methods that were deprecated two versions ago. They forget your project conventions mid-conversation. They generate code that looks right but silently breaks at runtime. No linter catches this. No type-checker catches this. The hallucination happens at the semantic layer — and until now, nothing governed it.

The Solution One command. Your AI stops lying.

Tribunal Kit wraps your coding agents in a neurosymbolic verification envelope — 52 specialist agents, 28 parallel reviewers, 183 reusable skills, and a compiled Rust core — that intercepts AI output, validates it against your actual codebase, and blocks hallucinated code before it reaches disk. Works with Cursor, VSCode, Windsurf, Claude Code, and Aider.

npx tribunal-kit init    # Install the governance layer (< 60 seconds)
npx tribunal-kit sync    # Bridge with Cursor / Windsurf / VSCode
npx tribunal-kit status  # Verify everything is locked in

What's Inside

Layer Count What It Does
Specialist Agents 51 Domain-specific reasoning (frontend, backend, security, database, mobile, DevOps)
Tribunal Reviewers 27 Parallel code review pipeline that catches hallucinations before they ship
Reusable Skills 183 Deep knowledge packs (React 19, Next.js 15, Rust, Python, Vue, animations, a11y)
Slash Workflows 38 One-command operations (/generate, /debug, /audit, /deploy, /refactor)
Rust Core 1 Native binary for sub-50ms operations (hashing, dedup, DAG scheduling, compression)
MCP Server 1 Model Context Protocol integration for dynamic tool access
Persistent Memory 4 types Semantic, Procedural, Episodic, Working — survives across sessions
Case Law Database Records past AI mistakes as permanent precedents to prevent recurrence


📂 Table of Contents (Click to Expand)

📈 Comparative Analysis

AI engineering requires more than static template rules or raw linters. See how Tribunal Kit stacks up against alternatives:

Dimension / Capability Tribunal Kit 🛡️ Static `.cursorrules` AST Linters (ESLint) Manual Prompting
Hallucination Mitigation Active check gates (`tk guardrail`) None (static text only) None (doesn't check context logic) None (rely on model)
Context Window Overhead Budget-gated recall & MCP tools Severe (bloats with entire files) N/A (runs post-edit) High (bloats system prompt)
Cognitive Alignment OCAE Fabel-5 alignment None None None
Self-Evolution Git diff log learning & SkillOpt Manual editing Manual config edits Manual prompt tuning
IDE & Terminal Support Cursor, Windsurf, VSCode, Claude, Aider Cursor/Windsurf only Independent Hand-copied
Execution Performance Rust Core (tribunal-core) N/A Slow Node processes Slow API calls


⚡ State-of-the-Art Performance (Rust Core)

Tribunal Kit v6 splits heavy computational tasks between a native Rust core and a flexible JS orchestrator:

  • Compiled Rust Core (tribunal-core): Powers all deterministic operations, such as path-traversal sandboxing, Levenshtein distance calculations, text merges, and memory database reads to eliminate Node startup latency.
  • Zero-Latency Hash Manifests: File synchronization and updates use SHA-256 incremental hash diffs, copying only modified assets and reducing CLI setup time by 95%.
  • Semaphore-Bounded Parallelism: Fully concurrent operations with thread limits (64 in Rust, 32 in Node.js) to avoid resource starvation in complex monorepos.



🛠️ Advanced Setup

Already ran npx tribunal-kit init? Here's how to go further:

# Install Git pre-push governance hook
npx tribunal-kit hook

# Scan your workspace for AI hallucinations (phantom packages, unverified APIs)
npx tribunal-kit guardrail

# Record an AI coding mistake as permanent precedent (case law)
npx tribunal-kit case add

# Optimize a skill file using the SkillOpt evolution engine
tk optimize-skill --target ./skills/auth-security.md "npm run test:auth" --epochs 5

[!TIP] The tk hook command installs a Git pre-push hook that auto-runs tk guardrail before every push — catching hallucinated imports and unverified APIs before they reach your remote.

[!NOTE] MCP Server: To connect Tribunal Kit to Cursor, VSCode, or Claude Desktop as an MCP server, see the MCP Server Integration section below.



⚖️ The Tribunal Pipeline — Mitigating AI Code Hallucinations

Code generation is solved. Code correctness is the frontier.

The Tribunal Pipeline intercepts raw agent generation and routes it through a parallel suite of 28 domain-specific reviewers before presenting changes to the developer:

graph TD
    A[User Request] -->|Intent Parsed| B(Context Broker)
    B --> C{Inner-Loop Validator}

    C -->|Syntax & Secrets Check| D[Parallel Tribunal Review]
    C -.->|Failed| E[Maker Auto-Correction]
    E -.-> C

    D -->|28 Domain Reviewers| F[Human Gate]
    F -->|Approved| G((Committed to Disk))

    classDef default fill:#1a1a1a,stroke:#333,stroke-width:2px,color:#fff;
    classDef critical fill:#ff1637,stroke:#fff,stroke-width:2px,color:#fff;
    classDef success fill:#ccff00,stroke:#fff,stroke-width:2px,color:#1a1a1a;

    class D critical;
    class G success;

Reviewer Swarms Include:

  • logic-reviewer · Semantic soundness & behavior checks.
  • security-auditor · Payload boundaries, SQL injection & OWASP scanning.
  • resilience-reviewer · Async error boundaries and retry logic.
  • ui-ux-auditor · Structural accessibility (a11y) & premium animations.
  • schema-reviewer · Type narrowing and database integrity checks.


🧠 Omniscience Cognitive Alignment Engine (OCAE)

The Omniscience Cognitive Alignment Engine (OCAE) aligns any LLM with the reasoning loops of a senior staff engineer:

  • Step 0 Epistemic Loop: Always-on cognition loop enforcing confidence checking (L1–L5), knowledge freshness audits, and precision budgeting before any script execution.
  • Dynamic API Trap Mitigation: Automatically guards code blocks against framework-specific compiler breakages (e.g., React 19 hook constraints, Drizzle ORM filtration issues, and Next.js 15 route headers).
  • Prose Alignment Formatting: Collapses ugly lists and bullet points into highly readable, scannable documentation prose, stripping out typical AI conversational introduction/conclusion slop.


🧬 SkillOpt: Autonomous Self-Evolution Engine

Stop writing and tuning system prompts by hand. The SkillOpt Self-Evolution Engine automatically refines your prompt rules directly from test harness feedback:

# Optimize a custom skill against a test harness
tk optimize-skill --target ./skills/auth-security.md "npm run test:auth" --epochs 5 --candidates 3
  1. Proposal Generation: The LLM suggests micro-patches to improve the target instruction file.
  2. Rust Deduplication: Proposals are compiled, token-checked, and filtered using normalized Levenshtein similarity (default 0.85) to exclude redundant changes.
  3. Harness Evaluation: The test command is executed. Successfully passing tests raise the candidate score.
  4. Genetic Promotion: The highest-scoring candidate is promoted as the new baseline for the next epoch.


🏛️ Supreme Court Case Law & Memory

Tribunal Kit builds a permanent repository memory layer that spans across conversation sessions:

1. Supreme Court Case Law (tk case)

Record AI coding errors as permanent local precedents. The precedence-reviewer actively references this local database to block the AI from repeating past code defects or pattern bugs.

  • Add precedence: tk case add
  • Search case law: tk case search "postgres deadlock"

2. 4-Type Persistent Memory (tk memory)

Manages your project context utilizing a strict 4-category cognitive taxonomy:

  • Semantic Memory — Project context (e.g., "Uses Drizzle with SQLite").
  • Procedural Memory — Action guidelines (e.g., "Compile Rust binary before publishing").
  • Episodic Memory — Development history and events.
  • Working Memory — Current task scope.

Budget-gated recall ensures that agents only pull relevant memory segments, avoiding token window bloat and context dilution.



🏃 The Marathon Harness — Long-Running Autonomy

The Marathon Harness governs long-running multi-session tasks, keeping agents on track without looping or stalling:

  • Feature DAG Graphing: Declare tasks with dependency bounds (e.g., --deps=1,2). If a core schema migration fails, dependent API route tasks are dynamically deadlocked and bypassed until fixed.
  • ANSI TUI Swarm Dashboard: Intercepts verbose, noisy terminal output when running parallel swarms (tk /swarm), projecting agent research, coding, and review steps in real-time.
  • Failure Context Recalls: Tracks failure histories, error stacks, and retry budgets. If a task is picked up by a new agent session, the agent receives the exact history of failed approaches to course-correct instantly.


🔌 Model Context Protocol (MCP) Server Integration

Tribunal Kit hosts an out-of-the-box Model Context Protocol (MCP) server via stdio. Connect it to Cursor, VSCode, Windsurf, or Claude Desktop to allow coding agents to query tools dynamically.

Config Example (mcp_config.json / Claude Desktop config)

{
  "mcpServers": {
    "tribunal-kit": {
      "command": "node",
      "args": ["C:/Users/sunrise/Desktop/pfojects/cli project/tribunal-kit/bin/wrapper.js"],
      "env": {
        "PROJECT_ROOT": "C:/Users/sunrise/Desktop/pfojects/cli project/tribunal-kit"
      }
    }
  }
}

Exposed MCP Tools

  • verify_contracts — Proactively verifies proposed code against team contract rules before writing to disk.
  • get_tribunal_skill / list_tribunal_agents — Dynamically injects skills/agent guidelines without overloading system prompts.


📜 Sovereign Covenant Protocol — AI Agent Behavioral Contract Testing (tk contract)

Design by Contract applied to AI coding agents. Declare invariants in declarative YAML rules stored in .tribunal/contracts/:

name: 'No console.log in production code'
scope: 'src/**/*.ts, src/**/*.tsx'
severity: block
must_not:
  - pattern: 'console.log'
    message: 'Use structured logger instead of console.log'
# Scaffold starter contracts
npx tribunal-kit contract init

# Run contract checks against target or modified files
npx tribunal-kit contract verify

# Replay a failure context trace snapshot
npx tribunal-kit contract replay <trace_id>


💻 CLI Command Reference

Below is the structured list of all core commands available via npx tribunal-kit <command> (or the alias tk):

Command Action / Arguments Description
init [--force] [--path <dir>] Initializes the .agent/ configuration payload.
sync Syncs .agent rules with Cursor, Windsurf, and VSCode configs.
status Evaluates workspace rules and manifest counts for violations.
guardrail [--file <path>] Scans workspace changes for phantom packages and // VERIFY tags.
optimize-skill --target <file> "<cmd>" Launches a self-evolving prompt optimization sequence.
align [--file <path>] Align outputs, strip intro/conclusion slop, enforce framework bounds.
learn [--dry-run] Analyzes Git diff logs to automatically distill project idioms.
case add | search <q> | export Records, searches, or compiles AI mistake precedents.
memory store | recall | gc Manages 4-type persistent memory with budget-gated recall.
graph Maps codebase dependencies and outputs clean context snapshots.
marathon init | status | next Sets up and executes long-running autonomous development.
contract init | verify | list | trace | replay AI Agent Behavioral Contract Testing and failure context trace replay.


🤝 Contributing & Security

We maintain high code standards and absolute runtime safety:

  • Security Policy: Tribunal Kit operates with zero runtime network dependencies, zero dangerous eval executes, and sandboxed file paths to protect your codebase. Read more in SECURITY.md.
  • Contributing Guide: We welcome community-authored agents, skills, and workflows! Please read CONTRIBUTING.md to set up your local development environment and run our verification tests.


Status

"Never guess database schemas. Verify every async boundary. Welcome to the Tribunal."

MIT Licensed • Engineered for ultimate AI code governance.

SIMILAR PLUGINS