spec-driven-dev
Original:🇺🇸 English
Translated
Spec-driven development framework with iterative refinement. Orchestrates feature development from intent to implementation via structured specs and task breakdown. Triggers on "/spec.plan", "/spec.refine", "/spec.clarify", "/spec.tasks", "/spec.run", "I want to build", "I want to add", "create spec", "spec-driven", "feature spec".
14installs
Sourcemauromedda/agent-toolkit
Added on
NPX Install
npx skill4agent add mauromedda/agent-toolkit spec-driven-devTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →ABOUTME: Spec-driven development orchestrator with subcommand interface
ABOUTME: Manages lifecycle: /spec.plan -> /spec.refine -> /spec.clarify -> /spec.tasks -> /spec.run
Spec-Driven Development
Iterative feature development framework ensuring zero ambiguity before execution.
Quick Reference
| Command | Purpose | Input |
|---|---|---|
| Create spec from "I want to build/add X" | Feature description |
| Improve spec with research/Gemini | Optional section focus |
| Answer clarification questions | Your response |
| Break spec into executable tasks | None (uses active spec) |
| Execute tasks with TDD | Optional task number |
Core Principle
Iterate until clarity: No task execution begins until ALL questions are resolved and the spec is unambiguous. Claude must be able to execute without interruptions.
Phase 1: /spec.plan
- Create Specification
/spec.planTrigger: or "I want to build/add X"
/spec.plan <description>Workflow
-
Checkfolder:
specs/- If missing: Create and
specs/specs/README.md - If exists: Read for project overrides
specs/README.md
- If missing: Create
-
Detect project context:
- Scan repo for language indicators (go.mod, pyproject.toml, package.json, etc.)
- Note primary language(s) for later skill invocation
- Check for language overrides
specs/README.md
-
Generate spec file:
- Filename: (kebab-case)
specs/{feature-slug}.md - Use template from
references/templates.md
- Filename:
-
Fill initial sections:
- Parse user intent into Objective
- List initial requirements (functional/non-functional)
- Mark status as
DRAFT
-
Generate clarifying questions:
- Identify ambiguities, edge cases, unknowns
- List as numbered questions in "Open Questions" section
- STOP and present questions to user
Output
Created: specs/feature-name.md (DRAFT)
Questions requiring clarification:
1. [Question about scope]
2. [Question about behavior]
3. [Question about constraints]
Use `/spec.clarify` to answer, or `/spec.refine` to research solutions.Phase 2: /spec.refine
- Research & Improve
/spec.refineTrigger: (e.g., , )
/spec.refine [section]/spec.refine solution/spec.refine requirementsWorkflow
-
Load active spec: Find most recent DRAFT spec in
specs/ -
Check project conventions:
- Read for behavior overrides
specs/README.md - Load relevant language skill (auto-detected or overridden)
- Load skill for architectural guidance
design-patterns
- Read
-
Research phase:
- If user requests Gemini:
gemini -m gemini-3-pro-preview "Analyze spec..." . - Search codebase for similar patterns
- Check skill references for best practices
- If user requests Gemini:
-
Update spec:
- Fill "Technical Strategy" with concrete approach
- Add architecture decisions with rationale
- Update requirements based on findings
-
Re-evaluate clarity:
- Are there new questions?
- Are existing questions resolved?
- If questions remain: STOP and present them
Gemini Integration (User-Invoked)
bash
# For design validation
/spec.refine --gemini "Review architecture approach"
# For alternative exploration
/spec.refine --gemini "What are alternatives to this solution?"Phase 3: /spec.clarify
- Answer Questions
/spec.clarifyTrigger: or
/spec.clarify <response>/spec.clarify Q1: answer, Q2: answerWorkflow
-
Load active spec with open questions
-
Parse user response:
- Match answers to numbered questions
- Accept free-form responses for single questions
-
Update spec:
- Move answered questions to relevant sections
- Add decisions/constraints to Requirements or Strategy
- Remove resolved questions from "Open Questions"
-
Check for new questions:
- Does the answer introduce new ambiguities?
- If questions remain: present them
- If no questions: announce spec is ready for
/spec.tasks
Example
User: /spec.clarify Q1: We need OAuth2 with Google provider only. Q2: No, admin can also delete.
Updated specs/auth-system.md:
- Added OAuth2/Google to Technical Strategy
- Updated permissions: admin can delete
Remaining questions: None
Spec is ready. Use `/spec.tasks` to create task breakdown.Phase 4: /spec.tasks
- Task Breakdown
/spec.tasksTrigger:
/spec.tasksPrerequisites
- Active spec must have status or
DRAFTAPPROVED - "Open Questions" section must be empty
- If questions exist: STOP and redirect to
/spec.clarify
Workflow
-
Validate spec readiness:
If open_questions > 0: ERROR: Spec has unresolved questions. Use /spec.clarify first. -
Mark spec as APPROVED
-
Generate task file:
specs/{feature-slug}.tasks.md -
Break down by component:
- Group tasks by logical component/module
- Each task = one logical unit (not TDD-granular)
- TDD practice enforced during , not here
/run
-
Add task metadata:
- Link back to spec
- Context summary
- Acceptance criteria per task
-
Final review:
- Present task list to user
- Ask: "Any tasks missing or need splitting?"
Task Granularity
Tasks should be high-level logical units:
- "Implement authentication middleware"
- "Create user model and repository"
- "Add API endpoints for user CRUD"
TDD cycle (Red-Green-Refactor) happens WITHIN each task during .
/spec.runPhase 5: /spec.run
- Execute Tasks
/spec.runTrigger: (e.g., , )
/spec.run [task#]/spec.run/spec.run 3Prerequisites
- Task file must exist:
specs/{feature}.tasks.md - If no task file: STOP and redirect to
/spec.tasks
Workflow
-
Load task file and find next unchecked task (or specified task#)
-
Load context:
- Read linked spec for requirements
- Read for project overrides
specs/README.md - Invoke appropriate language skill
-
Execute with TDD (per CLAUDE.md rules):
- RED: Write failing test first
- GREEN: Minimal code to pass
- REFACTOR: Clean up
- COMMIT: After each phase
-
Update task file:
- Mark task as complete
[x] - Add notes if needed
- Mark task as
-
Continue or pause:
- If more tasks: Ask "Continue to next task?"
- If blocked: Document blocker, ask for input
- If all done: Mark spec as
COMPLETED
Execution Rules
- No interruptions: If questions arise during execution, the spec was not ready
- Invoke skills: Auto-invoke ,
/python, etc. based on file type/golang - Respect hooks: Pre-commit hooks must pass before marking complete
- Gemini review: Follow CLAUDE.md thresholds (>100 lines or >3 files)
Project Configuration: specs/README.md
specs/README.mdOverride default behaviors per-project:
markdown
# Spec Configuration
## Language Override
Primary: golang
Secondary: python
## Conventions
- All specs require security section
- Tasks must include rollback plan
- Use feature branches: feature/{spec-name}
## Templates
Use custom templates from: ./templates/
## Auto-invoke
- Always run /trivy before marking complete
- Require /gemini-review for all specsState Management
Spec Status Flow
DRAFT -> APPROVED -> IN_PROGRESS -> COMPLETED
| |
v v
(questions?) (blocked?)
| |
v v
DRAFT IN_PROGRESSFile Structure
project/
└── specs/
├── README.md # Project overrides
├── auth-system.md # Spec (APPROVED)
├── auth-system.tasks.md # Task breakdown
├── user-dashboard.md # Spec (DRAFT)
└── ...Cross-Skill Integration
| When | Invoke |
|---|---|
Writing | |
Writing | |
Writing | |
Writing | |
Writing | |
| Architecture decisions | |
| User-requested review | |
Session Resume
On context compaction or session resume:
- Check for files with status
specs/IN_PROGRESS - Check files for unchecked items
.tasks.md - Report: "Found in-progress spec: X with Y tasks remaining"
- Ask: "Continue with ?"
/spec.run
Error Handling
| Situation | Response |
|---|---|
| "Spec has N unresolved questions. Use |
| "No task file found. Use |
| "No active spec. Use |
Ambiguity during | "Execution blocked: [issue]. Spec needs refinement. Use |
Templates
See for:
references/templates.md- Spec file template
- Task file template
- README.md template