multi-agents-cli 1.0.55 → 1.0.57
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 +114 -107
- package/init.js +37 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# multi-agents-cli
|
|
2
2
|
|
|
3
3
|
A structured workflow tool that orchestrates multiple Claude Code agents working in parallel - each isolated in its own git worktree, owning a specific scope of the codebase.
|
|
4
4
|
|
|
@@ -26,12 +26,11 @@ npm run agent
|
|
|
26
26
|
|
|
27
27
|
`multi-agents init` will:
|
|
28
28
|
- Guide you through project name, stack, IDE, and build trajectory using arrow-key selection
|
|
29
|
-
-
|
|
30
|
-
- Generate `
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
- Set up git remote handling (first agent session handles this automatically)
|
|
29
|
+
- Generate `BUILD_STATE.md`, `CONTRACTS.md`, `CLAUDE.md`, `CLOUD_STATE.md`
|
|
30
|
+
- Generate `shared/wiring.config.json` with client/backend env var conventions
|
|
31
|
+
- Write `.scaffold/.config.json`, `.scaffold/.tracking.json`, `.scaffold/scope-policy.json`
|
|
32
|
+
- Copy agent instruction files and framework scaffold guides from the bundled `core/`
|
|
33
|
+
- Initialize git, install pre-commit hook, and create the initial commit
|
|
35
34
|
|
|
36
35
|
---
|
|
37
36
|
|
|
@@ -39,11 +38,13 @@ npm run agent
|
|
|
39
38
|
|
|
40
39
|
| Command | Purpose |
|
|
41
40
|
|---------|---------|
|
|
42
|
-
| `npm run init` | Re-run initialization or restart a process |
|
|
43
41
|
| `npm run agent` | Start a new task with an agent |
|
|
44
|
-
| `npm run complete` |
|
|
42
|
+
| `npm run complete` | Merge agent work into main and update project state |
|
|
43
|
+
| `npm run restart` | Wipe and relaunch a specific agent |
|
|
44
|
+
| `npm run reset` | Nuclear wipe - removes all worktrees and resets project state |
|
|
45
|
+
| `npm run init` | Re-run initialization (locked after first run) |
|
|
45
46
|
|
|
46
|
-
All
|
|
47
|
+
All commands self-relocate to the repo root via `git rev-parse --git-common-dir`. Run them from the worktree terminal, the repo root, or anywhere inside the git tree.
|
|
47
48
|
|
|
48
49
|
---
|
|
49
50
|
|
|
@@ -55,19 +56,22 @@ All three commands self-relocate to the repo root via `git rev-parse --git-commo
|
|
|
55
56
|
npm run agent
|
|
56
57
|
```
|
|
57
58
|
|
|
58
|
-
Select scope (client/backend/shared) then agent then describe the task.
|
|
59
|
-
The workspace opens in your IDE automatically.
|
|
59
|
+
Select scope (client / backend / shared), then agent, then describe the task.
|
|
60
|
+
The workspace opens in your IDE and Claude Code CLI launches automatically.
|
|
60
61
|
|
|
61
62
|
The agent reads `TASK.md` and executes autonomously.
|
|
62
63
|
|
|
63
|
-
### 2.
|
|
64
|
+
### 2. Complete a task
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
```bash
|
|
67
|
+
npm run complete
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Validates scope boundaries via `git diff`, merges the branch into main, updates `BUILD_STATE.md` and `TASKS_HISTORY.md`, and clears the tracking slot.
|
|
67
71
|
|
|
68
72
|
### 3. Repeat
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
Pick the next agent and continue building.
|
|
71
75
|
|
|
72
76
|
---
|
|
73
77
|
|
|
@@ -77,11 +81,9 @@ Choose during `multi-agents init`:
|
|
|
77
81
|
|
|
78
82
|
**Multi-Agent Driven Orchestration** *(recommended)*
|
|
79
83
|
Every task starts with `npm run agent`. Each agent works in its own git worktree - an isolated branch and folder that merges back into main via `npm run complete`. Faster builds and lower token spend than a single long session.
|
|
80
|
-
If you commit directly to main yourself, you bypass the framework and break task tracking for any active agent branches.
|
|
81
84
|
|
|
82
85
|
**Shared Orchestration**
|
|
83
86
|
You and agents co-build - each owning a defined part of the codebase. Agent tasks run in git worktrees; your work happens directly in the project. Define boundaries before work begins.
|
|
84
|
-
If you and an agent touch the same file, expect merge conflicts.
|
|
85
87
|
|
|
86
88
|
---
|
|
87
89
|
|
|
@@ -103,7 +105,7 @@ Each framework has a dedicated scaffold instruction file in `.frameworks/client/
|
|
|
103
105
|
|
|
104
106
|
| Agent | Default task | Requires |
|
|
105
107
|
|-------|-------------|---------|
|
|
106
|
-
| `UI` | Scaffolds full project structure | - |
|
|
108
|
+
| `UI` | Scaffolds full project structure + client wiring config | - |
|
|
107
109
|
| `LOGIC` | State management, API integration, hooks | UI done |
|
|
108
110
|
| `FORMS` | Form components, validation, submission | UI done |
|
|
109
111
|
| `ROUTING` | Page routing, navigation, URL structure | UI done |
|
|
@@ -114,35 +116,78 @@ Each framework has a dedicated scaffold instruction file in `.frameworks/client/
|
|
|
114
116
|
|
|
115
117
|
| Agent | Default task | Requires |
|
|
116
118
|
|-------|-------------|---------|
|
|
117
|
-
| `
|
|
119
|
+
| `INIT` | Scaffolds backend structure, wiring config, CONTRACTS.md | - |
|
|
120
|
+
| `API` | REST/GraphQL endpoint implementation | INIT done |
|
|
118
121
|
| `LOGIC` | Business logic, services, data processing | API done |
|
|
119
122
|
| `AUTH` | Authentication, authorization, sessions | API done |
|
|
120
|
-
| `DB` | Database schemas, migrations, queries |
|
|
123
|
+
| `DB` | Database schemas, migrations, queries | INIT done |
|
|
121
124
|
| `EVENTS` | Event queues, pub/sub, webhooks | API done |
|
|
122
125
|
| `JOBS` | Background jobs, scheduled tasks | API done |
|
|
123
126
|
| `TESTING` | API and integration tests | API done |
|
|
124
127
|
|
|
125
128
|
### Shared
|
|
126
129
|
|
|
127
|
-
| Agent | Default task |
|
|
128
|
-
|
|
129
|
-
| `
|
|
130
|
+
| Agent | Default task | Requires |
|
|
131
|
+
|-------|-------------|---------|
|
|
132
|
+
| `CLOUD` | Deployment config, CI/CD, environment wiring | Client + backend done |
|
|
133
|
+
| `SECURITY` | Shared auth utilities, encryption, validation | - |
|
|
130
134
|
|
|
131
|
-
Start with UI (client) or
|
|
135
|
+
Start with `UI` (client) or `INIT` (backend). The launcher recommends the correct next agent dynamically based on what is already completed.
|
|
132
136
|
|
|
133
137
|
---
|
|
134
138
|
|
|
135
|
-
##
|
|
139
|
+
## Scope Validation
|
|
136
140
|
|
|
137
|
-
|
|
141
|
+
Every agent merge is validated before it touches main.
|
|
138
142
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
When a worktree is created, `agent.js` writes a `scope.json` file declaring the agent's identity and policy. When `npm run complete` runs, it:
|
|
144
|
+
|
|
145
|
+
1. Reads `scope.json` from the worktree
|
|
146
|
+
2. Loads `.scaffold/scope-policy.json` (written at init time)
|
|
147
|
+
3. Runs `git diff --name-only main...HEAD` to get every changed file
|
|
148
|
+
4. Blocks the merge if any file falls outside the allowed paths for that scope
|
|
149
|
+
|
|
150
|
+
**Policy summary:**
|
|
151
|
+
|
|
152
|
+
| Scope | Allowed | Blocked |
|
|
153
|
+
|-------|---------|---------|
|
|
154
|
+
| client | `client/**` | `backend/**`, `shared/**`, `CONTRACTS.md` |
|
|
155
|
+
| client/UI (scaffold only) | `client/**`, `shared/wiring.config.json` | `backend/**`, `CONTRACTS.md` |
|
|
156
|
+
| backend | `backend/**` | `client/**`, `shared/**`, `CONTRACTS.md` |
|
|
157
|
+
| backend/INIT (scaffold only) | `backend/**`, `shared/wiring.config.json`, `CONTRACTS.md` | `client/**` |
|
|
158
|
+
| shared/CLOUD | deployment files only | `client/**`, `backend/**`, `CONTRACTS.md` |
|
|
159
|
+
|
|
160
|
+
Scaffold-only overrides expire automatically after the first successful merge for that scope.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Wiring Config
|
|
165
|
+
|
|
166
|
+
`shared/wiring.config.json` is the client-backend interface contract for environment variables. It contains conventional variable names only - no values, no ports.
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"client": {
|
|
171
|
+
"apiBaseUrlVar": "API_BASE_URL",
|
|
172
|
+
"environments": {
|
|
173
|
+
"development": {},
|
|
174
|
+
"staging": {},
|
|
175
|
+
"production": {}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"backend": {
|
|
179
|
+
"portVar": "PORT",
|
|
180
|
+
"corsOriginVar": "CORS_ORIGIN",
|
|
181
|
+
"environments": {
|
|
182
|
+
"development": {},
|
|
183
|
+
"staging": {},
|
|
184
|
+
"production": {}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
143
188
|
```
|
|
144
189
|
|
|
145
|
-
|
|
190
|
+
The `UI` agent populates the client section on first scaffold. The `INIT` agent populates the backend section. The `CLOUD` agent reads both sections to wire per-environment values correctly.
|
|
146
191
|
|
|
147
192
|
---
|
|
148
193
|
|
|
@@ -155,8 +200,6 @@ For deployment set the root directory to `client/` - not the repo root.
|
|
|
155
200
|
3. Auto-clears old sessions or surfaces a decision when unfinished work is detected
|
|
156
201
|
4. If no remote - opens your browser to `github.com/new` with the repo name pre-filled
|
|
157
202
|
|
|
158
|
-
No manual `git remote add` needed.
|
|
159
|
-
|
|
160
203
|
---
|
|
161
204
|
|
|
162
205
|
## Key Files
|
|
@@ -166,44 +209,57 @@ No manual `git remote add` needed.
|
|
|
166
209
|
| `CLAUDE.md` | Global coordination rules - every agent reads this first |
|
|
167
210
|
| `BUILD_STATE.md` | Living project state - what is built, what is next |
|
|
168
211
|
| `CONTRACTS.md` | Shared types and interfaces - single source of truth |
|
|
212
|
+
| `TASKS_HISTORY.md` | Full audit trail of all agent sessions |
|
|
213
|
+
| `CLOUD_STATE.md` | Cloud deployment state and prereq checklist |
|
|
214
|
+
| `shared/wiring.config.json` | Client-backend env var name conventions |
|
|
169
215
|
| `TASK.md` | Per-task instructions - lives in the agent worktree |
|
|
170
216
|
| `.scaffold/.config.json` | Project config written at init time |
|
|
171
217
|
| `.scaffold/.tracking.json` | Active agent state - managed by workflow scripts |
|
|
172
|
-
| `.scaffold
|
|
218
|
+
| `.scaffold/scope-policy.json` | Allowed/blocked path rules per scope and agent |
|
|
173
219
|
|
|
174
|
-
Never edit `BUILD_STATE.md`
|
|
220
|
+
Never edit `BUILD_STATE.md` or `TASKS_HISTORY.md` directly. Workflow scripts own all updates.
|
|
175
221
|
|
|
176
222
|
---
|
|
177
223
|
|
|
178
|
-
##
|
|
179
|
-
|
|
180
|
-
Context loads in this order for every agent:
|
|
224
|
+
## Guard System
|
|
181
225
|
|
|
182
|
-
|
|
183
|
-
Root CLAUDE.md <- global rules, protocols, tracking schema
|
|
184
|
-
|
|
|
185
|
-
client/CLAUDE.md <- stack config, framework scaffold instructions
|
|
186
|
-
|
|
|
187
|
-
.frameworks/client/{fw}.md <- exact scaffold commands and path conventions
|
|
188
|
-
|
|
|
189
|
-
.agents/client/UI.md <- agent-specific behavior and constraints
|
|
190
|
-
|
|
|
191
|
-
TASK.md <- the specific task to execute
|
|
192
|
-
```
|
|
226
|
+
The launcher enforces structural rules before any worktree is created:
|
|
193
227
|
|
|
194
|
-
|
|
228
|
+
- **Skeleton guard** - LOGIC/FORMS/ROUTING/TESTING require UI completed first (client), API requires INIT completed first (backend)
|
|
229
|
+
- **Prerequisite check** - surfaces unmet dependencies, lets you proceed or repick
|
|
230
|
+
- **Active agent gate** - if the same agent is already running, offers Resume / Restart / Cancel with cascade warnings
|
|
231
|
+
- **MISSING gate** - if a worktree was deleted without completing, mandatory Recover or Reset decision
|
|
232
|
+
- **CLOUD gate** - CLOUD agent is only selectable when client and/or backend prerequisites are met, shows readiness table
|
|
195
233
|
|
|
196
234
|
---
|
|
197
235
|
|
|
198
|
-
##
|
|
236
|
+
## Architecture
|
|
199
237
|
|
|
200
|
-
|
|
238
|
+
```
|
|
239
|
+
my-project/
|
|
240
|
+
├── .agents/ <- agent instruction files (bundled in core/)
|
|
241
|
+
│ ├── client/ <- UI.md, LOGIC.md, FORMS.md, ROUTING.md, TESTING.md, ACCESSIBILITY.md
|
|
242
|
+
│ ├── backend/ <- INIT.md, API.md, DB.md, AUTH.md, LOGIC.md, EVENTS.md, JOBS.md, TESTING.md
|
|
243
|
+
│ └── shared/ <- CLOUD.md, SECURITY.md, CLOUD_TEARDOWN.md
|
|
244
|
+
├── .frameworks/ <- framework scaffold instructions (bundled in core/)
|
|
245
|
+
│ ├── client/ <- nextjs.md, angular.md, vite-react.md, nuxt.md, sveltekit.md, remix.md
|
|
246
|
+
│ └── backend/ <- express.md, nestjs.md, fastify.md, fastapi.md, django.md
|
|
247
|
+
├── .workflow/ <- workflow scripts (agent.js, complete.js, guards.js, reset.js, restart.js)
|
|
248
|
+
├── .scaffold/ <- runtime state (.config.json, .tracking.json, scope-policy.json, .initialized)
|
|
249
|
+
├── client/ <- built by client agents
|
|
250
|
+
├── backend/ <- built by backend agents (if separate)
|
|
251
|
+
├── shared/
|
|
252
|
+
│ └── wiring.config.json <- client-backend env var conventions
|
|
253
|
+
├── worktrees/ <- local only, gitignored
|
|
254
|
+
├── CLAUDE.md
|
|
255
|
+
├── BUILD_STATE.md
|
|
256
|
+
├── CONTRACTS.md
|
|
257
|
+
├── TASKS_HISTORY.md
|
|
258
|
+
└── CLOUD_STATE.md
|
|
259
|
+
```
|
|
201
260
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
- **Active agent gate** - if the same agent is already running, offers Continue / Complete / Abandon / Pick again
|
|
205
|
-
- **MISSING gate** - if a worktree was deleted without completing, mandatory Recover or Reset decision
|
|
206
|
-
- **Coexistence check** - if recovering, surfaces file conflicts and divergence before restoring
|
|
261
|
+
Each agent works in its own `worktrees/` folder on a dedicated branch.
|
|
262
|
+
On completion, scope is validated and work merges into `main`. The final `main` branch is a complete, runnable application.
|
|
207
263
|
|
|
208
264
|
---
|
|
209
265
|
|
|
@@ -228,52 +284,3 @@ The launcher enforces structural rules before any worktree is created:
|
|
|
228
284
|
**Status values:** `null` (never launched) - `ACTIVE` (running) - `MISSING` (worktree deleted without completing)
|
|
229
285
|
|
|
230
286
|
Managed entirely by `agent.js` and `complete.js`. Never edit manually.
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Path Tracking
|
|
235
|
-
|
|
236
|
-
`.scaffold/.paths.json` maps expected and actual framework paths:
|
|
237
|
-
|
|
238
|
-
```json
|
|
239
|
-
{
|
|
240
|
-
"client": {
|
|
241
|
-
"typesDir": {
|
|
242
|
-
"expected": "client/src/types",
|
|
243
|
-
"current": null,
|
|
244
|
-
"status": "pending"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
**Status values:** `pending` (not yet scaffolded) - `verified` (agent confirmed path) - `diverged` (actual path differs from expected)
|
|
251
|
-
|
|
252
|
-
Written at init time. Updated by agents after scaffolding their framework.
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## Architecture
|
|
257
|
-
|
|
258
|
-
```
|
|
259
|
-
my-project/
|
|
260
|
-
├── .agents/ <- agent instruction files
|
|
261
|
-
│ ├── client/ <- UI.md, LOGIC.md, FORMS.md ...
|
|
262
|
-
│ ├── backend/ <- API.md, DB.md, AUTH.md ...
|
|
263
|
-
│ └── shared/ <- SECURITY.md
|
|
264
|
-
├── .frameworks/ <- framework scaffold instructions
|
|
265
|
-
│ ├── client/ <- nextjs.md, angular.md ...
|
|
266
|
-
│ └── backend/ <- express.md, fastapi.md ...
|
|
267
|
-
├── .workflow/ <- workflow scripts (agent.js, complete.js, guards.js)
|
|
268
|
-
├── .scaffold/ <- runtime state (config, tracking, paths, lock)
|
|
269
|
-
├── client/ <- built by client agents
|
|
270
|
-
├── backend/ <- built by backend agents (if separate)
|
|
271
|
-
├── shared/
|
|
272
|
-
├── worktrees/ <- local only, gitignored
|
|
273
|
-
├── CLAUDE.md
|
|
274
|
-
├── BUILD_STATE.md
|
|
275
|
-
└── CONTRACTS.md
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
Each agent works in its own `worktrees/` folder on a dedicated branch.
|
|
279
|
-
On completion, its work merges into `main`. The final `main` branch is a complete, runnable application.
|
package/init.js
CHANGED
|
@@ -1550,8 +1550,43 @@ fi
|
|
|
1550
1550
|
|
|
1551
1551
|
if (selected.next === 'launch') {
|
|
1552
1552
|
separator();
|
|
1553
|
-
console.log(`\n
|
|
1554
|
-
|
|
1553
|
+
console.log(`\n${bold(green(' Project initialized successfully!'))}\n`);
|
|
1554
|
+
|
|
1555
|
+
// ── Summary block ─────────────────────────────────────────────────────────
|
|
1556
|
+
const bt = config.backend?.type;
|
|
1557
|
+
|
|
1558
|
+
console.log(` ${dim('Project')} : ${bold(projectName)}`);
|
|
1559
|
+
console.log(` ${dim('Client')} : ${config.client.framework} / ${config.client.language}${config.client.uiLibrary ? ' / ' + config.client.uiLibrary : ''}`);
|
|
1560
|
+
if (bt === 'separate') {
|
|
1561
|
+
console.log(` ${dim('Backend')} : ${config.backend.framework} / ${config.backend.language}${config.backend.orm ? ' / ' + config.backend.orm : ''}`);
|
|
1562
|
+
} else {
|
|
1563
|
+
console.log(` ${dim('Backend')} : integrated (API routes / SSR)`);
|
|
1564
|
+
}
|
|
1565
|
+
console.log(` ${dim('Workflow')} : ${selected.label}\n`);
|
|
1566
|
+
|
|
1567
|
+
console.log(` ${dim('Files generated:')}`);
|
|
1568
|
+
console.log(` ${green('+')} CLAUDE.md, client/CLAUDE.md${bt === 'separate' ? ', backend/CLAUDE.md' : ''}`);
|
|
1569
|
+
console.log(` ${green('+')} BUILD_STATE.md, TASKS_HISTORY.md, CONTRACTS.md`);
|
|
1570
|
+
console.log(` ${green('+')} CLOUD_STATE.md, shared/wiring.config.json`);
|
|
1571
|
+
console.log(` ${green('+')} .scaffold/.config.json, .scaffold/scope-policy.json`);
|
|
1572
|
+
console.log(` ${green('+')} .agents/, .frameworks/, .workflow/\n`);
|
|
1573
|
+
|
|
1574
|
+
console.log(` ${dim('Git:')}`);
|
|
1575
|
+
console.log(` ${green('+')} Repository initialized on main`);
|
|
1576
|
+
console.log(` ${green('+')} Pre-commit hook installed (direct main commits blocked)`);
|
|
1577
|
+
console.log(` ${green('+')} Initial commit created\n`);
|
|
1578
|
+
|
|
1579
|
+
console.log(` ${dim('Agents available:')}`);
|
|
1580
|
+
console.log(` ${dim('client')} : UI, LOGIC, FORMS, ROUTING, ACCESSIBILITY, TESTING`);
|
|
1581
|
+
if (bt === 'separate') {
|
|
1582
|
+
console.log(` ${dim('backend')} : INIT, API, AUTH, DB, LOGIC, EVENTS, JOBS, TESTING`);
|
|
1583
|
+
}
|
|
1584
|
+
console.log(` ${dim('shared')} : CLOUD, SECURITY\n`);
|
|
1585
|
+
|
|
1586
|
+
console.log(` ${dim('Next step:')}`);
|
|
1587
|
+
console.log(` ${cyan('npm run agent')} ${dim('- start your first task')}\n`);
|
|
1588
|
+
separator();
|
|
1589
|
+
console.log('');
|
|
1555
1590
|
rl.close();
|
|
1556
1591
|
return;
|
|
1557
1592
|
}
|
package/package.json
CHANGED