@guilhermednobre/agent-kit 0.1.0 → 0.2.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.
- package/README.md +52 -23
- package/bin/cli.js +10 -8
- package/package.json +4 -3
- package/templates/AGENTS.md +100 -110
- package/templates/CLAUDE.md +103 -249
- package/templates/claude/commands/analisar-consistencia.md +102 -0
- package/templates/claude/commands/avaliar-ideia.md +63 -0
- package/templates/claude/commands/configurar-worker.md +85 -0
- package/templates/claude/commands/criar-prd.md +1 -1
- package/templates/claude/commands/criar-tasks.md +9 -3
- package/templates/claude/commands/criar-techspec.md +1 -1
- package/templates/claude/commands/executar-bugfix.md +4 -4
- package/templates/claude/commands/executar-qa.md +6 -5
- package/templates/claude/commands/executar-review.md +20 -6
- package/templates/claude/commands/executar-task.md +3 -3
- package/templates/claude/commands/fechar-ciclo.md +79 -0
- package/templates/claude/rules/README.md +2 -2
- package/templates/claude/templates/bugs-template.md +2 -2
- package/templates/claude/templates/prd-template.md +65 -61
- package/templates/claude/templates/task-template.md +5 -5
- package/templates/claude/templates/tasks-template.md +1 -1
- package/templates/claude/templates/techspec-template.md +129 -129
- package/templates/claude/templates/worker-brief-template.md +3 -1
- package/templates/docs/agents/worker.md +75 -0
package/templates/CLAUDE.md
CHANGED
|
@@ -1,64 +1,16 @@
|
|
|
1
|
-
|
|
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.
|
|
1
|
+
@AGENTS.md
|
|
46
2
|
|
|
47
|
-
|
|
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.
|
|
3
|
+
# CLAUDE.md
|
|
51
4
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| Build | `{{CMD_BUILD}}` |
|
|
56
|
-
| Test | `{{CMD_TEST}}` |
|
|
57
|
-
| Lint | `{{CMD_LINT}}` |
|
|
58
|
-
| Single test | `{{CMD_TEST_ONE}}` |
|
|
59
|
-
<!--END-->
|
|
5
|
+
Claude's role in this repository: the **orchestrator**. Implementation runs on worker agents
|
|
6
|
+
supervised through Orca orchestration. The project, stack, commands and engineering rules are in
|
|
7
|
+
`AGENTS.md` (imported above); the worker's own contract is `docs/agents/worker.md`.
|
|
60
8
|
|
|
61
|
-
|
|
9
|
+
<!--WORKER-SETUP-->
|
|
10
|
+
> **First session: the worker is not configured yet.** Before any other work, run
|
|
11
|
+
> `/configurar-worker`. It asks which agent and model will implement the tasks, verifies that they
|
|
12
|
+
> run, and rewrites section 2 and this notice. Until then, no worker can be dispatched.
|
|
13
|
+
<!--/WORKER-SETUP-->
|
|
62
14
|
|
|
63
15
|
## 1. Roles
|
|
64
16
|
|
|
@@ -68,263 +20,165 @@ Owns: architecture, technical decisions, planning, task decomposition, difficult
|
|
|
68
20
|
root-cause analysis, security-sensitive decisions, QA, and final review.
|
|
69
21
|
|
|
70
22
|
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
|
|
72
|
-
and when a worker has failed twice on the same problem.
|
|
73
|
-
|
|
74
|
-
### Antigravity workers (`agy`)
|
|
23
|
+
for orchestration artifacts (`CLAUDE.md`, `AGENTS.md`, `docs/agents/**`, `.claude/**`, documents
|
|
24
|
+
under `tasks/**`), and when a worker has failed twice on the same problem.
|
|
75
25
|
|
|
76
|
-
|
|
77
|
-
repetitive changes, and applying documented bug fixes.
|
|
26
|
+
### Worker
|
|
78
27
|
|
|
79
|
-
|
|
28
|
+
Owns implementation, as defined in `docs/agents/worker.md`. Workers never choose the stack or
|
|
29
|
+
architecture, never make security decisions, and never commit.
|
|
80
30
|
|
|
81
|
-
### Pipeline
|
|
31
|
+
### Pipeline
|
|
82
32
|
|
|
83
|
-
| Command | Runs on |
|
|
33
|
+
| Command | Runs on | When |
|
|
84
34
|
|---|---|---|
|
|
85
|
-
| `/
|
|
86
|
-
| `/
|
|
87
|
-
| `/criar-
|
|
88
|
-
| `/
|
|
89
|
-
| `/
|
|
90
|
-
| `/
|
|
91
|
-
| `/executar-
|
|
92
|
-
|
|
93
|
-
|
|
35
|
+
| `/configurar-worker` | Claude | First session, or when the worker tool or model changes |
|
|
36
|
+
| `/avaliar-ideia` | Claude | Optional: go / clarify / kill verdict before a PRD |
|
|
37
|
+
| `/criar-prd` | Claude | Clarifying questions with the user |
|
|
38
|
+
| `/criar-techspec` | Claude | Architecture decisions; uses Context7 MCP |
|
|
39
|
+
| `/criar-tasks` | Claude | Decomposition and parallelism planning |
|
|
40
|
+
| `/analisar-consistencia` | Claude | Cross-checks PRD, TechSpec and Tasks; no dispatch while a Blocker or High finding is open |
|
|
41
|
+
| `/executar-task` | **worker** | Implementation |
|
|
42
|
+
| `/executar-review` | Claude | After each `worker_done`; findings ranked Blocker / High / Medium / Low |
|
|
43
|
+
| `/executar-bugfix` | **worker** | Applying a fix Claude diagnosed in `bugs.md` |
|
|
44
|
+
| `/executar-qa` | Claude | Browser QA; uses Playwright MCP |
|
|
45
|
+
| `/fechar-ciclo` | Claude | After an approved QA: lessons into rules, ADRs, memory or templates; changelog |
|
|
46
|
+
|
|
47
|
+
Any step that needs an MCP the worker lacks stays with Claude.
|
|
94
48
|
|
|
95
49
|
---
|
|
96
50
|
|
|
97
|
-
## 2. Launching
|
|
51
|
+
## 2. Launching a worker
|
|
98
52
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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.
|
|
53
|
+
<!--WORKER-RECIPE-->
|
|
54
|
+
**Not configured.** Run `/configurar-worker`.
|
|
55
|
+
<!--/WORKER-RECIPE-->
|
|
104
56
|
|
|
105
|
-
|
|
57
|
+
The orchestration sequence is the same for every worker tool; only the launch command, the
|
|
58
|
+
readiness check and the tool notes above change.
|
|
106
59
|
|
|
107
60
|
```bash
|
|
108
61
|
# 0. Once per session - create the Run
|
|
109
62
|
orca orchestration run-create --objective "<objective>" --json
|
|
110
63
|
|
|
111
|
-
# 1. Worktree - only when parallelizing (
|
|
64
|
+
# 1. Worktree - only when parallelizing (section 3); otherwise use the current one
|
|
112
65
|
orca worktree create --name <task-slug> --no-parent --json
|
|
113
66
|
# copy the full result.worktree.id: <repoId>::<path>
|
|
114
67
|
|
|
115
|
-
# 2. Agent terminal,
|
|
116
|
-
orca terminal create --worktree <selector> --title <task-slug>
|
|
117
|
-
--command "agy --model gemini-3.8-flash-high --dangerously-skip-permissions" --json
|
|
68
|
+
# 2. Agent terminal, with the launch command from the recipe above
|
|
69
|
+
orca terminal create --worktree <selector> --title <task-slug> --command "<launch command>" --json
|
|
118
70
|
# copy result.terminal.handle
|
|
119
71
|
|
|
120
|
-
# 3. Readiness - poll
|
|
72
|
+
# 3. Readiness - poll until the tail matches the readiness check above
|
|
121
73
|
orca terminal read --terminal <handle> --json
|
|
122
|
-
# ready when the tail shows the banner followed by a bare ">" prompt
|
|
123
74
|
|
|
124
|
-
# 4. Task + dispatch -
|
|
75
|
+
# 4. Task + dispatch - never pass --inject
|
|
125
76
|
orca orchestration task-create --spec "$(cat <brief-file>)" --json
|
|
126
77
|
orca orchestration dispatch --task <task_id> --to <handle> --return-preamble --json
|
|
127
|
-
# write result.preamble to a file; it carries the real
|
|
78
|
+
# write result.preamble to a file; it carries the real dispatch id
|
|
128
79
|
|
|
129
|
-
# 5. Deliver by file reference, not by pasting
|
|
80
|
+
# 5. Deliver by file reference, not by pasting a long brief into the TUI
|
|
130
81
|
orca terminal send --terminal <handle> \
|
|
131
82
|
--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
83
|
```
|
|
136
84
|
|
|
137
|
-
|
|
85
|
+
Do not use `orca orchestration worker-start`: it needs a configured `--agent`, and a failed start
|
|
86
|
+
marks the task `failed`, forcing a new task row.
|
|
87
|
+
|
|
88
|
+
### Supervising
|
|
89
|
+
|
|
90
|
+
The Orca notification ("You have 1 orchestration message") reaches the user, not Claude. Do not
|
|
91
|
+
rely on it, and do not leave a worker running unwatched:
|
|
138
92
|
|
|
139
|
-
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
93
|
+
- After every dispatch, arm a background **Monitor** that polls
|
|
94
|
+
`orca orchestration check --run <run> --json` every 30 s. It acknowledges batches that hold only
|
|
95
|
+
heartbeats (`check --run <run> --ack <delivery_id>`) and exits **without** acknowledging when a
|
|
96
|
+
`worker_done`, `question` or `escalation` arrives, so Claude reads it next. Re-arm it on timeout.
|
|
97
|
+
- Prefer it over a long `check --wait`: an unacknowledged message is replayed, and a background
|
|
98
|
+
`--wait` can be killed under memory pressure.
|
|
99
|
+
- If the Orca runtime drops, the `worker_done` may be lost. Detect the end from the worker's own
|
|
100
|
+
report (the worker block in `bugs.md`, the files on disk), review, and close the task with
|
|
101
|
+
`orca orchestration task-update`.
|
|
102
|
+
- After a reboot, Orca may restore old worker terminals: close them before relaunching.
|
|
103
|
+
|
|
104
|
+
### Worktrees
|
|
105
|
+
|
|
106
|
+
- A new Orca worktree branches from `origin/main`: **push** what the worker needs before
|
|
107
|
+
dispatching, or it will not be there.
|
|
108
|
+
- `orca worktree rm` deletes the local branch. Note its SHA, and commit reviewed work first.
|
|
109
|
+
- From Git Bash, prefix `MSYS_NO_PATHCONV=1` when sending slash-prefixed text or POSIX paths, or
|
|
110
|
+
they get rewritten into `C:/Program Files/Git/...`.
|
|
149
111
|
|
|
150
112
|
### Worker brief
|
|
151
113
|
|
|
152
|
-
Every
|
|
153
|
-
|
|
154
|
-
run
|
|
114
|
+
Every brief uses `.claude/templates/worker-brief-template.md` and states objective, context,
|
|
115
|
+
constraints, files involved, acceptance criteria, and the exact validation to run. When two workers
|
|
116
|
+
run in parallel and one consumes what the other produces, the brief **fixes the contract in
|
|
117
|
+
writing**: route, method, status code and response body field by field. When tests share a
|
|
118
|
+
database, Redis index or fixed port, the brief names the directory lock that serializes them.
|
|
155
119
|
|
|
156
120
|
---
|
|
157
121
|
|
|
158
122
|
## 3. Parallel work
|
|
159
123
|
|
|
160
|
-
Open a separate worktree and worker per task **only** when
|
|
161
|
-
|
|
124
|
+
Open a separate worktree and worker per task **only** when tasks are genuinely independent: no
|
|
125
|
+
dependency between them and no overlapping files.
|
|
162
126
|
|
|
163
|
-
- One task →
|
|
127
|
+
- One task → the current worktree. Do not create a worktree for a single task.
|
|
164
128
|
- Two or more independent tasks → one worktree and one worker each, all launched before waiting.
|
|
165
|
-
- Default cap: **3 concurrent workers**.
|
|
166
|
-
- Dependent tasks run in sequence. Never parallelize tasks that touch the same files.
|
|
129
|
+
- Default cap: **3 concurrent workers**.
|
|
167
130
|
- `/criar-tasks` marks which tasks are parallelizable; that marking drives this decision.
|
|
168
131
|
|
|
169
|
-
Launch every independent worker first, then wait once with `check --wait` and process each
|
|
170
|
-
`worker_done` as it arrives.
|
|
171
|
-
|
|
172
132
|
---
|
|
173
133
|
|
|
174
134
|
## 4. Review and shutdown
|
|
175
135
|
|
|
176
|
-
Never accept a worker's result on its word. After each `worker_done`:
|
|
136
|
+
Never accept a worker's result on its word. After each `worker_done`, run `/executar-review`:
|
|
177
137
|
|
|
178
138
|
1. Read the actual diff (`git -C <worktree> status --porcelain`, `git -C <worktree> diff`).
|
|
179
|
-
2. Read the changed files in full
|
|
180
|
-
3. Run the validation
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
**Only after the review passes**, shut the worker down:
|
|
139
|
+
2. Read the changed files in full.
|
|
140
|
+
3. Run the validation yourself and observe the output. A required output missing from the report
|
|
141
|
+
means it never ran.
|
|
142
|
+
4. Compare against every acceptance criterion and the applicable `.claude/rules/`.
|
|
185
143
|
|
|
186
|
-
|
|
187
|
-
orca terminal close --terminal <handle> --tab --json
|
|
188
|
-
|
|
144
|
+
Only after the review passes, close the worker:
|
|
145
|
+
`orca terminal close --terminal <handle> --tab --json`. Never close one on a timeout, a heartbeat
|
|
146
|
+
or an unreviewed `worker_done`.
|
|
189
147
|
|
|
190
|
-
|
|
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.
|
|
148
|
+
Branches are never merged automatically. Commit reviewed work as it accumulates when the user has
|
|
149
|
+
asked for commits — small commits are easier to review and survive a lost worktree.
|
|
194
150
|
|
|
195
151
|
---
|
|
196
152
|
|
|
197
153
|
## 5. Bugfix loop
|
|
198
154
|
|
|
199
|
-
When a review finds
|
|
200
|
-
regression — do not fix it inline. Diagnose it, then delegate the fix:
|
|
155
|
+
When a review or QA finds a Blocker or High problem, do not fix it inline:
|
|
201
156
|
|
|
202
|
-
1. Diagnose the **root cause
|
|
203
|
-
2.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
5. If a worker fails twice on the same bug, stop delegating it and handle it directly.
|
|
157
|
+
1. Diagnose the **root cause** — Claude's job, not the worker's.
|
|
158
|
+
2. Append it to `tasks/prd-<feature>/bugs.md` (`.claude/templates/bugs-template.md`) with the
|
|
159
|
+
cause, the intended solution and the regression test that must exist afterwards.
|
|
160
|
+
3. Launch a **new** worker with an `/executar-bugfix` brief pointing at that `bugs.md`.
|
|
161
|
+
4. Supervise, review again, then close that worker.
|
|
162
|
+
5. If a worker fails twice on the same bug, stop delegating and handle it directly. If Blocker or
|
|
163
|
+
High findings survive 3 bugfix rounds, take the case to the user.
|
|
210
164
|
|
|
211
|
-
|
|
212
|
-
|
|
165
|
+
Security-sensitive fixes and changes that alter the architecture are diagnosed *and* applied by
|
|
166
|
+
Claude, then recorded in `bugs.md`.
|
|
213
167
|
|
|
214
168
|
---
|
|
215
169
|
|
|
216
|
-
## 6.
|
|
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.
|
|
170
|
+
## 6. Progress visibility
|
|
220
171
|
|
|
221
|
-
|
|
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:
|
|
172
|
+
Update the Orca worktree comment at checkpoints (worker dispatched, done, review passed, bugfix
|
|
173
|
+
dispatched, blocked):
|
|
312
174
|
|
|
313
175
|
```bash
|
|
314
176
|
orca worktree set --worktree <selector> --comment "<short current state>" --json
|
|
315
177
|
```
|
|
316
178
|
|
|
317
|
-
Checkpoints worth reporting: worker dispatched, worker done, review passed, bugfix dispatched,
|
|
318
|
-
blocked.
|
|
319
|
-
|
|
320
179
|
---
|
|
321
180
|
|
|
322
|
-
##
|
|
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.
|
|
181
|
+
## 7. Maintaining this file
|
|
326
182
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
conventions a newcomer could not infer from one file. Update `AGENTS.md` and
|
|
330
|
-
`.claude/rules/README.md` in the same pass.
|
|
183
|
+
Role-specific instructions only. Anything every agent needs goes in `AGENTS.md`; anything the
|
|
184
|
+
worker needs goes in `docs/agents/worker.md`. Update the three in the same pass.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Cruza PRD, TechSpec e Tasks antes do despacho e aponta lacunas e contratos soltos. Rodado pelo Claude (orquestrador).
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Executado por:** Claude (orquestrador), na worktree atual.
|
|
6
|
+
> **Não delegue este comando a um worker**: decide se o plano está pronto para despachar.
|
|
7
|
+
> Ver `CLAUDE.md` seção 1 (divisão de responsabilidades).
|
|
8
|
+
> Roda **depois** de `/criar-tasks` e **antes** do primeiro `/executar-task`.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Você é um revisor de planejamento. Sua tarefa é provar, artefato contra artefato, que o PRD, a TechSpec
|
|
13
|
+
e as Tasks contam a mesma história, e que nenhum worker vai precisar adivinhar um contrato.
|
|
14
|
+
|
|
15
|
+
<critical>NÃO IMPLEMENTE NADA e NÃO REESCREVA os artefatos sem aprovação do usuário</critical>
|
|
16
|
+
<critical>Cada achado cita o trecho exato dos dois lados (arquivo e seção), nunca uma paráfrase</critical>
|
|
17
|
+
<critical>Requisito sem task é lacuna, não "fica para depois" (`AGENTS.md`, "The spec is the request")</critical>
|
|
18
|
+
|
|
19
|
+
## Entrada
|
|
20
|
+
|
|
21
|
+
Slug da funcionalidade: `tasks/prd-[slug]/`. Arquivos lidos:
|
|
22
|
+
|
|
23
|
+
- `prd.md`, `techspec.md`, `tasks.md` e todos os `itemized-tasks/*_task.md`
|
|
24
|
+
- `.claude/rules/` e, quando existirem, o glossário de domínio (`CONTEXT.md`) e as ADRs (`docs/adr/`) citadas pela TechSpec
|
|
25
|
+
|
|
26
|
+
## Verificações
|
|
27
|
+
|
|
28
|
+
### 1. Rastreabilidade (PRD → Tasks)
|
|
29
|
+
|
|
30
|
+
Monte a matriz requisito × task. Cada requisito funcional numerado do PRD precisa de pelo menos uma task
|
|
31
|
+
que o entregue **e** de um teste nessa task que o prove.
|
|
32
|
+
|
|
33
|
+
| Requisito | Task(s) | Teste que prova | Status |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| F1 | 3.0, 7.0 | `revisao.page.spec.tsx` | OK / LACUNA |
|
|
36
|
+
|
|
37
|
+
### 2. Cobertura técnica (TechSpec → Tasks)
|
|
38
|
+
|
|
39
|
+
Todo endpoint, migration, fila, componente e porta da TechSpec tem uma task dona. Nenhuma task cria algo que
|
|
40
|
+
a TechSpec não prevê.
|
|
41
|
+
|
|
42
|
+
### 3. Contratos entre tasks paralelas
|
|
43
|
+
|
|
44
|
+
Para cada par de tasks marcadas como paralelizáveis:
|
|
45
|
+
|
|
46
|
+
- [ ] Não tocam os mesmos arquivos (inclua `api-client.ts`, schemas compartilhados e migrations)
|
|
47
|
+
- [ ] Todo contrato que uma consome e a outra produz está **fixado por escrito** na TechSpec: rota,
|
|
48
|
+
método, status (200/202/404/422), corpo da resposta com nomes de campo e tipos
|
|
49
|
+
- [ ] A ordem de migrations não colide (dois `00NN` iguais)
|
|
50
|
+
|
|
51
|
+
Um contrato solto entre duas tasks paralelas é o bug mais comum que só aparece no QA: cada worker adivinha um formato diferente.
|
|
52
|
+
|
|
53
|
+
### 4. Conformidade com as invariantes
|
|
54
|
+
|
|
55
|
+
- [ ] Nenhuma decisão contradiz uma ADR vigente (ignore as supersedidas, que trazem banner)
|
|
56
|
+
- [ ] Termos de domínio usados como no glossário (`CONTEXT.md`), se existir
|
|
57
|
+
- [ ] Nada no plano exige o que o `AGENTS.md` ou o `CLAUDE.md` proíbem
|
|
58
|
+
|
|
59
|
+
### 5. Executabilidade das tasks
|
|
60
|
+
|
|
61
|
+
Cada `_task.md` tem: arquivos relevantes explícitos, critérios de sucesso verificáveis, comandos de validação
|
|
62
|
+
exatos, menção ao lock de banco quando toca integração ou E2E, e a seção de reporte.
|
|
63
|
+
|
|
64
|
+
### 6. Ambiguidades
|
|
65
|
+
|
|
66
|
+
Liste toda frase do PRD ou da TechSpec que admite duas leituras e que mudaria o código. Cada uma vira uma
|
|
67
|
+
pergunta ao usuário, nunca uma escolha silenciosa.
|
|
68
|
+
|
|
69
|
+
## Relatório
|
|
70
|
+
|
|
71
|
+
Salve em `tasks/prd-[slug]/consistencia.md`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
# Análise de Consistência - [Funcionalidade]
|
|
75
|
+
|
|
76
|
+
## Resumo
|
|
77
|
+
- Data: [AAAA-MM-DD]
|
|
78
|
+
- Veredito: PRONTO PARA DESPACHAR / AJUSTAR ANTES / VOLTAR AO PRD
|
|
79
|
+
- Lacunas: [N] · Contratos soltos: [N] · Conflitos com ADR: [N] · Ambiguidades: [N]
|
|
80
|
+
|
|
81
|
+
## Matriz de rastreabilidade
|
|
82
|
+
[tabela da verificação 1]
|
|
83
|
+
|
|
84
|
+
## Achados
|
|
85
|
+
| ID | Severidade | Tipo | Onde (arquivo § seção) | Achado | Ajuste proposto |
|
|
86
|
+
|----|------------|------|------------------------|--------|-----------------|
|
|
87
|
+
| C-01 | Blocker/High/Medium/Low | lacuna/contrato/adr/executabilidade/ambiguidade | ... | ... | ... |
|
|
88
|
+
|
|
89
|
+
## Perguntas ao usuário
|
|
90
|
+
1. [...]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Severidade segue a mesma escala do `/executar-review`. Blocker ou High impede o despacho.
|
|
94
|
+
|
|
95
|
+
## Ação após a análise
|
|
96
|
+
|
|
97
|
+
1. Mostre o veredito, os achados Blocker/High e as perguntas ao usuário.
|
|
98
|
+
2. Com a aprovação dele, aplique os ajustes nos artefatos de `tasks/**` (são documentos de orquestração,
|
|
99
|
+
o Claude pode editá-los) e rode a análise de novo até o veredito ser PRONTO PARA DESPACHAR.
|
|
100
|
+
3. Só então despache os workers.
|
|
101
|
+
|
|
102
|
+
<critical>NÃO DESPACHE NENHUM WORKER COM ACHADO BLOCKER OU HIGH ABERTO</critical>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Avalia uma ideia com evidência antes de abrir um PRD e termina em seguir, esclarecer ou descartar. Rodado pelo Claude (orquestrador).
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
> **Executado por:** Claude (orquestrador), na worktree atual.
|
|
6
|
+
> **Não delegue este comando a um worker**: exige conversa com o usuário.
|
|
7
|
+
> Ver `CLAUDE.md` seção 1 (divisão de responsabilidades).
|
|
8
|
+
> Roda **antes** do `/criar-prd`. É leve: minutos, não horas.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Você avalia se uma ideia merece um PRD. O objetivo é não gastar um ciclo inteiro em algo que seria cortado
|
|
13
|
+
depois.
|
|
14
|
+
|
|
15
|
+
<critical>NÃO ESCREVA PRD, TECHSPEC NEM CÓDIGO</critical>
|
|
16
|
+
<critical>Todo argumento se apoia em evidência: o código, o glossário de domínio, uma ADR, o uso real relatado pelo usuário</critical>
|
|
17
|
+
|
|
18
|
+
## Etapas
|
|
19
|
+
|
|
20
|
+
### 1. Entender
|
|
21
|
+
|
|
22
|
+
Reescreva a ideia em uma frase: **quem** ganha **o quê**, e **como saberemos** que funcionou. Se não couber em
|
|
23
|
+
uma frase, faça até 3 perguntas ao usuário antes de seguir.
|
|
24
|
+
|
|
25
|
+
### 2. Confrontar com o que já existe
|
|
26
|
+
|
|
27
|
+
- O produto já resolve isso de outro jeito? Procure no código e no glossário de domínio (`CONTEXT.md`), se existir.
|
|
28
|
+
- Alguma ADR já decidiu contra? Uma ideia que reabre uma ADR precisa dizer o que mudou desde ela.
|
|
29
|
+
- Cabe no escopo e nas restrições declaradas no `AGENTS.md`?
|
|
30
|
+
|
|
31
|
+
### 3. Custo e risco
|
|
32
|
+
|
|
33
|
+
- Tamanho estimado: P (1 task), M (2 a 4), G (5 ou mais). Aponte as partes do sistema tocadas.
|
|
34
|
+
- Maior incerteza técnica. Se for alta, proponha um spike curto antes do PRD.
|
|
35
|
+
- Custo recorrente por uso (chamadas a serviços pagos, infraestrutura), se houver.
|
|
36
|
+
|
|
37
|
+
### 4. Veredito
|
|
38
|
+
|
|
39
|
+
Salve em `tasks/ideias/[slug].md` e mostre ao usuário:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
# Ideia: [título]
|
|
43
|
+
|
|
44
|
+
- Data: [AAAA-MM-DD]
|
|
45
|
+
- Veredito: SEGUIR / ESCLARECER / DESCARTAR
|
|
46
|
+
- Em uma frase: [quem ganha o quê, e como medimos]
|
|
47
|
+
|
|
48
|
+
## Evidência a favor
|
|
49
|
+
- [...]
|
|
50
|
+
|
|
51
|
+
## Evidência contra / conflitos
|
|
52
|
+
- [...]
|
|
53
|
+
|
|
54
|
+
## Custo
|
|
55
|
+
- Tamanho: P/M/G · Áreas: [...] · Maior risco: [...]
|
|
56
|
+
|
|
57
|
+
## Próximo passo
|
|
58
|
+
- SEGUIR → `/criar-prd [slug]`
|
|
59
|
+
- ESCLARECER → [perguntas que faltam responder]
|
|
60
|
+
- DESCARTAR → [motivo, para não reabrir sem fato novo]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
O veredito é uma recomendação. Quem decide é o usuário.
|