github/git-workflow
> PR creation with structured summaries, keeping PR descriptions updated on follow-up pushes, and post-merge cleanup. Use when the user asks to commit, create or update a PR, push changes, address PR feedback, or says a PR was merged.
npx skills add https://github.com/github/copilot-billing-preview --skill git-workflow
Manage the git workflow for this project. Follow these conventions strictly.
Create descriptive branch names using category prefixes:
feat/short-description — new featuresfix/short-description — bug fixesrefactor/short-description — code restructuringchore/short-description — maintenance, deps, configsecurity/short-description — security fixesui/short-description — UI/UX changesimprove/short-description — improvements and optimizationsEach commit must be atomic — one logical change per commit.
Commit message format: prefix: short imperative description
Prefixes: fix:, feat:, refactor:, chore:, ci:, docs:, test:
Use feat!: or fix!: for breaking changes.
Rules:
package.json and run only the validation scripts that actually exist among build, lint, and test. If any existing required script fails, abort immediately and return the failure to the caller. Do not attempt to fix unrelated issues from inside this skill.Co-authored-by: Copilot <[email protected]>
Before creating any commit, review staged changes with git diff --cached to ensure only intended changes are included.
Do not treat "atomic commits" as a preference. Treat it as a required workflow.
Before creating any commit:
git status --short and git diff --stat.feat: add parser support for new fieldfeat: add reusable chart componentui: refresh dashboard layoutgit add -p when multiple logical changes share a file.git diff --cached and verify the staged diff matches exactly one logical change.Never create a single catch-all commit when the diff spans multiple concerns, such as:
If the user asks to create a PR and the branch contains uncommitted work spanning multiple logical changes, the skill must split that work into multiple commits before pushing.
If the user asks to address PR feedback, keep the fixes in one commit only when they all serve the same review-driven purpose. If feedback touches separate concerns, split it into multiple commits.
After all commits are ready and pushed:
git push -u origin <branch-name>gh pr create| Commit | Change |
|--------|--------|
| `fix:` description | What was fixed and why |
| `feat:` description | What was added |
When reporting success back to the user, include the branch name, relevant commit SHA(s), and PR URL.
When a branch already has an open PR and you push additional commits:
gh pr view --json body -q .body and use that exact content as the base for your update. Do not generate a fresh PR description from scratch.gh pr edit so it reflects the latest state of the branch.gh pr edit, verify the updated body still contains the important sections from the original PR description.Never leave the PR description stale after pushing fixes to an existing PR.
If the user explicitly asks to redo commits, split a monolithic commit, or force-push a corrected branch:
git push --force-with-lease only when the user explicitly requested rewriting remote history.When told a PR is merged:
git checkout maingit pull origin maingit branch -d <branch-name>Take github/git-workflow from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.