@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # @guilhermednobre/agent-kit
2
2
 
3
- Scaffolds a multi-agent development workflow into any repository: **Claude orchestrates,
4
- Antigravity (`agy`) workers implement**, supervised through Orca orchestration.
3
+ Scaffolds a multi-agent development workflow into any repository: **Claude orchestrates, a worker
4
+ agent of your choice implements**, supervised through Orca orchestration.
5
5
 
6
6
  ```bash
7
7
  npx @guilhermednobre/agent-kit init
@@ -13,24 +13,56 @@ Installed globally, the command is just `agent-kit`.
13
13
 
14
14
  | Path | Purpose |
15
15
  |---|---|
16
- | `CLAUDE.md` | Orchestrator contract — roles, worker launch recipe, parallel worktrees, review and shutdown, bugfix loop, engineering rules |
17
- | `AGENTS.md` | Worker contract — what the worker owns, the `worker_done` protocol, stack constraints, definition of done |
18
- | `.claude/commands/` | Seven pipeline commands: `criar-prd`, `criar-techspec`, `criar-tasks`, `executar-task`, `executar-bugfix`, `executar-qa`, `executar-review` |
16
+ | `AGENTS.md` | Shared contract for every agent and tool: project, stack, commands, engineering rules. Read natively by Claude Code, opencode, Codex and others |
17
+ | `CLAUDE.md` | Imports `AGENTS.md` (`@AGENTS.md`) and adds only the orchestrator role: pipeline, worker launch, supervision, review, bugfix loop |
18
+ | `docs/agents/worker.md` | The worker role: what it owns, the `worker_done` protocol, definition of done. Every brief points to it |
19
+ | `.claude/commands/` | The pipeline commands (below) |
19
20
  | `.claude/rules/` | Engineering rules split into always-applicable principles and technology-conditional ones |
20
21
  | `.claude/templates/` | Document templates for PRD, TechSpec, tasks, bugs and worker briefs |
21
22
 
22
23
  Existing files are never overwritten without `--force` or an explicit confirmation.
23
24
 
25
+ ### Why three files
26
+
27
+ The orchestrator and the worker get opposite orders ("dispatch and review" against "implement and
28
+ stop"). In one file, each reads the other's orders. So the shared part lives in `AGENTS.md`, which
29
+ every tool reads, and each role adds only its own file. Nothing is written twice.
30
+
31
+ ## The worker is chosen in the first session
32
+
33
+ The kit does not hard-code a worker tool or model. The generated `CLAUDE.md` opens with a notice;
34
+ in the first Claude Code session, run `/configurar-worker`. It asks which tool (opencode,
35
+ Antigravity, Codex CLI, another Claude Code, or none) and which model and effort level, lists the
36
+ models the tool offers, smoke-tests the choice, confirms readiness in a real Orca terminal, and
37
+ then writes the launch recipe into `CLAUDE.md` section 2 and removes the notice. Run it again to
38
+ switch.
39
+
40
+ ## The pipeline
41
+
42
+ | Command | Runs on | When |
43
+ |---|---|---|
44
+ | `/configurar-worker` | Claude | First session, or to switch worker tool or model |
45
+ | `/avaliar-ideia` | Claude | Optional: go / clarify / kill verdict before writing a PRD |
46
+ | `/criar-prd` | Claude | Clarifying questions with the user |
47
+ | `/criar-techspec` | Claude | Architecture decisions |
48
+ | `/criar-tasks` | Claude | Decomposition into `itemized-tasks/`, parallelism marking |
49
+ | `/analisar-consistencia` | Claude | Cross-checks PRD, TechSpec and Tasks; nothing is dispatched while a Blocker or High finding is open |
50
+ | `/executar-task` | worker | Implementation |
51
+ | `/executar-review` | Claude | After each `worker_done`; findings ranked Blocker / High / Medium / Low |
52
+ | `/executar-bugfix` | worker | Applies a fix Claude diagnosed in `bugs.md` |
53
+ | `/executar-qa` | Claude | Browser QA with Playwright MCP |
54
+ | `/fechar-ciclo` | Claude | After an approved QA: turns the cycle's lessons into rules, ADRs, memory or templates, and writes the changelog |
55
+
24
56
  ## Two modes
25
57
 
26
58
  `init` inspects the target directory and picks a mode. Override it with `--mode`.
27
59
 
28
- - **greenfield** — no dependency manifest found. The generated contracts state that the stack is
29
- an open user decision, and forbid Claude and workers from choosing one unilaterally.
60
+ - **greenfield** — no dependency manifest found. `AGENTS.md` states that the stack is an open user
61
+ decision, and forbids every agent from choosing one unilaterally.
30
62
  - **existing** — a manifest was found (`package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`,
31
- `pom.xml`, `Gemfile`, `composer.json`, `mix.exs`, and others). The contracts instead point at a
32
- commands table. For Node projects the table is prefilled from the actual `scripts` and lockfile;
33
- anything unknown is written as `TBD` rather than guessed.
63
+ `pom.xml`, `Gemfile`, `composer.json`, `mix.exs`, and others). `AGENTS.md` gets a commands table.
64
+ For Node projects it is prefilled from the actual `scripts` and lockfile; anything unknown is
65
+ written as `TBD` rather than guessed.
34
66
 
35
67
  ## Usage
36
68
 
@@ -40,7 +72,7 @@ npx @guilhermednobre/agent-kit init [directory]
40
72
 
41
73
  | Option | Effect |
42
74
  |---|---|
43
- | `--name <name>` | Project name written into the contracts |
75
+ | `--name <name>` | Project name written into `AGENTS.md` |
44
76
  | `--description <text>` | One-line project description |
45
77
  | `--mode <mode>` | `greenfield` or `existing`, overriding detection |
46
78
  | `--force` | Overwrite existing files without asking |
@@ -49,26 +81,23 @@ npx @guilhermednobre/agent-kit init [directory]
49
81
  | `-h, --help` | Show help |
50
82
  | `-v, --version` | Show version |
51
83
 
52
- Run without flags in a terminal and it prompts for name and description, and asks what to do about
53
- each file that already exists (skip, overwrite, or write a `.new` sibling).
54
-
55
84
  ## Language
56
85
 
57
- The contracts (`CLAUDE.md`, `AGENTS.md`) are in English. The commands, rules and document
58
- templates are in Portuguese, matching the workflow they came from. Change either after generating —
59
- nothing in the kit depends on the wording.
86
+ The contracts (`AGENTS.md`, `CLAUDE.md`, `docs/agents/worker.md`) are in English. The commands,
87
+ rules and document templates are in Portuguese, matching the workflow they came from.
60
88
 
61
89
  ## Requirements
62
90
 
63
- Node 20+ to run the generator. The workflow it scaffolds assumes Claude Code, and the worker half
64
- assumes the Antigravity CLI (`agy`) plus Orca; the documents are still readable and useful without
65
- them, but the launch recipe in `CLAUDE.md` section 2 is specific to that setup.
91
+ Node 20+ to run the generator. The workflow assumes Claude Code as orchestrator and Orca for
92
+ worktrees and orchestration. The worker can be any CLI agent that runs in a terminal and can call
93
+ `orca orchestration send`.
66
94
 
67
95
  ## After generating
68
96
 
69
- 1. Read `CLAUDE.md` and fill in anything marked `TBD`.
70
- 2. In `existing` mode, verify the commands table actually runs.
71
- 3. Delete the rule files under `.claude/rules/` that do not match your project, and update
97
+ 1. Open Claude Code and run `/configurar-worker`.
98
+ 2. Read `AGENTS.md` and fill in anything marked `TBD`.
99
+ 3. In `existing` mode, verify the commands table actually runs.
100
+ 4. Delete the rule files under `.claude/rules/` that do not match your project, and update
72
101
  `.claude/rules/README.md`.
73
102
 
74
103
  ## Development
package/bin/cli.js CHANGED
@@ -22,13 +22,13 @@ const OPTIONS = {
22
22
  };
23
23
 
24
24
  const HELP = `
