feat: apply Pattern 10 to all team skills — @ strong refs + workspace resolution

- SKILL.md: coordinator entry uses `@roles/coordinator/role.md` strong reference
- coordinator/role.md: command delegations use `@commands/xxx.md` prefix
- coordinator Phase 2: resolve project_root + skill_root via `Bash pwd` before TeamCreate
- Worker Spawn Template: role_spec uses absolute path from session skill_root
- skills_lib/team-skill-designer: document Pattern 10 + add quality checks

Covers 17 team skills: team-lifecycle-v4, team-frontend, team-ultra-analyze,
team-ux-improve, team-arch-opt, team-brainstorm, team-review, team-uidesign,
team-issue, team-iterdev, team-perf-opt, team-planex, team-quality-assurance,
team-testing, team-tech-debt, team-coordinate, team-roadmap-dev, team-frontend-debug

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-03-18 16:01:43 +08:00
parent 398601f885
commit b91bdcdfa4
35 changed files with 307 additions and 237 deletions

View File

@@ -52,7 +52,7 @@ Pipeline (Quick mode):
Parse `$ARGUMENTS`:
- Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
- No `--role` Read `roles/coordinator/role.md`, execute entry router
- No `--role``@roles/coordinator/role.md`, execute entry router
## Shared Constants
@@ -75,7 +75,7 @@ Agent({
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: ~ or <project>/.claude/skills/team-ultra-analyze/roles/<role>/role.md
role_spec: <skill_root>/roles/<role>/role.md
session: <session-folder>
session_id: <session-id>
team_name: ultra-analyze
@@ -83,7 +83,7 @@ requirement: <topic-description>
agent_name: <agent-name>
inner_loop: false
Read role_spec file to load Phase 2-4 domain instructions.
Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
Execute built-in Phase 1 (task discovery, owner=<agent-name>) -> role Phase 2-4 -> built-in Phase 5 (report).`
})
```

View File

@@ -51,7 +51,7 @@ When coordinator is invoked, detect invocation type:
| Interrupted session | Active/paused session exists | -> Phase 0 |
| New session | None of above | -> Phase 1 |
For callback/check/resume/complete: load `commands/monitor.md` and execute matched handler, then STOP.
For callback/check/resume/complete: load `@commands/monitor.md` and execute matched handler, then STOP.
### Router Implementation
@@ -95,15 +95,18 @@ TEXT-LEVEL ONLY. No source code reading.
1. Parse user task description from $ARGUMENTS
2. Extract explicit settings: `--mode`, scope, focus areas
3. Delegate to `commands/analyze.md` for signal detection and pipeline mode selection
3. Delegate to `@commands/analyze.md` for signal detection and pipeline mode selection
4. **Interactive clarification** (non-auto mode): AskUserQuestion for focus, perspectives, depth.
---
## Phase 2: Create Team + Initialize Session
1. Generate session ID: `UAN-{slug}-{YYYY-MM-DD}`
2. Create session folder structure:
1. Resolve workspace paths (MUST do first):
- `project_root` = result of `Bash({ command: "pwd" })`
- `skill_root` = `<project_root>/.claude/skills/team-ultra-analyze`
3. Generate session ID: `UAN-{slug}-{YYYY-MM-DD}`
4. Create session folder structure:
```
.workflow/.team/UAN-{slug}-{date}/
@@ -117,8 +120,8 @@ TEXT-LEVEL ONLY. No source code reading.
+-- learnings.md, decisions.md, conventions.md, issues.md
```
3. Write session.json with mode, requirement, timestamp
4. Initialize .msg/meta.json with pipeline metadata via team_msg:
5. Write session.json with mode, requirement, timestamp
6. Initialize .msg/meta.json with pipeline metadata via team_msg:
```typescript
mcp__ccw-tools__team_msg({
operation: "log",
@@ -134,13 +137,13 @@ mcp__ccw-tools__team_msg({
}
})
```
5. Call `TeamCreate({ team_name: "ultra-analyze" })`
7. Call `TeamCreate({ team_name: "ultra-analyze" })`
---
## Phase 3: Create Task Chain
Execute `commands/dispatch.md` inline (Command Execution Protocol):
Execute `@commands/dispatch.md` inline (Command Execution Protocol):
1. Read `roles/coordinator/commands/dispatch.md`
2. Follow dispatch Phase 2 -> Phase 3 -> Phase 4
3. Result: all pipeline tasks created with correct blockedBy dependencies
@@ -152,7 +155,7 @@ Execute `commands/dispatch.md` inline (Command Execution Protocol):
### Initial Spawn
Find first unblocked tasks and spawn their workers. Use SKILL.md Worker Spawn Template with:
- `role_spec: ~ or <project>/.claude/skills/team-ultra-analyze/roles/<role>/role.md`
- `role_spec: <skill_root>/roles/<role>/role.md`
- `team_name: ultra-analyze`
- `inner_loop: false`