{"id":"89bb49da-dd9e-4a4b-a197-5725a926a529","shortId":"QfUWzq","kind":"skill","title":"rebase-pr-chain","tagline":"Rebase a chain of dependent pull requests sequentially, fixing conflicts along the way. Use when the user asks to rebase a PR chain, fix conflicts on multiple chained PRs, or mentions sequential/stacked PRs that need updating.","description":"# Rebase PR Chain\n\nRebase a chain of dependent PRs so they are all up-to-date and mergeable.\n\n## 1. Identify the Chain\n\nAccept PR numbers from the user, or detect the chain automatically:\n\n```bash\ngh pr list --state open --json number,baseRefName,headRefName\n```\n\nBuild the dependency graph: each PR's `baseRefName` points to the branch of the PR it depends on. Sort topologically (base branch first).\n\nIf the user provides explicit PR numbers (e.g. \"33, 34, 35, 36, 37\"), use that order directly.\n\n## 2. Rebase Each PR\n\nFor each PR in the chain (starting from the one closest to the trunk):\n\n### a. Fetch and checkout\n\n```bash\ngit fetch origin <baseRefName> <headRefName>\ngit checkout <headRefName>\n```\n\nVerify the working tree is clean.\n\n### b. Rebase\n\n```bash\ngit rebase origin/<baseRefName>\n```\n\nIf the rebase completes cleanly, skip to step (d).\n\n### c. Resolve Conflicts\n\nFollow the same conflict resolution strategy as [fix-pr-conflict](../fix-pr-conflict/SKILL.md):\n\n1. List conflicting files: `git diff --name-only --diff-filter=U`\n2. For each file, understand both sides and classify:\n   - **Mechanical**: independent changes to nearby lines. Keep both.\n   - **Semantic**: incompatible changes to the same logic. Resolve if the outcome is clear.\n   - **Ambiguous**: design decisions or unclear intent. **Abort the rebase** (`git rebase --abort`) and escalate to the user with a description of the conflict.\n3. After resolving: `git add <file>` then `git rebase --continue`\n4. Repeat until the rebase completes or escalation is needed.\n\n### d. Verify\n\nRun verification per [verify-when-complete](../verify-when-complete/SKILL.md). Fix any issues from bad conflict resolution. If errors are unrelated, note them.\n\n### e. Force push\n\n```bash\ngit push --force-with-lease\n```\n\n## 3. Verify Chain Mergeability\n\nAfter all PRs are rebased, verify each is mergeable:\n\n```bash\ngh pr view <number> --json mergeable,mergeStateStatus\n```\n\nIf GitHub still reports conflicts (recomputation delay), wait a few seconds and re-check once.\n\n## 4. Report\n\nPresent a summary table:\n\n| PR | Branch | Status |\n|----|--------|--------|\n| #33 | feature-a | Mergeable |\n| #34 | feature-b | Mergeable |\n| #35 | feature-c | Conflict (escalated) |","tags":["rebase","chain","skill","issue","paultyng","agent-skills","ai-tools","claude-code","cursor","dotfiles"],"capabilities":["skill","source-paultyng","skill-rebase-pr-chain","topic-agent-skills","topic-ai-tools","topic-claude-code","topic-cursor","topic-dotfiles"],"categories":["skill-issue"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/paultyng/skill-issue/rebase-pr-chain","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add paultyng/skill-issue","source_repo":"https://github.com/paultyng/skill-issue","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (2,228 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:09:01.275Z","embedding":null,"createdAt":"2026-05-18T13:21:26.460Z","updatedAt":"2026-05-18T19:09:01.275Z","lastSeenAt":"2026-05-18T19:09:01.275Z","tsv":"'/fix-pr-conflict/skill.md':188 '/verify-when-complete/skill.md':283 '1':60,189 '2':125,202 '3':255,307 '33':116,352 '34':117,357 '35':118,362 '36':119 '37':120 '4':264,343 'abort':238,243 'accept':64 'add':259 'along':15 'ambigu':232 'ask':22 'automat':74 'b':159,360 'bad':288 'base':105 'baserefnam':83,92 'bash':75,147,161,300,320 'branch':96,106,350 'build':85 'c':174,365 'chain':4,7,27,32,43,46,63,73,134,309 'chang':213,221 'check':341 'checkout':146,152 'classifi':210 'clean':158,169 'clear':231 'closest':139 'complet':168,269,282 'conflict':14,29,176,180,187,191,254,289,331,366 'continu':263 'd':173,274 'date':57 'decis':234 'delay':333 'depend':9,48,87,101 'descript':251 'design':233 'detect':71 'diff':194,199 'diff-filt':198 'direct':124 'e':297 'e.g':115 'error':292 'escal':245,271,367 'explicit':112 'featur':354,359,364 'feature-a':353 'feature-b':358 'feature-c':363 'fetch':144,149 'file':192,205 'filter':200 'first':107 'fix':13,28,185,284 'fix-pr-conflict':184 'follow':177 'forc':298,304 'force-with-leas':303 'gh':76,321 'git':148,151,162,193,241,258,261,301 'github':328 'graph':88 'headrefnam':84 'identifi':61 'incompat':220 'independ':212 'intent':237 'issu':286 'json':81,324 'keep':217 'leas':306 'line':216 'list':78,190 'logic':225 'mechan':211 'mention':35 'mergeabl':59,310,319,325,356,361 'mergestatestatus':326 'multipl':31 'name':196 'name-on':195 'nearbi':215 'need':39,273 'note':295 'number':66,82,114 'one':138 'open':80 'order':123 'origin':150,164 'outcom':229 'per':278 'point':93 'pr':3,26,42,65,77,90,99,113,128,131,186,322,349 'present':345 'provid':111 'prs':33,37,49,313 'pull':10 'push':299,302 're':340 're-check':339 'rebas':2,5,24,41,44,126,160,163,167,240,242,262,268,315 'rebase-pr-chain':1 'recomput':332 'repeat':265 'report':330,344 'request':11 'resolut':181,290 'resolv':175,226,257 'run':276 'second':337 'semant':219 'sequenti':12 'sequential/stacked':36 'side':208 'skill' 'skill-rebase-pr-chain' 'skip':170 'sort':103 'source-paultyng' 'start':135 'state':79 'status':351 'step':172 'still':329 'strategi':182 'summari':347 'tabl':348 'topic-agent-skills' 'topic-ai-tools' 'topic-claude-code' 'topic-cursor' 'topic-dotfiles' 'topolog':104 'tree':156 'trunk':142 'u':201 'unclear':236 'understand':206 'unrel':294 'up-to-d':54 'updat':40 'use':18,121 'user':21,69,110,248 'verif':277 'verifi':153,275,280,308,316 'verify-when-complet':279 'view':323 'wait':334 'way':17 'work':155","prices":[{"id":"59f47eca-8eef-45f4-b05a-01c3e9719170","listingId":"89bb49da-dd9e-4a4b-a197-5725a926a529","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"paultyng","category":"skill-issue","install_from":"skills.sh"},"createdAt":"2026-05-18T13:21:26.460Z"}],"sources":[{"listingId":"89bb49da-dd9e-4a4b-a197-5725a926a529","source":"github","sourceId":"paultyng/skill-issue/rebase-pr-chain","sourceUrl":"https://github.com/paultyng/skill-issue/tree/main/skills/rebase-pr-chain","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:26.460Z","lastSeenAt":"2026-05-18T19:09:01.275Z"}],"details":{"listingId":"89bb49da-dd9e-4a4b-a197-5725a926a529","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"paultyng","slug":"rebase-pr-chain","github":{"repo":"paultyng/skill-issue","stars":8,"topics":["agent-skills","ai-tools","claude-code","cursor","dotfiles"],"license":"mit","html_url":"https://github.com/paultyng/skill-issue","pushed_at":"2026-05-18T18:26:54Z","description":"Personal Claude Code / Cursor agent skills, rules, and config","skill_md_sha":"2093c8271092af7f13fa14f2a76b79696415da6d","skill_md_path":"skills/rebase-pr-chain/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/paultyng/skill-issue/tree/main/skills/rebase-pr-chain"},"layout":"multi","source":"github","category":"skill-issue","frontmatter":{"name":"rebase-pr-chain","description":"Rebase a chain of dependent pull requests sequentially, fixing conflicts along the way. Use when the user asks to rebase a PR chain, fix conflicts on multiple chained PRs, or mentions sequential/stacked PRs that need updating."},"skills_sh_url":"https://skills.sh/paultyng/skill-issue/rebase-pr-chain"},"updatedAt":"2026-05-18T19:09:01.275Z"}}