koi
Documentation / architecture

System overview

Koi is a set of tools that keep a long engineering change in the repository instead of in a chat. This page names each part, says what it owns, and shows how the parts meet.

The problem Koi solves

A coding agent forgets everything when its chat ends. A change that takes twenty sessions, such as a framework migration, needs somewhere to keep the plan, the decisions, and the position reached so far. Koi keeps all of that in files under .koi/ in your repository. Any agent, in any session, can read those files and carry on. That is what lets a run go on unattended, phase after phase.

The parts

Koi is the name of the whole system, of the .koi/ folder convention, and of the koi command that installs and checks everything. The work is done by five parts.

Part What it is What it owns
koi A Rust program, the koi binary, from koi-installer.sh Installing the skills and yokai at one version (koi setup), updates (koi update), diagnostics (koi doctor), and the board commands Junji and Yokai's turns call (koi board status, koi board move)
Junji A skill you install into your coding agent with koi setup The method: the twelve verbs, the plan, the board, the notes, the verification commands in CONTEXT.md
Yokai A Rust program, the yokai binary Unattended execution: picking the next phase, running it through an agent, checking the result on disk, recovery, the cockpit
Tori A Rust library inside Yokai The connection to the agent over the Agent Client Protocol (ACP), one turn at a time
The agent Claude Code, Codex, Cursor CLI or OpenCode Reading code, editing files, running commands, committing

You can use Junji alone. You type /junji next in your agent and it runs one phase while you watch. Yokai is optional. It reads the same files and runs the phases for you, with a second agent turn reviewing each change and scripts on disk deciding whether it passed.

All of it lives in one repository, getkoi/koi: the skills in skills/, Yokai and Tori in crates/, this site in site/ and the decision records in docs/adr/. A release has one version and one tag, so koi 1.0.0, Yokai 1.0.0 and the 1.0.0 skills come from the same commit. koi and yokai ship as binaries, next to a koi-skills.tar.gz archive that koi setup copies the skills from; koi board and Yokai share one board implementation.

Two ways to drive the same files
How Junji, Yokai, Tori and the coding agent connect You type Junji verbs into your coding agent, which loads the Junji skill. Yokai can drive the same agent instead: Yokai sends turns through Tori, and Tori talks to the agent over ACP. In both cases the agent edits code and commits to the repository, moves board cards in BOARD.json through the koi CLI, and Yokai reads and verifies the repository after each phase. You /junji verbs Junji skill Coding agent Tori · ACP turns, events Yokai supervisor edits, commits reads, verifies koi CLI BOARD.json Repository: code, .koi/, Git history

The repository is the only thing the parts share. Junji never calls Yokai and Yokai never calls Junji. Both move board cards through the same code, koi board for agents and Yokai's built-in copy of it. Yokai does not even need the Junji skill installed: it reads .koi/run/BOARD.json, the phase plans and CONTEXT.md as plain files. That is why you can plan in one agent on your laptop and run phases with Yokai on another machine.

Who writes what

Each file has one owner. This keeps two tools from fighting over the same field.

  • Junji writes the method documents: PLAN.md or PLAN.html, CONTEXT.md, METHOD.md, BOARD.json, NOTES.md and phases/.
  • Yokai writes its own settings (.koi/yokai.yml), the reviewed sensor scripts in .koi/sensors/, and its run records (ledger.jsonl, sessions.jsonl, FEEDBACK.md, saves/).
  • Yokai also updates the board while it runs a phase. It changes a card's status and, after a human approves it, the card's yokai object with the model tier. Junji keeps that object intact when it edits the card.
  • The agent writes product code and commits it.

What lives in .koi/ lists every file.

A project from start to finish

  1. /junji begin creates .koi/run/ and records what the repository already has: languages, test commands, skills.
  2. /junji plan agrees on the change with you and writes the verification commands every phase must pass.
  3. /junji refine splits the plan into phases, stored as cards in BOARD.json.
  4. Each phase runs through /junji next in your agent, or through yokai. Either way the phase ends with passing checks and a commit.
  5. /junji consolidate turns the run into one document in your repository's spec folder and deletes .koi/run/. Settings and sensors in .koi/ stay for the next change.

Work across sessions follows this path in detail.