# Fix Plan: [Issue Title]

**Generated by:** reis_debugger  
**Date:** [timestamp]  
**Issue Type:** [type]  
**Original Plan:** [path to original PLAN.md]

---

## Objective
[One-sentence fix goal]

**For incomplete implementations:**
Complete the missing deliverables from [original plan name]

## Context

### Original Issue
[Brief description of the problem]

**For incomplete implementations:**
- **Original Plan:** [path]
- **Completeness:** [X]% ([Y]/[Z] tasks)
- **Completed Successfully:**
  - Task 1: [Name] ✅
  - Task 3: [Name] ✅
- **Missing:**
  - Task 2: [Name] ❌
- **Root Cause:** [Executor Skip | Plan Ambiguity | Dependency Blocker]
- **Evidence:** [specific evidence]

### Why This Fix
[Rationale for the approach]

**For incomplete implementations:**
This fix plan implements ONLY the missing features. Completed features will NOT be re-implemented to avoid wasted effort and risk of regression.

### Constraints
- [List any constraints or requirements]

**For incomplete implementations:**
- **DO NOT** modify completed Tasks [1, 3]
- **DO NOT** re-implement working features
- **ONLY** add missing Task 2 deliverables
- Ensure integration with existing code

---

## Dependencies
- [List any dependencies]

**For incomplete implementations:**
- Completed tasks from original plan (Tasks 1, 3)
- Original plan file: [path]

---

## Wave Fix-1: [Fix Description]

**Size:** [SMALL|MEDIUM|LARGE] ([time estimate])  
**Risk:** [LOW|MEDIUM|HIGH]

### Tasks

<task type="auto">
<name>[Specific fix task]</name>
<files>[Exact file paths]</files>
<action>
[Detailed implementation instructions]

**For incomplete implementations:**
Implement the missing [feature name] from original Task [N].

**Specific steps:**
1. [Step 1]
2. [Step 2]
3. [Step 3]

**Integration points:**
- Connect with [existing completed feature]
- Use [existing utility/function from completed tasks]
- Follow patterns from [completed task reference]

**What to avoid:**
- Modifying completed Task [X] code
- Duplicating functionality from completed features
- Breaking existing tests

**Why:**
- Maintains stability of working features
- Minimizes risk of regression
- Focused implementation
</action>
<verify>
[Specific verification commands]

**For incomplete implementations:**
```bash
# Verify missing deliverable now exists
test -f [missing-file.js] && echo "✓ Missing file created"

# Verify feature works
[test command for new feature]

# Verify no regression on completed features
npm test -- [completed-feature].test.js
```
</verify>
<done>
[Acceptance criteria]

**For incomplete implementations:**
- Missing deliverable [file/feature] now exists
- Tests pass for new feature
- Integration with completed features verified
- No regression on Tasks [1, 3]
- Overall plan completeness now 100%
</done>
</task>

---

## Success Criteria

**For bugs:**
- ✅ [Specific outcome 1]
- ✅ [Specific outcome 2]
- ✅ Tests pass
- ✅ No regressions

**For incomplete implementations:**
- ✅ All missing deliverables implemented
- ✅ Feature completeness: 100% ([Z]/[Z] tasks)
- ✅ New features integrated with completed work
- ✅ No impact on completed Tasks [1, 3]
- ✅ All tests pass (new + existing)
- ✅ Original plan verification now succeeds

---

## Verification

### Overall Checks
```bash
# Run full test suite
npm test

# Verify specific fix
[fix-specific verification commands]
```

**For incomplete implementations:**
```bash
# Verify missing items now exist
test -f [missing-file-1.js] && echo "✓ File 1 exists"
test -f [missing-file-2.js] && echo "✓ File 2 exists"

# Run verifier on original plan
reis verify [original-plan-path]
# Should now show 100% complete

# Verify no regression on completed features
npm test -- [completed-features].test.js

# Check git diff - should only show new files for missing features
git diff --name-only | grep -v [new-feature-files]
# Should be empty (no changes to completed features)
```

### Regression Checks
```bash
# Ensure existing features still work
[regression test commands]
```

---

## Notes

### Implementation Guidance
[Additional notes for executor]

**For incomplete implementations:**
- Focus ONLY on missing Task [N]
- Reference completed tasks for patterns/utilities
- Do not refactor or optimize completed code
- Keep changes isolated to new feature

### Edge Cases
[Any edge cases to handle]

### References
- Original plan: [path]
- Related patterns: [if any]
- Debug report: [path]

---

## Prevention Measures

**For incomplete implementations:**

### For This Plan
1. **Clearer Task Description**
   - Original Task [N] description was: "[original]"
   - Should include: Explicit file paths, acceptance criteria with file existence checks
   
2. **Complexity Assessment**
   - Task estimated complexity: [simple|moderate|high]
   - Should break into sub-tasks if > 45 min

3. **Verification Checkpoint**
   - Add task-level verification: `test -f [deliverable.js]`
   - Prevent moving to next task until verified

### For Future Plans
1. All tasks include explicit deliverables list
2. File existence checks in verification
3. Task complexity scoring in wave assignment
4. Checkpoints for multi-file tasks
