agentleFS
StormixStormix/transcripts-mcp/.agents/skills/rebase/SKILL.md

rebase

Skill8 starsChanged 2 months agoMITView on GitHub

Fetch the latest default branch and rebase the current branch on top of it, resolving any merge conflicts automatically. Use when asked to "rebase", "rebase on main", "update branch with main", "sync with main", "rebase onto latest", or "/rebase".

  • Deletes or force-pushes
  • Commits and pushes

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use dependency-watch, perform-task and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • telegramdesktopSkill

    dependency-watch

    Audit Telegram Desktop dependencies on freshly fetched origin/dev for releases and security fixes, including upstream lag and backport candidates in patched forks. Use for the scheduled dependency monitor or an explicitly requested dependency report.

    Also in 5 projects that use this

  • telegramdesktopSkill

    perform-task

    Resolve, start or resume, implement, review, test, and publish exactly one existing ai-tdesktop task by short slug or full dated id, including rare blocked retries and split-required results. Use when the user invokes $perform-task or /perform-task with a known task name, or when the continue scheduler delegates one selected task. Runs standard review lenses with fast applicability bailouts and selects task-specific domain and evidence instruments without selecting additional work.

    Also in 5 projects that use this

  • JerovinoSkill

    process-inbox

    Processes tasks.md inbox items by triaging each one to its proper location in the vault

    Also in 5 projects that use this

  • Trejon-888Skill

    continue

    Load project context, alignment audit, status check, suggest next action. Auto-invoke at session start, after context switches, or when user says 'continue', 'pick up where we left off', 'resume', 'what's next', 'status check', 'what now'.

    Also in 6 projects that use this

  • lepinkainenSkill

    code-health

    Analyze codebase health - large files, test coverage gaps, duplicate code, dead/legacy code, and documentation issues. Use when asked to scan, audit, or assess code quality, find refactoring targets, or identify technical debt.

    Also in 3 projects that use this

  • Hugging FaceSkill

    implement

    Make tests pass. Invoke after /write-tests produces failing tests.

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 13 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Before doing anything, verify the working tree state:

    line 12
  2. Very specific:

    Run git status --porcelain=v1 --branch.

    line 14
  3. Very specific:

    Ask whether to stash (git stash push -u -m "rebase-skill autostash") or abort

    line 16
  4. Distinctive:

    Do NOT silently discard work

    line 17
  5. Distinctive:

    Run git rev-parse --abbrev-ref HEAD to capture the current branch name.

    line 18
  6. Distinctive:

    If the fetch fails (network/auth), report the exact error and stop.

    line 34
  7. Very specific:

    Run git status --porcelain=v1.

    line 58
  8. Very specific:

    Read the full file (do not rely on <<<<<<< markers alone for context)

    line 62
  9. Very specific:

    After editing, ensure no <<<<<<<, =======, or >>>>>>> markers remain:

    line 80
  10. Distinctive:

    If the rebase reports "No changes - did you forget to use 'git add'?", the commit became empty after resolution.

    line 93
  11. Distinctive:

    If new conflicts appear on the next commit, return to step 4a.

    line 95
  12. Distinctive:

    If at any point you are stuck (more than 2 attempts on the same file produce conflict markers, or the user asked to stop), run git rebase …

    line 97
  13. Distinctive:

    If lockfiles or generated files were taken from base in Step 4, regenerate them now:

    line 104
  14. Distinctive:

    If a stash was created in Step 1, ask the user before popping it (git stash pop).

    line 109
  15. Very specific:

    NEVER run git push --force (without --with-lease) on the user's behalf

    line 122
  16. Distinctive:

    NEVER push at all unless the user explicitly asks

    line 123
  17. Distinctive:

    NEVER run git rebase --skip to bypass conflicts you do not understand — only for genuinely empty commits

    line 124
  18. Distinctive:

    NEVER discard uncommitted work without explicit confirmation

    line 125
  19. Distinctive:

    NEVER resolve a conflict by deleting code from one side without reading both sides in full

    line 126

“Common” is measured: kept by at least 6 in 10 of the 26 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rebase Current Branch on Latest Main

Fetch the latest default branch from origin and rebase the current branch on top of it, resolving conflicts as they appear. Do not push unless the user asks.

Step 1: Pre-Flight Checks

Before doing anything, verify the working tree state:

  1. Run git status --porcelain=v1 --branch. Confirm there are no uncommitted changes. If there are:
    • List them to the user
    • Ask whether to stash (git stash push -u -m "rebase-skill autostash") or abort
    • Do NOT silently discard work
  2. Run git rev-parse --abbrev-ref HEAD to capture the current branch name. If it is main, master, or the default branch, stop and tell the user there is nothing to rebase.
  3. Determine the default branch:
    gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
    Fall back to git symbolic-ref refs/remotes/origin/HEAD --short | sed 's@^origin/@@' if gh is unavailable. Cache the result as $BASE.
  4. Confirm an origin remote exists with git remote get-url origin.

