pi-maestro-flow 0.2.0
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/README.md +124 -0
- package/agents/aggregator.md +27 -0
- package/agents/cli-explore-agent.md +188 -0
- package/agents/cross-role-reviewer.md +171 -0
- package/agents/delegate.md +19 -0
- package/agents/explorer.md +23 -0
- package/agents/impeccable-agent.md +99 -0
- package/agents/ralph-executor.md +81 -0
- package/agents/reference.md +24 -0
- package/agents/role-design-author.md +220 -0
- package/agents/team-supervisor.md +143 -0
- package/agents/team-worker.md +237 -0
- package/agents/ui-design-agent.md +270 -0
- package/agents/workflow-analyzer.md +116 -0
- package/agents/workflow-codebase-mapper.md +77 -0
- package/agents/workflow-collab-planner.md +147 -0
- package/agents/workflow-debugger.md +104 -0
- package/agents/workflow-executor.md +133 -0
- package/agents/workflow-external-researcher.md +86 -0
- package/agents/workflow-integration-checker.md +83 -0
- package/agents/workflow-nyquist-auditor.md +85 -0
- package/agents/workflow-phase-researcher.md +85 -0
- package/agents/workflow-plan-checker.md +100 -0
- package/agents/workflow-planner.md +200 -0
- package/agents/workflow-project-researcher.md +74 -0
- package/agents/workflow-research-synthesizer.md +70 -0
- package/agents/workflow-reviewer.md +82 -0
- package/agents/workflow-roadmapper.md +81 -0
- package/agents/workflow-verifier.md +120 -0
- package/package.json +58 -0
- package/skills/codify-to-knowhow/SKILL.md +167 -0
- package/skills/delegation-check/SKILL.md +297 -0
- package/skills/domain-add/SKILL.md +75 -0
- package/skills/insight-challenge/SKILL.md +226 -0
- package/skills/learn-decompose/SKILL.md +124 -0
- package/skills/learn-follow/SKILL.md +163 -0
- package/skills/learn-investigate/SKILL.md +160 -0
- package/skills/learn-second-opinion/SKILL.md +128 -0
- package/skills/maestro/SKILL.md +239 -0
- package/skills/maestro-amend/SKILL.md +169 -0
- package/skills/maestro-analyze/SKILL.md +173 -0
- package/skills/maestro-blueprint/SKILL.md +159 -0
- package/skills/maestro-brainstorm/SKILL.md +193 -0
- package/skills/maestro-collab/SKILL.md +181 -0
- package/skills/maestro-companion/SKILL.md +536 -0
- package/skills/maestro-composer/SKILL.md +192 -0
- package/skills/maestro-execute/SKILL.md +193 -0
- package/skills/maestro-fork/SKILL.md +104 -0
- package/skills/maestro-grill/SKILL.md +151 -0
- package/skills/maestro-guard/SKILL.md +124 -0
- package/skills/maestro-help/SKILL.md +328 -0
- package/skills/maestro-impeccable/SKILL.md +302 -0
- package/skills/maestro-init/SKILL.md +151 -0
- package/skills/maestro-merge/SKILL.md +90 -0
- package/skills/maestro-milestone-audit/SKILL.md +117 -0
- package/skills/maestro-milestone-complete/SKILL.md +133 -0
- package/skills/maestro-milestone-release/SKILL.md +131 -0
- package/skills/maestro-next/SKILL.md +269 -0
- package/skills/maestro-overlay/SKILL.md +203 -0
- package/skills/maestro-plan/SKILL.md +194 -0
- package/skills/maestro-player/SKILL.md +184 -0
- package/skills/maestro-quick/SKILL.md +117 -0
- package/skills/maestro-ralph/SKILL.md +905 -0
- package/skills/maestro-ralph-cli/SKILL.md +976 -0
- package/skills/maestro-ralph-cli-execute/SKILL.md +229 -0
- package/skills/maestro-ralph-execute/SKILL.md +409 -0
- package/skills/maestro-ralph-v2/SKILL.md +1198 -0
- package/skills/maestro-roadmap/SKILL.md +157 -0
- package/skills/maestro-swarm-workflow/SKILL.md +272 -0
- package/skills/maestro-tools-execute/SKILL.md +143 -0
- package/skills/maestro-tools-register/SKILL.md +192 -0
- package/skills/maestro-ui-codify/SKILL.md +127 -0
- package/skills/maestro-universal-workflow/SKILL.md +622 -0
- package/skills/maestro-update/SKILL.md +156 -0
- package/skills/manage-codebase-rebuild/SKILL.md +111 -0
- package/skills/manage-drift-realign/SKILL.md +159 -0
- package/skills/manage-harvest/SKILL.md +121 -0
- package/skills/manage-issue/SKILL.md +88 -0
- package/skills/manage-issue-discover/SKILL.md +104 -0
- package/skills/manage-kg-extractors/SKILL.md +147 -0
- package/skills/manage-knowhow/SKILL.md +102 -0
- package/skills/manage-knowhow-capture/SKILL.md +109 -0
- package/skills/manage-knowledge-audit/SKILL.md +147 -0
- package/skills/manage-status/SKILL.md +80 -0
- package/skills/manage-wiki/SKILL.md +104 -0
- package/skills/odyssey-debug/SKILL.md +344 -0
- package/skills/odyssey-improve/SKILL.md +423 -0
- package/skills/odyssey-planex/SKILL.md +542 -0
- package/skills/odyssey-review-test-fix/SKILL.md +392 -0
- package/skills/odyssey-ui/SKILL.md +388 -0
- package/skills/prompt-generator/SKILL.md +470 -0
- package/skills/quality-auto-test/SKILL.md +168 -0
- package/skills/quality-debug/SKILL.md +176 -0
- package/skills/quality-refactor/SKILL.md +108 -0
- package/skills/quality-retrospective/SKILL.md +134 -0
- package/skills/quality-review/SKILL.md +169 -0
- package/skills/quality-sync/SKILL.md +90 -0
- package/skills/quality-test/SKILL.md +183 -0
- package/skills/scholar-anti-ai-writing/SKILL.md +173 -0
- package/skills/scholar-anti-ai-writing/references/patterns-chinese.md +242 -0
- package/skills/scholar-anti-ai-writing/references/patterns-english.md +242 -0
- package/skills/scholar-citation-verify/SKILL.md +166 -0
- package/skills/scholar-citation-verify/references/api-usage.md +372 -0
- package/skills/scholar-citation-verify/references/common-errors.md +384 -0
- package/skills/scholar-citation-verify/references/verification-rules.md +399 -0
- package/skills/scholar-experiment/SKILL.md +321 -0
- package/skills/scholar-ideation/SKILL.md +288 -0
- package/skills/scholar-latex-organizer/SKILL.md +186 -0
- package/skills/scholar-publish/SKILL.md +220 -0
- package/skills/scholar-rebuttal-pro/README.md +313 -0
- package/skills/scholar-rebuttal-pro/SKILL.md +511 -0
- package/skills/scholar-review/SKILL.md +227 -0
- package/skills/scholar-thesis-docx/README.md +111 -0
- package/skills/scholar-thesis-docx/README_EN.md +108 -0
- package/skills/scholar-thesis-docx/SKILL.md +212 -0
- package/skills/scholar-thesis-docx/references/failure-patterns-and-quality-gates.md +178 -0
- package/skills/scholar-thesis-docx/references/figure-and-code-rules.md +33 -0
- package/skills/scholar-thesis-docx/references/paper-format-workflow.md +68 -0
- package/skills/scholar-thesis-docx/references/script-usage.md +157 -0
- package/skills/scholar-thesis-docx/scripts/audit_docx_ooxml.py +429 -0
- package/skills/scholar-thesis-docx/scripts/check_word_com.ps1 +50 -0
- package/skills/scholar-thesis-docx/scripts/export_word_pdf.ps1 +62 -0
- package/skills/scholar-thesis-docx/scripts/normalize_word_styles.ps1 +498 -0
- package/skills/scholar-thesis-docx/scripts/render_mermaid_figure.ps1 +148 -0
- package/skills/scholar-writing/SKILL.md +296 -0
- package/skills/security-audit/SKILL.md +244 -0
- package/skills/skill-generator/SKILL.md +472 -0
- package/skills/skill-iter-tune/SKILL.md +382 -0
- package/skills/skill-simplify/SKILL.md +63 -0
- package/skills/skill-tuning/SKILL.md +174 -0
- package/skills/spec-add/SKILL.md +105 -0
- package/skills/spec-load/SKILL.md +98 -0
- package/skills/spec-remove/SKILL.md +74 -0
- package/skills/spec-setup/SKILL.md +75 -0
- package/skills/team-adversarial-swarm/SKILL.md +233 -0
- package/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
- package/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
- package/skills/team-adversarial-swarm/scripts/aco.py +473 -0
- package/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
- package/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
- package/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
- package/skills/team-arch-opt/SKILL.md +158 -0
- package/skills/team-brainstorm/SKILL.md +171 -0
- package/skills/team-coordinate/SKILL.md +266 -0
- package/skills/team-designer/SKILL.md +160 -0
- package/skills/team-executor/SKILL.md +189 -0
- package/skills/team-frontend/SKILL.md +136 -0
- package/skills/team-frontend-debug/SKILL.md +198 -0
- package/skills/team-interactive-craft/SKILL.md +141 -0
- package/skills/team-issue/SKILL.md +171 -0
- package/skills/team-lifecycle-v4/SKILL.md +209 -0
- package/skills/team-motion-design/SKILL.md +142 -0
- package/skills/team-perf-opt/SKILL.md +175 -0
- package/skills/team-planex/SKILL.md +137 -0
- package/skills/team-quality-assurance/SKILL.md +147 -0
- package/skills/team-review/SKILL.md +147 -0
- package/skills/team-roadmap-dev/SKILL.md +169 -0
- package/skills/team-swarm/SKILL.md +178 -0
- package/skills/team-swarm/scripts/aco.py +473 -0
- package/skills/team-swarm/scripts/pheromone.py +144 -0
- package/skills/team-swarm/scripts/scoring.py +92 -0
- package/skills/team-swarm/scripts/test_aco.py +475 -0
- package/skills/team-tech-debt/SKILL.md +128 -0
- package/skills/team-testing/SKILL.md +143 -0
- package/skills/team-ui-polish/SKILL.md +141 -0
- package/skills/team-uidesign/SKILL.md +144 -0
- package/skills/team-ultra-analyze/SKILL.md +173 -0
- package/skills/team-ux-improve/SKILL.md +151 -0
- package/skills/team-visual-a11y/SKILL.md +156 -0
- package/skills/workflow-skill-designer/SKILL.md +496 -0
- package/src/extension/index.ts +222 -0
- package/src/extension/schemas.ts +131 -0
- package/src/providers/cli-tools-loader.ts +74 -0
- package/src/providers/provider-registry.ts +130 -0
- package/src/tools/delegate.ts +85 -0
- package/src/tools/explore.ts +134 -0
- package/src/tools/moa.ts +213 -0
- package/src/tools/status.ts +99 -0
- package/src/tools/wait.ts +166 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: team-roadmap-dev
|
|
3
|
+
description: "Unified team skill for roadmap-driven development workflow. Coordinator discusses roadmap with user, then dispatches phased execution pipeline (plan -> execute -> verify). All roles invoke this skill with --role arg. Triggers on \"team roadmap-dev\"."
|
|
4
|
+
allowed-tools: TeamCreate TeamDelete SendMessage TaskCreate TaskUpdate TaskList TaskGet Agent AskUserQuestion Read Write Edit Bash Glob Grep mcp__maestro__team_msg
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Team Roadmap Dev
|
|
8
|
+
|
|
9
|
+
Roadmap-driven development with phased execution pipeline. Coordinator discusses roadmap with the user and manages phase transitions. Workers are spawned as team-worker agents.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Skill(skill="team-roadmap-dev", args="<task-description>")
|
|
15
|
+
|
|
|
16
|
+
SKILL.md (this file) = Router
|
|
17
|
+
|
|
|
18
|
+
+--------------+--------------+
|
|
19
|
+
| |
|
|
20
|
+
no --role flag --role <name>
|
|
21
|
+
| |
|
|
22
|
+
Coordinator Worker
|
|
23
|
+
roles/coordinator/role.md roles/<name>/role.md
|
|
24
|
+
|
|
|
25
|
+
+-- roadmap-discuss -> dispatch -> spawn workers -> STOP
|
|
26
|
+
|
|
|
27
|
+
+-------+-------+-------+
|
|
28
|
+
v v v
|
|
29
|
+
[planner] [executor] [verifier]
|
|
30
|
+
(team-worker agents)
|
|
31
|
+
|
|
32
|
+
Pipeline (per phase):
|
|
33
|
+
PLAN-N01 -> EXEC-N01 -> VERIFY-N01 (gap closure loop if needed)
|
|
34
|
+
|
|
35
|
+
Multi-phase:
|
|
36
|
+
Phase 1 -> Phase 2 -> ... -> Phase N -> Complete
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Role Registry
|
|
40
|
+
|
|
41
|
+
| Role | Path | Prefix | Inner Loop |
|
|
42
|
+
|------|------|--------|------------|
|
|
43
|
+
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
|
|
44
|
+
| planner | [roles/planner/role.md](roles/planner/role.md) | PLAN-* | true |
|
|
45
|
+
| executor | [roles/executor/role.md](roles/executor/role.md) | EXEC-* | true |
|
|
46
|
+
| verifier | [roles/verifier/role.md](roles/verifier/role.md) | VERIFY-* | true |
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## Pre-load (coordinator, before dispatch)
|
|
50
|
+
|
|
51
|
+
1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, read for module boundaries
|
|
52
|
+
2. **Specs (arch)**: `maestro load --type spec --category arch` — load arch constraints as shared context
|
|
53
|
+
3. **Specs (coding)**: `maestro load --type spec --category coding` — load coding constraints as shared context
|
|
54
|
+
4. **Wiki knowledge**: `maestro search "roadmap milestone development" --json` — top 5 entries as prior context
|
|
55
|
+
5. All optional — proceed without if unavailable
|
|
56
|
+
## Role Router
|
|
57
|
+
|
|
58
|
+
Parse `$ARGUMENTS`:
|
|
59
|
+
- Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
|
|
60
|
+
- No `--role` → `@roles/coordinator/role.md`, execute entry router
|
|
61
|
+
|
|
62
|
+
## Shared Constants
|
|
63
|
+
|
|
64
|
+
- **Session prefix**: `RD`
|
|
65
|
+
- **Session path**: `.workflow/.team/RD-<slug>-<date>/`
|
|
66
|
+
- **Team name**: `roadmap-dev`
|
|
67
|
+
- **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
|
|
68
|
+
- **Message bus**: `mcp__maestro__team_msg(session_id=<session-id>, ...)`
|
|
69
|
+
|
|
70
|
+
## Worker Spawn Template
|
|
71
|
+
|
|
72
|
+
Coordinator spawns workers using this template:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Agent({
|
|
76
|
+
subagent_type: "team-worker",
|
|
77
|
+
description: "Spawn <role> worker",
|
|
78
|
+
team_name: "roadmap-dev",
|
|
79
|
+
name: "<role>",
|
|
80
|
+
run_in_background: true,
|
|
81
|
+
prompt: `## Role Assignment
|
|
82
|
+
role: <role>
|
|
83
|
+
role_spec: <skill_root>/roles/<role>/role.md
|
|
84
|
+
session: <session-folder>
|
|
85
|
+
session_id: <session-id>
|
|
86
|
+
team_name: roadmap-dev
|
|
87
|
+
requirement: <task-description>
|
|
88
|
+
inner_loop: true
|
|
89
|
+
|
|
90
|
+
## Progress Milestones
|
|
91
|
+
session_id: <session-id>
|
|
92
|
+
Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
|
|
93
|
+
Report blockers immediately via team_msg type="blocker".
|
|
94
|
+
Report completion via team_msg type="task_complete" after final SendMessage.
|
|
95
|
+
|
|
96
|
+
Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
|
|
97
|
+
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**All worker roles** (planner, executor, verifier): Set `inner_loop: true`.
|
|
102
|
+
|
|
103
|
+
## User Commands
|
|
104
|
+
|
|
105
|
+
| Command | Action |
|
|
106
|
+
|---------|--------|
|
|
107
|
+
| `check` / `status` | Output execution status graph (phase-grouped), no advancement |
|
|
108
|
+
| `resume` / `continue` | Check worker states, advance next step |
|
|
109
|
+
|
|
110
|
+
## Session Directory
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
.workflow/.team/RD-<slug>-<date>/
|
|
114
|
+
+-- roadmap.md # Phase plan with requirements and success criteria
|
|
115
|
+
+-- state.md # Living memory (concise)
|
|
116
|
+
+-- config.json # Session settings (mode, depth, gates)
|
|
117
|
+
+-- wisdom/ # Cross-task knowledge accumulation
|
|
118
|
+
| +-- learnings.md
|
|
119
|
+
| +-- decisions.md
|
|
120
|
+
| +-- conventions.md
|
|
121
|
+
| +-- issues.md
|
|
122
|
+
+-- phase-1/ # Per-phase artifacts
|
|
123
|
+
| +-- context.md
|
|
124
|
+
| +-- IMPL_PLAN.md
|
|
125
|
+
| +-- TODO_LIST.md
|
|
126
|
+
| +-- .task/IMPL-*.json
|
|
127
|
+
| +-- summary-*.md
|
|
128
|
+
| +-- verification.md
|
|
129
|
+
+-- phase-N/
|
|
130
|
+
| +-- ...
|
|
131
|
+
+-- .msg/
|
|
132
|
+
+-- messages.jsonl # Team message bus log
|
|
133
|
+
+-- meta.json # Session metadata + shared state
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Completion Action
|
|
137
|
+
|
|
138
|
+
When the pipeline completes:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
AskUserQuestion({
|
|
142
|
+
questions: [{
|
|
143
|
+
question: "Roadmap Dev pipeline complete. What would you like to do?",
|
|
144
|
+
header: "Completion",
|
|
145
|
+
multiSelect: false,
|
|
146
|
+
options: [
|
|
147
|
+
{ label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and team resources" },
|
|
148
|
+
{ label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
|
|
149
|
+
{ label: "Export Results", description: "Export deliverables to a specified location, then clean" }
|
|
150
|
+
]
|
|
151
|
+
}]
|
|
152
|
+
})
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Specs Reference
|
|
156
|
+
|
|
157
|
+
- [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
|
|
158
|
+
|
|
159
|
+
## Error Handling
|
|
160
|
+
|
|
161
|
+
| Scenario | Resolution |
|
|
162
|
+
|----------|------------|
|
|
163
|
+
| Unknown --role value | Error with role registry list |
|
|
164
|
+
| Role file not found | Error with expected path (roles/{name}/role.md) |
|
|
165
|
+
| project-tech.json missing | Coordinator invokes /workflow:spec:setup |
|
|
166
|
+
| Phase verification fails with gaps | Coordinator triggers gap closure loop (max 3 iterations) |
|
|
167
|
+
| Max gap closure iterations (3) | Report to user, ask for guidance |
|
|
168
|
+
| Worker crash | Respawn worker, reassign task |
|
|
169
|
+
| Session corruption | Attempt recovery, fallback to manual reconciliation |
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: team-swarm
|
|
3
|
+
description: "Swarm intelligence team skill — ACO-driven multi-agent exploration with hybrid LLM coordinator + Python optimization controller. Coordinator generates swarm-config from user task, then runs K iterations of N parallel ants guided by pheromone state. Universal task space via config (nodes + scoring rule). Triggers on \"team swarm\", \"swarm intelligence\", \"蚁群\"."
|
|
4
|
+
allowed-tools: TeamCreate TeamDelete SendMessage TaskCreate TaskUpdate TaskList TaskGet Agent AskUserQuestion Read Write Edit Bash Glob Grep mcp__maestro__team_msg
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Team Swarm
|
|
8
|
+
|
|
9
|
+
Orchestrate ant-colony-style exploration over a user-defined task space. **Hybrid coordinator**: LLM handles task translation + worker spawning; Python script owns all numeric decisions (selection / pheromone update / convergence). Universal — task space and scoring rule come from `swarm-config.json`.
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Skill(skill="team-swarm", args="task description")
|
|
15
|
+
|
|
|
16
|
+
SKILL.md (this file) = Router
|
|
17
|
+
|
|
|
18
|
+
+--------------+--------------+
|
|
19
|
+
| |
|
|
20
|
+
no --role flag --role <name>
|
|
21
|
+
| |
|
|
22
|
+
Coordinator Worker
|
|
23
|
+
roles/coordinator/role.md roles/<name>/role.md
|
|
24
|
+
|
|
|
25
|
+
+-- Phase 1: gen swarm-config
|
|
26
|
+
+-- Phase 2: init --> Bash: scripts/aco.py init
|
|
27
|
+
+-- Phase 3: iterate (K rounds, each = spawn-and-stop)
|
|
28
|
+
| |
|
|
29
|
+
| +-- Bash: aco.py select --iter k -> N assignments
|
|
30
|
+
| +-- Spawn N x team-worker(ant)
|
|
31
|
+
| +-- [callback when all ants done]
|
|
32
|
+
| +-- (optional) Spawn team-worker(scorer)
|
|
33
|
+
| +-- Bash: aco.py update --iter k
|
|
34
|
+
| +-- Bash: aco.py converged
|
|
35
|
+
| +-- branch: loop k+1 OR Phase 4
|
|
36
|
+
|
|
|
37
|
+
+-- Phase 4: converge --> Bash: aco.py report -> Spawn team-worker(analyst)
|
|
38
|
+
-> best-solution.md
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Role Registry
|
|
42
|
+
|
|
43
|
+
| Role | Path | Prefix | Inner Loop |
|
|
44
|
+
|------|------|--------|------------|
|
|
45
|
+
| coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
|
|
46
|
+
| ant | [roles/ant/role.md](roles/ant/role.md) | ANT-* | false |
|
|
47
|
+
| scorer | [roles/scorer/role.md](roles/scorer/role.md) | SCORE-* | false |
|
|
48
|
+
| analyst | [roles/analyst/role.md](roles/analyst/role.md) | ANALYST-* | false |
|
|
49
|
+
|
|
50
|
+
## Role Router
|
|
51
|
+
|
|
52
|
+
Parse `$ARGUMENTS`:
|
|
53
|
+
- Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
|
|
54
|
+
- No `--role` -> `@roles/coordinator/role.md`, execute entry router
|
|
55
|
+
|
|
56
|
+
## Shared Constants
|
|
57
|
+
|
|
58
|
+
- **Session prefix**: `TS`
|
|
59
|
+
- **Session path**: `.workflow/.team/TS-<slug>-<date>/`
|
|
60
|
+
- **Team name**: `swarm`
|
|
61
|
+
- **Script root**: `<skill_root>/scripts/aco.py` (Python 3.10+)
|
|
62
|
+
- **Message bus**: `mcp__maestro__team_msg(session_id=<session-id>, ...)`
|
|
63
|
+
|
|
64
|
+
## Worker Spawn Template
|
|
65
|
+
|
|
66
|
+
Coordinator spawns workers using this template:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Agent({
|
|
70
|
+
subagent_type: "team-worker",
|
|
71
|
+
description: "Spawn <role> worker",
|
|
72
|
+
team_name: "swarm",
|
|
73
|
+
name: "<role>",
|
|
74
|
+
run_in_background: true,
|
|
75
|
+
prompt: `## Role Assignment
|
|
76
|
+
role: <role>
|
|
77
|
+
role_spec: <skill_root>/roles/<role>/role.md
|
|
78
|
+
session: <session-folder>
|
|
79
|
+
session_id: <session-id>
|
|
80
|
+
team_name: swarm
|
|
81
|
+
requirement: <task-description>
|
|
82
|
+
inner_loop: false
|
|
83
|
+
|
|
84
|
+
## Assignment (ant only)
|
|
85
|
+
<assignment JSON from aco.py select>
|
|
86
|
+
|
|
87
|
+
## Progress Milestones
|
|
88
|
+
session_id: <session-id>
|
|
89
|
+
Report progress via team_msg at natural phase boundaries.
|
|
90
|
+
Report blockers immediately via team_msg type="blocker".
|
|
91
|
+
Report completion via team_msg type="task_complete" after final SendMessage.
|
|
92
|
+
|
|
93
|
+
Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
|
|
94
|
+
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## User Commands
|
|
99
|
+
|
|
100
|
+
| Command | Action |
|
|
101
|
+
|---------|--------|
|
|
102
|
+
| `check` / `status` | View iteration progress + convergence curve |
|
|
103
|
+
| `resume` / `continue` | Resume interrupted iteration |
|
|
104
|
+
| `feedback <text>` | Inject feedback into wisdom; applies at next iteration |
|
|
105
|
+
| `revise <ITER>` | Re-run a specific iteration (rare) |
|
|
106
|
+
|
|
107
|
+
## Specs Reference
|
|
108
|
+
|
|
109
|
+
| Spec | Purpose |
|
|
110
|
+
|------|---------|
|
|
111
|
+
| [specs/swarm-protocol.md](specs/swarm-protocol.md) | Master protocol: script <-> coordinator interface, data flow |
|
|
112
|
+
| [specs/pheromone-schema.md](specs/pheromone-schema.md) | Pheromone JSON structure, update formula, evaporation |
|
|
113
|
+
| [specs/ant-output-schema.md](specs/ant-output-schema.md) | Critical contract for ant JSON artifacts |
|
|
114
|
+
| [specs/convergence-criteria.md](specs/convergence-criteria.md) | Stop conditions, multi-criterion logic |
|
|
115
|
+
| [specs/swarm-config-template.json](specs/swarm-config-template.json) | User-facing config template with all knobs |
|
|
116
|
+
|
|
117
|
+
## Scripts
|
|
118
|
+
|
|
119
|
+
| Script | Purpose | Invocation |
|
|
120
|
+
|--------|---------|------------|
|
|
121
|
+
| `scripts/aco.py` | Main CLI: init / select / update / converged / report | `python aco.py --session <path> <cmd>` |
|
|
122
|
+
| `scripts/pheromone.py` | Pheromone matrix module (imported by aco.py) | — |
|
|
123
|
+
| `scripts/scoring.py` | Pluggable scorer (script + fallback modes) | — |
|
|
124
|
+
|
|
125
|
+
## Session Directory
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
.workflow/.team/TS-<slug>-<date>/
|
|
129
|
+
├── team-session.json # Session state
|
|
130
|
+
├── swarm-config.json # User-facing config (Phase 1 output)
|
|
131
|
+
├── role-binding.json # Worker role_spec path map
|
|
132
|
+
├── task-space.json # Resolved nodes list
|
|
133
|
+
├── pheromone/
|
|
134
|
+
│ ├── current.json # Latest pheromone (each iter overwrites)
|
|
135
|
+
│ ├── init.json # Frozen initial state
|
|
136
|
+
│ └── history/<iter>.json # Per-iter snapshot
|
|
137
|
+
├── trails/<iter>.jsonl # Per-iter all-ant paths + scores
|
|
138
|
+
├── scores/iter-<iter>-scores.json # Scorer output (if mode == llm)
|
|
139
|
+
├── artifacts/
|
|
140
|
+
│ ├── ant-<iter>-<id>.json # Per-ant schema-locked output
|
|
141
|
+
│ ├── swarm-report.json # Phase 4 full report dump
|
|
142
|
+
│ └── best-solution.md # Analyst final synthesis
|
|
143
|
+
├── best.json # Canonical best solution
|
|
144
|
+
├── wisdom/ # learnings / decisions / issues
|
|
145
|
+
└── .msg/ # Message bus
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Completion Action
|
|
149
|
+
|
|
150
|
+
When swarm converges, coordinator presents:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
AskUserQuestion({
|
|
154
|
+
questions: [{
|
|
155
|
+
question: "Swarm pipeline complete. What would you like to do?",
|
|
156
|
+
header: "Completion",
|
|
157
|
+
multiSelect: false,
|
|
158
|
+
options: [
|
|
159
|
+
{ label: "Archive & Clean (Recommended)", description: "Archive session, delete team" },
|
|
160
|
+
{ label: "Keep Active", description: "Preserve for follow-up" },
|
|
161
|
+
{ label: "Export Best Solution", description: "Copy best-solution.md to target" },
|
|
162
|
+
{ label: "Run Another Round", description: "Reset convergence, K more iterations" }
|
|
163
|
+
]
|
|
164
|
+
}]
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Error Handling
|
|
169
|
+
|
|
170
|
+
| Scenario | Resolution |
|
|
171
|
+
|----------|------------|
|
|
172
|
+
| `aco.py` not found | Verify `<skill_root>/scripts/aco.py`; check Python install |
|
|
173
|
+
| Python version < 3.10 | Use `python3` or report dependency error |
|
|
174
|
+
| Config validation fails | AskUserQuestion to fix, regenerate, retry |
|
|
175
|
+
| All ants fail in iteration | Halt, AskUserQuestion (retry / abort / refine config) |
|
|
176
|
+
| Hallucination cluster (>50%) | Pause, AskUserQuestion (continue / refine scoring) |
|
|
177
|
+
| Convergence never trips | `max_iterations` safety net always fires |
|
|
178
|
+
| Session corruption | Phase 0 reconciliation; archive if irrecoverable |
|