multi-agents-cli 1.1.91 → 1.1.93
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/core/templates/CLAUDE.md +24 -1
- package/core/workflow/agent.js +50 -0
- package/package.json +1 -1
package/core/templates/CLAUDE.md
CHANGED
|
@@ -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.**
|
package/core/workflow/agent.js
CHANGED
|
@@ -760,6 +760,7 @@ const main = async () => {
|
|
|
760
760
|
|
|
761
761
|
let project, agent, task, contractsNote;
|
|
762
762
|
let timestamp, sanitizedName, worktreeName, branchName, worktreePath;
|
|
763
|
+
let resumeMode = false;
|
|
763
764
|
let contextSection = '';
|
|
764
765
|
|
|
765
766
|
let userSeedingContracts = false;
|
|
@@ -937,6 +938,7 @@ const main = async () => {
|
|
|
937
938
|
agent = argAgent;
|
|
938
939
|
} else {
|
|
939
940
|
agentLoop: while (true) {
|
|
941
|
+
resumeMode = false;
|
|
940
942
|
console.log('');
|
|
941
943
|
|
|
942
944
|
// Select agent with back option
|
|
@@ -1064,6 +1066,51 @@ const main = async () => {
|
|
|
1064
1066
|
if (activeChoice === 4) { continue agentLoop; }
|
|
1065
1067
|
}
|
|
1066
1068
|
|
|
1069
|
+
// COMPLETED gate
|
|
1070
|
+
const completedSlot = tracking?.[project]?.[agent];
|
|
1071
|
+
if (completedSlot?.status === 'COMPLETED') {
|
|
1072
|
+
const sanitizedForWorktree = config.projectName.toLowerCase().replace(/\s+/g, '-');
|
|
1073
|
+
const completedTimestamp = completedSlot.branch ? completedSlot.branch.split('/')[3] : null;
|
|
1074
|
+
const completedWorktreeName = completedTimestamp
|
|
1075
|
+
? `${project}-${sanitizedForWorktree}-${agent.toLowerCase()}-${completedTimestamp}`
|
|
1076
|
+
: null;
|
|
1077
|
+
const completedWorktreePath = completedWorktreeName
|
|
1078
|
+
? path.join(ROOT, 'worktrees', completedWorktreeName)
|
|
1079
|
+
: null;
|
|
1080
|
+
const worktreeExists = completedWorktreePath && fs.existsSync(completedWorktreePath);
|
|
1081
|
+
|
|
1082
|
+
separator();
|
|
1083
|
+
console.log(`\n ${bold(green('\u2713'))} ${bold(agent)} previously completed${completedSlot.completedAt ? ' on ' + new Date(completedSlot.completedAt).toLocaleDateString() : ''}.`);
|
|
1084
|
+
if (worktreeExists) {
|
|
1085
|
+
console.log(` ${dim('Worktree')} : ${dim(completedWorktreePath)}\n`);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
const completedOptions = worktreeExists
|
|
1089
|
+
? ['Continue in existing worktree', 'Start a new task', 'Pick a different agent']
|
|
1090
|
+
: ['Start a new task', 'Pick a different agent'];
|
|
1091
|
+
|
|
1092
|
+
const completedChoice = await arrowSelect('What would you like to do?', completedOptions, rl);
|
|
1093
|
+
|
|
1094
|
+
if (worktreeExists) {
|
|
1095
|
+
if (completedChoice === 0) {
|
|
1096
|
+
worktreePath = completedWorktreePath;
|
|
1097
|
+
branchName = completedSlot.branch;
|
|
1098
|
+
resumeMode = true;
|
|
1099
|
+
}
|
|
1100
|
+
if (completedChoice === 1) {
|
|
1101
|
+
guards.clearTrackingSlot(tracking, project, agent, ROOT);
|
|
1102
|
+
// fall through to fresh launch
|
|
1103
|
+
}
|
|
1104
|
+
if (completedChoice === 2) { continue agentLoop; }
|
|
1105
|
+
} else {
|
|
1106
|
+
if (completedChoice === 0) {
|
|
1107
|
+
guards.clearTrackingSlot(tracking, project, agent, ROOT);
|
|
1108
|
+
// fall through to fresh launch
|
|
1109
|
+
}
|
|
1110
|
+
if (completedChoice === 1) { continue agentLoop; }
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1067
1114
|
// MISSING gate
|
|
1068
1115
|
const trackingSlot = tracking?.[project]?.[agent];
|
|
1069
1116
|
if (trackingSlot?.status === 'MISSING') {
|
|
@@ -1459,6 +1506,7 @@ Mark each step complete. Only proceed to the task below when all are checked.
|
|
|
1459
1506
|
|
|
1460
1507
|
separator();
|
|
1461
1508
|
|
|
1509
|
+
if (!resumeMode) {
|
|
1462
1510
|
// ── Confirm ───────────────────────────────────────────────────────────────────
|
|
1463
1511
|
|
|
1464
1512
|
timestamp = Date.now();
|
|
@@ -1792,6 +1840,8 @@ ${excludedUrls}
|
|
|
1792
1840
|
}
|
|
1793
1841
|
}
|
|
1794
1842
|
|
|
1843
|
+
} // end if (!resumeMode)
|
|
1844
|
+
|
|
1795
1845
|
// ── Session start selection ─────────────────────────────────────────────────
|
|
1796
1846
|
|
|
1797
1847
|
separator();
|
package/package.json
CHANGED