25
- agent-kit — scaffolds a Claude-as-orchestrator / agy-worker agent workflow.
25
+ agent-kit — scaffolds a Claude-as-orchestrator / worker-agent workflow.
26
26
 
27
27
  Usage:
28
28
  npx @guilhermednobre/agent-kit init [directory]
29
29
 
30
30
  Options:
31
- --name <name> Project name written into CLAUDE.md and AGENTS.md
31
+ --name <name> Project name written into AGENTS.md
32
32
  --description <text> One-line project description
33
33
  --mode <mode> greenfield | existing (default: auto-detected)
34
34
  --force Overwrite existing files without asking
@@ -37,8 +37,9 @@ Options:
37
37
  -h, --help Show this help
38
38
  -v, --version Show version
39
39
 
40
- Writes CLAUDE.md, AGENTS.md and .claude/{commands,rules,templates} into the
41
- target directory. Existing files are never overwritten without --force or a
40
+ Writes AGENTS.md, CLAUDE.md, docs/agents/worker.md and
41
+ .claude/{commands,rules,templates} into the target directory. The worker
42
+ tool and model are chosen in the first Claude session (/configurar-worker). Existing files are never overwritten without --force or a
42
43
  confirmation.
43
44
  `;
44
45
 
@@ -180,13 +181,14 @@ function summarize(counts) {
180
181
  function printNextSteps(mode) {
181
182
  console.log("");
182
183
  console.log("Next steps:");
183
- console.log(" 1. Read CLAUDE.md and fill in anything marked TBD.");
184
+ console.log(" 1. Open Claude Code here and run /configurar-worker to choose the worker agent and model.");
185
+ console.log(" 2. Read AGENTS.md and fill in anything marked TBD.");
184
186
  if (mode === "existing") {
185
- console.log(" 2. Verify the commands table in CLAUDE.md actually runs.");
187
+ console.log(" 3. Verify the commands table in AGENTS.md actually runs.");
186
188
  } else {
187
- console.log(" 2. Decide the stack with your team, then update CLAUDE.md and rules/README.md.");
189
+ console.log(" 3. Decide the stack, then update AGENTS.md and .claude/rules/README.md.");
188
190
  }
189
- console.log(" 3. Drop the rule files under .claude/rules that do not match your project.");
191
+ console.log(" 4. Drop the rule files under .claude/rules that do not match your project.");
190
192
  }
191
193
 
192
194
  main().catch((error) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guilhermednobre/agent-kit",
3
- "version": "0.1.0",
4
- "description": "Scaffolds a Claude-as-orchestrator / Antigravity-worker agent workflow into any repository",
3
+ "version": "0.2.0",
4
+ "description": "Scaffolds a Claude-as-orchestrator / worker-agent workflow into any repository",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "agent-kit": "bin/cli.js"
@@ -28,7 +28,8 @@
28
28
  "agents",
29
29
  "orchestration",
30
30
  "scaffold",
31
- "antigravity"
31
+ "agents-md",
32
+ "opencode"
32
33
  ],
33
34
  "license": "MIT",
34
35
  "author": "Guilherme Damasceno"
@@ -1,159 +1,149 @@
1
1
  # AGENTS.md
2
2
 
3
- Operating contract for the **Antigravity implementation worker** (CLI `agy`) in this repository.
3
+ Shared contract for **every coding agent** in this repository, whatever the tool. It states what
4
+ the project is and how code is written here. It does not assign roles:
4
5
 
5
- You run inside an Orca-managed worktree, launched as `agy --model gemini-3.8-flash-high
6
- --dangerously-skip-permissions`, and you are supervised by a Claude orchestrator. `CLAUDE.md`
7
- governs the orchestrator; this file governs you. On any conflict, `CLAUDE.md` wins.
6
+ - the **orchestrator** role lives in `CLAUDE.md`, which imports this file;
7
+ - the **worker** role lives in `docs/agents/worker.md`, which every worker brief points to;
8
+ - coding standards live in `.claude/rules/` (see `.claude/rules/README.md`).
8
9
 
9
- Read `CLAUDE.md` and the applicable files in `.claude/rules/` before you start working.
10
+ On conflict: role file (`CLAUDE.md` or `docs/agents/worker.md`) > this file > `.claude/rules/`.
10
11
 
11
12
  ## Project
12
13
 
13
14
  **{{PROJECT_NAME}}** — {{PROJECT_DESCRIPTION}}
14
15
 
15
- ---
16
+ <!--IF:greenfield-->
17
+ ## Stack: not chosen yet
16
18
 
17
- ## 1. What you own
19
+ The repository is still a greenfield scaffold. Language, framework, package manager, directory
20
+ layout, and test tooling are **open decisions that belong to the user**. No agent picks them
21
+ unilaterally. If a task cannot proceed without one of them, ask.
18
22
 
19
- - Feature implementation
20
- - Routine refactoring
21
- - Tests
22
- - Documentation
23
- - Boilerplate
24
- - Straightforward debugging
25
- - Repetitive code changes
26
- - Applying fixes already diagnosed in `tasks/prd-<feature>/bugs.md`
23
+ `.claude/rules/` is split accordingly — see `.claude/rules/README.md`:
27
24
 
28
- ## 2. What you do not own
25
+ - **Always apply:** `code-standards.md`, `logging.md`, `tests.md` (principles, tool-agnostic).
26
+ - **Apply only if that technology is chosen:** `node.md`, `react.md`, `http.md`.
29
27
 
30
- - Architecture and technical decisions
31
- - Stack selection (see section 4)
32
- - Security-sensitive decisions
33
- - Difficult debugging and root-cause analysis
34
- - Planning and task decomposition
35
- - Final review
36
- - Commits, pushes, branch operations, and merges
28
+ Because no dependency manifest exists, there is **no runnable build, lint or test command yet**.
29
+ Never report a validation as passing when its command does not exist.
30
+ <!--END-->
31
+ <!--IF:existing-->
32
+ ## Stack
37
33
 
38
- If a task pushes you into any of these, stop and escalate. Do not decide it yourself.
34
+ Detected manifest: `{{STACK_MANIFEST}}`.
39
35
 
40
- ---
36
+ `.claude/rules/` is split into two tiers — see `.claude/rules/README.md`:
41
37
 
42
- ## 3. Orca orchestration protocol
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`.
43
40
 
