@eltonssouza/development-utility-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/.claude/agents/analyst.md +198 -0
  2. package/.claude/agents/backend-developer.md +126 -0
  3. package/.claude/agents/brain-keeper.md +229 -0
  4. package/.claude/agents/code-reviewer.md +181 -0
  5. package/.claude/agents/database-engineer.md +94 -0
  6. package/.claude/agents/devops-engineer.md +141 -0
  7. package/.claude/agents/frontend-developer.md +97 -0
  8. package/.claude/agents/gate-keeper.md +118 -0
  9. package/.claude/agents/migrator.md +291 -0
  10. package/.claude/agents/mobile-developer.md +80 -0
  11. package/.claude/agents/n8n-specialist.md +94 -0
  12. package/.claude/agents/product-owner.md +115 -0
  13. package/.claude/agents/qa-engineer.md +232 -0
  14. package/.claude/agents/release-engineer.md +204 -0
  15. package/.claude/agents/scaffold.md +87 -0
  16. package/.claude/agents/security-engineer.md +199 -0
  17. package/.claude/agents/sprint-runner.md +44 -0
  18. package/.claude/agents/stack-resolver.md +84 -0
  19. package/.claude/agents/tech-lead.md +182 -0
  20. package/.claude/agents/update-template.md +54 -0
  21. package/.claude/agents/ux-designer.md +118 -0
  22. package/.claude/settings.json +44 -0
  23. package/.claude/skills/README.md +332 -0
  24. package/.claude/skills/active-project/SKILL.md +129 -0
  25. package/.claude/skills/api-integration-test/SKILL.md +64 -0
  26. package/.claude/skills/auto-test-guard/SKILL.md +237 -0
  27. package/.claude/skills/auto-test-guard/resources/backend-tests.md +20 -0
  28. package/.claude/skills/auto-test-guard/resources/e2e-tests.md +24 -0
  29. package/.claude/skills/auto-test-guard/resources/execution-report.md +49 -0
  30. package/.claude/skills/auto-test-guard/resources/frontend-tests.md +18 -0
  31. package/.claude/skills/auto-test-guard/resources/initial-setup.md +108 -0
  32. package/.claude/skills/auto-test-guard/resources/run-suite.md +48 -0
  33. package/.claude/skills/auto-test-guard/resources/senior-gate.md +19 -0
  34. package/.claude/skills/brain-keeper/SKILL.md +60 -0
  35. package/.claude/skills/brain-keeper/obsidian/app.json +9 -0
  36. package/.claude/skills/brain-keeper/obsidian/appearance.json +4 -0
  37. package/.claude/skills/brain-keeper/obsidian/core-plugins.json +20 -0
  38. package/.claude/skills/brain-keeper/obsidian/daily-notes.json +5 -0
  39. package/.claude/skills/brain-keeper/obsidian/graph.json +32 -0
  40. package/.claude/skills/brain-keeper/obsidian/snippets/folder-colors.css +90 -0
  41. package/.claude/skills/brain-keeper/obsidian/templates.json +5 -0
  42. package/.claude/skills/brain-keeper/templates/README.md +51 -0
  43. package/.claude/skills/brain-keeper/templates/adr.md +40 -0
  44. package/.claude/skills/brain-keeper/templates/bug.md +35 -0
  45. package/.claude/skills/brain-keeper/templates/daily.md +38 -0
  46. package/.claude/skills/brain-keeper/templates/feature.md +62 -0
  47. package/.claude/skills/brain-keeper/templates/meeting.md +34 -0
  48. package/.claude/skills/brain-keeper/templates/tech-debt.md +21 -0
  49. package/.claude/skills/caveman/SKILL.md +187 -0
  50. package/.claude/skills/create-stack-pack/SKILL.md +281 -0
  51. package/.claude/skills/grill-me/SKILL.md +79 -0
  52. package/.claude/skills/honcho-memory/SKILL.md +207 -0
  53. package/.claude/skills/honcho-memory/docs/api-endpoints-verified.md +75 -0
  54. package/.claude/skills/honcho-memory/hooks/on-prompt-submit.js +221 -0
  55. package/.claude/skills/honcho-memory/hooks/on-stop.js +193 -0
  56. package/.claude/skills/honcho-memory/lib/honcho-client.js +363 -0
  57. package/.claude/skills/honcho-memory/lib/memory-injector.js +93 -0
  58. package/.claude/skills/honcho-memory/package.json +32 -0
  59. package/.claude/skills/honcho-memory/scripts/cli.js +370 -0
  60. package/.claude/skills/honcho-memory/scripts/setup.js +109 -0
  61. package/.claude/skills/honcho-memory/tests/t001-api-endpoints-verified.test.js +89 -0
  62. package/.claude/skills/honcho-memory/tests/t002-structure.test.js +97 -0
  63. package/.claude/skills/honcho-memory/tests/t003-honcho-client.test.js +162 -0
  64. package/.claude/skills/honcho-memory/tests/t004-soft-delete.test.js +259 -0
  65. package/.claude/skills/honcho-memory/tests/t005-memory-injector.test.js +175 -0
  66. package/.claude/skills/honcho-memory/tests/t006-on-prompt-submit.test.js +215 -0
  67. package/.claude/skills/honcho-memory/tests/t007-on-stop.test.js +165 -0
  68. package/.claude/skills/honcho-memory/tests/t008-cli.test.js +214 -0
  69. package/.claude/skills/honcho-memory/tests/t009-setup.test.js +232 -0
  70. package/.claude/skills/honcho-memory/tests/t010-skill-md.test.js +114 -0
  71. package/.claude/skills/honcho-memory/tests/t011-settings-hooks.test.js +105 -0
  72. package/.claude/skills/honcho-memory/tests/t012-docs-update.test.js +106 -0
  73. package/.claude/skills/honcho-memory/tests/t013-smoke-e2e.test.js +90 -0
  74. package/.claude/skills/pair-debug/SKILL.md +288 -0
  75. package/.claude/skills/prd-ready-check/SKILL.md +58 -0
  76. package/.claude/skills/project-manager/SKILL.md +167 -0
  77. package/.claude/skills/quality-standards/SKILL.md +201 -0
  78. package/.claude/skills/quick-feature/SKILL.md +264 -0
  79. package/.claude/skills/run-sprint/SKILL.md +342 -0
  80. package/.claude/skills/scaffold/SKILL.md +58 -0
  81. package/.claude/skills/stack-discovery/SKILL.md +159 -0
  82. package/.claude/skills/test-coverage-auditor/SKILL.md +59 -0
  83. package/.claude/skills/to-issues/SKILL.md +163 -0
  84. package/.claude/skills/to-prd/SKILL.md +130 -0
  85. package/.claude/skills/update-template/SKILL.md +254 -0
  86. package/.claude/stacks/CODEOWNERS +30 -0
  87. package/.claude/stacks/README.md +88 -0
  88. package/.claude/stacks/_template.md +116 -0
  89. package/.claude/stacks/java/spring-boot-3.md +376 -0
  90. package/.claude/stacks/java/spring-boot-4.md +438 -0
  91. package/.claude/stacks/typescript/angular-18.md +420 -0
  92. package/.claude/stacks/typescript/angular-19.md +397 -0
  93. package/.claude/stacks/typescript/angular-21.md +494 -0
  94. package/CLAUDE.md +453 -0
  95. package/README.md +391 -0
  96. package/bin/cli.js +773 -0
  97. package/bin/lib/backup.js +62 -0
  98. package/bin/lib/detect-stack.js +476 -0
  99. package/bin/lib/help.js +233 -0
  100. package/bin/lib/identity.js +108 -0
  101. package/bin/lib/local-dir.js +69 -0
  102. package/bin/lib/manifest.js +236 -0
  103. package/bin/lib/sync-all.js +394 -0
  104. package/bin/lib/version-check.js +398 -0
  105. package/dashboard/db.js +199 -0
  106. package/dashboard/package.json +22 -0
  107. package/dashboard/public/app.js +709 -0
  108. package/dashboard/public/content/docs/agents-reference.en.md +911 -0
  109. package/dashboard/public/content/docs/architecture-overview.en.md +260 -0
  110. package/dashboard/public/content/docs/autonomy-matrix.en.md +186 -0
  111. package/dashboard/public/content/docs/git-flow.en.md +525 -0
  112. package/dashboard/public/content/docs/honcho-memory.en.md +394 -0
  113. package/dashboard/public/content/docs/hooks-reference.en.md +420 -0
  114. package/dashboard/public/content/docs/pipeline.en.md +400 -0
  115. package/dashboard/public/content/docs/quality-gate.en.md +315 -0
  116. package/dashboard/public/content/docs/skills-reference.en.md +500 -0
  117. package/dashboard/public/content/docs/stack-rules.en.md +362 -0
  118. package/dashboard/public/content/docs/troubleshooting.en.md +637 -0
  119. package/dashboard/public/content/manifest.json +102 -0
  120. package/dashboard/public/content/manual/backend.en.md +1138 -0
  121. package/dashboard/public/content/manual/existing-project.en.md +831 -0
  122. package/dashboard/public/content/manual/frontend.en.md +1065 -0
  123. package/dashboard/public/content/manual/fullstack.en.md +1508 -0
  124. package/dashboard/public/content/manual/mobile.en.md +866 -0
  125. package/dashboard/public/index.html +108 -0
  126. package/dashboard/public/style.css +610 -0
  127. package/dashboard/public/vendor/marked.min.js +69 -0
  128. package/dashboard/rtk.js +143 -0
  129. package/dashboard/server-app.js +403 -0
  130. package/dashboard/server.js +104 -0
  131. package/dashboard/test/sprint1.test.js +406 -0
  132. package/dashboard/test/sprint2.test.js +571 -0
  133. package/dashboard/test/sprint3.test.js +560 -0
  134. package/package.json +33 -0
  135. package/scripts/hooks/subagent-telemetry.sh +14 -0
  136. package/scripts/hooks/telemetry-writer.js +250 -0
  137. package/scripts/latest-versions.json +56 -0
