pr-branch-naming
Skill91 starsChanged 6 months agoMITView on GitHub
Generate a conventionally-named branch and PR title from a feature description. Use when the user is starting a new branch, opening a PR, or asks how to name a branch or PR. Triggers on phrases like "create a branch", "name this branch", "open a PR", "what should I call this branch", "PR title for this".
- Commits and pushes
In this repository22 other files it gives its agents.
- accessibilitySkill
- agentic-design-systemsSkill
- ai-component-metadataSkill
- business-kickoff-workshopSkill
- cavemanSkill
- create-prdSkill
- create-skillSkill
- extract-design-systemSkill
- figma-generate-designSkill
- figma-useSkill
- find-skillsSkill
- frontend-designSkill
- marketing-psychologySkill
- performance-review-360-peerSkill
- performance-review-managerSkill
- performance-review-self-assessmentSkill
- presentationSkill
- product-context-builderSkill
- prompt-engineerSkill
- ux-auditSkill
- web-design-guidelinesSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 21
Don't fabricate a description.
- Distinctive: line 73
Keep it concise — aim for 3–6 words in the description portion
- Distinctive: line 106
Ask the user whether to:
- Distinctive: line 113
Before running either command, check the preconditions and stop with a clear message if they fail:
- Very specific: line 115
For
git checkout -b: run git status first. If the working tree is dirty, surface that and ask whether to proceed anyway, stash, or abort. - Very specific: line 116
For
gh pr create: run gh auth status first. If unauthenticated, tell the user to run gh auth login and stop. - Very specific: line 118
Never run destructive git operations (reset --hard, branch -D, push --force) as part of this skill.
- Distinctive: line 124
If the user is already on a non-default branch when invoking this skill, ask whether the new branch should be cut from main/master or from …
- Distinctive: line 125
If multiple changes are described (e.g., "fix the login bug and add a new dashboard widget"), suggest splitting into two branches/PRs …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR & Branch Naming
You generate a conventionally-named branch and a matching PR title from a feature description, then optionally check out the branch and/or open a PR — but only with explicit user confirmation.
Step 1: Get the feature description
The user's input is in $ARGUMENTS. It can be:
- A description — use it directly
- Empty — try to infer the work from
git statusand the most recent commits (git log -n 5 --oneline). If you can infer it, propose it back to the user for confirmation. If not, ask: "What's the feature or change this branch is for?"
Don't fabricate a description. If there's nothing to go on, ask.
Step 2: Pick the type and scope
Type (one of)
| Type | When to use |
feat | New feature or new UI work |
fix | Bug fix to existing functionality |
docs | Documentation changes only |
refactor | Code restructuring with no behavior change |
perf | Performance improvement |
chore | Tooling, config, dependency bumps |
experimental | Prototype, spike, or exploration not intended to ship as-is |
Pick the type that best matches the description. For designer-authored work, the common types are feat and experimental.
Scope
The area of the product affected — short, lowercase, single word if possible. Examples: playground, dashboard, auth, onboarding, billing.
Infer the scope from the description. If it's genuinely ambiguous, ask once: "What part of the product does this touch — dashboard, auth, etc.?" Don't pepper the user with questions.
Step 3: Pick the branch prefix
| Prefix | When to use |
feature/ | New features or UI work (pairs with feat) |
bugfix/ | Fixing existing functionality (pairs with fix) |
hotfix/ | Urgent production fixes |
docs/ | Documentation changes (pairs with docs) |
experimental/ | Prototypes and explorations (pairs with experimental) |
The prefix should align with the type. Use feature/ for feat, bugfix/ for fix, and so on.
Step 4: Generate the names
Branch name
Format: <prefix>/<kebab-description>
Rules:
- Lowercase only
- Hyphen-separated (no underscores, no spaces)
- No trailing hyphen
- Keep it concise — aim for 3–6 words in the description portion
- Drop filler words (
the,a,for,to,make)
Example: feature/patient-based-messaging
PR title
Format: <type>(<scope>): <short description>
Rules:
- Description in plain language, sentence case, no trailing period
- Concise — fits on one line
- Mirrors what the branch is about, but reads naturally to a human reviewer
Example: feat(playground): v1 prototype — patient-based messaging flow
Step 5: Show the result
Present both names plus a one-line rationale, in this format:
Branch: feature/patient-based-messaging
PR title: feat(playground): v1 prototype — patient-based messaging flow
Type: feat (new UI work) · Scope: playground · Prefix: feature/Step 6: Offer to apply
Ask the user whether to:
- Check out the branch — run
git checkout -b <branch> - Open a draft PR — run
gh pr create --draft --title "<title>" --body "<one-line description>" - Do both
- Neither — they'll copy the names themselves
Before running either command, check the preconditions and stop with a clear message if they fail:
- For
git checkout -b: rungit statusfirst. If the working tree is dirty, surface that and ask whether to proceed anyway, stash, or abort. If a branch with the same name already exists, suggest a numeric suffix (-2). - For
gh pr create: rungh auth statusfirst. If unauthenticated, tell the user to rungh auth loginand stop. Don't open the PR from a branch with no commits ahead of base — check withgit log <base>..HEAD --onelineand warn if empty.
Never run destructive git operations (reset --hard, branch -D, push --force) as part of this skill.
Notes
- If the user is already on a non-default branch when invoking this skill, ask whether the new branch should be cut from
main/masteror from the current branch. - If multiple changes are described (e.g., "fix the login bug and add a new dashboard widget"), suggest splitting into two branches/PRs rather than smushing them into one.
- The PR title's description can use an em dash (
—) to add a qualifier, as in the example. Don't overuse it.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

