skills/branch-creator/SKILL.md
Create safe Git feature or hotfix branches with concise names. Use this whenever the user asks to create a branch, start work on a new feature or fix, wants a `feat/...` or `hotfix/...` branch name, asks for a short branch slug from a task description, or wants help before beginning local Git work. Default to recommending the branch name and command first, then create only after user confirmation. Do not push, commit, rebase, or create PRs.
npx skillsauth add adonis0123/adonis-skills branch-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a local Git branch with a short, readable name:
feat/<slug> for normal feature workhotfix/<slug> for urgent fixes or production-impacting repairsThree qualities define a good run, in this order:
Branch creation changes the local checkout, so the default workflow is propose first, create after confirmation.
Use this skill when the user says things like:
Do not use this skill for:
Pick one prefix:
feat/ for new features, non-urgent product changes, refactors tied to a feature, UI improvements, and planned work.hotfix/ for urgent fixes, production breakages, release-blocking fixes, payment/auth/data-loss fixes, or when the user explicitly says hotfix.If both are plausible, recommend one and ask for confirmation. Do not silently use hotfix/ just because the task is a bug; reserve it for urgency or release pressure.
Generate the part after the slash from the user's task:
track:gen, paid-success, pricing-table), derive the slug from it (track-gen) instead of re-describing the task in fresh English (tracker-code-generation). The team greps, tab-completes, and recognizes branches by the words they already use, so a shorter borrowed name is also the more accurate one. Do not go searching the repo for vocabulary — only reuse terms already visible in the request or conversation.add, update, fix, new, page, feature, code, logic, issue, support.Tightening examples — the "loose" names are what to avoid:
| Task | Loose (too long) | Tight |
| --- | --- | --- |
| 改埋点代码的生成方式(项目里有 track:gen) | feat/tracker-code-generation | feat/track-gen |
| 登录后跳转修复 | feat/fix-login-redirect-issue | feat/login-redirect |
| 线上支付确认弹窗崩溃 | hotfix/payment-confirmation-modal-crash | hotfix/pay-confirm |
| pricing 页面多币种支持 | feat/pricing-multi-currency-support | feat/pricing-currency |
Safe character set: letters a-z, numbers 0-9, hyphen -, one slash between prefix and slug. Avoid spaces, uppercase, underscores, dots, quotes, emoji, shell metacharacters, consecutive slashes, and Git-reserved sequences such as .. or @{.
Speed matters here: every extra shell command is a round trip the user waits through, and git ls-remote is a network round trip that can take seconds. The whole flow needs at most two commands — one to inspect, one to create.
git status --short --branch
This single call tells you everything you need: it errors if the directory is not a Git repository (stop and tell the user), the ## ... line shows the current branch, and any remaining lines show uncommitted changes. Do not also run git rev-parse, git branch --show-current, git show-ref, or any remote query during the proposal step.
A dirty working tree is not a blocker — git switch -c carries the changes onto the new branch. Mention it in one clause and continue.
Reply in the user's language, in exactly this shape:
推荐分支:feat/track-gen
命令:git switch -c feat/track-gen
原因:<one sentence covering both prefix and slug choice>
(当前 master,工作区干净)确认后我创建。
The final line compresses the repository state into one parenthetical. Do not output a checklist that reports each individual check on its own line (格式 / 本地同名 / 远端同名 / …) — that is slower to produce and slower to read, and the checks happen at creation time anyway.
If the user's intent is too vague to name well, ask one concise question instead of proposing. Good branch names depend on small scope.
If the original request already pre-authorizes creation ("直接创建", "create it now", "不用确认"), propose and create in the same turn — still show the name and command, just don't wait.
If the user confirms a branch you already proposed in the previous turn, use that exact branch name unless the user asks to change it. Do not regenerate the slug.
git check-ref-format --branch <branch-name> && git switch -c <branch-name>
No pre-checks needed beyond this chain: git switch -c itself fails cleanly if the branch already exists — handle that by offering git switch <branch-name> instead. If git check-ref-format fails, do not try shell escaping or quoting tricks; generate a simpler safe name and confirm it. Skip the remote-collision check by default: it costs a network round trip, and a collision surfaces harmlessly at push time anyway. Run git ls-remote --heads origin <branch-name> only if the user explicitly asks about the remote.
Never push, commit, rebase, merge, delete branches, or create a PR/MR as part of this skill.
已创建并切换:feat/track-gen(原 master)
未提交的改动已随分支带过来。
The parenthetical reports the previous branch only. The second line appears only when the working tree was dirty. If creation fails, quote the failing command and the relevant error line, then suggest the smallest safe next step.
A good result is boring, fast, and short:
development
Use this skill when the user wants to set, write, or use a goal or /goal that makes a coding agent keep working until a verifiable done condition is met. This skill configures the autonomy and stopping contract for Codex, Claude Code, or portable agent prompts; it does not perform the underlying task. Trigger on requests like 'should I set a goal?', 'set up a durable goal', 'give me a /goal prompt', 'keep refactoring until tests pass', 'I am stepping away, have the agent finish this', or goal prompts for migrations, refactors, ports, spec implementations, eval loops, backlog cleanup, or multi-checkpoint work. Do not use for single quick edits, running tests once, OKR/scrum goal questions, recurring reminders, or token-budget settings.
tools
Use when the user's pain is "adding/removing one more X means editing N files" and X is a recurring variant kind: popup, banner, modal, ad slot, payment method, AI model/tool, form field type, connector, sub-site, command, menu item, agent, extension point, or data source. Use when they want to design, refactor, review, name, or explain a pluggable mechanism using registry, interface/trait contract, runtime core, and convention folders; mention pluginize, pluggable, plugin architecture, extension point, registry pattern, or extensibility. Use when explaining the first-principles rationale, DDD/SOLID/OCP mapping, or industry analogies behind that structure. Use for cross-stack mapping to VSCode contributes, Webpack/Vite plugins, Rust/Tauri connectors, Python entry_points, or cargo features. Skip one variant's internals/styles/hooks/copy/bugs, and skip register/registry meaning DI container, user signup, or package registry.
development
Use BEFORE heavier workflow skills when route choice matters. Route creative work without a design doc/spec to Brainstorm; destructive or hard-to-reverse work to Discuss; unresolved decisions, Plan/Full fan-out, ship checks, unclear bugs, and fresh-eyes fix-then-re-review need this gate. Skip single-line read-only lookups, pure typo/formatting edits, trivial safe one-line fixes, and clearly safe named-skill requests. Outputs Route, Runtime skill, Fallback alias, and Execution path.
development
Cross-agent code review handoff and review-fix-re-review loop with persistent packet artifacts. Requires a git repo because packet addressing uses git rev-parse --show-toplevel. Use when the user asks for an independent, read-only second pair of eyes on a diff/branch/PR another agent or teammate implemented; asks to verify reviewer feedback before fixing; says a fix is done and wants scoped re-review; asks to continue the latest review packet; or asks for first-principles, DDD, high-cohesion/low-coupling review. Persists each loop under $repo_root/.review-handoff/active/ so agents can resume without copy-paste. Do NOT use for ordinary implementation, generic staged-change review, review-comment copy editing, non-git folders/zips/tarballs/temp dirs, or when the user names a different review skill.