Original prompts and agent architecture by Galih Tama <galpt@v.recipes>.
Note
This project is still a work in progress and requires Kilocode v7.2.4 or newer to work reliably. It has been tested heavily with the MiniMax-M2.7 model — smarter models (e.g., Opus or GPT-5.4) may work out of the box, but less capable models may not behave as the README describes.
Import all agents at once via the Settings import flow.
In Kilocode:
- Open
Settings - Go to
About - Click
Import Settings - Select
agents.json - Save the config
Notes:
- This merges the bundle onto your existing config — existing settings are preserved
- Unknown top-level keys (such as
$schema) are ignored by the importer - After import,
ceobecomes the default agent
Import agents one at a time for a lighter setup.
In Kilocode:
- Open
Settings - Go to
Agent Behaviour - Open the
Agentssub-tab - Click
Import - Select one file from
agent-imports/
Note:
- The Agents import UI accepts one agent at a time
- Agent name must be unique (not already in your config)
v3 improved over ad-hoc single-agent workflows by introducing explicit pipeline stages and review quorums. However, it still relies primarily on prompt engineering — optimizing the instruction template — rather than engineering the context that goes into the template.
The problem: a well-engineered prompt with the wrong or poorly-gathered context still produces wrong results. The context is the what and when; the prompt is the how.
Every task starts with context gathering, not prompt writing. The pipeline treats context engineering as a distinct phase with dedicated tooling.
- Context Engineer: gathers and synthesizes what's relevant
- Solutions Architect: designs the solution given the gathered context
- Implementer: executes within the designed context
- Reviewer: independently verifies against source-of-truth
Every significant decision passes through visible review with explicit approval gates. No black-box autonomous decisions.
From requirement -> context -> design -> implementation -> verification -> delivery, with explicit checkpoints and remediation loops.
Context is dynamically filtered based on what's relevant for the current stage, not dumped all at once. Each pipeline stage receives only the context it needs.
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#1a1a2e', 'primaryTextColor': '#eaeaea', 'primaryBorderColor': '#4a4a6a', 'lineColor': '#7fdbca', 'secondaryColor': '#16213e', 'tertiaryColor': '#0f3460', 'fontFamily': 'Inter, system-ui, sans-serif', 'fontSize': '14px'}}}%%
flowchart TB
subgraph INPUT["📥 Input"]
direction TB
USER["👤 User Request"]
end
subgraph CORE["⚙️ Core Pipeline"]
direction TB
T0["🔍 Requirement Triage"]
T1["📚 Context Gathering"]
T2["🏗️ Design"]
T3["⚡ Implementation"]
T4["🔗 Integration"]
T5["✅ Independent Review"]
T6["🔄 Remediation"]
T7["📤 Delivery"]
end
subgraph OUTPUT["📤 Output"]
direction TB
RESULT["✅ Delivered Result"]
ARTIFACTS["📁 Context Cache"]
end
USER --> T0
T0 --> T1
T1 --> T2
T2 --> T3
T3 --> T4
T4 --> T5
T5 -->|"Findings"| T6
T6 -->|"Gates Pass"| T7
T7 --> RESULT
T7 --> ARTIFACTS
T0:::triage
T1:::context
T2:::design
T3:::impl
T4:::integrate
T5:::review
T6:::remediate
T7:::deliver
classDef triage fill:#1e3a5f,stroke:#3b82f6,stroke-width:2px,color:#bfdbfe
classDef context fill:#1a4a4a,stroke:#06b6d4,stroke-width:2px,color:#a5f3fc
classDef design fill:#3b2d5f,stroke:#8b5cf6,stroke-width:2px,color:#ddd6fe
classDef impl fill:#1a4a2d,stroke:#22c55e,stroke-width:2px,color:#bbf7d0
classDef integrate fill:#4a3a1a,stroke:#f59e0b,stroke-width:2px,color:#fef08a
classDef review fill:#fff7ed,stroke:#f97316,stroke-width:2px,color:#9a3412
classDef remediate fill:#fef2f2,stroke:#dc2626,stroke-width:2px,color:#991b1b
classDef deliver fill:#1a4a3a,stroke:#10b981,stroke-width:2px,color:#a7f3d0
| Stage | Agent | Output | Gate |
|---|---|---|---|
| 0. Triage | requirement-triage |
Classification: TRIVIAL / BOUNDED / COMPLEX | — |
| 1. Context | context-engineer |
Context Brief | — |
| 2. Design | solutions-architect |
Design Document (COMPLEX) / Plan | Review for COMPLEX |
| 3. Implement | implementer |
Code + Verification | — |
| 4. Integrate | integrator |
Connected Slices | — |
| 5. Review | QA / Fidelity / Security / Performance | Findings Report | Block on HIGH |
| 6. Remediate | remediator |
Fixed Code | Loop until CLEAR |
| 7. Deliver | delivery-manager |
Accepted Result | — |
graph TD
User(["👤 User"]) -->|"🎯 Single Prompt"| CEO
subgraph CEO["🎯 CEO Orchestrator"]
A["🔍 Requirement Triage"] --> B["📚 Context Brief"]
B --> C["🏗️ Design Doc"]
end
C --> D["⚡ Implementer"]
D --> E["🔗 Integrator"]
E --> F["✅ QA Reviewer"]
F -->|"✅ Pass"| Delivery
F -->|"❌ Findings"| Remediator
Security["🔒 Security Reviewer"] --> Remediator
Fidelity["📐 Fidelity Reviewer"] --> Remediator
Perf["⚡ Performance Reviewer"] --> Remediator
Remediator -->|"🔄 Fixed Code"| E
Remediator -->|"✅ All Clear"| Delivery
Delivery["📤 Delivery Manager"] -->|"📤 Delivered"| User
classDef stage fill:#e0f2fe,stroke:#3b82f6,stroke-width:2px,color:#1e40af
classDef review fill:#fff7ed,stroke:#f97316,stroke-width:2px,color:#9a3412
classDef remediate fill:#fef2f2,stroke:#dc2626,stroke-width:2px,color:#991b1b
classDef deliver fill:#d1fae5,stroke:#059669,stroke-width:2px,color:#065f46
classDef user fill:#e0e7ff,stroke:#6366f1,stroke-width:3px,color:#312e81
class CEO,A,B,C,D,E,F stage
class Security,Fidelity,Perf review
class Remediator remediate
class Delivery,User deliver
class User user
- Blue nodes — core pipeline stages
- Orange nodes — review agents
- Red node — remediation loop
- Green node — final delivery
The user sends a single prompt to ceo. ceo orchestrates the entire pipeline, delegating to specialists and reviewers as needed, with explicit remediation loops until all gates pass.
Agent: requirement-triage
- Classifies task as TRIVIAL / BOUNDED / COMPLEX
- Determines required pipeline depth based on risk classification
- Sets context quality bar: what additional context is needed before proceeding
Agent: context-engineer
- Gathers relevant context from:
- Repo structure and conventions (via
repo-explorer) - Existing documentation, specs, requirements, and
AGENTS.mdif present - Relevant code, APIs, patterns
- External knowledge (web fetch for libraries, docs)
- Git history for similar changes
- Repo structure and conventions (via
- Synthesizes context into a Context Brief — a focused, stage-specific document that narrows what matters
- The context pipeline automatically ingests repo-level agent definitions (like
AGENTS.md) at task start, providing the system with a shared understanding of available capabilities and conventions.
Agent: solutions-architect
- Translates the Context Brief + user request into a concrete technical plan
- Applies Specification Mode: explicit planning before implementation — defines file-by-file change scope, interfaces, migration considerations, invariants, and failure modes before any code is written
- For COMPLEX tasks, creates a Design Document reviewed by
scrum-masterandproduct-manager - Design review is a first-class gate, not optional — no implementation begins on COMPLEX tasks until the Design Document passes review
Agent: implementer
- Takes the Design Document + Context Brief
- Implements in atomic, verifiable slices
- Each slice produces: code change + verification evidence + residual risk notes
Agent: integrator
- Connects slices together
- Checks cross-file consistency, imports, interfaces
- Applies review findings with minimal blast radius
qa-reviewer: correctness, regressions, business logic gapsfidelity-reviewer: exactness against source-of-truth when fidelity-sensitivesecurity-reviewer: trust-boundary changesperformance-reviewer: performance constraints, concurrency, memory safety
Agent: remediator
- Addresses review findings
- Re-runs verification
- Ensures every gate passes before advancing
Agent: delivery-manager
- Confirms all acceptance criteria met
- Cleans up temporary artifacts
- Updates context cache for future work on same repo
Primary orchestrator. Entry point for all tasks. Routes to appropriate pipeline stage based on triage. Maintains todo state and continuity summaries.
Classifies the incoming task and determines pipeline depth.
Gathers, synthesizes, and narrows context. Produces a Context Brief. This replaces ad-hoc "inspect repo" steps with structured context engineering.
Enhanced from v3. Works from Context Brief, not raw user request. Produces Design Document for COMPLEX tasks, directly actionable plan for BOUNDED.
Takes Design Document + Context Brief, implements in verifiable slices.
Connects slices, applies review fixes, guards cross-file consistency.
Handles remediation loops after review findings. Replaces ad-hoc remediation loops previously embedded in ceo.
Final verification, artifact cleanup, acceptance confirmation.
Now operates on Context Brief + Design Document, not just code diff.
Checks against source-of-truth: spec, UI, protocol, algorithm, expected output.
Trust-boundary changes.
Concurrency, memory, resource constraints for structural changes.
Now works from triage classification + context, not just user request.
Context-aware requirement analysis.
Now feeds into context-engineer as a context source.
├── agents.json # Full config bundle (import this)
├── agent-imports/ # Individual agent files (for one-by-one import)
│ ├── ceo.agent.json
│ ├── requirement-triage.agent.json
│ ├── context-engineer.agent.json
│ ├── solutions-architect.agent.json
│ ├── implementer.agent.json
│ ├── integrator.agent.json
│ ├── remediator.agent.json
│ ├── delivery-manager.agent.json
│ ├── qa-reviewer.agent.json
│ ├── fidelity-reviewer.agent.json
│ ├── security-reviewer.agent.json
│ ├── performance-reviewer.agent.json
│ ├── scrum-master.agent.json
│ ├── product-manager.agent.json
│ ├── repo-explorer.agent.json
│ └── devops-engineer.agent.json
├── context/ # Templates for pipeline artifacts
│ ├── context-brief-template.md
│ └── design-doc-template.md
├── old-prompt.md # Legacy v3 prompts (for reference)
├── new-prompt.md
└── README.md
| Aspect | v3 | v4 |
|---|---|---|
| Context | Ad-hoc, prompt-dumped | Engineered, synthesized, narrowed |
| Triage | Implicit in ceo |
Dedicated requirement-triage agent |
| Requirement quality | Referenced in prompts | First-class classification in pipeline |
| Design | Single architect |
solutions-architect with context-aware design |
| Implementation | lead-engineer scoped by task |
implementer scoped by Design Document |
| Review | Post-hoc, code-only | Throughout, context-aware, multi-track |
| Remediation | Implicit loops in ceo |
Dedicated remediator |
| Delivery | End of ceo turn |
Explicit delivery-manager |
| Performance | Absent | performance-reviewer for structural changes |
| Continuity | Todos only | Context cache + resumable summaries |
This version builds on workflow patterns from structured AI code review systems:
- requirement quality matters before business-logic judgments
- context gathering and planning happen before implementation
- review is categorized and explicit, not vague
- delivery is a pipeline with retry and remediation loops, not one heroic agent trying to be flawless
The practical rules behind this setup are:
- the
ceomay act directly for trivial tasks, but should not rely on one heavy-lifting agent for meaningful work - for non-trivial work, the
ceoshould treat delegation as a normal acceleration mechanism, not a last resort - any non-trivial implementation should have at least one independent review lane
- explicit review quorums should govern signoff instead of ad-hoc judgment
- fidelity-sensitive work should include a dedicated source-of-truth review lane, not just a code review lane
- security review is opt-in by relevance, but mandatory for trust-boundary changes
- greenfield work and large-existing-codebase work should both pass through explicit discovery and planning
- subagents inherit the parent agent's effective permission envelope in Kilocode, so the CEO needs enough authority for its delegated workers to actually finish the job
- step budgets should be generous enough to survive planning, remediation, and re-review loops without collapsing halfway through the pipeline
- temporary artifacts should be treated as disposable by default and cleaned up before handoff so the workspace stays professional
- long-running tasks should maintain compact-safe state via todos and resumable summaries so Kilocode auto-compaction does not erase the working memory of the pipeline
This version is designed to be more autonomous in the face of normal failures:
- if one subagent stalls, the
ceoshould retry with a narrower scope, route the task to a better-fit agent, or execute directly when safe - review findings are meant to feed remediation loops, not merely produce commentary
- exactness-sensitive tasks should be checked against a source-of-truth checklist, whether that source is a UI, a spec, a protocol, a scheduler design, an interface contract, or expected output behavior
- the pipeline should pause for a human mainly when permission or a genuinely missing decision is required
- scratch files, temp folders, debug probes, and throwaway helpers should be kept contained and removed before final delivery unless intentionally promoted into the real solution
- resumable summaries and up-to-date todos are part of the workflow so a fresh agent can recover after auto-compaction without starting over blindly
One important runtime nuance:
- Kilocode does not provide magical direct subagent-to-subagent conversation by default
- the intended pattern is CEO-mediated handoff, where the orchestrator passes findings, constraints, and checklists between agents explicitly
- the normal iterative loop is parent → subagent → parent, and longer back-and-forth should reuse the same worker via
task_idinstead of assuming peer chat or nested delegation
This is still intentionally leaner than a full organization chart. The extra roles exist only where they create a real quality gate.
A single prompt to ceo triggers:
requirement-triage→ classify taskcontext-engineer→ produce Context Briefsolutions-architect→ produce Design Document (for COMPLEX)implementer→ implement slicesintegrator→ connect slices- Review queue → (QA, fidelity, security, performance as needed)
remediator→ fix findingsdelivery-manager→ final verification
The user interacts only with ceo. All other agents are orchestrated behind the scenes.
Same as v3 — CC BY 4.0 for prompts, Apache-2.0 for code/config. See LICENSE.