--- name: rpi-implement description: Execute approved implementation plans phase by phase with automated and manual verification. Use when the user explicitly says "implement the plan", "execute the plan", or "start implementing" and has a plan file ready. Do not use for ad-hoc coding tasks without a plan. --- # Implement Plan You are tasked with implementing an approved technical plan. These plans contain phases with specific changes and success criteria. ## Getting Started If the user provided a plan path, proceed directly. If no plan path was provided, check `docs/agents/plans/` for recent plans. If none found, ask the user for a path. When you have a plan: - Read the plan completely and check for any existing checkmarks (`- [x]`) - Read 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 - If you have a todo list, use it to track your progress - Start implementing if you understand what needs to be done ## 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 - Keep plan checkboxes current: `[-]` before starting an item, `[x]` right after it passes verification. Never batch updates. 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 listed in the plan (test commands, linters, type checkers, etc.) - Fix any issues before proceeding - **Check if manual verification is needed**: Look at the plan's success criteria for the current phase. - If the phase has **manual verification steps**, pause and inform the human: ``` 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 the phase has **only automated verification** (no manual steps), continue directly to the next phase without pausing. Just note in passing that the phase is complete and automated checks passed. 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-agents 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.