DeepWorkPlan — Create
Create a new Deep Work Plan through a smooth, unified flow: the developer
provides information once, you generate a single refined draft, the developer
reviews it, and you materialize the final plan under .dwp/plans/PLAN_{name}/.
Single-step change (vs legacy): DeepWorkPlan generates the refined draft
directly. There is no separate raw-draft file. This replaces the legacy
draft → refined-draft two-step (which wrote PLAN_{name}_draft.md and then
PLAN_{name}_draft_refined.md). The only reviewable draft artifact is now
.dwp/drafts/PLAN_{name}_draft_refined.md.
Philosophy
The goal is a delightful, smooth experience. The user provides information once;
the system handles all intermediate steps (refined-draft creation, review, final
plan generation) automatically.
Shared resources (read these)
Parameter Reference
| Input |
Classification |
Mode |
Behavior |
Example |
| (none) |
— |
guided |
Ask for name, then ask questions |
/dwp-create |
{short text} |
name-only |
guided |
Extract name, ask questions immediately |
/dwp-create improve error handling |
{long text} |
full-context |
guided |
Infer name, proceed to refined draft directly |
/dwp-create Refactor auth to use JWT across all services. Currently using sessions... |
trust or auto |
— |
trust |
Ask for name, then ask questions (no confirmations) |
/dwp-create trust |
{short text} trust |
name-only |
trust |
Extract name, ask questions (no confirmations) |
/dwp-create improve-error-handling trust |
{long text} trust |
full-context |
trust |
Infer name, proceed directly (no confirmations) |
/dwp-create Refactor auth... trust |
refined-draft {name} |
— |
refined-draft-only |
Produce ONLY the refined draft (no final plan) |
/dwp-create refined-draft my_plan |
from-refined-draft {file} |
— |
from-refined-draft |
Build final plan from an existing refined draft |
/dwp-create from-refined-draft PLAN_x_draft_refined.md |
from {file} |
— |
from-refined-draft |
Alias for from-refined-draft |
/dwp-create from PLAN_x_draft_refined.md |
Name format: users type names in any format; you auto-convert to
snake_case internally.
Modes
Guided Mode (default)
- Collects information from the user.
- Creates the refined draft → shows it for review.
- Asks for confirmation before creating the final plan.
- User can request adjustments before final generation.
Trust Mode (trust or auto)
- Collects information from the user.
- Creates the refined draft → final plan automatically (no intermediate
confirmations).
Unified Workflow
Step 0 — Parse Parameters & Determine Mode
0.1 Detect trust mode: if the LAST word is trust or auto, remove it and
set trust_mode = true; otherwise false.
0.2 Detect special modes (check FIRST word):
refined-draft → mode = "refined-draft-only", remaining text = plan name.
from-refined-draft or from → mode = "from-refined-draft", remaining text
= refined-draft file path.
- Otherwise → continue to input classification (0.3).
0.3 Classify remaining input:
| Condition |
Classification |
What to do |
| No remaining text |
no input |
Go to Step 1, then Step 2 (ask for name + all info) |
| ≤10 words AND no complete sentences AND no line breaks |
name-only |
Convert to snake_case → plan name. Go to Step 1, then Step 2 (skip name question) |
| >10 words OR detailed sentences OR line breaks |
full-context |
Infer plan name → snake_case. Go to Step 1, then Step 3 (use provided context) |
Name auto-conversion to snake_case: lowercase; replace hyphens/spaces with
_; strip everything but a-z0-9_. Examples: improve Feature X →
improve_feature_x, add-stripe-payments → add_stripe_payments.
CRITICAL: when input is name-only, NEVER explore the codebase or
research the topic before asking questions. The name only says what to CALL the
plan, not what to DO. Go directly to Step 2.
Routing by mode:
from-refined-draft → skip to Step 4.3.
refined-draft-only → gather info, create only the refined draft, skip final
plan creation.
no input / name-only → Step 1, then Step 2.
full-context → Step 1, then Step 3.
Step 1 — Quick Introduction
Show a brief intro matching the mode (guided vs trust): what will happen and that
you'll create a refined plan, review it (guided) or proceed (trust), then
generate the final executable plan.
Step 2 — Gather Information (Conversational)
Skip this entire step for full-context input — go straight to Step 3.
Collect, conversationally:
- 2.1 Plan name (skip if already extracted) — auto-convert to snake_case, add
PLAN_ prefix internally.
- 2.2 Objective — one or two sentences.
- 2.3 Context — where the changes live, constraints/rules, tech notes.
- 2.4 Tasks — at least 2; if only 1, suggest breaking it down.
- 2.5 Guidelines (optional) — branch/commit format, coverage target, etc.
2.6 Orchestrator detection (automatic). After 2.3–2.4, auto-detect an
orchestrator plan when: the work spans 2+ sub-repositories with independent
feature work, or the user explicitly mentions child DWPs / orchestrator /
"create plans in each repo". If detected, offer the choice between an
orchestrator plan (creates child DWPs per repo, each following its own
AGENTS.md) and a direct multi-project plan. See ../guide/GUIDE.md §13 and
../shared/adaptation.md (orchestrator-hub archetype).
2.7–2.9 (orchestrator only): ask for target repositories (note each repo
root — for an orchestrator hub this is repositories/{repo}/), dependency order,
and execution mode (Distributed / Sequential with Output Handoff / Sequential
basic). Default to Distributed.
2.10 Team-agents detection (automatic — always runs, non-orchestrator plans).
Always analyze whether 2+ tasks touch different files/modules with no data
dependencies and would benefit from parallel execution. This is NOT opt-in.
- If parallelizable: in guided mode, inform the user (do not ask) and add the
team-agents configuration; in trust mode, do it silently. Team-agents
metadata is always additive and backward compatible (other agents ignore it).
- Auto-assign parallel groups (tasks with no cross-dependencies), teammate roles
(derived from task content), and default model
sonnet. Setup/integration and
the three mandatory final tasks are always sequential.
- If not parallelizable: add nothing, mention nothing.
Step 2.11 — Parallel Research Phase (Claude Code only, automatic). Before
drafting, if the plan spans 2+ repos or several independent modules and context
isn't already provided, spawn research teammates (subagent_type: "Explore",
one per repo/area) to read each AGENTS.md, identify relevant files, contracts,
and validation commands, then synthesize their findings into enriched context for
the refined draft. Skip for simple/single-module plans or full-context input.
Fallback: research sequentially if team agents are unavailable. In trust mode,
run silently.
Step 3 — Create the Refined Draft (Automatic, SINGLE STEP)
This is the single-step change. Produce the refined draft directly —
one file, written straight to .dwp/drafts/. Do NOT create a separate raw
PLAN_{name}_draft.md first.
Show a 2-step progress UI:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Creating your plan...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1/2] Drafting refined plan...
3.1 Write the refined draft:
- Resolve
dwp_dir via ../shared/context.sh; ensure <dwp_dir>/drafts/ exists.
- Compose a professional, complete plan prompt following
../examples/CREATE_PLAN.md: objective, context (enriched with Step 2.11
research if applicable), well-formed tasks, guidelines. Expand every section
with full detail and clarity in one pass.
- Write only:
.dwp/drafts/PLAN_{name}_draft_refined.md.
[1/2] Drafting refined plan... ✓
[2/2] Preparing for review...
Step 4 — Review & Create Final Plan
4.1 Guided Mode — Show for Review
Present a summary (objective, task count + list, location, constraints) and the
path → .dwp/drafts/PLAN_{name}_draft_refined.md, then offer:
- Looks good, create the final plan → Step 4.4.
- Make adjustments → ask what to change, edit the refined draft in place,
show the menu again.
- Show the full refined draft → display it, then re-show the menu.
- Stop here → completion message for the draft phase.
4.2 Trust Mode — Automatic Continue
Skip review; go directly to Step 4.4. Progress: [2/2] Creating final plan....
4.3 From-Refined-Draft Mode
- Validate the file exists in
.dwp/drafts/. If not found, list available
refined drafts and ask the user to select.
- Read it; extract plan name, objective, context, tasks, guidelines.
- Skip to Step 4.4.
4.4 Create Final Plan
Follow ../guide/GUIDE.md. Create:
Folder: .dwp/plans/PLAN_{name}/
README.md — Goal; Context; Plan Variables (optional); Global Guidelines;
Task List with [ ] checkboxes + links (including the three mandatory final
tasks); Execution Rules; Skills & Agents Used; Plan Status / Notes; Analysis
Outputs (referencing EXECUTIVE_REPORT.md); Quick Reference to PROMPTS.md.
PROMPTS.md — from ../examples/PROMPTS_TEMPLATE.md, replacing
{PLAN_NAME}.
PROGRESS.md — initial template (Task Summaries / Key Decisions / Important
Values & Paths).
analysis_results/ — empty folder inside the plan directory.
User-defined task files — N.task_{title}.md, each with Context, Read
Before Starting (optional), Goal, Instructions (with re-anchoring),
Acceptance Criteria, Outputs (optional), Validation, Rollback (optional),
Execution Checklist, Completion & Log. For any task that adds new core
functionality or changes product behavior, bake the test discipline into
it (../guide/GUIDE.md §5.3): its Acceptance Criteria must require
automated test coverage for the new/changed behavior, and its Validation
must run the repo's tests plus lint/type-check/format checks (not the
build alone). Where related work is substantial, prefer a dedicated
N.task_add_tests_for_{feature}.md task right after the implementation task.
Likewise, for any task that touches auth, input handling, secrets/config,
network surface, or dependencies, bake the security discipline into it
(../guide/GUIDE.md §5.4); where the security-sensitive work is substantial,
prefer a dedicated N.task_security_hardening_{feature}.md task placed after
the implementation tasks and before the comprehensive-tests task, so
findings are fixed before tests encode the behavior and become regression
test cases rather than rework.
State layer (RECOMMENDED, ../spec/PLAN_STATE.md) — write
manifest.json (plan identity: name, archetype, rigor tier, spec version,
task count, creating agent — once, never edited after) and the initial
state.json (every task pending, empty gates). Both atomically
(write-temp-then-rename). REQUIRED when the plan will run unattended
(../spec/AGENT_PROTOCOL.md §7.2) or the workspace has no git.
Proportional rigor check first (../spec/DWP_SPECIFICATION.md §11): before
materializing anything, confirm the work actually warrants a plan. A trivial
single-concern change is micro tier — say that a plan is disproportionate,
offer to state goal + acceptance criteria + validation gate inline and just do
it. Declare the chosen tier (standard or deep) and why in the refined draft.
Three mandatory final tasks (always):
Security Review (MANDATORY, third-to-last, task N-2,
{N-2}.task_security_review.md): reviews the plan's full accumulated diff for
hardcoded secrets, injection risks, unsafe input handling, new attack surface,
and auth/permission changes; audits dependencies the plan introduced
(best-effort, with the ecosystem's audit tooling where available); verifies
docs/SECURITY.md still reflects reality and updates it when the plan changed
secrets handling, the auth model, or data boundaries; writes
analysis_results/SECURITY_REVIEW.md even when clean. A critical finding
blocks completion until fixed or explicitly accepted by the user
(../spec/DWP_SPECIFICATION.md §6.1).
Addon augmentation — ai-diff-reviewer (opt-in, only when installed).
When the target repo has installed the ai-diff-reviewer addon — detected via
.agents/skills/ai-diff-reviewer/ present + an extension file at one of the
three recognized paths (in precedence order): .review/extension.md,
.github/ai-diff-reviewer/extension.md, or the back-compat
.github/ai-pr-reviewer/extension.md — the Security Review task template gains
an ADDITIONAL post-existing-checks step: invoke the upstream skill's parent
default flow ("Review my current branch" / /ai-diff-reviewer), capture the
verdict, findings table, per-finding bodies, notes, and recommendation, and
append them to analysis_results/SECURITY_REVIEW.md under a dedicated
## AI Diff Reviewer local review heading. The upstream skill's prompt.md
is byte-identical to the CI Action's prompts/default.md at the same tag, so
when the same repo also runs the CI Action (Flow B), the local review shares
the same methodology and severity model via that prompt plus the extension
file; CI round 2+ may surface a shorter finding set under Iteration-Aware
Review (local stays a full pass — see addon SPEC §4.3). A critical finding
follows the existing SR contract
(blocks completion until fixed or explicitly accepted); warning / info
findings are appended and reported but do not block. The augmentation is
best-effort and conditional per the addon SPEC §7 (never-block rule): skip
the local review pass (warn once, NEVER fail the task) only when the
vendored skill is absent, detection fails (no extension file), or the local
review invocation errors. Flow A needs no CI provider secret — do NOT
treat an unset CURSOR_API_KEY (or other provider secret) as a reason to
skip the local Security Review pass; that secret is Flow B CI / gate
messaging only. Flow B optional companion (not a plan task):
when the plan's PR has been pushed and CI has posted its review, the developer
MAY invoke the upstream apply-review sub-skill from within the same
execute session to walk through CI findings per-finding (apply / defer /
skip) with explicit consent — read-only by default, edits require per-finding
yes, never commits or pushes. This is surfaced as an available option during
execute; the addon MUST NOT insert an apply-review task file into any
plan (would violate the mandatory-final-task-order rule).
Skills & Agents Discovery (MANDATORY, second-to-last, task N-1,
{N-1}.task_skills_agents_discovery.md): reviews completed tasks for new
patterns, checks the catalog, creates/updates skills/agents if warranted,
evaluates the skills-generator system. If no skills-generator exists in the
target repo, write a simplified evaluate-and-document-only version.
Executive Report (MANDATORY, last, task N,
{N}.task_executive_report.md): generates
analysis_results/EXECUTIVE_REPORT.md with Executive Summary, Product Impact,
Technical Details, QA Verification Guide, FAQs, Next Steps.
Add to the README a note: "Every plan includes Security Review
(third-to-last), Skills & Agents Discovery (second-to-last), and Executive
Report (last). These are auto-generated by /dwp-create."
Quality gates: atomic, ordered tasks; both mandatory files present;
analysis_results/ exists; PROGRESS.md exists; numbering correct (user tasks →
security review → skills discovery → executive report); behavior-changing tasks carry test coverage
in their Acceptance Criteria and tests + lint/type-check in their Validation
(../guide/GUIDE.md §5.3).
Accelerate generation with team agents (Claude Code only, automatic): for
5+ user-defined task files, the lead creates README/PROMPTS/PROGRESS/
analysis_results + the mandatory final task files, then spawns teammates (1 per
2–3 task files) to write user task files in parallel (no file overlap), verifies
all files, and cleans up. Fallback: generate sequentially.
Orchestrator additions (orchestrator plans):
- README Child DWP Plans table (
# | Repository | Child Plan | Status | Depends On), an Execution Mode subsection, and Dependency Rules.
- ORCHESTRATOR_MANIFEST.md at
.dwp/plans/PLAN_{name}/ORCHESTRATOR_MANIFEST.md
(template in ../guide/GUIDE.md §13.8): Shared Context, Child DWP Registry,
Dependency Graph, Output Contracts, Execution State.
- Task files: direct design tasks first (if hybrid); then
create_child_dwp
tasks in dependency order (template
../examples/ORCHESTRATOR_TASK_TEMPLATE_create_child_dwp.md); optional
integration_checkpoint tasks
(../examples/ORCHESTRATOR_TASK_TEMPLATE_integration_checkpoint.md);
execute_child_dwp tasks for Sequential-with-Output-Handoff mode
(../examples/ORCHESTRATOR_TASK_TEMPLATE_execute_child_dwp.md); then the two
mandatory final tasks last. Each create_child_dwp task instructs the agent to
navigate to the target repo, read its AGENTS.md, and create a child DWP at
repositories/{repo}/.dwp/plans/PLAN_{child}/ using that repo's conventions.
Team-agents metadata (when Step 2.10 detected parallelizable tasks): add a
"Team Agents Configuration (Claude Code Only)" section to the README (Parallel
Task Groups + Teammate Roles tables) and a "Team Agents Metadata (Claude Code
Only)" section to each parallel task file (Parallel Group / Teammate Role / Can
Run With / Blocks / Files Owned). Use ../examples/TEAM_AGENTS_TASK_TEMPLATE.md.
Rules: never put required info inside team-agents sections; every task must work
sequentially; mandatory final tasks are always sequential; file ownership between
parallel tasks must not overlap.
Step 5 — Completion & Execute Option
For a full plan, report success and the location
.dwp/plans/PLAN_{name}/, then offer: (1) execute now → run the Execute
sub-skill (../execute/SKILL.md); (2) review the README first, then ask again;
(3) done for now → tell them to run /dwp-execute {name} later.
Dailybot kickoff (only when the Dailybot addon is wired — best-effort,
non-blocking): after the plan is materialized and approved, send a regular
(non-milestone) kickoff report via the dailybot report sub-skill — "Starting:
<what is being built and why it matters>" — per the addon's lifecycle event
model (../addons/dailybot/SPEC.md §5.1). One kickoff per plan; skip silently
if Dailybot is absent, unauthenticated, or .dailybot/disabled exists. Never
block on this.
For refined-draft-only mode, report the single refined draft saved at
.dwp/drafts/PLAN_{name}_draft_refined.md and the next step: run
/dwp-create from PLAN_{name}_draft_refined.md to build the final plan.
Step 6 — Execute Plan (Optional)
If the user chose to execute, hand off to the Execute sub-skill
(../execute/SKILL.md): read the plan README, check git status, start from the
first [ ] task, execute sequentially, validate, commit per task, report.
Error Handling
- Plan name already exists: offer different name / overwrite / cancel.
- Name auto-converted: show an informational notice (not an error).
- Refined draft not found (from-refined-draft): list available refined drafts
in
.dwp/drafts/ and ask the user to choose.
- Insufficient tasks (<2): ask the user to break the work down.
Important Notes
- Git ignore: everything under
.dwp/ is git-ignored.
- Single artifact: the only draft file is
PLAN_{name}_draft_refined.md in
.dwp/drafts/ — there is no separate raw draft.
- Reference: follow
../guide/GUIDE.md; orchestrator → §13; team agents → §14.
- Archetypes: orchestrator support assumes the orchestrator-hub archetype
(sub-repos under
repositories/); an individual repo creates standard plans.
See ../shared/adaptation.md.
1---2name: deepworkplan-create3description: Create a Deep Work Plan. Gather context, draft, and refine into a single final plan under .dwp/plans/, with a refined draft staged in .dwp/drafts/. Use when the developer wants a new structured multi-task plan.4---56# DeepWorkPlan — Create78Create a new Deep Work Plan through a smooth, unified flow: the developer9provides information once, you generate a **single refined draft**, the developer10reviews it, and you materialize the final plan under `.dwp/plans/PLAN_{name}/`.1112> **Single-step change (vs legacy):** DeepWorkPlan generates the **refined draft13> directly**. There is **no separate raw-draft file**. This replaces the legacy14> draft → refined-draft two-step (which wrote `PLAN_{name}_draft.md` and then15> `PLAN_{name}_draft_refined.md`). The only reviewable draft artifact is now16> `.dwp/drafts/PLAN_{name}_draft_refined.md`.1718## Philosophy1920The goal is a delightful, smooth experience. The user provides information once;21the system handles all intermediate steps (refined-draft creation, review, final22plan generation) automatically.2324## Shared resources (read these)2526- [`../shared/context.sh`](../shared/context.sh) — resolve repo root, branch,27 agent tool, and the `.dwp/` output location (`dwp_dir`).28- [`../shared/dwp-paths.md`](../shared/dwp-paths.md) — the `.dwp/plans/` +29 `.dwp/drafts/` output convention.30- [`../shared/adaptation.md`](../shared/adaptation.md) — reasoning-over-copy-paste31 and the two repository archetypes (individual repo vs orchestrator hub).32- [`../guide/GUIDE.md`](../guide/GUIDE.md) — the full methodology: plan README33 structure, task-file anatomy, mandatory final tasks, orchestrator (§13),34 team agents (§14).35- [`../examples/CREATE_PLAN.md`](../examples/CREATE_PLAN.md) — prompt patterns.36- [`../examples/PROMPTS_TEMPLATE.md`](../examples/PROMPTS_TEMPLATE.md) — the37 `PROMPTS.md` template for each plan.3839## Parameter Reference4041| Input | Classification | Mode | Behavior | Example |42|-------|---------------|------|----------|---------|43| (none) | — | guided | Ask for name, then ask questions | `/dwp-create` |44| `{short text}` | **name-only** | guided | Extract name, ask questions immediately | `/dwp-create improve error handling` |45| `{long text}` | **full-context** | guided | Infer name, proceed to refined draft directly | `/dwp-create Refactor auth to use JWT across all services. Currently using sessions...` |46| `trust` or `auto` | — | trust | Ask for name, then ask questions (no confirmations) | `/dwp-create trust` |47| `{short text} trust` | **name-only** | trust | Extract name, ask questions (no confirmations) | `/dwp-create improve-error-handling trust` |48| `{long text} trust` | **full-context** | trust | Infer name, proceed directly (no confirmations) | `/dwp-create Refactor auth... trust` |49| `refined-draft {name}` | — | refined-draft-only | Produce ONLY the refined draft (no final plan) | `/dwp-create refined-draft my_plan` |50| `from-refined-draft {file}` | — | from-refined-draft | Build final plan from an existing refined draft | `/dwp-create from-refined-draft PLAN_x_draft_refined.md` |51| `from {file}` | — | from-refined-draft | Alias for `from-refined-draft` | `/dwp-create from PLAN_x_draft_refined.md` |5253> **Name format:** users type names in any format; you auto-convert to54> `snake_case` internally.5556## Modes5758### Guided Mode (default)59- Collects information from the user.60- Creates the **refined draft** → shows it for review.61- Asks for confirmation before creating the final plan.62- User can request adjustments before final generation.6364### Trust Mode (`trust` or `auto`)65- Collects information from the user.66- Creates the **refined draft** → final plan automatically (no intermediate67 confirmations).6869## Unified Workflow7071### Step 0 — Parse Parameters & Determine Mode7273**0.1 Detect trust mode:** if the LAST word is `trust` or `auto`, remove it and74set `trust_mode = true`; otherwise `false`.7576**0.2 Detect special modes (check FIRST word):**77- `refined-draft` → `mode = "refined-draft-only"`, remaining text = plan name.78- `from-refined-draft` or `from` → `mode = "from-refined-draft"`, remaining text79 = refined-draft file path.80- Otherwise → continue to input classification (0.3).8182**0.3 Classify remaining input:**8384| Condition | Classification | What to do |85|-----------|---------------|------------|86| No remaining text | **no input** | Go to Step 1, then Step 2 (ask for name + all info) |87| ≤10 words AND no complete sentences AND no line breaks | **name-only** | Convert to snake_case → plan name. Go to Step 1, then Step 2 (skip name question) |88| >10 words OR detailed sentences OR line breaks | **full-context** | Infer plan name → snake_case. Go to Step 1, then Step 3 (use provided context) |8990**Name auto-conversion to snake_case:** lowercase; replace hyphens/spaces with91`_`; strip everything but `a-z0-9_`. Examples: `improve Feature X` →92`improve_feature_x`, `add-stripe-payments` → `add_stripe_payments`.9394> **CRITICAL:** when input is **name-only**, NEVER explore the codebase or95> research the topic before asking questions. The name only says what to CALL the96> plan, not what to DO. Go directly to Step 2.9798**Routing by mode:**99- `from-refined-draft` → skip to Step 4.3.100- `refined-draft-only` → gather info, create only the refined draft, skip final101 plan creation.102- `no input` / `name-only` → Step 1, then Step 2.103- `full-context` → Step 1, then Step 3.104105### Step 1 — Quick Introduction106107Show a brief intro matching the mode (guided vs trust): what will happen and that108you'll create a refined plan, review it (guided) or proceed (trust), then109generate the final executable plan.110111### Step 2 — Gather Information (Conversational)112113> Skip this entire step for `full-context` input — go straight to Step 3.114115Collect, conversationally:116- **2.1 Plan name** (skip if already extracted) — auto-convert to snake_case, add117 `PLAN_` prefix internally.118- **2.2 Objective** — one or two sentences.119- **2.3 Context** — where the changes live, constraints/rules, tech notes.120- **2.4 Tasks** — at least 2; if only 1, suggest breaking it down.121- **2.5 Guidelines (optional)** — branch/commit format, coverage target, etc.122123**2.6 Orchestrator detection (automatic).** After 2.3–2.4, auto-detect an124**orchestrator plan** when: the work spans 2+ sub-repositories with independent125feature work, or the user explicitly mentions child DWPs / orchestrator /126"create plans in each repo". If detected, offer the choice between an127**orchestrator plan** (creates child DWPs per repo, each following its own128`AGENTS.md`) and a **direct multi-project plan**. See `../guide/GUIDE.md` §13 and129`../shared/adaptation.md` (orchestrator-hub archetype).130131**2.7–2.9 (orchestrator only):** ask for target repositories (note each repo132root — for an orchestrator hub this is `repositories/{repo}/`), dependency order,133and execution mode (Distributed / Sequential with Output Handoff / Sequential134basic). Default to Distributed.135136**2.10 Team-agents detection (automatic — always runs, non-orchestrator plans).**137Always analyze whether 2+ tasks touch different files/modules with no data138dependencies and would benefit from parallel execution. This is NOT opt-in.139- If parallelizable: in **guided** mode, inform the user (do not ask) and add the140 team-agents configuration; in **trust** mode, do it silently. Team-agents141 metadata is always additive and backward compatible (other agents ignore it).142- Auto-assign parallel groups (tasks with no cross-dependencies), teammate roles143 (derived from task content), and default model `sonnet`. Setup/integration and144 the three mandatory final tasks are always sequential.145- If not parallelizable: add nothing, mention nothing.146147**Step 2.11 — Parallel Research Phase (Claude Code only, automatic).** Before148drafting, if the plan spans 2+ repos or several independent modules and context149isn't already provided, spawn **research teammates** (`subagent_type: "Explore"`,150one per repo/area) to read each `AGENTS.md`, identify relevant files, contracts,151and validation commands, then synthesize their findings into enriched context for152the refined draft. Skip for simple/single-module plans or full-context input.153Fallback: research sequentially if team agents are unavailable. In trust mode,154run silently.155156### Step 3 — Create the Refined Draft (Automatic, SINGLE STEP)157158> **This is the single-step change.** Produce the **refined draft directly** —159> one file, written straight to `.dwp/drafts/`. Do NOT create a separate raw160> `PLAN_{name}_draft.md` first.161162Show a **2-step** progress UI:163164```165━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━166Creating your plan...167━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━168169[1/2] Drafting refined plan...170```171172**3.1 Write the refined draft:**173- Resolve `dwp_dir` via `../shared/context.sh`; ensure `<dwp_dir>/drafts/` exists.174- Compose a professional, complete plan prompt following175 `../examples/CREATE_PLAN.md`: objective, context (enriched with Step 2.11176 research if applicable), well-formed tasks, guidelines. Expand every section177 with full detail and clarity in one pass.178- Write **only**: `.dwp/drafts/PLAN_{name}_draft_refined.md`.179180```181[1/2] Drafting refined plan... ✓182[2/2] Preparing for review...183```184185### Step 4 — Review & Create Final Plan186187#### 4.1 Guided Mode — Show for Review188189Present a summary (objective, task count + list, location, constraints) and the190path `→ .dwp/drafts/PLAN_{name}_draft_refined.md`, then offer:1911. Looks good, create the final plan → Step 4.4.1922. Make adjustments → ask what to change, **edit the refined draft in place**,193 show the menu again.1943. Show the full refined draft → display it, then re-show the menu.1954. Stop here → completion message for the draft phase.196197#### 4.2 Trust Mode — Automatic Continue198199Skip review; go directly to Step 4.4. Progress: `[2/2] Creating final plan...`.200201#### 4.3 From-Refined-Draft Mode202203- Validate the file exists in `.dwp/drafts/`. If not found, list available204 refined drafts and ask the user to select.205- Read it; extract plan name, objective, context, tasks, guidelines.206- Skip to Step 4.4.207208#### 4.4 Create Final Plan209210Follow `../guide/GUIDE.md`. Create:2112121. **Folder:** `.dwp/plans/PLAN_{name}/`2132. **README.md** — Goal; Context; Plan Variables (optional); Global Guidelines;214 Task List with `[ ]` checkboxes + links (including the three mandatory final215 tasks); Execution Rules; Skills & Agents Used; Plan Status / Notes; Analysis216 Outputs (referencing `EXECUTIVE_REPORT.md`); Quick Reference to `PROMPTS.md`.2173. **PROMPTS.md** — from `../examples/PROMPTS_TEMPLATE.md`, replacing218 `{PLAN_NAME}`.2194. **PROGRESS.md** — initial template (Task Summaries / Key Decisions / Important220 Values & Paths).2215. **analysis_results/** — empty folder inside the plan directory.2226. **User-defined task files** — `N.task_{title}.md`, each with Context, Read223 Before Starting (optional), Goal, Instructions (with re-anchoring),224 Acceptance Criteria, Outputs (optional), Validation, Rollback (optional),225 Execution Checklist, Completion & Log. For any task that adds new core226 functionality or changes product behavior, bake the **test discipline** into227 it (`../guide/GUIDE.md` §5.3): its Acceptance Criteria **must** require228 automated test coverage for the new/changed behavior, and its Validation229 **must** run the repo's tests plus lint/type-check/format checks (not the230 build alone). Where related work is substantial, prefer a dedicated231 `N.task_add_tests_for_{feature}.md` task right after the implementation task.232 Likewise, for any task that touches auth, input handling, secrets/config,233 network surface, or dependencies, bake the **security discipline** into it234 (`../guide/GUIDE.md` §5.4); where the security-sensitive work is substantial,235 prefer a dedicated `N.task_security_hardening_{feature}.md` task placed after236 the implementation tasks and **before** the comprehensive-tests task, so237 findings are fixed before tests encode the behavior and become regression238 test cases rather than rework.2392407. **State layer (RECOMMENDED, `../spec/PLAN_STATE.md`)** — write241 `manifest.json` (plan identity: name, archetype, rigor tier, spec version,242 task count, creating agent — once, never edited after) and the initial243 `state.json` (every task `pending`, empty gates). Both atomically244 (write-temp-then-rename). REQUIRED when the plan will run unattended245 (`../spec/AGENT_PROTOCOL.md` §7.2) or the workspace has no git.246247**Proportional rigor check first (`../spec/DWP_SPECIFICATION.md` §11):** before248materializing anything, confirm the work actually warrants a plan. A trivial249single-concern change is **micro** tier — say that a plan is disproportionate,250offer to state goal + acceptance criteria + validation gate inline and just do251it. Declare the chosen tier (`standard` or `deep`) and why in the refined draft.252253**Three mandatory final tasks (always):**254- **Security Review** (MANDATORY, **third-to-last**, task `N-2`,255 `{N-2}.task_security_review.md`): reviews the plan's full accumulated diff for256 hardcoded secrets, injection risks, unsafe input handling, new attack surface,257 and auth/permission changes; audits dependencies the plan introduced258 (best-effort, with the ecosystem's audit tooling where available); verifies259 `docs/SECURITY.md` still reflects reality and updates it when the plan changed260 secrets handling, the auth model, or data boundaries; writes261 `analysis_results/SECURITY_REVIEW.md` even when clean. A critical finding262 blocks completion until fixed or explicitly accepted by the user263 (`../spec/DWP_SPECIFICATION.md` §6.1).264265 **Addon augmentation — `ai-diff-reviewer` (opt-in, only when installed).**266 When the target repo has installed the [`ai-diff-reviewer` addon](../addons/ai-diff-reviewer/SKILL.md) — detected via267 `.agents/skills/ai-diff-reviewer/` present + an extension file at one of the268 three recognized paths (in precedence order): `.review/extension.md`,269 `.github/ai-diff-reviewer/extension.md`, or the back-compat270 `.github/ai-pr-reviewer/extension.md` — the Security Review task template gains271 an ADDITIONAL post-existing-checks step: invoke the upstream skill's parent272 default flow ("Review my current branch" / `/ai-diff-reviewer`), capture the273 verdict, findings table, per-finding bodies, notes, and recommendation, and274 append them to `analysis_results/SECURITY_REVIEW.md` under a dedicated275 `## AI Diff Reviewer local review` heading. The upstream skill's `prompt.md`276 is byte-identical to the CI Action's `prompts/default.md` at the same tag, so277 when the same repo also runs the CI Action (Flow B), the local review shares278 the same methodology and severity model via that prompt plus the extension279 file; CI round 2+ may surface a shorter finding set under Iteration-Aware280 Review (local stays a full pass — see addon SPEC §4.3). A `critical` finding281 follows the existing SR contract282 (blocks completion until fixed or explicitly accepted); `warning` / `info`283 findings are appended and reported but do not block. The augmentation is284 best-effort and conditional per the addon SPEC §7 (never-block rule): skip285 the **local** review pass (warn once, NEVER fail the task) only when the286 vendored skill is absent, detection fails (no extension file), or the local287 review invocation errors. Flow A needs **no** CI provider secret — do NOT288 treat an unset `CURSOR_API_KEY` (or other provider secret) as a reason to289 skip the local Security Review pass; that secret is Flow B CI / gate290 messaging only. **Flow B optional companion (not a plan task):**291 when the plan's PR has been pushed and CI has posted its review, the developer292 MAY invoke the upstream `apply-review` sub-skill from within the same293 `execute` session to walk through CI findings per-finding (apply / defer /294 skip) with explicit consent — read-only by default, edits require per-finding295 yes, never commits or pushes. This is surfaced as an available option during296 `execute`; the addon MUST NOT insert an `apply-review` task file into any297 plan (would violate the mandatory-final-task-order rule).298- **Skills & Agents Discovery** (MANDATORY, **second-to-last**, task `N-1`,299 `{N-1}.task_skills_agents_discovery.md`): reviews completed tasks for new300 patterns, checks the catalog, creates/updates skills/agents if warranted,301 evaluates the skills-generator system. If no skills-generator exists in the302 target repo, write a simplified evaluate-and-document-only version.303- **Executive Report** (MANDATORY, **last**, task `N`,304 `{N}.task_executive_report.md`): generates305 `analysis_results/EXECUTIVE_REPORT.md` with Executive Summary, Product Impact,306 Technical Details, QA Verification Guide, FAQs, Next Steps.307308Add to the README a note: "Every plan includes Security Review309(third-to-last), Skills & Agents Discovery (second-to-last), and Executive310Report (last). These are auto-generated by `/dwp-create`."311312**Quality gates:** atomic, ordered tasks; both mandatory files present;313`analysis_results/` exists; `PROGRESS.md` exists; numbering correct (user tasks →314security review → skills discovery → executive report); behavior-changing tasks carry test coverage315in their Acceptance Criteria and tests + lint/type-check in their Validation316(`../guide/GUIDE.md` §5.3).317318**Accelerate generation with team agents (Claude Code only, automatic):** for3195+ user-defined task files, the lead creates README/PROMPTS/PROGRESS/320analysis_results + the mandatory final task files, then spawns teammates (1 per3212–3 task files) to write user task files in parallel (no file overlap), verifies322all files, and cleans up. Fallback: generate sequentially.323324**Orchestrator additions (orchestrator plans):**325- README **Child DWP Plans** table (`# | Repository | Child Plan | Status |326 Depends On`), an **Execution Mode** subsection, and **Dependency Rules**.327- **ORCHESTRATOR_MANIFEST.md** at `.dwp/plans/PLAN_{name}/ORCHESTRATOR_MANIFEST.md`328 (template in `../guide/GUIDE.md` §13.8): Shared Context, Child DWP Registry,329 Dependency Graph, Output Contracts, Execution State.330- Task files: direct design tasks first (if hybrid); then `create_child_dwp`331 tasks in dependency order (template332 `../examples/ORCHESTRATOR_TASK_TEMPLATE_create_child_dwp.md`); optional333 `integration_checkpoint` tasks334 (`../examples/ORCHESTRATOR_TASK_TEMPLATE_integration_checkpoint.md`);335 `execute_child_dwp` tasks for Sequential-with-Output-Handoff mode336 (`../examples/ORCHESTRATOR_TASK_TEMPLATE_execute_child_dwp.md`); then the two337 mandatory final tasks last. Each `create_child_dwp` task instructs the agent to338 navigate to the target repo, read its `AGENTS.md`, and create a child DWP at339 `repositories/{repo}/.dwp/plans/PLAN_{child}/` using that repo's conventions.340341**Team-agents metadata (when Step 2.10 detected parallelizable tasks):** add a342"Team Agents Configuration (Claude Code Only)" section to the README (Parallel343Task Groups + Teammate Roles tables) and a "Team Agents Metadata (Claude Code344Only)" section to each parallel task file (Parallel Group / Teammate Role / Can345Run With / Blocks / Files Owned). Use `../examples/TEAM_AGENTS_TASK_TEMPLATE.md`.346Rules: never put required info inside team-agents sections; every task must work347sequentially; mandatory final tasks are always sequential; file ownership between348parallel tasks must not overlap.349350### Step 5 — Completion & Execute Option351352For a full plan, report success and the location353`.dwp/plans/PLAN_{name}/`, then offer: (1) execute now → run the **Execute**354sub-skill (`../execute/SKILL.md`); (2) review the README first, then ask again;355(3) done for now → tell them to run `/dwp-execute {name}` later.356357**Dailybot kickoff (only when the Dailybot addon is wired — best-effort,358non-blocking):** after the plan is materialized and approved, send a **regular**359(non-milestone) kickoff report via the dailybot `report` sub-skill — "Starting:360\<what is being built and why it matters\>" — per the addon's lifecycle event361model (`../addons/dailybot/SPEC.md` §5.1). One kickoff per plan; skip silently362if Dailybot is absent, unauthenticated, or `.dailybot/disabled` exists. Never363block on this.364365For `refined-draft-only` mode, report the single refined draft saved at366`.dwp/drafts/PLAN_{name}_draft_refined.md` and the next step: run367`/dwp-create from PLAN_{name}_draft_refined.md` to build the final plan.368369### Step 6 — Execute Plan (Optional)370371If the user chose to execute, hand off to the **Execute** sub-skill372(`../execute/SKILL.md`): read the plan README, check git status, start from the373first `[ ]` task, execute sequentially, validate, commit per task, report.374375## Error Handling376377- **Plan name already exists:** offer different name / overwrite / cancel.378- **Name auto-converted:** show an informational notice (not an error).379- **Refined draft not found (from-refined-draft):** list available refined drafts380 in `.dwp/drafts/` and ask the user to choose.381- **Insufficient tasks (<2):** ask the user to break the work down.382383## Important Notes384385- **Git ignore:** everything under `.dwp/` is git-ignored.386- **Single artifact:** the only draft file is `PLAN_{name}_draft_refined.md` in387 `.dwp/drafts/` — there is no separate raw draft.388- **Reference:** follow `../guide/GUIDE.md`; orchestrator → §13; team agents → §14.389- **Archetypes:** orchestrator support assumes the orchestrator-hub archetype390 (sub-repos under `repositories/`); an individual repo creates standard plans.391 See `../shared/adaptation.md`.