feat: add dynamic pipeline detection for team sessions v5 architecture

Backend:
- Fix readLegacyFiles to handle { name, prefix }[] role format
- Add roles backfill in getEffectiveTeamMeta when meta.json exists
- Ensure pipeline_stages and roles flow correctly to API response

Team Skills:
- Add pipeline metadata initialization to all 16 team skill coordinator roles
- Each skill now reports pipeline_stages and roles to meta.json at session init

Documentation:
- Update command references and component documentation
- Add numerical-analysis-workflow skill spec
- Sync zh/en translations for commands and components
This commit is contained in:
catlog22
2026-03-04 14:52:07 +08:00
parent b203ada9c5
commit f389e3e6dd
56 changed files with 2007 additions and 201 deletions

View File

@@ -186,13 +186,25 @@ Bash("mkdir -p .workflow/<session-id>/artifacts/pipelines/A .workflow/<session-i
- `independent_targets`: populated for independent mode (e.g., ["refactor auth", "refactor API"])
- `fix_cycles`: populated per-branch/pipeline as fix cycles occur
3. Initialize .msg/meta.json:
```
Write("<session>/wisdom/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "parallel_mode": "<mode>" })
4. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<parallel_mode>",
pipeline_stages: ["analyzer", "designer", "refactorer", "validator", "reviewer"],
roles: ["coordinator", "analyzer", "designer", "refactorer", "validator", "reviewer"],
team_name: "arch-opt"
}
})
```
4. Create team:
5. Create team:
```
TeamCreate({ team_name: "arch-opt" })

View File

@@ -186,22 +186,26 @@ Bash("mkdir -p .workflow/.team/<session-id>/ideas .workflow/.team/<session-id>/c
}
```
4. Initialize .msg/meta.json:
```json
{
"session_id": "<session-id>",
"team_name": "brainstorm",
"topic": "<topic>",
"pipeline": "<mode>",
"angles": [],
"gc_round": 0,
"generated_ideas": [],
"critique_insights": [],
"synthesis_themes": [],
"evaluation_scores": [],
"status": "active"
}
4. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<mode>",
pipeline_stages: ["ideator", "challenger", "synthesizer", "evaluator"],
roles: ["coordinator", "ideator", "challenger", "synthesizer", "evaluator"],
team_name: "brainstorm",
topic: "<topic>",
angles: ["<angle1>", "<angle2>"],
gc_round": 0,
status: "active"
}
})
```
5. Create team:

View File

@@ -200,8 +200,24 @@ Regardless of complexity score or role count, coordinator MUST:
- `explorations/cache-index.json` (`{ "entries": [] }`)
- `discussions/` (empty directory)
9. **Initialize cross-role state** via team_msg:
- `team_msg(operation="log", session_id=<session-id>, from="coordinator", type="state_update", data={})`
9. **Initialize pipeline metadata** via team_msg:
```typescript
// 使用 team_msg 将 pipeline 元数据写入 .msg/meta.json
// 注意: 此处为动态角色,执行时需将 <placeholders> 替换为 task-analysis.json 中生成的实际角色列表
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<mode>",
pipeline_stages: ["<role1>", "<role2>", "<...dynamic-roles>"],
roles: ["coordinator", "<role1>", "<role2>", "<...dynamic-roles>"],
team_name: "<team-name>" // 从 session ID 或任务描述中提取
}
})
```
10. **Write team-session.json** with: session_id, task_description, status="active", roles, pipeline (empty), active_workers=[], completion_action="interactive", created_at

View File

@@ -161,10 +161,22 @@ Bash("mkdir -p .workflow/.team/FE-<slug>-<YYYY-MM-DD>/{.msg,wisdom,analysis,arch
}
```
3. Initialize .msg/meta.json:
```
Write("<session>/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "pipeline_mode": "<mode>" })
3. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<page|feature|system>",
pipeline_stages: ["analyst", "architect", "developer", "qa"],
roles: ["coordinator", "analyst", "architect", "developer", "qa"],
team_name: "frontend"
}
})
```
4. Create team:

View File

@@ -160,21 +160,22 @@ Bash("ccw issue list --status registered,pending --json")
Bash("mkdir -p .workflow/.team-plan/issue/explorations .workflow/.team-plan/issue/solutions .workflow/.team-plan/issue/audits .workflow/.team-plan/issue/queue .workflow/.team-plan/issue/builds .workflow/.team-plan/issue/wisdom")
```
2. Write session state to `.msg/meta.json`:
```json
{
"session_id": "<session-id>",
"status": "active",
"team_name": "issue",
"mode": "<quick|full|batch>",
"issue_ids": [],
"requirement": "<requirement>",
"execution_method": "<method>",
"code_review": "<setting>",
"timestamp": "<ISO-8601>",
"fix_cycles": {}
}
2. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<quick|full|batch>",
pipeline_stages: ["explorer", "planner", "reviewer", "integrator", "implementer"],
roles: ["coordinator", "explorer", "planner", "reviewer", "integrator", "implementer"],
team_name: "issue"
}
})
```
3. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)

