返回 AiToEarn
git-workflow.md
根目录 / project / aitoearn-backend / .claude / rules / git-workflow.md
1 # Git Workflow
2
3 ## Branch Naming
4
5 Format: `<type>/<description>`, e.g., `feat/user-auth`, `fix/login-bug`, `refactor/rename-files`
6
7 Types: feat, fix, refactor, docs, test, chore, perf, ci
8
9 ## Commit Message Format
10
11 ```
12 <type>: <description>
13
14 <optional body>
15 ```
16
17 Types: feat, fix, refactor, docs, test, chore, perf, ci
18
19 Note: Attribution disabled globally via ~/.claude/settings.json.
20
21 ## Merge Strategy
22
23 - Feature branches must be rebased onto target branch before merging: `git rebase <target-branch>`
24 - Use squash merge to combine all commits into one: `git merge --squash <feature-branch>` (then `git commit`)
25 - Merge commits are prohibited; keep commit history linear and clean
26
27 ## Pull Request Workflow
28
29 When creating PRs:
30 1. Analyze full commit history (not just latest commit)
31 2. Use `git diff [base-branch]...HEAD` to see all changes
32 3. Draft comprehensive PR summary following the PR template (`.github/pull_request_template.md`)
33 4. Include test plan with TODOs
34 5. Push with `-u` flag if new branch
35 6. Wait for Gemini code review, read review comments and fix any issues raised
36 7. After fixing review comments, resolve the review threads via GitHub GraphQL API (`resolveReviewThread` mutation)
37
38 ## Feature Implementation Workflow
39
40 1. **Plan First**
41 - Use **planner** agent to create implementation plan
42 - Identify dependencies and risks
43 - Break down into phases
44
45 2. **TDD Approach**
46 - Use **tdd-guide** agent
47 - Write tests first (RED)
48 - Implement to pass tests (GREEN)
49 - Refactor (IMPROVE)
50 - Verify 80%+ coverage
51
52 3. **Code Review**
53 - Use **code-reviewer** agent immediately after writing code
54 - Address CRITICAL and HIGH issues
55 - Fix MEDIUM issues when possible
56
57 4. **Commit & Push**
58 - Detailed commit messages
59 - Follow conventional commits format
60
60 lines MARKDOWN