Get the FREE Ultimate OpenClaw Setup Guide →

spec-driven-development

Use Caution
npx machina-cli add skill Bosh-Kuo/awesome-agent-toolkit/spec-driven-development --openclaw
Files (1)
SKILL.md
5.6 KB

Spec Driven Development

This skill implements an AI-Spec-Driven Development workflow that emulates "Antigravity Planning Mode". Ideally suited for complex, multi-step engineering tasks, it drastically reduces "hallucinated" solutions by forcing a structured "Think, Plan, then Act" lifecycle.

Trigger

IMPORTANT: This skill is ONLY triggered when the AI model is explicitly requested by the user (e.g., "Use spec-driven-development", "Activate planning mode", "Create a spec for this").

  • Do NOT auto-trigger this skill for simple Q&A or minor bug fixes.
  • It is designed for tasks requiring architectural thought, multiple file changes, or a defined implementation strategy.

Directory Structure

The workflow isolates its artifacts in a hidden directory to keep the workspace clean.

<PROJECT_ROOT>/
├── .spec-driven-development-tasks/      # Hidden directory for all tasks
│   ├── {YYYYMMDD}-{TASK_TITLE}/         # Specific task folder
│   │   ├── spec.md                      # "The WHAT": Requirements, Context, Scope
│   │   ├── implementation.md            # "The HOW": Architecture, File Changes, Steps
│   │   ├── task.md                      # "The WHEN": Real-time checklist & logs
│   │   └── walk-through.md              # "The SUMMARY": Verification Guide, Handover
│   └── ...
├── .gitignore                           # Excludes .spec-driven-development-tasks
└── ...

Workflow Diagram

graph TD
    Start((Start)) -->|User Request| Phase1[1. Initialization Phase<br/>Run init_task.sh]
    Phase1 -->|AUTO-PROCEED| Phase2[2. Research & Planning Phase<br/>Analyze, Scan Code, Draft Docs]
    
    Phase2 --> Docs[Drafted Docs:<br/>spec.md, implementation.md, task.md]
    Docs -->|STOP & REPORT| Review{User Review}
    
    Review -->|2.1 Direct Execute| Phase3[3. Execution Phase<br/>Implement & Update task.md]
    Review -->|2.2 Adjust & Execute| AdjustDirect[Adjust Docs]
    AdjustDirect -->|AUTO-PROCEED| Phase3
    Review -->|2.3 Adjust & Review| AdjustConfirm[Adjust Docs]
    AdjustConfirm -->|STOP & REPORT| Review
    
    Phase3 --> AllDone{All Tasks Done?}
    AllDone -->|No: Continue Work| Phase3
    AllDone -->|Yes: AUTO-PROCEED| Phase4[4. Completion Phase<br/>Write walk-through.md]
    
    Phase4 -->|STOP & REPORT| End((Task Complete))
    
    End -.->|New Requirements| Phase2

Workflow Phases

1. Initialization Phase

Input: The user's natural language request (e.g., "Help me refactor the authentication module"). The user does not provide a specific task title; the Agent must analyze the request to generate one.

Process:

  1. Generate a Task Title (e.g., refactor-auth-module).
  2. Run Script: Call skills/spec-driven-development/scripts/init_task.sh <TASK_TITLE>.
    • Ensures .spec-driven-development-tasks exists and is added to .gitignore.
    • Note: The user must have "Gitignore Access" enabled for the AI tool to modify .gitignore and files within ignored directories.
    • Creates {YYYYMMDD}-{TASK_TITLE} directory with 4 empty template files.

Output: A clean, isolated workspace for the task.

Transition: AUTO-PROCEED to Phase 2. Do not stop to report "Initialization Complete".

2. Deep Research & Planning Phase

Input: The initialized workspace and user requirements.

