From plan-workflow
Unified planning workflow - research, analyze, and generate parallel implementation plans in one command. Combines shared-context and parallel-plan with checkpoint support and optimized agent deployment.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plan-workflow:plan-workflowThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Single command to research, analyze, and plan feature implementation. This skill combines the functionality of `shared-context` and `parallel-plan` with optimizations and checkpoint support.
Single command to research, analyze, and plan feature implementation. This skill combines the functionality of shared-context and parallel-plan with optimizations and checkpoint support.
+--------------------------------------------------------------+
| /plan-workflow feature |
+--------------------------------------------------------------+
| |
| +-----------+ +----------+ +---------------------+ |
| | Research |-->|Checkpoint|-->| Planning + Validate | |
| | (Wave 1) | | (Review) | | (Waves 2-3) | |
| +-----------+ +----------+ +---------------------+ |
| | | |
| shared.md parallel-plan.md |
| |
+--------------------------------------------------------------+
Target: $ARGUMENTS
Parse arguments:
${PLANS_DIR}/If no feature name provided, abort with usage instructions:
Usage: /plan-workflow [feature-name] [options]
Options:
--research-only Stop after research phase (creates shared.md only)
--plan-only Skip research, use existing shared.md
--no-checkpoint No pause between research and planning (default: checkpoint enabled)
--optimized Use 7-agent optimized deployment (default: 10-agent standard)
--dry-run Show execution plan without running
Examples:
/plan-workflow user-authentication
/plan-workflow payment-integration --no-checkpoint
/plan-workflow api-refactor --research-only
/plan-workflow user-auth --plan-only
/plan-workflow new-feature --optimized --dry-run
Extract from $ARGUMENTS:
Validate the feature name:
Use the shared resolver to determine the correct plans directory:
source ${CLAUDE_PLUGIN_ROOT}/skills/_shared/scripts/resolve-plans-dir.sh
feature_dir="$(get_feature_plan_dir "[feature-name]")"
This handles monorepo detection, .plans-config files, and git root resolution automatically.
Run the state detection script:
${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/scripts/check-state.sh [feature-name]
This script reports:
${feature_dir}/ existsshared.md existsparallel-plan.md existsBased on flags and detected state:
| State | --plan-only | --research-only | Action |
|---|---|---|---|
| No shared.md | N/A | N/A | Full workflow from Phase 1; if --research-only, stop after Phase 4 |
| Has shared.md | Yes | N/A | Skip to Phase 5 (Analysis) |
| Has shared.md | No | Yes | Skip (already done) |
| Has shared.md | No | No | Full workflow from Phase 1 (regenerates shared.md) |
| Has parallel-plan.md | Any | Any | Warn about overwrite |
Note: "Planning" in this workflow = Phase 8 (Plan Generation). "Analysis" = Phase 5.
The --plan-only flag skips Research + Checkpoint (Phases 1-4) but NOT Analysis (Phase 5).
If ${feature_dir}/ doesn't exist:
mkdir -p "${feature_dir}"
If --dry-run is present, read and display dry run template:
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/checkpoint-messages.md
Display the "Dry Run" section from the template with appropriate values substituted, then STOP.
Read the research prompts template:
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/research-agents.md
CRITICAL: Deploy all 4 agents in a SINGLE message with MULTIPLE Task tool calls.
Each agent MUST write its findings to the specified output file. The orchestrator MUST verify file persistence after agents complete.
| Agent | Subagent Type | Output File | Focus |
|---|---|---|---|
| Architecture Researcher | codebase-research-analyst | research-architecture.md | System structure, components, data flow |
| Pattern Researcher | codebase-research-analyst | research-patterns.md | Existing patterns, conventions, examples |
| Integration Researcher | codebase-research-analyst | research-integration.md | APIs, databases, external systems |
| Documentation Researcher | codebase-research-analyst | research-docs.md | Relevant documentation files |
Each agent writes findings to ${feature_dir}/[output-file].
Use the prompts from research-agents.md with variables substituted:
{{FEATURE_NAME}} - The feature directory name{{FEATURE_DIR}} - Full output directory path (${feature_dir}, resolved in Step 2)After agents complete, validate all research files:
${CLAUDE_PLUGIN_ROOT}/skills/shared-context/scripts/validate-research-artifacts.sh "${feature_dir}"
If validation fails: identify which files are missing or invalid from the script output, re-deploy ONLY the failed agents with their original prompts, wait for corrected outputs, then rerun validation until pass.
Do not proceed to shared.md synthesis until validation passes.
After verifying all files exist, read all research files:
${feature_dir}/research-architecture.md${feature_dir}/research-patterns.md${feature_dir}/research-integration.md${feature_dir}/research-docs.mdRead the shared structure template:
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/shared-structure.md
Create ${feature_dir}/shared.md following the template exactly.
Run the validation script:
${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/scripts/validate-shared.sh "${feature_dir}/shared.md"
Fix any errors before proceeding.
If checkpoint is enabled, use AskUserQuestion with these options:
Question: "Research complete for [feature-name]. Review the shared context before planning?"
Options:
Read checkpoint message format from:
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/checkpoint-messages.md
If user chooses "Review shared.md first":
${feature_dir}/shared.mdIf user chooses "Stop here":
MANDATORY: This phase MUST run in standard mode, including when
--plan-onlyis used. The--plan-onlyflag skips Research (Phases 1-4), NOT Analysis. Analysis agents produce theanalysis-*.mdfiles required by Phase 8 (Plan Generation).
In standard mode (not --optimized), read analysis prompts:
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/planning-agents.md
CRITICAL: Deploy all 3 agents in a SINGLE message with MULTIPLE Task tool calls.
Each agent MUST write its findings to the specified output file. The orchestrator MUST verify file persistence after agents complete.
| Agent | Subagent Type | Output File | Focus |
|---|---|---|---|
| Context Synthesizer | codebase-research-analyst | analysis-context.md | Condense planning docs |
| Code Analyzer | codebase-research-analyst | analysis-code.md | Extract code patterns |
| Task Structure Agent | codebase-research-analyst | analysis-tasks.md | Suggest task breakdown |
Each agent writes to ${feature_dir}/[output-file].
Use the prompts from planning-agents.md with variables substituted:
{{FEATURE_NAME}} - The feature directory name{{FEATURE_DIR}} - Full output directory path (${feature_dir}, resolved in Step 2)After agents complete, validate all analysis files:
${CLAUDE_PLUGIN_ROOT}/skills/parallel-plan/scripts/validate-analysis-artifacts.sh "${feature_dir}"
If validation passes → skip to Step 16b (Pre-Generation Gate). If validation fails → proceed to Step 16a.
For each missing file reported by the validation script:
<ANALYSIS_*> tag content from the agent's response:
analysis-context.md → look for <ANALYSIS_CONTEXT>...</ANALYSIS_CONTEXT> in Agent 1's responseanalysis-code.md → look for <ANALYSIS_CODE>...</ANALYSIS_CODE> in Agent 2's responseanalysis-tasks.md → look for <ANALYSIS_TASKS>...</ANALYSIS_TASKS> in Agent 3's response${feature_dir}/[filename] using the Write toolAfter writing fallback files, re-run validation:
${CLAUDE_PLUGIN_ROOT}/skills/parallel-plan/scripts/validate-analysis-artifacts.sh "${feature_dir}"
Run the pre-generation gate script:
${CLAUDE_PLUGIN_ROOT}/skills/parallel-plan/scripts/persist-or-fail.sh "${feature_dir}"
MISSING_FILES and ACTION_REQUIRED. Write the missing files NOW (from response tags or by re-deploying agents), then re-run this gate until it passes (exit 0)Do NOT proceed to plan generation until persist-or-fail.sh exits 0.
PRE-CHECK: If
analysis-context.md,analysis-code.md, oranalysis-tasks.mddo not exist in${feature_dir}/, Phase 5 was skipped in error. Go back and run Phase 5 now.
After verifying all files exist, read all analysis files:
${feature_dir}/analysis-context.md${feature_dir}/analysis-code.md${feature_dir}/analysis-tasks.mdUsing TodoWrite, create a comprehensive task list tracking:
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/plan-structure.md
Create ${feature_dir}/parallel-plan.md following the template exactly.
Required sections:
Run the validation script:
${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/scripts/validate-workflow-plan.sh "${feature_dir}/parallel-plan.md"
Fix any structural issues found.
cat ${CLAUDE_PLUGIN_ROOT}/skills/plan-workflow/templates/validation-agents.md
Standard Mode: Deploy 3 agents in parallel:
| Agent | Subagent Type | Focus |
|---|---|---|
| File Path Validator | explore | Verify all referenced files exist |
| Dependency Validator | explore | Check for circular/invalid dependencies |
| Task Completeness Validator | codebase-research-analyst | Ensure tasks are actionable |
Optimized Mode: Deploy 2 agents in parallel:
| Agent | Subagent Type | Focus |
|---|---|---|
| Path Validator | explore | Verify paths + dependency graph |
| Completeness Validator | codebase-research-analyst | Task quality + completeness |
After validators complete:
Provide a comprehensive summary:
# Plan Workflow Complete
## Feature
[feature-name]
## Files Created
### Research Phase
- ${feature_dir}/research-architecture.md
- ${feature_dir}/research-patterns.md
- ${feature_dir}/research-integration.md
- ${feature_dir}/research-docs.md
- ${feature_dir}/shared.md
### Analysis Phase
- ${feature_dir}/analysis-context.md
- ${feature_dir}/analysis-code.md
- ${feature_dir}/analysis-tasks.md
### Planning Phase
- ${feature_dir}/parallel-plan.md
## Agent Deployment Summary
- Mode: [standard/optimized]
- Research agents: 4
- Analysis agents: [3/0 depending on mode]
- Validation agents: [3/2 depending on mode]
- Total agents: [10/7]
## Plan Overview
- **Total Phases**: [count]
- **Total Tasks**: [count]
- **Independent Tasks**: [count that can run in parallel]
- **Max Dependency Depth**: [deepest chain]
## Validation Results
- File Path Validation: [passed/X issues]
- Dependency Graph: [valid/X issues]
- Task Completeness: [X high quality, Y needs work]
## Next Steps
The implementation plan is ready. Run:
/implement-plan [feature-name]
This will execute the plan with parallel agents where dependencies allow.
When --optimized flag is used, the workflow changes:
Instead of separate research (4) + analysis (3) agents, deploy 5 unified agents:
| Unified Agent | Combines | Output |
|---|---|---|
| Architecture Analyst | Arch Research + Context Synthesizer | analysis-architecture.md |
| Pattern Analyst | Pattern Research + Code Analyzer | analysis-patterns.md |
| Integration Analyst | Integration Research | analysis-integration.md |
| Documentation Analyst | Doc Research | analysis-docs.md |
| Task Planner | Task Structure Agent | analysis-tasks.md |
These agents produce combined research+analysis output, skipping Phase 5 entirely.
Validation uses 2 agents instead of 3 (Path + Completeness merged).
Total: 7 agents instead of 10, 2 waves instead of 3.
Each task must have:
All files are written to ${feature_dir}/ (resolved via resolve-plans-dir.sh).
| File | Producer | Required Before |
|---|---|---|
research-architecture.md | Architecture Researcher agent | shared.md synthesis |
research-patterns.md | Pattern Researcher agent | shared.md synthesis |
research-integration.md | Integration Researcher agent | shared.md synthesis |
research-docs.md | Documentation Researcher agent | shared.md synthesis |
shared.md | Orchestrator (this skill) | Analysis phase |
| File | Producer | Required Before |
|---|---|---|
analysis-context.md | Context Synthesizer agent | parallel-plan.md generation |
analysis-code.md | Code Analyzer agent | parallel-plan.md generation |
analysis-tasks.md | Task Structure Agent | parallel-plan.md generation |
| File | Producer | Required Before |
|---|---|---|
parallel-plan.md | Orchestrator (this skill) | Skill completion |
Contract Rules:
<ANALYSIS_*> tags)validate-research-artifacts.sh before generating shared.md (Step 9)validate-analysis-artifacts.sh after analysis agents complete (Step 16)<ANALYSIS_*> response tags (Step 16a)persist-or-fail.sh as a mandatory pre-generation gate (Step 16b)persist-or-fail.sh must exit 0 before plan generationThe skill automatically detects and uses the correct plans directory in monorepo setups.
docs/plans/packages/app1/) will still create plans at the rootCreate a .plans-config file to customize behavior:
Repository Root (centralized plans):
# .plans-config at repo root
plans_dir: docs/plans
Package-Level Plans (optional):
# .plans-config in packages/app1/
plans_dir: docs/plans
scope: local
With scope: local, plans created from that directory use the local docs/plans/ instead of the root.
monorepo/
.plans-config # plans_dir: docs/plans
docs/plans/ # Centralized plans (default)
feature-a/
feature-b/
packages/
app1/
.plans-config # plans_dir: docs/plans, scope: local (optional)
docs/plans/ # App1-specific plans (only if configured)
app2/
--optimized to reduce agent countresolve-plans-dir.shnpx claudepluginhub yandy-r/claude-pluginsCreates structured plans for multi-step tasks including software features, implementations, research, or projects. Deepens plans via interactive sub-agent reviews.
Orchestrates multi-step pre-implementation planning: project research, stakeholder interviews, external LLM review, then TDD plans. Use for features needing structured analysis before coding.
Creates detailed implementation plans through interactive, iterative collaboration. Use when planning features, refactoring, or tasks with research and multi-agent analysis.