Skip to main content

Implement Plan

System Prompt

⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:

  1. IMMEDIATELY execute - no questions, no explanations first
  2. ALWAYS show full output from script/tool execution
  3. ALWAYS provide summary after execution completes

DO NOT:

  • Say "I don't need to take action" - you ALWAYS execute when invoked
  • Ask for confirmation unless requires_confirmation: true in frontmatter
  • Skip execution even if it seems redundant - run it anyway

The user invoking the command IS the confirmation.


Usage

/implement-plan

Implement plan from: $ARGUMENTS

You are tasked with implementing an approved technical plan from thoughts/shared/plans/. These plans contain phases with specific changes and success criteria.

Arguments

$ARGUMENTS - Plan File Path (required)

Specify the plan to implement:

  • Relative path: "thoughts/shared/plans/eng-123-feature.md"
  • Absolute path: Full path to plan file
  • With context: "Implement plan at thoughts/shared/plans/fix-auth.md for ENG-456"

Default Behavior

If no plan path:

  • Prompts for plan file path
  • Reads plan completely
  • Checks existing progress (checkmarks)
  • Creates todo list for tracking
  • Begins implementation

Getting Started

When given a plan path:

  • Read the plan completely and check for any existing checkmarks (- [x])
  • Read the original ticket and all files mentioned in the plan
  • Read files fully - never use limit/offset parameters, you need complete context
  • Think deeply about how the pieces fit together
  • Create a todo list to track your progress
  • Start implementing if you understand what needs to be done

If no plan path provided, ask for one.

Implementation Philosophy

Plans are carefully designed, but reality can be messy. Your job is to:

  • Follow the plan's intent while adapting to what you find
  • Implement each phase fully before moving to the next
  • Verify your work makes sense in the broader codebase context
  • Update checkboxes in the plan as you complete sections

When things don't match the plan exactly, think about why and communicate clearly. The plan is your guide, but your judgment matters too.

If you encounter a mismatch:

  • STOP and think deeply about why the plan can't be followed
  • Present the issue clearly:
    Issue in Phase [N]:
    Expected: [what the plan says]
    Found: [actual situation]
    Why this matters: [explanation]

    How should I proceed?

Verification Approach

After implementing a phase:

  • Run the success criteria checks (usually make check test covers everything)
  • Fix any issues before proceeding
  • Update your progress in both the plan and your todos
  • Check off completed items in the plan file itself using Edit
  • Pause for human verification: After completing all automated verification for a phase, pause and inform the human that the phase is ready for manual testing. Use this format:
    Phase [N] Complete - Ready for Manual Verification

    Automated verification passed:
    - [List automated checks that passed]

    Please perform the manual verification steps listed in the plan:
    - [List manual verification items from the plan]

    Let me know when manual testing is complete so I can proceed to Phase [N+1].

If instructed to execute multiple phases consecutively, skip the pause until the last phase. Otherwise, assume you are just doing one phase.

do not check off items in the manual testing steps until confirmed by the user.

If You Get Stuck

When something isn't working as expected:

  • First, make sure you've read and understood all the relevant code
  • Consider if the codebase has evolved since the plan was written
  • Present the mismatch clearly and ask for guidance

Use sub-tasks sparingly - mainly for targeted debugging or exploring unfamiliar territory.

Resuming Work

If the plan has existing checkmarks:

  • Trust that completed work is done
  • Pick up from the first unchecked item
  • Verify previous work only if something seems off

Remember: You're implementing a solution, not just checking boxes. Keep the end goal in mind and maintain forward momentum.

Action Policy

<default_behavior> This command implements changes by default when user intent is clear. Proceeds with:

  • Code generation/modification
  • File creation/updates
  • Configuration changes
  • Git operations (if applicable)

Provides concise progress updates during execution. </default_behavior>

After execution, verify: - Files created/modified as intended - Code compiles/tests pass (if applicable) - Git changes committed (if applicable) - Next recommended step provided

Success Output

When plan implementation completes:

✅ COMMAND COMPLETE: /implement-plan
Plan: <plan-file-path>
Phases: N/N complete
Tasks: N completed
Tests: All passing
Status: Ready for manual verification

Completion Checklist

Before marking complete:

  • Plan read completely
  • Files read (no limit/offset)
  • Todo list created
  • Each phase implemented
  • Checkboxes updated
  • Tests passing

Failure Indicators

This command has FAILED if:

  • ❌ No plan path provided
  • ❌ Plan not found
  • ❌ Tests failing
  • ❌ Phase incomplete

Clear Examples

Example 1: Implement Feature Plan

Input:

/implement-plan thoughts/shared/plans/eng-123-user-settings.md

Expected Output:

📋 Plan Loaded: eng-123-user-settings.md

## Phase 1: Database Schema ✓
- [x] Create user_settings table migration
- [x] Add indexes for tenant_id lookup
- [x] Run migration on test database

## Phase 2: API Endpoints (IN PROGRESS)
- [x] GET /api/v1/users/{id}/settings
- [ ] PUT /api/v1/users/{id}/settings
- [ ] PATCH /api/v1/users/{id}/settings

Progress: 60% complete
Next: Implement PUT endpoint

✅ COMMAND COMPLETE: /implement-plan
Phase 1: Complete
Phase 2: 1/3 tasks done

Example 2: Resume Implementation

Input:

/implement-plan thoughts/shared/plans/fix-auth-flow.md

Expected Output:

📋 Plan Loaded: fix-auth-flow.md

Detected existing progress:
- Phase 1: ✓ Complete (3/3 tasks)
- Phase 2: ✓ Complete (2/2 tasks)
- Phase 3: In progress (1/4 tasks)

Resuming from Phase 3, Task 2...

## Phase 3: Token Refresh
- [x] Implement refresh endpoint
- [ ] Add token rotation logic
- [ ] Update client SDK
- [ ] Add integration tests

Continuing implementation...

Recovery Steps

If this command fails:

  1. Plan file not found

    • Cause: Path incorrect or file moved
    • Fix: Check path, use ls thoughts/shared/plans/
    • Example: Use full path from repository root
  2. Plan format not recognized

    • Cause: Missing phase markers or checkboxes
    • Fix: Ensure plan uses ## Phase N and - [ ] format
    • Template: See thoughts/shared/templates/plan-template.md
  3. Implementation conflicts with codebase

    • Cause: Codebase changed since plan was written
    • Fix: STOP, update plan with current state
    • Never: Force implementation that doesn't fit
  4. Tests failing after changes

    • Cause: Implementation doesn't match existing code
    • Fix: Review failing tests, adjust implementation
    • Verify: Run tests after each phase

Context Requirements

Before using this command, verify:

  • Plan file exists at specified path
  • Plan has been approved (not draft)
  • All files mentioned in plan are accessible
  • Test suite can be run after changes

Plan Format Requirements:

ElementFormatExample
Phases## Phase N: Title## Phase 1: Database
Tasks- [ ] Task description- [ ] Create migration
Completed- [x] Task description- [x] Add indexes
FilesBackticks or linkssrc/api/settings.rs

When NOT to Use

Do NOT use when:

  • No approved plan exists
  • Plan still in review
  • Quick fix needed (use direct edit)

Anti-Patterns (Avoid)

Anti-PatternProblemSolution
Skip readingMissing contextRead files completely
Ignore mismatchesWrong implementationSTOP and communicate
Force failuresSilent bugsFix before proceeding

Principles

This command embodies:

  • #3 Complete Execution - Full plan execution
  • #9 Based on Facts - Follow approved plan
  • #6 Clear, Understandable - Clear phase completion

Full Standard: CODITECT-STANDARD-AUTOMATION.md