/git-workflow:create-branch [change description hint, optional]from Git Workflow
Creates a Git branch for the work at hand, named `<type>/<english-kebab-case-description>` using Conventional Commits types as prefixes. Works with no arguments — it derives the name from the current session and the uncommitted changes; an argument is a hint that shapes the name, never literal text. On `main`/`master` it fetches and branches from the remote's real default branch; on an existing working branch it branches from HEAD so stacked work keeps its base and remembers its parent; a branch that has not been published and whose name breaks the convention is renamed in place. Never pushes, never leaves you committing on the default branch. Use when starting a new piece of work, or when you notice changes are being made directly on the default branch. Trigger on "create a branch", "start a new branch", "branch for this", "new feature branch", "I should be on a branch for this", "stwórz brancha", "zrób nowego brancha", "nowa gałąź", "przełącz na brancha dla tej zmiany".
Ships in Git Workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Starting work on the default branch is the mistake this skill exists to prevent, and a branch called
fix-stuff is the second one. It reads what is actually going on — the uncommitted diff, the current
session, an optional hint — and creates one correctly named branch from the correct base.
The prefix vocabulary and the English-only rule are shared with the other two skills and live in
../../references/conventions.md. The naming rules below are this
skill's own. The one-line version, in case the conventions file is not available:
<type>/<english-kebab-case-description>, always English, prefix from feature / fix / chore /
docs / refactor / test / perf.
Check these first and stop with a plain explanation if either fails — never proceed on a guess.
git --version # git must be on PATH
git rev-parse --git-dir # must be inside a Git repository
If git is missing, say so and point at https://git-scm.com/downloads. If this is not a
repository, say so and offer git init — do not run it unasked.
git status --short --branch
git diff --stat
git diff --cached --stat
You now know the current branch and what is uncommitted. Do not run git fetch yet — whether it is
needed depends on step 2.
Detect the remote's real default branch rather than assuming main:
git symbolic-ref --short --quiet refs/remotes/origin/HEAD # prints e.g. origin/main
# fallback if that ref is not set locally — read the "HEAD branch:" line of the output:
git remote show origin
Both are plain git calls on purpose: the skill's allowed-tools only grants Bash(git:*), so a
pipe into sed or awk would fall outside it and prompt for permission.
Then branch according to where you are:
On a branch whose name breaks the convention — a tool or a person may have started the work
on worktree-quiet-river, claude/xyz or my-wip. A name that does not match the standard is
renamed in place instead of getting a second branch next to it, whatever created it and whether
or not it already has commits. It qualifies only when all three hold:
git branch --show-current # not the default branch, and not <type>/<kebab-case> with a
# type from the conventions (feature, fix, chore, docs, refactor, test, perf)
git rev-parse --abbrev-ref --symbolic-full-name "@{upstream}" # fails → no upstream
git branch -r --list "origin/<current-branch>" # empty → never published
Then, after step 4 gives the name and step 5 clears the collision check:
git branch -m <name>
git branch --show-current # must print <name>; if not, say so — never leave it silent
Do not fetch for a rename; the branch keeps its base. If the branch is already published, a
rename would cut it off from its remote: leave it alone and create a conforming branch from HEAD
as in the last case below, saying why. A branch that already follows the convention is never renamed.
On the default branch (main, master, or whatever the command above returned) — fetch and
branch from the fresh remote tip, so the new branch does not inherit a stale local base:
git fetch origin
git checkout -b <name> origin/<default-branch>
On any other branch — branch from HEAD. You are there on purpose; stacked work keeps its
base:
git checkout -b <name>
Uncommitted changes travel with you in both cases. Do not stash, do not reset, do not block on a dirty tree.
When the new (or renamed) branch sits on a branch other than the default one, remember which one, so
create-pull-request does not have to guess the base later — merge-base heuristics fail once the
parent has been squash-merged:
git config branch.<name>.stack-parent <parent-branch>
The parent is the branch you branched from. For a renamed branch cut from another one, read it from
the first reflog entry (git reflog show --format=%gs <name>, the branch: Created from <ref>
line); a <ref> of HEAD or the default branch means no stack — set nothing. The setting is local
and is never pushed.
Sources, in order of authority:
/create-branch dodaj filtry do listy faktur →
feature/invoice-list-filters, not a transliteration of the Polish sentence.The shape is fixed:
<prefix>/<english-kebab-case-description>
feature/, corrected defect → fix/,
documentation only → docs/, restructuring → refactor/, tests only → test/, everything else →
chore/. The full type table is in the conventions file.feature/invoice-list-filters, never feature/changed-invoice-page-tsx.Do not ask the user what to call it. Deriving the name from context is the whole job.
git rev-parse --verify --quiet refs/heads/<name>
If the branch already exists, stop. Report the collision, name the existing branch, and let the
user decide — do not switch to it, do not append -2.
Say which branch was created or renamed (old name → new name), from which base, and why that base; name the stack parent if one was recorded. One or two lines.
main/master,
create a branch first.create-pull-request sets the upstream when it is actually needed.git branch -r
and mimic whatever is there.Example 1 — no argument, on main, dirty tree
Input: /create-branch with edits under src/features/invoices/
Action: detect default branch main → git fetch origin →
git checkout -b feature/invoice-list-filters origin/main. Uncommitted edits come along.
Example 2 — Polish hint
Input: /create-branch popraw wyścig przy odświeżaniu tokenu
Action: git checkout -b fix/token-refresh-race origin/main — the hint is translated and compressed,
not copied.
Example 3 — already on a working branch
Input: /create-branch while on feature/invoice-list-filters
Action: branch from HEAD, no fetch: git checkout -b test/invoice-filter-cases. Report that the
base was the current branch, not main.
Example 4 — branch named by a tool
Input: /create-branch while on worktree-quiet-river (or claude/xyz, or my-wip), never pushed
Action: the name breaks the convention → git branch -m chore/update-dependencies, then confirm with
git branch --show-current. No second branch is created and no fetch is needed. Report the old and
new name. A published branch is not renamed; a conforming one is branched from HEAD.
Example 5 — collision
Input: /create-branch add invoice filters, but feature/invoice-filters already exists
Action: stop. "Branch feature/invoice-filters already exists — tell me whether to work on it or
pick a different name." Nothing is created.
Example 6 — stacked branch
Input: /create-branch while on feature/invoice-list-filters
Action: git checkout -b test/invoice-filter-cases, then
git config branch.test/invoice-filter-cases.stack-parent feature/invoice-list-filters. Report the
stack parent.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub janszewczyk/claude-plugins --plugin git-workflowOther plugins' skills for the same job
4 skills in this plugin
/create-commitCommits the current uncommitted work as one commit — or at most two when the changes clearly split by Conventional Commits type — writing each message as `type(scope): imperative summary` in English. Works with no arguments: it reads `git status` and `git diff` and decides for itself; an argument narrows what to commit or hints at intent, and is never copied verbatim into the message. Stages by explicit path, never `git add -A`. Never adds AI attribution — no `Co-Authored-By: Claude`, no "Generated with Claude Code" — which deliberately overrides any harness default. Does not push. Use when work is ready to be recorded in history. Trigger on "commit this", "commit my changes", "make a commit", "save this to git", "write a commit message", "zrób commita", "zacommituj zmiany", "skomituj to", "zapisz zmiany w gicie"./create-pull-requestOpens a GitHub pull request for the current branch with a unified five-section description — Summary, Changes, Diff stats, How to test, Related issues — used whether or not the repository ships a PULL_REQUEST_TEMPLATE. Works with no arguments: title and body are derived from the branch's commits and diff, in English, with a `Type: Sentence` title such as `Feature: Add status and date range filters to the invoice list`, so a squash-merge produces a clean, readable subject. Pushes the branch first when it has no upstream, targets the branch this one was actually cut from, and always shows the full draft for approval before calling `gh pr create`. Refreshes an existing PR with `gh pr edit` instead of failing. Use when a branch is ready for review. Trigger on "open a PR", "create a pull request", "raise a PR for this branch", "put this up for review", "otwórz PR", "stwórz pull requesta", "wystaw to do review", "zrób PR z tego brancha".