agentleFS
zoranmarticzoranmartic/coord-wright/skills/rebase-to-main/SKILL.md

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

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
  1. Distinctive:

    Run from the session worktree (not the main checkout).

    line 8
  2. Distinctive:

    If unclear, stop and ask the user.

    line 25
  3. Distinctive:

    After a successful continue, do NOT re-run this skill: its preflight requires HEAD to equal the upstream, which a rebased branch no longer …

    line 29
  4. Very specific:

    Only run from a registered session worktree (<project>-session-*), never from main.

    line 50
  5. Very specific:

    Never use plain --force; the script uses --force-with-lease.

    line 51
  6. Distinctive:

    Do not merge main into the task branch — rebase only.

    line 52
  7. Distinctive:

    Do not delete or rename the task branch.

    line 53
  8. Distinctive:

    If conflicts occur, stop and surface them.

    line 54

≈ “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.

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

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:

  1. git status --short — see which files conflict.
  2. git diff --cc -- <path> — inspect conflict hunks.
  3. Resolve only when the correct resolution is clear from local context. If unclear, stop and ask the user.
  4. git add <resolved-path> for each resolved file.
  5. git rebase --continue.
  6. Repeat if more conflicts remain.
  7. 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, then git 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.

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.