44
- You receive work as a dispatched task carrying an injected `task_id` and `dispatch_id`. Never
45
- invent, guess, or reuse stale IDs. You are a worker: you do not dispatch sub-workers.
41
+ The code examples in the rules are illustrative and do not authorize adding a technology the
42
+ project does not have. Adding or replacing a language, framework, package manager or test tool is a
43
+ **user decision**.
46
44
 
47
- Report completion **exactly once**:
45
+ ### Commands
48
46
 
49
- ```bash
50
- orca orchestration send --type worker_done \
51
- --subject "<short status>" \
52
- --body "<what you did, what you found, what remains>" \
53
- --task-id <task_id> --dispatch-id <dispatch_id> \
54
- --outcome succeeded --files-modified "path/a,path/b" --json
55
- ```
47
+ The single source of truth for how to build, test and lint. Agents run exactly what is listed here;
48
+ if the one you need is missing, ask instead of guessing. Never report a validation as passing when
49
+ its command does not exist or was not executed.
50
+
51
+ | Purpose | Command |
52
+ |---|---|
53
+ | Install | `{{CMD_INSTALL}}` |
54
+ | Build | `{{CMD_BUILD}}` |
55
+ | Test | `{{CMD_TEST}}` |
56
+ | Lint | `{{CMD_LINT}}` |
57
+ | Single test | `{{CMD_TEST_ONE}}` |
58
+ <!--END-->
59
+
60
+ Design decisions and their rejected alternatives belong in `docs/adr/`, and the domain glossary in
61
+ `CONTEXT.md`, once they exist. Read both before planning or implementing: they explain why the
62
+ code looks the way it does.
63
+
64
+ ## Environment pitfalls
56
65
 
