Headcount

Skills / Technology / Branch and worktree workflow

Skill

Branch and worktree workflow

Isolates feature work in its own branch or worktree and integrates it cleanly when done.

When it loads

Your assistant reads this description and loads the skill when a request matches it. Nothing else is in context until then.

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.

Add it to your assistant

This skill ships in the Technology department, with 18 others.

Claude Code

/plugin marketplace add cbrock84/headcount
/plugin install technology@headcount

ChatGPT and Codex

Add Headcount: Technology to ChatGPT from the ChatGPT plugin directory.

GitHub Copilot CLI

copilot plugin marketplace add cbrock84/headcount
copilot plugin install technology@headcount

Cursor

The repository is a Cursor plugin marketplace. On a Teams or Enterprise plan, import it under Dashboard, Plugins & MCPs, New marketplace, Import from a repository. To try this department on one machine, copy plugins/technology into ~/.cursor/plugins/local/ and reload the window.

Gemini CLI

Gemini CLI installs one skill at a time:

gemini skills install https://github.com/cbrock84/headcount.git --path plugins/technology/skills/branch-and-worktree-workflow

The skill is identical in every tool. The Copilot, Cursor and Gemini steps follow each tool's published format and have not been run end to end here.

What the skill tells the assistant

The full text, as it installs. View the source on GitHub.

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:

  1. Rerun the full check the project actually gates on, not the subset you have been running.
  2. Read your own diff top to bottom. Remove debug output, stray files, and commented-out code.
  3. 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.

Sources

references/sources.md in this skill lists the outside authorities that settle the questions here — what each one is authoritative for, and what you may do with it. Check them before answering on anything they cover, and cite what you used. Most are free to read and not free to reproduce; the use note on each is binding.

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.

Company context

Before answering, look for the company profile: the file .headcount/company.md in the working folder, or a document titled "Headcount company profile" in the conversation, the project's instructions or files, or saved memory. Where there is one, answer for that company and do not ask for anything it already states. Where it conflicts with what the person says now, the person is right, and say that the profile looks out of date. Where there is none, carry on: ask only for the facts this question turns on, and mention once that executive:company-onboarding records them so they are not asked again.

Other departments

A skill written as department:skill belongs to another department, and each department installs separately. If the one a question belongs to is not installed, name the department that owns it and how to add it, and do not improvise its work. references/departments.md in this skill lists each department this skill names, with the install step for Claude Code and for ChatGPT.

Files it ships with

Loaded only when the skill calls for them.

Sources it checks against

Where a question has an outside authority, the skill points the assistant at it instead of answering from memory.

More in Technology