--- name: git-workflow description: Git best practices, branching strategies, commit conventions, and PR workflows. Use when reviewing git history, writing commits, setting up branching strategy, or improving git practices. Triggers on "git best practices", "commit message", "branching strategy", or "PR workflow". --- # Git Workflow Git best practices, commit conventions, branching strategies, and pull request workflows. Guidelines for maintaining a clean, useful git history. ## When to Apply Reference these guidelines when: - Writing commit messages - Creating branches - Setting up git workflows - Reviewing pull requests - Maintaining git history ## Rule Categories by Priority | Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Commit Messages | CRITICAL | `commit-` | | 2 | Branching Strategy | HIGH | `branch-` | | 3 | Pull Requests | HIGH | `pr-` | | 4 | History Management | MEDIUM | `history-` | | 5 | Collaboration | MEDIUM | `collab-` | ## Quick Reference ### 1. Commit Messages (CRITICAL) - `commit-conventional` - Use conventional commits - `commit-atomic` - Atomic commits (one logical change) - `commit-present-tense` - Use imperative present tense - `commit-meaningful` - Descriptive, meaningful messages - `commit-body` - Add body for complex changes - `commit-references` - Reference issues/tickets ### 2. Branching Strategy (HIGH) - `branch-naming` - Consistent branch naming - `branch-feature` - Feature branch workflow - `branch-main-protected` - Protect main branch - `branch-short-lived` - Keep branches short-lived - `branch-delete-merged` - Delete merged branches ### 3. Pull Requests (HIGH) - `pr-small` - Keep PRs small and focused - `pr-description` - Write clear descriptions - `pr-reviewers` - Request appropriate reviewers - `pr-ci-pass` - Ensure CI passes - `pr-squash` - Squash when appropriate ### 4. History Management (MEDIUM) - `history-rebase` - Rebase vs merge - `history-no-force-push` - Avoid force push to shared branches - `history-clean` - Keep history clean - `history-tags` - Use tags for releases ### 5. Collaboration (MEDIUM) - `collab-code-review` - Effective code reviews - `collab-conflicts` - Handle merge conflicts - `collab-communication` - Communicate changes ## Essential Guidelines ### Conventional Commits ``` # Format ():