multi-agents-cli 1.1.1 → 1.1.3

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.
@@ -296,6 +296,37 @@ Only flag for clarification if the task remains genuinely ambiguous AFTER readin
296
296
  - "build the ui" with no @config set → framework unknown, cannot proceed
297
297
  - "add a component" with no description → which component, what purpose
298
298
  - Any task touching another agent's domain → flag and redirect
299
+ ## Output Verification Rule
300
+
301
+ Every agent must verify its output is functional before marking the task complete.
302
+ A task is not done until the output has been verified — not just written.
303
+
304
+ Verification is scope-specific:
305
+
306
+ | Scope | Agent | Verification |
307
+ |-------|-------|-------------|
308
+ | client | UI | `npm install && npm run dev` starts without errors from `client/` |
309
+ | client | LOGIC | `tsc --noEmit` passes with no new errors introduced |
310
+ | client | FORMS | `tsc --noEmit` passes with no new errors introduced |
311
+ | client | ROUTING | `npm run dev` starts and all defined routes resolve |
312
+ | client | TESTING | Test suite runs and all new tests pass |
313
+ | client | ACCESSIBILITY | a11y audit passes on all modified components |
314
+ | backend | INIT | Server starts without errors from `backend/` |
315
+ | backend | API | All defined endpoints respond with expected status codes |
316
+ | backend | AUTH | Auth flow completes without errors |
317
+ | backend | DB | Migrations run cleanly, schema matches entities |
318
+ | backend | LOGIC | Unit tests pass for all new business logic |
319
+ | backend | EVENTS | Event handlers register and fire without errors |
320
+ | backend | JOBS | Jobs register and execute without errors |
321
+ | shared | SECURITY | All security checks pass with no critical findings |
322
+
323
+ If verification fails:
324
+ 1. Fix the issue before marking complete — do not defer to another agent
325
+ 2. If the failure is caused by another agent's code, surface it explicitly before proceeding
326
+ 3. Never mark `[x] COMPLETED` in TASK.md until verification passes
327
+
328
+ ---
329
+
299
330
  ## Tracking Protocol
300
331
 
301
332
  Every agent reads `.scaffold/.tracking.json` at session start.
