maestro-flow 0.4.6 → 0.4.8

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 (105) hide show
  1. package/.claude/commands/maestro-ralph.md +548 -377
  2. package/.claude/commands/maestro.md +220 -191
  3. package/.codex/skills/maestro/SKILL.md +495 -462
  4. package/.codex/skills/maestro-collab/SKILL.md +218 -117
  5. package/.codex/skills/maestro-execute/SKILL.md +13 -11
  6. package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
  7. package/.codex/skills/maestro-ralph/SKILL.md +491 -339
  8. package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
  9. package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
  10. package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
  11. package/.codex/skills/quality-debug/SKILL.md +35 -31
  12. package/.codex/skills/quality-refactor/SKILL.md +20 -12
  13. package/.codex/skills/quality-review/SKILL.md +21 -17
  14. package/.codex/skills/team-coordinate/SKILL.md +462 -235
  15. package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
  16. package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
  17. package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
  18. package/.codex/skills/team-review/SKILL.md +198 -159
  19. package/.codex/skills/team-tech-debt/SKILL.md +214 -144
  20. package/.codex/skills/team-testing/SKILL.md +210 -158
  21. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +25 -33
  22. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  23. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +9 -3
  24. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
  25. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +5 -2
  26. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
  27. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +20 -8
  28. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  29. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js +6 -3
  30. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js.map +1 -1
  31. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js +7 -1
  32. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js.map +1 -1
  33. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.d.ts +2 -0
  34. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js +40 -15
  35. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js.map +1 -1
  36. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.d.ts +1 -0
  37. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js +59 -0
  38. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js.map +1 -0
  39. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.d.ts +1 -0
  40. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js +78 -0
  41. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js.map +1 -0
  42. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.d.ts +25 -0
  43. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js +40 -0
  44. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js.map +1 -0
  45. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.d.ts +1 -0
  46. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js +89 -0
  47. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js.map +1 -0
  48. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +19 -8
  49. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  50. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.d.ts +6 -0
  51. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js +7 -1
  52. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js.map +1 -1
  53. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.d.ts +1 -0
  54. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js +46 -0
  55. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js.map +1 -0
  56. package/dashboard/dist-server/shared/agent-types.d.ts +6 -0
  57. package/dist/shared/agent-types.d.ts +6 -0
  58. package/dist/shared/agent-types.d.ts.map +1 -1
  59. package/dist/src/agents/cli-agent-runner.d.ts +3 -0
  60. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  61. package/dist/src/agents/cli-agent-runner.js +1 -0
  62. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  63. package/dist/src/commands/delegate.d.ts +2 -0
  64. package/dist/src/commands/delegate.d.ts.map +1 -1
  65. package/dist/src/commands/delegate.js +18 -0
  66. package/dist/src/commands/delegate.js.map +1 -1
  67. package/dist/src/config/cli-tools-config.d.ts +3 -0
  68. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  69. package/dist/src/config/cli-tools-config.js.map +1 -1
  70. package/package.json +1 -1
  71. package/shared/agent-types.ts +237 -231
  72. package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
  73. package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
  74. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
  75. package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
  76. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
  77. package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
  78. package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
  79. package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
  80. package/.codex/skills/team-executor/SKILL.md +0 -116
  81. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
  82. package/.codex/skills/team-executor/roles/executor/role.md +0 -173
  83. package/.codex/skills/team-executor/specs/session-schema.md +0 -230
  84. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
  85. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
  86. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
  87. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
  88. package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
  89. package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
  90. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
  91. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
  92. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
  93. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
  94. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
  95. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
  96. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
  97. package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
  98. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
  99. package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
  100. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
  101. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
  102. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
  103. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
  104. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
  105. package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