Process:

  1. Deep Research: Scan relevant code/docs to understand the current system (avoid blind full-repo scans).
  2. Draft Documentation: Fill the empty files using templates:
    • spec.md: Context, Requirements, Scope (from templates/spec-template.md).
    • implementation.md: Architecture, Implementation Steps (from templates/implementation-template.md).
    • task.md: TODO Checklist (from templates/task-template.md).

Output: Drafted specification and planning documents.

Transition: STOP & REPORT. Present the plan to the user with exactly these 3 options:

  • 2.1. Execute Immediately: User agrees -> Proceed to Phase 3.
  • 2.2. Adjust & Execute: User gives minor feedback -> Update docs -> Proceed to Phase 3 (no second confirmation).
  • 2.3. Adjust & Review: User gives major feedback -> Update docs -> STOP & REPORT (ask for confirmation again).

3. Execution Phase

Input: Approved spec.md, implementation.md, task.md.

Process:

  1. Execute: Write code according to implementation.md.
  2. Real-time Update: Mark items in task.md as [x] immediately upon completion.
  3. Check Completion: Continue until all items in task.md are checked.

Output: Completed implementation and updated task.md.

Transition: AUTO-PROCEED to Phase 4 immediately after all tasks are done. Do not stop to ask "Ready for next phase?".

4. Completion & Archiving Phase

Input: Finished code and completed task.md.

Process:

  1. Summarize: Create walk-through.md using templates/walk-through-template.md.
  2. Iterative Requirement Handling:
    • If user provides New Requirements after this phase:
    • Return to Phase 2 (Option 2.2 Trigger) workflow.
    • Retain old content in docs.
    • Append new scope to docs.
    • Resume at Phase 3.

Output: Final project summary.

Transition: STOP & REPORT. Inform the user the task is fully complete and present the walk-through.md.

Source

git clone https://github.com/Bosh-Kuo/awesome-agent-toolkit/blob/main/skills/spec-driven-development/SKILL.mdView on GitHub

Overview

Spec-driven development is an AI workflow that emulates Antigravity Planning Mode for complex, multi-step tasks. It emphasizes a Think-Plan-Act lifecycle with a strict Spec -> Implementation -> Task Tracking progression, activated only when explicitly requested. This reduces hallucinations and improves architectural rigor by isolating work in a hidden, organized workspace.

How This Skill Works

When triggered by user request, the agent generates a task title, initializes a hidden workspace under .spec-driven-development-tasks, and transitions into Deep Research & Planning. It drafts spec.md, implementation.md, and task.md using templates, then proceeds through iterative execution with user reviews, updating task.md and walk-throughs as work progresses.

When to Use It

  • When the user explicitly asks to activate planning mode or use spec-driven-development
  • For architecture-level tasks that require multi-file changes or a defined implementation strategy
  • When tasks are complex and susceptible to hallucinations without a formal spec-first approach
  • When creating a formal spec for handover or external review
  • When tasks require traceable verification and a documented workflow from spec to implementation to task logs

Quick Start

  1. Step 1: User requests planning mode (e.g., 'Use spec-driven-development' or 'Activate planning mode')
  2. Step 2: Agent generates a task title and runs init_task.sh <TASK_TITLE> to create the hidden workspace with template files
  3. Step 3: Agent enters Deep Research & Planning, drafting spec.md, implementation.md, and task.md, then awaits user review

Best Practices

  • Require an explicit user trigger to engage the spec-driven workflow
  • Generate a precise, URL-safe Task Title (e.g., refactor-auth-module)
  • Keep all artifacts isolated under a hidden directory: .spec-driven-development-tasks
  • Populate spec.md and implementation.md from templates to ensure consistency
  • Use task.md and walk-through to capture real-time progress, verification steps, and handover notes

Example Use Cases

  • Refactor authentication module to add a multi-factor flow with minimal API surface changes
  • Design a new user analytics microservice with defined data contracts and event schemas
  • Migrate a relational schema to a backward-compatible version with data migration scripts
  • Implement a cross-service feature flag system with centralized configuration
  • Consolidate logging and observability across multiple modules for unified dashboards

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers