Claude Code Spec Workflow: Automated Spec-Driven Workflow for Claude Code
3 months ago
2
Automated spec-driven workflow for Claude Code. Transform feature ideas into complete implementations through Requirements → Design → Tasks → Implementation.
Install and run in any project directory:
npx @pimzino/claude-code-spec-workflow
That's it! The workflow will be automatically set up in your project.
# Run once in your project directory
npx @pimzino/claude-code-spec-workflow
# Test the setup
npx @pimzino/claude-code-spec-workflow test
# Install as dev dependency
npm install --save-dev @pimzino/claude-code-spec-workflow
# Run via package.json script
npx claude-spec-setup
The setup automatically creates:
📁 .claude/ directory structure with all necessary files
📝 7 slash commands for the complete workflow
🤖 Auto-generated task commands for each spec (NEW!)
📋 Document templates for consistent formatting
⚙️ Configuration files for workflow automation
🔧 Command generation scripts for dynamic task commands
📖 CLAUDE.md with comprehensive workflow instructions
1. Requirements Phase (/spec-requirements)
Generates user stories and acceptance criteria
Uses EARS format (WHEN/IF/THEN statements)
Ensures comprehensive requirement coverage
2. Design Phase (/spec-design)
Creates technical architecture and design
Includes Mermaid diagrams for visualization
Plans components, interfaces, and data models
3. Tasks Phase (/spec-tasks)
Breaks design into atomic coding tasks
References specific requirements
Focuses on test-driven development
4. Implementation Phase (/spec-execute)
Executes tasks systematically
Validates against requirements
Ensures quality and consistency
After setup, use these commands in Claude Code:
# Create a new feature spec
/spec-create user-authentication "Secure login system"# Generate requirements document
/spec-requirements
# Create design document
/spec-design
# Generate implementation tasks
/spec-tasks
# Execute specific tasks (two ways):
/spec-execute 1 # Traditional way
/user-authentication-task-1 # New auto-generated command# Execute subtasks
/user-authentication-task-2.1 # Auto-generated for subtasks# Check status
/spec-status
# List all specs
/spec-list
🆕 Auto-Generated Task Commands
The workflow now automatically creates individual commands for each task:
Easier execution: /user-auth-task-1 instead of /spec-execute 1 user-authentication
Better organization: Commands grouped by spec in .claude/commands/{spec-name}/
Auto-completion: Claude Code can suggest spec-specific commands
Clear purpose: Each command shows exactly what task it executes
# Setup in current directory
npx @pimzino/claude-code-spec-workflow
# Setup in specific directory
npx @pimzino/claude-code-spec-workflow --project /path/to/project
# Force overwrite existing files
npx @pimzino/claude-code-spec-workflow --force
# Skip confirmation prompts
npx @pimzino/claude-code-spec-workflow --yes
# Test the setup
npx @pimzino/claude-code-spec-workflow test
Works out of the box with any project
Auto-detects project type (Node.js, Python, Java, etc.)