mcpbeat Sign in

Branch And Worktree Workflow Agent Skill

Isolates feature work in its own branch or worktree and integrates it cleanly when done. Use this when starting work that should not disturb the current workspace, when several efforts must proceed in parallel on one repository, or when implementation is finished and the change needs merging, rebasing, or splitting for review.

522 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
220
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/cbrock84/headcount --skill branch-and-worktree-workflow

The instruction itself

5 sections, as written by the author

Branch and worktree workflow

Starting

Work that will take more than one sitting, or that runs alongside other work, gets its own isolated

workspace. A worktree gives you a second checkout of the same repository on a different branch — two

efforts, two directories, one object store, no stashing.

Branch from the current upstream default, not from whatever is checked out. Branching off a stale

local branch is how unrelated commits end up in a review.

While working

  • Commit at points where the tree is coherent, not at the end of the day.
  • Keep the branch current with its base often. A merge conflict found on day one is a five-minute

fix; the same conflict found on day ten is an afternoon.

  • One concern per branch. If you find an unrelated bug, note it and leave it.

Finishing

Before proposing the work:

  • Rerun the full check the project actually gates on, not the subset you have been running.
  • Read your own diff top to bottom. Remove debug output, stray files, and commented-out code.
  • Confirm the branch merges cleanly into its base.

Then decide how it integrates:

  • Small and coherent — merge as is.
  • Several separable concerns — split into stacked branches so each can be reviewed on its

merits. A reviewer given three concerns in one diff reviews none of them well.

  • Exploratory — keep the useful commits, drop the rest.

Never

  • Rewrite history on a branch someone else has checked out. Merge instead; a force-push breaks their

working copy.

  • Leave a worktree behind after merging — stale worktrees hold references and confuse later work.
  • Merge your own change without the checks green on the final commit, not an earlier one.

How to use it

Copy the folder

Take cbrock84/branch-and-worktree-workflow from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.