name: create-pr-commit description: "Generate branch names, conventional commit messages, and PR titles from real project conventions. Use when asked to propose commit/PR text (especially /create-commit or /create-pr) while validating types/scopes against repo standards."
Create Commit / PR / Branch Names
Overview
Produce high-signal Git metadata that matches the repository's actual conventions instead of inventing random types or scopes.
Workflow
Classify the change intent
- Determine the primary change type:
feat,fix,docs,style,refactor,perf,test,build,ci,chore, orrevert. - If multiple apply, choose the dominant user-facing impact.
- Determine the primary change type:
Discover project conventions before proposing text
- Inspect repo convention sources in this order:
.github/(PR templates, issue forms, workflows, actions, labels, release config)CONTRIBUTING*,README*, commit lint config (commitlint.*,package.json,.cz*,.commitlintrc*)- Existing git history (if available) for recurring scopes/types
- Extract:
- allowed commit types (if restricted)
- known scopes (directory or domain names)
- branch naming pattern (if documented)
- title casing rules for PRs/commits
- Inspect repo convention sources in this order:
Pick a scope using evidence
- Prefer scopes explicitly documented by the repo.
- If none are documented, derive from affected area (e.g.,
api,ui,docs,ci). - Never fabricate an arbitrary scope when confidence is low.
- If a new scope is reasonable, output:
suggest new scope: <scope>with one short reason.
Generate branch name options
- Output 1-3 options using detected pattern. If unknown, default to:
<type>/<short-kebab-title><type>/<scope>-<short-kebab-title>(only when scope is validated)
- Output 1-3 options using detected pattern. If unknown, default to:
Generate commit title options
- Output 1-3 options using:
type(scope): title- or
type: titlewhen scope is omitted.
- Use lowercase English, imperative mood, no trailing period.
- Keep under ~72 characters when possible.
- Output 1-3 options using:
Generate PR title options
- Output 1-3 options aligned with repository style.
- If no explicit PR style exists, mirror commit title semantics but allow natural readability.
Return a compact rationale block
- Include:
type chosenscope source(orno reliable scope found)branch pattern source(or fallback used)
- Include:
Output Template
branch names:
- ...
- ...
commit titles:
- ...
- ...
pr titles:
- ...
- ...
notes:
- type chosen: ...
- scope source: ...
- branch pattern source: ...
- suggest new scope: ... (optional)
Heuristics
- Prefer clarity over cleverness.
- Omit scope when uncertain.
- Keep semantic consistency across branch, commit, and PR titles.
- Avoid over-specific scopes tied to one file unless repo conventions do so.
Examples
Branch:
docs/update-contributing-guidelinesCommit:
docs: update contributing guidelinesPR:
docs: update contributing guidelinesBranch:
feat/auth-add-oauth-callbackCommit:
feat(auth): add oauth callback handlerPR:
feat(auth): add oauth callback handlerNotes:
suggest new scope: auth-flow (repo has auth and billing, but no flow-level scope yet)