/pm:epic-decomposefrom pm
Decomposes a feature epic into concrete, actionable tasks by analyzing the PRD and assigning specialized agents. Supports single-epic, multi-epic, and local offline modes.
Claude never picks this command on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /pm:epic-decompose still runs it.
Break epic into concrete, actionable tasks.
⚠️ IMPORTANT: This is a Claude Code command file, not a standalone script.
/pm:epic-decompose <feature_name>node ${CLAUDE_PLUGIN_ROOT}/scripts/pm/epic-decompose.jsSingle Epic:
/pm:epic-decompose <feature_name> [--local]
Multi-Epic (decomposes ALL epics at once):
/pm:epic-decompose <feature_name> [--local]
# Example: /pm:epic-decompose ecommerce-platform --local
# This will automatically decompose ALL epics:
# - 01-infrastructure
# - 02-auth-backend
# - 03-product-api
# - etc.
Single Epic from Multi-Epic structure:
/pm:epic-decompose <feature_name>/<epic_folder> [--local]
# Example: /pm:epic-decompose ecommerce-platform/01-infrastructure --local
--local, -l
: Use local mode (offline workflow)
: Creates task files in .claude/epics/ directory structure
: No GitHub/Azure synchronization
: Task files remain local-only until manually synced
: Ideal for offline work or projects without remote tracking
Example:
/pm:epic-decompose user-authentication --local
Query Context7 first: see .claude/rules/context7-required.md.
IMPORTANT: Before executing this command, read and follow:
.claude/rules/datetime.md - For getting real current date/timeBased on the PRD content and technical requirements, automatically determine which specialized agents should be assigned to tasks.
Read .claude/prds/$ARGUMENTS.md and identify:
Programming Languages:
.claude/agents/languages/python-backend-engineer.md.claude/agents/languages/nodejs-backend-engineer.md.claude/agents/frontend/react-frontend-engineer.md.claude/agents/languages/bash-scripting-expert.mdDatabases:
.claude/agents/databases/postgresql-expert.md.claude/agents/databases/mongodb-expert.md.claude/agents/databases/redis-expert.md.claude/agents/databases/cosmosdb-expert.mdCloud Platforms:
.claude/agents/cloud/aws-cloud-architect.md.claude/agents/cloud/azure-cloud-architect.md.claude/agents/cloud/gcp-cloud-architect.mdInfrastructure & Containers:
.claude/agents/containers/docker-containerization-expert.md.claude/agents/orchestration/kubernetes-orchestrator.md.claude/agents/infrastructure/terraform-infrastructure-expert.mdTesting:
.claude/agents/core/test-runner.md.claude/agents/testing/frontend-testing-engineer.md.claude/agents/testing/e2e-test-engineer.mdDevOps & CI/CD:
.claude/agents/devops/github-operations-specialist.md.claude/agents/devops/azure-devops-specialist.md.claude/agents/devops/observability-engineer.mdAdd required_agents array to epic.md frontmatter:
---
name: user-authentication
prd: user-authentication
status: backlog
created: 2025-12-17T10:00:00Z
updated: 2025-12-17T10:00:00Z
required_agents:
- path: .claude/agents/languages/python-backend-engineer.md
role: API implementation
tasks: [001, 002, 003]
- path: .claude/agents/databases/postgresql-expert.md
role: Database schema and migrations
tasks: [004, 005]
- path: .claude/agents/testing/frontend-testing-engineer.md
role: Test suite development
tasks: [006, 007]
- path: .claude/agents/devops/github-operations-specialist.md
role: CI/CD pipeline setup
tasks: [008]
---
Each task file should include assigned_agent in frontmatter:
---
name: Implement JWT authentication endpoints
status: open
created: 2025-12-17T10:00:00Z
updated: 2025-12-17T10:00:00Z
assigned_agent: .claude/agents/languages/python-backend-engineer.md
agent_context:
framework: fastapi
auth_method: jwt
libraries: [pyjwt, passlib]
github: [Will be updated when synced to GitHub]
depends_on: [004] # Depends on user schema
parallel: true
conflicts_with: []
---
Benefits of Agent Assignment:
Before proceeding, complete these validation steps. Do not bother the user with preflight checks progress ("I'm not going to ..."). Just do them and move on.
Verify epic exists:
.claude/epics/$ARGUMENTS directory exists.claude/epics/$ARGUMENTS/epic.md exists
b) Multiple epics: Subdirectories like .claude/epics/$ARGUMENTS/01-infrastructure/epic.mdDetect epic structure:
.claude/epics/$ARGUMENTS/epic.md exists → Single epic modeCheck for existing tasks:
.claude/epics/$ARGUMENTS/ for numbered task filesValidate epic frontmatter:
.claude/epics/$ARGUMENTS/epic.md has valid frontmatterCheck epic status:
CRITICAL: All tasks MUST follow Test-Driven Development (TDD).
When creating tasks, ensure each task includes:
.claude/rules/tdd.enforcement.mdEvery generated task file will remind developers to write tests first.
You are decomposing epic(s) into specific, actionable tasks for: $ARGUMENTS
Single Epic Mode:
.claude/epics/$ARGUMENTS/epic.md.claude/epics/$ARGUMENTS/Multi-Epic Mode (from epic-split):
.claude/epics/$ARGUMENTS/.claude/epics/$ARGUMENTS/epic.md.claude/epics/$ARGUMENTS/*/epic.mdIMPORTANT: Before creating tasks, determine which specialized agents should be used:
Read the PRD from .claude/prds/$ARGUMENTS.md (or linked PRD in epic frontmatter)
Identify Technology Stack:
Map to Specialized Agents using the Agent Selection Strategy section above:
lang:python-backend-engineer or lang:nodejs-backend-engineerframework:react-frontend-engineer or lang:javascript-frontend-engineerdb:postgresql-expert, db:mongodb-expert, or db:redis-expertcloud:aws-cloud-architect, cloud:azure-cloud-architect, or cloud:gcp-cloud-architectdevops:docker-containerization-expertcloud:kubernetes-orchestratorcloud:terraform-infrastructure-expertcore:test-runner, test:frontend-testing-engineer, framework:e2e-test-engineerdevops:github-operations-specialist or devops:azure-devops-specialistUpdate Epic Frontmatter with required_agents array (see Agent Selection Strategy section)
Prepare Agent Assignments for each task to be created
Example:
Technology Stack Detected:
- Backend: Python + FastAPI
- Database: PostgreSQL
- Testing: pytest
- Deployment: Docker
Agent Mapping:
- Tasks 001-003 (API): lang:python-backend-engineer
- Tasks 004-005 (Database): db:postgresql-expert
- Tasks 006-007 (Tests): core:test-runner
- Task 008 (Docker): devops:docker-containerization-expert
Determine if tasks can be created in parallel:
If tasks can be created in parallel, spawn sub-agents.
IMPORTANT: Do NOT use generic "general-purpose" agents. Task creation should be done directly by Claude Code, not delegated to sub-agents, as it requires careful analysis of PRD, agent selection, and proper frontmatter generation.
Task Creation Process:
assigned_agent based on PRD analysisExample Task Creation:
Creating task 001 (API endpoint):
- assigned_agent: .claude/agents/languages/python-backend-engineer.md
- agent_context: {framework: "fastapi", auth: "jwt"}
- File: .claude/epics/$ARGUMENTS/001.md
✓ Created
Creating task 002 (Database schema):
- assigned_agent: .claude/agents/databases/postgresql-expert.md
- agent_context: {orm: "sqlalchemy", migrations: "alembic"}
- File: .claude/epics/$ARGUMENTS/002.md
✓ Created
CRITICAL: Before creating ANY task, read the issue template:
Read .claude/templates/issue.xml
Read .claude/rules/issue-structure.xml
Every task file MUST include ALL required sections from issue.xml. Missing sections = auto-reject.
For each task, create a file with this exact structure:
---
name: [Task Title]
status: open
priority: [critical/high/medium/low]
effort: [S/M/L/XL]
created: [Current ISO date/time]
updated: [Current ISO date/time]
assigned_agent: .claude/agents/{category}/{agent-name}.md
agent_context:
framework: [framework_name]
language: [language_name]
github: [Will be updated when synced to GitHub]
depends_on: []
parallel: true
conflicts_with: []
---
# Task: [Task Title]
## Goal
[One sentence: WHAT this task delivers and WHY it matters]
## Context
[WHY this task exists — what triggered it, what currently works/doesn't,
what must be in place first. Include specific file paths, URLs, services.]
## Acceptance Criteria
- [ ] Specific, measurable criterion 1
- [ ] Specific, measurable criterion 2
- [ ] Specific, measurable criterion 3
## Affected Files
- `path/to/file.ts` — [what changes]
- `path/to/test.ts` — [new test file]
## Related Issues
- depends on #NNN — [why]
- blocks #NNN — [why]
- (or "None" if standalone)
## Verification Steps
[Concrete commands to verify this task is done:]
- `npm test -- --filter=feature` → all pass
- `curl http://localhost:3000/api/endpoint` → 200
- `kubectl get pods -n app` → Running
## Definition of Done
- [ ] Tests written FIRST (RED phase)
- [ ] Code implemented (GREEN phase)
- [ ] Code refactored (REFACTOR phase)
- [ ] All tests passing
- [ ] Verification steps confirmed
- [ ] PR approved and merged
## ⚠️ TDD Requirements
1. 🔴 RED: Write failing test first
2. 🟢 GREEN: Write minimal code to make test pass
3. 🔵 REFACTOR: Clean up code while keeping tests green
## Technical Constraints
[Stack, patterns, prohibitions — optional but recommended]
## Out of Scope
[What NOT to touch — prevents AI from "improving" neighbors]
For Single Epic:
Save tasks as: .claude/epics/$ARGUMENTS/{task_number}.md
For Multi-Epic:
Save tasks as: .claude/epics/$ARGUMENTS/{epic_folder}/{task_number}.md
Example: .claude/epics/ecommerce/01-infrastructure/001.md
date -u +"%Y-%m-%dT%H:%M:%SZ".claude/agents/languages/python-backend-engineer.md)
Mark tasks with parallel: true if they can be worked on simultaneously without conflicts.
Choose based on task count and complexity:
Small Epic (< 5 tasks): Create sequentially for simplicity
Medium Epic (5-10 tasks):
Large Epic (> 10 tasks):
Example for parallel execution:
Spawning 3 agents for parallel task creation:
- Agent 1: Creating tasks 001-003 (Database layer)
- Agent 2: Creating tasks 004-006 (API layer)
- Agent 3: Creating tasks 007-009 (UI layer)
Multi-Epic Processing Example:
Processing multiple epics from split:
📂 01-infrastructure/epic.md
Creating 8 tasks...
✅ Done
📂 02-auth-backend/epic.md
Creating 12 tasks...
✅ Done
📂 03-frontend/epic.md
Creating 10 tasks...
✅ Done
When creating tasks with dependencies:
After creating all tasks, update the epic file by adding this section:
## Tasks Created
- [ ] 001.md - {Task Title} (parallel: true/false)
- [ ] 002.md - {Task Title} (parallel: true/false)
- etc.
Total tasks: {count}
Parallel tasks: {parallel_count}
Sequential tasks: {sequential_count}
Estimated total effort: {sum of hours}
Also update the epic's frontmatter progress if needed (still 0% until tasks actually start).
Before finalizing tasks, verify:
For Single Epic: After successfully creating tasks:
For Multi-Epic: After processing all epics:
✅ Epic Decomposition Complete
📂 01-infrastructure: 8 tasks created
📂 02-auth-backend: 12 tasks created
📂 03-frontend: 10 tasks created
Total: 30 tasks across 3 epics
If any step fails:
Aim for tasks that can be completed in 1-3 days each. Break down larger tasks into smaller, manageable pieces for the "$ARGUMENTS" epic.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub lagowski/claudeautopm --plugin pm46 commands in this plugin
/blockedInstructions---/cleanClean up completed work and archive old epics./contextInstructions---/context-createContext CreateInitialize project context documentation for AI agent memory./context-primeContext PrimeLoad project context into current AI session for better understanding and continuity./context-updateContext UpdateUpdate project context after significant changes to maintain AI agent memory accuracy.Other plugins' commands for the same job