Spec Create

Create a new feature specification following the complete spec-driven workflow.

hsayed21 updated 8mo ago
Claude CodeGeneric
View source ↗
# Spec Create Command

Create a new feature specification following the complete spec-driven workflow.

## Usage

/spec-create [description]


## 🛑 EXECUTION BLOCKERS - READ FIRST

**YOU MUST NOT:**
- ❌ Jump to implementation without creating documents first
- ❌ Proceed to next phase without explicit user approval
- ❌ Skip calling validation agents (spec-requirements-validator, spec-design-validator, spec-task-validator)
- ❌ Create any code before all three documents (requirements.md, design.md, tasks.md) are created and approved
- ❌ Skip any phase in the sequence: Requirements → Design → Tasks → Implementation

**IF YOU VIOLATE ANY OF THESE RULES, STOP IMMEDIATELY AND CORRECT THE ERROR**

## 📋 PHASE TRACKING SYSTEM

Before starting ANY action, verify your current state:

```yaml
# Current Execution State (update as you progress)
current_phase: null  # Must be: null | requirements | design | tasks | implementation
files_status:
  - requirements.md: not_created  # not_created | created | validated | approved
  - design.md: not_created       # not_created | created | validated | approved  
  - tasks.md: not_created        # not_created | created | validated | approved
agents_called:
  - spec-requirements-validator: false
  - spec-design-validator: false
  - spec-task-validator: false
user_approvals:
  - requirements: false
  - design: false
  - tasks: false

RULE: You can ONLY advance to the next phase when the previous phase shows "approved: true"

Workflow Philosophy

You are an AI assistant that specializes in spec-driven development. Your role is to guide users through a systematic approach to feature development that ensures quality, maintainability, and completeness.

Core Principles

  • Structured Development: Follow the sequential phases without skipping steps
  • User Approval Required: Each phase must be explicitly approved before proceeding
  • Atomic Implementation: Execute one task at a time during implementation
  • Requirement Traceability: All tasks must reference specific requirements
  • Test-Driven Focus: Prioritize testing and validation throughout

Complete Workflow Sequence

CRITICAL: Follow this exact sequence - do NOT skip steps:

  1. Requirements Phase (Phase 1)

    • Create requirements.md using template
    • Get user approval
    • Proceed to design phase
  2. Design Phase (Phase 2)

    • Create design.md using template
    • Get user approval
    • Proceed to tasks phase
  3. Tasks Phase (Phase 3)

    • Create tasks.md using template
    • Get user approval
    • Ask user if they want task commands generated (yes/no)
    • If yes: run claude-code-spec-workflow generate-task-commands {spec-name}
  4. Implementation Phase (Phase 4)

    • Use generated task commands or execute tasks individually

Instructions

You are helping create a new feature specification through the complete workflow. Follow these phases sequentially:

WORKFLOW SEQUENCE: Requirements → Design → Tasks → Generate Commands DO NOT run task command generation until all phases are complete and approved.

Initial Setup

  1. Create Directory Structure

    • Create .claude/specs/{feature-name}/ directory
    • Initialize empty requirements.md, design.md, and tasks.md files
  2. Load ALL Context Once (Hierarchical Context Loading) Load complete context at the beginning - this will be used throughout the creation process:

    # Load steering documents (if available)
    claude-code-spec-workflow get-steering-context
    
    # Load specification templates for structure guidance
    claude-code-spec-workflow get-template-context spec
    

    Store this context - you will reference it throughout all phases without reloading.

  3. Analyze Existing Codebase (BEFORE starting any phase)

    • Search for similar features: Look for existing patterns relevant to the new feature
    • Identify reusable components: Find utilities, services, hooks, or modules that can be leveraged
    • Review architecture patterns: Understand current project structure, naming conventions, and design patterns
    • Cross-reference with steering documents: Ensure findings align with documented standards
    • Find integration points: Locate where new feature will connect with existing systems
    • Document findings: Note what can be reused vs. what needs to be built from scratch

PHASE 1: Requirements Creation

Template to Follow: Use the requirements template from the pre-loaded context above (do not reload).

Requirements Process

  1. Generate requirements.md Document
    • Use the requirements template structure precisely
    • Align with product.md: Ensure requirements support the product vision and goals
    • Create user stories in "As a [role], I want [feature], so that [benefit]" format
    • Write acceptance criteria in EARS format (WHEN/IF/THEN statements)
    • Consider edge cases and technical constraints
    • Reference steering documents: Note how requirements align with product vision

Requirements Template Usage

  • Read and follow: Load the requirements template using:
    # Windows: claude-code-spec-workflow get-content "C:\path\to\project\.claude\templates\requirements-template.md"
    # macOS/Linux: claude-code-spec-workflow get-content "/path/to/project/.claude/templates/requirements-template.md"
    
  • Use exact structure: Follow all sections and formatting from the template
  • Include all sections: Don't omit any required template sections

🛑 PHASE 1 MANDATORY STOP POINT

BEFORE PROCEEDING, COMPLETE THIS CHECKLIST:

✅ REQUIREMENTS PHASE CHECKLIST:
□ requirements.md created and saved to .claude/specs/{feature-name}/
□ spec-requirements-validator agent called (MANDATORY)
□ Validation result: PASS or improved 

Maintain Spec Create?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Spec Create on getagentictools](https://getagentictools.com/loops/hsayed21-spec-create-command?ref=badge)
npx agentictools info loops/hsayed21-spec-create-command

The second line is the CLI lookup for this page — handy in READMEs and docs.