multi-agents-cli 1.1.90 → 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.
- package/core/templates/CLAUDE.md +32 -10
- package/core/workflow/agent.js +45 -0
- package/package.json +1 -1
package/core/templates/CLAUDE.md
CHANGED
|
@@ -146,15 +146,14 @@ the agent must:
|
|
|
146
146
|
# then take the parent directory of that path - this is PROJECT_ROOT
|
|
147
147
|
```
|
|
148
148
|
Store this as PROJECT_ROOT. All subsequent paths (`.scaffold/`, `BUILD_STATE.md`, `CONTRACTS.md`, etc.) resolve from PROJECT_ROOT, never from the worktree directory.
|
|
149
|
-
2. Read `output_mode` from `.claude-scope` in the current worktree directory:
|
|
150
|
-
- `full` —
|
|
151
|
-
- `insights` — three permitted
|
|
152
|
-
1.
|
|
153
|
-
2.
|
|
154
|
-
3.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
Store this as OUTPUT_MODE. Apply it consistently for the entire session.
|
|
149
|
+
2. Read `output_mode` from `.claude-scope` in the current worktree directory. Do this silently — before emitting any output whatsoever, including narration of this session start sequence. Store as OUTPUT_MODE and enforce immediately:
|
|
150
|
+
- `full` — no restrictions on output
|
|
151
|
+
- `insights` — hard contract for the entire session. Emit exactly: `Output mode: insights` then proceed. Only three output types are permitted — any other text is a violation:
|
|
152
|
+
1. Before each phase, output this exact string (replace placeholders): `\033[1;36m▶\033[0m [phase] — [what and why, one line]` (color per agent scope: cyan client, yellow backend `\033[1;33m`, red shared `\033[1;31m`)
|
|
153
|
+
2. After each phase, output this exact string (replace placeholder): `\033[1;32m✔\033[0m [result — outcome in 10 words or fewer, stated as fact, no first-person narration]`
|
|
154
|
+
3. When blocked or a decision is required, output this exact string: `\033[38;5;208m\033[1m⚠\033[0m [blocker or decision]`
|
|
155
|
+
- `silent` — emit exactly: `Output mode: silent` then proceed. Show `✢ working...` between phases; emit only `\033[1;32m✔\033[0m` git operations, errors, and verification results; no other output
|
|
156
|
+
All remaining session start steps execute silently under insights and silent modes.
|
|
158
157
|
3. Read `BUILD_STATE.md` at PROJECT_ROOT - understand what has been built
|
|
159
158
|
3. Check if `TASK.md` exists in the current directory
|
|
160
159
|
4. If yes - read it and verify dependencies are met against BUILD_STATE.md
|
|
@@ -575,4 +574,27 @@ Log completion in TASK.md checklist.
|
|
|
575
574
|
Confirm: "Remote configured — proceeding with task."
|
|
576
575
|
|
|
577
576
|
**Never begin task implementation until this flag is cleared.
|
|
578
|
-
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
|
@@ -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