Skip to content

odykyi/spec-driven-development-practice

Repository files navigation

SDD Training Platform

A progressive, hands-on platform for learning Spec-Driven Development (SDD). Similar to Exercism, but focused on teaching developers how to write effective specifications and prompts for AI-assisted development.

Overview

The SDD Training Platform provides:

  • Progressive Learning Tracks - Structured learning paths from basics to advanced patterns
  • Hands-on Exercises - Practice writing specifications with immediate feedback
  • Automated Validation - Check your specs against exercise requirements
  • CLI Tool - Work locally with offline support
  • Web Platform - Browser-based interface with in-browser editor
  • Community Mentoring - Get feedback from experienced practitioners

Quick Start

Prerequisites

  • Node.js 18+
  • pnpm 8+

Installation

# Navigate to the project directory
cd spec-driven-development-practice

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run the installer to set up offline workspace
pnpm install-openspec

πŸ–₯️ Demo

Initializing an Exercise (OpenSpec Workflow)

$ sdd init-exercise basics/hello-world

β ‹ Initializing exercise basics/hello-world...
βœ” Exercise basics/hello-world initialized!

Location: ~/sdd-exercises/openspec/changes/basics-hello-world

Next steps:
  cd ~/sdd-exercises/openspec/changes/basics-hello-world
  cat proposal.md    # Read exercise
  edit specs/spec.md # Write your spec
  openspec validate --change basics-hello-world

Checking OpenSpec Status

$ openspec status --change basics-hello-world

Change: basics-hello-world
Schema: spec-driven
Progress: 4/4 artifacts complete

[x] proposal
[x] design
[x] specs
[x] tasks

All artifacts complete!

Running OpenSpec Validation

$ openspec validate --change basics-hello-world

βœ… Validation PASS

All checks passed!

Downloading an Exercise

$ sdd download basics/hello-world

β ‹ Downloading exercise basics/hello-world...
βœ” Downloaded exercise basics/hello-world to ~/sdd-exercises/basics/hello-world

To get started:
  cd ~/sdd-exercises/basics/hello-world
  sdd test

Running Validation (Success)

$ cd ~/sdd-exercises/basics/hello-world
$ sdd test

β ‹ Running tests...
βœ… Validation PASS

Summary: 4/4 checks passed
  Duration: 23ms

Checks:
  βœ… Requirements Present: Found 2 requirement(s)
  βœ… Requirements Have Scenarios: All requirements have at least one scenario
  βœ… Scenarios Have WHEN/THEN: All scenarios have proper WHEN and THEN clauses
  βœ… Minimum Scenarios Count: Found 3 scenarios (minimum: 2)

πŸŽ‰ All checks passed! Ready to submit.

Running Validation (Failure)

$ sdd test

β ‹ Running tests...
❌ Validation FAIL

Summary: 2/4 checks passed
  Failed: 2
  Duration: 18ms

Checks:
  βœ… Requirements Present: Found 1 requirement(s)
  ❌ Requirements Have Scenarios: 1 requirement(s) missing scenarios: Greeting Function
  ❌ Scenarios Have WHEN/THEN: Scenarios missing WHEN/THEN: Greeting Function > Default greeting
  βœ… Minimum Scenarios Count: Found 1 scenarios (minimum: 1)

Fix the failing checks and run 'sdd test' again.

Submitting Your Solution

$ sdd submit

β ‹ Running validation...
βœ… Validation passed
βœ” Solution submitted successfully!

Validation Results:
βœ… All 4 checks passed

Run 'sdd sync' to upload to server.

Web Interface

The web platform provides a browser-based editor for writing specifications:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  SDD Training                                    Dashboard  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  Hello World                                                β”‚
β”‚  β—‹ easy                                            Start β†’  β”‚
β”‚                                                             β”‚
β”‚  Instructions    [Editor]                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ # Hello World                                       β”‚   β”‚
β”‚  β”‚                                                     β”‚   β”‚
β”‚  β”‚ ## ADDED Requirements                               β”‚   β”‚
β”‚  β”‚                                                     β”‚   β”‚
β”‚  β”‚ ### Requirement: Greeting Function                  β”‚   β”‚
β”‚  β”‚ The system SHALL provide...                         β”‚   β”‚
β”‚  β”‚                                                     β”‚   β”‚
β”‚  β”‚ #### Scenario: Default greeting                     β”‚   β”‚
β”‚  β”‚ - **WHEN** no name is provided                     β”‚   β”‚
β”‚  β”‚ - **THEN** return "Hello, World!"                  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                             β”‚
β”‚  [Validate]                                                 β”‚
β”‚                                                             β”‚
β”‚  βœ… Validation Passed                                       β”‚
β”‚  4/4 checks passed                                         β”‚
β”‚                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

CLI Usage

There are three ways to run the sdd CLI:

Option 1: From project directory (easiest for development)

# From the spec-driven-development-practice directory:
pnpm cli init-exercise basics/hello-world

# Navigate to OpenSpec change:
cd ~/sdd-exercises/openspec/changes/basics-hello-world

# Write your spec in specs/spec.md
# Then validate with OpenSpec:
openspec validate --change basics-hello-world

Option 2: Direct path to CLI (when in exercise directory)

cd ~/sdd-exercises/openspec/changes/basics-hello-world

# Use full path to CLI:
node /path/to/spec-driven-development-practice/packages/cli/dist/cli.js test
# Or use OpenSpec directly:
openspec validate --change basics-hello-world

Option 3: Create alias (recommended for daily use)

# Add to your ~/.zshrc or ~/.bashrc:
alias sdd='node /path/to/spec-driven-development-practice/packages/cli/dist/cli.js'

# Then reload your shell:
source ~/.zshrc  # or source ~/.bashrc

# Now you can use 'sdd' from anywhere:
sdd init-exercise basics/hello-world
cd ~/sdd-exercises/openspec/changes/basics-hello-world
openspec validate --change basics-hello-world
sdd submit

Common Commands:

sdd list                           # List all exercises
sdd init-exercise <exercise>       # Initialize exercise as OpenSpec change
openspec validate --change <name>  # Validate your spec
openspec status --change <name>    # Check completion status
sdd submit                         # Submit solution
openspec list                      # List all changes

Web Platform

# Start development server
pnpm dev

# Open http://localhost:3000

Project Structure

sdd-training/
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/           # Validation engine and shared types
β”‚   β”œβ”€β”€ cli/            # Command-line interface
β”‚   └── web/            # Next.js web platform
β”œβ”€β”€ exercises/          # Exercise definitions
β”œβ”€β”€ tracks/             # Track configurations
└── openspec/           # Project specifications

Development

Workspace Commands

# Run all tests
pnpm test

# Lint all packages
pnpm lint

# Format code
pnpm format

Package-specific Commands

# Core package
pnpm --filter @sdd-training/core test
pnpm --filter @sdd-training/core build

# CLI package
pnpm --filter @sdd-training/cli start

# Web package
pnpm --filter @sdd-training/web dev

Contributing

See CONTRIBUTING.md for guidelines on:

  • Adding new exercises
  • Creating learning tracks
  • Improving validation rules
  • Contributing to the platform

Documentation

License

MIT

About

Hands-on platform for learning Spec-Driven Development (SDD)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors