{"id":"2db5e2b0-9d98-499a-aa7b-b4a5605f27de","shortId":"UcYKHY","kind":"skill","title":"rebase","tagline":"Use when the user asks to rebase the current branch onto another branch or update branch history without merging.","description":"input = $ARGUMENTS\n\nRebase the current feature branch onto a target branch. Goal: clean linear history, ready to push.\n\n## Conflict Resolution\n\n**Heuristics:**\n- **Lockfiles, migrations, config, version bumps** — accept the target branch version (latest agreed-upon state).\n- **Refactored-away code** — the target's removal wins. Rewire to the new location/API.\n- **Additive conflicts** (both sides add independent code) — keep both, but verify structural integrity: run the project's formatter/parser immediately after resolution. Conflict boundaries often leave orphan closing tags, duplicate brackets, or stray blocks that grep won't catch but a parser will.\n\n**Partial survival check:** When a resolution keeps *usage* of a symbol (component, function, import), verify the *declaration* and *import* also survived. Grep the resolved file for every feature-side symbol before continuing.\n\n## Migration Reconciliation\n\nRebase re-chains revision pointers in migration files but does NOT execute the target's new migrations against the local database. The DB version marker still holds the old revision, so the app crashes at runtime on missing schema objects.\n\n**Re-chain:** update the feature migration's parent revision to point to the target's chain tip. Update any declared head tracking (if the project tracks migration head outside alembic — check project CLAUDE.md/TOOLS.md).\n\n**Re-ID if non-monotonic.** Re-pointing `down_revision` alone is not sufficient. If the feature's own revision ID is now ≤ any upstream ID in the new chain, the chain violates monotonic-timestamp rules and silently breaks any DB already stamped at that ID — alembic reports head, skips the inserted middle, app crashes on missing columns. Fix: generate a fresh `date +%Y%m%d%H%M%S`, update `revision: str = …` inside the file, rename the file to match, update project head tracking.\n\n**Verify chain:** run `alembic history` and confirm revision IDs are non-decreasing along the chain.\n\n**Apply to local DB:**\n- DB at target's tip → only the feature migration needs applying.\n- DB at feature's old pre-rebase revision → stamp to the fork point (stamp moves the pointer without executing destructive down-migrations), then upgrade.\n- DB stamped at the feature revision but upstream migrations between fork and feature were inserted later → re-running the feature crashes. Stamp back to the fork point, `upgrade <last-upstream-rev>` (not `head`), then `stamp <feature-rev>`.\n\n## Flow\n\n1. **Present rebase plan.** Commits ahead, target branch. Start after presenting.\n2. **Rebase.** Resolve conflicts per heuristics above. Run formatter/parser after each conflict resolution to catch structural damage early.\n3. **Reconcile migrations** if any migration files were touched (re-chain + apply to local DB if running).\n4. **Run quality gates** — rebase bypasses pre-commit hooks; QG is the only safety net. Use the project's gate commands from TOOLS.md.\n5. **Force-push with `--force-with-lease`.** Invoking `/rebase` is intent to push; no additional confirmation needed.\n\n**Report:** commits applied/dropped, conflicts resolved, migration reconciliation results, quality gate results.","tags":["rebase","dotclaude","jhostalek","agent-skills","ai-coding","anthropic","claude","claude-code","claude-code-skills","code-review","codex-cli","cursor"],"capabilities":["skill","source-jhostalek","skill-rebase","topic-agent-skills","topic-ai-coding","topic-anthropic","topic-claude","topic-claude-code","topic-claude-code-skills","topic-code-review","topic-codex-cli","topic-cursor","topic-developer-tools","topic-git-workflow","topic-multi-agent"],"categories":["dotclaude"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/JHostalek/dotclaude/rebase","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add JHostalek/dotclaude","source_repo":"https://github.com/JHostalek/dotclaude","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 (3,163 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:13:17.219Z","embedding":null,"createdAt":"2026-05-18T13:20:34.140Z","updatedAt":"2026-05-18T19:13:17.219Z","lastSeenAt":"2026-05-18T19:13:17.219Z","tsv":"'/rebase':484 '/tools.md).':224 '1':403 '2':414 '3':432 '4':450 '5':474 'accept':47 'add':75 'addit':71,490 'agre':54 'agreed-upon':53 'ahead':408 'alemb':219,274,315 'alon':237 'along':325 'alreadi':269 'also':132 'anoth':13 'app':181,281 'appli':328,342,444 'applied/dropped':495 'argument':22 'ask':6 'away':59 'back':392 'block':103 'boundari':93 'bracket':100 'branch':11,14,17,27,31,50,410 'break':266 'bump':46 'bypass':455 'catch':108,428 'chain':151,191,205,256,258,313,327,443 'check':115,220 'claude.md':223 'claude.md/tools.md).':222 'clean':33 'close':97 'code':60,77 'column':285 'command':471 'commit':407,458,494 'compon':124 'config':44 'confirm':318,491 'conflict':39,72,92,417,425,496 'continu':145 'crash':182,282,390 'current':10,25 'd':293 'damag':430 'databas':169 'date':290 'db':171,268,331,332,343,369,447 'declar':129,209 'decreas':324 'destruct':363 'down-migr':364 'duplic':99 'earli':431 'everi':139 'execut':160,362 'featur':26,141,194,243,339,345,373,381,389 'feature-sid':140 'file':137,156,302,305,438 'fix':286 'flow':402 'forc':476,480 'force-push':475 'force-with-leas':479 'fork':355,379,395 'formatter/parser':88,422 'fresh':289 'function':125 'gate':453,470,502 'generat':287 'goal':32 'grep':105,134 'h':294 'head':210,217,276,310,399 'heurist':41,419 'histori':18,35,316 'hold':175 'hook':459 'id':227,247,252,273,320 'immedi':89 'import':126,131 'independ':76 'input':21 'insert':279,383 'insid':300 'integr':83 'intent':486 'invok':483 'keep':78,119 'later':384 'latest':52 'leas':482 'leav':95 'linear':34 'local':168,330,446 'location/api':70 'lockfil':42 'm':292,295 'marker':173 'match':307 'merg':20 'middl':280 'migrat':43,146,155,165,195,216,340,366,377,434,437,498 'miss':186,284 'monoton':231,261 'monotonic-timestamp':260 'move':358 'need':341,492 'net':465 'new':69,164,255 'non':230,323 'non-decreas':322 'non-monoton':229 'object':188 'often':94 'old':177,347 'onto':12,28 'orphan':96 'outsid':218 'parent':197 'parser':111 'partial':113 'per':418 'plan':406 'point':200,234,356,396 'pointer':153,360 'pre':349,457 'pre-commit':456 'pre-rebas':348 'present':404,413 'project':86,214,221,309,468 'push':38,477,488 'qg':460 'qualiti':452,501 're':150,190,226,233,386,442 're-chain':149,189,441 're-id':225 're-point':232 're-run':385 'readi':36 'rebas':1,8,23,148,350,405,415,454 'reconcil':433 'reconcili':147,499 'refactor':58 'refactored-away':57 'remov':64 'renam':303 'report':275,493 'resolut':40,91,118,426 'resolv':136,416,497 'result':500,503 'revis':152,178,198,236,246,298,319,351,374 'rewir':66 'rule':263 'run':84,314,387,421,449,451 'runtim':184 'safeti':464 'schema':187 'side':74,142 'silent':265 'skill' 'skill-rebase' 'skip':277 'source-jhostalek' 'stamp':270,352,357,370,391,401 'start':411 'state':56 'still':174 'str':299 'stray':102 'structur':82,429 'suffici':240 'surviv':114,133 'symbol':123,143 'tag':98 'target':30,49,62,162,203,334,409 'timestamp':262 'tip':206,336 'tools.md':473 'topic-agent-skills' 'topic-ai-coding' 'topic-anthropic' 'topic-claude' 'topic-claude-code' 'topic-claude-code-skills' 'topic-code-review' 'topic-codex-cli' 'topic-cursor' 'topic-developer-tools' 'topic-git-workflow' 'topic-multi-agent' 'touch':440 'track':211,215,311 'updat':16,192,207,297,308 'upgrad':368,397 'upon':55 'upstream':251,376 'usag':120 'use':2,466 'user':5 'verifi':81,127,312 'version':45,51,172 'violat':259 'win':65 'without':19,361 'won':106 'y':291","prices":[{"id":"521c37ae-a2c0-4024-8ee3-57b798df21b4","listingId":"2db5e2b0-9d98-499a-aa7b-b4a5605f27de","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"JHostalek","category":"dotclaude","install_from":"skills.sh"},"createdAt":"2026-05-18T13:20:34.140Z"}],"sources":[{"listingId":"2db5e2b0-9d98-499a-aa7b-b4a5605f27de","source":"github","sourceId":"JHostalek/dotclaude/rebase","sourceUrl":"https://github.com/JHostalek/dotclaude/tree/main/skills/rebase","isPrimary":false,"firstSeenAt":"2026-05-18T13:20:34.140Z","lastSeenAt":"2026-05-18T19:13:17.219Z"}],"details":{"listingId":"2db5e2b0-9d98-499a-aa7b-b4a5605f27de","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"JHostalek","slug":"rebase","github":{"repo":"JHostalek/dotclaude","stars":8,"topics":["agent-skills","ai-coding","anthropic","claude","claude-code","claude-code-skills","code-review","codex-cli","cursor","developer-tools","git-workflow","multi-agent","prompt-engineering","skill-md"],"license":"cc0-1.0","html_url":"https://github.com/JHostalek/dotclaude","pushed_at":"2026-05-17T15:07:41Z","description":"Agent skills for agentic coding tools. Extremely opinionated. Updated (almost) daily.","skill_md_sha":"f11f0d2ec27791fec4461a031a41b6dad7d43664","skill_md_path":"skills/rebase/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/JHostalek/dotclaude/tree/main/skills/rebase"},"layout":"multi","source":"github","category":"dotclaude","frontmatter":{"name":"rebase","description":"Use when the user asks to rebase the current branch onto another branch or update branch history without merging."},"skills_sh_url":"https://skills.sh/JHostalek/dotclaude/rebase"},"updatedAt":"2026-05-18T19:13:17.219Z"}}