Step 2: Fetch the Latest Base

Fetch only what is needed and prune stale refs:

git fetch --prune origin "$BASE"

If the fetch fails (network/auth), report the exact error and stop. Do not start a rebase against stale refs.

Step 3: Start the Rebase

Run:

git rebase "origin/$BASE"

Capture both stdout and stderr. There are three outcomes:

OutcomeHow to DetectAction
Clean rebaseExit 0, no CONFLICT linesGo to Step 5
ConflictsExit non-zero, output contains CONFLICT or could not applyGo to Step 4
Other failureExit non-zero without conflict markersRun git rebase --abort, restore any stash from Step 1, report error, stop

Step 4: Resolve Conflicts (Loop)

Repeat this loop until git status reports the rebase is no longer in progress.

4a. Inventory the Conflicts

Run git status --porcelain=v1. Conflicted files are marked UU, AA, DU, UD, AU, UA, or DD.

For each conflicted file:

  • Read the full file (do not rely on <<<<<<< markers alone for context)
  • Identify the conflict regions delimited by <<<<<<<, =======, >>>>>>>
  • Identify which side is "ours" (the rebased commit being replayed) and "theirs" (the base branch tip). During git rebase, "ours" is the upstream base and "theirs" is the commit being replayed — this is the opposite of git merge. Verify with git log --oneline -1 HEAD and git log --oneline -1 REBASE_HEAD if unsure.

4b. Resolve Each File

Apply this decision logic per conflict region:

SituationResolution
Lockfiles (pnpm-lock.yaml, Cargo.lock, package-lock.json, yarn.lock, bun.lockb, uv.lock)Take the base branch version, then regenerate (pnpm install, cargo build, npm install, etc.) at the end of the rebase, not per-step
Generated files (build output, snapshots, codegen)Take the base branch version and regenerate after the rebase completes
Both sides changed unrelated lines in the same hunkCombine both changes, preserving intent from each
Same line changed differently with clear semantic conflictRead surrounding code, infer intent, prefer the change that is consistent with the rest of the diff being replayed; if ambiguous, ask the user
Import/export lists, CHANGELOG.md, version bumpsMerge by union (keep entries from both sides, deduplicated, sorted as the file dictates)
Whitespace-only / formatting-only conflictsTake whichever side matches the project's formatter; run the formatter after if needed
Truly ambiguous business logicStop, present both versions to the user with file paths and line ranges, and ask which to keep

After editing, ensure no <<<<<<<, =======, or >>>>>>> markers remain:

git grep -nE '^(<{7}|={7}|>{7})( |$)' -- ':(exclude)*.md'

4c. Stage and Continue

git add <resolved files>
git rebase --continue

If the rebase reports "No changes - did you forget to use 'git add'?", the commit became empty after resolution. Run git rebase --skip.

If new conflicts appear on the next commit, return to step 4a.

If at any point you are stuck (more than 2 attempts on the same file produce conflict markers, or the user asked to stop), run git rebase --abort, restore the stash, and report.

Step 5: Post-Rebase Validation

Once the rebase completes:

  1. Confirm state: git status should show "nothing to commit, working tree clean" and the branch ahead of origin/$BASE.
  2. If lockfiles or generated files were taken from base in Step 4, regenerate them now:
    • pnpm install if pnpm-lock.yaml was touched
    • cargo build (or cargo check) if Cargo.lock was touched
    • The project-appropriate codegen command for any generated sources Stage and amend into the relevant commit only if regeneration produced changes; otherwise leave alone.
  3. If a stash was created in Step 1, ask the user before popping it (git stash pop).

Step 6: Report

Tell the user:

  • The base branch and SHA you rebased onto (git rev-parse --short "origin/$BASE")
  • How many commits were replayed (git rev-list --count "origin/$BASE..HEAD")
  • Which files had conflicts and a one-line summary of how each was resolved
  • Any follow-up they should do (e.g., "lockfile regenerated, please verify"), and whether a force-push is required (git push --force-with-lease) — but do not push unless explicitly asked

Hard Rules

  • NEVER run git push --force (without --with-lease) on the user's behalf
  • NEVER push at all unless the user explicitly asks
  • NEVER run git rebase --skip to bypass conflicts you do not understand — only for genuinely empty commits
  • NEVER discard uncommitted work without explicit confirmation
  • NEVER resolve a conflict by deleting code from one side without reading both sides in full

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.