Git branch pr workflow
Skill joshrotenberg/agent-tools/skills/git-branch-pr-workflow
Before making any non-trivial code, docs, or config change -- create a feature branch first, then open a PR. Never commit directly to main. Apply by default before any edit; this is the baseline branch discipline that all other git skills build on.From its SKILL.md
npx -y skills add joshrotenberg/agent-tools --skill git-branch-pr-workflowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, as published. Nobody here has run it
Git branch + PR workflow
Default to git checkout -b <type>/<description> before any
edits. Never commit directly to main, even on solo projects.
Conventional commit prefixes: feat, fix, refactor, chore,
ci, docs, test. Push branch, open PR, let the user (or the
dispatcher loop) merge.
When to apply
- Any code change beyond a trivial typo
- Any docs change that affects committed content
- Any config or workflow change
Why
- Keeps the commit log on main clean and bisectable
- CI runs against the PR before main moves
- Squash-merge gives main a clean linear history
- Even solo, the PR body is a useful place to record the "why"
How to apply
- Before any change,
git checkout -b <type>/<short-description>. If the work closes an issue, claim it first (gh issue edit <N> --add-label status/in-progress); see the claim protocol inissue-pr-conventions. - Make commits with conventional-commit messages
(
<type>: <description>;!marks breaking). - Push:
git push -u origin <branch>. - Open the PR:
gh pr create [--draft]with a tight body that references the underlying issue (use aCloses #Nkeyword in the PR body so the merge closes the linked issue). - Wait for CI; merge with
gh pr merge --squash --delete-branch.
Naming
Branch, issue title, PR title, and commit subject all take the same
conventional-commit prefix. The scheme, the type list, and the
tool-owned exemptions are in
issue-pr-conventions.
Two rules that bite here specifically:
-
The branch prefix matches the PR type. A
fix:PR belongs on afix/branch. Where they disagree, rename the branch (git branch -m fix/<slug>) before opening the PR. -
No trailers, and the author is the repo owner. Never add
Co-Authored-Byor a "Generated with Claude Code" line. Verify before pushing:git log -1 --format='%an <%ae>%n%(trailers)'The author must be the repo owner and the trailers must be empty. Amend before pushing if one slipped in.
Related
issue-pr-conventions-- the naming scheme, label taxonomy, and claim protocol.git-fix-pr-branching-- how to handle fixes when a PR is open vs merged.heredoc-backticks-- formatting the PR body without breaking the markdown.