57
- - Encode failure with `--outcome failed`. Never signal failure in prose alone, and never exit
58
- silently.
59
- - Blocking question to the coordinator:
60
- `orca orchestration ask --question "<q>" --options "<a,b>" --timeout-ms 600000`.
61
- Never use an interactive local prompt — the coordinator cannot see or answer it.
62
- - Blocked before completion: `--type escalation`.
63
- - Long runs: `--type heartbeat` every 5 minutes, or `--type status` for progress.
64
- - Read coordinator messages with `orca orchestration check --terminal <your handle>`.
66
+ Facts about this machine and toolchain that cost a debugging session once. Keep them short; the
67
+ `/fechar-ciclo` command adds to this list.
65
68
 
66
- After `worker_done`, your turn is over. Stop, return to an idle prompt, and start nothing new.
67
- Do not exit the shell — the coordinator reviews your work and then closes this terminal itself.
69
+ - (none yet)
68
70
 
69
71
  ---
70
72
 
71
- ## 4. Stack constraints
73
+ ## Engineering rules
72
74
 
73
- <!--IF:greenfield-->
74
- The stack is **not chosen**. This repository has no source code, no package manager, no dependency
75
- manifest, no build system, no test suite, and no CI.
75
+ These bias toward caution over speed. For trivial tasks, use judgment.
76
76
 
