agentleFS
tbhbtbhb/vale-ai-tells/.claude/skills/rebase/SKILL.md

rebase

Skill118 starsChanged 37 days agoMITView on GitHub

Replay the current branch onto its base and establish that the result is sound. Preflight settles the base by comparing the local default branch against origin's copy. The rebase runs under pinned settings. A range-diff afterwards says what the replay did to each commit. The gates then run against a tree no commit ever saw. Conflicts route to the resolve-rebase-conflicts skill. Use this whenever the user asks to rebase or to bring a branch current, and whenever a workflow needs the branch moved first.

  • Deletes or force-pushes
  • Commits and pushes

28 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 8 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

  • MicrosoftSkill

    merge

    Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never a bare git stash pop or git stash apply.

    line 62
  2. Distinctive:

    Read the output for a line about rerere replaying a recorded resolution.

    line 74
  3. Distinctive:

    Use it when the conflicts say somebody cut this branch from the wrong place.

    line 102
  4. Distinctive:

    Run the gate the script names:

    line 116

“Common” is measured: kept by at least 6 in 10 of the 28 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 workflow

Move the branch onto its base, then establish that what came out is right.

A guard hook runs alongside. It refuses a rebase started by hand and a continue past a conflict git never checked. It also refuses a dropped commit that isn't empty, a bare stash pop, and a force push without a lease.

Preflight

!bash ${CLAUDE_SKILL_DIR}/scripts/preflight.sh

Step 0: the checklist

Track these steps with the session's task-list tools where the harness provides them. Newer harnesses leave those tools out by default, and a session without them works the list in order as written.

  1. Choose the base
  2. Settle the working tree
  3. Start the rebase
  4. Resolve whatever it stops on
  5. Verify the result
  6. Report

Preflight reporting a merge or cherry-pick in progress stops everything. Say what's in the way and hand back. A rebase already in progress is the other case, and that one resumes at step 4.

Step 1: choose the base

Preflight computed this under == rebase base ==. Take its recommendation.

  • Local default branch carries everything the remote has, so rebase onto the local branch.
  • Local default branch sits behind the remote, so rebase onto origin/<default> and skip the stale local copy.

The commit skill's preflight makes the same decision, and both reach the same answer. Where the operator specifies a different base, use theirs and say why it differs.

Nothing to replay means nothing to do. Say so and stop.

Step 2: settle the working tree

--autostash handles a dirty tree, and start-rebase.sh passes it. It scopes the save to this rebase and never touches the shared stash stack, which is what makes it the sanctioned form here.

The stashed work is outside the worktree while you resolve a conflict, so nothing you see there reflects it. It can also conflict on the way back once the replay finishes.

Where the work has to persist through a cancelled rebase as well, park it in a throwaway commit first:

git commit -am wip --no-verify

That's the one sanctioned --no-verify in this repository, and git reset --soft HEAD~1 afterwards removes it before anything reaches history.

Never a bare git stash pop or git stash apply. Worktrees share one global stash stack whose indices shift whenever any worktree pushes. A bare pop takes whatever entry is at stash@{0} right then. The guard hook refuses it.

Step 3: start the rebase

bash .claude/skills/rebase/scripts/start-rebase.sh <base>

Don't type the git rebase yourself. The script pins off rebase.updateRefs, an operator preference that quietly moves other local branches pointing into the replayed range. It pins off rebase.autoSquash as well, which would otherwise collapse a fixup! commit that requires its own review. Recording the pre-rebase tip is the third thing it does. Without that record, step 5 has nothing to compare against.

Exit 0 means the replay finished, so go to step 5. A 1 means it stopped, so go to step 4.

Read the output for a line about rerere replaying a recorded resolution. That's git staging a resolution from an earlier rebase without stopping, and nothing has read it since. Treat every such path as unverified.

Step 4: resolve what it stops on

bash .claude/skills/rebase/scripts/rebase-status.sh

That says which commit stopped, how far through the replay it sits, which paths remain unmerged, and what git staged without asking.

Then invoke the resolve-rebase-conflicts skill. It classifies each path before anything edits it and settles the mechanical ones itself, which covers most of them in this repository. Don't resolve conflicts here. The classification is what keeps a mechanical case from turning into a decision someone makes by hand.

Once you have staged every path:

bash .claude/skills/rebase/scripts/continue-rebase.sh

That reads the staged blobs for conflict markers before it advances. git checks only that no path remains unmerged, so a file you staged with <<<<<<< still in it continues straight into a commit.

Repeat from rebase-status.sh at each further stop. Where git calls a commit empty because the change is already in the base, continue-rebase.sh --skip-empty drops it after proving the index matches HEAD.

You can still give up, and doing so doesn't cost anything:

git rebase --abort

Use it when the conflicts say somebody cut this branch from the wrong place. Resolving thirty of them to reach that conclusion helps nobody.

Step 5: verify the result

bash .claude/skills/rebase/scripts/verify-rebase.sh

A rebase that ends without complaint has proved one thing: every commit applied. It has proved nothing else, and what it leaves unproved is where the trouble sits.

A resolution can lose a hunk. The commit still applies. Its message still describes the change it no longer makes, and no gate anywhere notices, because a commit that does less than it claims isn't a syntax error. The range-diff this script prints is what surfaces it. That view pairs each old commit against its replayed self, marking = where the commit came through unchanged and ! where its content moved. Expect a ! wherever you resolved a conflict. Treat one anywhere else as a question to answer before moving on.

A tree can break with no commit at fault. The base adds a gate, the branch adds a file that gate rejects, and neither side fails on its own. That combination first exists after the rebase.

Run the gate the script names:

mise run check

Or mise run lint where the repository has no check. Either way, run it against the tree as it now stands rather than against any commit in isolation, because the tree is the thing nothing has tested yet.

A failure here is an ordinary fix rather than a rebase problem. Correct it, and commit through the commit skill. Where the fix belongs inside a commit the rebase just replayed, say so and let the operator choose between a follow-up commit and an amend.

Where the branch runs long enough for a mid-history break to matter, the thorough form runs the gate at every commit:

git -c rebase.updateRefs=false rebase --exec 'mise run lint' <base>

The script also lists any path the repository declares generated through rebase-resolve=regenerate. The resolution took one side of those whole, on the understanding that the generator would overwrite it. Run the generator now, and commit what it changes.

Step 6: report

Say what the base was, how many commits replayed, which paths conflicted, and how you settled each one. Give what the gates reported, and name anything the range-diff flagged.

Then hand back. Pushing is the caller's call. Because a rebase rewrites the branch, the push needs git push --force-with-lease origin HEAD. The guard refuses a bare --force, because the lease is what keeps the push from discarding whatever arrived while this session worked. Where a pull request is open, pr and watch-pr take it from there.

Where this sits

The commit skill rebases onto the base itself as its last step, and for a clean replay that rebase is all the branch needs. Come here when that rebase stops on a conflict, when the branch needs moving without a commit in hand, or when the result needs the verification step this skill runs.

Preconditions

  • a git repository with a resolvable default branch
  • the resolve-rebase-conflicts skill deployed alongside this one
  • a mise run check or mise run lint task for the verification to run

Preflight checks each and says which are missing.

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.