Kilo-Kit
Kilo-Kit is a governed MCP server that supervises AI coding agents with workflow orchestration, persistent memory, curated skills, and gated code execution.
Orchestrate coding tasks through the C4 lifecycle, task-mode routing, and 4-tier gating.
Store and retrieve cross-session architectural facts, reflections, and memory reports in SQLite.
Search, load, validate, and synthesize curated skills across engineering, security, productivity, DevOps, and agent frameworks.
Safely read files, search files, and grep code with workspace-boundary protections.
Write, edit, and run commands only through hard-gated session-based tools with narration and security guardrails.
Perform structured reasoning with Tree-of-Thoughts stepping, adversarial plan grilling, and 5-Whys root-cause tracing.
Compact verbose context while preserving invariants and synthesize reusable skills from solved problems.
Inspect and reset Sentinel circuit-breaker state, step budgets, failure streaks, and grounded-file telemetry.
Benchmark solutions against industry/GitHub practices and triangulate research with DAG trade-offs and confidence scoring.
Provides GitHub-grounded research and benchmarking, using popular repository patterns and standards to audit and validate solution trajectories.
Allows agents to store, retrieve, and reflect on persistent memory facts, decisions, reflections, and task trajectories in a local SQLite database for continuous self-improvement.
Kilo-Kit
The Autonomous Cognitive Cortex & Governed Agency Substrate for AI Coding Agents
Kilo-Kit is an enterprise-grade Model Context Protocol (MCP) server and supervisor engine that transforms raw LLM coding assistants (GitHub Copilot, Cursor, Windsurf, Claude Code, Gemini CLI) into disciplined, self-correcting software engineers. It enforces grounded diagnostic probing, Tree-of-Thoughts DAG planning, cross-session memory via SQLite FTS5 BM25, and runtime supervisor guardrails to eliminate blind code edits and infinite loop thrashing.
Quick Start (30s) • Why Kilo-Kit? • Architecture • IDE Setup • Core Capabilities • Tools Reference • Skills Catalog
💡 Why Kilo-Kit?
The Crisis of Unbounded AI Agency
Modern LLMs are exceptional code generators, but when given autonomous tools without structural guardrails, they suffer from critical operational failure modes:
Blind Mutations (Ungrounded Edits): Agents modify files without reading their contents, dependencies, or type contracts, introducing silent architectural regressions.
The Infinite Thrashing Loop: When a test or build fails, the agent repeats the exact same failing edit 5 to 10 times in a row until credits or context windows are exhausted.
Context Collapse & Lost-in-the-Middle: Unbounded test dumps and terminal traces inject 50,000+ tokens of raw noise, causing severe attention degradation and hallucinated refactoring.
Agent Amnesia: Every new session starts from zero—past mistakes, verified bug fixes, and architectural decisions are completely forgotten across conversations.
The Solution: Governed Autonomy
Kilo-Kit acts as an intelligent supervisor sitting between the AI agent and your codebase, establishing a balance of Macro-Determinism (strict safety boundaries) with Micro-Agency (unconstrained local implementation freedom):
🛡️ Pre-Flight Grounding Lock: File modifications are physically rejected at the protocol level if the agent has not inspected the target file during the active session.
🛑 Circuit Breaker Tripwire: Automatically halts execution after 3 consecutive identical actions or repeated failures, forcing structured root-cause analysis.
✂️ Smart Truncation (20/80 Rule): Retains critical command flags, dynamically scans and preserves intermediate exceptions (
FAIL,TypeError,panic), and keeps final stack traces while streaming raw verbose output safely to disk.🧠 Persistent BM25 Memory: Every architectural decision, verified solution, and reflection is indexed in embedded SQLite FTS5 for sub-millisecond retrieval across future sessions.
Related MCP server: lnwjud
⚡ Quick Start (in 30 seconds)
1. Zero-Install Instant Setup
Run Kilo-Kit directly with npx to automatically detect and configure all installed IDEs on your machine:
npx @vodailocz/kilo-kit-mcp setupOr install globally for zero-latency local execution:
npm install -g @vodailocz/kilo-kit-mcp
kilo-kit-setup --local2. Verify System Health
Run the 18-point empirical diagnostic suite:
kilo-kit-doctor🏥 Kilo-Kit System Health Doctor [HEALTHY]
✅ PASS Node.js Runtime: Node.js meets requirement (>= 20.0.0).
✅ PASS CLI Global Binaries: All CLI binaries resolved in PATH.
✅ PASS SQLite Persistence: SQLite verified (14 tables, FTS5 BM25 active, integrity: ok).
✅ PASS Skill Library: Successfully indexed all 180/180 skills in repository.
✅ PASS Client: GitHub Copilot: Configured in ~/.copilot/mcp-config.json [Local linked binary]
✅ PASS Client: Cursor IDE: Configured in ~/.cursor/mcp.json [Local linked binary]
✅ PASS Client: Claude Code: Configured in ~/.claude.json [Local linked binary]
✅ PASS MCP Server Runtime: All 24 tools registered; functional probe executed successfully.
Summary: Kilo-Kit Doctor: 18/18 checks passed. Overall Status: HEALTHY🏛️ Architecture & C4 Protocol
Kilo-Kit establishes a strict separation of concerns between Cognitive Reasoning (Cortex), Supervisor Guardrails (Sentinel), and Safe I/O Execution (Limbs):
[ Host AI Agent: Cursor / Copilot / Windsurf / Claude / Gemini ]
│
stdio / JSON-RPC
▼
┌────────────────────────────────────────────────────────────┐
│ KILO-SENTINEL SUPERVISOR MIDDLEWARE │
│ • Pre-Flight Grounding Lock • Loop & Thrashing Tripwire│
│ • 20/80 Smart Log Truncation • Step Budget Enforcer │
└──────────────────────────┬─────────────────────────────────┘
│
┌──────────────────┴──────────────────┐
▼ ▼
┌─────────────────────────────┐ ┌──────────────────────────┐
│ KILO COGNITIVE CORTEX │ │ SAFE EXECUTION │
│ • 4-Tier Adaptive Gating │ │ • Atomic File Writers │
│ • Tree-of-Thoughts DAG │ │ • AST-Safe File Editors │
│ • 5-Whys Diagnostic Engine │ │ • Filtered Command Exec │
│ • 180 Curated Skills │ └──────────────────────────┘
└──────────────┬──────────────┘
▼
┌─────────────────────────────┐
│ SQLITE ATOMIC MEMORY │
│ • FTS5 BM25 Search Engine │
│ • Self-Authoring Skills │
│ • Cross-Session Knowledge │
└─────────────────────────────┘The C4 5-Gate Lifecycle
Every non-trivial coding task proceeds through a verifiable state machine:
flowchart LR
G1["<b>Gate 1: Grounded Probe</b><br/>• BM25 Memory Recall<br/>• Exploratory Read"]
G2["<b>Gate 2: Cognitive Reasoning</b><br/>• 3-Option ToT DAG<br/>• Adversarial Grill<br/>• 5-Whys Root Cause"]
G3["<b>Gate 3: Approval</b><br/>• Plan Locked<br/>• Skills Injected"]
G4["<b>Gate 4: Execution</b><br/>• Defense-in-Depth<br/>• Sentinel Guarded"]
G5["<b>Gate 5: 4D QA</b><br/>• Empirical Tests<br/>• SQLite Reflection"]
G1 --> G2
G2 --> G3
G3 --> G4
G4 --> G5
G4 -.->|3x Loop Detected| Breaker["🛑 Circuit Breaker<br/>(Supervised Reset)"]
Breaker -.-> G1Gate 1 (Grounded Probe): Recalls relevant past lessons via BM25 ranking and performs read-only codebase reconnaissance.
Gate 2 (Cognitive Reasoning): Formulates a 3-option trade-off hypothesis DAG (
kilo_think_step) and conducts adversarial stress-testing (kilo_grill_plan).Gate 3 (Approval & Skills): Locks the implementation plan and injects domain-specific expert workflows (
kilo_get_skill).Gate 4 (Guarded Execution): Performs surgical code edits backed by atomic writes and syntax validation.
Gate 5 (Empirical QA & Reflection): Validates changes with automated test runners and Playwright before persisting lessons into SQLite memory.
💻 IDE Integration Guide
Kilo-Kit integrates natively into any MCP-compliant editor or CLI agent.
Client | Configuration Path | Command Configuration |
Cursor IDE |
|
|
GitHub Copilot |
|
|
Claude Code & Desktop |
|
|
Windsurf IDE |
|
|
Google Antigravity & Gemini CLI |
|
|
OpenCode |
|
|
⚡ Core Capabilities
1. 🚦 4-Tier Adaptive Task Gating
Replaces rigid one-size-fits-all rituals with task-calibrated execution paths:
Tier 0 (Inspect): Read-only exploration, file searches, regex grep. Immediately ready with zero gate friction.
Tier 1 (Micro-fix): Single-line bug fixes, typo corrections, linter remediations. Fast-path authorization with lightweight validation.
Tier 2 (Feature): Multistage feature implementation and refactoring. Requires Tree-of-Thoughts DAG planning and skill injection.
Tier 3 (Critical): Database migrations, auth workflows, cross-cutting architectural changes. Enforces adversarial red-team grilling and human-in-the-loop checkpoints.
2. 🔍 SQLite FTS5 with BM25 Lexical Ranking
Persistent memory engineered for instant recall:
Sub-millisecond full-text retrieval across thousands of past trajectories, decisions, and reflections.
Native BM25 relevance ranking surfaces verified past bug fixes before planning starts.
Prevents agents from repeating mistakes made in previous sessions or branches.
3. ✍️ Self-Authoring Skills & Autonomous Evolution
Turns every hard-won bug fix into persistent institutional knowledge:
Upon resolving complex edge cases, Gate 5 reflections automatically synthesize reusable
SKILL.mdinstruction files.New skills are dynamically indexed and discoverable across all connected agents via
kilo_get_skill.
4. 🛡️ Kilo-Sentinel Loop & Thrashing Tripwire
Real-time supervisor middleware that protects developer credits and context:
Blocks file modifications on unread files (enforces grounding).
Detects repeated identical tool calls and edit thrashing, cutting off execution before runaway token burns occur.
Offloads complete execution transcripts to disk while enforcing concise, information-dense summaries.
🧰 MCP Tools Suite (24 Tools)
Kilo-Kit provides a comprehensive, battery-included suite of cognitive and execution tools:
Group | Tool | Description |
Orchestration & Memory |
| Enforces C4 lifecycle gates and 4-tier task classification. |
| Routes intent to optimal workflow chains and task modes. | |
| Loads curated | |
| High-precision keyword and semantic search across 180 skills. | |
| Inspects stored SQLite facts, reflections, and session state. | |
| Pins immutable architectural guidelines and ADRs into SQLite. | |
| Persists session lessons and indexes successes into BM25. | |
| Audits skill catalog for schema and structure conformance. | |
Cognitive Reasoning |
| Tree-of-Thoughts DAG reasoning with 3-option trade-off matrix. |
| Adversarial Red-Team stress testing (inversion & simplification). | |
| 5-Whys diagnostic engine with recursive causal back-propagation. | |
| Grounded synthesis combining memory, GitHub context, and DAGs. | |
| Compresses conversation state by 40-70% while locking invariants. | |
| Distills complex resolved patterns into new reusable skills. | |
Supervisor & Sentinel |
| Inspects circuit breaker state, grounded files, and step budget. |
| Resets tripped circuit breaker with mandatory causal explanation. | |
| Audits solution trajectory against established industry patterns. | |
Safe Execution Limbs |
| Safe reading with line slicing, size capping, and boundary checks. |
| Atomic write protected by Grounding Lock, code smell & secret checks. | |
| AST-aware target replacement with bracket & syntax validation. | |
| Guarded command execution with security filters and 20/80 truncation. | |
| High-speed glob pattern searching across workspaces. | |
| Line-by-line regex and pattern matching across repositories. | |
| Telemetry report on routing confidence, skill selection, and weights. |
📚 Curated Skills Catalog (180 Skills)
Domain-specific expert engineering workflows bundled directly into the engine:
engineering/(39 skills): Clean code standards, backend APIs, Next.js App Router, React patterns, Tailwind CSS v4, Better-Auth, ASP.NET Core, database schema design.problem-solving/(24 skills): Systematic debugging, 5-Whys root cause tracing, collision-zone thinking, inversion exercise, scale game, simplification cascades.productivity/(33 skills): Spec-driven development, TDD workflows, peer code review, plan writing, verification before completion, subagent delegation.agent-frameworks/(26 skills): Agent memory, agentic RAG, multi-agent orchestration, context optimization, workflow state machines, MCP agent patterns.security/(22 skills): AI guardrails, OWASP vulnerability scanner, red-team tactics, defense-in-depth validation, secret scanning.devops-cloud/(36 skills): Cloudflare edge deployment, Docker containers, server management, performance profiling, Playwright automated testing.
Fuzzy Alias Support: Calling kilo_get_skill("tdd"), kilo_get_skill("clean-code"), or kilo_get_skill("debugging") automatically resolves to the canonical skill path without requiring directory prefixes.
📊 Empirical Verification & Quality Benchmarks
Metric | Vanilla Agent (Prompt Only) | With Kilo-Kit | Enforcement Mechanism |
Silent Chained Tool Calls | 65% of turns (empty text) | 0% (100% Narrated) | Inter-Tool Narration Badge & Guard |
Ungrounded Blind Edits | 42% of sessions | 0% (100% Blocked) | Pre-Flight Grounding Lock |
Infinite Thrashing Loops | Frequent on hard test failures | Terminated at 3 repeats | Kilo-Sentinel Circuit Breaker |
Token Longevity | Degrades at >30k tokens | Sustained >150k tokens | Smart 20/80 Truncation & Compaction |
Cross-Session Memory | 0% (Total amnesia) | Sub-ms BM25 Recall | SQLite FTS5 Lexical Ranking Engine |
Verification Rigor | Self-declared "everything works" | 100% Empirical Tests | Native Test Runner & Playwright Gate |
🧪 Development & Testing
# Clone repository
git clone https://github.com/VoDaiLocz/KILO-KIT.git
cd KILO-KIT
# Build TypeScript package
npm --prefix mcp install
npm --prefix mcp run build
# Link globally for local testing
npm link
# Run complete Vitest suite (16 files, 77 tests)
npm --prefix mcp test
# Run full 18-point system diagnostics
kilo-kit-doctor
# Validate all 180 skills against YAML schema standards
node src/tools/validate-skill.js --all skills📄 License
Distributed under the Apache 2.0 License. See LICENSE for details.
Available Tools
24 toolskilo_benchmark_solutionBenchmark Solution Against Industry & GitHubBRead-only
Audit the current session trajectory against open-source GitHub standards and industry best practices. Returns alignment score or triggers re-planning.
Inputs: sessionId (required), proposedApproach (required), industryBestPractice (required), format, +2 more.
kilo_compact_contextCognitive Context CompactorARead-onlyIdempotent
Compacts verbose logs, test dumps, and noisy output by 40-70% while preserving architectural invariants.
Inputs: content (required), format, sessionId, targetReduction, +1 more.
kilo_edit_fileEdit File (Kilo-Kit Hard-Gated)ADestructive
Perform exact targeted search-and-replace edit on an existing file with AST check. PROTOCOL HARD-GATE: Requires valid sessionId in 'ready' state.
Inputs: sessionId (required), targetContent (required), replacementContent (required), file, +6 more.
kilo_get_skillLoad Kilo-Kit SkillBRead-onlyIdempotent
Load a Kilo-Kit skill by name or category/skill. Supports fuzzy aliases (e.g. 'brainstorming', 'diagnose', 'playwright', 'tdd', 'productivity/brainstorming').
Inputs: skill (required), format, category, maxChars, +1 more.
kilo_grep_codeGrep Code (Kilo-Kit)BRead-onlyIdempotent
Search code snippets and matching lines across workspace files.
Inputs: query, format, search, isRegex, +5 more.
kilo_grill_planRed-Team Plan GrillingCRead-onlyIdempotent
Automated adversarial stress-testing against Inversion, Simplification Cascades, Blast Radius, and Edge-cases.
Inputs: plan (required), depth, label, format, +4 more.
kilo_memory_reportKilo-Kit C4 Memory ReportBRead-onlyIdempotent
Read global C4 memory facts, decisions, and recent suggestions.
Inputs: format.
kilo_orchestrate_taskKilo-Kit C4 Orchestrate TaskARead-only
MANDATORY: Call this tool FIRST before diagnosing, debugging, analyzing, creating, or modifying any code, UI, backend, or project files. Determines task mode, selects required workflow skills, enforces brainstorming gating, and orchestrates the execution flow.
Inputs: task, format, prompt, answers, +7 more.
kilo_read_fileRead File (Kilo-Kit Safe Workspace I/O)BRead-onlyIdempotent
Read file content safely across workspace boundaries (supports line ranges and byte capping up to 512KB).
Inputs: file, path, format, endLine, +4 more.
kilo_record_reflectionRecord Learning Reflection & Self-ImprovementB
Record correct approaches, wrong paths/pitfalls encountered, skill ratings, and lessons learned into SQLite to drive Kilo-Kit's continuous self-improvement across sessions.
Inputs: taskMode (required), taskSummary (required), lessonsLearned (required), correctApproach (required), +5 more.
kilo_remember_factRemember Architecture & Policy FactAIdempotent
Explicitly persist a project operating rule, workflow default, or verification standard into SQLite memory_facts for cross-session enforcement.
Inputs: key (required), kind (required), value (required), format, +2 more.
kilo_reset_circuit_breakerReset Circuit Breaker (Supervised)ADestructive
Reset an open Circuit Breaker with justification and root-cause evidence. Transitions breaker to HALF_OPEN.
Inputs: sessionId (required), justification (required), format.
kilo_route_intentRoute Current Intent to SkillsBRead-onlyIdempotent
Recommend the best Kilo-Kit skills for any user request, bug fix, feature, UI task, or coding issue. Call before selecting or executing a workflow skill.
Inputs: message (required), limit, format, context.
kilo_route_reportKilo-Kit Route ReportBRead-onlyIdempotent
Summarize route telemetry: top skills, task modes, workflow chains, score averages, and conflict penalties.
Inputs: format.
kilo_run_commandRun Command (Kilo-Kit Hard-Gated)ADestructive
MANDATORY: Execute a terminal command with security guardrails and timeout. Use this INSTEAD OF native Bash/terminal tools. PROTOCOL HARD-GATE: Requires valid sessionId in 'ready' state.
Inputs: command (required), sessionId (required), cwd, format, +3 more.
kilo_search_filesSearch Files (Kilo-Kit)BRead-onlyIdempotent
Search for files matching a pattern, substring, or glob across the workspace.
Inputs: glob, query, format, pattern, +3 more.
kilo_search_skillsSearch Kilo-Kit SkillsARead-onlyIdempotent
Search the Kilo-Kit skill library by natural-language query. Use this for broad discovery before loading a specific skill.
Inputs: query (required), limit, format, category.
kilo_sentinel_statusKilo-Sentinel Supervisor StatusBRead-onlyIdempotent
Inspect real-time Sentinel supervisor telemetry: Circuit breaker state, step budget, failure streaks, and grounded files list.
Inputs: sessionId (required), format.
kilo_synthesize_skillSynthesize Self-Evolving SkillADestructive
Distill a newly solved architectural pattern or bugfix methodology into a reusable, validated SKILL.md.
Inputs: skillName (required), solutionPattern (required), problemDescription (required), verificationGuidance (required), +3 more.
kilo_think_stepSequential Thinking & BranchingBRead-only
Iterative step-by-step reasoning engine with hypothesis tracking, revision, and solution branching.
Inputs: thought (required), thoughtNumber (required), totalThoughts (required), nextThoughtNeeded (required), +10 more.
kilo_trace_root_cause5-Whys Root Cause TracerBRead-onlyIdempotent
Recursive causal backward-propagation analysis from crash log to the underlying systemic root cause.
Inputs: errorLog (required), label, format, sessionId, +5 more.
kilo_triangulate_researchGrounded Cognitive Triangulation & Low-Confidence EscalatorB
Execute Triangulated Cognitive Synthesis: Combines Internal SQLite Memory, External GitHub Grounding, 3-Option ToT DAG Trade-Offs, and Low-Confidence Research Escalation. Persists reasoning atomically into SQLite before code modification.
Inputs: sessionId (required), dagOptions (required), chosenOption (required), confidenceScore (required), +9 more.
kilo_validate_skillsValidate Kilo-Kit SkillsCRead-onlyIdempotent
Run the Kilo-Kit skill validator and return a concise quality-gate summary. This is read-only and does not modify files.
Inputs: format.
kilo_write_fileWrite File (Kilo-Kit Hard-Gated)ADestructive
Create a new file or overwrite an existing file. PROTOCOL HARD-GATE: Requires valid sessionId in 'ready' state.
Inputs: content (required), sessionId (required), file, path, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 24 tools
Several clusters overlap: kilo_orchestrate_task and kilo_route_intent both select/recommend skills, kilo_search_skills vs kilo_get_skill is a discovery-vs-load split that's easy to confuse, and the reasoning family (kilo_think_step, kilo_triangulate_research, kilo_trace_root_cause, kilo_grill_plan, kilo_benchmark_solution) has fuzzy boundaries. Descriptions do help distinguish file ops and memory tools, but an agent could misselect among the reasoning/routing tools.
All 24 tools use a consistent kilo_ prefix followed by a verb_noun pattern (read_file, write_file, route_intent, record_reflection, reset_circuit_breaker). No camelCase or style mixing, and noun suffixes are predictable.
24 tools is heavy for a single server and pushes into the 16-25 'feels heavy' band. While the kit genuinely spans distinct areas (files, memory, skills, reasoning, routing), several reasoning tools could plausibly be consolidated.
Coverage is broad—file CRUD, command execution, skill search/load/synthesize/validate, memory persistence, routing, and reasoning. However, kilo_write_file, kilo_edit_file, and kilo_run_command all require a valid sessionId in 'ready' state, yet no tool exists to create or open a session, creating a potential dead-end for agents.
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
Hosted MCP server and Agent Skills for specs, engineering threads, and project memory.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseDqualityDmaintenanceAI-native orchestration layer with 80+ tools for task management, code editing, browser automation, terminal control, and persistent memory across CLI, local MCP, and cloud deployments.692 npm31ISC
- AlicenseNot gradedqualityBmaintenanceA cross-platform local AI-agent runtime and MCP gateway that exposes 279 tool definitions (267 advertised by default) for local files, Git, processes, Windows automation, WSL, browser control, Office semantic automation, and extensibility. It enables durable goal continuation, Engineering Harness workflows, context capsules, indexing, and resource-aware concurrent agent tasks through a single governed MCP connection.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to research topics, map and analyze codebases across 35+ languages, curate project context, and generate PRDs, user stories, task lists, and fullstack starter projects. It also supports multi-step workflow execution and AI-native task management through a CLI, interactive REPL, or MCP client integration.69 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to research topics, map and analyze codebases across 35+ languages, curate context, and generate requirements documents, user stories, task lists, and full-stack starter projects. It also supports multi-step workflow execution and AI-native task management through a CLI, interactive REPL, or MCP client integration.69 npmMIT