77
- Hard rules:
77
+ ### Think before acting
78
78
 
79
- - Do not pick the language, framework, package manager, directory layout, or test tooling.
80
- - Do not scaffold a project structure on your own initiative.
81
- - Do not run or claim to have run a command that does not exist yet.
79
+ Do not assume, do not hide confusion, surface tradeoffs. State assumptions explicitly; if multiple
80
+ interpretations exist, present them instead of silently picking one. If something is unclear, ask.
82
81
 
83
- If a task cannot proceed without one of those decisions, send an `ask` or an `escalation`. Never
84
- assume a default.
85
- <!--END-->
86
- <!--IF:existing-->
87
- This project already has a stack. The commands table in `CLAUDE.md` is the single source of truth
88
- for how to build, test and lint it.
82
+ ### Simplicity first
89
83
 
90
- Hard rules:
84
+ Minimum code that solves the problem, nothing speculative. No features beyond what was asked, no
85
+ abstractions for single-use code, no unrequested configurability, no error handling for impossible
86
+ scenarios. Simplicity governs **how** each item is implemented, never **whether** it is
87
+ implemented. Cutting scope is not simplification.
91
88
 
92
- - Use only the commands listed in `CLAUDE.md`. If the one you need is missing there, ask — do not
93
- guess an invocation.
94
- - Do not add, replace or upgrade a language, framework, package manager or test tool. That is a
95
- user decision, even when it looks like the obvious fix.
96
- - Do not introduce a new dependency unless the brief names it.
97
- - Do not run or claim to have run a command that does not exist or that you did not execute.
89
+ ### Surgical changes
98
90
 
99
- If a task cannot proceed without one of those decisions, send an `ask` or an `escalation`. Never
100
- assume a default.
101
- <!--END-->
91
+ Touch only what the task requires. Do not improve adjacent code, comments, or formatting. Do not
92
+ refactor what is not broken. Match existing style. Mention unrelated dead code instead of deleting
93
+ it. Remove only the imports and symbols your own change orphaned.
102
94
 
103
- `.claude/rules/README.md` says which rule files always apply and which only apply when the matching
104
- technology is part of the project. The code examples in the rules are illustrative, not a stack
105
- mandate.
95
+ ### Goal-driven execution
106
96
 
107
- ---
97
+ Turn every task into a verifiable goal before starting: "add validation" becomes "write tests for
98
+ invalid inputs, then make them pass". Weak success criteria ("make it work") guarantee rework.
108
99
 
109
- ## 5. Development workflow
100
+ ### The spec is the request
110
101
 
111
- 1. Read `CLAUDE.md`, this file, and the applicable `.claude/rules/` files.
112
- 2. Read the brief in full: objective, context, constraints, files involved, acceptance criteria,
113
- validation.
114
- 3. Work **only** inside the files the brief names. Touch nothing else.
115
- 4. Prefer small, reviewable diffs. Match the existing style.
116
- 5. Run the validation the brief specifies and observe the real output.
117
- 6. Report honestly — including what you did not do and why.
102
+ A PRD, TechSpec, or task file is a contract. Every item gets implemented. Never silently drop,
103
+ defer, merge, or "phase" items; if one looks unnecessary, ask before skipping. Before declaring a
104
+ multi-item task done, enumerate every item and its status:
118
105
 
