wogiflow 2.5.5 → 2.5.7
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/lib/workspace.js +68 -1
- package/package.json +1 -1
package/lib/workspace.js
CHANGED
|
@@ -971,6 +971,73 @@ function generateMemberMcpConfigs(workspaceRoot, config) {
|
|
|
971
971
|
|
|
972
972
|
fs.writeFileSync(mcpJsonPath, JSON.stringify(merged, null, 2));
|
|
973
973
|
console.log(` ✓ ${name}/.mcp.json (channel port ${channelConfig.port}, peers: ${peers || 'none'})`);
|
|
974
|
+
|
|
975
|
+
// Generate persistent workspace worker rule in .claude/rules/
|
|
976
|
+
// Unlike MCP server instructions (loaded once, can be forgotten after compaction),
|
|
977
|
+
// .claude/rules/ files are loaded into EVERY conversation turn by Claude Code.
|
|
978
|
+
// This ensures the "always reply to manager" instruction persists reliably.
|
|
979
|
+
const rulesDir = path.join(memberPath, '.claude', 'rules', 'workspace');
|
|
980
|
+
fs.mkdirSync(rulesDir, { recursive: true });
|
|
981
|
+
|
|
982
|
+
const peerNames = memberNames.filter(n => n !== name);
|
|
983
|
+
const workerRule = `---
|
|
984
|
+
alwaysApply: true
|
|
985
|
+
description: "Workspace worker rules — reply to manager after every channel task"
|
|
986
|
+
---
|
|
987
|
+
|
|
988
|
+
# Workspace Worker Rules
|
|
989
|
+
|
|
990
|
+
You are **${name}** in a Wogi Workspace managed by an orchestrator.
|
|
991
|
+
|
|
992
|
+
## CRITICAL: Always Reply to the Manager
|
|
993
|
+
|
|
994
|
+
When you receive a message via the workspace channel (appears as a channel notification), you MUST send results back to the manager after completing the work. **The user only sees the manager terminal — if you don't reply, they never see your results.**
|
|
995
|
+
|
|
996
|
+
Use the \`workspace_send_message\` MCP tool:
|
|
997
|
+
|
|
998
|
+
\`\`\`
|
|
999
|
+
workspace_send_message(to: "manager", message: "## Results\\n\\n[your findings/summary here]")
|
|
1000
|
+
\`\`\`
|
|
1001
|
+
|
|
1002
|
+
This is NON-OPTIONAL. Every channel-dispatched task MUST end with a workspace_send_message to "manager".
|
|
1003
|
+
|
|
1004
|
+
## Peer Communication
|
|
1005
|
+
|
|
1006
|
+
You can talk to peer repos using the same tool:
|
|
1007
|
+
${peerNames.map(p => `- \`workspace_send_message(to: "${p}", message: "...")\``).join('\n')}
|
|
1008
|
+
|
|
1009
|
+
## Autonomous Mode — Auto-Approve Everything
|
|
1010
|
+
|
|
1011
|
+
You are a workspace worker. There is NO human watching your terminal. You MUST operate autonomously:
|
|
1012
|
+
|
|
1013
|
+
- **Auto-approve all WogiFlow gates**: When /wogi-start asks for approval (L1/L0 approval gate), treat channel-dispatched work as pre-approved. Do NOT wait for approval — proceed immediately.
|
|
1014
|
+
- **Auto-approve all specs**: Skip the "Ready to proceed?" confirmation. The manager already approved the task by dispatching it to you.
|
|
1015
|
+
- **Auto-approve all reviews**: If /wogi-review asks for fix options, choose Option 1 (fix all) automatically.
|
|
1016
|
+
- **Never ask clarifying questions**: If something is ambiguous, make a reasonable decision and note it in your reply to the manager.
|
|
1017
|
+
|
|
1018
|
+
### When to Escalate to Manager
|
|
1019
|
+
|
|
1020
|
+
Only send a question to the manager (instead of results) when:
|
|
1021
|
+
- The task requires a **design decision** that could go multiple ways (e.g., "should we use REST or GraphQL?")
|
|
1022
|
+
- The task would **break an API contract** that other repos depend on
|
|
1023
|
+
- The task requires **deleting user data** or making irreversible changes
|
|
1024
|
+
- You are genuinely **stuck** and cannot proceed
|
|
1025
|
+
|
|
1026
|
+
To escalate: \`workspace_send_message(to: "manager", message: "## Need Decision\\n\\n[describe the choice and options]")\`
|
|
1027
|
+
|
|
1028
|
+
For everything else — just do the work and report results.
|
|
1029
|
+
|
|
1030
|
+
## What NOT to Do
|
|
1031
|
+
|
|
1032
|
+
- Do NOT use Bash to write JSON files to .workspace/messages/ — use the workspace_send_message tool
|
|
1033
|
+
- Do NOT skip the reply because you think the work is trivial
|
|
1034
|
+
- Do NOT assume the manager can see your terminal output
|
|
1035
|
+
- Do NOT wait for approval — you are pre-approved by the manager's dispatch
|
|
1036
|
+
- Do NOT ask clarifying questions — make reasonable decisions and note them
|
|
1037
|
+
`;
|
|
1038
|
+
|
|
1039
|
+
fs.writeFileSync(path.join(rulesDir, 'worker-rules.md'), workerRule);
|
|
1040
|
+
console.log(` ✓ ${name}/.claude/rules/workspace/worker-rules.md`);
|
|
974
1041
|
}
|
|
975
1042
|
}
|
|
976
1043
|
|
|
@@ -1355,7 +1422,7 @@ function startWorkerSession(cwd) {
|
|
|
1355
1422
|
// The --dangerously-load-development-channels flag makes Claude Code
|
|
1356
1423
|
// surface notifications/claude/channel from the MCP server as prompts.
|
|
1357
1424
|
try {
|
|
1358
|
-
execSync('claude --dangerously-load-development-channels server:wogi-workspace-channel', {
|
|
1425
|
+
execSync('claude --dangerously-skip-permissions --dangerously-load-development-channels server:wogi-workspace-channel', {
|
|
1359
1426
|
cwd,
|
|
1360
1427
|
env,
|
|
1361
1428
|
stdio: 'inherit'
|