Handle git operations following the project's specific conventions. Read the project's CLAUDE.md to understand branch naming, commit message format, and PR conventions before doing anything.
Steps
1. Read Project Conventions
Before any git operation, read CLAUDE.md for:
Commit message format (conventional commits? custom format?)
Branch naming convention
PR template (check .github/pull_request_template.md if it exists)
2. Check Current State
git status
git diff --stat HEAD
3. For Commits
Group related changes into logical commits (not one giant commit)
Write commit message following project conventions
If conventional commits: type(scope): description
Include breaking change footer if relevant
Max subject line: 72 characters
Body: what changed and WHY, not what (the diff shows what)
Check it doesn't already exist: git branch -a | grep name
5. For PR Descriptions
Structure:
## What
[One paragraph: what changed]
## Why
[One paragraph: why this change was needed]
## How
[Brief technical explanation of the approach]
## Testing
[How to test this change]
## Checklist
- [ ] Tests pass
- [ ] No console.logs left
- [ ] Docs updated if needed
6. Safety Checks
NEVER suggest git push --force on a shared branch
NEVER commit to main or master directly
Always check for secrets before committing: git diff --cached | grep -i "api_key\|secret\|password\|token"
Output
Print the git commands to run (don't run them automatically unless the user said "just do it").
Explain what each command does if it's non-obvious.
1---2name: git-workflow3description: Purpose4---56## Purpose7Handle git operations following the project's specific conventions. Read the project's CLAUDE.md to understand branch naming, commit message format, and PR conventions before doing anything.89## Steps1011### 1. Read Project Conventions12Before any git operation, read CLAUDE.md for:13- Commit message format (conventional commits? custom format?)14- Branch naming convention15- PR template (check `.github/pull_request_template.md` if it exists)1617### 2. Check Current State18```bash19git status20git diff --stat HEAD21```2223### 3. For Commits24- Group related changes into logical commits (not one giant commit)25- Write commit message following project conventions26- If conventional commits: `type(scope): description`27- Include breaking change footer if relevant28- Max subject line: 72 characters29- Body: what changed and WHY, not what (the diff shows what)3031### 4. For Branches32- Read the issue/task first to understand scope33- Name: `type/short-description` (e.g., `feat/add-review-widget`, `fix/auth-cookie-bug`)34- Check it doesn't already exist: `git branch -a | grep name`3536### 5. For PR Descriptions37Structure:38```markdown39## What40[One paragraph: what changed]4142## Why 43[One paragraph: why this change was needed]4445## How46[Brief technical explanation of the approach]4748## Testing49[How to test this change]5051## Checklist52- [ ] Tests pass53- [ ] No console.logs left54- [ ] Docs updated if needed55```5657### 6. Safety Checks58- NEVER suggest `git push --force` on a shared branch59- NEVER commit to `main` or `master` directly60- Always check for secrets before committing: `git diff --cached | grep -i "api_key\|secret\|password\|token"`6162## Output63Print the git commands to run (don't run them automatically unless the user said "just do it").64Explain what each command does if it's non-obvious.
Run npx skillmds@latest add shivae372/git-workflow in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Purpose It is listed under Productivity on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
shivae372 (@shivae372) published this skill. Their other Agent Skills are listed on their SkillMD profile.