This skill generates comprehensive implementation plans for engineers with zero context, detailing file touches, code examples, tests, and verification steps.
npx playbooks add skill ed3dai/ed3d-plugins --skill writing-implementation-plans
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to verify it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. Frequent commits.
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
Announce at start: "I'm using the writing-implementation-plans skill to create the implementation plan."
Save plans to: docs/implementation-plans/YYYY-MM-DD-<feature-name>/phase_##.md
Design plans are intentionally high-level. They describe components, modules, and contracts — not implementation code. This is by design.
You MUST generate code fresh based on codebase investigation. Do NOT copy code from the design document. Even if a design plan contains code examples (it shouldn't, but some might), treat them as illustrative only.
Why this matters:
The design plan tells you WHERE you're going. Codebase investigation tells you HOW to get there from where you are.
REQUIRED: Verify scope and codebase state
Count the phases/tasks in the design plan.
If design plan has >8 phases: STOP. Refuse to proceed.
Tell the user:
"This design has [N] phases, which exceeds the 8-phase limit for implementation plans. Please rerun this skill with a scope of no more than 8 phases. You can:
If already implementing phases 9+: The user should provide the previous implementation plan as context when scoping the next batch.
After scope validation, ask how to handle phase reviews:
Use AskUserQuestion:
Question: "How would you like to review the implementation plan phases?"
Options:
- "Write all phases to disk, I'll review afterwards"
- "Review each phase interactively before writing"
Track this choice - it affects the per-phase workflow below.
You MUST verify current codebase state before EACH AND EVERY PHASE. Use codebase-investigator to prove out your hypotheses and to ensure that current state aligns with what you want to write out.
YOU MUST verify current codebase state before writing ANY task.
DO NOT verify codebase yourself. Use codebase-investigator agent.
Do not use nested subagents. The planning workflow may dispatch codebase-investigator, code-reviewer, and test-requirement generation subagents, but those subagents must perform their assigned work directly and must not dispatch additional subagents.
Provide the agent with design assumptions so it can report discrepancies:
Dispatch one subagent codebase-investigator to understand testing behavior for this project.
Dispatch a second subagent codebase-investigator (simultaneously) with:
Example query to agent:
Design assumptions from docs/plans/YYYY-MM-DD-feature-design.md:
- Auth service in src/services/auth.ts with login() and logout() functions
- User model in src/models/user.ts with email and password fields
- Test file at tests/services/auth.test.ts
- Uses bcrypt dependency for password hashing
Verify these assumptions and report:
1. What exists vs what design expects
2. Any structural differences (different paths, functions, exports)
3. Any missing or additional components
4. Current dependency versions
Review investigator findings and note any differences from design assumptions.
Based on investigator report, NEVER write:
index.js if exists"config.py (if present)"types.ts"Based on investigator report, ALWAYS write:
src/auth.ts" (investigator confirmed doesn't exist)src/index.ts:45-67" (investigator confirmed exists, checked line numbers)config.py" (investigator confirmed already correct)If codebase state differs from design assumptions: Document the difference and adjust the implementation plan accordingly.
When phases involve external libraries or dependencies, research them before writing tasks.
Use a tiered approach—start with documentation, escalate to source code only when needed.
Use internet-researcher for:
This handles ~80% of external dependency questions. Most integration work follows documented patterns.
Use remote-code-researcher when:
Phase involves external dependency?
├─ No → codebase-investigator only
└─ Yes → What do we need to know?
├─ API usage, standard patterns → internet-researcher
├─ Standard/spec implementation → internet-researcher
├─ Implementation internals, extension points → remote-code-researcher
└─ Both local state + external info → combined-researcher
Dispatch internet-researcher when phase mentions:
Escalate to remote-code-researcher when:
Include external research findings alongside codebase verification:
**External dependency investigation findings:**
- ✓ Stripe SDK uses `stripe.customers.create()` with params: {email, name, metadata}
- ✓ OAuth2 refresh flow per RFC 6749 Section 6
- ✗ Design assumed sync API, but library is async-only
- + Error handling uses typed exception hierarchy (StripeError subclasses)
- 📖 Source: [Official docs | RFC spec | Source code @ commit]
Standards vs Implementation: Standards questions (e.g., "how does OAuth2 work") are internet-researcher territory. Implementation questions (e.g., "how does auth0-js store tokens") may require remote-code-researcher.
Each step is one action (2-5 minutes).
For functionality tasks:
For infrastructure tasks:
Task dependencies MUST be explicit and sequential:
Match task structure to what the design phase specifies.
The design plan distinguishes between infrastructure phases (verified operationally) and functionality phases (verified by tests). Your implementation tasks must honor this distinction.
| Phase Type | Task Structure | Verification |
|------------|----------------|--------------|
| Infrastructure | Create files, configure, verify operationally | Commands succeed (install, build, run) |
| Functionality | Write tests, implement, verify tests pass | Tests pass for the behavior |
Infrastructure tasks (project setup, config files, dependencies):
Functionality tasks (code that does something):
Test behavior, not implementation.
bcrypt.compare() was calledWhat doesn't need tests:
Subcomponent task grouping. Design plans structure phases as subcomponents: types → implementation → tests. When writing tasks for a subcomponent, wrap them in subcomponent markers (see "Task and Subcomponent Markers" section):
<!-- START_SUBCOMPONENT_A (tasks 1-3) -->
<!-- START_TASK_1 -->
### Task 1: TokenPayload type and TokenConfig
...
<!-- END_TASK_1 -->
<!-- START_TASK_2 -->
### Task 2: TokenService implementation
...
<!-- END_TASK_2 -->
<!-- START_TASK_3 -->
### Task 3: TokenService tests
...
<!-- END_TASK_3 -->
<!-- END_SUBCOMPONENT_A -->
The execution agent uses these markers to identify related tasks. The tests task proves the subcomponent works.
Read the design plan's "Done when" section. If it says "build succeeds," don't invent unit tests. If it says "tests pass for X," ensure tasks produce those tests.
Every plan phase document MUST start with this header:
# [Feature Name] Implementation Plan
**Goal:** [One sentence describing what this builds]
**Architecture:** [2-3 sentences about approach]
**Tech Stack:** [Key technologies/libraries]
**Scope:** [N] phases from original design (phases [X-Y] if partial implementation)
**Codebase verified:** [Date/time of verification]
---
## Acceptance Criteria Coverage
This phase implements and tests:
### {slug}.AC1: [Criterion heading from design plan]
- **{slug}.AC1.1 Success:** [Copied literally from design plan]
- **{slug}.AC1.3 Failure:** [Copied literally from design plan]
### {slug}.AC2: [Criterion heading from design plan]
- **{slug}.AC2.1 Success:** [Copied literally from design plan]
---
AC Coverage rules:
oauth2-svc-authn.AC1.1), not bare AC1.1{slug}.AC1) and the specific cases ({slug}.AC1.1, {slug}.AC1.3)Wrap every task and subcomponent in HTML comment markers to enable efficient parsing during execution.
Every task MUST be wrapped:
<!-- START_TASK_1 -->
### Task 1: [Task Name]
...task content...
<!-- END_TASK_1 -->
<!-- START_TASK_2 -->
### Task 2: [Task Name]
...task content...
<!-- END_TASK_2 -->
When tasks form a logical subcomponent (e.g., types → implementation → tests), wrap the group:
<!-- START_SUBCOMPONENT_A (tasks 3-5) -->
<!-- START_TASK_3 -->
### Task 3: TokenService types
...
<!-- END_TASK_3 -->
<!-- START_TASK_4 -->
### Task 4: TokenService implementation
...
<!-- END_TASK_4 -->
<!-- START_TASK_5 -->
### Task 5: TokenService tests
...
<!-- END_TASK_5 -->
<!-- END_SUBCOMPONENT_A -->
Key rules:
START_TASK_1, START_TASK_2, etc.START_SUBCOMPONENT_A, START_SUBCOMPONENT_B, etc.(tasks 3-5)Why markers:
START_TASK_ to list all tasks without reading full contentWorkflow depends on review mode selected above.
Step 0: Create granular task tracker with dependencies
After verifying scope (≤8 phases), use TaskCreate to create granular sub-tasks for EACH phase. This structure survives context compaction.
CRITICAL: Include absolute paths and set up dependencies.
Before creating tasks, capture absolute paths:
DESIGN_PATH: Absolute path to design plan (e.g., /Users/ed/project/docs/design-plans/2025-01-24-feature.md)PLAN_DIR: Absolute path to implementation plan directory (e.g., /Users/ed/project/docs/implementation-plans/2025-01-24-feature/)SCRATCHPAD_DIR: Absolute path to temp directory for subagent scratch files (e.g., /tmp/plan-2025-01-24-feature-a7f3b2/)Generate a unique session ID for SCRATCHPAD_DIR:
SESSION_ID=$(printf '%04x%04x' $RANDOM $RANDOM)
echo "/tmp/plan-$(date +%Y-%m-%d)-${slug}-${SESSION_ID}"
The session ID (e.g., a7f3b2) ensures isolation between:
SCRATCHPAD_DIR ensures session isolation. Code reviewers and other subagents should write any temp files here, not to shared locations like /tmp/.
Read the Acceptance Criteria section from the design plan. Acceptance criteria are numbered (AC1, AC1.1, AC1.2, etc.) and define what "done" means. When writing each phase:
For each phase N, create these tasks with dependencies:
- [ ] Phase NA: Read [Phase Name] from {DESIGN_PATH}
→ blocked by: Phase (N-1)D (or nothing if N=1)
- [ ] Phase NB: Investigate codebase for Phase N and activate relevant skills
→ blocked by: Phase NA
- [ ] Phase NC: Research external deps (Phase N)
→ blocked by: Phase NB
- [ ] Phase ND: Write {PLAN_DIR}/phase_0N.md
→ blocked by: Phase NC
VERBATIM TASK NAMES — DO NOT PARAPHRASE. Copy task names exactly as shown above. "Investigate codebase for Phase N and activate relevant skills" must include "and activate relevant skills" — that phrase triggers skill activation after compaction. Paraphrasing loses critical instructions.
After all phase tasks, create finalization task:
Before creating the Finalization task, check if .ed3d/implementation-plan-guidance.md exists. If it does, include its absolute path in the task description:
# If .ed3d/implementation-plan-guidance.md exists:
- [ ] Finalization: Run code-reviewer over all phase files (guidance: [absolute path to .ed3d/implementation-plan-guidance.md]), fix ALL issues including minor ones
→ blocked by: all Phase *D tasks
# If .ed3d/implementation-plan-guidance.md does NOT exist:
- [ ] Finalization: Run code-reviewer over all phase files, fix ALL issues including minor ones
→ blocked by: all Phase *D tasks
Example for a 3-phase design at /Users/ed/project/docs/design-plans/2025-01-24-oauth.md:
TaskCreate: "Phase 1A: Read Token Types from /Users/ed/project/docs/design-plans/2025-01-24-oauth.md"
TaskCreate: "Phase 1B: Investigate codebase for Phase 1 and activate relevant skills"
→ TaskUpdate: addBlockedBy: [1A]
TaskCreate: "Phase 1C: Research external deps (Phase 1)"
→ TaskUpdate: addBlockedBy: [1B]
TaskCreate: "Phase 1D: Write /Users/ed/project/docs/implementation-plans/2025-01-24-oauth/phase_01.md"
→ TaskUpdate: addBlockedBy: [1C]
TaskCreate: "Phase 2A: Read Token Service from /Users/ed/project/docs/design-plans/2025-01-24-oauth.md"
→ TaskUpdate: addBlockedBy: [1D]
TaskCreate: "Phase 2B: Investigate codebase for Phase 2 and activate relevant skills"
→ TaskUpdate: addBlockedBy: [2A]
TaskCreate: "Phase 2C: Research external deps (Phase 2)"
→ TaskUpdate: addBlockedBy: [2B]
TaskCreate: "Phase 2D: Write /Users/ed/project/docs/implementation-plans/2025-01-24-oauth/phase_02.md"
→ TaskUpdate: addBlockedBy: [2C]
TaskCreate: "Phase 3A: Read Session Manager from /Users/ed/project/docs/design-plans/2025-01-24-oauth.md"
→ TaskUpdate: addBlockedBy: [2D]
TaskCreate: "Phase 3B: Investigate codebase for Phase 3 and activate relevant skills"
→ TaskUpdate: addBlockedBy: [3A]
TaskCreate: "Phase 3C: Research external deps (Phase 3)"
→ TaskUpdate: addBlockedBy: [3B]
TaskCreate: "Phase 3D: Write /Users/ed/project/docs/implementation-plans/2025-01-24-oauth/phase_03.md"
→ TaskUpdate: addBlockedBy: [3C]
TaskCreate: "Finalization: Run code-reviewer over all phase files, fix ALL issues including minor ones"
→ TaskUpdate: addBlockedBy: [1D, 2D, 3D]
TaskCreate: "Test Requirements: Generate test-requirements.md from Acceptance Criteria"
→ TaskUpdate: addBlockedBy: [Finalization]
Why absolute paths in task descriptions: After compaction, the task list is all that remains. Absolute paths ensure you know exactly which files to read/write without relying on context.
Why dependencies: Tasks show [blocked by #X, #Y] in the task list, making execution order explicit and preventing out-of-order work.
Use TaskUpdate to mark each sub-task as in_progress when starting, completed when done.
---
Workflow for EACH phase (using granular task tracking):
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.