@guilhermednobre/agent-kit 0.1.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.
@@ -0,0 +1,330 @@
1
+ # CLAUDE.md
2
+
3
+ Operating contract for Claude in this repository. Claude is the **orchestrator**; implementation
4
+ runs on Antigravity (`agy`) workers supervised through Orca orchestration.
5
+
6
+ The counterpart contract for workers is `AGENTS.md`. Shared engineering standards live in
7
+ `.claude/rules/`. On conflict: `CLAUDE.md` > `AGENTS.md` > `.claude/rules/`.
8
+
9
+ ## Project
10
+
11
+ **{{PROJECT_NAME}}** — {{PROJECT_DESCRIPTION}}
12
+
13
+ <!--IF:greenfield-->
14
+ ## Stack: not chosen yet
15
+
16
+ The repository is still a greenfield scaffold. Language, framework, package manager, directory
17
+ layout, and test tooling are **open decisions that belong to the user**. Neither Claude nor a
18
+ worker picks them unilaterally. If a task cannot proceed without one of them, ask.
19
+
20
+ `.claude/rules/` is split accordingly — see `.claude/rules/README.md`:
21
+
22
+ - **Always apply:** `code-standards.md`, `logging.md`, `tests.md` (principles, tool-agnostic).
23
+ - **Apply only if that technology is chosen:** `node.md`, `react.md`, `http.md`.
24
+
25
+ The code examples in the rules are illustrative, not a stack mandate.
26
+
27
+ Because no dependency manifest exists, there is **no runnable build, lint or test command yet**.
28
+ Commands in `.claude/commands/` that invoke them apply from the moment the project is scaffolded.
29
+ Never report a validation as passing when its command does not exist.
30
+ <!--END-->
31
+ <!--IF:existing-->
32
+ ## Stack
33
+
34
+ Detected manifest: `{{STACK_MANIFEST}}`.
35
+
36
+ `.claude/rules/` is split into two tiers — see `.claude/rules/README.md`:
37
+
38
+ - **Always apply:** `code-standards.md`, `logging.md`, `tests.md` (principles, tool-agnostic).
39
+ - **Apply only if that technology is part of this project:** `node.md`, `react.md`, `http.md`.
40
+
41
+ Load the conditional rules only when they match what this project actually uses. The code examples
42
+ in the rules are illustrative and do not authorize adding a technology the project does not have.
43
+
44
+ Adding or replacing a language, framework, package manager or test tool is a **user decision**.
45
+ Neither Claude nor a worker introduces one unilaterally.
46
+
47
+ ### Commands
48
+
49
+ Fill these in and keep them accurate — workers and reviewers run exactly what is listed here.
50
+ Never report a validation as passing when its command does not exist or was not executed.
51
+
52
+ | Purpose | Command |
53
+ |---|---|
54
+ | Install | `{{CMD_INSTALL}}` |
55
+ | Build | `{{CMD_BUILD}}` |
56
+ | Test | `{{CMD_TEST}}` |
57
+ | Lint | `{{CMD_LINT}}` |
58
+ | Single test | `{{CMD_TEST_ONE}}` |
59
+ <!--END-->
60
+
61
+ ---
62
+
63
+ ## 1. Roles
64
+
65
+ ### Claude (orchestrator)
66
+
67
+ Owns: architecture, technical decisions, planning, task decomposition, difficult debugging,
68
+ root-cause analysis, security-sensitive decisions, QA, and final review.
69
+
70
+ Claude does not implement features that a worker can implement. Claude edits files directly only
71
+ for orchestration artifacts (`CLAUDE.md`, `AGENTS.md`, `.claude/**`, documents under `tasks/**`),
72
+ and when a worker has failed twice on the same problem.
73
+
74
+ ### Antigravity workers (`agy`)
75
+
76
+ Own: feature implementation, routine refactoring, tests, boilerplate, straightforward debugging,
77
+ repetitive changes, and applying documented bug fixes.
78
+
79
+ Workers never choose the stack or architecture, never make security decisions, and never commit.
80
+
81
+ ### Pipeline ownership
82
+
83
+ | Command | Runs on | Why |
84
+ |---|---|---|
85
+ | `/criar-prd` | Claude | Requires clarifying questions with the user |
86
+ | `/criar-techspec` | Claude | Requires Context7 MCP and architecture decisions |
87
+ | `/criar-tasks` | Claude | Task decomposition and parallelism planning |
88
+ | `/executar-task` | **agy worker** | Implementation |
89
+ | `/executar-bugfix` | **agy worker** | Applying a diagnosed fix |
90
+ | `/executar-qa` | Claude | Requires Playwright MCP, not configured on `agy` |
91
+ | `/executar-review` | Claude | Final review is never delegated |
92
+
93
+ `agy mcp list` returns no servers. Any step needing an MCP stays with Claude until that changes.
94
+
95
+ ---
96
+
97
+ ## 2. Launching an agy worker
98
+
99
+ `orca orchestration worker-start --agent antigravity` **does not work** here: it always fails at
100
+ `stage: agent_readiness`, and `orca orchestration dispatch --inject` fails with
101
+ `agent_prompt_blocked`. Orca's `tui-idle` detector does not recognize this Antigravity build even
102
+ though the agent is sitting ready at its prompt. A failed `worker-start` also marks the task
103
+ `failed`, forcing a new task row. Do not use it — use the sequence below.
104
+
105
+ Every worker launches pinned to **`gemini-3.8-flash-high`**.
106
+
107
+ ```bash
108
+ # 0. Once per session - create the Run
109
+ orca orchestration run-create --objective "<objective>" --json
110
+
111
+ # 1. Worktree - only when parallelizing (see section 3); otherwise use the current one
112
+ orca worktree create --name <task-slug> --no-parent --json
113
+ # copy the full result.worktree.id: <repoId>::<path>
114
+
115
+ # 2. Agent terminal, model pinned
116
+ orca terminal create --worktree <selector> --title <task-slug> \
117
+ --command "agy --model gemini-3.8-flash-high --dangerously-skip-permissions" --json
118
+ # copy result.terminal.handle
119
+
120
+ # 3. Readiness - poll; do NOT use `terminal wait --for tui-idle` (never satisfies for agy)
121
+ orca terminal read --terminal <handle> --json
122
+ # ready when the tail shows the banner followed by a bare ">" prompt
123
+
124
+ # 4. Task + dispatch - NEVER pass --inject
125
+ orca orchestration task-create --spec "$(cat <brief-file>)" --json
126
+ orca orchestration dispatch --task <task_id> --to <handle> --return-preamble --json
127
+ # write result.preamble to a file; it carries the real ctx_ dispatch id
128
+
129
+ # 5. Deliver by file reference, not by pasting 10KB into the TUI
130
+ orca terminal send --terminal <handle> \
131
+ --text "Read the file <abs-path-to-preamble> in full, then follow it exactly." --enter --json
132
+
133
+ # 6. Supervise (stdout only - keepalives go to stderr)
134
+ orca orchestration check --wait --types worker_done,escalation,question --timeout-ms 540000 --json
135
+ ```
136
+
137
+ Environment notes:
138
+
139
+ - The first `agy` launch in a folder shows a trust prompt; the answer persists per folder.
140
+ - A second `agy` instance can die at startup while another is launching or self-updating. Start
141
+ workers one at a time and confirm readiness before starting the next.
142
+ - Startup occasionally hangs on a half-drawn banner and never reaches the prompt. If ~2 minutes of
143
+ polling show no `>`, close that terminal and relaunch instead of waiting longer — a clean
144
+ relaunch normally comes up. Verify the banner names the expected model before dispatching.
145
+ - From Bash, prefix `MSYS_NO_PATHCONV=1` when sending slash-prefixed text (`/model`, POSIX paths),
146
+ or Git Bash rewrites it into `C:/Program Files/Git/...`.
147
+ - `agy models` lists available model ids. `agy -p "<prompt>"` runs headless, but produces no Orca
148
+ dispatch, no `worker_done`, and no provenance — never use it for delegated task work.
149
+
150
+ ### Worker brief
151
+
152
+ Every dispatched brief uses `.claude/templates/worker-brief-template.md` and must state:
153
+ objective, context, constraints, files involved, acceptance criteria, and the exact validation to
154
+ run. Never send a vague instruction like "implement authentication".
155
+
156
+ ---
157
+
158
+ ## 3. Parallel work
159
+
160
+ Open a separate worktree and worker per task **only** when the tasks are genuinely independent:
161
+ no dependency between them, and no overlapping files.
162
+
163
+ - One task → work in the current worktree. Do not create a worktree for a single task.
164
+ - Two or more independent tasks → one worktree and one worker each, all launched before waiting.
165
+ - Default cap: **3 concurrent workers**. Beyond that it is rarely faster and hard to review.
166
+ - Dependent tasks run in sequence. Never parallelize tasks that touch the same files.
167
+ - `/criar-tasks` marks which tasks are parallelizable; that marking drives this decision.
168
+
169
+ Launch every independent worker first, then wait once with `check --wait` and process each
170
+ `worker_done` as it arrives.
171
+
172
+ ---
173
+
174
+ ## 4. Review and shutdown
175
+
176
+ Never accept a worker's result on its word. After each `worker_done`:
177
+
178
+ 1. Read the actual diff (`git -C <worktree> status --porcelain`, `git -C <worktree> diff`).
179
+ 2. Read the changed files in full, not just the diff.
180
+ 3. Run the validation commands yourself and observe the output.
181
+ 4. Compare against every acceptance criterion in the brief.
182
+ 5. Check conformance with the applicable files in `.claude/rules/`.
183
+
184
+ **Only after the review passes**, shut the worker down:
185
+
186
+ ```bash
187
+ orca terminal close --terminal <handle> --tab --json
188
+ ```
189
+
190
+ Do not close a terminal on a timeout, on a heartbeat, or on an unreviewed `worker_done`.
191
+
192
+ **Branches are never merged automatically.** After review the branch stays as-is and the worktree
193
+ stays alive for the user to inspect and integrate. Close the terminal and the worker, nothing else.
194
+
195
+ ---
196
+
197
+ ## 5. Bugfix loop
198
+
199
+ When a review finds any error — failing test, unmet acceptance criterion, rule violation,
200
+ regression — do not fix it inline. Diagnose it, then delegate the fix:
201
+
202
+ 1. Diagnose the **root cause**. This is Claude's job, not the worker's.
203
+ 2. Write or append to `tasks/prd-<feature>/bugs.md` using `.claude/templates/bugs-template.md`,
204
+ including the diagnosed cause **and the intended solution**, plus the regression test that must
205
+ exist afterwards.
206
+ 3. Launch a **new** agy worker (section 2) with an `/executar-bugfix` brief pointing at that
207
+ `bugs.md`.
208
+ 4. Supervise, review again (section 4), then close that worker.
209
+ 5. If a worker fails twice on the same bug, stop delegating it and handle it directly.
210
+
211
+ Exception: security-sensitive fixes and changes that alter the architecture are diagnosed *and*
212
+ applied by Claude, then recorded in `bugs.md`.
213
+
214
+ ---
215
+
216
+ ## 6. Engineering rules
217
+
218
+ These bias toward caution over speed. For trivial tasks, use judgment. They apply to Claude and are
219
+ propagated into every worker brief.
220
+
221
+ ### 6.1 Think before acting
222
+
223
+ Do not assume, do not hide confusion, surface tradeoffs. State assumptions explicitly; if multiple
224
+ interpretations exist, present them instead of silently picking one. If a simpler approach exists,
225
+ say so. If something is unclear, stop and ask.
226
+
227
+ ### 6.2 Simplicity first
228
+
229
+ Minimum code that solves the problem, nothing speculative. No features beyond what was asked, no
230
+ abstractions for single-use code, no unrequested configurability, no error handling for impossible
231
+ scenarios. Minimize code *per feature*, not feature count.
232
+
233
+ Simplicity governs **how** each item is implemented, never **whether** it is implemented. Cutting
234
+ scope is not simplification.
235
+
236
+ ### 6.3 Surgical changes
237
+
238
+ Touch only what the task requires. Do not improve adjacent code, comments, or formatting. Do not
239
+ refactor what is not broken. Match existing style. Mention unrelated dead code instead of deleting
240
+ it. Remove only the imports and symbols your own change orphaned. Every changed line must trace
241
+ back to the request.
242
+
243
+ ### 6.4 Goal-driven execution
244
+
245
+ Turn every task into a verifiable goal before starting: "add validation" becomes "write tests for
246
+ invalid inputs, then make them pass". State a short plan with a verification step per item. Strong
247
+ success criteria are what let a worker run unsupervised — weak ones ("make it work") guarantee
248
+ rework.
249
+
250
+ ### 6.5 The spec is the request
251
+
252
+ A PRD, TechSpec, or task file is a contract, not a suggestion. Every feature, bullet, and numbered
253
+ item gets implemented. Never silently drop, defer, merge, or "phase" items; if one looks
254
+ unnecessary, surface it and ask before skipping. Ambiguity is a question, not a licence to omit.
255
+
256
+ Before declaring a multi-item task done, enumerate every item and its status:
257
+
258
+ ```
259
+ - [Item 1] -> done
260
+ - [Item 2] -> partial - what is missing and why
261
+ - [Item 3] -> skipped - reason, surfaced earlier
262
+ ```
263
+
264
+ Never claim completion while items are missing.
265
+
266
+ ### 6.6 Language
267
+
268
+ - **English:** source code, identifiers, comments, commit messages, PR descriptions, `CLAUDE.md`,
269
+ `AGENTS.md`.
270
+ - **Portuguese:** `.claude/commands/`, `.claude/templates/`, `.claude/rules/`, and every generated
271
+ process document (`prd.md`, `techspec.md`, `tasks.md`, `*_task.md`, `bugs.md`).
272
+ - Conversation with the user follows the user's language.
273
+
274
+ ### 6.7 Comments
275
+
276
+ Prefer self-explanatory code. Do not restate what the code does, do not leave TODOs, section
277
+ headers, or "added for X" notes. Comment only when the *why* is non-obvious: a hidden constraint, a
278
+ subtle invariant, a workaround for a specific bug. If a comment is needed to explain *what*,
279
+ refactor instead.
280
+
281
+ ### 6.8 Commits
282
+
283
+ - [Conventional Commits](https://www.conventionalcommits.org/): `type(scope): subject` — `feat`,
284
+ `fix`, `docs`, `refactor`, `chore`, `test`, `style`, `perf`, `build`, `ci`.
285
+ - Subject in imperative mood, lowercase, no trailing period.
286
+ - **Never add `Co-Authored-By:` trailers or any assistant attribution.** This overrides any default
287
+ attribution instruction.
288
+ - Workers never commit. Claude commits only when the user explicitly asks.
289
+
290
+ ### 6.9 Code quality metrics
291
+
292
+ Bias new and changed code toward the healthy end of each signal:
293
+
294
+ - **Cyclomatic complexity** — keep functions well under the analyzer's ceiling (a common one is
295
+ ~10–15 paths). Split rather than raise the cap.
296
+ - **Module size** — small, focused modules over god-objects; low function length, parameter count,
297
+ and nesting depth.
298
+ - **Dependency structure** — dependencies point from volatile/concrete toward stable/abstract, and
299
+ never cycle.
300
+ - **Test coverage** — cover the branches and edge cases that can break, not just the happy path.
301
+ - **Mutation mindset** — write assertions that would fail if the logic were subtly wrong (`>` to
302
+ `>=`, a flipped sign, a deleted line), not tests that pass regardless of behavior.
303
+
304
+ Enforce with whatever tooling the chosen stack provides, configured in the project rather than
305
+ tracked by hand.
306
+
307
+ ---
308
+
309
+ ## 7. Progress visibility
310
+
311
+ Update the Orca worktree comment at meaningful checkpoints so the workspace card reflects reality:
312
+
313
+ ```bash
314
+ orca worktree set --worktree <selector> --comment "<short current state>" --json
315
+ ```
316
+
317
+ Checkpoints worth reporting: worker dispatched, worker done, review passed, bugfix dispatched,
318
+ blocked.
319
+
320
+ ---
321
+
322
+ ## 8. Maintaining this file
323
+
324
+ This file was generated by `agent-kit`. It is a starting point, not a finished document — the
325
+ value comes from keeping it true to what the project actually is.
326
+
327
+ Re-run `/init` or update it by hand whenever reality moves: exact build, run, lint, and
328
+ single-test invocations; architecture and the non-obvious relationships between modules;
329
+ conventions a newcomer could not infer from one file. Update `AGENTS.md` and
330
+ `.claude/rules/README.md` in the same pass.
@@ -0,0 +1,93 @@
1
+ ---
2
+ description: Cria o PRD de uma funcionalidade a partir de perguntas de clarificação. Rodado pelo Claude (orquestrador).
3
+ ---
4
+
5
+ > **Executado por:** Claude (orquestrador), na worktree atual.
6
+ > **Não delegue este comando a um worker `agy`** — exige perguntas de clarificação com o usuário.
7
+ > Ver `CLAUDE.md` seção 1 (divisão de responsabilidades).
8
+
9
+ ---
10
+
11
+ Você é um especialista em criar PRDs focado em produzir documentos de requisitos claros e acionáveis para equipes de desenvolvimento e produto.
12
+
13
+ <critical>NÃO GERE O PRD SEM ANTES FAZER PERGUNTAS DE CLARIFICAÇÃO</critical>
14
+ <critical>EM HIPOTESE NENHUMA, FUJA DO PADRÃO DO TEMPLATE DO PRD</critical>
15
+
16
+ ## Objetivos
17
+
18
+ 1. Capturar requisitos completos, claros e testáveis focados no usuário e resultados de negócio
19
+ 2. Seguir o fluxo de trabalho estruturado antes de criar qualquer PRD
20
+ 3. Gerar um PRD usando o template padronizado e salvá-lo no local correto
21
+
22
+ ## Referência do Template
23
+
24
+ - Template fonte: @.claude/templates/prd-template.md
25
+ - Nome do arquivo final: `prd.md`
26
+ - Diretório final: `./tasks/prd-[nome-funcionalidade]/` (nome em kebab-case)
27
+
28
+ ## Fluxo de Trabalho
29
+
30
+ Ao ser invocado com uma solicitação de funcionalidade, siga a sequência abaixo.
31
+ ### 1. Esclarecer (Obrigatório)
32
+
33
+ Faça perguntas para entender:
34
+
35
+ - Problema a resolver
36
+ - Funcionalidade principal
37
+ - Restrições
38
+ - O que **NÃO está no escopo**
39
+
40
+ ### 2. Planejar (Obrigatório)
41
+
42
+ Crie um plano de desenvolvimento do PRD incluindo:
43
+
44
+ - Abordagem seção por seção
45
+ - Áreas que precisam pesquisa (**usar Web Search para buscar regras de negócio**)
46
+ - Premissas e dependências
47
+
48
+ <critical>NÃO GERE O PRD SEM ANTES FAZER PERGUNTAS DE CLARIFICAÇÃO</critical>
49
+ <critical>EM HIPOTESE NENHUMA, FUJA DO PADRÃO DO TEMPLATE DO PRD</critical>
50
+
51
+ ### 3. Redigir o PRD (Obrigatório)
52
+
53
+ - Use o template `.claude/templates/prd-template.md`
54
+ - **Foque no O QUÊ e POR QUÊ, não no COMO**
55
+ - Inclua requisitos funcionais numerados
56
+ - Mantenha o documento principal com no máximo 2.000 palavras
57
+
58
+ ### 4. Criar Diretório e Salvar (Obrigatório)
59
+
60
+ - Crie o diretório: `./tasks/prd-[nome-funcionalidade]/`
61
+ - Salve o PRD em: `./tasks/prd-[nome-funcionalidade]/prd.md`
62
+
63
+ ### 5. Reportar Resultados
64
+
65
+ - Forneça o caminho do arquivo final
66
+ - Forneça um resumo **BEM BREVE** sobre o resultado final do PRD
67
+
68
+ ## Princípios Fundamentais
69
+
70
+ - Esclareça antes de planejar; planeje antes de redigir
71
+ - Minimize ambiguidades; prefira declarações mensuráveis
72
+ - PRD define resultados e restrições, **não implementação**
73
+ - Considere sempre usabilidade e acessibilidade
74
+
75
+ ## Checklist de Perguntas de Clarificação
76
+
77
+ - **Problema e Objetivos**: qual problema resolver, objetivos mensuráveis
78
+ - **Usuários e Histórias**: usuários principais, histórias de usuário, fluxos principais
79
+ - **Funcionalidade Principal**: entradas/saídas de dados, ações
80
+ - **Escopo e Planejamento**: o que não está incluído, dependências
81
+ - **Design e Experiência**: diretrizes de UI/UX e acessibilidade
82
+
83
+ ## Checklist de Qualidade
84
+
85
+ - [ ] Perguntas esclarecedoras completas e respondidas
86
+ - [ ] Plano detalhado criado
87
+ - [ ] PRD gerado usando o template
88
+ - [ ] Requisitos funcionais numerados incluídos
89
+ - [ ] Arquivo salvo em `./tasks/prd-[nome-funcionalidade]/prd.md`
90
+ - [ ] Caminho final fornecido
91
+
92
+ <critical>NÃO GERE O PRD SEM ANTES FAZER PERGUNTAS DE CLARIFICAÇÃO</critical>
93
+ <critical>EM HIPOTESE NENHUMA, FUJA DO PADRÃO DO TEMPLATE DO PRD</critical>
@@ -0,0 +1,98 @@
1
+ ---
2
+ description: Decompõe PRD e Tech Spec em tarefas incrementais, marcando as paralelizáveis. Rodado pelo Claude (orquestrador).
3
+ ---
4
+
5
+ > **Executado por:** Claude (orquestrador), na worktree atual.
6
+ > **Não delegue este comando a um worker `agy`** — decomposição de tarefas e planejamento de paralelismo.
7
+ > Ver `CLAUDE.md` seção 1 (divisão de responsabilidades).
8
+
9
+ ---
10
+
11
+ Você é um assistente especializado em gerenciamento de projetos de desenvolvimento de software. Sua tarefa é criar uma lista detalhada de tarefas baseada em um PRD e uma Tech Spec para uma funcionalidade específica.
12
+
13
+ <critical>**ANTES DE GERAR QUALQUER ARQUIVO ME MOSTRE A LISTA DAS TASKS HIGH LEVEL PARA APROVAÇÃO**</critical>
14
+ <critical>NÃO IMPLEMENTE NADA</critical>
15
+ <critical>CADA TAREFA DEVE SER UM ENTREGÁVEL FUNCIONAL E INCREMENTAL</critical>
16
+ <critical>É FUNDAMENTAL QUE PARA CADA TAREFA EXISTA UM CONJUNTO DE TESTES QUE GARANTA O SEU FUNCIONAMENTO E OBJETIVO DE NEGÓCIO</critical>
17
+
18
+ ## Pré-requisitos
19
+
20
+ A funcionalidade em que você trabalhará é identificada por este slug:
21
+
22
+ - PRD requerido: `tasks/prd-[nome-funcionalidade]/prd.md`
23
+ - Tech Spec requerido: `tasks/prd-[nome-funcionalidade]/techspec.md`
24
+
25
+ ## Etapas do Processo
26
+
27
+ <critical>**ANTES DE GERAR QUALQUER ARQUIVO ME MOSTRE A LISTA DAS TASKS HIGH LEVEL PARA APROVAÇÃO**</critical>
28
+
29
+ 1. **Analisar PRD e Tech Spec**
30
+
31
+ - Extrair requisitos e decisões técnicas
32
+ - Identificar componentes principais
33
+
34
+ 2. **Gerar Estrutura de Tarefas**
35
+
36
+ - Organizar sequenciamento
37
+ - **Cada tarefa deve ser um entregável funcional**
38
+ - **Todas as tarefas devem ter o seu próprio conjunto de testes de unidade e integração**
39
+
40
+ 3. **Gerar Arquivos de Tarefas Individuais**
41
+
42
+ - Criar arquivo para cada tarefa principal
43
+ - Detalhar subtarefas e critérios de sucesso
44
+ - Detalhar os testes de unidade e integração
45
+
46
+ ## Diretrizes de Criação de Tarefas
47
+
48
+ - Agrupar tarefas por entregável lógico
49
+ - Ordenar tarefas logicamente, com dependências antes de dependentes (ex: backend antes do frontend, backend e frontend antes dos testes E2E)
50
+ - Tornar cada tarefa principal independentemente completável
51
+ - Definir escopo e entregáveis claros para cada tarefa
52
+ - Incluir testes como subtarefas dentro de cada tarefa principal
53
+
54
+ ## Especificações de Saída
55
+
56
+ ### Localização dos Arquivos
57
+
58
+ - Pasta da funcionalidade: `./tasks/prd-[nome-funcionalidade]/`
59
+ - Template para a lista de tarefas: `./.claude/templates/tasks-template.md`
60
+ - Lista de tarefas: `./tasks/prd-[nome-funcionalidade]/tasks.md`
61
+ - Template para cada tarefa individual: `./.claude/templates/task-template.md`
62
+ - Tarefas individuais: `./tasks/prd-[nome-funcionalidade]/[num]_task.md`
63
+
64
+ ### Formato do Resumo de Tarefas (tasks.md)
65
+
66
+ - **SEGUIR ESTRITAMENTE O TEMPLATE EM `./.claude/templates/tasks-template.md`**
67
+
68
+ ### Formato de Tarefa Individual ([num]_task.md)
69
+
70
+ - **SEGUIR ESTRITAMENTE O TEMPLATE EM `./.claude/templates/task-template.md`**
71
+
72
+ ## Diretrizes Finais
73
+
74
+ - Assuma que o leitor principal é um worker `agy` sem contexto prévio do projeto (seja explícito)
75
+ - **Evite criar mais de 10 tarefas** (agrupe conforme definido anteriormente)
76
+ - Use o formato X.0 para tarefas principais, X.Y para subtarefas
77
+
78
+ ## Marcação de Paralelismo (Obrigatório)
79
+
80
+ Esta marcação decide quantas worktrees e workers serão abertos, então precisa ser precisa.
81
+
82
+ Para cada tarefa principal, registre no `tasks.md`:
83
+
84
+ - **Depende de:** lista de tarefas que precisam terminar antes, ou `nenhuma`
85
+ - **Arquivos:** os arquivos e diretórios que a tarefa vai tocar
86
+ - **Paralelizável:** `sim` apenas se as duas condições valerem:
87
+ 1. Não depende de nenhuma tarefa ainda não concluída
88
+ 2. Não compartilha **nenhum** arquivo com outra tarefa marcada como paralelizável
89
+
90
+ Duas tarefas que tocam o mesmo arquivo **nunca** são paralelizáveis, mesmo sem dependência lógica
91
+ entre elas — elas seriam executadas em worktrees diferentes e o conflito só apareceria na
92
+ integração.
93
+
94
+ Na dúvida, marque `não`. Serializar custa tempo; paralelizar errado custa retrabalho.
95
+
96
+ Após completar a análise e gerar todos os arquivos necessários, apresente os resultados ao usuário e aguarde confirmação para prosseguir com a implementação.
97
+
98
+ <critical>NÃO IMPLEMENTE NADA, O FOCO DESSA ETAPA É NA LISTA E NO DETALHAMENTO DAS TAREFAS</critical>
@@ -0,0 +1,118 @@
1
+ ---
2
+ description: Cria a Tech Spec a partir do PRD, com análise profunda do projeto. Rodado pelo Claude (orquestrador).
3
+ ---
4
+
5
+ > **Executado por:** Claude (orquestrador), na worktree atual.
6
+ > **Não delegue este comando a um worker `agy`** — exige o Context7 MCP e decisões de arquitetura.
7
+ > Ver `CLAUDE.md` seção 1 (divisão de responsabilidades).
8
+
9
+ ---
10
+
11
+ Você é um especialista em especificações técnicas focado em produzir Tech Specs claras e prontas para implementação baseadas em um PRD completo. Seus outputs devem ser concisos, focados em arquitetura e seguir o template fornecido.
12
+
13
+ <critical>EXPLORE O PROJETO PRIMEIRO ANTES DE FAZER AS PERGUNTAS DE CLARIFICAÇÃO</critical>
14
+ <critical>NÃO GERE A TECH SPEC SEM ANTES FAZER PERGUNTAS DE CLARIFICAÇÃO (USE A SUA ASK USER QUESTIONS TOOL)</critical>
15
+ <critical>USAR O CONTEXT 7 MCP PARA QUESTÕES TÉCNICAS E WEB SEARCH (COM PELO MENOS 3 BUSCAS) PARA BUSCAR REGRAS DE NEGÓCIO E INFORMAÇÕES GERAIS ANTES DE FAZER AS PERGUNTAS DE CLARIFICAÇÃO</critical>
16
+ <critical>EM HIPOTESE NENHUMA, FUJA DO PADRÃO DO TEMPLATE DO TECHSPEC</critical>
17
+
18
+ ## Objetivos Principais
19
+
20
+ 1. Traduzir requisitos do PRD em **orientações técnicas e decisões arquiteturais**
21
+ 2. Realizar análise profunda do projeto antes de redigir qualquer conteúdo
22
+ 3. Avaliar bibliotecas existentes vs fazer um desenvolvimento customizado
23
+ 4. Gerar uma Tech Spec usando o template padronizado e salvá-la no local correto
24
+
25
+ <critical>Dê preferência à bibliotecas existentes</critical>
26
+
27
+ ## Template e Entradas
28
+
29
+ - Template Tech Spec: @.claude/templates/techspec-template.md
30
+ - PRD requerido: `tasks/prd-[nome-funcionalidade]/prd.md`
31
+ - Documento de saída: `tasks/prd-[nome-funcionalidade]/techspec.md`
32
+
33
+ ## Pré-requisitos
34
+
35
+ - Revisar padrões do projeto em @.claude/rules, começando por `.claude/rules/README.md`
36
+ - Confirmar que o PRD existe em `tasks/prd-[nome-funcionalidade]/prd.md`
37
+
38
+ ## A stack ainda não foi escolhida
39
+
40
+ <critical>Linguagem, framework, gerenciador de pacotes, estrutura de pastas e ferramenta de testes são decisões do USUÁRIO. A Tech Spec não as decide sozinha</critical>
41
+
42
+ Se a funcionalidade exigir uma dessas escolhas, **pergunte ao usuário** nas perguntas de
43
+ clarificação, apresentando as opções com trade-offs — não escolha silenciosamente e não trate os
44
+ exemplos das rules como se a decisão já estivesse tomada.
45
+
46
+ Depois que o usuário decidir, registre a escolha e a justificativa na seção "Decisões Principais"
47
+ da Tech Spec, e atualize o `CLAUDE.md` e o `.claude/rules/README.md` na mesma passada.
48
+
49
+ ## Fluxo de Trabalho
50
+
51
+ ### 1. Analisar PRD (Obrigatório)
52
+
53
+ - Ler o PRD completo **NÃO PULE ESTA ETAPA**
54
+ - Identificar conteúdo técnico
55
+ - Extrair requisitos principais, restrições e métricas de sucesso
56
+
57
+ ### 2. Análise Profunda do Projeto (Obrigatório)
58
+
59
+ - Descobrir arquivos, módulos, interfaces e pontos de integração implicados
60
+ - Mapear símbolos, dependências e pontos críticos
61
+ - Explorar estratégias de solução, padrões, riscos e alternativas
62
+ - Realizar análise ampla: chamadores/chamados, configs, middleware, persistência, concorrência, tratamento de erros, testes, infra
63
+
64
+ ### 3. Esclarecimentos Técnicos (Obrigatório)
65
+
66
+ Fazer perguntas focadas sobre:
67
+ - Posicionamento de domínio
68
+ - Fluxo de dados
69
+ - Dependências externas
70
+ - Interfaces principais
71
+ - Cenários de testes
72
+
73
+ ### 4. Mapeamento de Conformidade com Padrões (Obrigatório)
74
+
75
+ - Mapear decisões para @.claude/rules
76
+ - Destacar desvios com justificativa e alternativas conformes
77
+
78
+ ### 5. Gerar Tech Spec (Obrigatório)
79
+
80
+ - Usar @.claude/templates/techspec-template.md como estrutura exata
81
+ - Fornecer: visão geral da arquitetura, design de componentes, interfaces, modelos, endpoints, pontos de integração, análise de impacto, estratégia de testes, observabilidade
82
+ - Manter até ~2.000 palavras
83
+ - **Evitar repetir requisitos funcionais do PRD**; focar em como implementar
84
+
85
+ ### 6. Salvar Tech Spec (Obrigatório)
86
+
87
+ - Salvar como: `tasks/prd-[nome-funcionalidade]/techspec.md`
88
+ - Confirmar operação de escrita e caminho
89
+
90
+ ## Princípios Fundamentais
91
+
92
+ - A Tech Spec **foca em COMO, não O QUÊ** (PRD possui o que/por quê)
93
+ - Preferir arquitetura simples e evolutiva com interfaces claras
94
+ - Fornecer considerações de testabilidade e observabilidade antecipadamente
95
+
96
+ ## Checklist de Perguntas de Clarificação
97
+
98
+ - **Domínio**: limites e propriedade de módulos apropriados
99
+ - **Fluxo de Dados**: entradas/saídas, contratos e transformações
100
+ - **Dependências**: serviços/APIs externos, modos de falha, timeouts, idempotência
101
+ - **Implementação Principal**: lógica central, interfaces e modelos de dados
102
+ - **Testes**: caminhos críticos, testes de unidade/integração/e2e, testes de contrato
103
+ - **Reusar vs Construir**: bibliotecas/componentes existentes, viabilidade de licença, estabilidade da API
104
+
105
+ ## Checklist de Qualidade
106
+
107
+ - [ ] PRD revisado
108
+ - [ ] Análise profunda do repositório
109
+ - [ ] Esclarecimentos técnicos principais respondidos
110
+ - [ ] Tech Spec gerada usando o template
111
+ - [ ] Verificou as rules em @.claude/rules
112
+ - [ ] Arquivo escrito em `./tasks/prd-[nome-funcionalidade]/techspec.md`
113
+ - [ ] Caminho final de saída fornecido e confirmação
114
+
115
+ <critical>EXPLORE O PROJETO PRIMEIRO ANTES DE FAZER AS PERGUNTAS DE CLARIFICAÇÃO</critical>
116
+ <critical>NÃO GERE A TECH SPEC SEM ANTES FAZER PERGUNTAS DE CLARIFICAÇÃO (USE A SUA ASK USER QUESTIONS TOOL)</critical>
117
+ <critical>USAR O CONTEXT 7 MCP PARA QUESTÕES TÉCNICAS E WEB SEARCH (COM PELO MENOS 3 BUSCAS) PARA BUSCAR REGRAS DE NEGÓCIO E INFORMAÇÕES GERAIS ANTES DE FAZER AS PERGUNTAS DE CLARIFICAÇÃO</critical>
118
+ <critical>EM HIPOTESE NENHUMA, FUJA DO PADRÃO DO TEMPLATE DO TECHSPEC</critical>