.claude/skills/dan-plan/SKILL.md
Spawn planner agent to create execution plans for a phase based on research findings
npx skillsauth add RavBogard/DAN dan:planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Spawn a dan-planner agent to create execution plans for a phase. The planner reads research findings, REQUIREMENTS.md, and PROJECT.md to produce sequenced, dependency-aware PLAN.md files.
{phase}-RESEARCH.md for the target phase{phase}-{plan}-PLAN.md files with:
Spawns dan-planner subagent. One planner per phase.
State and frontmatter operations use the DAN CLI:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd $PROJECT_DIR frontmatter parse .planning/phases/01-foundation/01-01-PLAN.md
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd $PROJECT_DIR state set "Status" "Planning"
<execution_flow>
<step name="check_loop_closure" priority="first"> Before creating a new plan, verify all prior loops are closed. No orphan plans allowed.Read STATE.md to get current phase:
PHASE_DIR=$(node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" state get "Phase" | grep -oP '\d+')
Determine the phase directory path:
PHASE_PATH=$(ls -d "$PROJECT_DIR/.planning/phases/"*"-"* | grep "^.*/${PHASE_DIR}-" | head -1)
List all PLAN.md and SUMMARY.md files in the phase directory:
PLANS=$(ls "$PHASE_PATH"/*-PLAN.md 2>/dev/null)
SUMMARIES=$(ls "$PHASE_PATH"/*-SUMMARY.md 2>/dev/null)
For each PLAN.md, check if a matching SUMMARY.md exists:
02-01) from the filename{prefix}-SUMMARY.md in the SUMMARIES listnode "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" frontmatter parse "$PLAN_FILE"
b. If status is IN_PROGRESS or APPROVED:
BLOCK -- tell the user:
Previous plan [XX-NN] is [status]. Run
/dan:applyto complete it, then/dan:unifyto close the loop. c. If status isABANDONED: BLOCK -- abandoned plans still need summaries: Plan [XX-NN] was abandoned but has no SUMMARY.md. Run/dan:unifyto close the loop. d. If status isDRAFT: This is a plan that was never approved. It can be overwritten or the user can approve it. Inform the user: > Draft plan [XX-NN] exists. Approve it with/dan:applyor it will be superseded.
Only proceed to step 2 if all prior plans have matching SUMMARY.md files (or are in DRAFT state).
</step>If a phase number argument was provided by the user, use it:
PHASE_NUM=$1 # e.g., "02" or "2"
Otherwise, read the current phase from STATE.md:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" state get "Phase"
Extract the phase number (e.g., "2 of 5" -> "2"). Zero-pad to two digits.
Resolve the phase directory:
PHASE_PATH=$(ls -d "$PROJECT_DIR/.planning/phases/${PADDED_PHASE}-"* 2>/dev/null | head -1)
If it does not exist, error: "Phase directory not found for phase ${PADDED_PHASE}."
Check for RESEARCH.md:
RESEARCH_PATH="$PHASE_PATH/${PADDED_PHASE}-RESEARCH.md"
[ -f "$RESEARCH_PATH" ] && echo "Research found" || echo "No research -- will use ROADMAP.md phase section"
Determine the next plan number by counting existing PLAN.md files:
EXISTING_PLANS=$(ls "$PHASE_PATH"/*-PLAN.md 2>/dev/null | wc -l)
NEXT_PLAN=$((EXISTING_PLANS + 1))
PADDED_PLAN=$(printf "%02d" $NEXT_PLAN)
Collect paths to existing SUMMARY.md files for context:
EXISTING_SUMMARIES=$(ls "$PHASE_PATH"/*-SUMMARY.md 2>/dev/null)
Assemble the context file list for the planner:
$RESEARCH_PATH (or $PROJECT_DIR/.planning/ROADMAP.md if no research exists)$PROJECT_DIR/.planning/REQUIREMENTS.md$PROJECT_DIR/.planning/PROJECT.md$PHASE_PATH (phase directory path)$PADDED_PHASE-$PADDED_PLAN (plan identifier)$EXISTING_SUMMARIES paths (so planner knows what is already done)Spawn the dan-planner agent using the Task tool:
.claude/agents/dan-planner.md${PADDED_PHASE}-${PADDED_PLAN}-PLAN.md in ${PHASE_PATH}/"status: DRAFT"Wait for the planner to complete. The planner writes the PLAN.md file directly.
Verify the plan file was created:
PLAN_FILE="$PHASE_PATH/${PADDED_PHASE}-${PADDED_PLAN}-PLAN.md"
[ -f "$PLAN_FILE" ] && echo "Plan created" || echo "ERROR: Planner did not produce plan file"
Verify the plan frontmatter includes status: DRAFT:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" frontmatter parse "$PLAN_FILE"
Confirm status field is DRAFT. If missing, set it:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" frontmatter set "$PLAN_FILE" status DRAFT
Read the produced PLAN.md file and extract key information:
<objective> block)<task> elements)files_modified)requirements)Present a summary to the user:
## Plan ${PADDED_PHASE}-${PADDED_PLAN} Ready for Review
**Objective:** [extracted objective]
**Tasks:** [count] tasks
**Files:** [list of files_modified]
**Requirements:** [list of requirement IDs]
[Task list with names]
Approve this plan? (yes/no/revise)
Wait for user response:
a. On approval ("yes"): Transition the plan from DRAFT to APPROVED:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" frontmatter set "$PLAN_FILE" status APPROVED
b. On rejection with feedback ("revise" or "no" with comments):
c. On rejection without feedback ("no"):
/dan:plan to regenerate."
</step>
Update STATE.md to reflect the new plan:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" state set "Last activity" "$(date +%Y-%m-%d) -- Plan ${PADDED_PHASE}-${PADDED_PLAN} created and approved"
Commit the plan file:
node "$HOME/.claude/dan/bin/dan-tools.cjs" --cwd "$PROJECT_DIR" commit "plan(${PADDED_PHASE}-${PADDED_PLAN}): [brief objective from plan]" --files "$PLAN_FILE" "$PROJECT_DIR/.planning/STATE.md"
Inform the user of next steps:
Plan ${PADDED_PHASE}-${PADDED_PLAN} is approved and committed.
Next: Run `/dan:apply` to execute this plan.
</execution_flow>
data-ai
Core DAN workflow protocol and conventions injected into all agent contexts
testing
Spawn verifier agent to validate phase outputs against requirements and success criteria
tools
Close the loop on a completed plan by writing SUMMARY.md and updating state
tools
Show current project progress, blockers, and suggest the next action