multi-agents-cli 1.1.91 → 1.1.92

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.
@@ -574,4 +574,27 @@ Log completion in TASK.md checklist.
574
574
  Confirm: "Remote configured — proceeding with task."
575
575
 
576
576
  **Never begin task implementation until this flag is cleared.
577
- Never delete the flag on failure.**
577
+ Never delete the flag on failure.**
578
+ ## Completed Task Protocol
579
+
580
+ If `TASK.md` status is `COMPLETED` at session start, a previous task finished in this worktree.
581
+
582
+ **Do not re-run completed work. Treat any new user input as a follow-on task.**
583
+
584
+ ### On session start with COMPLETED TASK.md
585
+
586
+ 1. Read `TASK.md` silently - note what was completed
587
+ 2. Read `.claude-scope` for output mode (already set - no action needed)
588
+ 3. Emit session confirmation per Output Mode Contract
589
+ 4. Output (insights/full modes): `✔ Previous task complete. Ready for follow-on work.`
590
+ 5. Wait for user input
591
+
592
+ ### On receiving follow-on task
593
+
594
+ 1. Treat it as a new task within the same scope and worktree
595
+ 2. Execute it fully per your agent mission and scope rules
596
+ 3. Append a new entry to TASK.md under a `## Follow-on Task` heading with status IN PROGRESS
597
+ 4. When complete, update status to COMPLETED and run `npm run complete`
598
+
599
+ **Never begin implementation before confirming scope.
600
+ Never touch files outside your assigned scope.**
@@ -1064,6 +1064,51 @@ const main = async () => {
1064
1064
  if (activeChoice === 4) { continue agentLoop; }
1065
1065
  }
1066
1066
 
1067
+ // COMPLETED gate
1068
+ const completedSlot = tracking?.[project]?.[agent];
1069
+ if (completedSlot?.status === 'COMPLETED') {
1070
+ const sanitizedForWorktree = config.projectName.toLowerCase().replace(/\s+/g, '-');
1071
+ const completedTimestamp = completedSlot.branch ? completedSlot.branch.split('/')[3] : null;
1072
+ const completedWorktreeName = completedTimestamp
1073
+ ? `${project}-${sanitizedForWorktree}-${agent.toLowerCase()}-${completedTimestamp}`
1074
+ : null;
1075
+ const completedWorktreePath = completedWorktreeName
1076
+ ? path.join(ROOT, 'worktrees', completedWorktreeName)
1077
+ : null;
1078
+ const worktreeExists = completedWorktreePath && fs.existsSync(completedWorktreePath);
1079
+
1080
+ separator();
1081
+ console.log(`\n ${bold(green('\u2713'))} ${bold(agent)} previously completed${completedSlot.completedAt ? ' on ' + new Date(completedSlot.completedAt).toLocaleDateString() : ''}.`);
1082
+ if (worktreeExists) {
1083
+ console.log(` ${dim('Worktree')} : ${dim(completedWorktreePath)}\n`);
1084
+ }
1085
+
1086
+ const completedOptions = worktreeExists
1087
+ ? ['Continue in existing worktree', 'Start a new task', 'Pick a different agent']
1088
+ : ['Start a new task', 'Pick a different agent'];
1089
+
1090
+ const completedChoice = await arrowSelect('What would you like to do?', completedOptions, rl);
1091
+
1092
+ if (worktreeExists) {
1093
+ if (completedChoice === 0) {
1094
+ openIDE(completedWorktreePath);
1095
+ rl.close();
1096
+ return;
1097
+ }
1098
+ if (completedChoice === 1) {
1099
+ guards.clearTrackingSlot(tracking, project, agent, ROOT);
1100
+ // fall through to fresh launch
1101
+ }
1102
+ if (completedChoice === 2) { continue agentLoop; }
1103
+ } else {
1104
+ if (completedChoice === 0) {
1105
+ guards.clearTrackingSlot(tracking, project, agent, ROOT);
1106
+ // fall through to fresh launch
1107
+ }
1108
+ if (completedChoice === 1) { continue agentLoop; }
1109
+ }
1110
+ }
1111
+
1067
1112
  // MISSING gate
1068
1113
  const trackingSlot = tracking?.[project]?.[agent];
1069
1114
  if (trackingSlot?.status === 'MISSING') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-agents-cli",
3
- "version": "1.1.91",
3
+ "version": "1.1.92",
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",