agentleFS
anderson-c-santosanderson-c-santos/claude-skills-network/skills/create-branch/SKILL.md

create-branch

Skill1 starsChanged 5 months agoMITView on GitHub

Create and switch to a new git branch with proper naming convention. Trigger for: /create-branch, new branch, create branch, checkout new branch, branch off. Infers branch type from context, names it correctly, and pushes if requested.

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    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:

    Create and switch to a new git branch with consistent naming.

    line 8
  2. Distinctive:

    If detached HEAD → STOP: "Check out a branch first before branching off."

    line 48
  3. Distinctive:

    Always fetch before checking remote conflicts — avoids false "no conflict" on stale data.

    line 54
  4. Distinctive:

    Read recent git log, staged/unstaged changes, conversation context

    line 63
  5. Very specific:

    If exists locally or remotely → append -v2 or propose alternative.

    line 72
  6. Distinctive:

    Ask: "Push to remote now?" (skip if user already said push or implied PR readiness)

    line 84

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Create Branch

Create and switch to a new git branch with consistent naming. After this, use /open-pr when ready.

Invocation Forms

  • /create-branch — infer type+name from context
  • /create-branch <name> — apply correct prefix automatically
  • /create-branch <type> <description> — fully explicit

Branch Naming Convention

Format: <type>/<short-description>

  • Lowercase, hyphen-separated words
  • Max 50 chars total
  • ASCII only — no spaces, special chars, or accents
TypeWhen
feat/new feature
fix/bug fix
chore/tooling, deps, CI, config
refactor/restructure, no behavior change
docs/documentation only
hotfix/urgent production fix
release/release preparation

Examples:

  • feat/user-auth-jwt
  • fix/login-redirect-loop
  • chore/update-dependencies
  • hotfix/null-pointer-checkout
  • release/v1.2.0

Workflow

1. Check repo state

git status                  # must not be in detached HEAD
git branch --show-current   # current branch
git log --oneline -5        # recent context to infer intent

If detached HEAD → STOP: "Check out a branch first before branching off."

2. Fetch remote state

git fetch origin --prune 2>/dev/null || true

Always fetch before checking remote conflicts — avoids false "no conflict" on stale data.

3. Determine base branch

git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|.*/||'
# fallback: git branch -r | grep -E 'origin/(main|master)' | head -1 | sed 's|.*/||'

4. Infer branch name (if not given)

  • Read recent git log, staged/unstaged changes, conversation context
  • Propose exactly one name — not a list
  • Example: Creating branch feat/user-auth-jwt from main — confirm?

5. Check for name conflicts

git branch --list "<type>/<name>"
git ls-remote --heads origin "<type>/<name>" | grep -q . && echo "EXISTS"

If exists locally or remotely → append -v2 or propose alternative.

6. Create and switch

# From current branch (most common)
git checkout -b <type>/<name>

# From a specific base
git checkout -b <type>/<name> <base>

7. Push to remote

Ask: "Push to remote now?" (skip if user already said push or implied PR readiness)

git push -u origin <type>/<name>

8. Output

One line only:

feat/user-auth-jwt created from main — ready to code.

Edge Cases

  • Dirty working tree: warn but do not block — uncommitted changes carry over to new branch
  • No remote: skip remote conflict check and push offer
  • On a feature branch: offer to branch from main or from current branch — one clear question

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.