Imported from VoDaiLocz/kilo-kit-mcp (
AGENTS.md). Install upstream withnpx skills add VoDaiLocz/kilo-kit-mcp. Copyright stays with the author.
Kilo-Kit C4 v3.0 Cognitive Protocol
Applies to: Antigravity, Gemini CLI, Claude Code, OpenAI Codex
🧠 DIVISION OF LABOR (VỎ NÃO & CHÂN TAY):
- Kilo-Kit MCP (Cortex): High-level cognitive reasoning, 5-Whys root cause tracing, Tree-of-Thoughts DAG planning, adversarial red-teaming, context compaction, skill delivery, and SQLite learning memory.
- Execution Limbs: Perform surgical changes with defense-in-depth using your native tools or Kilo-Kit tools with Kilo-Sentinel supervision.
🏛️ MANDATORY 5-GATE COGNITIVE PROTOCOL:
-
Gate 1 (Hard-Gate & Grounded Probe):
- Call MCP tool
kilo_orchestrate_taskwith the user's request as your FIRST action. - Perform read-only exploratory probing (
view_file,grep_search, orkilo_read_file) to build a Grounded Diagnostic Model.
- Call MCP tool
-
Gate 2 (Substantive Cognitive Reasoning & Benchmarking):
- For Features / Architecture: MUST call
kilo_think_step(DAG with 3 trade-off options) andkilo_grill_plan(Adversarial Red-Team stress test). Callkilo_benchmark_solutionto audit against industry standards. - For Bugs / Errors: MUST call
kilo_trace_root_causewith{ errorLog, failingFile }to extract the 5-Whys causal chain before writing any fix. - For Context Overload (>4 files read): Call
kilo_compact_contextto lock invariants and prevent attention degradation.
- For Features / Architecture: MUST call
-
Gate 3 (Approval & Skill Delivery):
- Call
kilo_orchestrate_taskwithbrainstormingApproved=true. - Load required workflow skills using
kilo_get_skill(supports aliases likebrainstorming,diagnose,playwright,tdd,clean-code). - (Optional) Check supervisor status via
kilo_sentinel_status.
- Call
-
Gate 4 (Surgical Implementation & Defense-in-Depth):
- Apply
problem-solving/defense-in-depth(validation at input, logic, and persistence layers). - Maintain
engineering/clean-codestandards with zero bloat.
- Apply
-
Gate 5 (4D Quality Assurance & Reflection):
- Dimension 1 (Spec Fidelity): Verify against user requirements using Given-When-Then acceptance criteria (
productivity/spec-driven-development). - Dimension 2 (Clean Code): Verify deep module interfaces and zero dead code (
engineering/clean-code). - Dimension 3 (UX & Aesthetics): Verify responsive layout and mobile touch safety (
design/aesthetic,design/mobile-design). - Dimension 4 (Empirical & Playwright): Run compile/build commands AND execute tests before claiming completion.
- Continuous Reflection: Call
kilo_record_reflectionwith sessionId to persist lessons learned into SQLite memory.
- Dimension 1 (Spec Fidelity): Verify against user requirements using Given-When-Then acceptance criteria (
📢 MANDATORY INTER-TOOL NARRATION (ZERO SILENT CHAINS):
- Iron Law: NEVER execute consecutive tool calls without printing a 1-2 sentence intermediate update directly to the user. The terminal user CANNOT inspect internal MCP return payloads.
- Micro-Narration Protocol before issuing next tool call:
[DECISION]:State what you just concluded, selected, or verified cụ thể.[NEXT]:State what tool you are calling next and for what purpose.