# Implementation Plan: {FEATURE_NAME}

**Phase**: Implementation Planning  
**Date**: {DATE}  
**Iteration**: {ITERATION_ID}

## Status Indicators
- ⬜ Not started
- 🔄 In progress
- ⏸️ On hold
- ✅ Done

## Overview

[High-level implementation approach in 2-3 sentences]

## Atomic Task Criteria

All tasks MUST meet these 7 criteria to be considered atomic and agent-executable:

1. **Max 3 files**: Task modifies at most 3 files
2. **15-30 minutes**: Completable by an agent in one session
3. **Single outcome**: One clear, testable result
4. **Specific paths**: Exact file paths provided (no wildcards)
5. **Clear dependencies**: Explicit prerequisite tasks listed
6. **Success criteria**: Unambiguous completion definition
7. **No ambiguity**: Zero room for interpretation

## Work Items

### ⬜ Item #1: Set up structure
**Component**: [Component name]  
**Files**: [List specific files, max 3]  
**Priority**: High  
**Dependencies**: None  
**Done when**: Foundation is ready

### ⬜ Item #2: Define interfaces
**Component**: [Component name]  
**Files**: [List specific files, max 3]  
**Priority**: High  
**Dependencies**: Item #1  
**Done when**: All interfaces defined

### ⬜ Item #3: Implement core logic
**Component**: [Component name]  
**Files**: [List specific files, max 3]  
**Priority**: High  
**Dependencies**: Item #2  
**Done when**: Core functionality works

### ⬜ Item #4: Add error handling
**Component**: [Component name]  
**Files**: [List specific files, max 3]  
**Priority**: Medium  
**Dependencies**: Item #3  
**Done when**: Errors handled gracefully

### ⬜ Item #5: Add validation
**Component**: [Component name]  
**Files**: [List specific files, max 3]  
**Priority**: Medium  
**Dependencies**: Item #3  
**Done when**: Input/output validated

### ⬜ Item #6: Performance optimization
**Component**: [Component name]  
**Files**: [List specific files, max 3]  
**Priority**: Low  
**Dependencies**: Items #3, #4, #5  
**Done when**: Meets performance targets

[Add more items as needed - each must meet atomic criteria]

## Implementation Sequence

```
Stage 1: Foundation (Items 1-2)
   ↓
Stage 2: Core Logic (Items 3-4)
   ↓
Stage 3: Quality (Items 5-6)
   ↓
Stage 4: Integration & Polish
```

## Development Checklist

### Setup
- [ ] Create workspace
- [ ] Set up environment
- [ ] Configure tools

### Implementation
- [ ] Component structure
- [ ] Core logic
- [ ] Error handling
- [ ] Validation
- [ ] Performance tuning

### Quality
- [ ] Code review
- [ ] Test coverage
- [ ] Documentation

## Dependencies

- [Required component/library]
- [External service access]
- [Other prerequisites]

## Risks

| Risk | Mitigation |
|------|------------|
| [Technical risk] | [How we'll handle] |
| [Schedule risk] | [How we'll handle] |

## Organization

[Project-specific structure will be determined based on existing patterns]

## Review Points

- [ ] Design review complete
- [ ] Progress check at 50%
- [ ] Final review before completion

## Success Criteria

- [ ] All work items completed
- [ ] Tests passing
- [ ] Quality targets met
- [ ] Documentation updated

## Task Breakdown Guidelines

When creating tasks, ensure they are truly atomic:

**Good Task Example**:
```
Task: Add user authentication endpoint
Files: 
  - src/routes/auth.ts
  - src/middleware/authenticate.ts
  - src/types/auth.d.ts
Dependencies: Item #2 (interfaces defined)
Done when: POST /auth/login returns JWT token on valid credentials
```

**Bad Task Example (too broad)**:
```
Task: Implement authentication system
Files: Multiple files across the codebase
Done when: Authentication works
```

If a task seems too large, break it down:
- Authentication system → 
  - Define auth interfaces (1 task)
  - Create login endpoint (1 task)
  - Add JWT middleware (1 task)
  - Add logout endpoint (1 task)
  - Add session management (1 task)

---
Next: `/eg:implement {instance-name} @.eg/{instance-name}/plan.md`