From ai-devkit
Create a git branch from your current uncommitted changes or a short description — infers a sensible type prefix (feat/fix/chore/refactor/docs) and a kebab-case name, optionally in an isolated git worktree. Works on any repo.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-devkit:create-branch Optional description of the work (defaults to analyzing current changes)Optional description of the work (defaults to analyzing current changes)This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create a new git branch without needing an issue. Infer a clean `type/kebab-name` from either your current uncommitted changes or a one-line description, confirm it, then switch to it — optionally in an isolated worktree. This is the ad-hoc counterpart to `issue-to-branch`: use it when there's no issue to anchor on.
Create a new git branch without needing an issue. Infer a clean type/kebab-name from either your current uncommitted changes or a one-line description, confirm it, then switch to it — optionally in an isolated worktree. This is the ad-hoc counterpart to issue-to-branch: use it when there's no issue to anchor on.
$ARGUMENTS
# Where are we starting from? Detect the base branch instead of assuming it.
CURRENT=$(git branch --show-current)
if git ls-remote --heads origin develop | grep -q .; then BASE=develop
else BASE=$(git remote show origin 2>/dev/null | sed -n 's/.*HEAD branch: //p'); BASE=${BASE:-main}; fi
# What changed locally? (Used when no description is given.)
git status --short
git diff --stat
git diff --cached --stat
Two entry points, same destination:
$ARGUMENTS non-empty) — derive the name from the words.Type prefix — pick from the verb/intent:
feat — adds capability ("add", "implement", "support", new files).fix — corrects behavior ("fix", "bug", "crash", "regression").refactor — restructures without behavior change ("rename", "extract", "move").docs — documentation only (*.md, README, comments).chore — config, deps, tooling, CI, housekeeping.perf / test — performance work / test-only changes (optional, if your team uses them).Name — kebab-case, concise, no redundant prefix:
-, no spaces or slashes inside the name."add rate limiting to the api client" → feat/rate-limiting-api-client.# Slugify a description into a safe branch suffix (portable).
slugify() {
echo "$1" \
| tr '[:upper:]' '[:lower:]' \
| sed -E 's/[^a-z0-9]+/-/g; s/^-+//; s/-+$//' \
| cut -c1-50
}
Present the proposal before creating anything — never silently branch:
Proposed branch: feat/rate-limiting-api-client
Base: main
Source: description ("add rate limiting to the api client")
Isolation: none (switch in place)
Proceed? [accept / rename / change-base / use-worktree / cancel]
If the user asks for isolation (says "worktree", "isolated", "in parallel", or passes a worktree hint), switch to the worktree path in Phase 4.
Standard — switch in place (carries any uncommitted work onto the new branch):
NAME="feat/rate-limiting-api-client" # from Phase 2
git switch -c "$NAME" "$BASE" # branch off the detected base
# To keep committed work from your current branch instead, branch off HEAD: git switch -c "$NAME"
Isolated — new git worktree (leaves the current tree untouched; good for parallel work):
NAME="feat/rate-limiting-api-client"
# Sibling directory named after the leaf of the branch.
WT="../$(basename "$(git rev-parse --show-toplevel)")-${NAME##*/}"
git worktree add -b "$NAME" "$WT" "$BASE"
echo "Worktree ready at: $WT (cd there to work)"
Worktree note: uncommitted changes in the current tree do not follow into a new worktree. If the user has dirty work they want to move, prefer the standard
git switch -c(which carries it) or commit/stash first.
Only push/track when the user wants a remote branch now (many teams push later, at first PR):
git push -u origin "$NAME" # sets upstream so future `git push`/`git pull` need no args
| Prefix | Use for |
|---|---|
feat | New feature or capability |
fix | Bug fix / regression |
refactor | Restructure, no behavior change |
docs | Documentation only |
chore | Config, deps, tooling, CI |
perf / test | Perf-only / test-only (optional) |
type/kebab-name, lowercase, hyphen-separated.git switch -c) — fast, single workspace, carries dirty changes.git worktree add) — isolated dir for parallel work; clean up later with git worktree remove <path>.npx claudepluginhub alexandremorgado/ai-devkit --plugin ai-devkitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.