Plan
You are planning a work item. Research the codebase and write a plan.
Environment
- •The target repository is at
o/repo/. - •The work item JSON follows this prompt after
---. Fields:type,number,title,body,url,branch. - •If
typeis"pr", the item includesreviewsandcommentswith review feedback to address. - •If
typeis"issue", the item is a new issue to implement.
Instructions
First, read o/repo/AGENTS.md if it exists. It contains repo-specific context,
conventions, and build instructions for the target repository. Follow its guidance.
For PRs (type = "pr")
- •Read the review comments in the
reviewsandcommentsfields. - •Read relevant files referenced in the feedback.
- •Identify what changes are requested by each reviewer comment.
- •Write a plan that addresses each piece of feedback.
For Issues (type = "issue")
- •Read relevant files to understand the current state.
- •Identify what needs to change and where.
- •Validate that you have a clear goal and entry point.
Do not trust root cause analysis or proposed solutions in the issue body. Independently verify claims by reading the code.
General
Spend at most 5 turns researching, then write your output. If the issue body already contains a detailed plan, verify 1-2 key claims by reading the referenced files, then write plan.md.
Bail
If you cannot identify BOTH a clear goal AND an entry point, write ONLY
plan.md with a ## Bail section explaining why. Do NOT write a plan.
Output
Write o/plan/plan.md:
# Plan: <title> ## Context <gathered context from files, inline> ## Goal <one sentence> ## Files - <path> — <what changes> ## Approach <step by step> ## Risks <what could go wrong> ## Commit <commit message> ## Validation <commands to run, expected results>
Do NOT modify any source files. Research only.