Concerns (6 files): - coding-style.md (163 lines): patterns, anti-patterns, error handling, SOLID - naming.md (105 lines): naming conventions table per language - documentation.md (149 lines): docstrings, WHY vs WHAT, README standards - testing.md (134 lines): AAA pattern, mocking philosophy, TDD - git-workflow.md (118 lines): conventional commits, branch naming, PR format - project-structure.md (82 lines): directory layout, entry points, config placement Languages (4 files): - python.md (224 lines): uv, ruff, pyright, pytest, pydantic, idioms, anti-patterns - typescript.md (150 lines): strict mode, discriminated unions, satisfies, as const - nix.md (129 lines): flake structure, module patterns, alejandra, anti-patterns - shell.md (100 lines): set -euo pipefail, shellcheck, quoting, POSIX Frameworks (1 file): - n8n.md (42 lines): workflow design, node patterns, Error Trigger, security Context budget: 975 lines (concerns + python) < 1500 limit Refs: T6-T16 of rules-system plan
119 lines
2.2 KiB
Markdown
119 lines
2.2 KiB
Markdown
# Git Workflow Rules
|
|
|
|
## Conventional Commits
|
|
|
|
Format: `<type>(<scope>): <subject>`
|
|
|
|
### Commit Types
|
|
|
|
- **feat**: New feature
|
|
- `feat(auth): add OAuth2 login flow`
|
|
- `feat(api): expose user endpoints`
|
|
|
|
- **fix**: Bug fix
|
|
- `fix(payment): resolve timeout on Stripe calls`
|
|
- `fix(ui): button not clickable on mobile`
|
|
|
|
- **refactor**: Code refactoring (no behavior change)
|
|
- `refactor(utils): extract date helpers`
|
|
- `refactor(api): simplify error handling`
|
|
|
|
- **docs**: Documentation only
|
|
- `docs(readme): update installation steps`
|
|
- `docs(api): add endpoint examples`
|
|
|
|
- **chore**: Maintenance tasks
|
|
- `chore(deps): update Node to 20`
|
|
- `chore(ci): add GitHub actions workflow`
|
|
|
|
- **test**: Tests only
|
|
- `test(auth): add unit tests for login`
|
|
- `test(e2e): add checkout flow tests`
|
|
|
|
- **style**: Formatting, no logic change
|
|
- `style: sort imports alphabetically`
|
|
|
|
### Commit Rules
|
|
|
|
- Subject max 72 chars
|
|
- Imperative mood ("add", not "added")
|
|
- No period at end
|
|
- Reference issues: `Closes #123`
|
|
|
|
## Branch Naming
|
|
|
|
Pattern: `<type>/<short-description>`
|
|
|
|
### Branch Types
|
|
|
|
- `feature/add-user-dashboard`
|
|
- `feature/enable-dark-mode`
|
|
- `fix/login-redirect-loop`
|
|
- `fix/payment-timeout-error`
|
|
- `refactor/extract-user-service`
|
|
- `refactor/simplify-auth-flow`
|
|
- `hotfix/security-vulnerability`
|
|
|
|
### Branch Rules
|
|
|
|
- Lowercase and hyphens
|
|
- Max 50 chars
|
|
- Delete after merge
|
|
|
|
## Pull Requests
|
|
|
|
### PR Title
|
|
|
|
Follow Conventional Commit format:
|
|
- `feat: add user dashboard`
|
|
- `fix: resolve login redirect loop`
|
|
|
|
### PR Description
|
|
|
|
```markdown
|
|
## What
|
|
Brief description
|
|
|
|
## Why
|
|
Reason for change
|
|
|
|
## How
|
|
Implementation approach
|
|
|
|
## Testing
|
|
Steps performed
|
|
|
|
## Checklist
|
|
- [ ] Tests pass
|
|
- [ ] Code reviewed
|
|
- [ ] Docs updated
|
|
```
|
|
|
|
## Merge Strategy
|
|
|
|
### Squash Merge
|
|
|
|
- Many small commits
|
|
- One cohesive feature
|
|
- Clean history
|
|
|
|
### Merge Commit
|
|
|
|
- Preserve commit history
|
|
- Distinct milestones
|
|
- Detailed history preferred
|
|
|
|
### When to Rebase
|
|
|
|
- Before opening PR
|
|
- Resolving conflicts
|
|
- Keeping current with main
|
|
|
|
## General Rules
|
|
|
|
- Pull latest from main before starting
|
|
- Write atomic commits
|
|
- Run tests before pushing
|
|
- Request peer review before merge
|
|
- Never force push to main/master
|