--- name: git-workflow-standards description: Automatically applies when working with git. Ensures conventional commits, branch naming, PR templates, release workflow, and version control best practices. category: velocity --- # Git Workflow Standards When working with git, follow these patterns for consistent, professional version control. **Trigger Keywords**: git, commit, branch, pull request, PR, merge, release, version control, conventional commits, semantic versioning **Agent Integration**: Used by `backend-architect`, `devops-engineer`, `release-manager` ## ✅ Correct Pattern: Conventional Commits ```bash # Format: (): # # Types: # - feat: New feature # - fix: Bug fix # - docs: Documentation only # - style: Code style (formatting, semicolons) # - refactor: Code restructuring # - perf: Performance improvement # - test: Adding tests # - build: Build system changes # - ci: CI configuration changes # - chore: Other changes (dependencies, etc.) # Examples: # Feature commits feat(auth): add JWT authentication feat(api): add user profile endpoint feat: implement password reset flow # Bug fix commits fix(database): resolve connection pool leak fix(api): correct status code for validation errors fix: handle null values in user input # Documentation commits docs(readme): update installation instructions docs: add API documentation docs(contributing): add code review guidelines # Performance commits perf(query): optimize user search query perf: reduce memory usage in data processing # Refactoring commits refactor(models): simplify user model structure refactor: extract common validation logic # Breaking changes (add !) feat(api)!: change response format to JSON:API spec fix(auth)!: remove deprecated login endpoint # With body and footer feat(payments): add Stripe integration Implement Stripe payment processing with webhooks for subscription management. BREAKING CHANGE: Payment API now requires Stripe account Closes #123 ``` ## Branch Naming Convention ```bash # Format: / # # Types: # - feature/ - New features # - bugfix/ - Bug fixes # - hotfix/ - Urgent production fixes # - release/ - Release branches # - docs/ - Documentation changes # Examples: # Feature branches git checkout -b feature/user-authentication git checkout -b feature/add-search-endpoint git checkout -b feature/implement-caching # Bug fix branches git checkout -b bugfix/fix-login-redirect git checkout -b bugfix/resolve-memory-leak git checkout -b bugfix/correct-email-validation # Hotfix branches (for production) git checkout -b hotfix/critical-security-patch git checkout -b hotfix/fix-payment-processing # Release branches git checkout -b release/v1.2.0 git checkout -b release/v2.0.0-beta.1 # Documentation branches git checkout -b docs/update-api-reference git checkout -b docs/add-deployment-guide # Include issue number when applicable git checkout -b feature/123-user-profile git checkout -b bugfix/456-fix-crash ``` ## Pull Request Template ```markdown # .github/pull_request_template.md ## Description Brief description of what this PR does. Fixes #(issue) ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation update - [ ] Performance improvement - [ ] Code refactoring ## Changes Made - Change 1: Description - Change 2: Description - Change 3: Description ## Testing ### Test Plan Describe how you tested these changes: 1. Step 1 2. Step 2 3. Step 3 ### Test Results - [ ] All existing tests pass - [ ] New tests added and passing - [ ] Manual testing completed ## Checklist - [ ] My code follows the project's style guidelines - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published ## Screenshots (if applicable) Add screenshots here if UI changes were made. ## Additional Notes Any additional information that reviewers should know. ## Breaking Changes If this PR introduces breaking changes, describe them here and update CHANGELOG.md. ``` ## Commit Message Template ```bash # .gitmessage # (): # # # #