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 3 planning documents |
| Progress output | docs/progress/ | Phase 4 tracking documents (incl. MASTER.md) |
| Archive output | docs/archives/<project>/ | Phase 7 archived artifacts |
| Sub-SKILL install | Project level (auto-detect) | Platform-specific: .cursor/skills/, .claude/commands/, or project-local |
| Task tracking mode | Auto-detect | GITHUB_FULL, GITHUB_STANDARD, or LOCAL_ONLY (see below) |
| Adaptive control | Enabled | Drift thresholds: annotate=20%, replan=40%, rescope=60% of phase tasks |
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. The GitHub integration protocol is in references/github-integration.md. The adaptive control protocol is in references/adaptive-control.md.
The workflow supports three task tracking modes, auto-detected via a pre-flight check in Phase 1:
| Mode | Requirements | Capabilities |
|---|---|---|
| GITHUB_FULL (default) | gh CLI + auth + project scope | Issues + Milestones + Labels + Project board + worktree + PR |
| GITHUB_STANDARD (auto-fallback) | gh CLI + auth + repo scope | Issues + Milestones + Labels + worktree + PR (no board) |
| LOCAL_ONLY (fallback) | None | Original local-file workflow |
See references/github-integration.md for the full protocol, gh command reference, and Issue body template.
CRITICAL: Before starting any phase, check if docs/progress/MASTER.md already exists in the project.
GITHUB_FULL, GITHUB_STANDARD, or LOCAL_ONLY) from the Mode field, which phase you are in, what has been completed, and continue from the exact point where the previous conversation left off. Do NOT restart from Phase 0.references/github-integration.md § "Reading Progress from GitHub". Update MASTER.md if the GitHub state is ahead of the local index.After loading your current state, 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: Capture the user's high-level transformation direction in 1-2 sentences — just enough to give Phase 1 analysis a focus, without deep clarification.
Actions:
Output: A preliminary direction statement that guides Phase 1's analysis focus. This is NOT the final task definition — that comes in Phase 2 after analysis.
Goal: Build a comprehensive understanding of the current codebase, informed by the preliminary direction from Phase 0.
Actions:
project-analyzer sub-agents in parallel to analyze the codebase concurrently. Split the work by focus area:Provide each agent with the preliminary direction from Phase 0 AND references/super-philosophy.md so they can assess findings against S.U.P.E.R principles in context of the intended transformation.
If sub-agents are not available on the current platform, perform the analysis sequentially yourself — the scope is the same either way.
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 rating, S.U.P.E.R compliance score per modulerisk-assessment.md — Technical risks, compatibility risks, complexity hotspots, S.U.P.E.R Architecture Health Summary with violation hotspotsreferences/github-integration.md § "Pre-flight Check" to determine the task tracking mode (GITHUB_FULL, GITHUB_STANDARD, or LOCAL_ONLY). Report the detected mode to the user. If the mode is not what they expect, explain what's missing and how to upgrade (e.g., gh auth refresh -s project).Output: Complete docs/analysis/ directory with three documents. The S.U.P.E.R assessment serves as the architectural baseline for all subsequent phases. The detected GitHub integration mode is communicated to the user.
Goal: With the project fully analyzed, engage the user in a grounded, high-quality discussion to finalize the task definition. The analysis from Phase 1 enables asking precise, informed questions that would have been impossible before understanding the codebase.
Actions:
At minimum, confirm:
Output: A clear, confirmed task definition grounded in project reality. This is the authoritative task definition that guides all subsequent phases (Phase 3-7).
Goal: Break down the transformation into manageable, trackable tasks organized in phases, with explicit parallel execution lanes.
Actions:
task-architect sub-agents with the full analysis output from Phase 1 AND the confirmed task definition from Phase 2 — including the S.U.P.E.R health assessment from risk-assessment.md. 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.
docs/plan/ using the templates in references/templates/plan.md:task-breakdown.md — All phases and tasks with full detail, including parallel lane assignments and S.U.P.E.R design constraintsdependency-graph.md — Mermaid diagram showing task/phase dependencies and parallel lanesmilestones.md — Milestone definitions with target criteriaLOCAL_ONLY mode):After writing the local plan documents, create the corresponding GitHub resources. Follow the commands and templates in references/github-integration.md. Execute in this order:
a. Create Labels — priority, size, phase, lane, and spec-driven labels (idempotent with --force)
b. Create Milestones — one per Phase, via gh api REST call
c. Create Issues — one per task, using the Issue body template from references/github-integration.md. Assign labels and milestone. Add a 1-second delay between creations to avoid rate limits.
d. [GITHUB_FULL only] Create Project board — create the Project, link it to the repo, create custom fields (Priority, Size, Phase), and add all Issues to the board. If custom field value assignment fails, log a warning and continue — the Labels already carry the same information.
After creation, record all GitHub resource URLs (Project URL, Milestone URLs, Issue number mapping) — these are needed for MASTER.md in Phase 4.
references/adaptive-control.md § 4):For each Milestone created, compute the percentage-based drift thresholds from the task count in that phase and append the adaptive control YAML block to the Milestone description:
```yaml
adaptive:
drift_score: 0
strategy: "
thresholds:
annotate:
replan:
rescope:
total_tasks:
completed_tasks: 0
last_updated: "
```
In LOCAL_ONLY mode, add the "Adaptive Control State" section to MASTER.md instead (see Phase 4).
Output: Complete docs/plan/ directory with three documents. Every task is annotated with its S.U.P.E.R design drivers. In GitHub modes, all tasks also exist as GitHub Issues with Labels and Milestones. Adaptive control state is initialized for each phase.
Goal: Create a progress tracking system that survives across conversations. The format depends on the detected tracking mode.
Actions:
Use the templates in references/templates/progress.md for all progress documents.
docs/progress/MASTER.md as a lightweight GitHub index with:GITHUB_FULL or GITHUB_STANDARD)owner/repo)gh commands for querying live progressThe MASTER.md in GitHub mode does NOT duplicate task details — those live in the GitHub Issues. It serves as a local index and entry point for cross-conversation continuity.
Additionally, include a lightweight "Execution Telemetry" reference section noting that per-task telemetry is stored in Issue comments (see references/adaptive-control.md § 4.3) and drift state lives in Milestone descriptions (§ 4.1). This tells the resuming agent where to look.
docs/progress/MASTER.md with:LOCAL_ONLYdocs/progress/phase-N-<short-name>.md- [ ] Task descriptionreferences/adaptive-control.md § 4.2). This is the primary adaptive state storage in LOCAL_ONLY mode, since Milestone descriptions are not available.references/adaptive-control.md § 4.2).- [ ] Phase N: <name> (0/X tasks) with a link to either the phase file (LOCAL_ONLY) or the milestone URL (GitHub modes)- [x] Phase N: <name> (X/X tasks)Output: Complete docs/progress/ directory with MASTER.md (and per-phase detail files in LOCAL_ONLY mode).
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:
.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.references/templates/sub-skill.md for the full content outline):references/super-philosophy.md, so the full five principles with litmus tests must be embedded directly in the sub-SKILL body. This is the #1 most important section.docs/analysis/risk-assessment.md that must be addressedreferences/parallel-protocol.md for the full protocolreferences/adaptive-control.md for telemetry collection, drift evaluation, and automatic response actions. The sub-SKILL MUST include the Post-Task Telemetry section (see references/templates/sub-skill.md § 9).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.docs/progress/MASTER.md at the start of every conversationcloses #N, and comment on the Issue. Progress is tracked via Issue state (open/closed).Output: A project-level task-specific SKILL.
Goal: Present all preparation artifacts to the user and confirm readiness to begin development.
Actions:
docs/analysis/project-overview.mddocs/analysis/module-inventory.mddocs/analysis/risk-assessment.mddocs/plan/task-breakdown.mddocs/plan/dependency-graph.mddocs/plan/milestones.mddocs/progress/MASTER.mddocs/progress/phase-N-*.md (LOCAL_ONLY mode, one per phase)Output: User confirmation to proceed with actual implementation.
Trigger: This phase activates when ALL tasks are complete — all Issues closed (GitHub modes) or all checkboxes marked [x] (LOCAL_ONLY mode).
Goal: Archive all workflow artifacts for future reference and traceability, then clean up the working directories.
Actions:
docs/archives/<project-name>/. See references/templates/archive.md for the target directory structure and index template.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.mddocs/archives/README.md: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/.Output: All artifacts preserved under docs/archives/<project-name>/, with an updated index at docs/archives/README.md. In GitHub modes, Milestones and Issues remain as a permanent record on GitHub.
All rules in references/behavioral-rules.md apply to every phase. Read and follow them.