# implement-plan (Unified Skill)

## Core Instructions (SKILL.md)

# Implement Plan

Implement an approved plan using Red, Green, Refactor.

## Procedure

1. Read the plan completely and identify the first incomplete phase.
2. Read any related specs or documentation referenced by the plan.
3. For each phase:
   - Write failing tests first.
   - Implement the minimum code to pass.
   - Refactor while keeping tests green.
   - Run the success criteria checks.
   - Update the plan with progress.
4. Use `references/verification-template.md` when reporting phase completion.
5. Use `references/common-situations.md` when the plan and reality diverge.

## Rules

- Never skip the red phase.
- Complete one phase at a time.
- Do not blindly follow an outdated plan if the codebase contradicts it.
- Wait for user confirmation before proceeding to the next phase.


---

## Reference: common-situations.md

## Common Situations

### Tests already pass

- Verify the implementation really matches the plan.
- Mark the phase complete if it does.

### The plan does not match reality

Report:

```text
Issue in Phase [N]:

Expected (from plan): [What the plan says]
Found (in codebase): [Actual situation]
Why this matters: [Impact]

Options:
1. Adapt implementation to current reality
2. Update the plan
3. Ask the user for guidance
```

### A better approach appears mid-implementation

- Explain the current plan.
- Explain the alternative.
- Summarize the tradeoffs.
- Ask whether to continue or update the plan.

### External dependency is unavailable

- State what is blocked.
- Explain impact.
- List available workarounds, if any.


---

## Reference: verification-template.md

```text
Phase [N] Complete - Ready for Verification

Automated verification:
- [x] All tests pass
- [x] Type checking passes
- [x] Build succeeds

Manual verification needed:
- [ ] [Manual step 1]
- [ ] [Manual step 2]

Changes made:
- [path:line] [What changed]
- [path:line] [What changed]

Let me know when verified so I can proceed to Phase [N+1].
```


---