119
- Never commit, push, stage, or switch branches. The coordinator reviews the working tree as-is.
106
+ ```
107
+ - [Item 1] -> done
108
+ - [Item 2] -> partial - what is missing and why
109
+ - [Item 3] -> skipped - reason, surfaced earlier
110
+ ```
120
111
 
121
- ---
112
+ ### Honesty about validation
122
113
 
123
- ## 6. Engineering rules
114
+ Never fabricate command output, test results, file paths, or dependencies. A validation counts only
115
+ when its output was observed in this session. Missing output means it did not run.
124
116
 
125
- The full set is in `CLAUDE.md` section 6 and `.claude/rules/`. The ones that most often go wrong:
117
+ ### Language
126
118
 
127
- - **Simplicity first** — minimum code that solves the problem. No speculative features,
128
- abstractions for single-use code, or unrequested configurability. Simplicity governs *how* you
129
- implement each item, never *whether* you implement it.
130
- - **Surgical changes** — do not improve adjacent code, comments, or formatting. Do not refactor
131
- what is not broken. Remove only the symbols your own change orphaned; mention other dead code
132
- instead of deleting it.
133
- - **The spec is the request** — implement every item in the brief. Never silently drop, defer, or
134
- merge items. Ambiguity is a question, not a licence to omit.
135
- - **Language** — code, identifiers, and comments in English; process documents
136
- (`prd.md`, `techspec.md`, `tasks.md`, `bugs.md`) in Portuguese.
137
- - **Comments** — prefer self-explanatory code. Comment only when the *why* is non-obvious.
119
+ - **English:** source code, identifiers, comments, commit messages, PR descriptions, `AGENTS.md`,
120
+ `CLAUDE.md`, `docs/agents/`.
121
+ - **Portuguese:** `.claude/commands/`, `.claude/templates/`, `.claude/rules/`, and every generated
122
+ process document (`prd.md`, `techspec.md`, `tasks.md`, `*_task.md`, `bugs.md`).
123
+ - Conversation with the user follows the user's language.
138
124
 
139
- ---
125
+ ### Comments
126
+
127
+ Prefer self-explanatory code. No restating what the code does, no TODOs, no section headers, no
128
+ "added for X" notes. Comment only when the *why* is non-obvious.
140
129
 
141
- ## 7. Definition of done
130
+ ### Commits
142
131
 
143
- A task is done only when all of the following hold:
132
+ - [Conventional Commits](https://www.conventionalcommits.org/): `type(scope): subject`, imperative,
133
+ lowercase, no trailing period.
134
+ - **Never add `Co-Authored-By:` trailers or any assistant attribution.**
135
+ - Only the orchestrator commits, and only when the user asks.
144
136
 
145
- - Every acceptance criterion in the brief is met.
146
- - Every item in the brief is implemented, or explicitly reported as partial or skipped with a
147
- reason.
148
- - The specified validation was actually executed and its output observed.
149
- - No unrequested scope was added and no unrelated file was touched.
150
- - Nothing is fabricated: no invented command output, test result, file path, or dependency.
137
+ ### Code quality
151
138
 
152
- Then, and only then, send `worker_done`.
139
+ Keep functions small and well under the complexity ceiling, modules focused, dependencies pointing
140
+ toward stable abstractions with no cycles. Tests cover the branches that can break, and their
141
+ assertions would fail if the logic were subtly wrong (`>` to `>=`, a flipped sign, a deleted line).
153
142
 
154
143
  ---
155
144
 
156
- ## 8. Maintenance
145
+ ## Maintaining this file
157
146
 
158
- Update this file whenever the stack lands or the worker protocol changes, in the same pass as
159
- `CLAUDE.md` and `.claude/rules/README.md`.
147
+ Generated by `agent-kit` as a starting point. Keep it true to what the project is: exact commands,
148
+ non-obvious relationships between modules, conventions a newcomer could not infer from one file.
149
+ Keep it under ~200 lines; move topic-specific rules into `.claude/rules/`.