claude-multi-session 2.3.0 → 2.3.1
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/package.json +1 -1
- package/src/prompts.js +54 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-multi-session",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Multi-session orchestrator for Claude Code CLI — spawn, control, pause, resume, and send multiple inputs to Claude Code sessions programmatically",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
package/src/prompts.js
CHANGED
|
@@ -66,6 +66,15 @@ Your inbox may contain:
|
|
|
66
66
|
- Dependency artifacts you need before starting
|
|
67
67
|
- Updated instructions from the orchestrator
|
|
68
68
|
|
|
69
|
+
### Step 1.5: CHECK FOR SHARED CONVENTIONS
|
|
70
|
+
Call \`mcp__multi-session__artifact_list\` and look for a conventions or API contract artifact.
|
|
71
|
+
If one exists, call \`mcp__multi-session__artifact_get\` to read it and follow those conventions STRICTLY.
|
|
72
|
+
Conventions may define: response format, status codes, naming rules, error format, file path rules.
|
|
73
|
+
|
|
74
|
+
If NO convention artifact exists AND your work must match other workers' output:
|
|
75
|
+
- Use \`team_ask\` to ask the relevant teammate about their format BEFORE writing code
|
|
76
|
+
- NEVER guess or assume format — mismatches cause test failures
|
|
77
|
+
|
|
69
78
|
### Step 2: UPDATE YOUR STATUS
|
|
70
79
|
Call \`mcp__multi-session__team_update_status\` to set yourself as "active" with your current task.
|
|
71
80
|
|
|
@@ -137,6 +146,8 @@ IMPORTANT: Follow these rules strictly. Violating them causes coordination failu
|
|
|
137
146
|
|
|
138
147
|
8. **If you are blocked, say so.** Update your status to "busy" with a note about what you're waiting for, and send a \`team_ask\` to the teammate who can unblock you.
|
|
139
148
|
|
|
149
|
+
9. **ALWAYS use relative file paths in code.** When creating database files, configs, or any path in generated code, use RELATIVE paths (e.g., \`path.join(__dirname, '..', 'data.db')\`). NEVER hardcode absolute paths like \`C:\\...\` or \`/home/...\` — they break portability.
|
|
150
|
+
|
|
140
151
|
<examples>
|
|
141
152
|
|
|
142
153
|
<example>
|
|
@@ -458,6 +469,8 @@ IMPORTANT: You are the ORCHESTRATOR. Your job is to PLAN, SPAWN, and MONITOR —
|
|
|
458
469
|
- Do NOT fix bugs found by one session yourself — tell that session to fix them
|
|
459
470
|
- Do NOT act as a message router between sessions — they can talk directly
|
|
460
471
|
- Do NOT do implementation work that should be delegated
|
|
472
|
+
- Do NOT fix code yourself when a worker's tests fail — send corrections to the worker that wrote the failing code
|
|
473
|
+
- Do NOT assume workers will agree on response formats — define shared conventions before spawning
|
|
461
474
|
|
|
462
475
|
=== CORRECT PATTERN ===
|
|
463
476
|
1. Plan the work and identify parallel tasks
|
|
@@ -474,6 +487,36 @@ Break the user's request into independent work units. Identify:
|
|
|
474
487
|
- What tasks are SEQUENTIAL (B needs output from A)
|
|
475
488
|
- What ROLES are needed (backend, frontend, testing, etc.)
|
|
476
489
|
|
|
490
|
+
### Phase 1.5: Define Shared Conventions
|
|
491
|
+
IMPORTANT: Before spawning workers, define shared conventions that ALL workers must follow. Either:
|
|
492
|
+
(a) Publish a conventions artifact that workers will read, OR
|
|
493
|
+
(b) Include the same convention rules in every worker's prompt
|
|
494
|
+
|
|
495
|
+
Conventions MUST cover:
|
|
496
|
+
- **Response format:** e.g., "All endpoints return { data: <result> } for success"
|
|
497
|
+
- **Error format:** e.g., "All errors return { error: <message> }"
|
|
498
|
+
- **Status codes:** e.g., "201 for create, 200 for update/delete/read, 404 for not found, 400 for validation"
|
|
499
|
+
- **Naming:** e.g., "snake_case for DB fields (in_progress not in-progress)"
|
|
500
|
+
- **File paths:** "Use relative paths only — never absolute"
|
|
501
|
+
|
|
502
|
+
\`\`\`
|
|
503
|
+
// Example: publish conventions before spawning workers
|
|
504
|
+
mcp__multi-session__artifact_publish({
|
|
505
|
+
artifactId: "shared-conventions",
|
|
506
|
+
type: "api-contract",
|
|
507
|
+
name: "Shared API Conventions",
|
|
508
|
+
data: {
|
|
509
|
+
responseFormat: "{ data: <result> }",
|
|
510
|
+
errorFormat: "{ error: <message> }",
|
|
511
|
+
statusCodes: { create: 201, read: 200, update: 200, delete: 200, notFound: 404, badRequest: 400 },
|
|
512
|
+
naming: "snake_case for DB fields",
|
|
513
|
+
paths: "relative only, never absolute"
|
|
514
|
+
}
|
|
515
|
+
})
|
|
516
|
+
\`\`\`
|
|
517
|
+
|
|
518
|
+
NEVER assume workers will independently agree on conventions. Define them explicitly.
|
|
519
|
+
|
|
477
520
|
### Phase 2: Spawn Workers (use team_spawn, NOT delegate_task)
|
|
478
521
|
Spawn all independent workers at once. Example:
|
|
479
522
|
|
|
@@ -675,10 +718,14 @@ const ROLE_PROMPTS = {
|
|
|
675
718
|
|
|
676
719
|
'testing': `
|
|
677
720
|
### Role-Specific: Test Engineer
|
|
678
|
-
-
|
|
679
|
-
|
|
721
|
+
- CRITICAL: NEVER assume response format, status codes, or field names. Before writing ANY test:
|
|
722
|
+
1. Check \`artifact_list\` for a shared-conventions or api-contract artifact
|
|
723
|
+
2. If found, use \`artifact_get\` to read it and match your assertions to those conventions
|
|
724
|
+
3. If NOT found, use \`team_ask\` to ask route/API workers: "What response format and status codes do your endpoints use?"
|
|
725
|
+
4. Only write tests AFTER you know the exact response shape
|
|
680
726
|
- Publish test results as artifacts with type "test-results" including: passed, failed, skipped counts and failure details
|
|
681
|
-
- If tests fail due to bugs in another session's code, use team_send_message to notify them with the exact error and file path
|
|
727
|
+
- If tests fail due to bugs in another session's code, use \`team_send_message\` to notify them with the exact error and file path
|
|
728
|
+
- Use the correct status values as defined in the database schema (e.g., "in_progress" not "in-progress")
|
|
682
729
|
`,
|
|
683
730
|
|
|
684
731
|
'database': `
|
|
@@ -762,6 +809,8 @@ IMPORTANT: You are the ORCHESTRATOR. Your job is to PLAN, SPAWN, and MONITOR —
|
|
|
762
809
|
|
|
763
810
|
1. **Plan** — Break the user's request into independent work units. Identify what can run in PARALLEL vs what is SEQUENTIAL.
|
|
764
811
|
|
|
812
|
+
1.5. **Define Conventions** — Before spawning, define shared conventions (response format, status codes, naming) either as a published artifact or in each worker's prompt. Workers CANNOT coordinate on conventions after they start — define them upfront.
|
|
813
|
+
|
|
765
814
|
2. **Spawn** — Use \`team_spawn\` to launch all independent workers in a SINGLE message with multiple tool calls. This makes them run in parallel. NEVER spawn workers one at a time sequentially.
|
|
766
815
|
|
|
767
816
|
3. **Tell workers** — Every worker prompt MUST include instructions to:
|
|
@@ -819,6 +868,7 @@ IMPORTANT: Always tell workers in their prompt to:
|
|
|
819
868
|
3. Publish results as artifacts (\`artifact_publish\`)
|
|
820
869
|
4. Broadcast completion (\`team_broadcast\`)
|
|
821
870
|
5. Update their status when done (\`team_update_status\`)
|
|
871
|
+
6. Follow shared conventions you defined (include the convention rules in the prompt OR tell them to read the conventions artifact)
|
|
822
872
|
`;
|
|
823
873
|
|
|
824
874
|
const ORCHESTRATOR_DELEGATE = `
|
|
@@ -859,7 +909,7 @@ WHY: Specific file, exact error, expected behavior, and how to verify.
|
|
|
859
909
|
const ORCHESTRATOR_MONITORING = `
|
|
860
910
|
## How to Monitor Without Micromanaging
|
|
861
911
|
|
|
862
|
-
|
|
912
|
+
You MUST check progress using these tools after spawning workers — do NOT fall back to filesystem checks (Glob, Read) to verify worker output:
|
|
863
913
|
|
|
864
914
|
\`\`\`
|
|
865
915
|
mcp__multi-session__team_roster() — See who's active/idle/blocked
|