You are executing the Spec-Driven Development workflow — a standardized pre-development pipeline for large-scale complex tasks. Your job is to complete all preparation phases before any actual coding begins, ensuring the project has full analysis, a clear plan, trackable progress documents, and a task-specific SKILL.
| Path | Default Value | Purpose |
|---|---|---|
| Analysis output | docs/analysis/ |
Phase 1 analysis documents |
| Plan output | docs/plan/ |
Phase 2 planning documents |
| Progress output | docs/progress/ |
Phase 3 tracking documents (incl. MASTER.md) |
| Archive output | docs/archives/<project>/ |
Phase 6 archived artifacts |
| Sub-SKILL install | Project level (auto-detect) | Platform-specific: .cursor/skills/, .claude/commands/, or project-local |
Templates for all generated documents are in references/templates/. Behavioral rules are in references/behavioral-rules.md. The parallel execution protocol is in references/parallel-protocol.md.
CRITICAL: Before starting any phase, check if docs/progress/MASTER.md already exists in the project.
After loading your current state from MASTER.md, populate the platform's native task tracking tool (e.g. TodoWrite) with the active phase's pending tasks. For each task, set content to the task description, status to "in-progress" for the currently active task and "todo" for the rest, and priority mapped as P0=high, P1=medium, P2=low. This gives the user real-time visual progress in their IDE. If no native task tool is available, skip this step — MASTER.md alone is sufficient.
Goal: Understand exactly what the user wants to accomplish and eliminate all ambiguity.
Actions:
Identify the user's core intent from their message. Extract:
Ask the user structured clarifying questions. At minimum, confirm:
Summarize your understanding back to the user and get explicit confirmation before proceeding.
Output: A clear, confirmed task definition that will guide all subsequent phases.
Goal: Build a comprehensive understanding of the current codebase.
Actions:
Launch project-analyzer sub-agents in parallel to analyze the codebase concurrently. Split the work by focus area:
Provide each agent with the confirmed task definition from Phase 0 so they can assess findings in context of the target transformation.
If sub-agents are not available on the current platform, perform the analysis sequentially yourself — the scope is the same either way.
Consolidate agent outputs and resolve any contradictions or gaps. Write analysis documents to docs/analysis/ using the templates in references/templates/analysis.md:
project-overview.md — Architecture, tech stack, entry points, build systemmodule-inventory.md — Every module with: responsibility, dependencies, size, complexity ratingrisk-assessment.md — Technical risks, compatibility risks, complexity hotspotsOutput: Complete docs/analysis/ directory with three documents.
Goal: Break down the transformation into manageable, trackable tasks organized in phases, with explicit parallel execution lanes.
Actions:
Launch task-architect sub-agents with the full analysis output from Phase 1. If the project is large enough to warrant multiple strategies, launch 2 agents exploring different decomposition approaches (e.g., bottom-up vs. strangler fig) and pick the better result.
If sub-agents are not available, perform the decomposition yourself.
The decomposition must produce:
Write planning documents to docs/plan/ using the templates in references/templates/plan.md:
task-breakdown.md — All phases and tasks with full detail, including parallel lane assignmentsdependency-graph.md — Mermaid diagram showing task/phase dependencies and parallel lanesmilestones.md — Milestone definitions with target criteriaOutput: Complete docs/plan/ directory with three documents.
Goal: Create a document-driven progress tracking system that survives across conversations.
Actions:
Use the templates in references/templates/progress.md for all progress documents.
Create the master control file docs/progress/MASTER.md with:
Create one detailed progress file per phase: docs/progress/phase-N-<short-name>.md
- [ ] Task description
The MASTER.md format must follow this convention:
- [ ] Phase N: <name> (0/X tasks) [details](./phase-N-<name>.md)
- [x] Phase N: <name> (X/X tasks) [details](./phase-N-<name>.md)
Output: Complete docs/progress/ directory with MASTER.md and per-phase detail files.
Goal: Create a project-level SKILL tailored to this specific task, encoding the interaction patterns and development standards needed for the actual implementation work.
Actions:
The sub-SKILL is always installed at project level (e.g., .cursor/skills/, .claude/commands/, or project-local directory). Do not ask the user for installation location. This keeps the sub-SKILL co-located with the project it serves and avoids polluting the global skill space.
Determine what the sub-SKILL should contain (see references/templates/sub-skill.md for the full content outline):
references/super-philosophy.md — the architectural coding standard for all generated codereferences/parallel-protocol.md for the full protocolDelegate creation to the platform's native skill-creator:
skill-creator skill, providing it with the task context, the desired skill name, description, and content outline. Let the native tool handle the actual file generation and installation.The generated sub-SKILL should instruct the agent to:
docs/progress/MASTER.md at the start of every conversationOutput: A project-level task-specific SKILL.
Goal: Present all preparation artifacts to the user and confirm readiness to begin development.
Actions:
Present a structured summary to the user:
List all generated artifacts:
docs/analysis/project-overview.md
docs/analysis/module-inventory.md
docs/analysis/risk-assessment.md
docs/plan/task-breakdown.md
docs/plan/dependency-graph.md
docs/plan/milestones.md
docs/progress/MASTER.md
docs/progress/phase-N-*.md (one per phase)Ask the user: "All preparation is complete. Ready to begin Phase 1 development?"
Output: User confirmation to proceed with actual implementation.
Trigger: This phase activates when ALL checkboxes in docs/progress/MASTER.md are marked complete ([x]).
Goal: Archive all workflow artifacts for future reference and traceability, then clean up the working directories.
Actions:
Announce to the user that all tasks have been completed. Congratulate them.
Determine the archive directory name from the task name established in Phase 0. Sanitize it for use as a directory name (lowercase, hyphens instead of spaces, no special characters). The archive path is: docs/archives/<project-name>/. See references/templates/archive.md for the target directory structure and index template.
Create the archive directory structure and move all artifacts into it:
docs/analysis/ to docs/archives/<project-name>/analysis/
docs/plan/ to docs/archives/<project-name>/plan/
docs/progress/ to docs/archives/<project-name>/progress/
docs/archives/<project-name>/skill/SKILL.md
Create or update the archive index file docs/archives/README.md:
After archiving, remove the now-empty docs/analysis/, docs/plan/, and docs/progress/ directories from the project root's docs/ folder, and remove the sub-SKILL's original directory if it is now empty. Only docs/archives/ should remain under docs/.
Suggest to the user that they might want to commit the archive to version control.
Output: All artifacts preserved under docs/archives/<project-name>/, with an updated index at docs/archives/README.md.
All rules in references/behavioral-rules.md apply to every phase. Read and follow them.