Decompose PRDs and Tech Specs into parallel-executable tasks with contracts, prompts, and dependency graphs. Use when breaking down a PRD for multi-agent execution.
Breaks down PRDs and Tech Specs into parallel-executable tasks with contracts and dependency graphs. Use this when you need to decompose requirements for multi-agent execution with the `cpo` orchestrator.
/plugin marketplace add jpoutrin/product-forge/plugin install product-design@product-forge-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Decompose a PRD and Tech Spec into parallel-executable tasks with contracts, dependency graphs, and agent prompts.
flowchart TB
Start[("PRD + Tech Spec")]
Dir["1. Determine Output Dir"]
Analyze["2. Analyze Tech Spec"]
Manifest["3. Create manifest.json"]
Context["4. Create context.md"]
Arch["5. Create architecture.md"]
Contracts["6. Create contracts/"]
Tasks["7. Generate task files"]
Graph["8. Create task-graph.md"]
Prompts["9. Generate prompts/"]
Update["10. Update manifest"]
Report["11. Report Results"]
Start --> Dir
Dir --> Analyze
Analyze --> Manifest
Manifest --> Context
Context --> Arch
Arch --> Contracts
Contracts --> Tasks
Tasks --> Graph
Graph --> Prompts
Prompts --> Update
Update --> Report
Report --> Done(["Ready for cpo run"])
PARALLEL_DIR="parallel/TS-0042-inventory-system"
parallel/{slug}/If a Tech Spec (TS-XXXX) is provided:
Read and validate Tech Spec:
Extract from Tech Spec:
architecture.mdcontracts/types.pycontracts/api-schema.yamlSkip redundant steps:
If no Tech Spec provided: Generate contracts from PRD and display warning:
"Consider creating a Tech Spec first for better contract definitions"
Use the cpo format:
{
"tech_spec_id": "TS-0042",
"name": "inventory-system",
"technology": "python",
"python_version": "3.11",
"waves": [
{
"number": 1,
"tasks": [
{ "id": "task-001", "agent": "python-experts:django-expert" },
{ "id": "task-002", "agent": "python-experts:django-expert" }
],
"validation": "from apps.users.models import User; print('Wave 1 OK')"
}
],
"metadata": {
"tech_spec": "tech-specs/approved/TS-0042-inventory.md",
"generated_at": "2025-01-15T10:00:00Z",
"total_tasks": 3,
"max_parallel": 2,
"critical_path": ["task-001", "task-003"]
}
}
Shared project context read once by all agents (token-efficient):
Create architecture.md with Mermaid component diagram:
graph TB
Client["Client/Frontend"]
Gateway["API Gateway"]
subgraph Users["Users Service<br/>(task-001)"]
UserAPI["User API<br/>/api/users/"]
UserDB["User DB"]
end
subgraph Products["Products Service<br/>(task-002)"]
ProductAPI["Product API<br/>/api/products/"]
ProductDB["Product DB"]
end
Client --> Gateway
Gateway --> UserAPI
Gateway --> ProductAPI
UserAPI --> UserDB
ProductAPI --> ProductDB
Conventions:
subgraph to group by service/task-->) for direct dependencies-.->) for weak dependenciesfrom dataclasses import dataclass
from typing import Optional
from datetime import datetime
from enum import Enum
class UserRole(str, Enum):
ADMIN = "admin"
USER = "user"
@dataclass
class User:
id: int
email: str
username: str
role: UserRole
created_at: datetime
@dataclass
class UserCreateRequest:
email: str
username: str
password: str
openapi: 3.0.0
info:
title: API
version: 1.0.0
components:
schemas:
User:
type: object
required: [id, email, username]
properties:
id: {type: integer}
email: {type: string, format: email}
username: {type: string}
paths:
/users:
get:
summary: List users
responses:
'200':
description: User list
Create task specs in tasks/ using compact YAML format.
See the parallel-task-format skill for the complete task specification format.
Dependency visualization with Mermaid:
flowchart TB
subgraph W1[Wave 1 - parallel]
t001[task-001-users<br/>django-expert]
t002[task-002-products<br/>django-expert]
end
subgraph W2[Wave 2 - parallel]
t003[task-003-orders<br/>django-expert]
end
t001 --> t003
t002 --> t003
Include Gantt chart for timeline:
gantt
title Parallel Task Execution
dateFormat YYYY-MM-DD
section Wave 1
task-001-users :t001, 2025-01-01, 4h
task-002-products :t002, 2025-01-01, 4h
section Wave 2
task-003-orders :crit, t003, after t001, 3h
Use the parallel-prompt-generator skill to generate agent-ready prompts from the task files.
This creates:
prompts/agent-prompts.md - Wave summary and launch commandsprompts/task-NNN.txt - Individual agent promptsSee the parallel-prompt-generator skill for the complete prompt template and generation workflow.
Key points:
context.md contentUpdate manifest.json with final task counts.
Report summary:
Decomposition Complete
Output: parallel/TS-0042-inventory-system/
Source: docs/prd.md
Tech Spec: TS-0042
Tasks: 6
Waves: 3
Max parallel: 3
Next: Run cpo run parallel/TS-0042-inventory-system/
Before finalizing:
parallel-task-format skill)Wave 1: shared-models (contracts)
Wave 2: users-service, products-service, orders-service (parallel)
Wave 3: api-gateway
Wave 4: integration-tests
Wave 1: models-and-migrations
Wave 2: views-and-serializers, api-endpoints (parallel)
Wave 3: comprehensive-tests
Wave 1: types-and-hooks
Wave 2: form-components, list-components (parallel)
Wave 3: pages (parallel)
Wave 4: routing-and-integration
Split coupled tasks or create intermediate shared task.
Split by component (models, views, tests) or defer optional features.
Warn user, generate best-effort contracts with TODOs.
Update contracts first, then regenerate prompts.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.