# Coder Agent - Multi-agent system for code implementation # # This configuration defines a quorum with a planner agent that coordinates # a specialized coder agent for implementation tasks. [quorum] cwd = "." db = "/tmp/test.db" delegation = true verification = false snapshot_policy = "diff" delegation_wait_policy = "all" delegation_wait_timeout_secs = 120 delegation_cancel_grace_secs = 5 max_parallel_delegations = 5 [planner] provider = "anthropic" model = "claude-opus-4-5" #provider = "codex" #model = "gpt-5.2-codex" tools = ["delegate", "create_task", "todowrite", "todoread", "question", "search_text", "glob", "ls", "index", "read_tool", "shell"] system = [ { file = "../prompts/default_system.txt" } ] # Middleware for planner # Context middleware warns when approaching token limits [[planner.middleware]] type = "context" warn_at_percent = 80 fallback_max_tokens = 32000 [[planner.middleware]] type = "agent_mode" default = "plan" reminder = """ # Plan Mode - System Reminder ## Your Role: Orchestrator You are the **planner and orchestrator**. Your hands are tied — YOU personally must not edit files, run mutating shell commands, or make any direct changes to the system. However, your PRIMARY job is to **delegate implementation work to specialized agents**. **Read-only constraint applies to YOU, not your delegates.** When you delegate to the `coder` agent, that agent WILL edit files, write code, and make changes — that is exactly what it's for, and that is expected and correct. ## What You MUST Do 1. **Explore & understand** — Use read-only tools and delegate exploration tasks to gather the context needed. 2. **Plan** — Break the work into concrete, actionable implementation tasks. 3. **Delegate implementation** — Use the `delegate` tool to assign each implementation task to the `coder` agent with a clear objective, context, and expected output. Do NOT attempt to do the implementation yourself. Do NOT stop at just having a plan. 4. **Verify & iterate** — After a delegate completes, review the results and delegate follow-up work if needed. ## What You MUST NOT Do - Do NOT edit files yourself (no sed, tee, echo, cat, write_file, edit, etc.) - Do NOT run mutating shell commands yourself - Do NOT stop at exploration and planning — a plan without delegation is incomplete - Do NOT use explore-only delegation when implementation is needed ## Anti-Pattern Warning If you find yourself only delegating exploration/search tasks and never delegating to the `coder` agent for actual implementation, you are doing it wrong. The user wants code changes, not just analysis. Your plan is only valuable when it results in delegated implementation work. --- Ask the user clarifying questions or for their opinion when weighing tradeoffs. Don't make large assumptions about user intent. """ # Optional: Detect duplicate code patterns # [[planner.middleware]] # type = "dedup_check" # threshold = 0.8 [quorum.delegation_summary] provider = "anthropic" model = "claude-3-5-haiku-20241022" [[delegates]] id = "coder" provider = "llama_cpp" model = "qwen3-coder-30b" description = "Specialized in implementation and code writing" capabilities = ["rust", "python"] tools = ["question", "edit", "todowrite", "todoread", "glob", "search_text", "ls", "index", "shell", "read_tool", "write_file"] system = [ { file = "../prompts/anthropic_opencode.txt" } ] #[delegates.parameters] model = "unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Qwen3-Coder-30B-A3B-Instruct-UD-Q6_K_XL.gguf" n_ctx = 120000 max_tokens = 8192 flash_attention = "enabled" kv_cache_type_k = "q8_0" kv_cache_type_v = "q8_0" # Middleware for coder delegate # Apply same limits as planner [[delegates.middleware]] type = "limits" max_steps = 100 max_turns = 30 [[delegates.middleware]] type = "context" warn_at_percent = 70 fallback_max_tokens = 110000 # Detect when code is similar to existing code [[delegates.middleware]] type = "dedup_check" threshold = 0.85 min_lines = 10