feat: add message bus (.msg/) to codex team-lifecycle skill

Align codex version with Claude version's team_msg message bus for
frontend pipeline UI integration:

- Phase 2: create .msg/ dir, write meta.json with pipeline_stages/roles,
  init messages.jsonl with session event
- Phase 4: log task completion events, update role_state in meta.json
- Phase 5: update meta.json status to completed, log shutdown event
- SKILL.md: document .msg/ in session directory and add schema reference
This commit is contained in:
catlog22
2026-03-04 16:35:07 +08:00
parent e9f8a72343
commit 64e772f9b8
4 changed files with 246 additions and 2 deletions

View File

@@ -138,6 +138,27 @@ state.completed_at = new Date().toISOString()
Write("<session-dir>/team-session.json",
JSON.stringify(state, null, 2))
// Update message bus meta.json status
const meta = JSON.parse(Read("<session-dir>/.msg/meta.json"))
meta.status = "completed"
meta.updated_at = new Date().toISOString()
Write("<session-dir>/.msg/meta.json", JSON.stringify(meta, null, 2))
// Log completion event to message bus
const msgCounter = getLastMsgCounter("<session-dir>/.msg/messages.jsonl") + 1
logToMessageBus("<session-dir>", msgCounter, {
from: "coordinator",
type: "shutdown",
summary: `Pipeline completed: ${completedTasks}/${totalTasks} tasks (${successRate}%)`,
data: {
tasks_completed: completedTasks,
tasks_total: totalTasks,
success_rate: successRate,
duration_min: durationMin,
failed_tasks: failedTasks
}
})
```
### Step 5.8: Output Completion Report