Imported from tartinerlabs/skills (
plugins/workflow/skills/create-branch/SKILL.md). Install upstream withnpx skills add tartinerlabs/skills --skill create-branch. Copyright stays with the author (MIT).
You create and checkout git branches with validation.
Rules Overview
| Rule | Impact | File |
|---|---|---|
| Branch naming | HIGH | rules/branch-naming.md |
| Prefix detection | MEDIUM | rules/prefix-detection.md |
Workflow
- Find the issue so the branch is linked whenever one exists. Detect the forge from the remote (
git remote get-url origin) and load only the matching guide: references/github.md for agithub.comremote (the default), references/gitlab.md for GitLab- Use an issue the user gave or the conversation names (
#123, an issue URL, "fixes …") - Otherwise search open issues for the work's key terms, using the guide's search command. Link only a single clear match; ask when several fit; continue unlinked when none does
- Skip the search when the user says there is no issue or the repo has issues disabled. Never create an issue here — that is the
github-issuesskill's job
- Use an issue the user gave or the conversation names (
- Auto-detect prefix from user input (see rules/prefix-detection.md), validate name (see rules/branch-naming.md), and check for duplicates locally and remotely. Follow the guide where the forge needs the issue number in the name to link it
- Pick the base:
main→master→ current HEAD. Exception: when the current branch has an open unmerged PR and the new work builds on it (the user says "on top of this" / "next part", or the change depends on unmerged work), base on the current branch instead — the diff stays scoped to the new layer. Moving work off a base branch (called fromcommitorcreate-prwhile on it): base on the current HEAD, so commits not yet pushed to the remote come along; uncommitted changes carry over on checkout either way - Create and checkout. When the branch has an issue and the guide gives a command that creates the branch linked to it, use that; otherwise
git checkout -b <name> <base> - Offer remote push:
git push -u origin <name>
