Create a Feature Branch

VerifiedSafe

Create a feature branch named from the git username and a slug derived from session context.

Sby Skills Guide Bot
DevelopmentBeginner
7/29/2026
Claude Code
#git#branching#workflow#version-control#naming-conventions

Recommended for

Automated summary

Creates a git feature branch named `<git-username>/<feature-slug>`, deriving the slug from the current session's context and repo state.

Strengths

  • Guards against misuse: stops when the directory is not a git repo and refuses to nest a branch off an existing feature branch.
  • Slugifies the git username deterministically with an explicit shell pipeline that lowercases and replaces non-alphanumeric characters with hyphens.
  • Picks the feature slug from uncommitted changes first, then from the task in progress, producing concrete names with little user input.
  • Keeps a narrow tool allowlist limited to read-only git calls plus branch creation (`branch`, `config`, `status`, `switch`, `symbolic-ref`).

Limitations

  • Depends on `git config user.name` being set; when it is unset the skill must ask the user for the segment.
  • Does not push the branch, set an upstream, or handle repos where the default branch cannot be resolved from `origin/HEAD`.
  • The slug can be a guess when session context is thin, in which case it proposes a name and asks for confirmation instead of creating the branch.
When to use it

Use it when you are about to start new work and want a consistently named feature branch cut from the base branch without inventing the naming yourself.

When not to use it

Don't use it when you need to branch off another feature branch, push the new branch to a remote, or rename an existing branch.

Security analysis

Safe
Quality score88/100

The skill only runs read-only or branch-creation git commands (git branch, config, status, switch, symbolic-ref) within a declared allowlist. It does not execute destructive commands, exfiltrate data, or invoke network operations. The only potential concern is user-controlled branch naming, but the process slugifies and asks for confirmation when intent is unclear, and the allowed tools restrict execution to git operations.

No concerns found

How this analysis is made

Examples

Start a branch for a bugfix
Create a branch for the login redirect fix I'm working on.
Cut a branch from uncommitted work
Cut a new feature branch based on the changes in my working tree.
Start a branch for a described task
Start a branch — I'm going to add pagination to the users API.

name: branch description: >- Create a git feature branch named for the current session's work. Slugifies the git username and derives a short kebab-case feature slug from the changes or task under discussion. Use when the user asks to start, create, or cut a branch. allowed-tools: Bash(git branch:), Bash(git config:), Bash(git status:), Bash(git switch:), Bash(git symbolic-ref:*)

Branch

Create a feature branch named <git-username>/<feature-slug>, off the current base branch, using the session context to name it.

Context

If the fields below show commands rather than output, run each one first.

  • Branch: !git branch --show-current 2>/dev/null || echo "(not a git repo)"
  • Default branch: !git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null || echo "(unknown)"
  • Git username: !git config user.name 2>/dev/null || echo "(unset)"
  • Status: !git status --short 2>/dev/null

Process

  1. Check the current branch.

    • Not a git repo → stop and say so.
    • Already on a feature branch (not main/master or the repo's default branch) → stop and report it. Don't nest a branch off another feature branch unless the user explicitly asks.
    • On the base branch → continue.
  2. Derive the username segment. Slugify git config user.name so spaces and other non-alphanumeric characters become hyphens (e.g. "First Last" → first-last):

    git_username=$(git config user.name \
      | tr '[:upper:]' '[:lower:]' \
      | sed -E 's/[^a-z0-9]+/-/g; s/^-+|-+$//g')
    

    If user.name is unset, ask the user for the segment.

  3. Derive the feature slug from session context. A short, kebab-case description of the work (e.g. fix-login-redirect). Draw it, in order of preference, from:

    • Uncommitted changes in the working tree (see Status above).
    • The task the user is actively working on in this session.
    • What the user states directly.

    Keep it concise — a few words, lowercase, hyphen-separated, no type prefix. If the intent is unclear or you'd be guessing, propose a slug and confirm before creating the branch.

  4. Create the branch:

    git switch -c "${git_username}/<feature-slug>"
    
  5. Report the new branch name.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-a-feature-branch-ms5lrgfm' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-a-feature-branch-ms5lrgfm/download' --output '.skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md.part' && mv '.skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md.part' '.skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(git branch:*), Bash(git config:*), Bash(git status:*), Bash(git switch:*), Bash(git symbolic-ref:*)

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md' && test -s '.skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/branch' && cp -R '.skill-downloads/create-a-feature-branch-ms5lrgfm' '.claude/skills/branch'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-a-feature-branch-ms5lrgfm'

openskills read 'create-a-feature-branch-ms5lrgfm'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-a-feature-branch-ms5lrgfm/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills