agentleFS
pivoshenkopivoshenko/pivoshenko.ai/skills/git-branch-create/SKILL.md

git-branch-create

Skill6 starsChanged 44 days agoMITView on GitHub

Create a new git branch using a conventional naming scheme. Use when the user asks to create a branch, start a new branch, /git-branch-create, or signals they are beginning a discrete piece of work - "start work on X", "spin up a branch for Y", "let's start Z". Boundary: a request naming an existing issue ("#42", "pick up that issue") is `git-issue-start`'s; filing a ticket without starting work is `git-issue-create`'s. Creates and checks out the branch immediately without asking for confirmation.

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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
  1. Very specific:

    No remote -> git checkout -b <name> <base> (local ref.

    line 29
  2. Very specific:

    No ticket IDs unless asked.

    line 48
  3. Distinctive:

    Never delete/reset existing branches here

    line 63
  4. Distinctive:

    Never push new branch unless asked

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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

Git Branch Create

Make + checkout new branch. No confirm.

Flow

  1. User named an issue (#42, "the oauth issue", "start 42") -> stop, this is git-issue-start's flow: it assigns the issue, derives the type from its type: * label, and branches using the naming rules below. Why -> branching from an issue without assigning it leaves the tracker claiming nobody picked the work up
  2. Parallel: git status + git branch --show-current
  3. Dirty tree -> stop. Tell user to stash or commit first. Why -> checkout -b carries staged + unstaged changes into the new branch silently, mixing them with future work
  4. Pick base:
    • Detect, don't assume: git symbolic-ref --short refs/remotes/origin/HEAD -> strip the origin/. Ref missing (never fetched) -> git remote set-head origin -a, re-read. No remote -> main, fall back master. Why -> a repo based on develop or trunk gets branched off the wrong parent otherwise, and the mistake surfaces at PR time as a diff full of other people's commits
    • Base = the detected default branch unless the user explicitly says "off this branch" / "from here" -> then use current. Skip step 4's fetch; go to step 5 "off current" variant. Being on a feature branch alone is not that signal
  5. Exists? git show-ref --verify --quiet refs/heads/<name> -> 0 = stop, surface conflict, no overwrite. Why -> checkout -b errors anyway, but check early so message is clean + no half-state
  6. Create:
    • Off <base> (default): git fetch origin <base> + git checkout -b <name> origin/<base>
    • No remote -> git checkout -b <name> <base> (local ref; skip the fetch). Local <base> absent too (unborn repo) -> git checkout -b <name> off HEAD
    • Off current: git checkout -b <name> (no fetch, no remote ref - current HEAD is the base)
  7. Print branch + base

Naming

<type>/<short-kebab-desc> or <type>/<scope>-<short-kebab-desc>.

Whole name ≤ 60 chars.

Type

Same set + picks as git-commit. See that skill's Type pick + Tiebreakers for disambiguation. Quick list: feat|fix|perf|refactor|docs|test|build|ci|chore.

Desc

  • Kebab-case. Not camel / snake
  • Imperative present: add, fix, remove. Not added, fixes
  • < ~50 chars, and keeps the whole name ≤ 60. Over -> drop the scope segment first, then cut modifiers, then pick a shorter verb. Never truncate mid-word: feat/add-oauth-log reads like a different feature
  • No ticket IDs unless asked. Why -> history readable + tool-agnostic; trackers come+go, branches stay. Asked -> suffix: feat/add-auth-middleware-PROJ-123

Examples

  • feat/add-oauth-login
  • fix/api-timeout-on-retry
  • refactor/extract-user-service
  • docs/update-readme
  • ci/cache-pnpm-store

Rules

  • Derive type + desc from intent + diff if avail
  • Issue number given -> hand to git-issue-start. Don't branch from an issue here
  • User gives name -> verbatim. No rewrite
  • Never delete/reset existing branches here
  • Never push new branch unless asked
  • Branch exists -> stop. Surface conflict. No overwrite

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.