@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,911 @@
1
+ # Agents reference
2
+
3
+ This reference catalogs the 25 agents in the `development-utility-kit` harness. Each agent is a specialist declared in `.claude/agents/<name>.md` with a YAML frontmatter (`name`, `description`, `tools`, `model`). Skills invoke agents through the `Task` tool; agents can also invoke other agents (orchestration). Use this page as the operational index: which agent to open, with which model, at which point in the pipeline, and which downstream agents it dispatches.
4
+
5
+ Audience: developers on the team who open the local dashboard and need to decide, in seconds, which harness piece to move. Who decides what is consolidated in [autonomy-matrix](autonomy-matrix). Who enters each pipeline stage is in [pipeline](pipeline).
6
+
7
+ ## Master table — 25 agents
8
+
9
+ | Agent | Model | Domain | Decides alone? | When to invoke |
10
+ |---|---|---|---|---|
11
+ | `product-owner` | opus 4.7 | Product, scope, UX, business rule | Yes (4 human-only exceptions) | Decide scope, priority, MVP, API contract |
12
+ | `tech-lead` | opus 4.7 | Stack, pattern, refactor, final review | Yes (3 human-only exceptions) | Approve merge, decide pattern, resolve technical conflict |
13
+ | `security-engineer` | opus 4.7 | OWASP, LGPD, hardening | Yes (technical veto HIGH/CRITICAL) | Security audit, vulnerability, headers, CORS |
14
+ | `analyst` | sonnet 4.6 | Technical decomposition, goal-ready PLAN_*.md | Yes within scope | Break feature into FR/NFR/BR/IR and sprints with DoD |
15
+ | `architect` | sonnet 4.6 | Macro architecture, ADR | Yes; cross-context escalates to tech-lead | Decide architectural pattern, propose ADR |
16
+ | `backend-developer` | sonnet 4.6 | Java 25 + Spring Boot 4 | Yes within scope | Implement endpoint, service, DTO, repository |
17
+ | `frontend-developer` | sonnet 4.6 | Angular 21 + Signals + ng-bootstrap | Yes within scope | Build component, screen, typed service |
18
+ | `mobile-developer` | sonnet 4.6 | React Native 0.84 + Expo SDK 54 | Yes within scope | Mobile app from scratch, Angular→RN conversion, native integration |
19
+ | `database-engineer` | sonnet 4.6 | PostgreSQL, MongoDB, Redis | Yes; cross-cutting goes to tech-lead | Modeling, index, migration, query perf |
20
+ | `devops-engineer` | sonnet 4.6 | Docker, K8s, CI/CD, cloud | Yes up to R$ 200/month | CI/CD pipeline, containerization, deploy |
21
+ | `n8n-specialist` | sonnet 4.6 | n8n workflow + LangChain | Yes within scope | Create workflow, automation, AI agent in n8n |
22
+ | `ux-designer` | sonnet 4.6 | Wireframes, design system, a11y | Yes on "how it looks"; scope goes to PO | Wireframe, component spec, screen flow |
23
+ | `qa-engineer` | sonnet 4.6 | Unit/integration/E2E/mutation tests | Yes within scope | Write JUnit, Jest, Playwright, PIT tests |
24
+ | `gate-keeper` | sonnet 4.6 | Senior+ quality gate | Yes; blocks merge on red | Validate coverage, mutation, a11y, Lighthouse, pyramid |
25
+ | `test-coverage-auditor` | sonnet 4.6 | Coverage + debt audit | Yes (gate inside prd-ready-check) | Map test debt, P0/P1 |
26
+ | `code-reviewer` | sonnet 4.6 | Initial code review | Recommends; tech-lead merges | Review PR, findings by severity |
27
+ | `prd-ready-check` | sonnet 4.6 | Final pre-production gate | Yes; GO/NO-GO | Final checklist before deploy |
28
+ | `api-integration-test` | sonnet 4.6 | Real backend↔frontend smoke | Yes within scope | Boot stack and validate curl + clean console |
29
+ | `sprint-runner` | sonnet 4.6 | TDD sprint orchestration | Yes; asks on plan ambiguity | Execute Sprint N of PLAN_*.md |
30
+ | `scaffold` | haiku 4.5 | Java/Angular initial skeleton | Yes (mechanical, idempotent) | Create backend/, frontend/, or fullstack from scratch |
31
+ | `update-template` | haiku 4.5 | Sync with development-utility-kit | Yes (with Y checkpoint) | Update `.claude/` + CLAUDE.md |
32
+ | `migrator` | sonnet 4.6 | Legacy → target stack migration | Yes per phase; ADR per major cross | Java 8/11/17→25, Spring 2/3→4, Angular 14-20→21 |
33
+ | `release-engineer` | sonnet 4.6 | SemVer bump + CHANGELOG | Yes through command output; human pushes | Cut release, generate tag, validate permissions |
34
+ | `auditor` | sonnet 4.6 | Audit drift vs template | Reports only (read-only) | Compare project vs template, list divergent files |
35
+ | `brain-keeper` | sonnet 4.6 | Obsidian vault under `docs/brain/` | Yes within scope | Record daily, feature, ADR, bug at end of PLAN |
36
+
37
+ ---
38
+
39
+ ## Top authorities
40
+
41
+ ### product-owner
42
+
43
+ **Model**: opus 4.7
44
+
45
+ **When to invoke**: any product, scope, business rule, flow, priority, persona, success metric or API contract question. The single voice when the team needs a business decision.
46
+
47
+ PT triggers: `"decide produto"`, `"define escopo"`, `"regra de negócio"`, `"prioriza backlog"`, `"MVP ou v2"`.
48
+
49
+ **Mission**: decide product and record an ADR. Never asks the human outside the 4 exceptions (deleting real customer data, relevant financial cost, breaking change on a published public contract, brand identity change approved by marketing).
50
+
51
+ **Expected inputs**: raw user demand or hand-off from `analyst`/`architect`/developers with a product question.
52
+
53
+ **Outputs / artifacts**:
54
+ - ADR at `docs/brain/decisions/ADR-NNN-<slug>.md`
55
+ - "Product decision" log block
56
+ - Ordered backlog MVP → v2 → v3 with promotion criteria
57
+ - Numbered business rules, named edge cases, endpoint and screen contracts
58
+
59
+ **Inviolable rules**:
60
+ - You decide; asking the human is a rare exception.
61
+ - Every decision becomes an ADR — never an informal decision.
62
+ - Edge cases always named (empty, duplicate, concurrency, no permission, no network, invalid data, limit reached).
63
+ - Brutal MVP; cut what can be cut.
64
+ - Never contradict an active ADR without formally superseding it.
65
+
66
+ **Escalation**: human only in the 4 Autonomy Matrix situations. Product/technical conflict → joint ADR with `tech-lead`.
67
+
68
+ **Tools**: Read, Write, Glob, Grep, Bash(find/cat/git log/git diff/ls).
69
+
70
+ **When NOT to use**: direct code implementation (use `backend-developer`/`frontend-developer`). Stack/pattern decisions (use `tech-lead`).
71
+
72
+ ### tech-lead
73
+
74
+ **Model**: opus 4.7
75
+
76
+ **When to invoke**: any non-trivial technical decision, stack/pattern choice, cross-cutting refactor, technical debt, final review before merge, or conflict between specialists.
77
+
78
+ PT triggers: `"decisão técnica"`, `"qual padrão"`, `"aprova merge"`, `"review final"`, `"refactor disso"`.
79
+
80
+ **Mission**: orchestrate specialists, maintain technical consistency, block merge if the senior+ gate fails. Decides with a weighted framework (Impact 30 / Effort 25 / Risk 25 / Adherence 20).
81
+
82
+ **Expected inputs**: technical demand, ADR proposed by `architect`, PR ready after `code-reviewer`.
83
+
84
+ **Outputs**:
85
+ - Technical decision ADR with score grid in `## Justification`
86
+ - Delegation plan (which agent does what, parallel or sequential)
87
+ - Explicit merge approval or block
88
+ - Entry in `tech-debt.md` when debt is accepted
89
+
90
+ **Inviolable rules**:
91
+ - Decide with framework — never by intuition.
92
+ - Every significant technical decision becomes an ADR.
93
+ - Never implement directly; delegate to the correct specialist.
94
+ - Block merge if `gate-keeper` returns red; coverage/mutation/SpotBugs/OWASP are non-negotiable.
95
+ - Always consult active ADRs before deciding.
96
+
97
+ **Human escalation**: only 3 situations (irreconcilable requirement conflict, breaking change on public production contract, infra cost > R$ 200/month).
98
+
99
+ **Tools**: Read, Write, Glob, Grep, Bash(git/find/cat/ls).
100
+
101
+ **When NOT to use**: product question (go to `product-owner`). Implementation (go to the specialist). Trivial patch bump (delegate directly to the developer).
102
+
103
+ ### security-engineer
104
+
105
+ **Model**: opus 4.7
106
+
107
+ **When to invoke**: security audit, OWASP Top 10 review, LGPD compliance, auth/CORS/headers analysis, vulnerability scan, hardening.
108
+
109
+ PT triggers: `"auditoria de segurança"`, `"OWASP"`, `"LGPD"`, `"audita vulnerabilidade"`, `"revisa CORS e headers"`.
110
+
111
+ **Mission**: classify security findings and apply fixes. Has technical veto on HIGH/CRITICAL — blocks merge without human confirmation.
112
+
113
+ **Expected inputs**: codebase or PR diff, auth configuration, dependency list.
114
+
115
+ **Outputs**:
116
+ - Audit report structured by severity (CRITICAL/HIGH/MEDIUM)
117
+ - Veto formatted as `## SECURITY VETO — MERGE BLOCKED` when applicable
118
+ - Fix code applied via `Edit`/`Write`, not just description
119
+ - LGPD checklist when personal data is involved
120
+
121
+ **Inviolable rules**:
122
+ - HIGH/CRITICAL = merge blocked, no exception.
123
+ - Never assume something is secure without reading the code.
124
+ - Always deliver fix code, not just a description.
125
+ - Prioritize by real attacker impact, not CVSS alone.
126
+ - Never lower severity to unblock a sprint.
127
+
128
+ **Escalation**: human only in the single provided situation (irreversible action on real customer data). Notifies `tech-lead` on veto.
129
+
130
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(grep/find/cat/mvn/npm audit).
131
+
132
+ **When NOT to use**: functional bug without security component (use `backend-developer`/`frontend-developer`). Stack decision (use `tech-lead`).
133
+
134
+ ---
135
+
136
+ ## Decomposition and architecture
137
+
138
+ ### analyst
139
+
140
+ **Model**: sonnet 4.6
141
+
142
+ **When to invoke**: transform a PRD or DISCOVERY into a goal-ready technical PLAN with FR/NFR/BR/IR, BDD user stories, sprints, and machine-checkable DoD.
143
+
144
+ PT triggers: `"analisa essa tarefa"`, `"faz o plano"`, `"quebra em requisitos"`, `"cria as user stories"`.
145
+
146
+ **Mission**: produce `docs/plans/PLAN_<NAME>.md` executable by `sprint-runner` and by `/goal`. Every task and sprint ends with a DoD verifiable by an evaluator (Haiku).
147
+
148
+ **Expected inputs** (human path — requires discovery artifact):
149
+ - `docs/prd/PRD_<NAME>.md` (primary, from `to-prd`), or
150
+ - `docs/discovery/DISCOVERY_<NAME>.md` (fallback, from `grill-me`), or
151
+ - PLAN seed with §1 + §7 filled, or
152
+ - Proposed ADR.
153
+
154
+ Autonomous path (`sprint-runner`, `release-engineer`): exempt via signal `caller: sprint-runner|autonomous` in the Task prompt.
155
+
156
+ **Outputs**: `docs/plans/PLAN_<NAME>.md` with 9 fixed sections (context, requirements, modeling, BDD, sprints, risks, pending decisions, `/goal` block, history).
157
+
158
+ **Inviolable rules**:
159
+ - No discovery artifact on the human path = refuse.
160
+ - Every task and every sprint has a machine-checkable DoD.
161
+ - `/goal` block at the end of the file is mandatory.
162
+ - Never invent a requirement — ambiguities go in §7 "Pending decisions".
163
+ - Filename always `PLAN_<NAME_KEBAB_CASE>.md`, no spaces or accents.
164
+
165
+ **Escalation**: `architect` for new architectural decisions; `tech-lead` for ambiguity between stacks.
166
+
167
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(cat/find/git log).
168
+
169
+ **When NOT to use**: implementation (use `backend-developer`/`frontend-developer`). Trivial single-file edit. Bug with unknown root cause (use `pair-debug`).
170
+
171
+ ### architect
172
+
173
+ **Model**: sonnet 4.6
174
+
175
+ **When to invoke**: decide architectural pattern (DDD vs CRUD, modular monolith vs microservices, REST vs Event-Driven), model domain, record macro ADR.
176
+
177
+ PT triggers: `"decide arquitetura"`, `"qual padrão usar"`, `"modela domínio"`, `"trade-off arquitetural"`, `"registra ADR"`.
178
+
179
+ **Mission**: propose architecture with weighted framework (Impact 30 / Effort 25 / Risk 25 / Adherence 20). `tech-lead` approves cross-cutting decisions.
180
+
181
+ **Expected inputs**: technical context (scale, team, domain complexity), constraints, existing code.
182
+
183
+ **Outputs**: ADR saved at `docs/brain/decisions/ADR-NNN-<slug>.md` with Context, Decision, Consequences, Discarded alternatives and score grid.
184
+
185
+ **Inviolable rules**:
186
+ - No ADR, no architecture change.
187
+ - Decision framework mandatory — score in the ADR.
188
+ - Never introduce a dependency without justification.
189
+ - Inspect code before proposing; never propose a rewrite of code you have not read.
190
+ - No premature abstraction — only complicate with a concrete requirement.
191
+
192
+ **Escalation**: `tech-lead` when decision spans > 1 bounded context, cost > R$ 200/month, or public external contract.
193
+
194
+ **Tools**: Read, Write, Glob, Grep, Bash(git log/git diff/cat/find).
195
+
196
+ **When NOT to use**: implementation (use a developer). Patch or lib bump (use `tech-lead`). Product decision (use `product-owner`).
197
+
198
+ ---
199
+
200
+ ## Implementation
201
+
202
+ ### backend-developer
203
+
204
+ **Model**: sonnet 4.6
205
+
206
+ **When to invoke**: implement, refactor, or debug Java 25+ / Spring Boot 4.0+ code.
207
+
208
+ PT triggers: `"cria endpoint"`, `"implementa controller"`, `"faz o service"`, `"cria DTO"`, `"refatora backend"`.
209
+
210
+ **Mission**: deliver backend features inside the standards — `record` DTOs, Bean Validation, `ProblemDetail` (RFC 9457), Flyway with indexes, Testcontainers (never H2), JaCoCo ≥ 85% / PIT ≥ 70%.
211
+
212
+ **Expected inputs**: task from `sprint-runner` or `tech-lead` with a defined API contract.
213
+
214
+ **Outputs**: controllers, services, repositories, Flyway migrations, JUnit + Mockito + Testcontainers tests, ProblemDetail mapping.
215
+
216
+ **Inviolable rules**:
217
+ - `record` DTOs separated req/res; never expose entity.
218
+ - Bean Validation + `@ControllerAdvice` → `ProblemDetail`.
219
+ - No `var` in signatures/returns; no `// TODO`.
220
+ - Flyway migration with FK index on the N side in the same migration.
221
+ - Every external call has timeout + retry + domain-exception mapping.
222
+ - Never log token/password/PII.
223
+
224
+ **Escalation**: cross-table schema → `database-engineer`. Auth/headers/secrets → `security-engineer`. Contract change → `product-owner` + `frontend-developer`. Red gate → `gate-keeper`.
225
+
226
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(mvn/mvnw/gradle/gradlew/java/curl).
227
+
228
+ **When NOT to use**: Angular screen or component (use `frontend-developer`). Pattern decision (use `tech-lead`).
229
+
230
+ ### frontend-developer
231
+
232
+ **Model**: sonnet 4.6
233
+
234
+ **When to invoke**: implement, refactor, or debug Angular 21+ standalone + Signals + OnPush + ng-bootstrap.
235
+
236
+ PT triggers: `"cria componente"`, `"faz a tela"`, `"implementa frontend"`, `"refatora componente"`.
237
+
238
+ **Mission**: deliver Angular UI inside the mandatory multi-file layout (`.ts` + `.html` + `.scss`), with Signal Forms, lazy loading, a11y AA, and coverage ≥ 85%.
239
+
240
+ **Expected inputs**: wireframe from `ux-designer`, API contract from `backend-developer`, task from `sprint-runner`.
241
+
242
+ **Outputs**: standalone OnPush components, typed services, lazy routes, Jest + Testing Library + jest-axe tests.
243
+
244
+ **Inviolable rules**:
245
+ - Multi-file always — `templateUrl` + `styleUrls`. Inline forbidden (hard CLAUDE.md rule, overrides ADR-008).
246
+ - Standalone + OnPush + Signals; no NgModule or default ChangeDetection.
247
+ - Never `any`; always `unknown` + narrowing.
248
+ - Lazy loading mandatory on feature routes.
249
+ - `@if`/`@for`/`@switch` in new code; `*ngIf`/`*ngFor` are legacy.
250
+ - ng-bootstrap before reinventing a component.
251
+
252
+ **Escalation**: visual token or design system → `ux-designer`. Contract change → `product-owner` + `backend-developer`. Bundle/LCP regression → `tech-lead`.
253
+
254
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(npm/npx/ng/node).
255
+
256
+ **When NOT to use**: Spring backend (use `backend-developer`). Native app (use `mobile-developer`). UX/visual identity decision (use `ux-designer`).
257
+
258
+ ### mobile-developer
259
+
260
+ **Model**: sonnet 4.6
261
+
262
+ **When to invoke**: build iOS/Android app from scratch, convert Angular to mobile, implement native features (camera, push, biometrics), store deploy.
263
+
264
+ PT triggers: `"cria app mobile"`, `"transforma em mobile"`, `"react native"`, `"implementa tela mobile"`.
265
+
266
+ **Mission**: deliver React Native 0.84+ with New Architecture, Expo SDK 54+, TS strict, Reanimated 4, FlashList 2, React Navigation 7.
267
+
268
+ **Expected inputs**: wireframe or existing Angular app (for conversion), backend API contract, platform requirements.
269
+
270
+ **Outputs**: features-first structure, screens, hooks, services, env configs (dev/staging/prod), EAS build, deploy to TestFlight/Play Internal.
271
+
272
+ **Inviolable rules**:
273
+ - TS strict, never `any`.
274
+ - Functional components with hooks; never classes.
275
+ - React Navigation for navigation; never manual linking.
276
+ - Reanimated 4 (not the old Animated API).
277
+ - FlashList for long lists; FlatList only legacy.
278
+ - MMKV for sync storage; AsyncStorage only legacy.
279
+ - Error boundary on every screen; skeleton instead of spinner.
280
+
281
+ **Escalation**: stack/lib decision → `tech-lead`. Product decision → `product-owner`. UX → `ux-designer`.
282
+
283
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(npx/npm/yarn/node/expo/pod/xcodebuild/adb/gradle/gradlew/cat/find/curl/git).
284
+
285
+ **When NOT to use**: Angular web (use `frontend-developer`). Backend (use `backend-developer`).
286
+
287
+ ### database-engineer
288
+
289
+ **Model**: sonnet 4.6
290
+
291
+ **When to invoke**: relational modeling, index strategy, migration plan, query optimization, PostgreSQL/MongoDB/Redis decision.
292
+
293
+ PT triggers: `"modela banco"`, `"otimiza query"`, `"estratégia de índice"`, `"planeja migration"`, `"performance de banco"`.
294
+
295
+ **Mission**: produce Flyway DDL with indexes created together with the table, with each index justified by query pattern, and N+1 prevention.
296
+
297
+ **Expected inputs**: domain requirements, predicted query patterns, estimated data volume.
298
+
299
+ **Outputs**: entity table (field/type/constraint/index/justification), relationship table, dedicated indexes, Flyway `V<N>__<description>.sql`.
300
+
301
+ **Inviolable rules**:
302
+ - Every index has a justification (which query it benefits).
303
+ - Index created in the same migration as the table.
304
+ - Never suggests an index without analyzing the pattern.
305
+ - Considers volume on type choice (VARCHAR vs TEXT, INT vs BIGINT).
306
+ - No N+1 — checks fetch strategy on JPA relationships.
307
+
308
+ **Escalation**: cross-context schema → `tech-lead`. Migration applied in production → `tech-lead` approves.
309
+
310
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(mvn/mvnw/cat/find/grep).
311
+
312
+ **When NOT to use**: service or controller implementation (use `backend-developer`). Trivial app cache (use `backend-developer`).
313
+
314
+ ### devops-engineer
315
+
316
+ **Model**: sonnet 4.6
317
+
318
+ **When to invoke**: containerization, CI/CD, K8s, deploy, observability (Prometheus, ELK, Jaeger), cloud choice.
319
+
320
+ PT triggers: `"containeriza"`, `"configura CI/CD"`, `"monta pipeline"`, `"deploy cloud"`, `"infra"`.
321
+
322
+ **Mission**: deliver non-root multi-stage Dockerfile, docker-compose with healthcheck, lint→build→test→scan→deploy pipeline, blue/green or canary strategy.
323
+
324
+ **Expected inputs**: project stack, uptime requirements, cost constraints.
325
+
326
+ **Outputs**: Dockerfile, docker-compose.yml, CI/CD workflow, Prometheus/Grafana dashboards, AlertManager rules.
327
+
328
+ **Inviolable rules**:
329
+ - Containers always run non-root.
330
+ - Always multi-stage builds.
331
+ - Healthcheck on every service.
332
+ - Secrets never in env vars in compose — vault or Docker secrets.
333
+ - Dependency cache, parallelism, fail-fast in the pipeline.
334
+ - Never push to prod without a rollback plan.
335
+
336
+ **Escalation**: cost > R$ 200/month → human with proposal + recommendation. Decision that affects architecture pattern → `tech-lead`.
337
+
338
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(docker/docker-compose/kubectl/cat/find/curl/git log/git status).
339
+
340
+ **When NOT to use**: product/scope question (use `product-owner`). Stack migration (use `migrator`).
341
+
342
+ ### n8n-specialist
343
+
344
+ **Model**: sonnet 4.6
345
+
346
+ **When to invoke**: build/debug n8n workflows, integrations between systems, AI agents with LangChain, webhooks, n8n deploy on Docker/K8s.
347
+
348
+ PT triggers: `"cria workflow n8n"`, `"automação n8n"`, `"debug workflow"`, `"integra n8n com backend"`.
349
+
350
+ **Mission**: deliver workflow with error handling, idempotency, rate limiting, reusable subworkflows, and managed credentials (never hardcoded).
351
+
352
+ **Expected inputs**: desired trigger (webhook/cron/chat), systems to integrate, transformation rules, retry requirements.
353
+
354
+ **Outputs**: workflow exported as JSON, n8n + PostgreSQL + Redis compose deploy, execution dashboards, AI Agent with tools and memory.
355
+
356
+ **Inviolable rules**:
357
+ - Every workflow has error handling — never silent errors.
358
+ - Production webhooks validate payload on the first node.
359
+ - Credentials never hardcoded.
360
+ - Function nodes commented explaining logic.
361
+ - Subworkflows for reusable logic.
362
+ - Rate limiting on external calls.
363
+ - Idempotency on webhooks.
364
+
365
+ **Escalation**: Spring Boot API contract → `backend-developer`. Auth/JWT → `security-engineer`. Product decision → `product-owner`.
366
+
367
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(docker/docker-compose/npm/npx/node/curl/cat/find/git).
368
+
369
+ **When NOT to use**: core domain logic (use `backend-developer`). Trivial automation that fits in cron (use `devops-engineer`).
370
+
371
+ ---
372
+
373
+ ## UX/UI
374
+
375
+ ### ux-designer
376
+
377
+ **Model**: sonnet 4.6
378
+
379
+ **When to invoke**: descriptive wireframe, screen flow, component spec with states, heuristic analysis, design system, WCAG 2.1 AA a11y.
380
+
381
+ PT triggers: `"wireframe"`, `"fluxo de tela"`, `"design system"`, `"acessibilidade"`, `"spec de UX"`.
382
+
383
+ **Mission**: define "how it looks" — states, animations, layout, spacing, microcopy, ng-bootstrap component choice. Decides and produces the spec.
384
+
385
+ **Expected inputs**: feature or screen defined by `product-owner`, user flow, design system constraints.
386
+
387
+ **Outputs**: descriptive wireframe (route, access, layout, ng-bootstrap components, default/loading/empty/error/disabled states, flow, responsiveness, a11y).
388
+
389
+ **Inviolable rules**:
390
+ - Always specify ALL states — never only the happy path.
391
+ - Error message guides the user to fix it; never a generic "an error occurred".
392
+ - Empty state has a clear CTA.
393
+ - Skeleton on lists; spinner only for short actions.
394
+ - Never use absolute colors — reference design tokens / Bootstrap variables.
395
+ - ng-bootstrap before inventing a component.
396
+ - WCAG 2.1 AA is not optional.
397
+
398
+ **Escalation**: scope or flow → `product-owner`. New visual dependency → `tech-lead`.
399
+
400
+ **Tools**: Read, Write, Glob, Grep, Bash(cat/find).
401
+
402
+ **When NOT to use**: implement the component (use `frontend-developer`). Decide what the user can do (use `product-owner`).
403
+
404
+ ---
405
+
406
+ ## Quality
407
+
408
+ ### qa-engineer
409
+
410
+ **Model**: sonnet 4.6
411
+
412
+ **When to invoke**: write, fix, or improve unit, integration, or E2E tests. Raise mutation score. Cover an untested scenario.
413
+
414
+ PT triggers: `"cria testes"`, `"escreve teste unitário"`, `"teste de integração"`, `"teste E2E"`.
415
+
416
+ **Mission**: cover behavior with JUnit 5 + Mockito + Testcontainers (backend), Jest + Testing Library (frontend), Playwright + axe (E2E), PIT (mutation).
417
+
418
+ **Expected inputs**: new code to cover, bug to reproduce, threshold to reach.
419
+
420
+ **Outputs**: unit tests, integration (`*IT.java`), E2E with axe scan, jest-axe scan in components, Lighthouse CI config.
421
+
422
+ **Inviolable rules**:
423
+ - Reproduce the bug before fixing — every fix starts with a red test.
424
+ - Testcontainers, never H2.
425
+ - AssertJ in Java instead of `assertEquals`.
426
+ - Testing Library instead of `fixture.debugElement`.
427
+ - `@Disabled`/`.skip()` only with ADR and deadline.
428
+ - Mutation score ≥ 70% in `domain/` + `application/`.
429
+ - A11y `serious`/`critical` = hard-fail.
430
+ - Lighthouse: median-of-3 within budget.
431
+ - Pyramid: hard-fail if `e2e_ratio > 30%`.
432
+
433
+ **Escalation**: test fails due to a production bug → responsible developer. Mutation score < 70% after trying → `tech-lead`.
434
+
435
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(mvn test/mvnw test/npm test/npx jest/npx playwright).
436
+
437
+ **When NOT to use**: red gate without understanding what failed (use `gate-keeper`). Feature implementation (use developers).
438
+
439
+ ### gate-keeper
440
+
441
+ **Model**: sonnet 4.6
442
+
443
+ **When to invoke**: at the end of every task or sprint, to generate missing tests and run the full senior+ gate (coverage, mutation, SpotBugs, OWASP, jest-axe, axe-playwright, Lighthouse CI, pyramid).
444
+
445
+ PT triggers: `"roda os testes"`, `"gera os testes"`, `"garante que nada quebrou"`, `"valida a tarefa"`, `"testa tudo"`, `"suite completa"`.
446
+
447
+ **Mission**: senior+ safety net. Blocks merge if any threshold fails. Diagnoses and returns to the specialist with a clear instruction.
448
+
449
+ **Expected inputs**: scope detected via `git diff --name-only HEAD~1..HEAD` (or `--cached`).
450
+
451
+ **Outputs**: generated tests per layer, report with counts/coverage/mutation score, pyramid line (`unit X% | integration Y% | e2e Z% → balanced | warn | RED`), GREEN/RED verdict.
452
+
453
+ **Inviolable rules**:
454
+ - Task without green gate = task incomplete.
455
+ - Never `@Disabled`/`.skip()`/`xit()` to pass.
456
+ - Never lowers a threshold.
457
+ - Surviving mutant becomes an immediate fix, not debt.
458
+ - Browser console clean on E2E (via Chrome MCP).
459
+ - Suite runs on the whole project, not just touched modules.
460
+ - A11y `serious`/`critical` blocks merge.
461
+ - Lighthouse outside the budget blocks merge (never re-runs until it passes).
462
+ - Pyramid `e2e_ratio > 30%` blocks merge.
463
+
464
+ **Escalation**: production bug → correct developer. Persistent low mutation → `tech-lead`. Critical CVE → `security-engineer`. Business rule changed → `product-owner`.
465
+
466
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(git/node/mvn/mvnw/gradle/gradlew/npm/npx/ng/cat/find/ls).
467
+
468
+ **When NOT to use**: debt audit without running the suite (use `test-coverage-auditor`). Decision about what to test (use `qa-engineer`).
469
+
470
+ ### test-coverage-auditor
471
+
472
+ **Model**: sonnet 4.6
473
+
474
+ **When to invoke**: map untested code, identify recurring manual tests, prioritize debt (P0/P1/P2/P3). Acts as a gate inside `prd-ready-check`.
475
+
476
+ PT triggers: `"audita os testes"`, `"tem débito de teste?"`, `"cobertura tá ok?"`, `"faz auditoria de cobertura"`.
477
+
478
+ **Mission**: audit and report. Does not write tests (that's `qa-engineer`) nor run the suite (that's `gate-keeper`).
479
+
480
+ **Expected inputs**: source tree (backend + frontend), JaCoCo + Jest reports, previous `tech-debt.md`.
481
+
482
+ **Outputs**: count by severity, trend vs previous audit, verdict for the PRD gate, update to `tech-debt.md` with P0/P1.
483
+
484
+ **Inviolable rules**:
485
+ - Never lowers threshold without a formal ADR.
486
+ - Never closes a P0 without a corresponding committed automated test.
487
+ - Never confuses "passes CI" with "actually covered" — analyzes assertions.
488
+
489
+ **Escalation**: open P0 → blocks `prd-ready-check`. Prioritization → `tech-lead`. Test generation → `gate-keeper`.
490
+
491
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(git/mvn/mvnw/npm/npx/find/cat/ls).
492
+
493
+ **When NOT to use**: generate the tests (use `qa-engineer`/`gate-keeper`). Formally accept the debt (use `tech-lead`).
494
+
495
+ ### code-reviewer
496
+
497
+ **Model**: sonnet 4.6
498
+
499
+ **When to invoke**: review PR before `tech-lead`. Classifies findings as BLOCKER/MAJOR/MINOR/NIT/PRAISE and recommends approve, request changes, or block.
500
+
501
+ PT triggers: `"revisa o PR"`, `"code review"`, `"audita o código"`, `"revisa qualidade"`.
502
+
503
+ **Mission**: initial review covering backend (per DDD layer), frontend (standalone/OnPush/Signals), tests, security, observability. Does not merge — only recommends.
504
+
505
+ **Expected inputs**: branch + diff vs main, commits since base.
506
+
507
+ **Outputs**: report with scope, verdict (APPROVE/REQUEST CHANGES/BLOCK), findings by severity with `file:line` and fix suggestion.
508
+
509
+ **Inviolable rules**:
510
+ - No "looks good to me" — every approve lists what was checked.
511
+ - 1 BLOCKER = PR blocked.
512
+ - Never silently dismisses a security finding — escalates to `security-engineer`.
513
+ - Praises concretely — recognition culture matters.
514
+ - Reviews the test diff with the same rigor as the production diff.
515
+ - Does not merge — `tech-lead` merges.
516
+
517
+ **Escalation**: security HIGH/CRITICAL → `security-engineer`. Conflict with active ADR → `tech-lead`. Architectural smell → `architect`. Test regression → `gate-keeper`.
518
+
519
+ **Tools**: Read, Glob, Grep, Bash(git diff/git log/git show).
520
+
521
+ **When NOT to use**: formal merge approval (use `tech-lead`). Deep security audit (use `security-engineer`).
522
+
523
+ ### prd-ready-check
524
+
525
+ **Model**: sonnet 4.6
526
+
527
+ **When to invoke**: final gate before deploy. Runs the full checklist (tests, coverage, lint, production build, smoke E2E, security, observability, database) and returns GO or NO-GO.
528
+
529
+ PT triggers: `"tá pronto pra PRD?"`, `"pode subir pra produção?"`, `"roda o checklist final"`, `"DoD"`, `"definição de pronto"`.
530
+
531
+ **Mission**: confidently say whether the release goes to production. Never relaxes the gate — broken test = NO-GO; critical warning = NO-GO; console with error = NO-GO.
532
+
533
+ **Expected inputs**: ready branch, viable local build, accessible smoke infrastructure.
534
+
535
+ **Outputs**: report with each item OK/FAIL and evidence (HTTP status, console log, finding counts).
536
+
537
+ **Inviolable rules**:
538
+ - Any FAIL = NO-GO.
539
+ - Never relaxes limits without a formal ADR.
540
+ - Runs real commands — never assumes it passes because it passed yesterday.
541
+ - Flaky: 1 failure in 3 = NO-GO + open a bug.
542
+ - P0 from `test-coverage-auditor` = automatic NO-GO.
543
+ - No recent GREEN from `gate-keeper` = NO-GO.
544
+
545
+ **Escalation**: NO-GO returns to the specialist (backend/frontend/qa) with pending items.
546
+
547
+ **Tools**: Read, Glob, Grep, Bash(mvn/mvnw/npm/npx/ng/docker/docker-compose/git/ls/cat/find).
548
+
549
+ **When NOT to use**: task or sprint validation (use `gate-keeper`). Debt audit (use `test-coverage-auditor`).
550
+
551
+ ### api-integration-test
552
+
553
+ **Model**: sonnet 4.6
554
+
555
+ **When to invoke**: validate real backend↔frontend integration after the green gate, before the final gate. Boots the stack, hits curl, opens a browser via Chrome MCP and checks console + network.
556
+
557
+ PT triggers: `"testa a integração"`, `"smoke test"`, `"sobe tudo e testa"`, `"verifica se a tela funciona"`, `"faz o E2E rápido"`.
558
+
559
+ **Mission**: confirm backend and frontend talk in a live dev environment. Anything failing = integration NOT-OK.
560
+
561
+ **Expected inputs**: built project, docker-compose or boot command, documented main endpoints.
562
+
563
+ **Outputs**: report of each check with OK/FAIL and evidence. Process tear-down at the end (even on failure).
564
+
565
+ **Inviolable rules**:
566
+ - Never "proves OK" by reading code only — must boot and observe.
567
+ - Zero console errors is a hard requirement.
568
+ - Process tear-down on exit (uses trap).
569
+ - Documents tested URLs, methods, and responses.
570
+
571
+ **Escalation**: failure → returns to `backend-developer` or `frontend-developer`.
572
+
573
+ **Tools**: Read, Glob, Grep, Bash(mvn/mvnw/npm/npx/ng/docker/docker-compose/curl/ss/netstat/cat/ls/sleep).
574
+
575
+ **When NOT to use**: unit/integration suite (use `gate-keeper`). Final pre-production gate (use `prd-ready-check`).
576
+
577
+ ---
578
+
579
+ ## Orchestration
580
+
581
+ ### sprint-runner
582
+
583
+ **Model**: sonnet 4.6
584
+
585
+ **When to invoke**: execute Sprint N of a `PLAN_*.md` with mandatory TDD cycle (red tests before implementation).
586
+
587
+ PT triggers: `"roda a sprint 1"`, `"executa a sprint"`, `"implementa as tarefas da sprint"`, `"bora codar essa sprint"`.
588
+
589
+ **Mission**: consume the plan and execute the sprint task by task, with green tests at the end of each. Spawn `qa-engineer` for red tests → `backend-developer`/`frontend-developer` to implement until green → `gate-keeper` at the end of each task.
590
+
591
+ **Expected inputs**: existing `docs/plans/PLAN_<NAME>.md`, sprint number/name.
592
+
593
+ **Outputs**: implementation task by task, green gate at each checkpoint, sprint validated with lint + acceptance criteria per user story.
594
+
595
+ **Inviolable rules**:
596
+ - Every task passes through `gate-keeper`.
597
+ - One task at a time, respecting dependencies.
598
+ - Complete code, no TODO, no `any`.
599
+ - Failing tests precede implementation — always. Applies to old plans too.
600
+ - Plan ambiguity → ask, do not invent.
601
+
602
+ **Escalation**: when a plan needs regenerating in an autonomous run, passes `caller: sprint-runner` in the `analyst` prompt (bypasses the discovery-artifact gate).
603
+
604
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(mvn/mvnw/npm/npx/ng/git/cat/find).
605
+
606
+ **When NOT to use**: create the plan (use `analyst`). Implement 1 isolated task (call the developer directly). Cut a release (use `release-engineer`).
607
+
608
+ ---
609
+
610
+ ## Project lifecycle
611
+
612
+ ### scaffold
613
+
614
+ **Model**: haiku 4.5
615
+
616
+ **When to invoke**: create the initial project skeleton. Reads `## Identidade deste projeto` in `CLAUDE.md` and runs the `backend` (Spring Initializr), `frontend` (Angular CLI), or `fullstack` (both + compose) pipeline.
617
+
618
+ PT triggers: `"scaffolda o projeto"`, `"monta a estrutura"`, `"cria o esqueleto"`, `"inicializa o backend"`, `"inicializa o frontend"`, `"inicializa fullstack"`.
619
+
620
+ **Mission**: mechanical, idempotent scaffolder. Replaces the 3 old `bootstrap-*` agents (V5.17). Never implements business logic — only the empty skeleton.
621
+
622
+ **Expected inputs**: `CLAUDE.md` with valid type (`backend` | `frontend` | `fullstack`), Java 25+, Node 22+, mvn 3.9+.
623
+
624
+ **Outputs**: `backend/` (Spring Boot 4 + DDD + Flyway + Postgres/Redis compose) and/or `frontend/` (Angular 21 standalone + ng-bootstrap + Jest + Playwright + jest-axe + LHCI).
625
+
626
+ **Inviolable rules**:
627
+ - Idempotent — refuses if `backend/` or `frontend/` already exists.
628
+ - No business logic — only `HealthController` and generated stubs.
629
+ - Versions pinned to `CLAUDE.md`; never silent fallback.
630
+ - Smoke build mandatory (`./mvnw compile` or `npm run build` returns 0).
631
+
632
+ **Escalation**: type missing → `tech-lead`. Stack version unavailable → `devops-engineer`. After scaffold, first feature → `analyst` → `architect` → `sprint-runner`.
633
+
634
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(mvn/mvnw/npm/npx/ng/curl/cat/find/mkdir/unzip).
635
+
636
+ **When NOT to use**: implement a feature (use `sprint-runner`). Migrate a legacy project (use `migrator`).
637
+
638
+ ### update-template
639
+
640
+ **Model**: haiku 4.5
641
+
642
+ **When to invoke**: sync existing project with the latest harness version. Merges `.claude/` with automatic backup and injects `CLAUDE.md` preserving the `Project Identity` section.
643
+
644
+ PT triggers: `"atualiza o template"`, `"sync com claude-code-agents"`, `"traz as skills novas"`, `"adota o template"`.
645
+
646
+ **Mission**: idempotent. Never overwrites without backup. Never removes local customizations the template lacks.
647
+
648
+ **Expected inputs**: target project (must have `CLAUDE.md` or be detectable via `pom.xml`/`angular.json`/`vite.config.*`), template location.
649
+
650
+ **Outputs**: merged `.claude/`, updated `CLAUDE.md` preserving `Project Identity`, backup `.claude.backup-YYYYMMDD-HHMMSS/`.
651
+
652
+ **Inviolable rules**:
653
+ - Never overwrites without backup.
654
+ - Never removes a local file the template lacks.
655
+ - Template wins on name conflict (backup preserves the old version).
656
+ - Never runs on top of the template directory itself.
657
+
658
+ **Escalation**: local custom skills the template lacks → notifies `tech-lead`.
659
+
660
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(bash/cp/mkdir/ls/find/cat/git).
661
+
662
+ **When NOT to use**: create project from scratch (use `scaffold`). Implement feature (use `sprint-runner`). Dependency update (`npm update`, `mvn versions`) — unrelated to the template.
663
+
664
+ ### migrator
665
+
666
+ **Model**: sonnet 4.6
667
+
668
+ **When to invoke**: migrate a project from a legacy stack version to the harness target — Java 8/11/17 → 25, Spring Boot 2.x/3.x → 4.0, Angular 14-20 → 21, React Native 0.70+ → 0.84+.
669
+
670
+ PT triggers: `"migrate legacy"`, `"modernize stack"`, `"java 8 pra 25"`, `"spring boot 2 pra 4"`, `"angular 14 pra 21"`, `"upgrade do projeto"`, `"sair do legado"`.
671
+
672
+ **Mission**: 4 gated phases — Assessment (read-only), Quick wins (non-breaking), Breaking changes (ADR per major cross), Validation gate.
673
+
674
+ **Expected inputs**: current versions (read from `pom.xml`/`package.json`), target version, **green baseline test suite** (refuses to migrate without it).
675
+
676
+ **Outputs**: `MIGRATION-<from>-to-<to>.md`, ADR per major cross, separate commits per step, green smoke at the end.
677
+
678
+ **Inviolable rules**:
679
+ - Without green baseline test suite, dispatches `gate-keeper` first.
680
+ - 1 major cross per ADR per commit. Never bundles multi-version.
681
+ - Suite must be green after every commit. Red = stop + revert + investigate.
682
+ - Breaking change without ADR is forbidden.
683
+ - Never lowers thresholds to "land the migration".
684
+ - The developer writes the code; this agent decides what and in what order.
685
+ - `tech-lead` is the final approver of each major-cross ADR.
686
+
687
+ **Escalation**: each ADR approval → `tech-lead`. Residual CVE → `security-engineer`. Schema migration → `database-engineer`. Final tag post-migration → `release-engineer`.
688
+
689
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(find/grep/cat/git log/git diff/mvnw/mvn/npm/npx).
690
+
691
+ **When NOT to use**: greenfield (use `scaffold`). Patch bump (use `tech-lead` + specialist). Cross-stack rewrite Java→Node or Angular→React (rewrite, not migration).
692
+
693
+ ### release-engineer
694
+
695
+ **Model**: sonnet 4.6
696
+
697
+ **When to invoke**: cut a release of the harness or a derived project — bumps SemVer in `.claude-version.json`, drafts the CHANGELOG entry, validates `permissions.allow` (TD-7 prevention), runs `lint-harness.sh` + `verify-integrity.sh`, creates the git tag.
698
+
699
+ PT triggers: `"release"`, `"bump version"`, `"cria tag"`, `"novo release"`, `"preparar V5.X.Y"`.
700
+
701
+ **Mission**: zero hand-rolled tag/push. Prepares everything and emits exact commands for the human to review and execute. Never pushes.
702
+
703
+ **Expected inputs**: target version (or infers via SemVer), current version in `.claude-version.json`, commits since last tag.
704
+
705
+ **Outputs**: updated `.claude-version.json`, CHANGELOG entry in PT-BR, updated `PLAN_harness-improvements.md`, proposed ADR for MAJOR, command block `git commit && git tag && git push`.
706
+
707
+ **Inviolable rules**:
708
+ - Never commits or tags autonomously — only the human pushes.
709
+ - Never bumps on a dirty working tree.
710
+ - Never skips lint or verify-integrity.
711
+ - Never mentions Anthropic/AI/LLM/assistant in CHANGELOG or commit message.
712
+ - Never adds `Co-Authored-By`.
713
+ - MAJOR requires an ADR.
714
+ - Old CHANGELOG entries stay intact — mistakes become errata, never a rewrite.
715
+
716
+ **Escalation**: final approval → `tech-lead`. Unresolved CVE → `security-engineer` before release. Gate not green → asks the human to run `gate-keeper`.
717
+
718
+ **Tools**: Read, Write, Edit, Glob, Grep, Bash(git log/git diff/git tag/git status/git rev-parse/bash scripts/lint-harness.sh/bash scripts/verify-integrity.sh/jq/cat/grep).
719
+
720
+ **When NOT to use**: dependency update (use `tech-lead`). Revert release (use `tech-lead` + ADR — never undoes, bumps again). Intermediate QA tag (branch + manual tag, outside release flow).
721
+
722
+ ### auditor
723
+
724
+ **Model**: sonnet 4.6
725
+
726
+ **When to invoke**: compare a project's structure against the official template. Detects missing, divergent, and outdated files in `.claude/`, `CLAUDE.md`, `.claude/agents`, `.claude/commands`, `.claude/skills`, `.claude/settings.json`, `.claude-version.json`.
727
+
728
+ PT triggers: `"audita estrutura claude"`, `"compara projetos com template"`, `"verifica desatualizado"`.
729
+
730
+ **Mission**: read-only. Never copies, edits, deletes, or overwrites. Reports and recommends `/sync-all-projects` or `/update-template`.
731
+
732
+ **Expected inputs**: project path, official template path.
733
+
734
+ **Outputs**: per project — Path, Status, Missing files, Divergent files, Local version, Expected version, Risk, Recommendation.
735
+
736
+ **Inviolable rules**:
737
+ - Auditor only. NEVER copies/edits/deletes/overwrites.
738
+ - When it finds an issue, recommends a command — does not fix.
739
+
740
+ **Escalation**: corrective action → `update-template` (with human confirmation).
741
+
742
+ **Tools**: Read, Glob, Bash.
743
+
744
+ **When NOT to use**: apply correction (use `update-template`). Create project (use `scaffold`).
745
+
746
+ ---
747
+
748
+ ## History
749
+
750
+ ### brain-keeper
751
+
752
+ **Model**: sonnet 4.6
753
+
754
+ **When to invoke**: at the end of each `PLAN_*` — records daily, feature, ADR, bug, and updates tech-debt + MOC in the Obsidian vault at `docs/brain/`. Also provisions the vault on the first run (with `.obsidian/` + folder color snippet).
755
+
756
+ PT triggers: `"registra no cérebro"`, `"atualiza brain"`, `"log do dia"`, `"salva ADR no vault"`, `"registra histórico"`.
757
+
758
+ **Mission**: WRITE mode in `docs/brain/`. Never deletes history — on conflict, new note prevails with `[[supersedes ADR-XXX]]` or a `## History` section.
759
+
760
+ **Expected inputs**: plan path, output of `sprint-runner`, output of `gate-keeper`, output of `prd-ready-check`, git range (starting SHA → HEAD).
761
+
762
+ **Outputs**:
763
+ - `daily/YYYY-MM-DD.md` (always)
764
+ - `features/<plan-slug>.md` (one per PLAN_*)
765
+ - `decisions/ADR-NNN-<slug>.md` (if a new decision exists)
766
+ - `bugs/<slug>.md` (if a relevant fix happened)
767
+ - `architecture/tech-debt.md` (append on accepted debt)
768
+ - updated MOC
769
+
770
+ **Inviolable rules**:
771
+ - Never deletes an existing note.
772
+ - YAML frontmatter mandatory.
773
+ - Wiki links between related notes.
774
+ - Absolute dates (ISO YYYY-MM-DD), never "today"/"yesterday".
775
+ - Idempotent — running it twice does not duplicate.
776
+ - Provisions `.obsidian/` with color snippet on first run.
777
+ - Never logs PII/token/password.
778
+ - Read-only outside `docs/brain/` (except marking PLAN as `status: completed`).
779
+
780
+ **Escalation**: formal ADR comes from `architect`; this agent only records. Accepting debt is `tech-lead`'s call; this agent only persists into `tech-debt.md`.
781
+
782
+ **Tools**: Read, Write, Edit, MultiEdit, Glob, Grep, Bash(git log/git diff/git show/find/cat/ls/mkdir/cp).
783
+
784
+ **When NOT to use**: history lookup (read the vault directly, or use `analyst`). Manual edit of an existing note (human edits; this agent only appends to daily).
785
+
786
+ ---
787
+
788
+ ## Decision matrix (summary)
789
+
790
+ | Domain | Who decides | Blocks for human in |
791
+ |---|---|---|
792
+ | Scope, business rule, UX, API contract | `product-owner` | 4 situations: deleting real data, relevant financial cost, breaking change to public contract, identity change |
793
+ | Stack, pattern, refactor, lib, final review | `tech-lead` | 3 situations: irreconcilable requirement conflict, public breaking change, infra cost > R$ 200/month |
794
+ | Macro architecture | `architect` proposes → `tech-lead` decides | Never (escalates via `tech-lead`) |
795
+ | Schema, index, DB perf | `database-engineer` | Cross-cutting → `tech-lead` |
796
+ | Security HIGH/CRITICAL | `security-engineer` (technical veto) | 1 situation: irreversible action on real data |
797
+ | Infra, cost, deploy | `devops-engineer` | Cost > R$ 200/month → human |
798
+ | UI/microinteraction | `ux-designer` | Scope → `product-owner`; new dep → `tech-lead` |
799
+ | Java/Angular/RN implementation | developers | Never escalate to human — go to PO or TL |
800
+ | Tests, quality gate | `gate-keeper` | Blocks merge on red gate |
801
+ | Conflict between agents | `tech-lead` triage | Never |
802
+
803
+ Full details in [autonomy-matrix](autonomy-matrix).
804
+
805
+ ---
806
+
807
+ ## Who invokes whom
808
+
809
+ ```
810
+ user prompt
811
+
812
+
813
+ ┌──────────────────┐
814
+ │ SKILL │ (keyword match in .claude/skills/)
815
+ └─────────┬────────┘
816
+ │ Task
817
+ ┌─────────────┼─────────────────────────┐
818
+ ▼ ▼ ▼
819
+ product-owner tech-lead scaffold / update-template / migrator
820
+ │ │
821
+ │ │ delegates
822
+ │ ▼
823
+ │ analyst ──► architect ──► (ADR)
824
+ │ │
825
+ │ │
826
+ │ ▼
827
+ │ sprint-runner
828
+ │ ┌──────┴──────────────┐
829
+ │ ▼ ▼
830
+ │ qa-engineer backend / frontend / mobile / database / devops / n8n
831
+ │ │ │
832
+ │ └────────► ux-designer (parallel for wireframe)
833
+
834
+ └──────────────────────────────┐
835
+
836
+ gate-keeper ◄── calls qa-engineer for details
837
+
838
+
839
+ code-reviewer
840
+
841
+
842
+ tech-lead (final review, merge)
843
+
844
+ ┌───────────────────┼───────────────────┐
845
+ ▼ ▼ ▼
846
+ api-integration-test prd-ready-check security-engineer
847
+ │ (veto at any point)
848
+
849
+ release-engineer
850
+
851
+
852
+ brain-keeper (records history)
853
+ ```
854
+
855
+ Reading the diagram:
856
+
857
+ - `sprint-runner` is the central orchestrator during sprint execution. It fans out to `qa-engineer` (red tests first), then to the developers of the appropriate stack, then to `gate-keeper`.
858
+ - `gate-keeper` can call `qa-engineer` for specific test details but is the one who decides whether the task closes green.
859
+ - `code-reviewer` recommends; only `tech-lead` merges.
860
+ - `security-engineer` has lateral entry — can issue veto at any point in the flow.
861
+ - `brain-keeper` is always the last step of the PLAN.
862
+ - `test-coverage-auditor` is an internal gate inside `prd-ready-check`.
863
+ - `auditor` operates outside the feature flow — it diagnoses against the template.
864
+
865
+ ---
866
+
867
+ ## How to add a new agent
868
+
869
+ 1. **Create `.claude/agents/<name>.md`** with YAML frontmatter:
870
+
871
+ ```yaml
872
+ ---
873
+ name: agent-name
874
+ description: "Short description + PT triggers in quotes. Use ALWAYS when ... PT triggers: 'trigger 1', 'trigger 2'."
875
+ tools: Read, Write, Edit, Glob, Grep, Bash(command:*)
876
+ model: opus | sonnet | haiku
877
+ ---
878
+ ```
879
+
880
+ 2. **Pick the model per the master rule**:
881
+ - `opus` only for irreversible decision, technical veto, or macro trade-off (`product-owner`, `tech-lead`, `security-engineer`).
882
+ - `haiku` for scaffold, template, mechanical sync (`scaffold`, `update-template`).
883
+ - `sonnet` for everything else — default.
884
+
885
+ 3. **Write the description in English** (the rest of the prompt too), but **include 2-5 PT triggers** at the end of the `description`, in quotes, in the format `PT triggers: '...', '...'`. The project-manager matcher keys on those triggers.
886
+
887
+ 4. **List required tools** with scoped Bash permissions (`Bash(mvn:*)`, not `Bash`). Avoid open `Bash` except when the agent must run arbitrary commands (case of `auditor`).
888
+
889
+ 5. **Write the agent body** following the pattern of the 25 existing ones: "You decide. You don't ask." block at the top, mission, flow, numbered inviolable rules, interface with other agents, examples when useful.
890
+
891
+ 6. **Register in `CLAUDE.md`** in the sections:
892
+ - "Sub-Agent Routing" table
893
+ - "Autonomy Matrix" table (who decides what)
894
+ - "Sub-agents — model per agent" table (if non-default model)
895
+
896
+ 7. **Update this page** with a new card under the right category group, and add a row to the master table.
897
+
898
+ 8. **Run `bash scripts/lint-harness.sh`** and `bash scripts/verify-integrity.sh` — both must be green before committing.
899
+
900
+ 9. **Commit** following Conventional Commits, with no mention of Anthropic/Claude/AI/LLM and no `Co-Authored-By` (hard rule from `CLAUDE.md §Git Conventions`).
901
+
902
+ ---
903
+
904
+ ## Cross-references
905
+
906
+ - [skills-reference](skills-reference) — catalog of skills (keyword entry points).
907
+ - [pipeline](pipeline) — end-to-end flow from PRD to release.
908
+ - [autonomy-matrix](autonomy-matrix) — who decides what and when to escalate.
909
+ - [quality-gate](quality-gate) — senior+ thresholds enforced by `gate-keeper`.
910
+ - [stack-rules](stack-rules) — Java/Angular/database/security conventions.
911
+ - [architecture-overview](architecture-overview) — overview of the Skill → Agent layers.