skills/rebase/SKILL.md
Rebase current feature branch onto master (or configured base) with automated conflict resolution. Handles pre-checks, conflict classification, and post-rebase verification. Use when the user asks to rebase, update a branch, sync with master, or resolve rebase conflicts.
npx skillsauth add olamedia/analytics-skills rebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Rebase the current feature branch onto the target branch with minimal user intervention. Resolve trivial and mechanical conflicts automatically; stop and ask only for overlapping ones with conflicting intent.
| Term | Meaning |
|------|---------|
| <source> | Current feature branch being rebased |
| <target> | Branch to rebase onto (default: master) |
| <split> | Fork/split point — the last common commit between <source> and <target> |
| <remote> | Remote name (auto-detected via git remote; default: origin) |
| <backup> | Safety copy: <source>-rebase-backup |
Skip when: user asks for merge (not rebase), or wants interactive rebase (squash/reorder/edit).
Setup → Analyze → Pre-checks → Backup → Rebase → [Conflict loop] → Verify → Report
↓ (overlapping)
Reproduce or ask
At any state the user (or the agent, if stuck) can pick one of:
Resolve all parameters before doing anything. Do not proceed until all answers are collected.
<source>: git branch --show-current. Refuse if on master/main.<remote>: git remote. If multiple remotes, ask user which one. If one, use it.<target>. If user provides a simple name without / (e.g., master), ask whether they mean <remote>/master (remote tracking branch) or local master. Recommend remote. Wait for answer.<backup> name (<source>-rebase-backup) so user can recover manually if the session is lost.git fetch <remote> <target> — fetch latest. No local checkout/pull needed, rebase targets <remote>/<target> directly.Build a mental model of the branch before touching anything.
Identify <split> — the exact commit where <source> diverged from <target>: git merge-base HEAD <remote>/<target>. Report it to the user (hash + subject line via git log -1 --format="%h %s" <split>).
Read the full commit log from split to HEAD: git log --reverse --format="%h %s" <split>..HEAD.
For each commit, read its diff (git show <hash> --stat + selective git show <hash> -- <file> for non-trivial ones).
Produce a short summary: the branch's goal (what feature/fix it implements), the strategy (how commits build on each other), key files (files most heavily changed), and the split point commit. Present this to the user for confirmation before proceeding.
Squash offer. If more than one commit exists since the split point, recommend squashing — fewer commits means fewer conflict points during rebase (conflicts are resolved per-commit, so N commits can produce N × the same conflict). Ask the user for confirmation. If user agrees:
git reset --soft <split> && git commit.This understanding — especially the split point and per-commit intent — is used in Step 5 to judge whether overlapping changes can be reproduced.
git status --porcelain. If dirty:
git stash push -m "rebase-skill-auto-stash", note stash was created.git rev-list --count HEAD..<remote>/<target>. If 0 → already up to date, skip rebase, report done.Create a safety copy of the branch before rebase:
git branch <backup>
<backup> is the rollback target. Deleted only after the user confirms the rebase result in Step 7. If anything goes wrong → rollback restores this exact state (see Rollback section).
Run git rebase <remote>/<target>.
Clean rebase (exit 0): proceed to Step 6 (Verify).
Conflicts (exit non-zero): proceed to Step 5.
For each commit that conflicts:
git diff --name-only --diff-filter=U.| Class | Definition | Action |
|-------|-----------|--------|
| Trivial | Whitespace-only, import reordering, adjacent non-overlapping lines, auto-generated files (lockfiles, snapshots) | Resolve automatically — accept incoming for generated files, merge both sides for additive changes. git add <file>. |
| Mechanical | Same line changed on both sides but intent is unambiguous (version bump, config value update, renamed identifier used consistently) | Resolve with brief explanation logged to user. git add <file>. |
| Overlapping | Both sides changed the same region with different logic. See Overlapping Resolution below. | Assess reproducibility → auto-resolve or ask. |
git rebase --continue.When both sides modified the same code region:
git add <file>.<source>'s version<target>'s versionRules:
git rebase --continue itself fails, read the error and act accordingly (often a missed file).git log --oneline -20 — confirm commit history looks correct (feature commits on top of base).package.json scripts or a Makefile, run it. Report pass/fail. Do not block on warnings.git diff <remote>/<target>..HEAD --stat — show what the branch changes relative to base after rebase.git stash pop) or clean<backup> (kept until user confirms, then deleted)Each overlapping conflict gets its own entry:
src/checkout.ts L101–130 — Reproduced: re-applied discount logic on top of master's refactored price calcsrc/auth.ts L55–72 — Asked user: kept master's session handling, re-added token refreshAvailable at any point — on user request, abort command, or unrecoverable error:
git rebase --abort (if rebase is in progress)git checkout <source> and git reset --hard <backup>git stash popgit log --oneline -5<backup> only after confirmation: git branch -d <backup><backup> after user confirms), don't modify files outside the rebase flow.<target> (e.g., develop, release/x.y), use it. Default is master.--force-push unless user explicitly asksmaster/main itself<backup> before user confirms rebase resultdevelopment
FE feature analysis from raw idea (or YouTrack ticket) through to a split-aware developer briefs. Produces context-map.md, requirements.md, task-brief-{side}.md. Generic — project knowledge is auto-discovered.
testing
Concise technical communication that stays readable and honest. Cuts fluff about fifty to seventy percent while keeping natural flow, uncertainty markers, and human tone. Levels lite (default), mid, tight. Short SKILL body; rules below are complete.
documentation
Strip LLM tells from text so it reads human. Triggers: humanize, sounds like AI, too robotic, natural rewrite, AI slop, or obvious LLM patterns. Reference: https://en.wikipedia.org/wiki/WP:Signs_of_AI_writing
development
Guide frontend development toward websites that feel premium and trustworthy, grounded in cognitive science research (processing fluency, prototypicality). Two modes: active guidance during build, and audit (problems + suggestions). Use when building UI, reviewing frontend code, or when the user mentions premium, trust, design quality, audit, review, or frontend polish.