View File

@@ -162,20 +162,22 @@ Bash("mkdir -p .workflow/.team/<session-id>/design .workflow/.team/<session-id>/
}
```
7. Initialize .msg/meta.json:
```json
{
"session_id": "<session-id>",
"requirement": "<requirement>",
"pipeline": "<pipeline>",
"architecture_decisions": [],
"implementation_context": [],
"review_feedback_trends": [],
"gc_round": 0,
"max_gc_rounds": 3,
"sprint_history": []
}
7. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-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"],
team_name: "iterdev"
}
})
```
---

View File

@@ -127,17 +127,37 @@ For callback/check/resume: load `commands/monitor.md` and execute the appropriat
4. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
5. Initialize explorations directory with empty cache-index.json
6. Write team-session.json
7. **Initialize meta.json with pipeline metadata** (CRITICAL for UI):
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<mode>", // e.g., "full", "spec-only", "impl-only"
pipeline_stages: ["analyst", "writer", "planner", "executor", "tester", "reviewer"], // Roles as stages
roles: ["coordinator", "analyst", "writer", "planner", "executor", "tester", "reviewer"],
team_name: "lifecycle" // Skill name for badge display
}
})
```
**pipeline_stages format**: Array of role names that represent pipeline stages. The UI will display these as the pipeline workflow.
**Task counts by mode**:
| Mode | Tasks |
|------|-------|
| spec-only | 6 |
| impl-only | 4 |
| fe-only | 3 |
| fullstack | 6 |
| full-lifecycle | 10 |
| full-lifecycle-fe | 12 |
| Mode | Tasks | pipeline_stages |
|------|-------|-----------------|
| spec-only | 6 | `["analyst", "writer", "reviewer"]` |
| impl-only | 4 | `["planner", "executor", "tester", "reviewer"]` |
| fe-only | 3 | `["planner", "fe-developer", "fe-qa"]` |
| fullstack | 6 | `["planner", "executor", "fe-developer", "tester", "fe-qa", "reviewer"]` |
| full-lifecycle | 10 | `["analyst", "writer", "planner", "executor", "tester", "reviewer"]` |
| full-lifecycle-fe | 12 | `["analyst", "writer", "planner", "executor", "fe-developer", "tester", "fe-qa", "reviewer"]` |
---

View File

@@ -186,10 +186,22 @@ Bash("mkdir -p .workflow/<session-id>/artifacts/pipelines/A .workflow/<session-i
- `independent_targets`: populated for independent mode (e.g., ["optimize rendering", "optimize API"])
- `fix_cycles`: populated per-branch/pipeline as fix cycles occur
3. Initialize .msg/meta.json:
```
Write("<session>/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "parallel_mode": "<mode>" })
3. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<auto|single|fan-out|independent>",
pipeline_stages: ["profiler", "strategist", "optimizer", "benchmarker", "reviewer"],
roles: ["coordinator", "profiler", "strategist", "optimizer", "benchmarker", "reviewer"],
team_name: "perf-opt"
}
})
```
4. Create team:

View File

@@ -95,18 +95,24 @@ For callback/check/resume: load `commands/monitor.md` and execute the appropriat
3. Create subdirectories: `artifacts/solutions/`, `wisdom/`
4. Call `TeamCreate` with team name (default: "planex")
5. Initialize wisdom files (learnings.md, decisions.md, conventions.md, issues.md)
6. Write .msg/meta.json:
```
{
6. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
input_type: "<issues|text|plan>",
input: "<raw-input>",
execution_method: "<agent|codex|gemini>",
status: "active",
active_workers: [],
started_at: "<ISO timestamp>"
}
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "plan-execute",
pipeline_stages: ["planner", "executor"],
roles: ["coordinator", "planner", "executor"],
team_name: "planex",
input_type: "<issues|text|plan>",
execution_method: "<agent|codex|gemini>"
}
})
```
---

View File

@@ -139,23 +139,34 @@ For callback/check/resume/complete: load `commands/monitor.md` and execute match
1. Generate session ID
2. Create session folder
3. Call TeamCreate with team name
4. Initialize .msg/meta.json with empty fields
4. Initialize meta.json with pipeline metadata and shared state:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<discovery|testing|full>",
pipeline_stages: ["scout", "strategist", "generator", "executor", "analyst"],
roles: ["coordinator", "scout", "strategist", "generator", "executor", "analyst"],
team_name: "quality-assurance",
discovered_issues: [],
test_strategy: {},
generated_tests: {},
execution_results: {},
defect_patterns: [],
coverage_history: [],
quality_score: null
}
})
```
5. Initialize wisdom directory (learnings.md, decisions.md, conventions.md, issues.md)
6. Write session file with: session_id, mode, scope, status="active"
**Shared Memory Structure**:
```
{
"discovered_issues": [],
"test_strategy": {},
"generated_tests": {},
"execution_results": {},
"defect_patterns": [],
"coverage_history": [],
"quality_score": null
}
```
**Success**: Team created, session file written, shared memory initialized.
---

View File

@@ -197,7 +197,26 @@ Bash("ccw team log --session-id <session-id> --from coordinator --type dispatch_
│ └── meta.json
```
3. Initialize .msg/meta.json with: workflow_id, mode, target, dimensions, auto flag
3. Initialize .msg/meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<default|full|fix-only|quick>",
pipeline_stages: ["scanner", "reviewer", "fixer"],
roles: ["coordinator", "scanner", "reviewer", "fixer"],
team_name: "review",
target: "<target>",
dimensions: "<dimensions>",
auto_confirm: "<auto_confirm>"
}
})
```
**Success**: Session folder created, shared memory initialized.

View File

@@ -198,8 +198,27 @@ Delegate to `commands/roadmap-discuss.md`:
**Workflow**:
1. Call `TeamCreate({ team_name: "roadmap-dev" })`
2. Spawn worker roles (see SKILL.md Coordinator Spawn Template)
3. Load `commands/dispatch.md` for task chain creation
2. Initialize meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "roadmap-driven",
pipeline_stages: ["planner", "executor", "verifier"],
roles: ["coordinator", "planner", "executor", "verifier"],
team_name: "roadmap-dev"
}
})
```
3. Spawn worker roles (see SKILL.md Coordinator Spawn Template)
4. Load `commands/dispatch.md` for task chain creation
| Step | Action |
|------|--------|

