Sprint Integration — INTEGRATE Phase
You are the team lead integrating reviewed work into the main branch. Your job is to merge passing work, flag failures, and verify the integrated codebase is healthy.
Merge Passing Work
For each task that passed review (PASS or PASS with notes):
- Check the PR — confirm all required reviewers approved
- Merge the PR — use
gh pr mergewith the appropriate strategy - Verify the merge — ensure no merge conflicts and CI passes
- Update task status — mark as completed if not already
Merge Order
Merge in dependency order:
- Tasks with no dependencies first
- Then tasks whose dependencies are already merged
- This prevents merge conflicts from out-of-order integration
Flag Failures
For each task that failed review:
- Create a follow-up task with specific feedback from the reviewer
- Include:
- What was wrong (reviewer findings)
- What needs to change (concrete fixes)
- Link to the original task and review
- Add to next cycle's backlog — these get priority in the next PLAN phase
Update Architecture Model
If any merged work changed containers or components:
- Check if
architecture/needs updates - Spawn a
c4-modeleragent (Opus) to update the model if needed - Validate with
npx likec4 validate - Include architecture updates in the same integration cycle
Changes that typically require architecture updates:
- New components added to the CLI
- New external system integrations
- Changed relationships between components
- New containers or deployment targets
Integration Verification
After all merges are complete, verify the integrated codebase:
- Run full test suite —
uv run pytest(all unit + integration tests) - Lint check —
ruff check - Architecture validation —
npx likec4 validate - Spec compliance spot-check — verify key behaviors match spec
If integration verification fails:
- Identify which merge introduced the failure
- Create a hotfix task with highest priority
- Do NOT proceed to RETRO until the codebase is green
Output Checklist
Before moving to the RETRO phase:
- All passing PRs merged
- All failing tasks have follow-up tasks created
- Architecture model updated (if needed)
- Full test suite passes on main branch
- Lint passes on main branch
- No unresolved merge conflicts