Use Karajan Code (KJ) as the default orchestrator for implementing tasks and fixing bugs in this project.
When asked to implement, fix, or refactor code, use kj_run via MCP instead of editing manually:
- If a Planning Game MCP is available and a task ID is provided, fetch the task context first.
- Run
kj_runwith the task description and defaults below. - If neither KJ MCP nor PG MCP are available, implement directly.
For kj_run, use:
mode: "standard"methodology: "tdd"coder: "claude"reviewer: "codex"reviewerFallback: "claude"maxIterations: 5maxIterationMinutes: 5
- Maximum rigor requested: use
mode: "paranoid". - User explicitly requests no TDD: use
methodology: "standard". - If
kj_runfails, diagnose withkj_doctor/kj_configand retry. - Edit manually only if the user asks or KJ cannot complete the task.
See docs/troubleshooting.md for common issues. Key points:
- Claude as subprocess: Claude Code 2.x requires 3 workarounds when launching
claude -pfrom Node.js: stripCLAUDECODEenv var,stdin: "ignore", read from stderr (not stdout). Seesrc/agents/claude-agent.js->cleanExecaOpts()/pickOutput(). - Interactive wizards: The coder runs without stdin. Tasks requiring
pnpm create astro,npm init, etc. must use--yes/--no-inputflags or report that they cannot complete. - Checkpoint: If
elicitInputreturns null, the session continues (does not stop). Only explicit "stop" or "4" stops it. - Resume:
kj_resumeaccepts stopped, failed, and paused sessions.
User input: "implement the next priority task" Expected action:
- If PG MCP is available, fetch the priority task.
- Run
kj_runwith that task and defaults above. - If no PG MCP, ask the user what to implement.