team-lifecycle-v3
npx skills add https://github.com/catlog22/claude-code-workflow --skill team-lifecycle-v3
Agent 安装分布
Skill 文档
Team Lifecycle v3
Unified team skill: specification â implementation â testing â review. All team members invoke with --role=xxx to route to role-specific execution.
Architecture
âââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Skill(skill="team-lifecycle-v3") â
â args="ä»»å¡æè¿°" æ args="--role=xxx" â
âââââââââââââââââââââ¬ââââââââââââââââââââââââââââââââ
â Role Router
âââââ --role present? âââââ
â NO â YES
â â
Orchestration Mode Role Dispatch
(auto â coordinator) (route to role.md)
â
ââââââ´âââââ¬ââââââââ¬ââââââââ¬ââââââââ¬ââââââââ¬ââââââââ¬ââââââââ
â â â â â â â â
coordinator analyst writer discussant planner executor tester reviewer
â â
on-demand by coordinator
ââââââââââââ âââââââââââ
â explorer â âarchitectâ
ââââââââââââ âââââââââââ
ââââââââââââââââ ââââââââ
â fe-developer â âfe-qa â
ââââââââââââââââ ââââââââ
Role Router
Input Parsing
Parse $ARGUMENTS to extract --role. If absent â Orchestration Mode (auto route to coordinator).
Role Registry
| Role | File | Task Prefix | Type | Compact |
|---|---|---|---|---|
| coordinator | roles/coordinator/role.md | (none) | orchestrator | â ï¸ å缩åå¿ é¡»é读 |
| analyst | roles/analyst/role.md | RESEARCH-* | pipeline | å缩åå¿ é¡»é读 |
| writer | roles/writer/role.md | DRAFT-* | pipeline | å缩åå¿ é¡»é读 |
| discussant | roles/discussant/role.md | DISCUSS-* | pipeline | å缩åå¿ é¡»é读 |
| planner | roles/planner/role.md | PLAN-* | pipeline | å缩åå¿ é¡»é读 |
| executor | roles/executor/role.md | IMPL-* | pipeline | å缩åå¿ é¡»é读 |
| tester | roles/tester/role.md | TEST-* | pipeline | å缩åå¿ é¡»é读 |
| reviewer | roles/reviewer/role.md | REVIEW-* + QUALITY-* | pipeline | å缩åå¿ é¡»é读 |
| explorer | roles/explorer/role.md | EXPLORE-* | service (on-demand) | å缩åå¿ é¡»é读 |
| architect | roles/architect/role.md | ARCH-* | consulting (on-demand) | å缩åå¿ é¡»é读 |
| fe-developer | roles/fe-developer/role.md | DEV-FE-* | frontend pipeline | å缩åå¿ é¡»é读 |
| fe-qa | roles/fe-qa/role.md | QA-FE-* | frontend pipeline | å缩åå¿ é¡»é读 |
â ï¸ COMPACT PROTECTION: è§è²æä»¶æ¯æ§è¡ææ¡£ï¼ä¸æ¯åèèµæãå½ context compression åçåï¼è§è²æä»¤ä» å©æè¦æ¶ï¼å¿ é¡»ç«å³
Readå¯¹åº role.md éæ°å è½½ååç»§ç»æ§è¡ãä¸å¾åºäºæè¦æ§è¡ä»»ä½ Phaseã
Dispatch
- Extract
--rolefrom arguments - If no
--roleâ route to coordinator (Orchestration Mode) - Look up role in registry â Read the role file â Execute its phases
Orchestration Mode
When invoked without --role, coordinator auto-starts. User just provides task description.
Invocation: Skill(skill="team-lifecycle-v3", args="ä»»å¡æè¿°")
Lifecycle:
ç¨æ·æä¾ä»»å¡æè¿°
â coordinator Phase 1-3: éæ±æ¾æ¸
â TeamCreate â å建任å¡é¾
â coordinator Phase 4: spawn 馿¹ worker (åå°) â STOP
â Worker æ§è¡ â SendMessage åè° â coordinator æ¨è¿ä¸ä¸æ¥
â 循ç¯ç´å° pipeline 宿 â Phase 5 æ±æ¥
User Commands (å¤éå·²æåç coordinator):
| Command | Action |
|---|---|
check / status |
è¾åºæ§è¡ç¶æå¾ï¼ä¸æ¨è¿ |
resume / continue |
æ£æ¥ worker ç¶æï¼æ¨è¿ä¸ä¸æ¥ |
Shared Infrastructure
以䏿¨¡æ¿éç¨äºææ worker è§è²ãæ¯ä¸ª role.md åªéå Phase 2-4 çè§è²ç¹æé»è¾ã
Worker Phase 1: Task Discovery (ææ worker å ±äº«)
æ¯ä¸ª worker å¯å¨åæ§è¡ç¸åçä»»å¡åç°æµç¨ï¼
- è°ç¨
TaskList()è·åææä»»å¡ - çé: subject å¹é æ¬è§è²åç¼ + owner æ¯æ¬è§è² + status 为 pending + blockedBy 为空
- æ ä»»å¡ â idle çå¾
- æä»»å¡ â
TaskGetè·å详æ âTaskUpdateæ è®° in_progress
Resume Artifact Check (鲿¢æ¢å¤åéå¤äº§åº):
- æ£æ¥æ¬ä»»å¡çè¾åºäº§ç©æ¯å¦å·²åå¨
- 产ç©å®æ´ â è·³å° Phase 5 æ¥å宿
- 产ç©ä¸å®æ´æä¸åå¨ â æ£å¸¸æ§è¡ Phase 2-4
Worker Phase 5: Report (ææ worker å ±äº«)
ä»»å¡å®æåçæ åæ¥åæµç¨:
- Message Bus: è°ç¨
mcp__ccw-tools__team_msgè®°å½æ¶æ¯- åæ°: operation=”log”, team=, from=, to=”coordinator”, type=<æ¶æ¯ç±»å>, summary=”[] <æè¦>”, ref=<产ç©è·¯å¾>
- 注æ:
teamå¿ é¡»æ¯ session ID (å¦TLS-project-2026-02-27), 䏿¯ team name. ä»ä»»å¡æè¿°çSession:åæ®µæå. - CLI fallback: å½ MCP ä¸å¯ç¨æ¶ â
ccw team log --team <session-id> --from <role> --to coordinator --type <type> --summary "[<role>] ..." --json
- SendMessage: åéç»æç» coordinator (content å summary é½å¸¦
[<role>]åç¼) - TaskUpdate: æ è®°ä»»å¡ completed
- Loop: åå° Phase 1 æ£æ¥ä¸ä¸ä¸ªä»»å¡
Wisdom Accumulation (ææè§è²)
跨任å¡ç¥è¯ç§¯ç´¯ãCoordinator å¨ session åå§åæ¶å建 wisdom/ ç®å½ã
ç®å½:
<session-folder>/wisdom/
âââ learnings.md # 模å¼åæ´å¯
âââ decisions.md # æ¶æå设计å³ç
âââ conventions.md # 代ç åºçº¦å®
âââ issues.md # å·²ç¥é£é©åé®é¢
Worker å è½½ (Phase 2): ä» task description æå Session: <path>, 读å wisdom ç®å½ä¸åæä»¶ã
Worker è´¡ç® (Phase 4/5): å°æ¬ä»»å¡åç°åå
¥å¯¹åº wisdom æä»¶ã
Role Isolation Rules
| å 许 | ç¦æ¢ |
|---|---|
| å¤çèªå·±åç¼çä»»å¡ | å¤çå ¶ä»è§è²åç¼çä»»å¡ |
| SendMessage ç» coordinator | ç´æ¥ä¸å ¶ä» worker éä¿¡ |
| ä½¿ç¨ Toolbox ä¸å£°æçå·¥å · | ä¸ºå ¶ä»è§è²åå»ºä»»å¡ |
| å§æ´¾ç» commands/ ä¸çå½ä»¤ | ä¿®æ¹ä¸å±äºæ¬èè´£çèµæº |
Coordinator é¢å¤ç¦æ¢: ç´æ¥ç¼å/ä¿®æ¹ä»£ç ãè°ç¨å®ç°ç±» subagentãç´æ¥æ§è¡åæ/æµè¯/审æ¥ã
Pipeline Definitions
Spec-only (12 tasks)
RESEARCH-001 â DISCUSS-001 â DRAFT-001 â DISCUSS-002
â DRAFT-002 â DISCUSS-003 â DRAFT-003 â DISCUSS-004
â DRAFT-004 â DISCUSS-005 â QUALITY-001 â DISCUSS-006
Impl-only / Backend (4 tasks)
PLAN-001 â IMPL-001 â TEST-001 + REVIEW-001
Full-lifecycle (16 tasks)
[Spec pipeline] â PLAN-001(blockedBy: DISCUSS-006) â IMPL-001 â TEST-001 + REVIEW-001
Frontend Pipelines
FE-only: PLAN-001 â DEV-FE-001 â QA-FE-001
(GC loop: QA-FE verdict=NEEDS_FIX â DEV-FE-002 â QA-FE-002, max 2 rounds)
Fullstack: PLAN-001 â IMPL-001 ⥠DEV-FE-001 â TEST-001 ⥠QA-FE-001 â REVIEW-001
Full + FE: [Spec pipeline] â PLAN-001 â IMPL-001 ⥠DEV-FE-001 â TEST-001 ⥠QA-FE-001 â REVIEW-001
Cadence Control
èææ¨¡å: äºä»¶é©±å¨ï¼æ¯ä¸ª beat = coordinator å¤é â å¤ç â spawn â STOPã
Beat Cycle (忬¡èæ)
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Event Coordinator Workers
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
callback/resume âââ ââ handleCallback ââ
â mark completed â
â check pipeline â
ââ handleSpawnNext ââ¤
â find ready tasks â
â spawn workers ââââ¼âââ [Worker A] Phase 1-5
â (parallel OK) âââ¼âââ [Worker B] Phase 1-5
ââ STOP (idle) ââââââ â
â
callback âââââââââââââââââââââââââââââââââââââââââââ
(next beat) SendMessage + TaskUpdate(completed)
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Pipeline èæè§å¾:
Spec-only (12 beats, ä¸¥æ ¼ä¸²è¡)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Beat 1 2 3 4 5 6 7 8 9 10 11 12
â â â â â â â â â â â â
R1 â D1 â W1 â D2 â W2 â D3 â W3 â D4 â W4 â D5 â Q1 â D6
â² â²
pipeline sign-off
start pause
R=RESEARCH D=DISCUSS W=DRAFT(writer) Q=QUALITY
Impl-only (3 beats, å«å¹¶è¡çªå£)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Beat 1 2 3
â â ââââââ´âââââ
PLAN â IMPL âââ TEST ⥠REVIEW â å¹¶è¡çªå£
ââââââ¬âââââ
pipeline
done
Full-lifecycle (15 beats, specâimpl è¿æ¸¡å«æ£æ¥ç¹)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Beat 1-12: [Spec pipeline åä¸]
â
Beat 12 (D6 宿): ⸠CHECKPOINT ââ ç¨æ·ç¡®è®¤å resume
â
Beat 13 14 15
PLAN â IMPL â TEST ⥠REVIEW
Fullstack (å«åå¹¶è¡çªå£)
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Beat 1 2 3 4
â ââââââ´âââââ ââââââ´âââââ â
PLAN â IMPL ⥠DEV-FE â TEST ⥠QA-FE â REVIEW
â² â² â²
å¹¶è¡çªå£ 1 å¹¶è¡çªå£ 2 忥å±é
æ£æ¥ç¹ (Checkpoint):
| è§¦åæ¡ä»¶ | ä½ç½® | è¡ä¸º |
|---|---|---|
| SpecâImpl è¿æ¸¡ | DISCUSS-006 宿å | ⸠æåï¼çå¾
ç¨æ· resume 确认 |
| GC 循ç¯ä¸é | QA-FE max 2 rounds | è¶ åºè½®æ¬¡ â 忢è¿ä»£ï¼æ¥åå½åç¶æ |
| Pipeline åæ» | æ ready + æ running | æ£æ¥ç¼ºå¤±ä»»å¡ï¼æ¥åç¨æ· |
Stall æ£æµ (coordinator handleCheck æ¶æ§è¡):
| æ£æ¥é¡¹ | æ¡ä»¶ | å¤ç |
|---|---|---|
| Worker æ ååº | in_progress 任塿 åè° | æ¥åçå¾
ä¸çä»»å¡å表ï¼å»ºè®®ç¨æ· resume |
| Pipeline æ»é | æ ready + æ running + æ pending | æ£æ¥ blockedBy ä¾èµé¾ï¼æ¥åå¡ç¹ |
| GC 循ç¯è¶ é | DEV-FE / QA-FE è¿ä»£ > max_rounds | ç»æ¢å¾ªç¯ï¼è¾åºææ° QA æ¥å |
Task Metadata Registry
| Task ID | Role | Phase | Dependencies | Description |
|---|---|---|---|---|
| RESEARCH-001 | analyst | spec | (none) | Seed analysis and context gathering |
| DISCUSS-001 | discussant | spec | RESEARCH-001 | Critique research findings |
| DRAFT-001 | writer | spec | DISCUSS-001 | Generate Product Brief |
| DISCUSS-002 | discussant | spec | DRAFT-001 | Critique Product Brief |
| DRAFT-002 | writer | spec | DISCUSS-002 | Generate Requirements/PRD |
| DISCUSS-003 | discussant | spec | DRAFT-002 | Critique Requirements/PRD |
| DRAFT-003 | writer | spec | DISCUSS-003 | Generate Architecture Document |
| DISCUSS-004 | discussant | spec | DRAFT-003 | Critique Architecture Document |
| DRAFT-004 | writer | spec | DISCUSS-004 | Generate Epics & Stories |
| DISCUSS-005 | discussant | spec | DRAFT-004 | Critique Epics |
| QUALITY-001 | reviewer | spec | DISCUSS-005 | 5-dimension spec quality validation |
| DISCUSS-006 | discussant | spec | QUALITY-001 | Final review discussion and sign-off |
| PLAN-001 | planner | impl | (none or DISCUSS-006) | Multi-angle exploration and planning |
| IMPL-001 | executor | impl | PLAN-001 | Code implementation |
| TEST-001 | tester | impl | IMPL-001 | Test-fix cycles |
| REVIEW-001 | reviewer | impl | IMPL-001 | 4-dimension code review |
| DEV-FE-001 | fe-developer | impl | PLAN-001 | Frontend implementation |
| QA-FE-001 | fe-qa | impl | DEV-FE-001 | 5-dimension frontend QA |
Coordinator Spawn Template
When coordinator spawns workers, use background mode (Spawn-and-Stop):
Task({
subagent_type: "general-purpose",
description: "Spawn <role> worker",
team_name: <team-name>,
name: "<role>",
run_in_background: true,
prompt: `ä½ æ¯ team "<team-name>" ç <ROLE>.
## é¦è¦æä»¤
ä½ çææå·¥ä½å¿
é¡»éè¿è°ç¨ Skill è·åè§è²å®ä¹åæ§è¡ï¼
Skill(skill="team-lifecycle-v3", args="--role=<role>")
å½åéæ±: <task-description>
Session: <session-folder>
## è§è²åå
- åªå¤ç <PREFIX>-* ä»»å¡ï¼ä¸æ§è¡å
¶ä»è§è²å·¥ä½
- ææè¾åºå¸¦ [<role>] æ è¯åç¼
- ä»
ä¸ coordinator éä¿¡
- ä¸ä½¿ç¨ TaskCreate 为å
¶ä»è§è²å建任å¡
- æ¯æ¬¡ SendMessage åå
è°ç¨ mcp__ccw-tools__team_msg è®°å½
## 工使µç¨
1. è°ç¨ Skill â è·åè§è²å®ä¹åæ§è¡é»è¾
2. æ role.md 5-Phase æµç¨æ§è¡
3. team_msg + SendMessage ç»æç» coordinator
4. TaskUpdate completed â æ£æ¥ä¸ä¸ä¸ªä»»å¡`
})
Session Directory
.workflow/.team/TLS-<slug>-<date>/
âââ team-session.json # Session state
âââ spec/ # Spec artifacts
â âââ spec-config.json
â âââ discovery-context.json
â âââ product-brief.md
â âââ requirements/
â âââ architecture/
â âââ epics/
â âââ readiness-report.md
â âââ spec-summary.md
âââ discussions/ # Discussion records
âââ plan/ # Plan artifacts
â âââ plan.json
â âââ .task/TASK-*.json
âââ explorations/ # Explorer output (cached)
âââ architecture/ # Architect assessments + design-tokens.json
âââ analysis/ # analyst design-intelligence.json (UI mode)
âââ qa/ # QA audit reports
âââ wisdom/ # Cross-task knowledge
â âââ learnings.md
â âââ decisions.md
â âââ conventions.md
â âââ issues.md
âââ .msg/ # Team message bus logs (messages.jsonl)
âââ shared-memory.json # Cross-role state
Session Resume
Coordinator supports --resume / --continue for interrupted sessions:
- Scan
.workflow/.team/TLS-*/team-session.jsonfor active/paused sessions - Multiple matches â AskUserQuestion for selection
- Audit TaskList â reconcile session state â task status
- Reset in_progress â pending (interrupted tasks)
- Rebuild team and spawn needed workers only
- Create missing tasks with correct blockedBy
- Kick first executable task â Phase 4 coordination loop
Shared Spec Resources
| Resource | Path | Usage |
|---|---|---|
| Document Standards | specs/document-standards.md | YAML frontmatter, naming, structure |
| Quality Gates | specs/quality-gates.md | Per-phase quality gates |
| Product Brief Template | templates/product-brief.md | DRAFT-001 |
| Requirements Template | templates/requirements-prd.md | DRAFT-002 |
| Architecture Template | templates/architecture-doc.md | DRAFT-003 |
| Epics Template | templates/epics-template.md | DRAFT-004 |
Error Handling
| Scenario | Resolution |
|---|---|
| Unknown –role value | Error with available role list |
| Missing –role arg | Orchestration Mode â coordinator |
| Role file not found | Error with expected path |
| Command file not found | Fallback to inline execution |