Skill: chained-pr
Chained PRs. Large changes broken into reviewable chunks that protect reviewer cognitive load.
Activation Contract
Load this skill when:
- A planned PR may exceed 300 changed lines
- SDD forecasts
300-line budget risk: High or Chained PRs recommended: Yes
- The user asks for chained/stacked PRs or review slices
Hard Rules
- Split PRs over 300 changed lines unless a maintainer explicitly accepts
size:exception
- Keep each PR reviewable in ≤60 minutes
- One deliverable work unit per PR; keep tests/docs with the unit they verify
- State start, end, prior dependencies, follow-up work, and out-of-scope in every chained PR
- Every child PR must include a dependency diagram marking the current PR with
📍
- Do not mix chain strategies after the user chooses one
Decision Gates
| Condition |
Action |
| PR ≤300 changed lines and focused |
Keep single PR |
| PR >300, each slice can land independently |
Use Stacked PRs to main |
| PR >300, feature must integrate before main |
Use Feature Branch Chain with tracker |
| Generated/vendor/migration diff cannot split cleanly |
Ask maintainer for size:exception |
SDD provides delivery_strategy |
Follow it before apply/PR creation |
Strategy A: Stacked PRs to Main
main ← PR1 (refactor base)
← PR2 (core logic, base = PR1)
← PR3 (integration, base = PR2)
- PR1 targets main, gets reviewed and merged
- PR2 targets main, but code based on PR1
- PR3 targets main, but code based on PR2
- Each merge updates main, next PR rebases
Strategy B: Feature Branch Chain (with Tracker)
main ←──── feature/auth (tracker PR, draft, no merge)
← feat/auth-validate (PR #1)
← feat/auth-middleware (PR #2, base = PR #1)
← feat/auth-integrate (PR #3, base = PR #2)
- Create tracker PR
feature/auth → draft, targets main, never merged
- PR #1 targets
feature/auth, reviewed and merged into tracker
- PR #2 targets PR #1's branch, reviewed and merged
- PR #3 targets PR #2's branch, reviewed and merged
- When all children are in, merge tracker to main
Critical: child PRs must NEVER target main directly. If GitHub shows previous slices in a child diff, retarget/rebase until the diff is clean.
Execution Steps
- Estimate changed lines and identify independent work units
- Ask for chain strategy when none is cached and budget is exceeded
- Create branches/PRs using the chosen strategy only
- Add Chain Context to each PR body (see below)
- Verify each PR independently: CI, tests, docs, clean diff
- Keep tracker PR draft/no-merge until all children are reviewed
Chain Context (add to each PR body)
## PR Chain
This is PR **2 of 3** in the `{feature}` chain:
- 📍 **PR #2 — {this PR description}** (you are here)
- PR #1: {description} → {link}
- PR #3: {description} → {link}
| Item | Value |
|------|-------|
| Chain strategy | stacked-to-main / feature-branch-chain |
| Review budget | {additions} + {deletions} = {total} changed lines |
| Depends on | {PR #1 link} |
| Blocks | {PR #3 link} |
Output Contract
Return: chosen strategy, PR order, current PR boundary, dependency diagram, review budget, verification plan, and any size:exception rationale.
Anti-patterns
- ❌ Splitting by file type instead of work unit (models/views/controllers → weak split)
- ❌ Child PR diff includes parent's code (polluted diff → retarget/rebase)
- ❌ Mixing stacked-to-main and feature-branch in same chain
- ❌ Tracker PR merged before children are complete
1---2name: chained-pr3description: >4 Chained PRs for large changes — split oversized PRs into sequential,5 reviewable chunks under 300 lines. Stacked PRs or Feature Branch Chain.6 Trigger: When a PR exceeds 300 lines, or SDD forecasts budget risk High.7license: MIT8metadata:9 source: https://skillmd.com/skills/leandrobenjaminl/chained-pr10 author: Leandro Benjamin L.11 version: "4.0"12 model_tier: T2-fast13---1415# Skill: chained-pr1617Chained PRs. Large changes broken into reviewable chunks that protect reviewer cognitive load.1819## Activation Contract2021Load this skill when:22- A planned PR may exceed **300 changed lines**23- SDD forecasts `300-line budget risk: High` or `Chained PRs recommended: Yes`24- The user asks for chained/stacked PRs or review slices2526## Hard Rules2728- Split PRs over **300 changed lines** unless a maintainer explicitly accepts `size:exception`29- Keep each PR reviewable in ≤60 minutes30- One deliverable work unit per PR; keep tests/docs with the unit they verify31- State start, end, prior dependencies, follow-up work, and out-of-scope in every chained PR32- Every child PR must include a dependency diagram marking the current PR with `📍`33- Do not mix chain strategies after the user chooses one3435## Decision Gates3637| Condition | Action |38|-----------|--------|39| PR ≤300 changed lines and focused | Keep single PR |40| PR >300, each slice can land independently | Use **Stacked PRs to main** |41| PR >300, feature must integrate before main | Use **Feature Branch Chain** with tracker |42| Generated/vendor/migration diff cannot split cleanly | Ask maintainer for `size:exception` |43| SDD provides `delivery_strategy` | Follow it before apply/PR creation |4445## Strategy A: Stacked PRs to Main4647```48main ← PR1 (refactor base)49 ← PR2 (core logic, base = PR1)50 ← PR3 (integration, base = PR2)51```52531. PR1 targets main, gets reviewed and merged542. PR2 targets main, but code based on PR1553. PR3 targets main, but code based on PR2564. Each merge updates main, next PR rebases5758## Strategy B: Feature Branch Chain (with Tracker)5960```61main ←──── feature/auth (tracker PR, draft, no merge)62 ← feat/auth-validate (PR #1)63 ← feat/auth-middleware (PR #2, base = PR #1)64 ← feat/auth-integrate (PR #3, base = PR #2)65```66671. Create tracker PR `feature/auth` → draft, targets main, never merged682. PR #1 targets `feature/auth`, reviewed and merged into tracker693. PR #2 targets PR #1's branch, reviewed and merged704. PR #3 targets PR #2's branch, reviewed and merged715. When all children are in, merge tracker to main7273**Critical**: child PRs must NEVER target main directly. If GitHub shows previous slices in a child diff, retarget/rebase until the diff is clean.7475## Execution Steps76771. Estimate changed lines and identify independent work units782. Ask for chain strategy when none is cached and budget is exceeded793. Create branches/PRs using the chosen strategy only804. Add **Chain Context** to each PR body (see below)815. Verify each PR independently: CI, tests, docs, clean diff826. Keep tracker PR draft/no-merge until all children are reviewed8384## Chain Context (add to each PR body)8586```markdown87## PR Chain8889This is PR **2 of 3** in the `{feature}` chain:90- 📍 **PR #2 — {this PR description}** (you are here)91- PR #1: {description} → {link}92- PR #3: {description} → {link}9394| Item | Value |95|------|-------|96| Chain strategy | stacked-to-main / feature-branch-chain |97| Review budget | {additions} + {deletions} = {total} changed lines |98| Depends on | {PR #1 link} |99| Blocks | {PR #3 link} |100```101102## Output Contract103104Return: chosen strategy, PR order, current PR boundary, dependency diagram, review budget, verification plan, and any `size:exception` rationale.105106## Anti-patterns107108- ❌ Splitting by file type instead of work unit (models/views/controllers → weak split)109- ❌ Child PR diff includes parent's code (polluted diff → retarget/rebase)110- ❌ Mixing stacked-to-main and feature-branch in same chain111- ❌ Tracker PR merged before children are complete