plugins/specweave/skills/plan/SKILL.md
Generate plan.md and tasks.md for increment. Use when saying "create plan", "generate tasks", or "plan the increment".
npx skillsauth add anton-abyzov/specweave plugins/specweave/skills/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.
⚠️ FOR EXISTING INCREMENTS ONLY - NOT for creating new increments!
When to use sw:plan:
spec.md createdplan.md and tasks.mdWhen NOT to use sw:plan:
sw:increment insteadspec.md exists yet → Use sw:increment insteadGenerate plan.md and tasks.md for an increment using Architect Agent.
sw:plan # Auto-detect PLANNING increment
sw:plan 0039 # Explicit increment ID
sw:plan --force # Overwrite existing plan/tasks
sw:plan 0039 --verbose # Verbose output
Auto-detect increment (if not specified):
Validate pre-conditions:
Error Handling:
import { ERROR_MESSAGES, formatError } from './src/utils/error-formatter.js';
// If spec.md not found
if (!specExists) {
formatError(ERROR_MESSAGES.SPEC_NOT_FOUND(incrementId));
return;
}
// If increment not found
if (!incrementExists) {
formatError(ERROR_MESSAGES.INCREMENT_NOT_FOUND(incrementId));
return;
}
// If user tries to use sw:plan for NEW increments
if (userIsCreatingNew) {
formatError(ERROR_MESSAGES.WRONG_COMMAND_FOR_NEW_INCREMENT());
return;
}
Generate plan.md (via Architect Agent):
Generate tasks.md:
Update metadata:
Execution Strategy Recommendation (MANDATORY): After generating tasks.md, analyze complexity and output a recommendation:
6a. Count pending tasks in the generated tasks.md (count [ ] markers)
6b. Detect domains from file paths and task descriptions:
src/components/, src/pages/, src/hooks/, src/styles/, .tsx, .css, React/Vue/Angular keywordssrc/api/, src/services/, src/middleware/, src/routes/, Express/Fastify/NestJS keywordsprisma/, src/db/, migrations/, schema, SQL/Prisma keywordsDockerfile, .github/, k8s/, terraform/, CI/CD keywordstests/, e2e/, .test., .spec., test framework keywordssrc/auth/, authentication, authorization keywordsios/, android/, React Native keywords6c. Apply execution strategy matrix and output:
EXECUTION STRATEGY
══════════════════════════════════════════
Tasks: [N] pending | Domains: [N] ([list])
──────────────────────────────────────────
Recommended: sw:do (≤8 tasks, 1 domain)
Recommended: sw:auto (9-15 tasks, 1-2 domains)
Recommended: sw:team-lead (>15 tasks OR 3+ domains)
══════════════════════════════════════════
⚠️ sw:team-lead uses more tokens but produces higher quality
through parallel domain-specialized agents.
Next: sw:team-lead [ID] | sw:auto [ID] | sw:do [ID]
Show ONLY the matching recommendation line (not all three). For 3+ domains, add a stronger nudge:
⚡ This is a multi-domain feature. sw:team-lead is strongly recommended
for parallel execution across [domain1], [domain2], [domain3].
--force: Overwrite existing plan.md/tasks.md--preserve-task-status: Keep existing task completion status (requires --force)--verbose: Show detailed execution informationAuto-detect and plan:
sw:plan
# ✅ Auto-detected increment: 0039-ultra-smart-next-command
# ✅ Generated plan.md (2.5K)
# ✅ Generated tasks.md (4.2K, 15 tasks)
# ✅ Transitioned PLANNING → ACTIVE
Force regenerate:
sw:plan 0039 --force
# ⚠️ Overwriting existing plan.md
# ⚠️ Overwriting existing tasks.md
# ✅ Generated plan.md (2.8K)
# ✅ Generated tasks.md (5.1K, 18 tasks)
Multiple PLANNING increments:
sw:plan
# ❌ Multiple increments in PLANNING status found:
# - 0040-feature-a
# - 0041-feature-b
# Please specify: sw:plan 0040
🎯 OPTIONAL: Detect if planning for SpecWeave framework increment.
Before generating plan.md, check repository context:
import { detectSpecWeaveRepository } from './src/utils/repository-detector.js';
const repoInfo = detectSpecWeaveRepository(process.cwd());
if (repoInfo.isSpecWeaveRepo) {
console.log('ℹ️ Planning for SpecWeave framework increment');
console.log('');
console.log(' 💡 Framework Planning Considerations:');
console.log(' • Design for backward compatibility');
console.log(' • Consider impact on existing user projects');
console.log(' • Plan for migration guides if breaking');
console.log(' • Document new patterns in CLAUDE.md');
console.log(' • Add ADR for significant architectural changes');
console.log('');
}
Why This Helps: Planning for framework features requires different considerations than user apps:
Typical workflow:
# 1. Create increment (generates spec.md)
sw:increment "Add user authentication"
# Status: BACKLOG → PLANNING (spec.md created)
# 2. Edit spec.md (add requirements, ACs)
# ... edit spec.md ...
# 3. Generate plan and tasks
sw:plan
# Status: PLANNING → ACTIVE (tasks.md created)
# 4. Execute tasks
sw:do
spec.md not found:
❌ spec.md not found in increment '0039-ultra-smart-next-command'
💡 Create spec.md first using `sw:increment` or manually
plan.md already exists:
❌ plan.md already exists in increment '0039'
💡 Use --force to overwrite existing plan.md
Increment closed:
❌ Cannot generate plan for COMPLETED increment
💡 Reopen increment with `sw:reopen` first
Components:
IncrementDetector: Auto-detect or validate incrementPlanValidator: Validate pre-conditionsArchitectAgentInvoker: Generate plan.md via Architect AgentTaskGeneratorInvoker: Generate tasks.md with BDD test plansPlanCommandOrchestrator: Coordinate execution pipelineState transitions:
When the execution strategy analysis (Step 6) identifies 2+ viable execution approaches or when task dependency ordering has meaningful alternatives, use AskUserQuestion with the markdown preview field to show DAG diagrams of task dependencies.
When to use: Presenting execution strategy options where the task dependency graph helps visualize parallelism, critical path, or execution order trade-offs.
When NOT to use: When there's only one viable strategy, or when the choice is purely about tooling (e.g., sw:do vs sw:auto) without structural implications.
AskUserQuestion({
questions: [{
question: "Which execution strategy should we use for this increment?",
header: "Strategy",
multiSelect: false,
options: [
{
label: "Parallel (Recommended)",
description: "Frontend and backend in parallel, merge at integration. 2 parallel lanes.",
markdown: "T-001 [DB Schema] ──► T-003 [API Routes] ──┐\n ├──► T-006 [E2E Tests]\nT-002 [JWT Utils] ──► T-004 [Middleware] ──┘\n └──► T-005 [Frontend] ──► T-007 [Docs]\n\nCritical path: T-001 → T-003 → T-006\nParallel lanes: 2 | Tasks: 7"
},
{
label: "Sequential",
description: "All tasks in order. Simpler but slower, no parallelism.",
markdown: "T-001 [DB Schema] ──► T-002 [JWT Utils] ──► T-003 [API Routes]\n ──► T-004 [Middleware] ──► T-005 [Frontend]\n ──► T-006 [E2E Tests] ──► T-007 [Docs]\n\nCritical path: T-001 → T-002 → ... → T-007 (all)\nParallel lanes: 0 | Tasks: 7"
}
]
}]
})
sw:increment - Create new increment (generates spec.md)sw:do - Execute tasks from tasks.mdsw:validate - Validate increment structuresw:sync-docs - Sync spec changes to living docs--preserve-task-status to keep completion checkmarks when regeneratingPart of: Increment 0039 (Ultra-Smart Next Command) Status: Phase 1 - Foundation (US-007)
tools
Generate AI videos from text prompts or images. Supports Google Veo 3.1 and Pollinations.ai (free). Use when generating video, creating animations, text-to-video, AI video, video generation, make clip, animate.
tools
Validate increment with rule-based checks and AI quality assessment. Use when saying "validate", "check quality", or "verify increment".
tools
Create and manage umbrella workspaces for multi-repo projects. Activate when the user wants to: create umbrella, umbrella init, wrap in umbrella, create workspace, setup multi-repo, migrate repos to umbrella, umbrella create, new workspace, restructure into umbrella, "wrap this repo", "create umbrella for these repos", "setup workspace with repos", "move repos into umbrella". Do NOT activate for: add a repo to existing umbrella (use sw:get), add a feature, add an increment, clone a repo (use sw:get).
tools
--- description: Merge completed parallel agent work and trigger GitHub sync per increment. Activates for: team merge, merge agents, combine work, team finish. --- # Team Merge **Verify all teammates completed, run quality gates, close increments, and trigger sync.** ## Usage ```bash sw:team-merge sw:team-merge --dry-run # Preview merge plan sw:team-merge --skip-sync # Merge without GitHub/JIRA sync ``` ## What This Skill Does 1. **Verify all teammates completed** -- bl