Files
Claude-Code-Workflow/.claude/skills/team-lifecycle/role-specs/analyst.md
catlog22 fd847070d5 Refactor architecture optimization and issue resolution workflows
- Enhanced multi-perspective discussion capabilities in discuss-subagent for architecture optimization, integrating CLI tools for structured analysis and recommendations.
- Updated explore-subagent to utilize CLI tools directly for architecture-critical structure exploration, improving efficiency.
- Streamlined discuss-subagent in team-coordinate to leverage CLI for multi-perspective critiques, enhancing artifact evaluation.
- Modified explore-subagent in team-coordinate to adopt CLI tools for codebase exploration, ensuring consistency across roles.
- Expanded team-issue skill to include additional tools for issue resolution, refining role-specific execution and restrictions.
- Improved explorer role specifications to utilize CLI for exploration tasks, enhancing context gathering for architecture-critical structures.
- Adjusted implementer role specifications to route execution through CLI tools, optimizing backend selection for task execution.
- Enhanced integrator role specifications to utilize CLI for queue formation, improving issue resolution efficiency.
- Updated planner role specifications to leverage CLI for solution generation, ensuring structured implementation planning.
- Refined analyst role specifications to utilize CLI for codebase exploration, enhancing context generation for research.
- Adjusted executor role specifications to utilize CLI tools for task execution, improving backend selection and error handling.
- Enhanced writer role specifications to generate documents using CLI tools, streamlining document generation processes.
- Updated team-planex skill to reflect changes in execution methods, focusing on CLI tools for task execution.
- Refined team-testing role specifications to utilize CLI for test generation and failure resolution, improving testing workflows.
- Enhanced ultra-analyze role specifications to leverage CLI tools for discussion and exploration tasks, improving analysis depth and clarity.
2026-03-04 23:19:36 +08:00

3.5 KiB

role, prefix, inner_loop, discuss_rounds, subagents, message_types
role prefix inner_loop discuss_rounds subagents message_types
analyst RESEARCH false
DISCUSS-001
discuss
success progress error
research_ready research_progress error

Analyst — Phase 2-4

Phase 2: Seed Analysis

Objective: Extract structured seed information from the topic/idea.

  1. Extract session folder from task description (Session: <path>)
  2. Parse topic from task description (first non-metadata line)
  3. If topic starts with @ or ends with .md/.txt → Read the referenced file as topic content
  4. Run Gemini CLI seed analysis:
Bash({
  command: `ccw cli -p "PURPOSE: Analyze topic and extract structured seed information.
TASK: * Extract problem statement * Identify target users * Determine domain context
* List constraints and assumptions * Identify 3-5 exploration dimensions * Assess complexity
TOPIC: <topic-content>
MODE: analysis
EXPECTED: JSON with: problem_statement, target_users[], domain, constraints[], exploration_dimensions[], complexity_assessment" --tool gemini --mode analysis`,
  run_in_background: true
})
  1. Wait for CLI result, parse seed analysis JSON

Phase 3: Codebase Exploration (conditional)

Objective: Gather codebase context if an existing project is detected.

Condition Action
package.json / Cargo.toml / pyproject.toml / go.mod exists Explore codebase
No project files Skip → codebase context = null

When project detected: Use CLI exploration with Gemini.

Bash({
  command: `ccw cli -p "PURPOSE: Explore codebase for general context to inform spec generation
TASK: • Identify tech stack and frameworks • Map architecture patterns • Document conventions • List integration points
MODE: analysis
CONTEXT: @**/* | Memory: Seed analysis keywords: <keywords>
EXPECTED: JSON with: tech_stack[], architecture_patterns[], conventions[], integration_points[]
CONSTRAINTS: Focus on general context" --tool gemini --mode analysis --rule analysis-analyze-code-patterns`,
  run_in_background: false
})

Parse CLI output to build codebase context: tech_stack, architecture_patterns, conventions, integration_points.

Phase 4: Context Packaging + Inline Discuss

4a: Context Packaging

spec-config.json<session-folder>/spec/spec-config.json:

  • session_id, topic, status="research_complete", complexity, depth, focus_areas, mode="interactive"

discovery-context.json<session-folder>/spec/discovery-context.json:

  • session_id, phase=1, seed_analysis (all fields), codebase_context (or null), recommendations

design-intelligence.json<session-folder>/analysis/design-intelligence.json (UI mode only):

  • Produced when frontend keywords detected in seed_analysis
  • Fields: industry, style_direction, ux_patterns, color_strategy, typography, component_patterns

4b: Inline Discuss (DISCUSS-001)

Call discuss subagent with:

  • Artifact: <session-folder>/spec/discovery-context.json
  • Round: DISCUSS-001
  • Perspectives: product, risk, coverage

Handle discuss verdict per team-worker consensus handling protocol.

Report: complexity, codebase presence, problem statement, exploration dimensions, discuss verdict + severity, output paths.

Error Handling

Scenario Resolution
Gemini CLI failure Fallback to direct Claude analysis
Codebase detection failed Continue as new project
Topic too vague Report with clarification questions
CLI exploration fails Continue without codebase context
Discuss subagent fails Proceed without discuss, log warning