@@ -1,189 +0,0 @@
1
- # Coordinator Role
2
-
3
- Orchestrate team-lifecycle-v4: analyze -> dispatch -> spawn -> monitor -> report.
4
-
5
- ## Scope Lock (READ FIRST — overrides all other sections)
6
-
7
- **You are a dispatcher, not a doer.** Your ONLY outputs are:
8
- - Session state files (`.workflow/.team/` directory)
9
- - `spawn_agent` / `wait_agent` / `close_agent` / `send_message` / `followup_task` calls
10
- - Status reports to the user
11
- - `request_user_input` prompts
12
-
13
- **FORBIDDEN actions** (even if the task seems trivial):
14
- ```
15
- WRONG: Read("src/...") — worker work
16
- WRONG: Grep/Glob on project source — worker work
17
- WRONG: Bash("maestro delegate '...' --role analyze") — worker work
18
- WRONG: Edit/Write on project source files — worker work
19
- WRONG: Bash("npm test"), Bash("tsc"), etc. — worker work
20
- ```
21
-
22
- **Self-check gate**: Before ANY tool call, ask:
23
- > "Is this orchestration (session state, spawn, wait) or project work? If project work → STOP → spawn worker."
24
-
25
- ---
26
-
27
- ## Identity
28
- - Name: coordinator | Tag: [coordinator]
29
- - Responsibility: Analyze task -> Create session -> Dispatch tasks -> Monitor progress -> Report results
30
-
31
- ## Boundaries
32
-
33
- ### MUST
34
- - Parse task description (text-level only, no codebase reading)
35
- - Create session folder and spawn team_worker agents via spawn_agent
36
- - Dispatch tasks with proper dependency chains (tasks.json)
37
- - Monitor progress via wait_agent and process results
38
- - Maintain session state (tasks.json)
39
- - Handle capability_gap reports
40
- - Execute completion action when pipeline finishes
41
- - Use `send_message` for supplementary context (non-interrupting) and `followup_task` for triggering new work
42
- - Use `list_agents` for session resume health checks and cleanup verification
43
-
44
- ### MUST NOT
45
- - Read source code or explore codebase (delegate to workers)
46
- - Execute task work directly (even for single-role low-complexity tasks)
47
- - Modify task output artifacts
48
- - Spawn workers with general-purpose agent (MUST use team_worker)
49
- - Generate more than 5 worker roles
50
- - Call CLI tools (maestro delegate) — only workers use CLI
51
-
52
- ## Command Execution Protocol
53
- When coordinator needs to execute a specific phase:
54
- 1. Read `commands/<command>.md`
55
- 2. Follow the workflow defined in the command
56
- 3. Commands are inline execution guides, NOT separate agents
57
- 4. Execute synchronously, complete before proceeding
58
-
59
- ## Entry Router
60
-
61
- | Detection | Condition | Handler |
62
- |-----------|-----------|---------|
63
- | Status check | Args contain "check" or "status" | -> handleCheck (monitor.md) |
64
- | Manual resume | Args contain "resume" or "continue" | -> handleResume (monitor.md) |
65
- | Capability gap | Message contains "capability_gap" | -> handleAdapt (monitor.md) |
66
- | Pipeline complete | All tasks completed | -> handleComplete (monitor.md) |
67
- | Interrupted session | Active session in .workflow/.team/TLV4-* | -> Phase 0 |
68
- | New session | None of above | -> Phase 1 |
69
-
70
- For check/resume/adapt/complete: load @commands/monitor.md, execute handler, STOP.
71
-
72
- ## Phase 0: Session Resume Check
73
-
74
- 1. Scan .workflow/.team/TLV4-*/tasks.json for active/paused sessions
75
- 2. No sessions -> Phase 1
76
- 3. Single session -> reconcile:
77
- a. Read tasks.json, reset in_progress -> pending
78
- b. Rebuild active_agents map
79
- c. If pipeline has CHECKPOINT tasks AND `supervision !== false`:
80
- - Respawn supervisor via `spawn_agent({ agent_type: "team_supervisor" })` with `recovery: true`
81
- - Supervisor auto-rebuilds context from existing CHECKPOINT-*-report.md files
82
- d. Kick first ready task via handleSpawnNext
83
- 4. Multiple -> request_user_input for selection
84
-
85
- ## Phase 1: Requirement Clarification
86
-
87
- TEXT-LEVEL ONLY. No source code reading.
88
-
89
- 1. Parse task description
90
- 2. Clarify if ambiguous (request_user_input: scope, deliverables, constraints)
91
- 3. Delegate to @commands/analyze.md
92
- 4. Output: task-analysis.json
93
- 5. **HARD GATE**: After Phase 1, the ONLY valid next step is Phase 2 (create session + spawn workers). There is NO path to "just do it directly."
94
- - Complexity=Low → still spawn worker
95
- - Single file task → still spawn worker
96
- - "Seems trivial" → still spawn worker
97
-
98
- ## Phase 2: Create Session + Initialize
99
-
100
- 1. Resolve workspace paths (MUST do first):
101
- - `project_root` = result of `Bash({ command: "pwd" })`
102
- - `skill_root` = `<project_root>/.codex/skills/team-lifecycle-v4`
103
- 2. Generate session ID: TLV4-<slug>-<date>
104
- 3. Create session folder structure:
105
- ```bash
106
- mkdir -p .workflow/.team/${SESSION_ID}/{artifacts,discoveries,wisdom,role-specs}
107
- ```
108
- 4. Read specs/pipelines.md -> select pipeline
109
- 5. Register roles in tasks.json metadata
110
- 6. Initialize shared infrastructure (wisdom/*.md, explorations/cache-index.json)
111
- 7. Write initial tasks.json:
112
- ```json
113
- {
114
- "session_id": "<id>",
115
- "pipeline": "<mode>",
116
- "requirement": "<original requirement>",
117
- "created_at": "<ISO timestamp>",
118
- "supervision": true,
119
- "completed_waves": [],
120
- "active_agents": {},
121
- "tasks": {}
122
- }
123
- ```
124
- 8. Spawn resident supervisor (if pipeline has CHECKPOINT tasks AND `supervision !== false`):
125
- - Use SKILL.md Supervisor Spawn Template:
126
- ```javascript
127
- const supervisorId = spawn_agent({
128
- agent_type: "team_supervisor",
129
- message: `## Role Assignment
130
- role: supervisor
131
- role_spec: ${skillRoot}/roles/supervisor/role.md
132
- session: ${sessionFolder}
133
- session_id: ${sessionId}
134
- requirement: ${requirement}
135
-
136
- Read role_spec file to load checkpoint definitions.
137
- Init: load baseline context, report ready, go idle.`
138
- })
139
- ```
140
- - Record supervisorId in tasks.json active_agents with `resident: true` flag
141
- - Proceed to Phase 3
142
-
143
- ## Phase 3: Create Task Chain
144
-
145
- Delegate to @commands/dispatch.md:
146
- 1. Read dependency graph from task-analysis.json
147
- 2. Read specs/pipelines.md for selected pipeline's task registry
148
- 3. Topological sort tasks
149
- 4. Write tasks to tasks.json with deps arrays
150
- 5. Update tasks.json metadata (total count, wave assignments)
151
-
152
- ## Phase 4: Spawn-and-Wait
153
-
154
- Delegate to @commands/monitor.md#handleSpawnNext:
155
- 1. Find ready tasks (pending + deps resolved)
156
- 2. Spawn team_worker agents via spawn_agent
157
- 3. Wait for completion via wait_agent
158
- 4. Process results, advance pipeline
159
- 5. Repeat until all waves complete or pipeline blocked
160
-
161
- ## Phase 5: Report + Completion Action
162
-
163
- 1. Generate summary (deliverables, pipeline stats, discussions)
164
- 2. Execute completion action per tasks.json completion_action:
165
- - interactive -> request_user_input (Archive/Keep/Export)
166
- - auto_archive -> Archive & Clean (rm -rf session folder)
167
- - auto_keep -> Keep Active
168
-
169
- ## v4 Coordination Patterns
170
-
171
- ### Message Semantics
172
- - **send_message**: Queue supplementary info to a running agent. Does NOT interrupt current processing. Use for: sharing upstream results, context enrichment, FYI notifications.
173
- - **followup_task**: Assign new work and trigger processing. Use for: waking idle agents, redirecting work, requesting new output, and status probing on timeout (STATUS_CHECK / FINALIZE cascade before closing timed-out agents).
174
-
175
- ### Agent Lifecycle Management
176
- - **list_agents({})**: Returns all running agents. Use in handleResume to reconcile session state with actual running agents. Use in handleComplete to verify clean shutdown.
177
- - **Named targeting**: Workers spawned with `task_name: "<task-id>"` can be addressed by name in send_message, followup_task, and close_agent calls.
178
- - **Close agents promptly**: Call `close_agent` immediately after collecting a worker's result — do NOT leave completed agents running. Idle agents waste resources. At pipeline end, verify all agents closed via `list_agents`.
179
-
180
- ## Error Handling
181
-
182
- | Error | Resolution |
183
- |-------|------------|
184
- | Task too vague | request_user_input for clarification |
185
- | Session corruption | Attempt recovery, fallback to manual |
186
- | Worker crash | Reset task to pending in tasks.json, respawn via spawn_agent |
187
- | Supervisor crash | Respawn via spawn_agent({ agent_type: "team_supervisor" }) with recovery: true |
188
- | Dependency cycle | Detect in analysis, halt |
189
- | Role limit exceeded | Merge overlapping roles |
@@ -1,100 +0,0 @@
1
- # Tasks Schema — team-lifecycle-v4
2
-
3
- > Base schema: `~/.maestro/templates/cli/schemas/team-tasks-schema.json`
4
-
5
- This file documents lifecycle-v4 specific extensions to the universal team tasks schema.
6
-
7
- ## Session ID Format
8
-
9
- `tlv4-<topic>-<YYYYMMDD>` (e.g., `tlv4-auth-system-20260324`)
10
-
11
- ## Valid Roles
12
-
13
- Must match a directory in `.codex/skills/team-lifecycle-v4/roles/`:
14
-
15
- | Role | Task Prefix | Description |
16
- |------|-------------|-------------|
17
- | analyst | RESEARCH | Domain research and analysis |
18
- | writer | DRAFT | Document generation (product brief, requirements, etc.) |
19
- | planner | PLAN | Architecture and planning |
20
- | executor | IMPL | Code implementation |
21
- | tester | TEST | Testing and validation |
22
- | reviewer | REVIEW / QUALITY | Code and spec review |
23
- | supervisor | CHECKPOINT | Quality gate verification |
24
- | coordinator | (orchestrator) | Pipeline orchestration (not a task role) |
25
-
26
- ## Valid Pipeline Phases
27
-
28
- From `specs/pipelines.md`:
29
-
30
- | Phase | Wave | Description |
31
- |-------|------|-------------|
32
- | research | 1 | Domain exploration |
33
- | product-brief | 2 | Vision and problem definition |
34
- | requirements | 3 | Functional/non-functional requirements |
35
- | architecture | 4 | System design |
36
- | epics | 5 | Epic and story breakdown |
37
- | readiness | 6 | Pre-implementation readiness check |
38
- | checkpoint | varies | Supervision gates |
39
- | planning | 7 | Detailed implementation planning |
40
- | arch-detail | 8 | Architecture refinement |
41
- | orchestration | 9 | Task orchestration |
42
- | implementation | 10+ | Code writing |
43
- | validation | varies | Testing |
44
- | review | varies | Code/spec review |
45
-
46
- ## Valid Pipelines
47
-
48
- | Pipeline | Description |
49
- |----------|-------------|
50
- | spec-only | Research → Brief → Requirements → Architecture → Epics → Readiness |
51
- | impl-only | Planning → Implementation → Validation → Review |
52
- | full-lifecycle | spec-only + impl-only combined |
53
- | fe-only | Frontend-specific implementation |
54
- | fullstack | Full-stack implementation |
55
- | full-lifecycle-fe | Full lifecycle with frontend focus |
56
-
57
- ## Example
58
-
59
- ```json
60
- {
61
- "session_id": "tlv4-auth-system-20260324",
62
- "skill": "team-lifecycle-v4",
63
- "pipeline": "full-lifecycle",
64
- "requirement": "Design and implement user authentication system with OAuth2 and RBAC",
65
- "created_at": "2026-03-24T10:00:00+08:00",
66
- "supervision": true,
67
- "completed_waves": [1],
68
- "active_agents": { "DRAFT-001": "agent-abc123" },
69
- "tasks": {
70
- "RESEARCH-001": {
71
- "title": "Domain research",
72
- "description": "Explore auth domain: OAuth2 flows, RBAC patterns, competitor analysis",
73
- "role": "analyst",
74
- "pipeline_phase": "research",
75
- "deps": [],
76
- "context_from": [],
77
- "wave": 1,
78
- "status": "completed",
79
- "findings": "Identified OAuth2+RBAC pattern, 5 integration points, SSO requirement",
80
- "quality_score": null,
81
- "supervision_verdict": null,
82
- "error": null
83
- },
84
- "DRAFT-001": {
85
- "title": "Product brief",
86
- "description": "Generate product brief from research context",
87
- "role": "writer",
88
- "pipeline_phase": "product-brief",
89
- "deps": ["RESEARCH-001"],
90
- "context_from": ["RESEARCH-001"],
91
- "wave": 2,
92
- "status": "in_progress",
93
- "findings": null,
94
- "quality_score": null,
95
- "supervision_verdict": null,
96
- "error": null
97
- }
98
- }
99
- }
100
- ```
@@ -1,204 +0,0 @@
1
- # Knowledge Transfer Protocols
2
-
3
- ## 1. Transfer Channels
4
-
5
- | Channel | Method | Producer | Consumer |
6
- |---------|--------|----------|----------|
7
- | Artifacts | Files in `<session>/artifacts/` | Task executor | Next task in pipeline |
8
- | Discoveries | Files in `<session>/discoveries/{task_id}.json` | Task executor | Coordinator + downstream |
9
- | Wisdom | Append to `<session>/wisdom/*.md` | Any role | All roles |
10
- | Context Accumulator | In-memory aggregation | Inner loop only | Current task |
11
- | Exploration Cache | `<session>/explorations/` | Analyst / researcher | All roles |
12
- | **Progress Milestones** | `team_msg` type=progress/blocker/task_complete | Worker (all roles) | Coordinator + Human (CLI) |
13
- | **Cross-Worker Handoff** | `send_message` from coordinator to running worker | Coordinator | Running worker |
14
-
15
- ## 2. Context Loading Protocol (Before Task Execution)
16
-
17
- Every role MUST load context in this order before starting work.
18
-
19
- | Step | Action | Required |
20
- |------|--------|----------|
21
- | 1 | Read `<session>/tasks.json` -- locate upstream task entries, check status and findings | Yes |
22
- | 2 | Read `<session>/discoveries/{upstream_id}.json` for each upstream dependency -- get detailed findings and artifact paths | Yes |
23
- | 3 | Read artifact files from upstream discovery's `artifacts_produced` paths | Yes |
24
- | 4 | Read `<session>/wisdom/*.md` if exists | Yes |
25
- | 5 | Check `<session>/explorations/cache-index.json` before new exploration | If exploring |
26
-
27
- **Loading rules**:
28
- - Never skip step 1 -- tasks.json contains task status, wave progression, and summary findings
29
- - Never skip step 2 -- discoveries contain detailed key_findings, decisions, and artifact references
30
- - If artifact path in discovery does not exist, log warning and continue
31
- - Wisdom files are append-only -- read all entries, newest last
32
-
33
- ## 3. Context Publishing Protocol (After Task Completion)
34
-
35
- | Step | Action | Required |
36
- |------|--------|----------|
37
- | 1 | Write deliverable to `<session>/artifacts/<task-id>-<name>.md` | Yes |
38
- | 2 | Write `<session>/discoveries/{task_id}.json` with payload (see schema below) | Yes |
39
- | 3 | Append wisdom entries for learnings, decisions, issues found | If applicable |
40
-
41
- ## 4. Discovery File Schema
42
-
43
- Written to `<session>/discoveries/{task_id}.json` on task completion.
44
-
45
- ```json
46
- {
47
- "task_id": "<TASK-NNN>",
48
- "worker": "<TASK-NNN>",
49
- "timestamp": "2026-03-24T10:15:00+08:00",
50
- "type": "<pipeline_phase>",
51
- "status": "completed | failed",
52
- "findings": "Summary string (max 500 chars)",
53
- "quality_score": null,
54
- "supervision_verdict": null,
55
- "error": null,
56
- "data": {
57
- "key_findings": [
58
- "Finding 1",
59
- "Finding 2"
60
- ],
61
- "decisions": [
62
- "Decision with rationale"
63
- ],
64
- "files_modified": [
65
- "path/to/file.ts"
66
- ],
67
- "verification": "self-validated | peer-reviewed | tested"
68
- },
69
- "artifacts_produced": [
70
- "<session>/artifacts/<task-id>-<name>.md"
71
- ]
72
- }
73
- ```
74
-
75
- **Field rules**:
76
- - `artifacts_produced`: Always artifact paths, never inline content
77
- - `data.key_findings`: Max 5 items, each under 100 chars
78
- - `data.decisions`: Include rationale, not just the choice
79
- - `data.files_modified`: Only for implementation tasks
80
- - `data.verification`: One of `self-validated`, `peer-reviewed`, `tested`
81
-
82
- **Supervisor-specific extensions** (CHECKPOINT tasks only):
83
-
84
- ```json
85
- {
86
- "supervision_verdict": "pass | warn | block",
87
- "supervision_score": 0.85,
88
- "data": {
89
- "risks_logged": 0,
90
- "blocks_detected": 0
91
- }
92
- }
93
- ```
94
-
95
- - `supervision_verdict`: Required for CHECKPOINT tasks. Determines pipeline progression.
96
- - `supervision_score`: Float 0.0-1.0. Aggregate of individual check scores.
97
- - `data.risks_logged`: Count of risks written to wisdom/issues.md.
98
- - `data.blocks_detected`: Count of blocking issues found. >0 implies verdict=block.
99
-
100
- ## 5. Exploration Cache Protocol
101
-
102
- Prevents redundant research across tasks.
103
-
104
- | Step | Action |
105
- |------|--------|
106
- | 1 | Read `<session>/explorations/cache-index.json` |
107
- | 2 | If angle already explored, read cached result from `explore-<angle>.json` |
108
- | 3 | If not cached, perform exploration |
109
- | 4 | Write result to `<session>/explorations/explore-<angle>.json` |
110
- | 5 | Update `cache-index.json` with new entry |
111
-
112
- **cache-index.json format**:
113
- ```json
114
- {
115
- "entries": [
116
- {
117
- "angle": "competitor-analysis",
118
- "file": "explore-competitor-analysis.json",
119
- "created_by": "RESEARCH-001",
120
- "timestamp": "2026-01-15T10:30:00Z"
121
- }
122
- ]
123
- }
124
- ```
125
-
126
- **Rules**:
127
- - Cache key is the exploration `angle` (normalized to kebab-case)
128
- - Cache entries never expire within a session
129
- - Any role can read cached explorations; only the creator updates them
130
-
131
- ## 6. Progress Milestone Protocol
132
-
133
- Workers report progress during execution via `team_msg`. This provides:
134
- - **Human CLI monitoring**: `maestro agent-msg list -s <session-id> --type progress` works while coordinator is blocked in `wait_agent`
135
- - **Coordinator post-wait trace**: Full execution history for forensics and status display
136
- - **Blocker awareness**: Coordinator knows where worker got stuck on timeout
137
-
138
- ### Message Types
139
-
140
- | Type | When | Purpose |
141
- |------|------|---------|
142
- | `progress` | At natural phase boundaries | Report milestone reached + progress % |
143
- | `blocker` | Immediately on error | Report blocking issue without waiting |
144
- | `task_complete` | After `report_agent_job_result` | Final status for coordinator trace |
145
-
146
- ### Progress Message Schema
147
-
148
- ```javascript
149
- mcp__maestro-tools__team_msg({
150
- operation: "log",
151
- session_id: "<session_id>",
152
- from: "<task_id>", // e.g., "IMPL-001"
153
- to: "coordinator",
154
- type: "progress", // or "blocker" or "task_complete"
155
- summary: "[<task_id>] <phase description> (<pct>%)",
156
- data: {
157
- task_id: "<task_id>",
158
- role: "<role>",
159
- status: "in_progress", // in_progress | blocked | completed
160
- progress_pct: 0-100,
161
- phase: "<what just completed>",
162
- key_info: "<most important finding>"
163
- }
164
- })
165
- ```
166
-
167
- ### Timing Constraint
168
-
169
- `wait_agent` is **blocking** — coordinator cannot read team_msg during wait. Progress is only consumed:
170
- 1. On `handleCheck` (user types "check" while coordinator is idle)
171
- 2. On `handleResume` after `wait_agent` returns (drain bus before collecting discoveries)
172
- 3. By human via `maestro agent-msg list` CLI (works anytime, independent of coordinator)
173
-
174
- ### Relationship to Discoveries
175
-
176
- - **Progress milestones** = lightweight trace during execution (via team_msg)
177
- - **Discovery files** = authoritative final output (via `discoveries/{task_id}.json`)
178
- - If team_msg fails, worker continues — discovery file is ground truth
179
- - Coordinator always reads both: team_msg for trace, discoveries for results
180
-
181
- ## 7. Cross-Worker Handoff Protocol
182
-
183
- When worker A completes and worker B is still running, coordinator pushes A's findings to B via `send_message`:
184
-
185
- ```javascript
186
- // In handleSpawnNext, after collecting A's discovery:
187
- send_message({
188
- target: "IMPL-002", // B's task_name
189
- message: `## Supplementary Context from IMPL-001\n${findingsFromA}`
190
- })
191
- // Note: send_message queues info without interrupting B's current work
192
- ```
193
-
194
- **When to send**: After each wave of discoveries is collected, if any running worker could benefit from the new findings.
195
- **What to send**: Key findings and decisions from completed tasks, especially those listed in `context_from` deps.
196
-
197
- ## 8. Platform Mapping Reference
198
-
199
- | Claude Code Operation | Codex Equivalent |
200
- |----------------------|------------------|
201
- | `team_msg(operation="get_state", role=<upstream>)` | Read `tasks.json` + Read `discoveries/{upstream_id}.json` |
202
- | `team_msg(type="state_update", payload={...})` | Write `discoveries/{task_id}.json` |
203
- | `TaskCreate` / `TaskUpdate` status fields | Read/Write `tasks.json` task entries |
204
- | In-memory state aggregation | Parse `tasks.json` + glob `discoveries/*.json` |
@@ -1,72 +0,0 @@
1
- # Analyze Task
2
-
3
- Parse user task -> detect QA capabilities -> build dependency graph -> design roles.
4
-
5
- **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
-
7
- ## Signal Detection
8
-
9
- | Keywords | Capability | Prefix |
10
- |----------|------------|--------|
11
- | scan, discover, find issues, audit | scout | SCOUT |
12
- | strategy, plan, test layers, coverage | strategist | QASTRAT |
13
- | generate tests, write tests, create tests | generator | QAGEN |
14
- | run tests, execute, fix tests | executor | QARUN |
15
- | analyze, report, quality score | analyst | QAANA |
16
-
17
- ## QA Mode Detection
18
-
19
- | Condition | Mode |
20
- |-----------|------|
21
- | Keywords: discovery, scan, issues, bug-finding | discovery |
22
- | Keywords: test, coverage, TDD, unit, integration | testing |
23
- | Both keyword types OR no clear match | full |
24
-
25
- ## Dependency Graph
26
-
27
- Natural ordering tiers for QA pipeline:
28
- - Tier 0: scout (issue discovery)
29
- - Tier 1: strategist (strategy requires scout discoveries)
30
- - Tier 2: generator (generation requires strategy)
31
- - Tier 3: executor (execution requires generated tests)
32
- - Tier 4: analyst (analysis requires execution results)
33
-
34
- ## Pipeline Definitions
35
-
36
- ```
37
- Discovery Mode: SCOUT -> QASTRAT -> QAGEN(L1) -> QARUN(L1) -> QAANA
38
- Testing Mode: QASTRAT -> QAGEN(L1) -> QARUN(L1) -> QAGEN(L2) -> QARUN(L2) -> QAANA
39
- Full Mode: SCOUT -> QASTRAT -> [QAGEN(L1) || QAGEN(L2)] -> [QARUN(L1) || QARUN(L2)] -> QAANA -> SCOUT(regression)
40
- ```
41
-
42
- ## Complexity Scoring
43
-
44
- | Factor | Points |
45
- |--------|--------|
46
- | Per capability | +1 |
47
- | Cross-domain (test + discovery) | +2 |
48
- | Parallel tracks | +1 per track |
49
- | Serial depth > 3 | +1 |
50
-
51
- Results: 1-3 Low, 4-6 Medium, 7+ High
52
-
53
- ## Role Minimization
54
-
55
- - Cap at 6 roles (coordinator + 5 workers)
56
- - Merge overlapping capabilities
57
- - Absorb trivial single-step roles
58
-
59
- ## Output
60
-
61
- Write <session>/task-analysis.json:
62
- ```json
63
- {
64
- "task_description": "<original>",
65
- "pipeline_mode": "<discovery|testing|full>",
66
- "capabilities": [{ "name": "<cap>", "prefix": "<PREFIX>", "keywords": ["..."] }],
67
- "dependency_graph": { "<TASK-ID>": { "role": "<role>", "addBlockedBy": ["..."], "priority": "P0|P1|P2" } },
68
- "roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": false }],
69
- "complexity": { "score": 0, "level": "Low|Medium|High" },
70
- "gc_loop_enabled": true
71
- }
72
- ```
@@ -1,108 +0,0 @@
1
- # Dispatch Tasks
2
-
3
- Create task chains from dependency graph with proper blockedBy relationships.
4
-
5
- ## Workflow
6
-
7
- 1. Read task-analysis.json -> extract pipeline_mode and dependency_graph
8
- 2. Read specs/pipelines.md -> get task registry for selected pipeline
9
- 3. Topological sort tasks (respect blockedBy)
10
- 4. Validate all owners exist in role registry (SKILL.md)
11
- 5. For each task (in order):
12
- - Build JSON entry with structured description (see template below)
13
- - Set blockedBy and owner fields in the entry
14
- 6. Write all entries to `<session>/tasks.json`
15
- 7. Update session.json with pipeline.tasks_total
16
- 8. Validate chain (no orphans, no cycles, all refs valid)
17
-
18
- ## Task Description Template
19
-
20
- Each task is a JSON entry in the tasks array:
21
-
22
- ```json
23
- {
24
- "id": "<TASK-ID>",
25
- "subject": "<TASK-ID>",
26
- "description": "PURPOSE: <goal> | Success: <criteria>\nTASK:\n - <step 1>\n - <step 2>\nCONTEXT:\n - Session: <session-folder>\n - Layer: <L1-unit|L2-integration|L3-e2e> (if applicable)\n - Upstream artifacts: <list>\n - Shared memory: <session>/wisdom/.msg/meta.json\nEXPECTED: <artifact path> + <quality criteria>\nCONSTRAINTS: <scope limits>\n---\nInnerLoop: <true|false>\nRoleSpec: ~ or <project>/.codex/skills/team-quality-assurance/roles/<role>/role.md",
27
- "status": "pending",
28
- "owner": "<role>",
29
- "blockedBy": ["<dependency-list>"]
30
- }
31
- ```
32
-
33
- ## Pipeline Task Registry
34
-
35
- ### Discovery Mode
36
- ```
37
- SCOUT-001 (scout): Multi-perspective issue scanning
38
- blockedBy: []
39
- QASTRAT-001 (strategist): Test strategy formulation
40
- blockedBy: [SCOUT-001]
41
- QAGEN-001 (generator): L1 unit test generation
42
- blockedBy: [QASTRAT-001], meta: layer=L1
43
- QARUN-001 (executor): L1 test execution + fix cycles
44
- blockedBy: [QAGEN-001], inner_loop: true, meta: layer=L1
45
- QAANA-001 (analyst): Quality analysis report
46
- blockedBy: [QARUN-001]
47
- ```
48
-
49
- ### Testing Mode
50
- ```
51
- QASTRAT-001 (strategist): Test strategy formulation
52
- blockedBy: []
53
- QAGEN-L1-001 (generator): L1 unit test generation
54
- blockedBy: [QASTRAT-001], meta: layer=L1
55
- QARUN-L1-001 (executor): L1 test execution + fix cycles
56
- blockedBy: [QAGEN-L1-001], inner_loop: true, meta: layer=L1
57
- QAGEN-L2-001 (generator): L2 integration test generation
58
- blockedBy: [QARUN-L1-001], meta: layer=L2
59
- QARUN-L2-001 (executor): L2 test execution + fix cycles
60
- blockedBy: [QAGEN-L2-001], inner_loop: true, meta: layer=L2
61
- QAANA-001 (analyst): Quality analysis report
62
- blockedBy: [QARUN-L2-001]
63
- ```
64
-
65
- ### Full Mode
66
- ```
67
- SCOUT-001 (scout): Multi-perspective issue scanning
68
- blockedBy: []
69
- QASTRAT-001 (strategist): Test strategy formulation
70
- blockedBy: [SCOUT-001]
71
- QAGEN-L1-001 (generator-1): L1 unit test generation
72
- blockedBy: [QASTRAT-001], meta: layer=L1
73
- QAGEN-L2-001 (generator-2): L2 integration test generation
74
- blockedBy: [QASTRAT-001], meta: layer=L2
75
- QARUN-L1-001 (executor-1): L1 test execution + fix cycles
76
- blockedBy: [QAGEN-L1-001], inner_loop: true, meta: layer=L1
77
- QARUN-L2-001 (executor-2): L2 test execution + fix cycles
78
- blockedBy: [QAGEN-L2-001], inner_loop: true, meta: layer=L2
79
- QAANA-001 (analyst): Quality analysis report
80
- blockedBy: [QARUN-L1-001, QARUN-L2-001]
81
- SCOUT-002 (scout): Regression scan after fixes
82
- blockedBy: [QAANA-001]
83
- ```
84
-
85
- ## InnerLoop Flag Rules
86
-
87
- - true: executor roles (run-fix cycles)
88
- - false: scout, strategist, generator, analyst roles
89
-
90
- ## Dependency Validation
91
-
92
- - No orphan tasks (all tasks have valid owner)
93
- - No circular dependencies
94
- - All blockedBy references exist
95
- - Session reference in every task description
96
- - RoleSpec reference in every task description
97
-
98
- ## Log After Creation
99
-
100
- ```
101
- mcp__maestro-tools__team_msg({
102
- operation: "log",
103
- session_id: <session-id>,
104
- from: "coordinator",
105
- type: "pipeline_selected",
106
- data: { pipeline: "<mode>", task_count: <N> }
107
- })
108
- ```