From agent-trio
Use when the user asks for implementation work, multi-step planning, or wants to follow a structured build → review loop with tracked artifacts. Do NOT use for read-only questions, one-shot guidance, simple code reviews, or any task that does not need a plan or coordination files.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-trio:using-agent-trioThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
<SUBAGENT-STOP>
.trio/plan.md, .trio/handoff.md, .trio/review.md) already exist and the user wants to continue./review or answer inline. Do not create trio artifacts.If in doubt, answer the question first. You can always enter the trio loop later if the task turns out to need it.
Every session with this skill operates in one of three modes. Determine your mode before doing anything else.
| Mode | When | Files you may write |
|---|---|---|
| consult | Read-only question, code review, or one-shot guidance | None |
| plan | User wants a plan or phased approach; execution not yet confirmed | .trio/plan.md, .trio/criteria.md |
| execute | Human has confirmed the plan and wants changes made | All artifact files |
consult — Answer directly. Inspect code, explain behavior, review a diff. Do not create or modify trio artifacts. Exit when done.
plan — Write or update .trio/plan.md and .trio/criteria.md, then stop. Wait for human confirmation before proceeding to execute mode.
execute — The human has confirmed the plan. Run the build → review → learn loop. Write artifacts as directed below.
You are the head agent in a plan → build → review → learn loop. You coordinate, plan, review, and learn. You do not implement directly unless the task is trivial.
.trio/learnings.md./clear, or model switch.If you are in execute mode and .trio/criteria.md does not exist, create it before doing anything else. Write:
## Verification
[How you will confirm the work is correct — commands, checks, behaviors]
## Acceptance criteria
[What "done" looks like for the current task]
## Evidence
[Where the proof lives — test output, URLs, files]
If .trio/learnings.md is empty or only has the starter template, seed it with any lessons you already know about this project.
Follow this loop for every task:
.trio/plan.md with the goal, constraints, done criteria, and task slices. Update .trio/criteria.md with verification and acceptance criteria. Ask the human to confirm before proceeding..trio/handoff.md..trio/handoff.md, delegate review to a reviewer agent. The reviewer reads .trio/criteria.md (never the builder). The reviewer writes .trio/review.md..trio/review.md says APPROVED, update .trio/learnings.md with anything that should change future loops. If REJECTED, loop back to build. If ESCALATE, ask the human.When you wake up without context, read the artifacts to recover state:
.trio/plan.md → you are at step 1. Write one, update .trio/criteria.md, confirm with the human..trio/plan.md exists, no .trio/handoff.md → you are at step 2. Build..trio/handoff.md newer than .trio/review.md → you are at step 3. Review..trio/review.md says APPROVED → you are at step 4. Update .trio/learnings.md, next task or done..trio/review.md says ESCALATE → ask the human.The builder records its outcome in .trio/handoff.md. Route on the status:
| Status | Meaning | Head agent action |
|---|---|---|
DONE | Implementation complete, no concerns | Dispatch reviewer |
DONE_WITH_CONCERNS | Complete but with noted risks or caveats | Dispatch reviewer; add concerns to .trio/criteria.md for reviewer attention |
NEEDS_CONTEXT | Blocked on a missing requirement or decision | Read .trio/handoff.md blockers, resolve with the human, re-dispatch builder |
BLOCKED | External dependency or access problem that the builder cannot resolve | Escalate to the human |
If .trio/handoff.md does not include a status line, treat it as DONE.
The reviewer writes .trio/review.md with one of:
| Status | Head agent action |
|---|---|
APPROVED | Update .trio/learnings.md, advance to next task slice or declare done |
REJECTED | Check ## Retry count in .trio/review.md. If count is 3 or higher, treat as ESCALATE. Otherwise re-dispatch builder; builder reads .trio/review.md for feedback. |
ESCALATE | Ask the human — the reviewer found something that requires human judgment |
A resumed session can recover routing state from artifacts alone using the Resuming rules above combined with these status tables.
| File | You write | Others read |
|---|---|---|
.trio/plan.md | goal, constraints, slices | builder, reviewer |
.trio/criteria.md | verification, acceptance, evidence | reviewer only |
.trio/handoff.md | — (builder writes) | you, reviewer |
.trio/review.md | — (reviewer writes) | you, builder, human |
.trio/learnings.md | durable lessons after each loop | builder, reviewer |
You own .trio/plan.md, .trio/criteria.md, and .trio/learnings.md. The builder owns .trio/handoff.md. The reviewer owns .trio/review.md.
.trio/handoff.md and .trio/review.md are overwritten on each iteration — this is intentional. Token efficiency and workspace clarity matter more than inline history. If your team needs an audit trail of prior rejections, commit the artifacts to version control between iterations.
.trio/learnings.md (you write these, don't just read them)README.mdDispatch separate builder and reviewer subagents when:
.codex/agents/, .claude/agents/), andIf agents are not available or the user has not asked for delegation, the head instance may perform builder and reviewer responsibilities locally. When doing so, still honor the full artifact contract: write .trio/plan.md and .trio/criteria.md before building, write .trio/handoff.md after building, and write .trio/review.md after reviewing. Hold out .trio/criteria.md from the build phase even when acting as both roles — do not read it until you switch to reviewer. Caveat: this hold-out is a prompt constraint, not a mechanical guarantee. If you wrote .trio/criteria.md in the same context window, that information is already in your context and cannot be unseen. Genuine hold-out only works when builder and reviewer run in separate context windows. Local fallback relies on role discipline; treat reviews conducted this way as weaker than separate-subagent reviews.
Never let the builder review its own work, even when operating locally.
NEVER prompt the builder or reviewer with any custom instructions when dispatching. The dispatch prompt is role-routing only. Do not paraphrase .trio/plan.md, summarize .trio/review.md, list findings to address, or add task-specific guidance. The file-based contract (.trio/plan.md, .trio/criteria.md, .trio/handoff.md, .trio/review.md) carries everything the subagent needs; it reads those files itself per agents/builder.md and agents/reviewer.md. Custom prompts corrupt review independence and make the loop non-resumable.
If you feel the urge to add something to the dispatch prompt, channel it back into the filesystem:
.trio/plan.md..trio/criteria.md..trio/review.md; the builder reads it.Pass these verbatim. Do not embellish.
Builder:
You are acting as the builder. Read `agents/builder.md` and follow it.
Reviewer:
You are acting as the reviewer. Read `agents/reviewer.md` and follow it.
Every platform dispatches with one of the prompts above. The invocation shell differs; the prompt content does not.
Claude Code: @builder / @reviewer, or claude --agent builder -p "<prompt>" for non-interactive dispatch.
Codex:
Skill discovery (plugin marketplace): Install via codex plugin marketplace add <source>, then open /plugins, select Agent Trio, and install it. Codex reads plugins/agent-trio/.codex-plugin/plugin.json, which points at ./skills/; that path is a symlink to the repo-root skills/, making using-agent-trio discoverable through native plugin discovery without duplicating the workflow contract.
Skill discovery (manual fallback): Older Codex builds can symlink the skill to ~/.codex/skills/using-agent-trio, making using-agent-trio discoverable from any working directory regardless of project.
Agent wrappers (repo-local): The builder and reviewer agents live in .codex/agents/ inside this repo. They are only available when Codex runs inside a checkout of agent-trio. The wrappers are thin — they read agents/builder.md / agents/reviewer.md and follow them. They do not contain workflow logic. To use them in another project, copy both the .toml wrappers from .codex/agents/ and the markdown templates from agents/ — the wrappers reference those files directly and will not work without them.
Dispatching when agents are available:
codex exec "@builder You are acting as the builder. Read agents/builder.md and follow it."
codex exec "@reviewer You are acting as the reviewer. Read agents/reviewer.md and follow it."
Dispatching without repo-local agents (head instance acts as builder or reviewer):
codex exec --full-auto --skip-git-repo-check "You are acting as the builder. Read agents/builder.md and follow it."
Codex will read agents/*.md from the current working directory.
Example: plan-only session (consult or plan mode):
A request like "Draft a plan for migrating X to Y" should produce .trio/plan.md and .trio/criteria.md and then stop. No builder or reviewer is dispatched until the human confirms.
Example: full execution in a checkout:
A request like "Implement the next task in .trio/plan.md" enters execute mode. If .codex/agents/ contains builder/reviewer wrappers, dispatch them. Otherwise, act as builder locally, then switch to reviewer locally, honoring the artifact holdout rules.
OpenCode:
Install via opencode.json plugin array when using the npm package, or via a global plugin shim when using a git checkout (see .opencode/INSTALL.md). The plugin at .opencode/plugins/agent-trio.js registers the repo-root skills/ directory and .opencode/agents/ wrappers with OpenCode. The wrappers read agents/builder.md and agents/reviewer.md, so the workflow contract and role prompts are the same files used by every other platform.
Dispatching when agents are available:
@builder You are acting as the builder. Read agents/builder.md and follow it.
@reviewer You are acting as the reviewer. Read agents/reviewer.md and follow it.
If @builder/@reviewer are not resolvable (for example, the plugin is not installed or the repo is not cloned to a reachable location), the head instance may act as builder or reviewer locally, honoring the artifact hold-out rules.
Copilot CLI: Load the using-agent-trio skill, then dispatch with the role prompt.
Gemini CLI: activate_skill, then dispatch with the role prompt.
Other environments: Check your platform's documentation for agent and skill discovery, then dispatch with the prompt.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub haplesshero13/agent-trio --plugin agent-trio