wogiflow 2.5.5 → 2.5.6

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.
Files changed (2) hide show
  1. package/lib/workspace.js +44 -0
  2. package/package.json +1 -1
package/lib/workspace.js CHANGED
@@ -971,6 +971,50 @@ 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
+ ## What NOT to Do
1010
+
1011
+ - Do NOT use Bash to write JSON files to .workspace/messages/ — use the workspace_send_message tool
1012
+ - Do NOT skip the reply because you think the work is trivial
1013
+ - Do NOT assume the manager can see your terminal output
1014
+ `;
1015
+
1016
+ fs.writeFileSync(path.join(rulesDir, 'worker-rules.md'), workerRule);
1017
+ console.log(` ✓ ${name}/.claude/rules/workspace/worker-rules.md`);
974
1018
  }
975
1019
  }
976
1020
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wogiflow",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
4
4
  "description": "AI-powered development workflow management system with multi-model support",
5
5
  "main": "lib/index.js",
6
6
  "bin": {