Agent skill
git-workflow
A skill that outlines best practices for using Git in a collaborative development environment, including branching strategies, commit conventions, and pull request workflows.
Install this agent skill to your Project
npx add-skill https://github.com/nicholasgriffintn/claude-code/tree/main/skills/git-workflow
SKILL.md
Git Workflow Skill
Tooling Notes
This skill should only use read-only commands and avoid modifying files.
Workflow
Copy this checklist and use it to track your progress through the Git workflow process:
Git Workflow Checklist
- [ ] Create a feature branch from the main branch.
- [ ] Make changes and commit frequently with clear, descriptive messages, using atomic commits.
- [ ] Rebase your feature branch onto the latest main branch to keep it up to date.
- [ ] Run tests and ensure all checks pass before pushing changes.
- [ ] Push your feature branch to the remote repository.
- [ ] Open a pull request (PR) against the main branch with a clear description of changes.
- [ ] Request reviews from team members and address any feedback.
- [ ] Once approved, merge the PR using a squash merge to maintain a clean commit history.
- [ ] Delete the feature branch after merging.
Branching Strategy
Adopt the following branching strategy for effective collaboration:
- Main Branch: The stable branch that always reflects production-ready code.
- Feature Branches: Created from the main branch for developing new features or bug fixes. Named descriptively (e.g.,
feature/user-authentication). - Release Branches: Optional branches created from the main branch for preparing a new production release.
- Hotfix Branches: Created from the main branch to quickly address critical bugs in production.
Here's a visual representation of the branching strategy:
main
|
-----------------
| | |
feature1 feature2 hotfix1
Commit Conventions
Follow these the Conventional Commits specification for commit messages:
- Format:
<type>(<scope>): <description> - Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code changes that neither fix a bug nor add a featuretest: Adding or updating testschore: Maintenance tasks (build process, dependencies, etc.)
- Example:
feat(auth): add user login functionality
Pull Request Workflow
When creating and managing pull requests, follow these best practices:
- Descriptive Title and Description: Provide a clear title and detailed description of the changes made in the PR.
- Link Issues: Reference any related issues in the PR description.
- Request Reviews: Assign reviewers who are familiar with the codebase or the feature being changed.
- Address Feedback: Respond to reviewer comments and make necessary changes promptly.
- Merge Strategy: Use squash merging to combine all commits from the feature branch into a single commit on the main branch for a cleaner history.
- Post-Merge Actions: Delete the feature branch and ensure the main branch is up to date locally.
Branch Naming Conventions
Use the following conventions for naming branches:
- Feature Branches:
feature/<descriptive-name> - Bugfix Branches:
bugfix/<descriptive-name> - Hotfix Branches:
hotfix/<descriptive-name> - Release Branches:
release/<version-number> - Example:
feature/user-authentication,bugfix/login-error,hotfix/payment-issue,release/1.2.0
Common Git Commands
- Create a new branch:
bash
git checkout -b feature/your-feature-name - Commit changes:
bash
git add . git commit -m "feat(scope): descriptive message" - Rebase onto main:
bash
git fetch origin git rebase origin/main - Push branch to remote:
bash
git push origin feature/your-feature-name - Merge pull request (squash):
bash
git checkout main git pull origin main git merge --squash feature/your-feature-name git commit -m "Merge feature/your-feature-name" git push origin main - Delete a branch:
bash
git branch -d feature/your-feature-name git push origin --delete feature/your-feature-name
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
testing-strategy
A specialist skill that designs and implements a testing strategy for a codebase. This skill should be used after code development and before code review.
architecture-patterns
A specialist skill that recognises and applies common software architecture patterns within a codebase. This skill should be used during the design and development phases of a project.
project-analysis
A specialist skill that analyses a codebase to understand its structure, dependencies, and architecture. This skill should be used at the start of a new project or when onboarding to an existing codebase.
backend-design
Design robust backend systems and APIs. Use when users ask to plan or implement services, data models, or integrations.
security-review
A specialist skill for security reviews, threat modeling, and remediation guidance. Use for auth/permissions changes, secrets or PII handling, public endpoints, or dependency upgrades.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use when users ask to build web components, pages, or applications.
Didn't find tool you were looking for?