@@ -395,21 +395,21 @@ const main = async () => {
395
395
 
396
396
  try {
397
397
  const CLIENT_START = {
398
- 'Next.js': 'npm run dev',
399
- 'Nuxt': 'npm run dev',
400
- 'SvelteKit': 'npm run dev',
401
- 'Remix': 'npm run dev',
402
- 'Vite+React': 'npm run dev',
403
- 'Angular': 'npx ng serve',
398
+ 'Next.js': 'cd client && npm install && npm run dev',
399
+ 'Nuxt': 'cd client && npm install && npm run dev',
400
+ 'SvelteKit': 'cd client && npm install && npm run dev',
401
+ 'Remix': 'cd client && npm install && npm run dev',
402
+ 'Vite+React': 'cd client && npm install && npm run dev',
403
+ 'Angular': 'cd client && npm install && npx ng serve',
404
404
  };
405
405
  const BACKEND_START = {
406
- 'NestJS': 'npm run start:dev',
407
- 'Express': 'npm run dev',
408
- 'Fastify': 'npm run dev',
409
- 'Django': 'python manage.py runserver',
410
- 'FastAPI': 'uvicorn main:app --reload',
411
- 'Laravel': 'php artisan serve',
412
- 'Rails': 'bin/rails server',
406
+ 'NestJS': 'cd backend && npm install && npm run start:dev',
407
+ 'Express': 'cd backend && npm install && npm run dev',
408
+ 'Fastify': 'cd backend && npm install && npm run dev',
409
+ 'Django': 'cd backend && pip install -r requirements.txt && python manage.py runserver',
410
+ 'FastAPI': 'cd backend && pip install -r requirements.txt && uvicorn main:app --reload',
411
+ 'Laravel': 'cd backend && composer install && php artisan serve',
412
+ 'Rails': 'cd backend && bundle install && bin/rails server',
413
413
  };
414
414
 
415
415
  const pkgPath = path.join(ROOT, 'package.json');
@@ -418,10 +418,11 @@ const main = async () => {
418
418
  if (!pkg.scripts) pkg.scripts = {};
419
419
 
420
420
  const parts = branchName.split('/');
421
- const mergedScope = parts.length >= 4 ? parts[1] : null;
422
- const mergedAgent = parts.length >= 4 ? parts[2].toUpperCase() : null;
421
+ const _t = guards.loadTracking(ROOT, config);
422
+ const uiDone = _t?.client?.UI?.status === 'COMPLETED';
423
+ const initDone = _t?.backend?.INIT?.status === 'COMPLETED';
423
424
 
424
- if (mergedScope === 'client' && mergedAgent === 'UI') {
425
+ if (uiDone) {
425
426
  const fw = config.client && config.client.framework;
426
427
  const cmd = CLIENT_START[fw];
427
428
  if (cmd && !pkg.scripts['start:client']) {
@@ -431,7 +432,7 @@ const main = async () => {
431
432
  }
432
433
  }
433
434
 
434
- if (mergedScope === 'backend' && mergedAgent === 'INIT') {
435
+ if (initDone) {
435
436
  const fw = config.backend && config.backend.framework;
436
437
  const cmd = BACKEND_START[fw];
437
438
  if (cmd && !pkg.scripts['start:backend']) {
@@ -69,6 +69,7 @@ const main = async () => {
69
69
 
70
70
  // ── Load config and tracking ─────────────────────────────────────────────────
71
71
 
72
+ const confirmed = process.argv.includes('--confirmed');
72
73
  const config = fs.existsSync(CONFIG_PATH) ? JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')) : {};
73
74
  const tracking = fs.existsSync(TRACKING_PATH) ? JSON.parse(fs.readFileSync(TRACKING_PATH, 'utf8')) : {};
74
75
  const projectName = config.projectName || path.basename(ROOT);
@@ -89,11 +90,12 @@ const main = async () => {
89
90
 
90
91
  let remoteUrl = null;
91
92
  try {
92
- remoteUrl = execSync('git remote get-url origin', { cwd: ROOT, encoding: 'utf8' }).trim();
93
+ remoteUrl = execSync('git remote get-url origin', { cwd: ROOT, encoding: 'utf8', stdio: 'pipe' }).trim();
93
94
  } catch {}
94
95
 
95
96
  // ── Display warning ───────────────────────────────────────────────────────────
96
97
 
98
+ if (!confirmed) {
97
99
  separator();
98
100
  console.log(`${red(bold(' ⚠ FULL PROJECT RESET'))}\n`);
99
101
  console.log(` ${bold('This will permanently delete:')}\n`);
@@ -169,6 +171,8 @@ const main = async () => {
169
171
  process.exit(1);
170
172
  }
171
173
 
174
+ } // end if (!confirmed)
175
+
172
176
  // ── Execute wipe ──────────────────────────────────────────────────────────────
173
177
 
174
178
  separator();
@@ -229,12 +233,25 @@ const main = async () => {
229
233
  console.log(` ${green('✓')} Git history removed`);
230
234
  } catch {}
231
235
 
236
+ // ── Re-plant package.json ────────────────────────────────────────────
237
+
238
+ try {
239
+ const freshPkg = {
240
+ name: projectName.toLowerCase().replace(/\s+/g, '-'),
241
+ version: '1.0.0',
242
+ scripts: { init: 'multi-agents init' },
243
+ };
244
+ fs.writeFileSync(path.join(ROOT, 'package.json'), JSON.stringify(freshPkg, null, 2) + '\n', 'utf8');
245
+ console.log(' ' + green('\u2713') + ' package.json re-planted');
246
+ } catch { /* best-effort */ }
247
+
232
248
  // ── Post-wipe instructions ────────────────────────────────────────────────────
233
249
 
234
250
  separator();
235
251
  console.log(`${green(bold(' Project wiped successfully.'))}\n`);
236
- console.log(` To start fresh:\n`);
237
- console.log(` ${cyan(`cd .. && multi-agents init ${projectName}`)}\n`);
252
+ console.log(` Run to start fresh:\n`);
253
+ console.log(` ${cyan('npm run init')}
254
+ `);
238
255
  separator();
239
256
 
240
257
  process.exit(0);
package/init.js CHANGED
@@ -78,7 +78,7 @@ const projectArg = isGlobalCLI ? args[1] : null;
78
78
 
79
79
  if (isReInit) {
80
80
  try {
81
- const gitCommonDir = execSync('git rev-parse --git-common-dir', { encoding: 'utf8' }).trim();
81
+ const gitCommonDir = execSync('git rev-parse --git-common-dir', { encoding: 'utf8', stdio: 'pipe' }).trim();
82
82
  const repoRoot = path.resolve(gitCommonDir, '..');
83
83
  process.chdir(repoRoot);
84
84
  } catch { /* stay in current directory */ }
@@ -275,7 +275,7 @@ const main = async () => {
275
275
  ],
276
276
  }, { onCancel: () => process.exit(0) });
277
277
  if (confirm.value !== 'yes') { console.log(dim('\n Cancelled.\n')); process.exit(0); }
278
- const resetChild = spawn('node', [path.join(ROOT, '.workflow', 'reset.js')], { stdio: 'inherit', cwd: ROOT });
278
+ const resetChild = spawn('node', [path.join(ROOT, '.workflow', 'reset.js'), '--confirmed'], { stdio: 'inherit', cwd: ROOT });
279
279
  resetChild.on('exit', code => process.exit(code ?? 0));
280
280
  return;
281
281
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Multi-agent workflow orchestration for Claude Code — isolated git worktrees, structured state tracking, autonomous task chaining",
5
5
  "keywords": [
6
6
  "claude-code",