Implementation Planning
Convert a spec into a concrete implementation plan that an autonomous coding agent can execute safely.
The output is a saved Markdown plan, not only chat text.
User Input
Use ask_user_question for any blocking missing input or product/contract decision. Ask one concise question, include likely options when useful, and provide a decisive recommendation. Do not ask in plain chat unless the tool is unavailable.
Primary Goal
Produce a plan with:
- enough repository context for implementation without re-discovering the whole codebase;
- well-scoped, independently verifiable tasks;
- explicit file touch points, contracts, tests, and risks;
- Ralphex-compatible task headings.
Workflow
- Identify the source spec and target plan path.
- If the user names a spec file, use it.
- If not, search likely locations:
docs/, docs/specs/, docs/implementation/, specs/, requirements/, issues, or the current prompt.
- If no usable spec exists, use
ask_user_question to ask for exactly one missing input: the spec location or spec text.
- Read the full source spec.
- Inspect only the repository context needed to make the plan executable:
- project guidance files (
AGENTS.md, CLAUDE.md, README.md, package/build files);
- existing architecture, API, schema, migration, and testing docs mentioned by the spec;
- relevant source files, tests, fixtures, generated-code scripts, and CI commands.
- Determine the implementation path.
- Prefer the smallest coherent sequence that preserves existing conventions.
- If the spec is ambiguous, make a reasonable assumption and record it in the plan.
- Use
ask_user_question only when a product/contract decision blocks planning.
- Write or update a Markdown plan.
- If the plan was created from a specific item in
docs/backlog.md, load the
backlog skill and invoke its cleanup option with the exact item heading
and saved plan path. Do this immediately after the plan is successfully
saved; do not clean up the item if plan creation failed. The cleanup must
remove only that item and preserve the remaining backlog.
- Confirm the plan is executable by the
implementation skill:
- it contains at least one task heading matching
### Task N: <title> or ### Iteration N: <title>;
- every task section contains at least one unchecked checklist item;
- every task includes verification and observable completion criteria.
- Run the
revdiff skill against the saved plan (--only <plan-path>; add
--untracked for a new file). Process captured annotations and update the
plan when needed.
- Report the saved file path and no more than three important caveats.
Default Plan Location
Use the first matching convention:
- Existing project plan convention if obvious.
docs/plans/YYYYMMDD-<kebab-case-title>.md.
docs/implementation-plan.md if the repository already uses a single rolling implementation plan.
Ralphex Compatibility Rules
Ralphex task execution requires executable sections. The plan must include task headings in this form:
### Task 1: Short imperative task title
Rules:
- Use
### Task N: headings for implementation tasks.
- Number tasks consecutively starting at 1.
- Do not hide task headings inside code blocks.
- Each task must be completable in one focused implementation pass.
- Each task must include a verification command or manual verification step.
- Include at least one unchecked checklist item (
- [ ]) in every task so progress can be marked and resumed.
- Do not include tasks that only say "review", "investigate", or "decide" unless they produce a concrete repository artifact.
- If discovery is needed, make it a bounded implementation task with an output file, fixture, test, or documented decision.
Required Plan Structure
Use this template unless the repository has a stronger established format:
# <Plan Title>
## Overview
<What will be built and why.>
## Source Spec
- Spec: `<path or prompt>`
- Status: <Draft/Approved/Assumed>
- Last reviewed: YYYY-MM-DD
## Repository Context
- `<path>` — <why it matters>
- `<path>` — <why it matters>
## Implementation Constraints
- <Language/framework/runtime constraints>
- <Contract/API compatibility constraints>
- <Security/privacy/migration constraints>
- <Generated-code or schema constraints>
## Assumptions
- <Assumption made because the spec or repo did not decide it.>
## Non-goals
- <Explicitly excluded work.>
## Task Summary
1. <Task 1 title and outcome>
2. <Task 2 title and outcome>
## Implementation Tasks
### Task 1: <Short imperative title>
Goal: <Concrete outcome.>
Context:
- <Relevant repo behavior, invariant, or prior decision.>
- <Important dependency from the source spec.>
Files:
- Create: `<path>` — <purpose>
- Modify: `<path>` — <purpose>
- Test: `<path>` — <purpose>
Steps:
- [ ] <Specific implementation step.>
- [ ] <Specific implementation step.>
- [ ] <Update docs/contracts/generated artifacts if applicable.>
Verification:
- `<command>`
- <Manual check if no command exists.>
Completion criteria:
- <Observable done condition.>
- <Observable done condition.>
### Task 2: <Short imperative title>
Goal: <Concrete outcome.>
Context:
- <Relevant repo behavior, invariant, or prior decision.>
Files:
- Modify: `<path>` — <purpose>
- Test: `<path>` — <purpose>
Steps:
- [ ] <Specific implementation step.>
Verification:
- `<command>`
Completion criteria:
- <Observable done condition.>
## Cross-Task Verification
- `<command that should pass after all tasks>`
- <Release/build/manual acceptance check>
## Risks and Mitigations
- Risk: <risk>
Mitigation: <mitigation>
## Open Questions
- <Question, or `None`.>
Task Design Standards
A good task has:
- a narrow goal;
- a concrete file touch list;
- enough context to avoid broad rediscovery;
- implementation steps in dependency order;
- tests or validation commands;
- completion criteria that can be checked from the repository.
Split tasks when:
- one task would touch unrelated layers;
- contract/schema changes need to land before implementation;
- data migration or generated code must be verified separately;
- UI, API, persistence, and tests are separable;
- rollback or feature-flag work deserves independent validation.
Combine tasks when:
- splitting would force repeated edits to the same tiny code path;
- verification only makes sense after the pieces are together;
- one change is just a test for the other.
Context to Capture
Prefer concrete, implementation-useful context:
- current architecture and entry points;
- relevant modules/classes/functions/components;
- existing patterns to copy;
- naming conventions;
- schema/API/contract owners;
- generated files and generation commands;
- migrations and backward compatibility rules;
- test fixtures and smallest relevant test commands;
- deployment, build, lint, or contract gates;
- security, privacy, permissions, and data-retention constraints;
- known pitfalls from current code.
Avoid generic context:
- broad summaries of the whole repo;
- restating the entire spec;
- obvious language/framework facts;
- speculative alternatives not chosen.
Behavior Rules
- Be concise and decisive.
- Make reasonable assumptions and record them.
- Do not brainstorm multiple plans unless asked.
- Do not implement the plan unless the user explicitly asks.
- Do not create vague tasks.
- Do not leave placeholders like
TBD except in Open Questions.
- Preserve existing user edits when updating an existing plan.
1---2name: implementation-planning3description: Turn an existing product/technical spec into a thorough, repository-grounded implementation plan. Use when asked to create an implementation plan, break a spec into tasks, make a Ralphex-compatible plan, or convert requirements into executable engineering steps.4---56# Implementation Planning78Convert a spec into a concrete implementation plan that an autonomous coding agent can execute safely.910The output is a saved Markdown plan, not only chat text.1112## User Input1314Use `ask_user_question` for any blocking missing input or product/contract decision. Ask one concise question, include likely options when useful, and provide a decisive `recommendation`. Do not ask in plain chat unless the tool is unavailable.1516## Primary Goal1718Produce a plan with:1920- enough repository context for implementation without re-discovering the whole codebase;21- well-scoped, independently verifiable tasks;22- explicit file touch points, contracts, tests, and risks;23- Ralphex-compatible task headings.2425## Workflow26271. Identify the source spec and target plan path.28 - If the user names a spec file, use it.29 - If not, search likely locations: `docs/`, `docs/specs/`, `docs/implementation/`, `specs/`, `requirements/`, issues, or the current prompt.30 - If no usable spec exists, use `ask_user_question` to ask for exactly one missing input: the spec location or spec text.312. Read the full source spec.323. Inspect only the repository context needed to make the plan executable:33 - project guidance files (`AGENTS.md`, `CLAUDE.md`, `README.md`, package/build files);34 - existing architecture, API, schema, migration, and testing docs mentioned by the spec;35 - relevant source files, tests, fixtures, generated-code scripts, and CI commands.364. Determine the implementation path.37 - Prefer the smallest coherent sequence that preserves existing conventions.38 - If the spec is ambiguous, make a reasonable assumption and record it in the plan.39 - Use `ask_user_question` only when a product/contract decision blocks planning.405. Write or update a Markdown plan.416. If the plan was created from a specific item in `docs/backlog.md`, load the42 `backlog` skill and invoke its `cleanup` option with the exact item heading43 and saved plan path. Do this immediately after the plan is successfully44 saved; do not clean up the item if plan creation failed. The cleanup must45 remove only that item and preserve the remaining backlog.467. Confirm the plan is executable by the `implementation` skill:47 - it contains at least one task heading matching `### Task N: <title>` or `### Iteration N: <title>`;48 - every task section contains at least one unchecked checklist item;49 - every task includes verification and observable completion criteria.508. Run the `revdiff` skill against the saved plan (`--only <plan-path>`; add51 `--untracked` for a new file). Process captured annotations and update the52 plan when needed.539. Report the saved file path and no more than three important caveats.5455## Default Plan Location5657Use the first matching convention:58591. Existing project plan convention if obvious.602. `docs/plans/YYYYMMDD-<kebab-case-title>.md`.613. `docs/implementation-plan.md` if the repository already uses a single rolling implementation plan.62## Ralphex Compatibility Rules6364Ralphex task execution requires executable sections. The plan must include task headings in this form:6566```markdown67### Task 1: Short imperative task title68```6970Rules:7172- Use `### Task N:` headings for implementation tasks.73- Number tasks consecutively starting at 1.74- Do not hide task headings inside code blocks.75- Each task must be completable in one focused implementation pass.76- Each task must include a verification command or manual verification step.77- Include at least one unchecked checklist item (`- [ ]`) in every task so progress can be marked and resumed.78- Do not include tasks that only say "review", "investigate", or "decide" unless they produce a concrete repository artifact.79- If discovery is needed, make it a bounded implementation task with an output file, fixture, test, or documented decision.8081## Required Plan Structure8283Use this template unless the repository has a stronger established format:8485```markdown86# <Plan Title>8788## Overview89<What will be built and why.>9091## Source Spec92- Spec: `<path or prompt>`93- Status: <Draft/Approved/Assumed>94- Last reviewed: YYYY-MM-DD9596## Repository Context97- `<path>` — <why it matters>98- `<path>` — <why it matters>99100## Implementation Constraints101- <Language/framework/runtime constraints>102- <Contract/API compatibility constraints>103- <Security/privacy/migration constraints>104- <Generated-code or schema constraints>105106## Assumptions107- <Assumption made because the spec or repo did not decide it.>108109## Non-goals110- <Explicitly excluded work.>111112## Task Summary1131. <Task 1 title and outcome>1142. <Task 2 title and outcome>115116## Implementation Tasks117118### Task 1: <Short imperative title>119120Goal: <Concrete outcome.>121122Context:123- <Relevant repo behavior, invariant, or prior decision.>124- <Important dependency from the source spec.>125126Files:127- Create: `<path>` — <purpose>128- Modify: `<path>` — <purpose>129- Test: `<path>` — <purpose>130131Steps:132- [ ] <Specific implementation step.>133- [ ] <Specific implementation step.>134- [ ] <Update docs/contracts/generated artifacts if applicable.>135136Verification:137- `<command>`138- <Manual check if no command exists.>139140Completion criteria:141- <Observable done condition.>142- <Observable done condition.>143144### Task 2: <Short imperative title>145146Goal: <Concrete outcome.>147148Context:149- <Relevant repo behavior, invariant, or prior decision.>150151Files:152- Modify: `<path>` — <purpose>153- Test: `<path>` — <purpose>154155Steps:156- [ ] <Specific implementation step.>157158Verification:159- `<command>`160161Completion criteria:162- <Observable done condition.>163164## Cross-Task Verification165- `<command that should pass after all tasks>`166- <Release/build/manual acceptance check>167168## Risks and Mitigations169- Risk: <risk>170 Mitigation: <mitigation>171172## Open Questions173- <Question, or `None`.>174```175176## Task Design Standards177178A good task has:179180- a narrow goal;181- a concrete file touch list;182- enough context to avoid broad rediscovery;183- implementation steps in dependency order;184- tests or validation commands;185- completion criteria that can be checked from the repository.186187Split tasks when:188189- one task would touch unrelated layers;190- contract/schema changes need to land before implementation;191- data migration or generated code must be verified separately;192- UI, API, persistence, and tests are separable;193- rollback or feature-flag work deserves independent validation.194195Combine tasks when:196197- splitting would force repeated edits to the same tiny code path;198- verification only makes sense after the pieces are together;199- one change is just a test for the other.200201## Context to Capture202203Prefer concrete, implementation-useful context:204205- current architecture and entry points;206- relevant modules/classes/functions/components;207- existing patterns to copy;208- naming conventions;209- schema/API/contract owners;210- generated files and generation commands;211- migrations and backward compatibility rules;212- test fixtures and smallest relevant test commands;213- deployment, build, lint, or contract gates;214- security, privacy, permissions, and data-retention constraints;215- known pitfalls from current code.216217Avoid generic context:218219- broad summaries of the whole repo;220- restating the entire spec;221- obvious language/framework facts;222- speculative alternatives not chosen.223224## Behavior Rules225226- Be concise and decisive.227- Make reasonable assumptions and record them.228- Do not brainstorm multiple plans unless asked.229- Do not implement the plan unless the user explicitly asks.230- Do not create vague tasks.231- Do not leave placeholders like `TBD` except in `Open Questions`.232- Preserve existing user edits when updating an existing plan.