Ask your agent
What it does
This sets up a Neon planning and Opus building loop using PLAN.md and HANDOFF.md. Each pass handles one step, runs the required checks, records status, and repeats review and fixes until the acceptance checks pass.
SKILL.md
---
name: handoff
description: "Runs a Neon-plans / Opus-builds loop with PLAN.md and HANDOFF.md. Use when planning a project, handing off between models, reviewing or fixing code, or writing a Codex prompt."
---
# Handoff
A two-model loop with two shared files. The planner/reviewer (Gemini Neon, $100 Google plan) plans and checks the code. The builder/fixer (Claude Opus, $200 Claude plan) builds one step at a time and applies fixes. They pass `PLAN.md` and `HANDOFF.md` back and forth until the checks are met.
If the user names different models, keep the same roles. Do not invent results, benchmarks, or other prices.
## Quick start
1. Copy the `PLAN.md` and `HANDOFF.md` templates below into the project.
2. Copy the progress checklist into the chat and check items off as you go.
3. Start a **fresh** Neon session. Paste Prompt 1 with the project goal. Save the output as `PLAN.md`. Do not build yet.
4. Start a **fresh** Opus session. Paste Prompt 2. It does only the next unmet step, runs tests, updates `HANDOFF.md`, and stops.
5. Start a **fresh** Neon session. Paste Prompt 3. It reviews from the files and the code, not the builder's chat.
6. If there are findings, start a **fresh** Opus session with Prompt 4, then repeat step 5. If the step is clean, go back to step 4 for the next plan step.
7. Stop when the stop rule is met, or the user says to stop.
If asked for one prompt to paste into a coding agent (for example Codex), do not do the work. Package the matching prompt plus both files, then stop.
## Progress checklist
Copy this and check items off:
```
Handoff progress
- [ ] PLAN.md written with numbered steps and acceptance checks
- [ ] HANDOFF.md created
- [ ] Fresh session: builder took one unmet step
- [ ] Tests and that step's acceptance check were run
- [ ] HANDOFF.md updated (done, still needs work, files touched, next step)
- [ ] Fresh session: reviewer checked the code
- [ ] Findings ranked High / Medium / Low
- [ ] Acceptance check marked met only if the reviewer saw it pass
- [ ] Fresh session: builder fixed highest-severity findings first
- [ ] Tests re-run after the fix
- [ ] Review repeated after the fix
- [ ] Next plan step started only after this step is clean
- [ ] Stop rule met, or user said stop
```
## Templates
Create these in the project root. Fill them in; do not invent sections.
### PLAN.md
The planner writes this first. Each step needs an acceptance check (a command or behavior, and what "done" looks like). Leave checks unmet until review confirms them. The planner should spot flaws in the logic, question the architecture, and suggest better ways to implement things — not write the implementation.
```markdown
# Plan
## Goal
[what this project should do]
## Steps
1. [step]
Acceptance: [command or behavior, and what "done" looks like]
2. [step]
Acceptance: [check]
```
### HANDOFF.md
The living status file, so both models know what is already done and what still needs work. Update it at the end of every pass. Keep it short and current.
```markdown
# Handoff
## Already done
- [step or finding, plus the check that passed]
## Still needs work
- [High/Medium/Low] [what's left or what the review found]
## Decisions
- [choice and why]
## Blockers
- [or "None"]
## Files touched
- [paths]
## Next step
[one line: who does what next]
```
## Rules for every pass
Start every plan, build, review, and fix pass in a fresh session. Do not rely on chat memory or a compacted transcript.
Before doing anything else:
1. Read `PLAN.md` and `HANDOFF.md` (create `HANDOFF.md` if it is missing).
2. If the repo has git, skim recent commits.
3. Run the project's tests or smoke check once, so you are not starting from a broken tree.
4. Do exactly one thing this pass: plan, build one step, review, or fix.
5. Update `HANDOFF.md` and stop.
## The loop
1. **Plan.** Neon writes `PLAN.md`. No building.
2. **Build one step.** Opus takes the next unmet step only, implements it, runs the tests and that step's acceptance check, and updates `HANDOFF.md`. It does not mark the step complete; review does that.
3. **Review.** Neon reads both files and the code, then uses the review checklist. Findings go under "Still needs work", ranked by severity. It does not implement fixes.
4. **Fix.** Opus fixes findings, highest severity first, runs tests again, updates `HANDOFF.md`, and stops.
5. **Loop.** Review again after every fix. Do not skip review. Start the next unmet plan step only after this step is clean.
## Review checklist
The check is a review pass by the planner, not a self-check by the builder.
- Flaws in the logic
- Architecture issues
- Better ways to implement things
- Whether this step's acceptance check was actually run and met
- Whether the tests or smoke check were run, and what they showed
Rank each finding **High**, **Medium**, or **Low**:
- **High:** broken behavior, a failed or unrun acceptance check, or a design problem that will not hold up
- **Medium:** should be fixed before calling the work done, but the step basically works
- **Low:** optional cleanup
Do not mark a plan step's acceptance check as met unless the reviewer saw the check run and pass.
## Stop rule
The loop is done when all of these are true, or the user says to stop:
- Every `PLAN.md` acceptance check is met
- No high-severity findings remain
- Tests for the completed steps were run and passed
- `HANDOFF.md` next step says "done" (medium or low findings may stay only if the user accepts them)
Until then, keep going back and forth.
## Worked example
Goal: add a `GET /health` endpoint that returns `{"ok": true}`.
`PLAN.md` after the planner:
```markdown
# Plan
## Goal
Add a health endpoint that returns JSON {"ok": true}.
## Steps
1. Add GET /health that returns {"ok": true}
Acceptance: `curl -s localhost:3000/health` prints `{"ok": true}`
2. Add a test for the endpoint
Acceptance: the test command runs a passing health test
```
After the builder finishes step 1, `HANDOFF.md` might look like:
```markdown
# Handoff
## Already done
- Implemented GET /health in src/server.ts (acceptance not yet confirmed by review)
## Still needs work
- Review step 1
- Step 2: add a test
## Decisions
- None
## Blockers
- None
## Files touched
- src/server.ts
## Next step
Neon reviews step 1 against the curl check
```
A useful review finding: `High: /health returns plain text, not JSON`. The builder fixes it, tests are re-run, Neon reviews again, marks step 1 met, and sets next step to "Opus builds step 2". Loop until both checks are met and no high findings remain.
## If it goes wrong
- **Builder does several plan steps in one pass.** Stop. Leave later steps unmet. Next build pass takes only the first unfinished step.
- **Same chat is used for build and review.** Start a fresh reviewer session. It should read only the files and the code, not the builder's transcript.
- **Reviewer marks an acceptance check met without seeing it run.** Unmark it. Re-run the check in a review pass before calling the step done.
- **Work is handed back without running tests.** Do not switch models yet. Run the tests and the step's acceptance check, update `HANDOFF.md`, then hand off.
- **`HANDOFF.md` has no next-step line, or does not match the repo.** Update it from the files and git before starting the next pass.
- **Planner starts writing implementation.** Stop and return to planning. Implementation belongs in a builder pass.
## Prompts
Fill in the bracketed parts. Do not add tasks, metrics, or claims the user did not give you.
### 1. Planner writes PLAN.md
```
Read HANDOFF.md if it exists. Plan this project and save the plan in PLAN.md.
[project goal and constraints]
Spot flaws in the logic, question the architecture, and suggest better ways to implement things. Break the work into numbered steps. Each step needs an acceptance check (a command or observable behavior, and what "done" looks like). Do not write the implementation.
```
### 2. Builder takes one step
```
Start a fresh pass. Read PLAN.md and HANDOFF.md first, then the code. If the repo has git, skim recent commits. Run the tests or smoke check once.
Do only the next unmet step from PLAN.md. Do not start later steps.
When you finish, run the tests and that step's acceptance check. Update HANDOFF.md: already done, still needs work, decisions, blockers, files touched, and one next-step line. Do not mark the acceptance check as met; leave that for review.
```
### 3. Planner reviews
```
Start a fresh review. Read PLAN.md, HANDOFF.md, and the code. Do not implement anything.
Check the code and find anything that could be better. Use this checklist: flaws in the logic, architecture issues, better ways to implement things, whether this step's acceptance check was run and met, and whether the tests were run.
Write findings in HANDOFF.md under "Still needs work", ranked High, Medium, or Low. Only mark a PLAN.md acceptance check as met if you saw it run and pass. Set the next-step line.
```
### 4. Builder fixes findings
```
Start a fresh pass. Read PLAN.md and HANDOFF.md, then the code.
Fix the "Still needs work" findings, highest severity first. Do not start the next plan step.
When you finish, run the tests and the relevant acceptance checks. Update HANDOFF.md and set the next-step line for another review.
```
## If you are asked for one prompt to hand off to a coding agent
Do not do the work. Put this in one prompt the user can paste into that agent (for example Codex):
- The goal and the brief
- `PLAN.md` (or the full plan, if the file is not in the repo)
- `HANDOFF.md` (including next step)
- Which pass this is: build one named step, review, or fix
- Any limits the user named (do not post, do not spend without asking, show the result first)
- Instructions to start from the files, do only that pass, run the tests before handing back, and update `HANDOFF.md`
Show the user the full prompt and stop.
1 file
- SKILL.md9.7 KB