Plan Software Change
Given an input file path or provided requirements, plan the change to existing or new software.
The sidecar plan file must be fully self-contained. A new agent session given only that file
and access to the repository must have all the context needed to implement the change without
reading the original input file or this conversation.
Before writing, verify the plan contains:
- Analyze the input/requirements
→ Output: Context (goal, motivation, acceptance criteria, constraints, background).
- Research the current project
→ Output: Context (dependencies, contracts) and Implementation Hints (grounded facts).
- Search for related info — referenced files, configs, docs, tests, existing patterns, and
project conventions (e.g.
AGENTS.md, CLAUDE.md, CONTRIBUTING.md, architecture decision
records, coding guidelines, style guides) relevant to the change.
- Identify existing documentation that describes the components or behavior being changed (e.g.
README, architecture/API docs, ADRs, changelogs, user guides) so it can be tracked for updates
in the plan.
- If the change touches a domain with an available skill (e.g. database, cloud, security,
language-specific), invoke that skill and fold its findings into Implementation Hints.
- If research reveals requirements are infeasible, decide where to document the blocker:
- Missing resource that could be obtained → Open Questions.
- Contradiction with an existing invariant → Consistency Issues (prefix
[high]).
- Fundamentally impossible regardless of resources → note in Context and halt planning.
- Create a structured plan how the change can be implemented, including necessary changes to
tests and to existing documentation that describes the affected components
→ Output: Implementation Plan.
- Suggest improvements to the input/requirements
→ Output: Proposed Improvements (optional — omit section if none).
- Analyze the plan itself for consistency: check whether any step, as written, would introduce or
silently rely on a contradiction
→ Output: Consistency Issues (optional — omit section if none).
"Consistency issues" are contradictions or conflicts with existing invariants that the planned
change would introduce or silently rely on. Prefix each entry with [high] if it blocks
implementation, or [low] if it can be resolved during implementation. Keep them distinct
from the "Implementation Plan" (concrete steps) and "Implementation Hints" (grounded facts)
and non-redundant with both. See the Output Format template for what counts as a consistency issue.
- Note open questions, unclear requirements, implications for security or topics that need
clarification before implementation and/or planning can start
→ Output: Open Questions (optional — omit section if none remain).
- Write the output to a markdown sidecar file
→ Output: the assembled sidecar file.
The sidecar must contain every section produced above, assembled in the order shown below.
Before writing, ensure the Implementation Plan steps are numbered consecutively from 1
with no gaps or duplicates; if steps were added, removed, or reordered, renumber them while
preserving each step's [ ]/[x] checkbox state.
After writing, ensure the file ends with exactly one newline and no trailing blank lines or
--- rules.
Sidecar file naming:
- If no input file path is given, ask the user for a name to use for the sidecar output file
before proceeding (propose a short/multi-word filename derived from the plan content with words
delimited by "-").
- If input file path is given, derive the sidecar name by inserting
-plan before the
file extension (e.g. #123.md → #123-plan.md).
- If the input has no extension, append
-plan to the basename (e.g. Dockerfile →
Dockerfile-plan.md, Makefile → Makefile-plan.md).
- If the input is a directory, ask the user for a filename.
- Create the sidecar file if it does not exist. If it already exists, overwrite it entirely
with the updated plan.
Produce the template sections in the order shown below. Don't duplicate content across sections.
Resolving open questions
Whenever an open question is resolved (whether answered by the user or through agent research),
apply steps 1–3 in one update. Additionally, if after resolution no questions remain, also apply
step 4:
- Remove the question entry from the Open Questions section.
- Incorporate the answer as a concrete note in Implementation Hints.
- Update any affected steps in the Implementation Plan, renumbering if steps were
inserted or removed so numbering stays consecutive (see renumbering rule below).
- Remove the entire Open Questions section, including its heading
and all surrounding blank lines.
Output format
Write the following Output Format template into the sidecar file (e.g. #123-plan.md).
Strip all HTML comments from the template when writing; they are authoring guidance only.
OMIT optional sections when they have no content.
# Title <!-- Generate a meaningful title for the planned task -->
## Context
<!--
Everything a new agent needs to understand the task without reading the original input:
the system/component being changed, goal and motivation, key constraints, acceptance
criteria, and relevant background (related issues, shared contracts, dependencies).
Completeness matters more than brevity. Keep high-level background here; fold concrete,
codebase-derived details (exact file paths, config keys, version constraints) into
Implementation Hints rather than restating them here.
-->
## Implementation Plan
<!--
Numbered, actionable steps describing what needs to change and why, referencing
specific files and components found in step 2. Steps should be granular enough
that a new agent can execute one step without further decomposition; prefer one
step per logical change over one step per file. Include explicit steps for
updating existing documentation affected by the change (README, architecture/API docs,
ADRs, changelogs, inline doc comments, etc.), referencing the specific doc files.
A source change that leaves its documentation stale is an incomplete
change.
Add a task-list checkbox to every numbered step and its sub-steps, using the format
`1. [ ] Step text`. Note in the plan introduction that an implementing agent must
flip `[ ]` to `[x]` immediately after completing each step and rewrite the sidecar
file in place, so progress is resumable across sessions.
Keep step numbers consecutive starting at 1, with no gaps or duplicates. Whenever
steps are inserted, removed, or reordered, renumber the remaining steps and carry
over each step's existing `[ ]`/`[x]` state — never reset a completed step back to
`[ ]` during renumbering.
-->
## Proposed Improvements <!-- OPTIONAL — omit section entirely if none -->
<!--
Suggestions that go beyond the stated requirements and would improve quality, safety,
or maintainability.
-->
## Consistency Issues <!-- OPTIONAL — omit section entirely if none -->
<!--
Contradictions or conflicts with existing invariants that the planned change
would introduce or silently rely on.
Triage: action → Implementation Plan; fact/constraint → Implementation Hints;
contradiction that must be acknowledged before the plan is coherent → here.
Example: "[high] Step 3 adds a REST endpoint to module A, but ADR-0007 mandates
all new external interfaces go through module B. This contradicts the architecture
decision and must be resolved before implementation."
When nothing genuinely conflicts, OMIT the entire section.
-->
## Implementation Hints
<!--
Concrete, grounded guidance derived from codebase research (step 2) and resolved open
questions (when the answer is just information and not a task). This section must contain
facts only — never actionable steps.
- exact file paths
- config keys
- version constraints
- behavior confirmed by code reading, etc.
-->
## Open Questions <!-- OPTIONAL — omit section entirely if none remain -->
<!--
Questions that must be resolved before implementation and/or planning can start.
Follow the "Resolving open questions" protocol above when closing each one.
-->
1---2name: plan-software-change3description: Create and update a plan to change software — to introduce new features or fix bugs.4---56# Plan Software Change78Given an input file path or provided requirements, plan the change to existing or new software.910**The sidecar plan file must be fully self-contained.** A new agent session given only that file11and access to the repository must have all the context needed to implement the change without12reading the original input file or this conversation.1314**Before writing, verify the plan contains:**15- [ ] The system or component being changed16- [ ] The goal and motivation for the change17- [ ] Acceptance criteria or definition of done18- [ ] Key constraints (dependencies, contracts, shared state)19- [ ] Concrete starting point (first file to open, first test to run)20- [ ] A new agent could begin implementing without reading the original input21221. Analyze the input/requirements 23 → Output: **Context** (goal, motivation, acceptance criteria, constraints, background).242. Research the current project 25 → Output: **Context** (dependencies, contracts) and **Implementation Hints** (grounded facts).26 - Search for related info — referenced files, configs, docs, tests, existing patterns, and27 project conventions (e.g. `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, architecture decision28 records, coding guidelines, style guides) relevant to the change.29 - Identify existing documentation that describes the components or behavior being changed (e.g.30 README, architecture/API docs, ADRs, changelogs, user guides) so it can be tracked for updates31 in the plan.32 - If the change touches a domain with an available skill (e.g. database, cloud, security,33 language-specific), invoke that skill and fold its findings into **Implementation Hints**.34 - If research reveals requirements are infeasible, decide where to document the blocker:35 - Missing resource that could be obtained → **Open Questions**.36 - Contradiction with an existing invariant → **Consistency Issues** (prefix `[high]`).37 - Fundamentally impossible regardless of resources → note in **Context** and halt planning.383. Create a structured plan how the change can be implemented, including necessary changes to39 tests and to existing documentation that describes the affected components 40 → Output: **Implementation Plan**.414. Suggest improvements to the input/requirements 42 → Output: **Proposed Improvements** (optional — omit section if none).435. Analyze the plan itself for consistency: check whether any step, as written, would introduce or44 silently rely on a contradiction 45 → Output: **Consistency Issues** (optional — omit section if none). 46 "Consistency issues" are contradictions or conflicts with existing invariants that the planned47 change would introduce or silently rely on. Prefix each entry with `[high]` if it blocks48 implementation, or `[low]` if it can be resolved during implementation. Keep them distinct49 from the "Implementation Plan" (concrete steps) and "Implementation Hints" (grounded facts)50 and non-redundant with both. See the Output Format template for what counts as a consistency issue.516. Note open questions, unclear requirements, implications for security or topics that need52 clarification before implementation and/or planning can start 53 → Output: **Open Questions** (optional — omit section if none remain).547. Write the output to a markdown sidecar file 55 → Output: the assembled sidecar file. 56 The sidecar must contain every section produced above, assembled in the order shown below.57 Before writing, ensure the **Implementation Plan** steps are numbered consecutively from 158 with no gaps or duplicates; if steps were added, removed, or reordered, renumber them while59 preserving each step's `[ ]`/`[x]` checkbox state.60 After writing, ensure the file ends with exactly one newline and no trailing blank lines or61 `---` rules.62 **Sidecar file naming:**63 - If no input file path is given, ask the user for a name to use for the sidecar output file64 before proceeding (propose a short/multi-word filename derived from the plan content with words65 delimited by "-").66 - If input file path is given, derive the sidecar name by inserting `-plan` before the67 file extension (e.g. `#123.md` → `#123-plan.md`).68 - If the input has no extension, append `-plan` to the basename (e.g. `Dockerfile` →69 `Dockerfile-plan.md`, `Makefile` → `Makefile-plan.md`).70 - If the input is a directory, ask the user for a filename.71 - Create the sidecar file if it does not exist. If it already exists, overwrite it entirely72 with the updated plan.7374Produce the template sections in the order shown below. Don't duplicate content across sections.7576## Resolving open questions7778Whenever an open question is resolved (whether answered by the user or through agent research),79apply steps 1–3 in one update. Additionally, if after resolution no questions remain, also apply80step 4:81821. Remove the question entry from the **Open Questions** section.832. Incorporate the answer as a concrete note in **Implementation Hints**.843. Update any affected steps in the **Implementation Plan**, renumbering if steps were85 inserted or removed so numbering stays consecutive (see renumbering rule below).864. Remove the **entire** **Open Questions** section, including its heading87 and all surrounding blank lines.8889## Output format9091Write the following Output Format template into the sidecar file (e.g. `#123-plan.md`).92Strip all HTML comments from the template when writing; they are authoring guidance only.93OMIT optional sections when they have no content.9495```markdown96# Title <!-- Generate a meaningful title for the planned task -->9798## Context99100<!--101Everything a new agent needs to understand the task without reading the original input:102the system/component being changed, goal and motivation, key constraints, acceptance103criteria, and relevant background (related issues, shared contracts, dependencies).104Completeness matters more than brevity. Keep high-level background here; fold concrete,105codebase-derived details (exact file paths, config keys, version constraints) into106Implementation Hints rather than restating them here.107-->108109## Implementation Plan110111<!--112Numbered, actionable steps describing what needs to change and why, referencing113specific files and components found in step 2. Steps should be granular enough114that a new agent can execute one step without further decomposition; prefer one115step per logical change over one step per file. Include explicit steps for116updating existing documentation affected by the change (README, architecture/API docs,117ADRs, changelogs, inline doc comments, etc.), referencing the specific doc files.118A source change that leaves its documentation stale is an incomplete119change.120121Add a task-list checkbox to every numbered step and its sub-steps, using the format122`1. [ ] Step text`. Note in the plan introduction that an implementing agent must123flip `[ ]` to `[x]` immediately after completing each step and rewrite the sidecar124file in place, so progress is resumable across sessions.125126Keep step numbers consecutive starting at 1, with no gaps or duplicates. Whenever127steps are inserted, removed, or reordered, renumber the remaining steps and carry128over each step's existing `[ ]`/`[x]` state — never reset a completed step back to129`[ ]` during renumbering.130--> 131132## Proposed Improvements <!-- OPTIONAL — omit section entirely if none -->133134<!--135Suggestions that go beyond the stated requirements and would improve quality, safety,136or maintainability.137-->138139## Consistency Issues <!-- OPTIONAL — omit section entirely if none -->140141<!--142Contradictions or conflicts with existing invariants that the planned change143would introduce or silently rely on.144145Triage: action → Implementation Plan; fact/constraint → Implementation Hints;146contradiction that must be acknowledged before the plan is coherent → here.147148Example: "[high] Step 3 adds a REST endpoint to module A, but ADR-0007 mandates149all new external interfaces go through module B. This contradicts the architecture150decision and must be resolved before implementation."151152When nothing genuinely conflicts, OMIT the entire section.153-->154155## Implementation Hints156157<!--158Concrete, grounded guidance derived from codebase research (step 2) and resolved open159questions (when the answer is just information and not a task). This section must contain160facts only — never actionable steps.161162- exact file paths163- config keys164- version constraints165- behavior confirmed by code reading, etc.166-->167168## Open Questions <!-- OPTIONAL — omit section entirely if none remain -->169170<!--171Questions that must be resolved before implementation and/or planning can start.172Follow the "Resolving open questions" protocol above when closing each one.173-->174```