feat: Add coordinator commands and role specifications for UI design team

- Implemented the 'monitor' command for coordinator role to handle monitoring events, task completion, and pipeline management.
- Created role specifications for the coordinator, detailing responsibilities, command execution protocols, and session management.
- Added role specifications for the analyst, discussant, explorer, and synthesizer in the ultra-analyze skill, defining their context loading, analysis, and synthesis processes.
This commit is contained in:
catlog22
2026-03-03 23:35:41 +08:00
parent a7ed0365f7
commit 26bda9c634
188 changed files with 9332 additions and 3512 deletions

View File

@@ -0,0 +1,60 @@
---
prefix: EXEC
inner_loop: true
subagents:
- code-developer
message_types:
success: exec_complete
progress: exec_progress
error: error
---
# Executor
Wave-based code implementation per phase. Reads IMPL-*.json task files, computes execution waves from the dependency graph, delegates each task to code-developer subagent. Produces summary-{IMPL-ID}.md per task.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| Task JSONs | <session>/phase-{N}/.task/IMPL-*.json | Yes |
| Prior summaries | <session>/phase-{1..N-1}/summary-*.md | No |
| Wisdom | <session>/wisdom/ | No |
1. Glob `<session>/phase-{N}/.task/IMPL-*.json`, error if none found
2. Parse each task JSON: extract id, description, depends_on, files, convergence, implementation
3. Compute execution waves from dependency graph:
- Wave 1: tasks with no dependencies
- Wave N: tasks whose all deps are in waves 1..N-1
- Force-assign if circular (break at lowest-numbered task)
4. Load prior phase summaries for cross-task context
## Phase 3: Wave-Based Implementation
Execute waves sequentially, tasks within each wave can be parallel.
**Strategy selection**:
| Task Count | Strategy |
|------------|----------|
| <= 2 | Direct: inline Edit/Write |
| 3-5 | Single code-developer for all |
| > 5 | Batch: one code-developer per module group |
**Per task**:
1. Build prompt from task JSON: description, files, implementation steps, convergence criteria
2. Include prior summaries and wisdom as context
3. Delegate to code-developer subagent (`run_in_background: false`)
4. Write `<session>/phase-{N}/summary-{IMPL-ID}.md` with: task ID, affected files, changes made, status
**Between waves**: report wave progress via team_msg (type: exec_progress)
## Phase 4: Self-Validation
| Check | Method | Pass Criteria |
|-------|--------|---------------|
| Affected files exist | `test -f <path>` for each file in summary | All present |
| TypeScript syntax | `npx tsc --noEmit` (if tsconfig.json exists) | No errors |
| Lint | `npm run lint` (best-effort) | No critical errors |
Log errors via team_msg but do NOT fix — verifier handles gap detection.

View File

@@ -0,0 +1,60 @@
---
prefix: PLAN
inner_loop: true
subagents:
- cli-explore-agent
- action-planning-agent
message_types:
success: plan_ready
progress: plan_progress
error: error
---
# Planner
Research and plan creation per roadmap phase. Gathers codebase context via cli-explore-agent, then generates wave-based execution plans with convergence criteria via action-planning-agent.
## Phase 2: Context Loading + Research
| Input | Source | Required |
|-------|--------|----------|
| roadmap.md | <session>/roadmap.md | Yes |
| config.json | <session>/config.json | Yes |
| Prior summaries | <session>/phase-{1..N-1}/summary-*.md | No |
| Wisdom | <session>/wisdom/ | No |
1. Read roadmap.md, extract phase goal, requirements (REQ-IDs), success criteria
2. Read config.json for depth setting (quick/standard/comprehensive)
3. Load prior phase summaries for dependency context
4. Detect gap closure mode (task description contains "Gap closure")
5. Launch cli-explore-agent with phase requirements as exploration query:
- Target: files needing modification, patterns, dependencies, test infrastructure, risks
6. If depth=comprehensive: run Gemini CLI analysis (`--mode analysis --rule analysis-analyze-code-patterns`)
7. Write `<session>/phase-{N}/context.md` combining roadmap requirements + exploration results
## Phase 3: Plan Creation
1. Load context.md from Phase 2
2. Create output directory: `<session>/phase-{N}/.task/`
3. Delegate to action-planning-agent with:
- Phase context + roadmap section + prior summaries
- Task ID format: `IMPL-{phase}{seq}` (e.g., IMPL-101, IMPL-102)
- Convergence criteria rules: measurable, goal-backward, includes file existence + export checks + test checks
- Hard limits: <= 10 tasks per phase, valid DAG, no cycles
4. Agent produces: `IMPL_PLAN.md`, `.task/IMPL-*.json`, `TODO_LIST.md`
5. If gap closure: only create tasks for gaps, starting from next available ID
## Phase 4: Self-Validation
| Check | Pass Criteria | Action on Failure |
|-------|---------------|-------------------|
| Task JSON files exist | >= 1 IMPL-*.json found | Error to coordinator |
| Required fields | id, title, description, files, implementation, convergence | Log warning |
| Convergence criteria | Each task has >= 1 criterion | Log warning |
| No self-dependency | task.id not in task.depends_on | Log error, remove cycle |
| All deps valid | Every depends_on ID exists | Log warning |
| IMPL_PLAN.md exists | File present | Generate minimal version from task JSONs |
After validation, compute wave structure from dependency graph for reporting:
- Wave count = topological layers of DAG
- Report: task count, wave count, file list

View File

@@ -0,0 +1,72 @@
---
prefix: VERIFY
inner_loop: true
subagents: []
message_types:
success: verify_passed
failure: gaps_found
error: error
---
# Verifier
Goal-backward verification per phase. Reads convergence criteria from IMPL-*.json task files and checks against actual codebase state. Read-only — never modifies code. Produces verification.md with pass/fail and structured gap lists.
## Phase 2: Context Loading
| Input | Source | Required |
|-------|--------|----------|
| Task JSONs | <session>/phase-{N}/.task/IMPL-*.json | Yes |
| Summaries | <session>/phase-{N}/summary-*.md | Yes |
| Wisdom | <session>/wisdom/ | No |
1. Glob IMPL-*.json files, extract convergence criteria from each task
2. Glob summary-*.md files, parse frontmatter (task, affects, provides)
3. If no task JSONs or summaries found → error to coordinator
## Phase 3: Goal-Backward Verification
For each task's convergence criteria, execute appropriate check:
| Criteria Type | Method |
|---------------|--------|
| File existence | `test -f <path>` |
| Command execution | Run command, check exit code |
| Pattern match | Grep for pattern in specified files |
| Semantic check | Optional: Gemini CLI (`--mode analysis --rule analysis-review-code-quality`) |
**Per task scoring**:
| Result | Condition |
|--------|-----------|
| pass | All criteria met |
| partial | Some criteria met |
| fail | No criteria met or critical check failed |
Collect all gaps from partial/failed tasks with structured format:
- task ID, criteria type, expected value, actual value
## Phase 4: Compile Results
1. Aggregate per-task results: count passed, partial, failed
2. Determine overall status:
- `passed` if gaps.length === 0
- `gaps_found` otherwise
3. Write `<session>/phase-{N}/verification.md`:
```yaml
---
phase: <N>
status: passed | gaps_found
tasks_checked: <count>
tasks_passed: <count>
gaps:
- task: "<task-id>"
type: "<criteria-type>"
item: "<description>"
expected: "<expected>"
actual: "<actual>"
---
```
4. Update .msg/meta.json with verification summary