# Merge Validation Checklist

> ✅ **Works with any IDE** - This checklist provides comprehensive merge validation steps

## Pre-Merge Validation

### Story Completion

- [ ] All stories in "Review" or "Done" status
- [ ] All tasks marked complete [x] in stories
- [ ] Dev Agent Records updated with completion notes
- [ ] Debug logs reviewed and cleaned
- [ ] Change logs updated with version info

### Quality Verification

- [ ] All unit tests passing
- [ ] Integration tests passing
- [ ] Test coverage meets requirements (≥80%)
- [ ] ESLint/linting clean (0 errors)
- [ ] Build successful on all branches
- [ ] Performance benchmarks met
- [ ] Security scans passed

### Code Review

- [ ] Code follows project conventions
- [ ] No commented-out code blocks
- [ ] No debug console.logs remaining
- [ ] Documentation updated
- [ ] API changes documented
- [ ] Breaking changes identified

### Worktree Status

- [ ] All worktrees have pushed changes
- [ ] No uncommitted changes in worktrees
- [ ] Feature branches up to date with base
- [ ] No stale worktrees remaining

## Merge Preparation

### Conflict Analysis

- [ ] Merge conflicts identified
- [ ] Conflict resolution strategy defined
- [ ] Affected files backed up
- [ ] Team members notified of conflicts

### Integration Order

- [ ] Dependency order determined
- [ ] Foundation changes merged first
- [ ] Feature branches sequenced correctly
- [ ] UI changes merged last

### Branch Preparation

- [ ] Base branch (main/develop) up to date
- [ ] Feature branches rebased if needed
- [ ] Commit messages follow convention
- [ ] Squash commits if required

## Merge Execution

### Sequential Merge Process

- [ ] First wave branches merged
- [ ] Tests run after each merge
- [ ] Conflicts resolved as encountered
- [ ] Build verified after each merge

### Quality Gates Between Merges

- [ ] Tests still passing
- [ ] No regression detected
- [ ] Performance unchanged
- [ ] Integration verified

### Conflict Resolution

- [ ] Conflicts resolved correctly
- [ ] Both versions considered
- [ ] Business logic preserved
- [ ] Tests updated for changes

## Post-Merge Validation

### Comprehensive Testing

- [ ] Full test suite executed
- [ ] E2E tests passing
- [ ] Manual smoke tests completed
- [ ] Performance tests run
- [ ] Security scan repeated

### Integration Verification

- [ ] All features working together
- [ ] No feature interactions broken
- [ ] Data flow correct
- [ ] UI consistency maintained

### Documentation Update

- [ ] README updated if needed
- [ ] API documentation current
- [ ] Architecture diagrams updated
- [ ] Deployment notes added

### Story Finalization

- [ ] All stories marked "Done"
- [ ] Sprint board updated
- [ ] Stakeholders notified
- [ ] Demo prepared if needed

## Cleanup Activities

### Worktree Cleanup

- [ ] All worktrees removed
- [ ] Feature branches deleted (or archived)
- [ ] Local branches cleaned
- [ ] Remote tracking updated

### Coordination Cleanup

- [ ] Orchestrator files archived
- [ ] Temporary files removed
- [ ] Logs archived for reference
- [ ] Metrics captured for retrospective

## Final Verification

### Production Readiness

- [ ] Code ready for deployment
- [ ] No known issues remaining
- [ ] Performance acceptable
- [ ] Security validated
- [ ] Rollback plan ready

### Team Sign-off

- [ ] Developer confirmation
- [ ] QA approval
- [ ] Scrum Master sign-off
- [ ] Product Owner acceptance

## Merge Command Execution

```bash
# Start merge process
/stories:merge all

# Or manual merge
git checkout main
git merge feature/story-1-1
git merge feature/story-1-2
# ... continue for all branches
```

## Rollback Procedure

If issues detected post-merge:

1. [ ] Stop further merges
2. [ ] Identify problem commit
3. [ ] Execute rollback plan
4. [ ] Notify team
5. [ ] Document lessons learned

---

**Critical**: Do not proceed to deployment until all items are verified. Post-merge issues are costly to fix.