View File

@@ -224,17 +224,30 @@ Bash("ccw team log --session-id <session-id> --from coordinator --type <message-
└── issues.md
```
3. Initialize .msg/meta.json:
| Field | Initial Value |
|-------|---------------|
| `debt_inventory` | [] |
| `priority_matrix` | {} |
| `remediation_plan` | {} |
| `fix_results` | {} |
| `validation_results` | {} |
| `debt_score_before` | null |
| `debt_score_after` | null |
3. Initialize .msg/meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<scan|remediate|targeted>",
pipeline_stages: ["scanner", "assessor", "planner", "executor", "validator"],
roles: ["coordinator", "scanner", "assessor", "planner", "executor", "validator"],
team_name: "tech-debt",
debt_inventory: [],
priority_matrix: {},
remediation_plan: {},
fix_results: {},
validation_results: {},
debt_score_before: null,
debt_score_after: null
}
})
```
4. Call TeamCreate with team name "tech-debt"

View File

@@ -157,10 +157,22 @@ Bash("mkdir -p .workflow/.team/TST-<slug>-<date>/strategy .workflow/.team/TST-<s
}
```
3. Initialize .msg/meta.json:
```
Write("<session>/wisdom/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "pipeline": "<mode>" })
3. Initialize .msg/meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<targeted|standard|comprehensive>",
pipeline_stages: ["strategist", "generator", "executor", "analyst"],
roles: ["coordinator", "strategist", "generator", "executor", "analyst"],
team_name: "testing"
}
})
```
4. Create team:

View File

@@ -170,10 +170,22 @@ Bash("mkdir -p .workflow/.team/UDS-<slug>-<date>/research .workflow/.team/UDS-<s
}
```
3. Initialize .msg/meta.json:
```
Write("<session>/wisdom/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "pipeline": "<pipeline>" })
3. Initialize .msg/meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<component|system|full-system>",
pipeline_stages: ["researcher", "designer", "reviewer", "implementer"],
roles: ["coordinator", "researcher", "designer", "reviewer", "implementer"],
team_name: "uidesign"
}
})
```
4. Create team:

View File

@@ -156,7 +156,24 @@ TeamCreate({ team_name: "ultra-analyze" })
```
3. Write session.json with mode, requirement, timestamp
4. Initialize .msg/meta.json
4. Initialize .msg/meta.json with pipeline metadata:
```typescript
// Use team_msg to write pipeline metadata to .msg/meta.json
mcp__ccw-tools__team_msg({
operation: "log",
session_id: "<session-id>",
from: "coordinator",
type: "state_update",
summary: "Session initialized",
data: {
pipeline_mode: "<Quick|Deep|Standard>",
pipeline_stages: ["explorer", "analyst", "discussant", "synthesizer"],
roles: ["coordinator", "explorer", "analyst", "discussant", "synthesizer"],
team_name: "ultra-analyze"
}
})
```
5. Call `TeamCreate({ team_name: "ultra-analyze" })`
---