mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-28 20:01:17 +08:00
feat: migrate all codex team skills from spawn_agents_on_csv to spawn_agent + wait_agent architecture
- Delete 21 old team skill directories using CSV-wave pipeline pattern (~100+ files) - Delete old team-lifecycle (v3) and team-planex-v2 - Create generic team-worker.toml and team-supervisor.toml (replacing tlv4-specific TOMLs) - Convert 19 team skills from Claude Code format (Agent/SendMessage/TaskCreate) to Codex format (spawn_agent/wait_agent/tasks.json/request_user_input) - Update team-lifecycle-v4 to use generic agent types (team_worker/team_supervisor) - Convert all coordinator role files: dispatch.md, monitor.md, role.md - Convert all worker role files: remove run_in_background, fix Bash syntax - Convert all specs/pipelines.md references - Final state: 20 team skills, 217 .md files, zero Claude Code API residuals Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
65
.codex/skills/team-iterdev/roles/architect/role.md
Normal file
65
.codex/skills/team-iterdev/roles/architect/role.md
Normal file
@@ -0,0 +1,65 @@
|
||||
---
|
||||
role: architect
|
||||
prefix: DESIGN
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: design_ready
|
||||
revision: design_revision
|
||||
error: error
|
||||
---
|
||||
|
||||
# Architect
|
||||
|
||||
Technical design, task decomposition, and architecture decision records for iterative development.
|
||||
|
||||
## Phase 2: Context Loading + Codebase Exploration
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | No |
|
||||
| Wisdom files | <session>/wisdom/ | No |
|
||||
|
||||
1. Extract session path and requirement from task description
|
||||
2. Read .msg/meta.json for shared context (architecture_decisions, implementation_context)
|
||||
3. Read wisdom files if available (learnings.md, decisions.md, conventions.md)
|
||||
4. Explore codebase for existing patterns, module structure, dependencies:
|
||||
- Use mcp__ace-tool__search_context for semantic discovery
|
||||
- Identify similar implementations and integration points
|
||||
|
||||
## Phase 3: Technical Design + Task Decomposition
|
||||
|
||||
**Design strategy selection**:
|
||||
|
||||
| Condition | Strategy |
|
||||
|-----------|----------|
|
||||
| Single module change | Direct inline design |
|
||||
| Cross-module change | Multi-component design with integration points |
|
||||
| Large refactoring | Phased approach with milestones |
|
||||
|
||||
**Outputs**:
|
||||
|
||||
1. **Design Document** (`<session>/design/design-<num>.md`):
|
||||
- Architecture decision: approach, rationale, alternatives
|
||||
- Component design: responsibility, dependencies, files, complexity
|
||||
- Task breakdown: files, estimated complexity, dependencies, acceptance criteria
|
||||
- Integration points and risks with mitigations
|
||||
|
||||
2. **Task Breakdown JSON** (`<session>/design/task-breakdown.json`):
|
||||
- Array of tasks with id, title, files, complexity, dependencies, acceptance_criteria
|
||||
- Execution order for developer to follow
|
||||
|
||||
## Phase 4: Design Validation
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| Components defined | Verify component list | At least 1 component |
|
||||
| Task breakdown exists | Verify task list | At least 1 task |
|
||||
| Dependencies mapped | All components have dependencies field | All present (can be empty) |
|
||||
| Integration points | Verify integration section | Key integrations documented |
|
||||
|
||||
1. Run validation checks above
|
||||
2. Write architecture_decisions entry to .msg/meta.json:
|
||||
- design_id, approach, rationale, components, task_count
|
||||
3. Write discoveries to wisdom/decisions.md and wisdom/conventions.md
|
||||
@@ -0,0 +1,62 @@
|
||||
# Analyze Task
|
||||
|
||||
Parse iterative development task -> detect capabilities -> assess pipeline complexity -> design roles.
|
||||
|
||||
**CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
|
||||
|
||||
## Signal Detection
|
||||
|
||||
| Keywords | Capability | Role |
|
||||
|----------|------------|------|
|
||||
| design, architect, restructure, refactor plan | architect | architect |
|
||||
| implement, build, code, fix, develop | developer | developer |
|
||||
| test, verify, validate, coverage | tester | tester |
|
||||
| review, audit, quality, check | reviewer | reviewer |
|
||||
|
||||
## Pipeline Selection
|
||||
|
||||
| Signal | Score |
|
||||
|--------|-------|
|
||||
| Changed files > 10 | +3 |
|
||||
| Changed files 3-10 | +2 |
|
||||
| Structural change (refactor, architect, restructure) | +3 |
|
||||
| Cross-cutting (multiple, across, cross) | +2 |
|
||||
| Simple fix (fix, bug, typo, patch) | -2 |
|
||||
|
||||
| Score | Pipeline |
|
||||
|-------|----------|
|
||||
| >= 5 | multi-sprint |
|
||||
| 2-4 | sprint |
|
||||
| 0-1 | patch |
|
||||
|
||||
## Dependency Graph
|
||||
|
||||
Natural ordering tiers:
|
||||
- Tier 0: architect (design must come first)
|
||||
- Tier 1: developer (implementation requires design)
|
||||
- Tier 2: tester, reviewer (validation requires artifacts, can run parallel)
|
||||
|
||||
## Complexity Assessment
|
||||
|
||||
| Factor | Points |
|
||||
|--------|--------|
|
||||
| Cross-module changes | +2 |
|
||||
| Serial depth > 3 | +1 |
|
||||
| Multiple developers needed | +2 |
|
||||
| GC loop likely needed | +1 |
|
||||
|
||||
## Output
|
||||
|
||||
Write <session>/task-analysis.json:
|
||||
```json
|
||||
{
|
||||
"task_description": "<original>",
|
||||
"pipeline_type": "<patch|sprint|multi-sprint>",
|
||||
"capabilities": [{ "name": "<cap>", "role": "<role>", "keywords": ["..."] }],
|
||||
"roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": false }],
|
||||
"complexity": { "score": 0, "level": "Low|Medium|High" },
|
||||
"needs_architecture": true,
|
||||
"needs_testing": true,
|
||||
"needs_review": true
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,187 @@
|
||||
# Command: Dispatch
|
||||
|
||||
Create the iterative development task chain with correct dependencies and structured task descriptions.
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| User requirement | From coordinator Phase 1 | Yes |
|
||||
| Session folder | From coordinator Phase 2 | Yes |
|
||||
| Pipeline definition | From SKILL.md Pipeline Definitions | Yes |
|
||||
| Pipeline mode | From tasks.json `pipeline_mode` | Yes |
|
||||
|
||||
1. Load user requirement and scope from tasks.json
|
||||
2. Load pipeline stage definitions from SKILL.md Task Metadata Registry
|
||||
3. Read `pipeline_mode` from tasks.json (patch / sprint / multi-sprint)
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
### Task Entry Template
|
||||
|
||||
Each task in tasks.json `tasks` object:
|
||||
```json
|
||||
{
|
||||
"<TASK-ID>": {
|
||||
"title": "<concise title>",
|
||||
"description": "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>\nTASK:\n - <step 1: specific action>\n - <step 2: specific action>\n - <step 3: specific action>\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Upstream artifacts: <artifact-1>, <artifact-2>\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <deliverable path> + <quality criteria>\nCONSTRAINTS: <scope limits, focus areas>\n---\nInnerLoop: <true|false>",
|
||||
"role": "<role-name>",
|
||||
"prefix": "<PREFIX>",
|
||||
"deps": ["<dependency-list>"],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Mode Router
|
||||
|
||||
| Mode | Action |
|
||||
|------|--------|
|
||||
| `patch` | Create DEV-001 + VERIFY-001 |
|
||||
| `sprint` | Create DESIGN-001 + DEV-001 + VERIFY-001 + REVIEW-001 |
|
||||
| `multi-sprint` | Create Sprint 1 chain, subsequent sprints created dynamically |
|
||||
|
||||
---
|
||||
|
||||
### Patch Pipeline
|
||||
|
||||
**DEV-001** (developer):
|
||||
```json
|
||||
{
|
||||
"DEV-001": {
|
||||
"title": "Implement fix",
|
||||
"description": "PURPOSE: Implement fix | Success: Fix applied, syntax clean\nTASK:\n - Load target files and understand context\n - Apply fix changes\n - Validate syntax\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: Modified source files + <session>/code/dev-log.md | Syntax clean\nCONSTRAINTS: Minimal changes | Preserve existing behavior\n---\nInnerLoop: true",
|
||||
"role": "developer",
|
||||
"prefix": "DEV",
|
||||
"deps": [],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**VERIFY-001** (tester):
|
||||
```json
|
||||
{
|
||||
"VERIFY-001": {
|
||||
"title": "Verify fix correctness",
|
||||
"description": "PURPOSE: Verify fix correctness | Success: Tests pass, no regressions\nTASK:\n - Detect test framework\n - Run targeted tests for changed files\n - Run regression test suite\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Upstream artifacts: code/dev-log.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/verify/verify-001.json | Pass rate >= 95%\nCONSTRAINTS: Focus on changed files | Report any regressions\n---\nInnerLoop: false",
|
||||
"role": "tester",
|
||||
"prefix": "VERIFY",
|
||||
"deps": ["DEV-001"],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Sprint Pipeline
|
||||
|
||||
**DESIGN-001** (architect):
|
||||
```json
|
||||
{
|
||||
"DESIGN-001": {
|
||||
"title": "Technical design and task breakdown",
|
||||
"description": "PURPOSE: Technical design and task breakdown | Success: Design document + task breakdown ready\nTASK:\n - Explore codebase for patterns and dependencies\n - Create component design with integration points\n - Break down into implementable tasks with acceptance criteria\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/design/design-001.md + <session>/design/task-breakdown.json | Components defined, tasks actionable\nCONSTRAINTS: Focus on <task-scope> | Risk assessment required\n---\nInnerLoop: false",
|
||||
"role": "architect",
|
||||
"prefix": "DESIGN",
|
||||
"deps": [],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**DEV-001** (developer):
|
||||
```json
|
||||
{
|
||||
"DEV-001": {
|
||||
"title": "Implement design",
|
||||
"description": "PURPOSE: Implement design | Success: All design tasks implemented, syntax clean\nTASK:\n - Load design and task breakdown\n - Implement tasks in execution order\n - Validate syntax after changes\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Upstream artifacts: design/design-001.md, design/task-breakdown.json\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: Modified source files + <session>/code/dev-log.md | Syntax clean, all tasks done\nCONSTRAINTS: Follow design | Preserve existing behavior | Follow code conventions\n---\nInnerLoop: true",
|
||||
"role": "developer",
|
||||
"prefix": "DEV",
|
||||
"deps": ["DESIGN-001"],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**VERIFY-001** (tester, parallel with REVIEW-001):
|
||||
```json
|
||||
{
|
||||
"VERIFY-001": {
|
||||
"title": "Verify implementation",
|
||||
"description": "PURPOSE: Verify implementation | Success: Tests pass, no regressions\nTASK:\n - Detect test framework\n - Run tests for changed files\n - Run regression test suite\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Upstream artifacts: code/dev-log.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/verify/verify-001.json | Pass rate >= 95%\nCONSTRAINTS: Focus on changed files | Report regressions\n---\nInnerLoop: false",
|
||||
"role": "tester",
|
||||
"prefix": "VERIFY",
|
||||
"deps": ["DEV-001"],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**REVIEW-001** (reviewer, parallel with VERIFY-001):
|
||||
```json
|
||||
{
|
||||
"REVIEW-001": {
|
||||
"title": "Code review for correctness and quality",
|
||||
"description": "PURPOSE: Code review for correctness and quality | Success: All dimensions reviewed, verdict issued\nTASK:\n - Load changed files and design document\n - Review across 4 dimensions: correctness, completeness, maintainability, security\n - Score quality (1-10) and issue verdict\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Upstream artifacts: design/design-001.md, code/dev-log.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: <session>/review/review-001.md | Per-dimension findings with severity\nCONSTRAINTS: Focus on implementation changes | Provide file:line references\n---\nInnerLoop: false",
|
||||
"role": "reviewer",
|
||||
"prefix": "REVIEW",
|
||||
"deps": ["DEV-001"],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Multi-Sprint Pipeline
|
||||
|
||||
Sprint 1: DESIGN-001 -> DEV-001 -> DEV-002(incremental) -> VERIFY-001 -> DEV-fix -> REVIEW-001
|
||||
|
||||
Create Sprint 1 tasks using sprint templates above, plus:
|
||||
|
||||
**DEV-002** (developer, incremental):
|
||||
```json
|
||||
{
|
||||
"DEV-002": {
|
||||
"title": "Incremental implementation",
|
||||
"description": "PURPOSE: Incremental implementation | Success: Remaining tasks implemented\nTASK:\n - Load remaining tasks from breakdown\n - Implement incrementally\n - Validate syntax\nCONTEXT:\n - Session: <session-folder>\n - Scope: <task-scope>\n - Upstream artifacts: design/task-breakdown.json, code/dev-log.md\n - Shared memory: <session>/.msg/meta.json\nEXPECTED: Modified source files + updated dev-log.md\nCONSTRAINTS: Incremental delivery | Follow existing patterns\n---\nInnerLoop: true",
|
||||
"role": "developer",
|
||||
"prefix": "DEV",
|
||||
"deps": ["DEV-001"],
|
||||
"status": "pending",
|
||||
"findings": "",
|
||||
"error": ""
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Subsequent sprints created dynamically after Sprint N completes.
|
||||
|
||||
## Phase 4: Validation
|
||||
|
||||
Verify task chain integrity:
|
||||
|
||||
| Check | Method | Expected |
|
||||
|-------|--------|----------|
|
||||
| Task count correct | tasks.json count | patch: 2, sprint: 4, multi: 5+ |
|
||||
| Dependencies correct | Trace deps graph | Acyclic, correct ordering |
|
||||
| No circular dependencies | Trace full graph | Acyclic |
|
||||
| Structured descriptions | Each has PURPOSE/TASK/CONTEXT/EXPECTED | All present |
|
||||
|
||||
If validation fails, fix the specific task and re-validate.
|
||||
186
.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md
Normal file
186
.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md
Normal file
@@ -0,0 +1,186 @@
|
||||
# Command: Monitor
|
||||
|
||||
Synchronous pipeline coordination using spawn_agent + wait_agent.
|
||||
|
||||
## Constants
|
||||
|
||||
- WORKER_AGENT: team_worker
|
||||
- MAX_GC_ROUNDS: 3
|
||||
|
||||
## Handler Router
|
||||
|
||||
| Source | Handler |
|
||||
|--------|---------|
|
||||
| "capability_gap" | handleAdapt |
|
||||
| "check" or "status" | handleCheck |
|
||||
| "resume" or "continue" | handleResume |
|
||||
| All tasks completed | handleComplete |
|
||||
| Default | handleSpawnNext |
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Session state | tasks.json | Yes |
|
||||
| Trigger event | From Entry Router detection | Yes |
|
||||
| Meta state | <session>/.msg/meta.json | Yes |
|
||||
|
||||
1. Load tasks.json for current state, pipeline_mode, gc_round, max_gc_rounds
|
||||
2. Read tasks from tasks.json to get current task statuses
|
||||
3. Identify trigger event type from Entry Router
|
||||
|
||||
## Phase 3: Event Handlers
|
||||
|
||||
### handleCallback
|
||||
|
||||
Triggered when a worker completes (wait_agent returns).
|
||||
|
||||
1. Determine role from completed task prefix:
|
||||
|
||||
| Task Prefix | Role Detection |
|
||||
|-------------|---------------|
|
||||
| `DESIGN-*` | architect |
|
||||
| `DEV-*` | developer |
|
||||
| `VERIFY-*` | tester |
|
||||
| `REVIEW-*` | reviewer |
|
||||
|
||||
2. Mark task as completed in tasks.json:
|
||||
|
||||
```
|
||||
state.tasks[taskId].status = 'completed'
|
||||
```
|
||||
|
||||
3. Record completion in session state and update metrics
|
||||
|
||||
4. **Generator-Critic check** (when reviewer completes):
|
||||
- If completed task is REVIEW-* AND pipeline is sprint or multi-sprint:
|
||||
- Read review report for GC signal (critical_count, score)
|
||||
- Read tasks.json for gc_round
|
||||
|
||||
| GC Signal | gc_round < max | Action |
|
||||
|-----------|----------------|--------|
|
||||
| review.critical_count > 0 OR review.score < 7 | Yes | Increment gc_round, create DEV-fix task in tasks.json with deps on this REVIEW, log `gc_loop_trigger` |
|
||||
| review.critical_count > 0 OR review.score < 7 | No (>= max) | Force convergence, accept with warning, log to wisdom/issues.md |
|
||||
| review.critical_count == 0 AND review.score >= 7 | - | Review passed, proceed to handleComplete check |
|
||||
|
||||
- Log team_msg with type "gc_loop_trigger" or "task_unblocked"
|
||||
|
||||
5. Proceed to handleSpawnNext
|
||||
|
||||
### handleSpawnNext
|
||||
|
||||
Find and spawn the next ready tasks.
|
||||
|
||||
1. Read tasks.json, find tasks where:
|
||||
- Status is "pending"
|
||||
- All deps tasks have status "completed"
|
||||
|
||||
2. For each ready task, determine role from task prefix:
|
||||
|
||||
| Task Prefix | Role | Inner Loop |
|
||||
|-------------|------|------------|
|
||||
| DESIGN-* | architect | false |
|
||||
| DEV-* | developer | true |
|
||||
| VERIFY-* | tester | false |
|
||||
| REVIEW-* | reviewer | false |
|
||||
|
||||
3. Spawn team_worker:
|
||||
|
||||
```javascript
|
||||
// 1) Update status in tasks.json
|
||||
state.tasks[taskId].status = 'in_progress'
|
||||
|
||||
// 2) Spawn worker
|
||||
const agentId = spawn_agent({
|
||||
agent_type: "team_worker",
|
||||
items: [
|
||||
{ type: "text", text: `## Role Assignment
|
||||
role: ${role}
|
||||
role_spec: ${skillRoot}/roles/${role}/role.md
|
||||
session: ${sessionFolder}
|
||||
session_id: ${sessionId}
|
||||
requirement: ${taskDescription}
|
||||
inner_loop: ${innerLoop}` },
|
||||
|
||||
{ type: "text", text: `Read role_spec file to load Phase 2-4 domain instructions.
|
||||
Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.` }
|
||||
]
|
||||
})
|
||||
|
||||
// 3) Track agent
|
||||
state.active_agents[taskId] = { agentId, role, started_at: now }
|
||||
|
||||
// 4) Wait for completion
|
||||
wait_agent({ ids: [agentId] })
|
||||
|
||||
// 5) Collect results and update tasks.json
|
||||
state.tasks[taskId].status = 'completed'
|
||||
delete state.active_agents[taskId]
|
||||
```
|
||||
|
||||
4. **Parallel spawn rules**:
|
||||
|
||||
| Pipeline | Scenario | Spawn Behavior |
|
||||
|----------|----------|---------------|
|
||||
| Patch | DEV -> VERIFY | One worker at a time |
|
||||
| Sprint | VERIFY + REVIEW both unblocked | Spawn BOTH in parallel, wait_agent for both |
|
||||
| Sprint | Other stages | One worker at a time |
|
||||
| Multi-Sprint | VERIFY + DEV-fix both unblocked | Spawn BOTH in parallel, wait_agent for both |
|
||||
| Multi-Sprint | Other stages | One worker at a time |
|
||||
|
||||
5. STOP after processing -- wait for next event
|
||||
|
||||
### handleCheck
|
||||
|
||||
Output current pipeline status from tasks.json. Do NOT advance pipeline.
|
||||
|
||||
```
|
||||
Pipeline Status (<pipeline-mode>):
|
||||
[DONE] DESIGN-001 (architect) -> design/design-001.md
|
||||
[DONE] DEV-001 (developer) -> code/dev-log.md
|
||||
[RUN] VERIFY-001 (tester) -> verifying...
|
||||
[RUN] REVIEW-001 (reviewer) -> reviewing...
|
||||
[WAIT] DEV-fix (developer) -> blocked by REVIEW-001
|
||||
|
||||
GC Rounds: <gc_round>/<max_gc_rounds>
|
||||
Sprint: <sprint_id>
|
||||
Session: <session-id>
|
||||
```
|
||||
|
||||
### handleResume
|
||||
|
||||
Resume pipeline after user pause or interruption.
|
||||
|
||||
1. Audit tasks.json for inconsistencies:
|
||||
- Tasks stuck in "in_progress" -> reset to "pending"
|
||||
- Tasks with completed deps but still "pending" -> include in spawn list
|
||||
2. Proceed to handleSpawnNext
|
||||
|
||||
### handleComplete
|
||||
|
||||
Triggered when all pipeline tasks are completed.
|
||||
|
||||
**Completion check by mode**:
|
||||
|
||||
| Mode | Completion Condition |
|
||||
|------|---------------------|
|
||||
| patch | DEV-001 + VERIFY-001 completed |
|
||||
| sprint | DESIGN-001 + DEV-001 + VERIFY-001 + REVIEW-001 (+ any GC tasks) completed |
|
||||
| multi-sprint | All sprint tasks (+ any GC tasks) completed |
|
||||
|
||||
1. Verify all tasks completed in tasks.json
|
||||
2. If any tasks not completed, return to handleSpawnNext
|
||||
3. **Multi-sprint check**: If multi-sprint AND more sprints planned:
|
||||
- Record sprint metrics to .msg/meta.json sprint_history
|
||||
- Evaluate downgrade eligibility (velocity >= expected, review avg >= 8)
|
||||
- Pause for user confirmation before Sprint N+1
|
||||
4. If all completed, transition to coordinator Phase 5 (Report + Completion Action)
|
||||
|
||||
## Phase 4: State Persistence
|
||||
|
||||
After every handler execution:
|
||||
|
||||
1. Update tasks.json with current state (gc_round, last event, active tasks)
|
||||
2. Update .msg/meta.json gc_round if changed
|
||||
3. Verify task list consistency
|
||||
4. STOP and wait for next event
|
||||
161
.codex/skills/team-iterdev/roles/coordinator/role.md
Normal file
161
.codex/skills/team-iterdev/roles/coordinator/role.md
Normal file
@@ -0,0 +1,161 @@
|
||||
# Coordinator Role
|
||||
|
||||
Orchestrate team-iterdev: analyze -> dispatch -> spawn -> monitor -> report.
|
||||
|
||||
## Identity
|
||||
- Name: coordinator | Tag: [coordinator]
|
||||
- Responsibility: Analyze task -> Create session -> Dispatch tasks -> Monitor progress -> Report results
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
- Use `team_worker` agent type for all worker spawns (NOT `general-purpose`)
|
||||
- Follow Command Execution Protocol for dispatch and monitor commands
|
||||
- Respect pipeline stage dependencies (deps)
|
||||
- Stop after spawning workers -- wait for results via wait_agent
|
||||
- Handle developer<->reviewer GC loop (max 3 rounds)
|
||||
- Maintain tasks.json for real-time progress
|
||||
- Execute completion action in Phase 5
|
||||
|
||||
### MUST NOT
|
||||
- Implement domain logic (designing, coding, testing, reviewing) -- workers handle this
|
||||
- Spawn workers without creating tasks first
|
||||
- Write source code directly
|
||||
- Force-advance pipeline past failed review/validation
|
||||
- Modify task outputs (workers own their deliverables)
|
||||
|
||||
## Command Execution Protocol
|
||||
|
||||
When coordinator needs to execute a command:
|
||||
1. Read `commands/<command>.md`
|
||||
2. Follow the workflow defined in the command
|
||||
3. Commands are inline execution guides, NOT separate agents
|
||||
4. Execute synchronously, complete before proceeding
|
||||
|
||||
## Entry Router
|
||||
|
||||
| Detection | Condition | Handler |
|
||||
|-----------|-----------|---------|
|
||||
| Status check | Args contain "check" or "status" | -> handleCheck (monitor.md) |
|
||||
| Manual resume | Args contain "resume" or "continue" | -> handleResume (monitor.md) |
|
||||
| Pipeline complete | All tasks completed | -> handleComplete (monitor.md) |
|
||||
| Interrupted session | Active/paused session in .workflow/.team/IDS-* | -> Phase 0 |
|
||||
| New session | None of above | -> Phase 1 |
|
||||
|
||||
For check/resume/complete: load @commands/monitor.md, execute handler, STOP.
|
||||
|
||||
## Phase 0: Session Resume Check
|
||||
|
||||
1. Scan `.workflow/.team/IDS-*/tasks.json` for active/paused sessions
|
||||
2. No sessions -> Phase 1
|
||||
3. Single session -> reconcile (read tasks.json, reset in_progress->pending, kick first ready task)
|
||||
4. Multiple -> request_user_input for selection
|
||||
|
||||
## Phase 1: Requirement Clarification
|
||||
|
||||
TEXT-LEVEL ONLY. No source code reading.
|
||||
|
||||
1. Parse user task description from $ARGUMENTS
|
||||
2. Delegate to @commands/analyze.md
|
||||
3. Assess complexity for pipeline selection:
|
||||
|
||||
| Signal | Weight |
|
||||
|--------|--------|
|
||||
| Changed files > 10 | +3 |
|
||||
| Changed files 3-10 | +2 |
|
||||
| Structural change (refactor, architect, restructure) | +3 |
|
||||
| Cross-cutting (multiple, across, cross) | +2 |
|
||||
| Simple fix (fix, bug, typo, patch) | -2 |
|
||||
|
||||
| Score | Pipeline |
|
||||
|-------|----------|
|
||||
| >= 5 | multi-sprint |
|
||||
| 2-4 | sprint |
|
||||
| 0-1 | patch |
|
||||
|
||||
4. Ask for missing parameters via request_user_input (mode selection)
|
||||
5. Record requirement with scope, pipeline mode
|
||||
6. CRITICAL: Always proceed to Phase 2, never skip team workflow
|
||||
|
||||
## Phase 2: Session & Team Setup
|
||||
|
||||
1. Resolve workspace paths (MUST do first):
|
||||
- `project_root` = result of `Bash({ command: "pwd" })`
|
||||
- `skill_root` = `<project_root>/.codex/skills/team-iterdev`
|
||||
2. Generate session ID: `IDS-<slug>-<YYYY-MM-DD>`
|
||||
3. Create session folder structure:
|
||||
```
|
||||
mkdir -p .workflow/.team/<session-id>/{design,code,verify,review,wisdom}
|
||||
```
|
||||
4. Read specs/pipelines.md -> select pipeline based on complexity
|
||||
5. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
|
||||
6. Write initial tasks.json:
|
||||
```json
|
||||
{
|
||||
"session_id": "<id>",
|
||||
"pipeline_mode": "<patch|sprint|multi-sprint>",
|
||||
"requirement": "<original requirement>",
|
||||
"created_at": "<ISO timestamp>",
|
||||
"gc_round": 0,
|
||||
"max_gc_rounds": 3,
|
||||
"active_agents": {},
|
||||
"tasks": {}
|
||||
}
|
||||
```
|
||||
7. Initialize meta.json with pipeline metadata:
|
||||
```typescript
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log", session_id: "<id>", from: "coordinator",
|
||||
type: "state_update", summary: "Session initialized",
|
||||
data: {
|
||||
pipeline_mode: "<patch|sprint|multi-sprint>",
|
||||
pipeline_stages: ["architect", "developer", "tester", "reviewer"],
|
||||
roles: ["coordinator", "architect", "developer", "tester", "reviewer"]
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Phase 3: Task Chain Creation
|
||||
|
||||
Delegate to @commands/dispatch.md:
|
||||
1. Read specs/pipelines.md for selected pipeline task registry
|
||||
2. Add task entries to tasks.json `tasks` object with deps
|
||||
3. Update tasks.json metadata
|
||||
|
||||
## Phase 4: Spawn-and-Wait
|
||||
|
||||
Delegate to @commands/monitor.md#handleSpawnNext:
|
||||
1. Find ready tasks (pending + all deps resolved)
|
||||
2. Spawn team_worker agents via spawn_agent, wait_agent for results
|
||||
3. Output status summary
|
||||
4. STOP
|
||||
|
||||
## Phase 5: Report + Completion Action
|
||||
|
||||
1. Load session state -> count completed tasks, calculate duration
|
||||
2. Record sprint learning to .msg/meta.json sprint_history
|
||||
3. List deliverables:
|
||||
|
||||
| Deliverable | Path |
|
||||
|-------------|------|
|
||||
| Design Document | <session>/design/design-001.md |
|
||||
| Task Breakdown | <session>/design/task-breakdown.json |
|
||||
| Dev Log | <session>/code/dev-log.md |
|
||||
| Verification Results | <session>/verify/verify-001.json |
|
||||
| Review Report | <session>/review/review-001.md |
|
||||
|
||||
4. Execute completion action per session.completion_action:
|
||||
- interactive -> request_user_input (Archive/Keep/Export)
|
||||
- auto_archive -> Archive & Clean (status=completed)
|
||||
- auto_keep -> Keep Active (status=paused)
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Error | Resolution |
|
||||
|-------|------------|
|
||||
| Task too vague | request_user_input for clarification |
|
||||
| Session corruption | Attempt recovery, fallback to manual |
|
||||
| Worker crash | Reset task to pending, respawn |
|
||||
| GC loop exceeds 3 rounds | Accept with warning, record in shared memory |
|
||||
| Sprint velocity drops below 50% | Alert user, suggest scope reduction |
|
||||
| Task ledger corrupted | Rebuild from tasks.json state |
|
||||
74
.codex/skills/team-iterdev/roles/developer/role.md
Normal file
74
.codex/skills/team-iterdev/roles/developer/role.md
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
role: developer
|
||||
prefix: DEV
|
||||
inner_loop: true
|
||||
message_types:
|
||||
success: dev_complete
|
||||
progress: dev_progress
|
||||
error: error
|
||||
---
|
||||
|
||||
# Developer
|
||||
|
||||
Code implementer. Implements code according to design, incremental delivery. Acts as Generator in Generator-Critic loop (paired with reviewer).
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | Yes |
|
||||
| Design document | <session>/design/design-001.md | For non-fix tasks |
|
||||
| Task breakdown | <session>/design/task-breakdown.json | For non-fix tasks |
|
||||
| Review feedback | <session>/review/*.md | For fix tasks |
|
||||
| Wisdom files | <session>/wisdom/ | No |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read .msg/meta.json for shared context
|
||||
3. Detect task type:
|
||||
|
||||
| Task Type | Detection | Loading |
|
||||
|-----------|-----------|---------|
|
||||
| Fix task | Subject contains "fix" | Read latest review file for feedback |
|
||||
| Normal task | No "fix" in subject | Read design document + task breakdown |
|
||||
|
||||
4. Load previous implementation_context from .msg/meta.json
|
||||
5. Read wisdom files for conventions and known issues
|
||||
|
||||
## Phase 3: Code Implementation
|
||||
|
||||
**Implementation strategy selection**:
|
||||
|
||||
| Task Count | Complexity | Strategy |
|
||||
|------------|------------|----------|
|
||||
| <= 2 tasks | Low | Direct: inline Edit/Write |
|
||||
| 3-5 tasks | Medium | Single agent: one code-developer for all |
|
||||
| > 5 tasks | High | Batch agent: group by module, one agent per batch |
|
||||
|
||||
**Fix Task Mode** (GC Loop):
|
||||
- Focus on review feedback items only
|
||||
- Fix critical issues first, then high, then medium
|
||||
- Do NOT change code that was not flagged
|
||||
- Maintain existing code style and patterns
|
||||
|
||||
**Normal Task Mode**:
|
||||
- Read target files, apply changes using Edit or Write
|
||||
- Follow execution order from task breakdown
|
||||
- Validate syntax after each major change
|
||||
|
||||
## Phase 4: Self-Validation
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| Syntax | tsc --noEmit or equivalent | No errors |
|
||||
| File existence | Verify all planned files exist | All files present |
|
||||
| Import resolution | Check no broken imports | All imports resolve |
|
||||
|
||||
1. Run syntax check: `tsc --noEmit` / `python -m py_compile` / equivalent
|
||||
2. Auto-fix if validation fails (max 2 attempts)
|
||||
3. Write dev log to `<session>/code/dev-log.md`:
|
||||
- Changed files count, syntax status, fix task flag, file list
|
||||
4. Update implementation_context in .msg/meta.json:
|
||||
- task, changed_files, is_fix, syntax_clean
|
||||
5. Write discoveries to wisdom/learnings.md
|
||||
66
.codex/skills/team-iterdev/roles/reviewer/role.md
Normal file
66
.codex/skills/team-iterdev/roles/reviewer/role.md
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
role: reviewer
|
||||
prefix: REVIEW
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: review_passed
|
||||
revision: review_revision
|
||||
critical: review_critical
|
||||
error: error
|
||||
---
|
||||
|
||||
# Reviewer
|
||||
|
||||
Code reviewer. Multi-dimensional review, quality scoring, improvement suggestions. Acts as Critic in Generator-Critic loop (paired with developer).
|
||||
|
||||
## Phase 2: Context Loading
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | Yes |
|
||||
| Design document | <session>/design/design-001.md | For requirements alignment |
|
||||
| Changed files | Git diff | Yes |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read .msg/meta.json for shared context and previous review_feedback_trends
|
||||
3. Read design document for requirements alignment
|
||||
4. Get changed files via git diff, read file contents (limit 20 files)
|
||||
|
||||
## Phase 3: Multi-Dimensional Review
|
||||
|
||||
**Review dimensions**:
|
||||
|
||||
| Dimension | Weight | Focus Areas |
|
||||
|-----------|--------|-------------|
|
||||
| Correctness | 30% | Logic correctness, boundary handling |
|
||||
| Completeness | 25% | Coverage of design requirements |
|
||||
| Maintainability | 25% | Readability, code style, DRY |
|
||||
| Security | 20% | Vulnerabilities, input validation |
|
||||
|
||||
Per-dimension: scan modified files, record findings with severity (CRITICAL/HIGH/MEDIUM/LOW), include file:line references and suggestions.
|
||||
|
||||
**Scoring**: Weighted average of dimension scores (1-10 each).
|
||||
|
||||
**Output review report** (`<session>/review/review-<num>.md`):
|
||||
- Files reviewed count, quality score, issue counts by severity
|
||||
- Per-finding: severity, file:line, dimension, description, suggestion
|
||||
- Scoring breakdown by dimension
|
||||
- Signal: CRITICAL / REVISION_NEEDED / APPROVED
|
||||
- Design alignment notes
|
||||
|
||||
## Phase 4: Trend Analysis + Verdict
|
||||
|
||||
1. Compare with previous review_feedback_trends from .msg/meta.json
|
||||
2. Identify recurring issues, improvement areas, new issues
|
||||
|
||||
| Verdict Condition | Message Type |
|
||||
|-------------------|--------------|
|
||||
| criticalCount > 0 | review_critical |
|
||||
| score < 7 | review_revision |
|
||||
| else | review_passed |
|
||||
|
||||
3. Update review_feedback_trends in .msg/meta.json:
|
||||
- review_id, score, critical count, high count, dimensions, gc_round
|
||||
4. Write discoveries to wisdom/learnings.md
|
||||
88
.codex/skills/team-iterdev/roles/tester/role.md
Normal file
88
.codex/skills/team-iterdev/roles/tester/role.md
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
role: tester
|
||||
prefix: VERIFY
|
||||
inner_loop: false
|
||||
message_types:
|
||||
success: verify_passed
|
||||
failure: verify_failed
|
||||
fix: fix_required
|
||||
error: error
|
||||
---
|
||||
|
||||
# Tester
|
||||
|
||||
Test validator. Test execution, fix cycles, and regression detection.
|
||||
|
||||
## Phase 2: Environment Detection
|
||||
|
||||
| Input | Source | Required |
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| .msg/meta.json | <session>/.msg/meta.json | Yes |
|
||||
| Changed files | Git diff | Yes |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read .msg/meta.json for shared context
|
||||
3. Get changed files via git diff
|
||||
4. Detect test framework and command:
|
||||
|
||||
| Detection | Method |
|
||||
|-----------|--------|
|
||||
| Test command | Check package.json scripts, pytest.ini, Makefile |
|
||||
| Coverage tool | Check for nyc, coverage.py, jest --coverage config |
|
||||
|
||||
Common commands: npm test, pytest, go test ./..., cargo test
|
||||
|
||||
## Phase 3: Execution + Fix Cycle
|
||||
|
||||
**Iterative test-fix cycle** (max 5 iterations):
|
||||
|
||||
| Step | Action |
|
||||
|------|--------|
|
||||
| 1 | Run test command |
|
||||
| 2 | Parse results, check pass rate |
|
||||
| 3 | Pass rate >= 95% -> exit loop (success) |
|
||||
| 4 | Extract failing test details |
|
||||
| 5 | Apply fix using CLI tool |
|
||||
| 6 | Increment iteration counter |
|
||||
| 7 | iteration >= MAX (5) -> exit loop (report failures) |
|
||||
| 8 | Go to Step 1 |
|
||||
|
||||
**Fix delegation**: Use CLI tool to fix failing tests:
|
||||
|
||||
```bash
|
||||
ccw cli -p "PURPOSE: Fix failing tests; success = all listed tests pass
|
||||
TASK: • Analyze test failure output • Identify root cause in changed files • Apply minimal fix
|
||||
MODE: write
|
||||
CONTEXT: @<changed-files> | Memory: Test output from current iteration
|
||||
EXPECTED: Code fixes that make failing tests pass without breaking other tests
|
||||
CONSTRAINTS: Only modify files in changed list | Minimal changes
|
||||
Test output: <test-failure-details>
|
||||
Changed files: <file-list>" --tool gemini --mode write --rule development-debug-runtime-issues
|
||||
```
|
||||
|
||||
Wait for CLI completion before re-running tests.
|
||||
|
||||
## Phase 4: Regression Check + Report
|
||||
|
||||
1. Run full test suite for regression: `<test-command> --all`
|
||||
|
||||
| Check | Method | Pass Criteria |
|
||||
|-------|--------|---------------|
|
||||
| Regression | Run full test suite | No FAIL in output |
|
||||
| Coverage | Run coverage tool | >= 80% (if configured) |
|
||||
|
||||
2. Write verification results to `<session>/verify/verify-<num>.json`:
|
||||
- verify_id, pass_rate, iterations, passed, timestamp, regression_passed
|
||||
|
||||
3. Determine message type:
|
||||
|
||||
| Condition | Message Type |
|
||||
|-----------|--------------|
|
||||
| passRate >= 0.95 | verify_passed |
|
||||
| passRate < 0.95 && iterations >= MAX | fix_required |
|
||||
| passRate < 0.95 | verify_failed |
|
||||
|
||||
4. Update .msg/meta.json with test_patterns entry
|
||||
5. Write discoveries to wisdom/issues.md
|
||||
Reference in New Issue
Block a user