8000 chore(skills): fast-forward main after the merge lands by dominikwozniak · Pull Request #75 · dominikwozniak/dw-mc · GitHub
[go: up one dir, main page]

Skip to content

chore(skills): fast-forward main after the merge lands - #75

Merged
dominikwozniak merged 1 commit into
mainfrom
chore/merge-skill-syncs-main
Sep 17, 2026
Merged

dominikwozniak merged 1 commit into
mainfrom
chore/merge-skill-syncs-main

Conversation

@dominikwozniak
Copy link
Copy Markdown
Owner

A session that lands a pull request from a worktree leaves this machine a step behind GitHub: the squash is up there and local main still points at the commit before it, so the next branch is cut from stale ground. Closing that gap carries one detail git will not let you guess — main is checked out in the primary worktree, so git fetch origin main:main refuses and the fast-forward has to run there through git -C. The merge-and-clean-up skill now holds the whole loop: merge, sync, clean up.

What changes

  • .agents/skills/merge-and-clean-up/SKILL.md — a Sync main step between landing and the clean-up: fetch --prune, then git -C <the worktree tagged [main]> merge --ff-only origin/main. A refusal ends the sync and goes in the report; the merge already happened.
  • Same file — down to the commands and the four traps worth writing down, with headRefName read off the first gh pr view so the branch name has a source.

Test plan

  • pnpm format — pass
  • git behaviour checked against a throwaway clone with a worktree, git 2.55: fetch origin main:main refuses with refusing to fetch into branch 'refs/heads/main' checked out at ...; merge --ff-only fast-forwards over an unrelated dirty file, and refuses without writing on a file it would touch (Your local changes ... would be overwritten) and on a diverged main (Not possible to fast-forward, aborting)
  • by hand: this pull request is the skill's next run

Risk

Documentation for an agent, with no code path behind it. A wrong line makes a session do the wrong thing by hand; the two writes it adds are --ff-only, which refuses rather than inventing a merge commit or touching another session's uncommitted work, and nothing here removes a worktree.

🤖 Generated with Claude Code

Landing a pull request used to leave this machine behind it: the squash
existed on GitHub while local main still pointed at the commit before, so
the next piece of work started from stale ground. Closing that needs one
detail git will not let you guess - main is checked out in the primary
worktree, which is why it moves there through git -C rather than from the
session's own worktree, and why the move is --ff-only.

The rest of the skill drops to the commands plus the few traps worth
writing down.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dominikwozniak
dominikwozniak merged commit fef1f80 into main Sep 17, 2026
1 check passed
@dominikwozniak
dominikwozniak deleted the chore/merge-skill-syncs-main branch September 17, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0