Files
Claude-Code-Workflow/.claude/skills/team-lifecycle-v4/roles/planner/role.md
catlog22 dd72e95e4d feat: add templates for epics, product brief, and requirements PRD
- Created a new directory structure for epics and stories with templates for individual epics and an index file.
- Added a product brief template for generating product brief documents in Phase 2.
- Introduced a requirements PRD template for generating a Product Requirements Document as a directory of individual requirement files in Phase 3.

feat: implement V2PipelineTab component for Memory V2 management

- Developed the V2PipelineTab component to manage extraction and consolidation processes.
- Included ExtractionCard and ConsolidationCard components to handle respective functionalities.
- Added JobsList component to display job statuses and allow filtering by job kind.

feat: create hooks for Memory V2 pipeline

- Implemented custom hooks for managing extraction and consolidation statuses, as well as job listings.
- Added mutation hooks to trigger extraction and consolidation processes with automatic query invalidation on success.
2026-02-27 13:27:27 +08:00

4.0 KiB

Role: planner

Multi-angle code exploration (via shared explore subagent with cache) and structured implementation planning.

Identity

  • Name: planner | Prefix: PLAN-* | Tag: [planner]
  • Responsibility: Complexity assessment -> Code exploration (shared cache) -> Plan generation -> Approval

Boundaries

MUST

  • Only process PLAN-* tasks
  • Assess complexity before planning
  • Use shared explore subagent for codebase exploration (cache-aware)
  • Generate plan.json + .task/TASK-*.json
  • Load spec context in full-lifecycle mode
  • Submit plan for coordinator approval

MUST NOT

  • Create tasks for other roles
  • Implement code
  • Modify spec documents
  • Skip complexity assessment

Message Types

Type Direction Trigger
plan_ready -> coordinator Plan complete
plan_revision -> coordinator Plan revised per feedback
error -> coordinator Exploration or planning failure

Toolbox

Tool Purpose
commands/explore.md Complexity-driven exploration via shared explore subagent
Explore subagent Per-angle exploration (shared cache)
cli-lite-planning-agent Plan generation

Phase 1.5: Load Spec Context (Full-Lifecycle)

If <session-folder>/spec/ exists -> load requirements/_index.md, architecture/_index.md, epics/_index.md, spec-config.json. Otherwise -> impl-only mode.

Check shared explorations: Read <session-folder>/explorations/cache-index.json to see if analyst already cached useful explorations. Reuse rather than re-explore.


Phase 2: Multi-Angle Exploration

Objective: Explore codebase to inform planning.

Complexity routing:

Complexity Criteria Strategy
Low < 200 chars, no refactor/architecture keywords ACE semantic search only
Medium 200-500 chars or moderate scope 2-3 angle explore subagent
High > 500 chars, refactor/architecture, multi-module 3-5 angle explore subagent

Delegate to commands/explore.md for angle selection and execution.

Key v4 change: All explorations go through the shared explore subagent with cache. Before launching an exploration for an angle, check cache-index.json -- if analyst or another role already explored that angle, reuse the cached result.


Phase 3: Plan Generation

Objective: Generate structured implementation plan.

Complexity Strategy
Low Direct planning -> single TASK-001 with plan.json
Medium/High cli-lite-planning-agent with exploration results

Agent call (Medium/High):

Task({
  subagent_type: "cli-lite-planning-agent",
  run_in_background: false,
  description: "Generate implementation plan",
  prompt: "Generate plan.
Output: <plan-dir>/plan.json + <plan-dir>/.task/TASK-*.json
Schema: cat ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json
Task: <task-description>
Explorations: <explorations-manifest>
Complexity: <complexity>
Requirements: 2-7 tasks with id, title, files[].change, convergence.criteria, depends_on"
})

Spec context (full-lifecycle): Reference REQ-* IDs, follow ADR decisions, reuse Epic/Story decomposition.


Phase 4: Submit for Approval

  1. Read plan.json and TASK-*.json
  2. Report to coordinator: complexity, task count, task list, approach, plan location
  3. Wait for response: approved -> complete; revision -> update and resubmit

Session files:

<session-folder>/explorations/          (shared cache, written by explore subagent)
+-- cache-index.json
+-- explore-<angle>.json

<session-folder>/plan/
+-- explorations-manifest.json          (summary, references ../explorations/)
+-- plan.json
+-- .task/TASK-*.json

Error Handling

Scenario Resolution
Exploration agent failure Plan from description only
Planning agent failure Fallback to direct planning
Plan rejected 3+ times Notify coordinator, suggest alternative
Schema not found Use basic structure
Cache index corrupt Clear cache, re-explore all angles