@@ -0,0 +1,525 @@
1
+ # Git Flow
2
+
3
+ Mandatory versioning standard for every project adopting `development-utility-kit`. Combines classic Git Flow with Conventional Commits and the agent-driven review rules (`code-reviewer`, `tech-lead`, `release-engineer`).
4
+
5
+ ## Why Git Flow is mandatory
6
+
7
+ - **Traceability**: every piece of work goes through an intention-named branch (`feature/`, `bugfix/`, `hotfix/`, `release/`) — history is easy to read and the origin of each change is obvious.
8
+ - **Safe hotfixes**: production has a stable line (`main`) that never receives direct commits. Hotfixes leave `main`, return to `main` and `develop` simultaneously, without dragging in-progress features along.
9
+ - **Prepared releases**: the `release/*` branch lets you stabilize a version (version bump, CHANGELOG, smoke tests) without freezing the whole team on `develop`.
10
+ - **Senior+ gate compatibility**: the pipeline (`auto-test-guard`, `gate-keeper`, `code-reviewer`, `tech-lead`) assumes PRs between named branches. Direct work on `main` or `develop` breaks the pipeline.
11
+ - **Cross-project standardization**: switching projects, the dev finds the same topology, branch names, and commit format.
12
+
13
+ ## Canonical branches
14
+
15
+ ```
16
+ hotfix/*
17
+
18
+
19
+ ┌────────main────────┐ ← production (only merges via PR from
20
+ │ │ release/* or hotfix/*)
21
+ │ release/* │
22
+ │ ▲ │
23
+ │ │ │
24
+ ▼─────┴──develop──────┘ ← integration (receives PRs from
25
+ ▲ ▲ feature/* and bugfix/*)
26
+ │ │
27
+ feature/*│ │bugfix/*
28
+ ```
29
+
30
+ | Branch | Base | Target (merge) | Purpose |
31
+ |--------------|------------|-------------------------|--------------------------------------------------------------------------------------------|
32
+ | `main` | — | — | Production. Only merges via PR from `release/*` or `hotfix/*`. Every merge produces a tag. |
33
+ | `develop` | `main` | — | Continuous integration of features. May be ahead of `main` by several features. |
34
+ | `feature/*` | `develop` | `develop` (via PR) | New feature. Naming: `feature/<short-slug>` (e.g., `feature/auth-refresh-token`). |
35
+ | `release/*` | `develop` | `main` + `develop` (PR) | Release preparation. Version bump, CHANGELOG, smoke. Naming: `release/v1.4.0`. |
36
+ | `hotfix/*` | `main` | `main` + `develop` (PR) | Urgent production fix. Naming: `hotfix/<short-slug>` (e.g., `hotfix/payment-rounding`). |
37
+ | `bugfix/*` | `develop` | `develop` (via PR) | Non-urgent dev bug fix. Naming: `bugfix/<short-slug>`. |
38
+
39
+ Absolute rule: **never commit directly to `main` or `develop`**. Every change enters via PR.
40
+
41
+ ## Feature flow
42
+
43
+ ### Start
44
+
45
+ ```bash
46
+ git checkout develop
47
+ git pull origin develop
48
+ git flow feature start auth-refresh-token
49
+ # manual equivalent:
50
+ # git checkout -b feature/auth-refresh-token develop
51
+ ```
52
+
53
+ ### Development
54
+
55
+ Make small, atomic commits with Conventional Commits messages:
56
+
57
+ ```bash
58
+ git add src/auth/refresh-token.ts
59
+ git commit -m "feat(auth): add POST /api/v1/auth/refresh endpoint"
60
+
61
+ git add src/auth/refresh-token.spec.ts
62
+ git commit -m "test(auth): cover refresh token rotation and expiry"
63
+
64
+ git add docs/api/auth.md
65
+ git commit -m "docs(auth): document refresh token payload"
66
+ ```
67
+
68
+ ### Finish
69
+
70
+ Two valid options:
71
+
72
+ **Option A — `git flow feature finish`** (local merge + branch delete). Use only on solo projects or with off-GitHub review:
73
+
74
+ ```bash
75
+ git flow feature finish auth-refresh-token
76
+ git push origin develop
77
+ ```
78
+
79
+ **Option B — Pull Request (recommended for teams)**:
80
+
81
+ ```bash
82
+ git push origin feature/auth-refresh-token
83
+ gh pr create --base develop --head feature/auth-refresh-token \
84
+ --title "feat(auth): refresh token rotation" \
85
+ --body "$(cat .github/PULL_REQUEST_TEMPLATE.md)"
86
+ ```
87
+
88
+ The PR triggers `code-reviewer` (initial review), then `tech-lead` for final approval. After merge, the remote branch is auto-deleted.
89
+
90
+ ## Release flow
91
+
92
+ A release branches off `develop` and prepares the delivery for `main`.
93
+
94
+ ```bash
95
+ git checkout develop
96
+ git pull origin develop
97
+ git flow release start v1.4.0
98
+ # git checkout -b release/v1.4.0 develop
99
+ ```
100
+
101
+ On the `release/*` branch, `release-engineer` runs:
102
+
103
+ 1. **Version bump**:
104
+ ```bash
105
+ # Backend (Maven)
106
+ mvn versions:set -DnewVersion=1.4.0 -DgenerateBackupPoms=false
107
+
108
+ # Frontend (npm)
109
+ npm version 1.4.0 --no-git-tag-version
110
+ ```
111
+ 2. **CHANGELOG**: generates/updates `CHANGELOG.md` from Conventional Commits since the previous tag.
112
+ 3. **Smoke tests**: runs `auto-test-guard` + `api-integration-test`.
113
+ 4. **Release commit**:
114
+ ```bash
115
+ git commit -am "chore(release): v1.4.0"
116
+ ```
117
+
118
+ Finishing produces two simultaneous PRs (`main` and `develop`):
119
+
120
+ ```bash
121
+ git push origin release/v1.4.0
122
+ gh pr create --base main --head release/v1.4.0 --title "chore(release): v1.4.0"
123
+ gh pr create --base develop --head release/v1.4.0 --title "chore(release): v1.4.0 back-merge"
124
+ ```
125
+
126
+ After `tech-lead` approval, merge **both**. Then create the tag:
127
+
128
+ ```bash
129
+ git checkout main
130
+ git pull origin main
131
+ git tag -a v1.4.0 -m "Release v1.4.0"
132
+ git push origin v1.4.0
133
+ ```
134
+
135
+ `release-engineer` never runs `git push` or `git tag` directly — it only prepares the commands; the human executes them.
136
+
137
+ ## Hotfix flow
138
+
139
+ Hotfix fixes production without going through `develop`.
140
+
141
+ ```bash
142
+ git checkout main
143
+ git pull origin main
144
+ git flow hotfix start payment-rounding
145
+ # git checkout -b hotfix/payment-rounding main
146
+ ```
147
+
148
+ Apply the fix, commit, open two PRs:
149
+
150
+ ```bash
151
+ git commit -am "fix(payment): correct cent rounding in BRL amounts"
152
+ git push origin hotfix/payment-rounding
153
+
154
+ gh pr create --base main --head hotfix/payment-rounding
155
+ gh pr create --base develop --head hotfix/payment-rounding
156
+ ```
157
+
158
+ After merge, patch bump (`v1.4.1`) and tag, same as release flow. **The branch must be merged into `main` AND `develop`** — forgetting the back-merge makes the hotfix reappear as a regression in the next release.
159
+
160
+ ## Bugfix flow
161
+
162
+ Identical to feature flow but signals a non-urgent fix:
163
+
164
+ ```bash
165
+ git checkout develop
166
+ git flow bugfix start dropdown-overflow-mobile
167
+ # implementation + commit
168
+ git push origin bugfix/dropdown-overflow-mobile
169
+ gh pr create --base develop --head bugfix/dropdown-overflow-mobile
170
+ ```
171
+
172
+ The difference vs `hotfix/*` is that bugfix **does not** go to `main` directly — it ships with the next normal release.
173
+
174
+ ## Conventional Commits
175
+
176
+ Every commit message follows the format:
177
+
178
+ ```
179
+ <type>(<scope>): <short description in imperative>
180
+
181
+ [optional body, 72-char line breaks]
182
+
183
+ [optional footer: BREAKING CHANGE, Closes #N, Refs #N]
184
+ ```
185
+
186
+ ### Allowed types
187
+
188
+ | Type | When to use |
189
+ |------------|------------------------------------------------------------------------------|
190
+ | `feat` | New user-facing feature or API consumer-visible feature |
191
+ | `fix` | Bug fix |
192
+ | `refactor` | Code reorganization with no behavior change |
193
+ | `test` | Add/adjust tests (unit, integration, E2E) |
194
+ | `docs` | Documentation change (Markdown, JSDoc, Javadoc) |
195
+ | `chore` | Maintenance task (dependencies, build, release) |
196
+ | `perf` | Performance improvement with no behavior change |
197
+ | `style` | Formatting, lint, whitespace (no logic changes) |
198
+ | `build` | Build system change (Docker, Maven, npm) |
199
+ | `ci` | CI/CD pipeline change (GitHub Actions, GitLab CI) |
200
+ | `revert` | Reverts a previous commit — body must cite the reverted SHA |
201
+
202
+ ### Scope
203
+
204
+ Optional but **strongly recommended**. Identifies the affected module: `auth`, `payment`, `user`, `web`, `db`, `mobile`, `infra`, `ci`. Enables history filtering:
205
+
206
+ ```bash
207
+ git log --oneline --grep="^feat(auth)"
208
+ ```
209
+
210
+ ### Good examples
211
+
212
+ ```
213
+ feat(auth): rotate refresh token every 24h
214
+ fix(payment): correct cent rounding in BRL amounts
215
+ refactor(user): extract email validation to domain service
216
+ test(order): cover cancellation after payment scenario
217
+ docs(api): document RFC 9457 error payload
218
+ chore(deps): bump spring-boot to 4.0.3
219
+ perf(query): add composite index on orders(user_id, created_at)
220
+ build(docker): migrate base image to eclipse-temurin:25-jre-alpine
221
+ ci(release): add automatic version bump job
222
+ revert: revert "feat(payment): add recurring PIX"
223
+
224
+ This reverts commit a1b2c3d4. Production bug with duplicated charges.
225
+ ```
226
+
227
+ ### Bad examples
228
+
229
+ ```
230
+ # Too generic
231
+ update code
232
+ fix stuff
233
+ WIP
234
+
235
+ # Missing Conventional type
236
+ added user endpoint
237
+ Fixed bug
238
+
239
+ # Subject too long (>72 chars)
240
+ feat(auth): add endpoint POST /api/v1/auth/refresh that rotates refresh tokens every 24h with configurable expiry
241
+
242
+ # Mixing concerns
243
+ feat(auth): refresh token + payment bugfix + README update
244
+ ```
245
+
246
+ ### Body and footer
247
+
248
+ Body explains **why** (not what — the diff already shows what). Footer marks breaking changes and issue references:
249
+
250
+ ```
251
+ feat(api): switch pagination format to metadata wrapper
252
+
253
+ The response used to be a bare array. It now returns
254
+ { data: [...], meta: { page, size, total } } to support
255
+ pagination across all resources.
256
+
257
+ BREAKING CHANGE: existing clients must change from
258
+ res.data[0] to res.data.data[0].
259
+
260
+ Closes #142
261
+ Refs ADR-021
262
+ ```
263
+
264
+ ## Non-negotiable restrictions
265
+
266
+ > **NON-NEGOTIABLE**
267
+ >
268
+ > - **NEVER** include references to "Claude", "Anthropic", "AI", "LLM", "assistant", or any AI tool in commit text (subject, body, trailers).
269
+ > - **NEVER** add a `Co-Authored-By: Claude <noreply@anthropic.com>` line or anything similar.
270
+ > - Commits must look 100% written by the human developer on the team.
271
+ > - Violation = `tech-lead` refuses the merge and the commit must be rewritten.
272
+
273
+ ### Why this rule exists
274
+
275
+ Commit history is the professional authorship record of the team. Leaking assistance tooling pollutes audit trails, adds noise to code review, and may breach internal IP policies. Whoever signs the commit owns it — and the owner is the human.
276
+
277
+ ### How to avoid accidents
278
+
279
+ 1. Configure your `~/.gitconfig` without auto-injected assistant trailers.
280
+ 2. Before `git commit`, read the full message (`git commit -v` shows the diff too).
281
+ 3. If a tool suggested a message containing any AI reference, **edit before committing**.
282
+ 4. Use a `commit-msg` hook (see Hooks section) to block automatically.
283
+
284
+ ### How to fix if it slipped through
285
+
286
+ For the latest commit (not yet pushed):
287
+
288
+ ```bash
289
+ git commit --amend
290
+ # Rewrite removing the reference. Save.
291
+ ```
292
+
293
+ For several commits (not yet pushed):
294
+
295
+ ```bash
296
+ git rebase -i HEAD~5
297
+ # Mark commits as `reword`, save, edit each message.
298
+ ```
299
+
300
+ For commits already pushed on your own feature branch (not on `main`/`develop`):
301
+
302
+ ```bash
303
+ git rebase -i origin/develop
304
+ # Rewrite, then force-push ONLY on your branch:
305
+ git push --force-with-lease origin feature/<your-branch>
306
+ ```
307
+
308
+ If it already landed in `main` or `develop`, open an incident with `tech-lead` — rewriting shared history needs team coordination.
309
+
310
+ ## Pull Requests
311
+
312
+ ### Title
313
+
314
+ Use Conventional Commits, same as the commit:
315
+
316
+ ```
317
+ feat(auth): refresh token rotation
318
+ ```
319
+
320
+ ### Body
321
+
322
+ Use a standard template (place it in `.github/PULL_REQUEST_TEMPLATE.md`):
323
+
324
+ ```markdown
325
+ ## What changed
326
+
327
+ 2-4 lines summary of what was done and why.
328
+
329
+ ## How to test
330
+
331
+ Reproducible steps (curl, commands, UI scenario).
332
+
333
+ ```bash
334
+ curl -X POST http://localhost:8080/api/v1/auth/refresh \
335
+ -H "Authorization: Bearer <token>"
336
+ ```
337
+
338
+ ## Checklist
339
+
340
+ - [ ] Unit tests green (`./mvnw test` / `npm test`)
341
+ - [ ] Coverage >= 85% lines, >= 80% branches
342
+ - [ ] Mutation score >= 70% (`./mvnw verify -Ppitest`)
343
+ - [ ] Lint zero warnings (`npm run lint -- --max-warnings 0`)
344
+ - [ ] Documentation updated (if applicable)
345
+ - [ ] No `// TODO` in production code
346
+ - [ ] No `console.log` / `System.out.println`
347
+ - [ ] No hardcoded secrets
348
+
349
+ ## References
350
+
351
+ Closes #N
352
+ ADR-XXX (if architectural decision involved)
353
+ ```
354
+
355
+ ### Reviewers
356
+
357
+ | PR type | Automatic reviewer | Human reviewer |
358
+ |---------------------------|--------------------------|-------------------------------|
359
+ | `feature/*` → `develop` | `code-reviewer` | `tech-lead` |
360
+ | `bugfix/*` → `develop` | `code-reviewer` | `tech-lead` |
361
+ | `release/*` → `main` | `code-reviewer` | `tech-lead` + `product-owner` |
362
+ | `hotfix/*` → `main` | `code-reviewer` | `tech-lead` |
363
+ | Cross-team (touches >1 area) | `code-reviewer` | `tech-lead` + area lead |
364
+
365
+ `code-reviewer` runs automatically when the PR opens and comments inline. `tech-lead` provides the final approval and blocks if the senior+ gate fails.
366
+
367
+ ## Agent integration
368
+
369
+ | Agent | Role in Git Flow |
370
+ |--------------------|----------------------------------------------------------------------------------------------------------|
371
+ | `release-engineer` | On `release/*`: version bump, CHANGELOG generation, prepares `git tag` commands for the human to run. |
372
+ | `tech-lead` | Final review on every PR targeting `main` or `develop`. Blocks if senior+ gate fails. |
373
+ | `code-reviewer` | Automatic inline review when PR opens. Comments on patterns, dead code, naming, error handling. |
374
+ | `gate-keeper` | Runs senior+ gate (coverage, mutation, a11y, Lighthouse). Blocks merge if thresholds are not met. |
375
+ | `qa-engineer` | Generates missing tests during the feature, before the PR. |
376
+ | `analyst` | Produces `PLAN_*.md` that becomes the base for the feature commits (1 PLAN = 1 `feature/*` branch typically). |
377
+
378
+ `release-engineer` **does not** run `git push --tags` or `git push origin main` — it only prints commands for the human.
379
+
380
+ ## Relevant local git hooks
381
+
382
+ > Note: these are **git hooks** (files in `.git/hooks/`), different from **Claude Code hooks** (see [Hooks reference](hooks-reference)).
383
+
384
+ ### `commit-msg` — validates Conventional Commits
385
+
386
+ File: `.git/hooks/commit-msg`
387
+
388
+ ```bash
389
+ #!/usr/bin/env bash
390
+ # Blocks commits outside Conventional Commits format
391
+ # and any AI/assistant reference in the message.
392
+
393
+ msg_file="$1"
394
+ msg=$(cat "$msg_file")
395
+
396
+ # Conventional Commits pattern
397
+ pattern='^(feat|fix|refactor|test|docs|chore|perf|style|build|ci|revert)(\([a-z0-9-]+\))?: .{1,72}'
398
+
399
+ if ! echo "$msg" | head -n1 | grep -Eq "$pattern"; then
400
+ echo "ERROR: commit outside Conventional Commits format."
401
+ echo "Expected format: <type>(<scope>): <description>"
402
+ exit 1
403
+ fi
404
+
405
+ # Blocks AI references
406
+ if echo "$msg" | grep -Eiq '(claude|anthropic|\bai\b|llm|co-authored-by:\s*claude|assistant)'; then
407
+ echo "ERROR: message contains AI/assistant reference — forbidden."
408
+ exit 1
409
+ fi
410
+ ```
411
+
412
+ Make it executable:
413
+
414
+ ```bash
415
+ chmod +x .git/hooks/commit-msg
416
+ ```
417
+
418
+ ### `pre-push` — local gate (optional)
419
+
420
+ File: `.git/hooks/pre-push`
421
+
422
+ ```bash
423
+ #!/usr/bin/env bash
424
+ # Runs tests before push. Skip with --no-verify if needed.
425
+
426
+ if [ -f pom.xml ]; then
427
+ ./mvnw -q test || exit 1
428
+ fi
429
+
430
+ if [ -f package.json ]; then
431
+ npm test -- --watchAll=false || exit 1
432
+ fi
433
+ ```
434
+
435
+ ### Distributing hooks in the project
436
+
437
+ Hooks in `.git/hooks/` are not versioned. To share, use `core.hooksPath`:
438
+
439
+ ```bash
440
+ # Version hooks in scripts/git-hooks/ and configure each clone
441
+ git config core.hooksPath scripts/git-hooks
442
+ ```
443
+
444
+ Other hook integrations are described in [Hooks reference](hooks-reference) — do not confuse the two systems.
445
+
446
+ ## Anti-patterns — what NOT to do
447
+
448
+ - **Direct commit to `main` or `develop`**: violates the "everything via PR" rule. Configure branch protection on GitHub/GitLab to block it.
449
+ - **Merge without PR**: skips `code-reviewer`, `tech-lead`, and the senior+ gate. Even when technically possible, the process forbids it.
450
+ - **Squash that erases Conventional history**: when "Squash and merge"-ing, the final message must remain Conventional. Do not let GitHub generate messages like "Merge pull request #42 from feature/auth".
451
+ - **Force push on shared branch**: `git push --force` on `main`, `develop`, `release/*` or `hotfix/*` breaks other devs' checkouts. Use `--force-with-lease` only on your own feature branch.
452
+ - **Long branches (> 5 days without rebase)**: increase conflicts. Rebase against `develop` at least once a day.
453
+ - **Mixing types in the same commit**: `feat + fix + refactor` in one commit pollutes the CHANGELOG and complicates revert. Split.
454
+ - **Forgetting hotfix back-merge into `develop`**: guarantees regression in the next release. Always two PRs.
455
+ - **Manual tag before merge to `main`**: only tag after confirmed merge. Tagging a commit not in `main` causes confusion.
456
+
457
+ ## Quick FAQ
458
+
459
+ ### How do I revert a merge on `main`?
460
+
461
+ ```bash
462
+ git checkout main
463
+ git revert -m 1 <merge-commit-SHA>
464
+ git push origin main
465
+ ```
466
+
467
+ `-m 1` tells git that parent 1 (the base, i.e., `main` before the merge) is what we want to keep. The revert becomes a new commit — history is preserved.
468
+
469
+ ### How do I cherry-pick a hotfix to `develop` manually?
470
+
471
+ If you forgot to open the PR to `develop`:
472
+
473
+ ```bash
474
+ git checkout develop
475
+ git pull origin develop
476
+ git cherry-pick <fix-commit-SHA>
477
+ git push origin develop
478
+ ```
479
+
480
+ If conflicts arise, resolve them, then `git cherry-pick --continue`.
481
+
482
+ ### How do I rebase safely on a long-running feature?
483
+
484
+ ```bash
485
+ git checkout feature/my-feature
486
+ git fetch origin
487
+ git rebase origin/develop
488
+ # Resolve conflicts commit by commit
489
+ git push --force-with-lease origin feature/my-feature
490
+ ```
491
+
492
+ `--force-with-lease` (not `--force`) protects against overwriting commits another dev may have pushed to your branch without your knowledge.
493
+
494
+ ### Can I use `merge --no-ff` instead of `git flow`?
495
+
496
+ Yes, `git flow` is syntactic sugar. The essentials are:
497
+
498
+ - Properly named branch.
499
+ - Merge via PR (not local).
500
+ - Merge commit preserved (`--no-ff`), so history clearly shows where the feature started and ended.
501
+
502
+ ### What if `commit-msg` hook complains about an old message during rebase?
503
+
504
+ The hook only runs on new commits. In a rebase with `reword`, it validates the new message. Rewrite to Conventional. If it is an old merge you did not author, ask the `tech-lead` for guidance.
505
+
506
+ ### How do I block direct push to `main` on GitHub?
507
+
508
+ In **Settings → Branches → Branch protection rules**:
509
+
510
+ - Pattern: `main`
511
+ - Require pull request before merging: on
512
+ - Require approvals: 1+
513
+ - Require status checks to pass: CI gate
514
+ - Restrict pushes that create matching branches: on
515
+
516
+ Replicate for `develop`.
517
+
518
+ ## References
519
+
520
+ - [Pipeline](pipeline) — overview of the task pipeline, from discovery to merge.
521
+ - [Agents reference](agents-reference) — details of each agent involved in the flow (`release-engineer`, `tech-lead`, `code-reviewer`, `gate-keeper`).
522
+ - [Quality gate](quality-gate) — thresholds applied before merge.
523
+ - [Autonomy matrix](autonomy-matrix) — who decides what in review conflicts.
524
+ - [Hooks reference](hooks-reference) — difference between git hooks and Claude Code hooks.
525
+ - [Troubleshooting](troubleshooting) — common issues in Git Flow, commits, and PRs.