Appearance
Getting Started with Spec-Driven Development
Introduction
This guide provides practical, hands-on instructions for getting started with specification-driven development (SDD) and the three major frameworks covered in this research: BMAD, SpecKit, and OpenSpec.
Whether you're implementing SDD for the first time or evaluating frameworks for your organization, this guide will help you move from theory to practice.
Core Concepts Quick Reference
Before diving into specific frameworks, ensure you understand these fundamental concepts:
Specification vs. Documentation
Traditional Documentation:
- Written after implementation
- Often becomes outdated
- Not executable or verifiable
- Separate from development workflow
SDD Specification:
- Written before or alongside implementation
- Automatically synchronized with code
- Executable and continuously verified
- Central to development workflow
Specification Formats
Natural Language (BDD-style):
gherkin
Feature: User Authentication
Scenario: Successful login
Given a registered user exists
When the user provides valid credentials
Then the user is authenticated
And the user is redirected to dashboardStructured (YAML):
yaml
specification:
name: user_authentication
behaviors:
- scenario: successful_login
preconditions:
- user_registered: true
actions:
- provide_credentials: valid
postconditions:
- user_authenticated: true
- redirect_to: dashboardAPI Contract:
json
{
"request": {
"method": "POST",
"path": "/auth/login",
"body": {
"email": "string",
"password": "string"
}
},
"response": {
"status": 200,
"body": {
"token": "string",
"user": "object"
}
}
}Verification Levels
Unit Level:
- Individual function/method specifications
- Fast execution (milliseconds)
- High volume
Integration Level:
- Component interaction specifications
- Medium execution (seconds)
- Moderate volume
End-to-End Level:
- Complete user scenario specifications
- Slow execution (minutes)
- Low volume
Choosing Your Framework
Quick Decision Guide
Answer these questions to narrow your framework choice:
1. Project Type?
- Greenfield (new project) → Consider BMAD or SpecKit
- Brownfield (existing code) → Consider OpenSpec
- Mixed → Consider OpenSpec or SpecKit
2. Team Size?
- Small (2-10) → OpenSpec
- Medium (10-50) → Any framework
- Large (50+) → SpecKit or BMAD
3. GitHub Native?
- Yes → SpecKit (best integration)
- No → BMAD or OpenSpec
4. Governance Requirements?
- High (regulated industry) → SpecKit
- Medium → Any framework
- Low → OpenSpec
5. Automation Preference?
- Maximum automation → BMAD
- Balanced → SpecKit
- Developer control → OpenSpec
Framework Selection Matrix
| Criteria | BMAD | SpecKit | OpenSpec |
|---|---|---|---|
| Greenfield | Excellent | Excellent | Good |
| Brownfield | Fair | Good | Excellent |
| GitHub Integration | Good | Excellent | Good |
| Automation Level | Very High | High | Medium |
| Learning Curve | Steep | Medium | Gentle |
| Resource Needs | High | Medium | Low |
Getting Started with BMAD
Prerequisites
- Python 3.9+
- Node.js 16+ (for certain agents)
- Docker (recommended for agent isolation)
- 8GB+ RAM (16GB recommended)
- GitHub account
Installation
bash
# Install BMAD CLI
pip install bmad-framework
# Verify installation
bmad --version
# Initialize project
bmad init my-project
cd my-projectProject Structure
my-project/
├── bmad.config.yaml # BMAD configuration
├── specs/ # Specification directory
│ ├── features/ # Feature specifications
│ ├── api/ # API specifications
│ └── components/ # Component specifications
├── agents/ # Custom agent configurations
└── output/ # Generated code and reportsFirst Specification
Create specs/features/user-registration.yaml:
yaml
specification:
name: user_registration
description: User registration workflow
agents:
- product_manager
- architect
- backend_developer
- qa_engineer
requirements:
- id: REQ-001
description: Users can register with email and password
priority: high
behaviors:
- scenario: successful_registration
given:
- email_format_valid: true
- email_not_registered: true
- password_meets_requirements: true
when:
- user_submits_registration_form
then:
- user_account_created: true
- confirmation_email_sent: true
- user_redirected_to_welcome_page: true
- scenario: duplicate_email_registration
given:
- email_already_registered: true
when:
- user_submits_registration_form
then:
- error_message_displayed: "Email already registered"
- user_account_not_created: trueRunning BMAD
bash
# Analyze specifications
bmad analyze specs/features/user-registration.yaml
# Generate implementation plan
bmad plan specs/features/user-registration.yaml
# Execute with agents
bmad execute specs/features/user-registration.yaml --agents=all
# Verify implementation
bmad verify specs/features/user-registration.yamlBMAD Agent Monitoring
bash
# View agent activity
bmad agents status
# Monitor specific agent
bmad agents logs backend_developer
# Agent performance metrics
bmad agents metricsNext Steps with BMAD
- Review generated code in
output/directory - Customize agent behaviors in
agents/directory - Add integration tests:
bmad test --level=integration - Set up CI/CD:
bmad ci-config generate
Getting Started with SpecKit
Prerequisites
- GitHub account and repository
- GitHub Actions enabled
- Git 2.30+
- Node.js 16+ or Python 3.8+ (language-dependent)
Installation
bash
# Install SpecKit CLI
npm install -g @github/speckit
# Or via Homebrew
brew install github/tap/speckit
# Verify installation
speckit --version
# Initialize in repository
cd your-repo
speckit initProject Structure
your-repo/
├── .speckit/
│ ├── constitution.yaml # Governance rules
│ ├── quality-gates.yaml # Pass/fail criteria
│ └── templates/ # Specification templates
├── specifications/
│ ├── features/
│ ├── apis/
│ └── components/
└── .github/
└── workflows/
└── speckit-verify.ymlFirst Constitution
Create .speckit/constitution.yaml:
yaml
constitution:
name: Development Constitution
version: 1.0.0
standards:
specification-format:
rule: All specifications must use Markdown with YAML frontmatter
enforcement: blocking
completeness:
rule: Specifications must include Given-When-Then scenarios
enforcement: blocking
review:
rule: Specifications require review from architect
enforcement: blocking
reviewers:
- architect-team
quality-gates:
coverage:
rule: Minimum 80% specification coverage
enforcement: warning
verification:
rule: All specifications must have passing tests
enforcement: blocking
change-governance:
breaking-changes:
rule: Breaking specification changes require approval
enforcement: blocking
approvers:
- tech-lead
- product-ownerFirst Specification
Create specifications/features/user-login.md:
markdown
---
id: SPEC-001
title: User Login
status: draft
owner: auth-team
reviewers: [architect-team, security-team]
---
# User Login Specification
## Overview
Users authenticate with email and password to access the application.
## Scenarios
### Scenario: Successful Login
**Given:** A registered user exists with email "user@example.com"
**And:** The user's account is active
**When:** The user provides correct email and password
**Then:** The user is authenticated
**And:** A session token is generated
**And:** The user is redirected to their dashboard
### Scenario: Invalid Credentials
**Given:** A registered user exists
**When:** The user provides incorrect password
**Then:** An error message is displayed
**And:** The user is not authenticated
**And:** No session token is generated
## API Contract
```yaml
endpoint: POST /auth/login
request:
body:
email: string (required)
password: string (required)
response:
success:
status: 200
body:
token: string
user:
id: number
email: string
error:
status: 401
body:
error: stringAcceptance Criteria
- [ ] Email validation follows RFC 5322
- [ ] Password is encrypted in transit and at rest
- [ ] Failed login attempts are rate-limited
- [ ] Account lockout after 5 failed attempts
### Running SpecKit
```bash
# Verify specifications against constitution
speckit verify
# Check specific specification
speckit verify specifications/features/user-login.md
# Generate coverage report
speckit coverage
# Create new specification from template
speckit new feature user-logoutGitHub Actions Integration
Create .github/workflows/speckit-verify.yml:
yaml
name: SpecKit Verification
on:
pull_request:
paths:
- 'specifications/**'
push:
branches: [main]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install SpecKit
run: npm install -g @github/speckit
- name: Verify Constitutional Compliance
run: speckit verify --constitution .speckit/constitution.yaml
- name: Check Coverage
run: speckit coverage --min 80
- name: Generate Report
run: speckit report --format html --output report.html
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: speckit-report
path: report.htmlNext Steps with SpecKit
- Customize constitution for your organization
- Create specification templates
- Set up automated reviews
- Configure quality gates
- Train team on specification authoring
Getting Started with OpenSpec
Prerequisites
- Python 3.8+ or Node.js 14+
- Existing codebase (brownfield focus)
- Git repository
Installation
bash
# Python installation
pip install openspec
# Node.js installation
npm install -g openspec
# Verify installation
openspec --version
# Initialize in existing project
cd your-project
openspec init --detectProject Structure
your-project/
├── openspec.config.yaml # Configuration
├── .openspec/
│ ├── specs/ # Specifications
│ ├── coverage/ # Coverage data
│ └── reports/ # Verification reports
└── (your existing code structure)Discovery and Extraction
bash
# Discover existing patterns
openspec discover --path ./src
# Extract specifications from code
openspec extract --input ./src --output .openspec/specs
# Extract from tests
openspec extract-tests --test-dir ./tests
# Generate API specifications
openspec extract-api --openapi ./swagger.jsonExample Extracted Specification
OpenSpec generates specifications from your code. Example output in .openspec/specs/user_service.yaml:
yaml
# Auto-generated by OpenSpec from existing code
specification:
name: user_service
source: src/services/user_service.py
extracted: 2026-01-07
confidence: high
functions:
- name: create_user
specification:
inputs:
email: string
password: string
outputs:
user: User
behaviors:
- validates_email_format
- hashes_password
- creates_database_record
- sends_confirmation_email
verification:
tests:
- test_create_user_success
- test_create_user_duplicate_email
- test_create_user_invalid_email
coverage: 85%Refining Specifications
bash
# Edit extracted specification
openspec edit .openspec/specs/user_service.yaml
# Validate refined specification
openspec validate .openspec/specs/user_service.yaml
# Run verification
openspec verify .openspec/specs/user_service.yamlManual Specification Enhancement
Edit .openspec/specs/user_service.yaml:
yaml
specification:
name: user_service
# Enhanced with business context
business_rules:
- Email must be unique across system
- Password must meet complexity requirements
- New users start in pending status
# Enhanced scenarios
scenarios:
- name: create_user_success
given:
- email_not_in_use: true
- password_meets_requirements: true
when:
- create_user_called
then:
- user_created_in_database: true
- confirmation_email_sent: true
- user_status: pending
# Define verification strategy
verification:
unit_tests: required
integration_tests: required
contract_tests: optionalContinuous Verification
bash
# Set up pre-commit hook
openspec hooks install
# Run verification
openspec verify --all
# Generate coverage report
openspec coverage --format html
# Incremental verification (only changed specs)
openspec verify --changedCI/CD Integration
Add to your existing CI pipeline (e.g., .github/workflows/ci.yml):
yaml
- name: OpenSpec Verification
run: |
pip install openspec
openspec verify --all
openspec coverage --min 75 --fail-underNext Steps with OpenSpec
- Review and refine auto-generated specifications
- Gradually increase specification coverage
- Add specifications for new features
- Configure enforcement levels
- Train team on specification refinement
Common Workflows
Workflow 1: Adding a New Feature
With BMAD:
bash
1. bmad spec create feature/new-checkout-flow
2. Edit specification in editor
3. bmad execute feature/new-checkout-flow
4. bmad verify feature/new-checkout-flow
5. Review and mergeWith SpecKit:
bash
1. speckit new feature checkout-flow
2. Edit specification in editor
3. git add specifications/features/checkout-flow.md
4. git commit -m "Add checkout flow specification"
5. Create PR (automatic verification runs)
6. Review and mergeWith OpenSpec:
bash
1. Write specification in .openspec/specs/checkout.yaml
2. openspec validate specs/checkout.yaml
3. Implement feature
4. openspec verify specs/checkout.yaml
5. Review and mergeWorkflow 2: Refactoring Existing Code
With BMAD:
bash
1. bmad analyze existing-component
2. Review specification gaps
3. bmad refactor existing-component --preserve-behavior
4. bmad verify existing-componentWith SpecKit:
bash
1. speckit extract existing-component
2. Review and enhance extracted specification
3. Implement refactoring
4. speckit verify (ensures behavior preserved)With OpenSpec:
bash
1. openspec extract --input ./src/component
2. openspec verify --baseline (capture current behavior)
3. Implement refactoring
4. openspec verify (compare against baseline)Workflow 3: API Contract Changes
With BMAD:
bash
1. Update API specification
2. bmad impact-analysis api-spec
3. bmad verify-contracts --all-consumers
4. Deploy with versioningWith SpecKit:
bash
1. Update API specification
2. Constitution validates breaking changes
3. Request approval from governance
4. speckit verify-contracts
5. Merge and deployWith OpenSpec:
bash
1. Update API specification
2. openspec contract-check --consumers
3. openspec generate-migration-guide
4. Coordinate with consumer teamsIntegration with Existing Tools
IDE Integration
VS Code:
- BMAD: Install "BMAD Framework" extension
- SpecKit: Install "GitHub SpecKit" extension
- OpenSpec: Install "OpenSpec" extension
IntelliJ/PyCharm:
- BMAD: Plugin available in JetBrains marketplace
- SpecKit: Limited support, use CLI
- OpenSpec: Plugin available
Git Hooks
Pre-commit:
bash
# BMAD
bmad hooks install
# SpecKit
speckit hooks install
# OpenSpec
openspec hooks installPre-push:
bash
# Run full verification before pushing
git config core.hooksPath .git-hooksCI/CD Platforms
GitHub Actions: All frameworks have official actions GitLab CI: CLI-based integration Jenkins: Plugin available for SpecKit, CLI for others CircleCI: CLI-based integration
Troubleshooting
Common Issues
BMAD Agent Failures:
bash
# Check agent logs
bmad agents logs <agent-name>
# Reset agent state
bmad agents reset <agent-name>
# Verify agent configuration
bmad agents validateSpecKit Constitutional Violations:
bash
# Show violation details
speckit verify --verbose
# Temporarily disable rule
speckit verify --ignore-rule <rule-name>
# Request constitution override
speckit override-request <specification-id>OpenSpec Extraction Issues:
bash
# Increase extraction confidence threshold
openspec extract --confidence 0.7
# Manual specification
openspec new --template manual
# Debug extraction
openspec extract --debug --verboseLearning Resources
Official Documentation
- BMAD: docs.bmad-framework.io
- SpecKit: docs.github.com/speckit
- OpenSpec: openspec.dev
Community
- BMAD: GitHub Discussions, Discord server
- SpecKit: GitHub Discussions, Slack channel
- OpenSpec: GitHub Discussions, Community forum
Training
- BMAD: Official certification course
- SpecKit: GitHub Skills course
- OpenSpec: Community tutorials
Next Steps
After completing this getting started guide:
- Read Framework Comparison to understand deeper differences
- Study Foundational Theory to understand the "why"
- Explore Adjacent Technologies to enhance your SDD practice
- Join Community discussions and share your experience
- Contribute to frameworks and documentation
Conclusion
Getting started with specification-driven development is an investment in code quality, team collaboration, and development velocity. Choose the framework that best fits your context, start small, and incrementally expand your specification coverage.
Remember:
- Start with high-value components
- Get team buy-in early
- Iterate on specification quality
- Automate verification continuously
- Share successes and learnings
This guide was created with AI assistance. Installation instructions and commands based on BMAD, SpecKit, and OpenSpec official documentation as of January 2026.