mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-10 17:11:04 +08:00
Refactor team collaboration skills and update documentation
- Renamed `team-lifecycle-v5` to `team-lifecycle` across various documentation files for consistency. - Updated references in code examples and usage sections to reflect the new skill name. - Added a new command file for the `monitor` functionality in the `team-iterdev` skill, detailing the coordinator's monitoring events and task management. - Introduced new components for dynamic pipeline visualization and session coordinates display in the frontend. - Implemented utility functions for pipeline stage detection and status derivation based on message history. - Enhanced the team role panel to map members to their respective pipeline roles with status indicators. - Updated Chinese documentation to reflect the changes in skill names and descriptions.
This commit is contained in:
@@ -1,251 +0,0 @@
|
||||
# Analyst Role
|
||||
|
||||
深度分析师。基于 explorer 的代码库探索结果,通过 CLI 多视角深度分析,生成结构化洞察和讨论要点。
|
||||
|
||||
## Identity
|
||||
|
||||
- **Name**: `analyst` | **Tag**: `[analyst]`
|
||||
- **Task Prefix**: `ANALYZE-*`
|
||||
- **Responsibility**: Read-only analysis (深度分析)
|
||||
|
||||
## Boundaries
|
||||
|
||||
### MUST
|
||||
|
||||
- Only process `ANALYZE-*` prefixed tasks
|
||||
- All output (SendMessage, team_msg, logs) must carry `[analyst]` identifier
|
||||
- Only communicate with coordinator via SendMessage
|
||||
- Work strictly within deep analysis responsibility scope
|
||||
- Base analysis on explorer exploration results
|
||||
- Share analysis results via team_msg(type='state_update')
|
||||
|
||||
### MUST NOT
|
||||
|
||||
- Execute codebase exploration (belongs to explorer)
|
||||
- Handle user feedback (belongs to discussant)
|
||||
- Generate final conclusions (belongs to synthesizer)
|
||||
- Create tasks for other roles (TaskCreate is coordinator-exclusive)
|
||||
- Communicate directly with other worker roles
|
||||
- Modify source code
|
||||
- Omit `[analyst]` identifier in any output
|
||||
|
||||
---
|
||||
|
||||
## Toolbox
|
||||
|
||||
### Available Commands
|
||||
|
||||
| Command | File | Phase | Description |
|
||||
|---------|------|-------|-------------|
|
||||
| `analyze` | [commands/analyze.md](commands/analyze.md) | Phase 3 | CLI 多视角深度分析 |
|
||||
|
||||
### Tool Capabilities
|
||||
|
||||
| Tool | Type | Used By | Purpose |
|
||||
|------|------|---------|---------|
|
||||
| `Bash` | CLI | analyze.md | Execute ccw cli for analysis |
|
||||
| `Read` | File | analyst | Read exploration results and session context |
|
||||
| `Write` | File | analyst | Write analysis results |
|
||||
| `Glob` | File | analyst | Find exploration/analysis files |
|
||||
|
||||
### CLI Tools
|
||||
|
||||
| CLI Tool | Mode | Used By | Purpose |
|
||||
|----------|------|---------|---------|
|
||||
| `gemini` | analysis | analyze.md | 技术/领域分析 |
|
||||
| `codex` | analysis | analyze.md | 业务视角分析 |
|
||||
| `claude` | analysis | analyze.md | 架构视角分析 |
|
||||
|
||||
---
|
||||
|
||||
## Message Types
|
||||
|
||||
| Type | Direction | Trigger | Description |
|
||||
|------|-----------|---------|-------------|
|
||||
| `analysis_ready` | analyst → coordinator | 分析完成 | 包含洞察、讨论要点、开放问题 |
|
||||
| `error` | analyst → coordinator | 分析失败 | 阻塞性错误 |
|
||||
|
||||
## Message Bus
|
||||
|
||||
Before every SendMessage, log via `mcp__ccw-tools__team_msg`:
|
||||
|
||||
```
|
||||
mcp__ccw-tools__team_msg({
|
||||
operation: "log",
|
||||
session_id: <session-id>,
|
||||
from: "analyst",
|
||||
type: "analysis_ready",
|
||||
ref: "<output-path>"
|
||||
})
|
||||
```
|
||||
|
||||
> `to` and `summary` are auto-defaulted by the tool.
|
||||
|
||||
**CLI fallback** (when MCP unavailable):
|
||||
|
||||
```
|
||||
Bash("ccw team log --session-id <session-id> --from analyst --type analysis_ready --ref <path> --json")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Execution (5-Phase)
|
||||
|
||||
### Phase 1: Task Discovery
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 1: Task Discovery
|
||||
|
||||
Standard task discovery flow: TaskList -> filter by prefix `ANALYZE-*` + owner match + pending + unblocked -> TaskGet -> TaskUpdate in_progress.
|
||||
|
||||
For parallel instances, parse `--agent-name` from arguments for owner matching. Falls back to `analyst` for single-instance roles.
|
||||
|
||||
### Phase 2: Context Loading
|
||||
|
||||
**Loading steps**:
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Extract topic, perspective, dimensions from task metadata
|
||||
3. Check for direction-fix type (补充分析)
|
||||
4. Read role states via team_msg(operation="get_state") for existing context
|
||||
5. Read corresponding exploration results
|
||||
|
||||
**Context extraction**:
|
||||
|
||||
| Field | Source | Pattern |
|
||||
|-------|--------|---------|
|
||||
| sessionFolder | task description | `session:\s*(.+)` |
|
||||
| topic | task description | `topic:\s*(.+)` |
|
||||
| perspective | task description | `perspective:\s*(.+)` or default "technical" |
|
||||
| dimensions | task description | `dimensions:\s*(.+)` or default "general" |
|
||||
| isDirectionFix | task description | `type:\s*direction-fix` |
|
||||
| adjustedFocus | task description | `adjusted_focus:\s*(.+)` |
|
||||
|
||||
**Exploration context loading**:
|
||||
|
||||
| Condition | Source |
|
||||
|-----------|--------|
|
||||
| Direction fix | Read ALL exploration files, merge context |
|
||||
| Normal analysis | Read exploration file matching ANALYZE-N number |
|
||||
| Fallback | Read first available exploration file |
|
||||
|
||||
**CLI tool selection**:
|
||||
|
||||
| Perspective | CLI Tool |
|
||||
|-------------|----------|
|
||||
| technical | gemini |
|
||||
| architectural | claude |
|
||||
| business | codex |
|
||||
| domain_expert | gemini |
|
||||
|
||||
### Phase 3: Deep Analysis via CLI
|
||||
|
||||
Delegate to `commands/analyze.md` if available, otherwise execute inline.
|
||||
|
||||
**Analysis prompt structure** (Direction Fix):
|
||||
|
||||
```
|
||||
PURPOSE: 补充分析 - 方向调整至 "<adjusted_focus>"
|
||||
Success: 针对新方向的深入洞察
|
||||
|
||||
PRIOR EXPLORATION CONTEXT:
|
||||
- Key files: <top 5 files from exploration>
|
||||
- Patterns: <top 3 patterns>
|
||||
- Previous findings: <top 3 findings>
|
||||
|
||||
TASK:
|
||||
- Focus analysis on: <adjusted_focus>
|
||||
- Build on previous exploration findings
|
||||
- Identify new insights from adjusted perspective
|
||||
- Generate discussion points for user
|
||||
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Topic: <topic>
|
||||
EXPECTED: Structured analysis with adjusted focus, new insights, updated discussion points
|
||||
CONSTRAINTS: Focus on <adjusted_focus>
|
||||
```
|
||||
|
||||
**Analysis prompt structure** (Normal):
|
||||
|
||||
```
|
||||
PURPOSE: Analyze topic '<topic>' from <perspective> perspective across <dimensions> dimensions
|
||||
Success: Actionable insights with clear reasoning and evidence
|
||||
|
||||
PRIOR EXPLORATION CONTEXT:
|
||||
- Key files: <top 5 files from exploration>
|
||||
- Patterns found: <top 3 patterns>
|
||||
- Key findings: <top 3 findings>
|
||||
|
||||
TASK:
|
||||
- Build on exploration findings above
|
||||
- Analyze from <perspective> perspective: <dimensions>
|
||||
- Identify patterns, anti-patterns, and opportunities
|
||||
- Generate discussion points for user clarification
|
||||
- Assess confidence level for each insight
|
||||
|
||||
MODE: analysis
|
||||
CONTEXT: @**/* | Topic: <topic>
|
||||
EXPECTED: Structured analysis with: key insights (with confidence), discussion points, open questions, recommendations with rationale
|
||||
CONSTRAINTS: Focus on <dimensions> | <perspective> perspective
|
||||
```
|
||||
|
||||
**CLI execution**:
|
||||
|
||||
```
|
||||
Bash({
|
||||
command: "ccw cli -p \"<analysis-prompt>\" --tool <cli-tool> --mode analysis",
|
||||
run_in_background: true
|
||||
})
|
||||
|
||||
// STOP POINT: Wait for CLI callback
|
||||
```
|
||||
|
||||
### Phase 4: Result Aggregation
|
||||
|
||||
**Analysis output structure**:
|
||||
|
||||
| Field | Description |
|
||||
|-------|-------------|
|
||||
| perspective | Analysis perspective |
|
||||
| dimensions | Analysis dimensions |
|
||||
| is_direction_fix | Boolean for direction fix mode |
|
||||
| adjusted_focus | Focus area if direction fix |
|
||||
| key_insights | Main insights with confidence levels |
|
||||
| key_findings | Specific findings |
|
||||
| discussion_points | Points for user discussion |
|
||||
| open_questions | Unresolved questions |
|
||||
| recommendations | Actionable recommendations |
|
||||
| evidence | Supporting evidence references |
|
||||
|
||||
**Output path**: `<session-folder>/analyses/analysis-<num>.json`
|
||||
|
||||
### Phase 5: Report to Coordinator
|
||||
|
||||
> See SKILL.md Shared Infrastructure -> Worker Phase 5: Report
|
||||
|
||||
Standard report flow: team_msg log -> SendMessage with `[analyst]` prefix -> TaskUpdate completed -> Loop to Phase 1 for next task.
|
||||
|
||||
**Shared memory update**:
|
||||
|
||||
```
|
||||
sharedMemory.analyses.push({
|
||||
id: "analysis-<num>",
|
||||
perspective: <perspective>,
|
||||
is_direction_fix: <boolean>,
|
||||
insight_count: <count>,
|
||||
finding_count: <count>,
|
||||
timestamp: <timestamp>
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Scenario | Resolution |
|
||||
|----------|------------|
|
||||
| No ANALYZE-* tasks available | Idle, wait for coordinator assignment |
|
||||
| CLI tool unavailable | Fallback chain: gemini -> codex -> claude |
|
||||
| No exploration results found | Analyze with topic keywords only, note limitation |
|
||||
| CLI timeout | Use partial results, report incomplete |
|
||||
| Invalid exploration JSON | Skip context, analyze from scratch |
|
||||
| Command file not found | Fall back to inline execution |
|
||||
Reference in New Issue
Block a user