rebase-to-main
Skill0 starsChanged 47 days agoApache-2.0View on GitHub
Rebase a registered coord session worktree branch onto origin/main and push it with --force-with-lease. Use when the user says $rebase-to-main, \"rebase this task branch onto main\", or needs to make a task branch fast-forwardable before $merge-to-main.
- Deletes or force-pushes
- Commits and pushes
In this repository20 other files it gives its agents.
- coord-archive-indexSkill
- coord-assignSkill
- coord-auditSkill
- coord-checkSkill
- coord-dirtySkill
- coord-discardSkill
- coord-helpSkill
- coord-initSkill
- coord-loop-doctorSkill
- coord-promoteSkill
- coord-refineSkill
- coord-requeueSkill
- coord-reviewSkill
- coord-shape-reviewSkill
- coord-shapeSkill
- coord-splitSkill
- coord-statusSkill
- coord-tokensSkill
- coord-unblockerSkill
- merge-to-mainSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
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
- Distinctive: line 8
Run from the session worktree (not the main checkout).
- Distinctive: line 25
If unclear, stop and ask the user.
- Distinctive: line 29
After a successful continue, do NOT re-run this skill: its preflight requires HEAD to equal the upstream, which a rebased branch no longer …
- Very specific: line 50
Only run from a registered session worktree (<project>-session-*), never from main.
- Very specific: line 51
Never use plain --force; the script uses --force-with-lease.
- Distinctive: line 52
Do not merge main into the task branch — rebase only.
- Distinctive: line 53
Do not delete or rename the task branch.
- Distinctive: line 54
If conflicts occur, stop and surface them.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rebase the current session worktree branch onto origin/main so /merge-to-main
can fast-forward afterward. Rewrites task branch history.
Run from the session worktree (not the main checkout).
Run
"${COORD_TOOLS:-$HOME/Projects/coord-wright}/bin/rebase-to-main.sh"Exit codes
Exit 0 — rebase and force-push complete. Run /merge-to-main next.
Exit 1 — rebase stopped with conflicts. The script printed the conflicted paths. Resolve:
git status --short— see which files conflict.git diff --cc -- <path>— inspect conflict hunks.- Resolve only when the correct resolution is clear from local context. If unclear, stop and ask the user.
git add <resolved-path>for each resolved file.git rebase --continue.- Repeat if more conflicts remain.
- After a successful continue, do NOT re-run this skill: its preflight
requires HEAD to equal the upstream, which a rebased branch no longer does
(exit 2). Run the two finish commands the script printed under
"Then finish by hand":
git diff --check origin/main..HEAD, thengit push --force-with-lease=<upstream-branch>:<pre-rebase-sha> origin HEAD:<upstream-branch>(the lease is pinned to the upstream commit the script fetched).
To abandon a conflicted rebase: git rebase --abort, confirm git status --short
is clean, then re-run this skill from scratch.
Exit 2 — preflight failure (dirty tree, no upstream, branch out of sync, not a registered session worktree). Report the error and stop.
Source of truth
${COORD_TOOLS}/docs/coordination.md${COORD_TOOLS}/projects.txt
Rules
- Only run from a registered session worktree (
<project>-session-*), never from main. - Never use plain
--force; the script uses--force-with-lease. - Do not merge main into the task branch — rebase only.
- Do not delete or rename the task branch.
- If conflicts occur, stop and surface them. Do not guess resolutions.
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
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.

