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.
- package/.claude/commands/maestro-ralph.md +548 -377
- package/.claude/commands/maestro.md +220 -191
- package/.codex/skills/maestro/SKILL.md +495 -462
- package/.codex/skills/maestro-collab/SKILL.md +218 -117
- package/.codex/skills/maestro-execute/SKILL.md +13 -11
- package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
- package/.codex/skills/maestro-ralph/SKILL.md +491 -339
- package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
- package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
- package/.codex/skills/quality-debug/SKILL.md +35 -31
- package/.codex/skills/quality-refactor/SKILL.md +20 -12
- package/.codex/skills/quality-review/SKILL.md +21 -17
- package/.codex/skills/team-coordinate/SKILL.md +462 -235
- package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
- package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
- package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
- package/.codex/skills/team-review/SKILL.md +198 -159
- package/.codex/skills/team-tech-debt/SKILL.md +214 -144
- package/.codex/skills/team-testing/SKILL.md +210 -158
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +25 -33
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +9 -3
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +5 -2
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +20 -8
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js +6 -3
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js +7 -1
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js +40 -15
- package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js +59 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js +78 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.d.ts +25 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js +40 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js +89 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +19 -8
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.d.ts +6 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js +7 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js +46 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js.map +1 -0
- package/dashboard/dist-server/shared/agent-types.d.ts +6 -0
- package/dist/shared/agent-types.d.ts +6 -0
- package/dist/shared/agent-types.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +3 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +1 -0
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/commands/delegate.d.ts +2 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +18 -0
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/config/cli-tools-config.d.ts +3 -0
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/package.json +1 -1
- package/shared/agent-types.ts +237 -231
- package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
- package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
- package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
- package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
- package/.codex/skills/team-executor/SKILL.md +0 -116
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
- package/.codex/skills/team-executor/roles/executor/role.md +0 -173
- package/.codex/skills/team-executor/specs/session-schema.md +0 -230
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
- package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
- package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
- package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# Executor Role
|
|
2
|
-
|
|
3
|
-
Orchestrate the team-executor workflow: session validation, state reconciliation, team_worker dispatch, progress monitoring, completion action. The sole built-in role -- all worker roles are loaded from session role-specs and spawned via team_worker agent.
|
|
4
|
-
|
|
5
|
-
## Identity
|
|
6
|
-
|
|
7
|
-
- **Name**: `executor` | **Tag**: `[executor]`
|
|
8
|
-
- **Responsibility**: Validate session -> Reconcile state -> Create session -> Dispatch team_worker agents -> Monitor progress -> Completion action -> Report results
|
|
9
|
-
|
|
10
|
-
## Boundaries
|
|
11
|
-
|
|
12
|
-
### MUST
|
|
13
|
-
- Validate session structure before any execution
|
|
14
|
-
- Reconcile session state with tasks.json on startup
|
|
15
|
-
- Reset in_progress tasks to pending (interrupted tasks)
|
|
16
|
-
- Detect fast-advance orphans and reset to pending
|
|
17
|
-
- Spawn team_worker agents via spawn_agent and wait via wait_agent
|
|
18
|
-
- Monitor progress via wait_agent and route messages
|
|
19
|
-
- Maintain session state persistence (tasks.json)
|
|
20
|
-
- Handle capability_gap reports with warning only (cannot generate role-specs)
|
|
21
|
-
- Execute completion action when pipeline finishes
|
|
22
|
-
|
|
23
|
-
### MUST NOT
|
|
24
|
-
- Execute task work directly (delegate to workers)
|
|
25
|
-
- Modify task output artifacts (workers own their deliverables)
|
|
26
|
-
- Call CLI tools or spawn utility members directly for implementation (code-developer, etc.)
|
|
27
|
-
- Generate new role-specs (use existing session role-specs only)
|
|
28
|
-
- Skip session validation
|
|
29
|
-
- Override consensus_blocked HIGH without user confirmation
|
|
30
|
-
- Spawn workers with `general-purpose` agent (MUST use `team_worker`)
|
|
31
|
-
|
|
32
|
-
> **Core principle**: executor is the orchestrator, not the executor. All actual work is delegated to session-defined worker roles via team_worker agents. Unlike team-coordinate coordinator, executor CANNOT generate new role-specs.
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Entry Router
|
|
37
|
-
|
|
38
|
-
When executor is invoked, first detect the invocation type:
|
|
39
|
-
|
|
40
|
-
| Detection | Condition | Handler |
|
|
41
|
-
|-----------|-----------|---------|
|
|
42
|
-
| Status check | Arguments contain "check" or "status" | -> handleCheck |
|
|
43
|
-
| Manual resume | Arguments contain "resume" or "continue" | -> handleResume |
|
|
44
|
-
| Capability gap | Message contains "capability_gap" | -> handleAdapt |
|
|
45
|
-
| Pipeline complete | All tasks completed, no pending/in_progress | -> handleComplete |
|
|
46
|
-
| New execution | None of above | -> Phase 0 |
|
|
47
|
-
|
|
48
|
-
For check/resume/adapt/complete: load `commands/monitor.md` and execute the appropriate handler, then STOP.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Phase 0: Session Validation + State Reconciliation
|
|
53
|
-
|
|
54
|
-
**Objective**: Validate session structure and reconcile session state with actual task status.
|
|
55
|
-
|
|
56
|
-
### Step 1: Session Validation
|
|
57
|
-
|
|
58
|
-
Validate session structure (see SKILL.md Session Validation):
|
|
59
|
-
- [ ] Directory exists at session path
|
|
60
|
-
- [ ] `tasks.json` exists and parses
|
|
61
|
-
- [ ] `task-analysis.json` exists and parses
|
|
62
|
-
- [ ] `role-specs/` directory has >= 1 .md files
|
|
63
|
-
- [ ] All roles in tasks.json#roles have corresponding role-spec .md files
|
|
64
|
-
- [ ] Role-spec files have valid YAML frontmatter + Phase 2-4 sections
|
|
65
|
-
|
|
66
|
-
If validation fails -> ERROR with specific reason -> STOP
|
|
67
|
-
|
|
68
|
-
### Step 2: Load Session State
|
|
69
|
-
|
|
70
|
-
Read tasks.json and task-analysis.json.
|
|
71
|
-
|
|
72
|
-
### Step 3: Reconcile with tasks.json
|
|
73
|
-
|
|
74
|
-
Compare tasks.json task statuses with session expectations, bidirectional sync.
|
|
75
|
-
|
|
76
|
-
### Step 4: Reset Interrupted Tasks
|
|
77
|
-
|
|
78
|
-
Reset any in_progress tasks to pending.
|
|
79
|
-
|
|
80
|
-
### Step 5: Detect Fast-Advance Orphans
|
|
81
|
-
|
|
82
|
-
In_progress tasks without matching active_agents + created > 5 minutes -> reset to pending.
|
|
83
|
-
|
|
84
|
-
### Step 6: Create Missing Tasks (if needed)
|
|
85
|
-
|
|
86
|
-
For each task in task-analysis, check if exists in tasks.json, create if missing.
|
|
87
|
-
|
|
88
|
-
### Step 7: Update Session File
|
|
89
|
-
|
|
90
|
-
Write reconciled tasks.json.
|
|
91
|
-
|
|
92
|
-
### Step 8: Session Setup
|
|
93
|
-
|
|
94
|
-
Initialize session folder if needed.
|
|
95
|
-
|
|
96
|
-
**Success**: Session validated, state reconciled, session ready -> Phase 1
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Phase 1: Spawn-and-Wait
|
|
101
|
-
|
|
102
|
-
**Objective**: Spawn first batch of ready workers as team_worker agents, wait for completion, then continue.
|
|
103
|
-
|
|
104
|
-
**Workflow**:
|
|
105
|
-
1. Load `commands/monitor.md`
|
|
106
|
-
2. Find tasks with: status=pending, deps all resolved, owner assigned
|
|
107
|
-
3. For each ready task -> spawn team_worker via spawn_agent, wait via wait_agent
|
|
108
|
-
4. Process results, advance pipeline
|
|
109
|
-
5. Repeat until all tasks complete or pipeline blocked
|
|
110
|
-
6. Output status summary with execution graph
|
|
111
|
-
|
|
112
|
-
**Pipeline advancement** driven by:
|
|
113
|
-
- Synchronous wait_agent loop (automatic)
|
|
114
|
-
- User "check" -> handleCheck (status only)
|
|
115
|
-
- User "resume" -> handleResume (advance)
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## Phase 2: Report + Completion Action
|
|
120
|
-
|
|
121
|
-
**Objective**: Completion report, interactive completion choice, and follow-up options.
|
|
122
|
-
|
|
123
|
-
**Workflow**:
|
|
124
|
-
1. Load session state -> count completed tasks, duration
|
|
125
|
-
2. List all deliverables with output paths in `<session>/artifacts/`
|
|
126
|
-
3. Include discussion summaries (if inline discuss was used)
|
|
127
|
-
4. Summarize wisdom accumulated during execution
|
|
128
|
-
5. Output report:
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
[executor] ============================================
|
|
132
|
-
[executor] TASK COMPLETE
|
|
133
|
-
[executor]
|
|
134
|
-
[executor] Deliverables:
|
|
135
|
-
[executor] - <artifact-1.md> (<producer role>)
|
|
136
|
-
[executor] - <artifact-2.md> (<producer role>)
|
|
137
|
-
[executor]
|
|
138
|
-
[executor] Pipeline: <completed>/<total> tasks
|
|
139
|
-
[executor] Roles: <role-list>
|
|
140
|
-
[executor] Duration: <elapsed>
|
|
141
|
-
[executor]
|
|
142
|
-
[executor] Session: <session-folder>
|
|
143
|
-
[executor] ============================================
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
6. **Execute Completion Action** (based on tasks.json completion_action):
|
|
147
|
-
|
|
148
|
-
| Mode | Behavior |
|
|
149
|
-
|------|----------|
|
|
150
|
-
| `interactive` | request_user_input with Archive/Keep/Export options |
|
|
151
|
-
| `auto_archive` | Execute Archive & Clean (rm -rf session folder) without prompt |
|
|
152
|
-
| `auto_keep` | Execute Keep Active without prompt |
|
|
153
|
-
|
|
154
|
-
**Interactive handler**: See SKILL.md Completion Action section.
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Agent Lifecycle Management
|
|
159
|
-
- **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`.
|
|
160
|
-
|
|
161
|
-
## Error Handling
|
|
162
|
-
|
|
163
|
-
| Error | Resolution |
|
|
164
|
-
|-------|------------|
|
|
165
|
-
| Session validation fails | ERROR with specific reason, suggest re-run team-coordinate |
|
|
166
|
-
| Task timeout | Log, mark failed, ask user to retry or skip |
|
|
167
|
-
| Worker crash | Reset task to pending in tasks.json, respawn via spawn_agent |
|
|
168
|
-
| Session corruption | Attempt recovery, fallback to manual reconciliation |
|
|
169
|
-
| capability_gap reported | handleAdapt: WARN only, cannot generate new role-specs |
|
|
170
|
-
| Pipeline stall (no ready, no running) | Check for missing tasks, report to user |
|
|
171
|
-
| Fast-advance conflict | Executor reconciles, no duplicate spawns |
|
|
172
|
-
| Role-spec file not found | ERROR, cannot proceed without role definition |
|
|
173
|
-
| Completion action fails | Default to Keep Active, log warning |
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
# Session Schema
|
|
2
|
-
|
|
3
|
-
Required session structure for team-executor v2. All components MUST exist for valid execution. Updated for role-spec architecture (lightweight Phase 2-4 files instead of full role.md files).
|
|
4
|
-
|
|
5
|
-
## Directory Structure
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
<session-folder>/
|
|
9
|
-
+-- team-session.json # Session state + dynamic role registry (REQUIRED)
|
|
10
|
-
+-- task-analysis.json # Task analysis output: capabilities, dependency graph (REQUIRED)
|
|
11
|
-
+-- role-specs/ # Dynamic role-spec definitions (REQUIRED, >= 1 .md file)
|
|
12
|
-
| +-- <role-1>.md # Lightweight: YAML frontmatter + Phase 2-4 only
|
|
13
|
-
| +-- <role-2>.md
|
|
14
|
-
+-- artifacts/ # All MD deliverables from workers
|
|
15
|
-
| +-- <artifact>.md
|
|
16
|
-
+-- .msg/ # Team message bus + state
|
|
17
|
-
| +-- messages.jsonl # Message log
|
|
18
|
-
| +-- meta.json # Session metadata + cross-role state
|
|
19
|
-
+-- wisdom/ # Cross-task knowledge
|
|
20
|
-
| +-- learnings.md
|
|
21
|
-
| +-- decisions.md
|
|
22
|
-
| +-- issues.md
|
|
23
|
-
+-- explorations/ # Shared explore cache
|
|
24
|
-
| +-- cache-index.json
|
|
25
|
-
| +-- explore-<angle>.json
|
|
26
|
-
+-- discussions/ # Inline discuss records
|
|
27
|
-
| +-- <round>.md
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Validation Checklist
|
|
31
|
-
|
|
32
|
-
team-executor validates the following before execution:
|
|
33
|
-
|
|
34
|
-
### Required Components
|
|
35
|
-
|
|
36
|
-
| Component | Validation | Error Message |
|
|
37
|
-
|-----------|------------|---------------|
|
|
38
|
-
| `--session` argument | Must be provided | "Session required. Usage: --session=<path-to-TC-folder>" |
|
|
39
|
-
| Directory | Must exist at path | "Session directory not found: <path>" |
|
|
40
|
-
| `team-session.json` | Must exist, parse as JSON, and contain all required fields | "Invalid session: team-session.json missing, corrupt, or missing required fields" |
|
|
41
|
-
| `task-analysis.json` | Must exist, parse as JSON, and contain all required fields | "Invalid session: task-analysis.json missing, corrupt, or missing required fields" |
|
|
42
|
-
| `role-specs/` directory | Must exist and contain >= 1 .md file | "Invalid session: no role-spec files in role-specs/" |
|
|
43
|
-
| Role-spec file mapping | Each role in team-session.json#roles must have .md file | "Role-spec file not found: role-specs/<role>.md" |
|
|
44
|
-
| Role-spec structure | Each role-spec must have YAML frontmatter + Phase 2-4 sections | "Invalid role-spec: role-specs/<role>.md missing required section" |
|
|
45
|
-
|
|
46
|
-
### Validation Order
|
|
47
|
-
|
|
48
|
-
Validate in sequence; halt on first error:
|
|
49
|
-
|
|
50
|
-
| Step | Target | Required Fields / Checks | Error on Failure |
|
|
51
|
-
|------|--------|--------------------------|------------------|
|
|
52
|
-
| 1 | `--session=<path>` argument | Must be provided | "Session required. Usage: --session=<path-to-TC-folder>" |
|
|
53
|
-
| 2 | Directory at path | Must exist | "Session directory not found: <path>" |
|
|
54
|
-
| 3 | `team-session.json` | Exists, valid JSON, contains: `session_id` (string), `task_description` (string), `status` (active\|paused\|completed), `team_name` (string), `roles` (non-empty array) | "Invalid session: team-session.json missing, corrupt, or missing required fields" |
|
|
55
|
-
| 4 | `task-analysis.json` | Exists, valid JSON, contains: `capabilities` (array), `dependency_graph` (object), `roles` (non-empty array) | "Invalid session: task-analysis.json missing, corrupt, or missing required fields" |
|
|
56
|
-
| 5 | `role-specs/` directory | Exists, contains >= 1 `.md` file | "Invalid session: no role-spec files in role-specs/" |
|
|
57
|
-
| 6 | Role-spec mapping | Each role in `team-session.json#roles` has matching `role-specs/<role.name>.md`; each file passes Role-Spec Structure Validation | "Role-spec file not found: role-specs/<role.name>.md" |
|
|
58
|
-
|
|
59
|
-
All checks pass -> proceed to Phase 0.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## team-session.json Schema
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"session_id": "TC-<slug>-<date>",
|
|
68
|
-
"task_description": "<original user input>",
|
|
69
|
-
"status": "active | paused | completed",
|
|
70
|
-
"team_name": "<team-name>",
|
|
71
|
-
"roles": [
|
|
72
|
-
{
|
|
73
|
-
"name": "<role-name>",
|
|
74
|
-
"prefix": "<PREFIX>",
|
|
75
|
-
"responsibility_type": "<type>",
|
|
76
|
-
"inner_loop": false,
|
|
77
|
-
"role_spec": "role-specs/<role-name>.md"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"pipeline": {
|
|
81
|
-
"dependency_graph": {},
|
|
82
|
-
"tasks_total": 0,
|
|
83
|
-
"tasks_completed": 0
|
|
84
|
-
},
|
|
85
|
-
"active_workers": [],
|
|
86
|
-
"completed_tasks": [],
|
|
87
|
-
"completion_action": "interactive",
|
|
88
|
-
"created_at": "<timestamp>"
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Required Fields
|
|
93
|
-
|
|
94
|
-
| Field | Type | Description |
|
|
95
|
-
|-------|------|-------------|
|
|
96
|
-
| `session_id` | string | Unique session identifier |
|
|
97
|
-
| `task_description` | string | Original task description from user |
|
|
98
|
-
| `status` | string | One of: "active", "paused", "completed" |
|
|
99
|
-
| `team_name` | string | Team name for Agent tool |
|
|
100
|
-
| `roles` | array | List of role definitions |
|
|
101
|
-
| `roles[].name` | string | Role name (must match .md filename) |
|
|
102
|
-
| `roles[].prefix` | string | Task prefix for this role |
|
|
103
|
-
| `roles[].role_spec` | string | Relative path to role-spec file |
|
|
104
|
-
|
|
105
|
-
### Optional Fields
|
|
106
|
-
|
|
107
|
-
| Field | Type | Description |
|
|
108
|
-
|-------|------|-------------|
|
|
109
|
-
| `pipeline` | object | Pipeline metadata |
|
|
110
|
-
| `active_workers` | array | Currently running workers |
|
|
111
|
-
| `completed_tasks` | array | List of completed task IDs |
|
|
112
|
-
| `completion_action` | string | Completion mode: interactive, auto_archive, auto_keep |
|
|
113
|
-
| `created_at` | string | ISO timestamp |
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## task-analysis.json Schema
|
|
118
|
-
|
|
119
|
-
```json
|
|
120
|
-
{
|
|
121
|
-
"capabilities": [
|
|
122
|
-
{
|
|
123
|
-
"name": "<capability-name>",
|
|
124
|
-
"description": "<description>",
|
|
125
|
-
"artifact_type": "<type>"
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
"dependency_graph": {
|
|
129
|
-
"<task-id>": {
|
|
130
|
-
"depends_on": ["<dependency-task-id>"],
|
|
131
|
-
"role": "<role-name>"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"roles": [
|
|
135
|
-
{
|
|
136
|
-
"name": "<role-name>",
|
|
137
|
-
"prefix": "<PREFIX>",
|
|
138
|
-
"responsibility_type": "<type>",
|
|
139
|
-
"inner_loop": false,
|
|
140
|
-
"role_spec_metadata": {
|
|
141
|
-
"additional_members": [],
|
|
142
|
-
"message_types": {
|
|
143
|
-
"success": "<prefix>_complete",
|
|
144
|
-
"error": "error"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
],
|
|
149
|
-
"complexity_score": 0
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## Role-Spec File Schema
|
|
156
|
-
|
|
157
|
-
Each role-spec in `role-specs/<role-name>.md` follows the lightweight format with YAML frontmatter + Phase 2-4 body.
|
|
158
|
-
|
|
159
|
-
### Required Structure
|
|
160
|
-
|
|
161
|
-
```markdown
|
|
162
|
-
---
|
|
163
|
-
role: <name>
|
|
164
|
-
prefix: <PREFIX>
|
|
165
|
-
inner_loop: <true|false>
|
|
166
|
-
message_types:
|
|
167
|
-
success: <type>
|
|
168
|
-
error: error
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
# <Role Name> — Phase 2-4
|
|
172
|
-
|
|
173
|
-
## Phase 2: <Name>
|
|
174
|
-
<domain-specific context loading>
|
|
175
|
-
|
|
176
|
-
## Phase 3: <Name>
|
|
177
|
-
<domain-specific execution>
|
|
178
|
-
|
|
179
|
-
## Phase 4: <Name>
|
|
180
|
-
<domain-specific validation>
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### Role-Spec Structure Validation
|
|
184
|
-
|
|
185
|
-
Each `role-specs/<role>.md` must satisfy:
|
|
186
|
-
|
|
187
|
-
| Check | Required | Error on Failure |
|
|
188
|
-
|-------|----------|------------------|
|
|
189
|
-
| YAML frontmatter (between `---` markers) | Present | "Invalid role-spec: missing frontmatter" |
|
|
190
|
-
| Frontmatter fields | `role` (string), `prefix` (string), `inner_loop` (boolean), `message_types` (object) | "Invalid role-spec: missing required field" |
|
|
191
|
-
| Body sections | `## Phase 2`, `## Phase 3`, `## Phase 4` headings present | "Invalid role-spec: missing Phase N" |
|
|
192
|
-
|
|
193
|
-
All checks pass -> role-spec valid.
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## Example Valid Session
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
.workflow/.team/TC-auth-feature-2026-02-27/
|
|
201
|
-
+-- team-session.json # Valid JSON with session metadata
|
|
202
|
-
+-- task-analysis.json # Valid JSON with dependency graph
|
|
203
|
-
+-- role-specs/
|
|
204
|
-
| +-- researcher.md # YAML frontmatter + Phase 2-4
|
|
205
|
-
| +-- developer.md # YAML frontmatter + Phase 2-4
|
|
206
|
-
| +-- tester.md # YAML frontmatter + Phase 2-4
|
|
207
|
-
+-- artifacts/ # (may be empty)
|
|
208
|
-
+-- .msg/ # Team message bus + state (messages.jsonl + meta.json)
|
|
209
|
-
+-- wisdom/
|
|
210
|
-
| +-- learnings.md
|
|
211
|
-
| +-- decisions.md
|
|
212
|
-
| +-- issues.md
|
|
213
|
-
+-- explorations/
|
|
214
|
-
| +-- cache-index.json
|
|
215
|
-
+-- discussions/ # (may be empty)
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Recovery from Invalid Sessions
|
|
221
|
-
|
|
222
|
-
If session validation fails:
|
|
223
|
-
|
|
224
|
-
1. **Missing team-session.json**: Re-run team-coordinate with original task
|
|
225
|
-
2. **Missing task-analysis.json**: Re-run team-coordinate with resume
|
|
226
|
-
3. **Missing role-spec files**: Re-run team-coordinate with resume
|
|
227
|
-
4. **Invalid frontmatter**: Manual fix or re-run team-coordinate
|
|
228
|
-
5. **Corrupt JSON**: Manual inspection or re-run team-coordinate
|
|
229
|
-
|
|
230
|
-
**team-executor cannot fix invalid sessions** -- it can only report errors and suggest recovery steps.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Analyze Task
|
|
2
|
-
|
|
3
|
-
Parse user task -> detect 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
|
-
| investigate, explore, research | analyst | RESEARCH |
|
|
12
|
-
| write, draft, document | writer | DRAFT |
|
|
13
|
-
| implement, build, code, fix | executor | IMPL |
|
|
14
|
-
| design, architect, plan | planner | PLAN |
|
|
15
|
-
| test, verify, validate | tester | TEST |
|
|
16
|
-
| analyze, review, audit | reviewer | REVIEW |
|
|
17
|
-
|
|
18
|
-
## Dependency Graph
|
|
19
|
-
|
|
20
|
-
Natural ordering tiers:
|
|
21
|
-
- Tier 0: analyst, planner (knowledge gathering)
|
|
22
|
-
- Tier 1: writer (creation requires context)
|
|
23
|
-
- Tier 2: executor (implementation requires plan/design)
|
|
24
|
-
- Tier 3: tester, reviewer (validation requires artifacts)
|
|
25
|
-
|
|
26
|
-
## Complexity Scoring
|
|
27
|
-
|
|
28
|
-
| Factor | Points |
|
|
29
|
-
|--------|--------|
|
|
30
|
-
| Per capability | +1 |
|
|
31
|
-
| Cross-domain | +2 |
|
|
32
|
-
| Parallel tracks | +1 per track |
|
|
33
|
-
| Serial depth > 3 | +1 |
|
|
34
|
-
|
|
35
|
-
Results: 1-3 Low, 4-6 Medium, 7+ High
|
|
36
|
-
|
|
37
|
-
## Role Minimization
|
|
38
|
-
|
|
39
|
-
- Cap at 5 roles
|
|
40
|
-
- Merge overlapping capabilities
|
|
41
|
-
- Absorb trivial single-step roles
|
|
42
|
-
|
|
43
|
-
## Output
|
|
44
|
-
|
|
45
|
-
Write <session>/task-analysis.json:
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"task_description": "<original>",
|
|
49
|
-
"pipeline_type": "<spec-only|impl-only|full-lifecycle|...>",
|
|
50
|
-
"capabilities": [{ "name": "<cap>", "prefix": "<PREFIX>", "keywords": ["..."] }],
|
|
51
|
-
"dependency_graph": { "<TASK-ID>": { "role": "<role>", "blockedBy": ["..."], "priority": "P0|P1|P2" } },
|
|
52
|
-
"roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": false }],
|
|
53
|
-
"complexity": { "score": 0, "level": "Low|Medium|High" },
|
|
54
|
-
"needs_research": true
|
|
55
|
-
}
|
|
56
|
-
```
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Dispatch Tasks
|
|
2
|
-
|
|
3
|
-
Create task chains from dependency graph, write to tasks.json with proper deps relationships.
|
|
4
|
-
|
|
5
|
-
## Workflow
|
|
6
|
-
|
|
7
|
-
1. Read task-analysis.json -> extract dependency_graph
|
|
8
|
-
2. Read specs/pipelines.md -> get task registry for selected pipeline
|
|
9
|
-
3. Topological sort tasks (respect deps)
|
|
10
|
-
4. Validate all owners exist in role registry (SKILL.md)
|
|
11
|
-
5. For each task (in order):
|
|
12
|
-
- Add task entry to tasks.json `tasks` object (see template below)
|
|
13
|
-
- Set deps array with upstream task IDs
|
|
14
|
-
- Assign wave number based on dependency depth
|
|
15
|
-
6. Update tasks.json metadata: total count, wave assignments
|
|
16
|
-
7. Validate chain (no orphans, no cycles, all refs valid)
|
|
17
|
-
|
|
18
|
-
## Task Entry Template
|
|
19
|
-
|
|
20
|
-
Each task in tasks.json `tasks` object:
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"<TASK-ID>": {
|
|
24
|
-
"title": "<concise title>",
|
|
25
|
-
"description": "PURPOSE: <goal> | Success: <criteria>\nTASK:\n - <step 1>\n - <step 2>\nCONTEXT:\n - Session: <session-folder>\n - Upstream artifacts: <list>\n - Key files: <list>\nEXPECTED: <artifact path> + <quality criteria>\nCONSTRAINTS: <scope limits>\n---\nInnerLoop: <true|false>\nRoleSpec: <project>/.codex/skills/team-lifecycle-v4/roles/<role>/role.md",
|
|
26
|
-
"role": "<role-name>",
|
|
27
|
-
"pipeline_phase": "<phase>",
|
|
28
|
-
"deps": ["<upstream-task-id>", "..."],
|
|
29
|
-
"context_from": ["<upstream-task-id>", "..."],
|
|
30
|
-
"wave": 1,
|
|
31
|
-
"status": "pending",
|
|
32
|
-
"findings": null,
|
|
33
|
-
"quality_score": null,
|
|
34
|
-
"supervision_verdict": null,
|
|
35
|
-
"error": null
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## InnerLoop Flag Rules
|
|
41
|
-
|
|
42
|
-
- true: Role has 2+ serial same-prefix tasks (writer: DRAFT-001->004)
|
|
43
|
-
- false: Role has 1 task, or tasks are parallel
|
|
44
|
-
|
|
45
|
-
## CHECKPOINT Task Rules
|
|
46
|
-
|
|
47
|
-
CHECKPOINT tasks are dispatched like regular tasks but handled differently at spawn time:
|
|
48
|
-
|
|
49
|
-
- Added to tasks.json with proper deps (upstream tasks that must complete first)
|
|
50
|
-
- Owner: supervisor
|
|
51
|
-
- **NOT spawned as team_worker** — coordinator wakes the resident supervisor via followup_task
|
|
52
|
-
- If `supervision: false` in tasks.json, skip creating CHECKPOINT tasks entirely
|
|
53
|
-
- RoleSpec in description: `<project>/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md`
|
|
54
|
-
|
|
55
|
-
## Dependency Validation
|
|
56
|
-
|
|
57
|
-
- No orphan tasks (all tasks have valid owner)
|
|
58
|
-
- No circular dependencies
|
|
59
|
-
- All deps references exist in tasks object
|
|
60
|
-
- Session reference in every task description
|
|
61
|
-
- RoleSpec reference in every task description
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Monitor Pipeline
|
|
2
|
-
|
|
3
|
-
Synchronous pipeline coordination using spawn_agent + wait_agent.
|
|
4
|
-
|
|
5
|
-
## Constants
|
|
6
|
-
|
|
7
|
-
- WORKER_AGENT: team_worker
|
|
8
|
-
- SUPERVISOR_AGENT: team_supervisor (resident, woken via followup_task)
|
|
9
|
-
|
|
10
|
-
## Handler Router
|
|
11
|
-
|
|
12
|
-
| Source | Handler |
|
|
13
|
-
|--------|---------|
|
|
14
|
-
| "capability_gap" | handleAdapt |
|
|
15
|
-
| "check" or "status" | handleCheck |
|
|
16
|
-
| "resume" or "continue" | handleResume |
|
|
17
|
-
| All tasks completed | handleComplete |
|
|
18
|
-
| Default | handleSpawnNext |
|
|
19
|
-
|
|
20
|
-
## handleCheck
|
|
21
|
-
|
|
22
|
-
Read-only status report from tasks.json + team_msg progress, then STOP.
|
|
23
|
-
|
|
24
|
-
Read tasks.json + team_msg (type="progress", last=50) + team_msg (type="blocker", last=10). Aggregate latest milestone per task.
|
|
25
|
-
|
|
26
|
-
**Output format**:
|
|
27
|
-
```
|
|
28
|
-
[coordinator] Pipeline Status — Progress: <done>/<total> (<pct>%)
|
|
29
|
-
[coordinator] Active Workers: <task_id> <role> <milestone_phase> <pct>% "<summary>" <time_ago>
|
|
30
|
-
[coordinator] Blockers: <count or "none"> (detail per blocker if any)
|
|
31
|
-
[coordinator] Completed: <list>
|
|
32
|
-
[coordinator] Ready: <pending with resolved deps>
|
|
33
|
-
[coordinator] Commands: 'resume' to advance | 'check' to refresh
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**CLI monitoring**: `maestro agent-msg list -s "<session_id>" --type progress --last 10`
|
|
37
|
-
|
|
38
|
-
## handleResume
|
|
39
|
-
|
|
40
|
-
**Agent Health Check** (v4): Cross-check `list_agents()` against `active_agents`. Missing agents -> reset task to pending. Crashed supervisor (resident + no CHECKPOINT in_progress + pending CHECKPOINT exists) -> respawn with recovery: true.
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
Load active_agents -> route:
|
|
44
|
-
none -> handleSpawnNext
|
|
45
|
-
has agents -> health check, process completions -> handleSpawnNext
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## handleSpawnNext
|
|
49
|
-
|
|
50
|
-
Find ready tasks, spawn workers, wait for completion, process results.
|
|
51
|
-
|
|
52
|
-
1. Read tasks.json
|
|
53
|
-
2. Collect: completedTasks, inProgressTasks, readyTasks (pending + all deps completed)
|
|
54
|
-
3. No ready + nothing in progress -> handleComplete
|
|
55
|
-
4. No ready + work in progress -> report waiting, STOP
|
|
56
|
-
5. Has ready -> separate regular tasks and CHECKPOINT tasks
|
|
57
|
-
|
|
58
|
-
### Spawn Regular Tasks
|
|
59
|
-
|
|
60
|
-
For each ready non-CHECKPOINT task:
|
|
61
|
-
|
|
62
|
-
**Spawn worker message template**:
|
|
63
|
-
```
|
|
64
|
-
## Role Assignment
|
|
65
|
-
role: <role> | role_spec: <skillRoot>/roles/<role>/role.md
|
|
66
|
-
session: <session-folder> | session_id: <session-id>
|
|
67
|
-
requirement: <requirement> | inner_loop: <true|false>
|
|
68
|
-
Read role_spec for Phase 2-4 instructions. Execute Phase 1 -> role Phase 2-4 -> Phase 5 (report).
|
|
69
|
-
## Task Context
|
|
70
|
-
task_id: <id> | title: <title> | description: <description> | pipeline_phase: <phase>
|
|
71
|
-
## Upstream Context
|
|
72
|
-
<prevContext>
|
|
73
|
-
## Progress Milestones
|
|
74
|
-
Report progress via team_msg at phase boundaries. Blockers via type="blocker". Completion via type="task_complete" after report_agent_job_result.
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**Result collection**: `wait_agent({ timeout_ms: 1800000 })` (30 min), drain progress + blockers from team_msg, log execution trace.
|
|
78
|
-
|
|
79
|
-
**Timeout escalation**: STATUS_CHECK (3 min) -> FINALIZE with interrupt (3 min) -> mark timed_out with last progress context, close_agent. Normal completion -> read `discoveries/{task_id}.json` for status/findings/quality_score/error. Missing file -> status="failed". Close each agent (use task_name, not agentId).
|
|
80
|
-
|
|
81
|
-
**Cross-Agent Supplementary Context** (v4): Use `send_message` (not `followup_task`) to deliver upstream results to running downstream workers as non-interrupting supplementary context.
|
|
82
|
-
|
|
83
|
-
### Handle CHECKPOINT Tasks
|
|
84
|
-
|
|
85
|
-
For each ready CHECKPOINT task:
|
|
86
|
-
|
|
87
|
-
1. Ensure supervisor in active_agents (resident: true). Not found -> spawn via SKILL.md Supervisor Spawn Template.
|
|
88
|
-
2. Wake supervisor via `followup_task` with checkpoint scope (dep task IDs) + pipeline progress.
|
|
89
|
-
3. `wait_agent` (30 min) with standard timeout escalation (STATUS_CHECK -> FINALIZE -> timed_out).
|
|
90
|
-
4. Read `artifacts/${task.id}-report.md`, parse verdict:
|
|
91
|
-
- **pass** -> mark completed, proceed
|
|
92
|
-
- **warn** -> log risks to wisdom, mark completed, proceed
|
|
93
|
-
- **block** -> request_user_input: Override / Revise upstream / Abort
|
|
94
|
-
|
|
95
|
-
### Persist and Loop
|
|
96
|
-
|
|
97
|
-
Write tasks.json -> more tasks ready? -> loop handleSpawnNext. All done -> handleComplete. Blocked -> report, STOP.
|
|
98
|
-
|
|
99
|
-
## handleComplete
|
|
100
|
-
|
|
101
|
-
**Cleanup Verification** (v4): `list_agents()` -> close any still-running team agents (including resident supervisor).
|
|
102
|
-
|
|
103
|
-
Pipeline done. Generate summary (deliverables, stats, discussions). Route by completion_action: interactive (Archive/Keep/Export) | auto_archive | auto_keep.
|
|
104
|
-
|
|
105
|
-
## handleAdapt
|
|
106
|
-
|
|
107
|
-
Capability gap reported mid-pipeline.
|
|
108
|
-
|
|
109
|
-
1. Parse gap description
|
|
110
|
-
2. Check if existing role covers it -> redirect
|
|
111
|
-
3. Role count < 5 -> generate dynamic role-spec in <session>/role-specs/
|
|
112
|
-
4. Add new task to tasks.json, spawn worker via spawn_agent + wait_agent
|
|
113
|
-
5. Role count >= 5 -> merge or pause
|