|
| 1 | +# Issue-to-PR Workflow |
| 2 | + |
| 3 | +The mechanical workflow that delivers value: from GitHub issue to merged pull request. |
| 4 | + |
| 5 | +## The Complete Flow |
| 6 | + |
| 7 | +``` |
| 8 | +GitHub Issue → Planning Mode → Implementation → Pull Request → Review → Merge |
| 9 | +``` |
| 10 | + |
| 11 | +## Step-by-Step Mechanics |
| 12 | + |
| 13 | +### 1. GitHub Issue Defines the Work |
| 14 | + |
| 15 | +Every task starts as a GitHub issue: |
| 16 | +- Clear problem statement |
| 17 | +- Success criteria defined |
| 18 | +- Labels automatically assigned by Claude Code GitHub Action based on principles |
| 19 | + |
| 20 | +**Anti-pattern**: Starting work without an issue leads to scope creep and unclear PRs. |
| 21 | + |
| 22 | +### 2. Planning Mode Review |
| 23 | + |
| 24 | +Run `/close-issue <number>` with planning mode (default): |
| 25 | +- Claude analyzes the issue |
| 26 | +- Presents a plan for review |
| 27 | +- You approve, refine, or reject |
| 28 | + |
| 29 | +**Key insight**: This shifts you from "driving" to "managing" - you review plans, not implementation details. |
| 30 | + |
| 31 | +### 3. Implementation in Isolation |
| 32 | + |
| 33 | +Once plan is approved: |
| 34 | +- Automatic worktree creation for complete isolation |
| 35 | +- Claude implements in focused sessions |
| 36 | +- Each commit represents verified progress |
| 37 | + |
| 38 | +**Tools involved**: |
| 39 | +- [Git worktrees](worktree-workflow.md) for isolation |
| 40 | +- [Git workflow](git-workflow.md) for commits |
| 41 | +- MCP tools for file operations |
| 42 | + |
| 43 | +### 4. Pull Request Packages the Solution |
| 44 | + |
| 45 | +Implementation complete: |
| 46 | +- Push branch to remote |
| 47 | +- Create PR referencing "Closes #<issue>" |
| 48 | +- PR description explains the solution |
| 49 | + |
| 50 | +**Quality gates**: |
| 51 | +- Small, focused changes (planning mode enables this) |
| 52 | +- Clear connection to original issue |
| 53 | +- Tests pass, linting clean |
| 54 | + |
| 55 | +### 5. Review Completes the Cycle |
| 56 | + |
| 57 | +PR review happens at the right altitude: |
| 58 | +- Review the solution, not individual lines |
| 59 | +- Verify it solves the original issue |
| 60 | +- Merge when approved |
| 61 | + |
| 62 | +### 6. Post-Merge Workflow |
| 63 | + |
| 64 | +After merging via GitHub UI: |
| 65 | +1. Exit Claude Code |
| 66 | +2. `git checkout main` |
| 67 | +3. `git pull origin main` |
| 68 | +4. `source setup.sh` |
| 69 | +5. Start new terminal session |
| 70 | +6. Restart Claude Code: |
| 71 | + - Resume last chat for context continuity |
| 72 | + - Or start fresh for new work |
| 73 | + |
| 74 | +**Note**: This manual process ensures clean environment and updated configurations. |
| 75 | + |
| 76 | +### 7. Optional: Post-PR Retro |
| 77 | + |
| 78 | +For significant work: |
| 79 | +- Run [post-PR mini retro](post-pr-mini-retro.md) |
| 80 | +- Capture learnings |
| 81 | +- Update procedures if needed |
| 82 | + |
| 83 | +## Why This Works |
| 84 | + |
| 85 | +1. **Clear boundaries**: Issues define WHAT, PRs deliver solutions |
| 86 | +2. **Parallel execution**: Multiple issues → multiple agents → multiple PRs |
| 87 | +3. **Quality through planning**: Better plans = better PRs |
| 88 | +4. **Reduced cognitive load**: Review plans and PRs, not live coding |
| 89 | + |
| 90 | +## Configuration |
| 91 | + |
| 92 | +Planning mode should be enabled by default for all users: |
| 93 | +```bash |
| 94 | +# In ~/.claude/settings.json |
| 95 | +{ |
| 96 | + "defaultMode": "plan" |
| 97 | +} |
| 98 | +``` |
| 99 | + |
| 100 | +**Recommendation**: Add this to your `setup.sh` or dotfiles to ensure all team members start with planning mode enabled. This enforces OSE principles from day one. |
| 101 | + |
| 102 | +## Related |
| 103 | + |
| 104 | +- [tmux + git worktrees + Claude Code + Planning Mode](tmux-git-worktrees-claude-code.md) - The complete productivity system |
| 105 | +- [OSE Principle](../principles/ose.md) - Why this workflow embodies management over doing |
0 commit comments