sdd-pipeline 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -0
- package/bin/sdd.js +51 -0
- package/lib/bundle/.claude/commands/sdd-bmad.md +71 -0
- package/lib/bundle/.claude/commands/sdd-converge.md +26 -0
- package/lib/bundle/.claude/commands/sdd-init.md +35 -0
- package/lib/bundle/.claude/commands/sdd-spec.md +52 -0
- package/lib/bundle/.claude/commands/sdd-tasks.md +38 -0
- package/lib/bundle/.github/workflows/converge.yml +81 -0
- package/lib/bundle/.sdd/config.json +28 -0
- package/lib/bundle/.sdd/smoke-test.ps1 +19 -0
- package/lib/bundle/.sdd/tool-versions.json +6 -0
- package/lib/bundle/CLAUDE.md +29 -0
- package/lib/bundle/commands/sdd-status.ps1 +59 -0
- package/lib/bundle/converge/validation.md +20 -0
- package/lib/bundle/extensions/README.md +46 -0
- package/lib/bundle/extensions/sdd-api/SPEC.template.md +48 -0
- package/lib/bundle/extensions/sdd-api/prompts/api-design.md +15 -0
- package/lib/bundle/extensions/sdd-api/validation/api-checklist.md +24 -0
- package/lib/bundle/extensions/sdd-api/validation/openapi-rules.spectral.yaml +11 -0
- package/lib/bundle/extensions/sdd-backend/SPEC.template.md +52 -0
- package/lib/bundle/extensions/sdd-backend/prompts/data-model.md +15 -0
- package/lib/bundle/extensions/sdd-backend/validation/backend-checklist.md +23 -0
- package/lib/bundle/extensions/sdd-frontend/SPEC.template.md +49 -0
- package/lib/bundle/extensions/sdd-frontend/prompts/ux-design.md +13 -0
- package/lib/bundle/extensions/sdd-frontend/validation/frontend-checklist.md +26 -0
- package/lib/bundle/run-converge.ps1 +141 -0
- package/lib/bundle/templates/BMAD-brief.template.md +35 -0
- package/lib/bundle/templates/CONSTITUTION.template.md +29 -0
- package/lib/bundle/templates/PLAN.template.md +33 -0
- package/lib/bundle/templates/README.md +18 -0
- package/lib/bundle/templates/SPEC.template.md +46 -0
- package/lib/bundle/templates/TASKS.template.md +24 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# XDM Method — SDD Pipeline for Claude Code
|
|
2
|
+
|
|
3
|
+
Spec-Driven Development pipeline that transforms raw feature requests into validated, shipped code through a self-correcting converge loop.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```powershell
|
|
8
|
+
# 1. Initialize (if new project)
|
|
9
|
+
claude "/sdd-init"
|
|
10
|
+
|
|
11
|
+
# 2. Brainstorm — generate structured brief
|
|
12
|
+
claude "/sdd-bmad <feature description>"
|
|
13
|
+
|
|
14
|
+
# 3. Generate SPEC.md
|
|
15
|
+
claude "/sdd-spec"
|
|
16
|
+
|
|
17
|
+
# 4. Generate TASKS.md
|
|
18
|
+
claude "/sdd-tasks"
|
|
19
|
+
|
|
20
|
+
# 5. Implement tasks
|
|
21
|
+
|
|
22
|
+
# 6. Validate (auto in CI, or manually)
|
|
23
|
+
pwsh run-converge.ps1 -Url "http://localhost:3000" -Strict
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Pipeline Phases
|
|
27
|
+
|
|
28
|
+
| Phase | Command | Output |
|
|
29
|
+
|-------|---------|--------|
|
|
30
|
+
| 0: BMAD | `/sdd-bmad` | BMAD-brief.md |
|
|
31
|
+
| 2: Spec | `/sdd-spec` | SPEC.md |
|
|
32
|
+
| 3: Tasks | `/sdd-tasks` | TASKS.md |
|
|
33
|
+
| 5: Converge | `/sdd-converge` | converge/validation.md |
|
|
34
|
+
|
|
35
|
+
## Key Features
|
|
36
|
+
|
|
37
|
+
- **Phase gates:** `/sdd-spec` fails if BMAD-brief.md missing — no bypass
|
|
38
|
+
- **Prompt injection protection:** All user input sanitized before LLM embedding
|
|
39
|
+
- **SSRF protection:** URL validation blocks private IPs, localhost, cloud metadata endpoints
|
|
40
|
+
- **Dev server health check:** 60s timeout with retry before Lighthouse runs
|
|
41
|
+
- **GitHub Actions CI:** Runs converge on push/PR, creates Issue on failure
|
|
42
|
+
- **Domain extensions:** API, frontend, backend — set via `.sdd/config.json`
|
|
43
|
+
|
|
44
|
+
## Status
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
pwsh commands/sdd-status.ps1 # Quick status
|
|
48
|
+
pwsh commands/sdd-status.ps1 --Verify # Full verification
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Architecture
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Raw Idea -> /sdd-bmad -> BMAD-brief.md
|
|
55
|
+
-> /sdd-spec -> SPEC.md
|
|
56
|
+
-> /sdd-tasks -> TASKS.md
|
|
57
|
+
-> Implement
|
|
58
|
+
-> run-converge.ps1 -> converge/validation.md
|
|
59
|
+
|
|
|
60
|
+
+-- PASS: merge
|
|
61
|
+
+-- FAIL: fix -> re-enter
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Files
|
|
65
|
+
|
|
66
|
+
| Path | Purpose |
|
|
67
|
+
|------|---------|
|
|
68
|
+
| `.sdd/config.json` | Pipeline state, template versions |
|
|
69
|
+
| `templates/` | SDD artifact templates |
|
|
70
|
+
| `.claude/commands/` | Claude Code slash commands |
|
|
71
|
+
| `run-converge.ps1` | Converge validation script |
|
|
72
|
+
| `.github/workflows/converge.yml` | CI/CD pipeline |
|
|
73
|
+
| `extensions/` | Domain-specific extensions |
|
|
74
|
+
|
|
75
|
+
## Extensions
|
|
76
|
+
|
|
77
|
+
Enable via `.sdd/config.json` `project.domain`:
|
|
78
|
+
- `api` — OpenAPI spec, endpoint validation
|
|
79
|
+
- `frontend` — design system, Lighthouse targets
|
|
80
|
+
- `backend` — data models, security requirements
|
|
81
|
+
|
|
82
|
+
## Requirements
|
|
83
|
+
|
|
84
|
+
- Windows 11 + PowerShell (primary), Bash (fallback)
|
|
85
|
+
- Git, Node.js, npm
|
|
86
|
+
- Claude Code CLI
|
|
87
|
+
|
|
88
|
+
See [docs/spec-pipeline-synthesis.md](docs/spec-pipeline-synthesis.md) for full pipeline specification.
|
package/bin/sdd.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// sdd — Spec-Driven Development CLI
|
|
3
|
+
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const fs = require('fs')
|
|
6
|
+
const init = require('../lib/init')
|
|
7
|
+
const bmad = require('../lib/bmad')
|
|
8
|
+
const config = require('../lib/config')
|
|
9
|
+
|
|
10
|
+
const args = process.argv.slice(2)
|
|
11
|
+
const cmd = args[0]
|
|
12
|
+
|
|
13
|
+
switch (cmd) {
|
|
14
|
+
case 'init':
|
|
15
|
+
init.run()
|
|
16
|
+
break
|
|
17
|
+
case 'bmad':
|
|
18
|
+
bmad.run(args.slice(1).join(' '))
|
|
19
|
+
break
|
|
20
|
+
case 'spec':
|
|
21
|
+
console.log('Run: claude "/sdd-spec" to generate SPEC.md')
|
|
22
|
+
break
|
|
23
|
+
case 'tasks':
|
|
24
|
+
console.log('Run: claude "/sdd-tasks" to generate TASKS.md')
|
|
25
|
+
break
|
|
26
|
+
case 'converge':
|
|
27
|
+
console.log('Run: pwsh run-converge.ps1 -Strict to run converge')
|
|
28
|
+
break
|
|
29
|
+
case 'status':
|
|
30
|
+
config.printStatus()
|
|
31
|
+
break
|
|
32
|
+
case 'help':
|
|
33
|
+
default:
|
|
34
|
+
if (cmd && cmd !== 'help') {
|
|
35
|
+
console.error(`Unknown command: ${cmd}\n`)
|
|
36
|
+
}
|
|
37
|
+
console.log(`
|
|
38
|
+
sdd — Spec-Driven Development CLI
|
|
39
|
+
|
|
40
|
+
Usage:
|
|
41
|
+
sdd init Initialize SDD pipeline in current directory
|
|
42
|
+
sdd bmad <description> Generate BMAD brief
|
|
43
|
+
sdd status Show pipeline phase status
|
|
44
|
+
sdd help Show this help
|
|
45
|
+
|
|
46
|
+
Full pipeline (requires Claude Code):
|
|
47
|
+
claude "/sdd-spec" Generate SPEC.md
|
|
48
|
+
claude "/sdd-tasks" Generate TASKS.md
|
|
49
|
+
pwsh run-converge.ps1 Run converge validation
|
|
50
|
+
`)
|
|
51
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
# SDD BMAD — Brainstorm, Multi-Agent, Define
|
|
3
|
+
---
|
|
4
|
+
tool: Bash
|
|
5
|
+
when: always
|
|
6
|
+
---
|
|
7
|
+
# Phase 0: BMAD multi-perspective brief generator
|
|
8
|
+
|
|
9
|
+
function Sanitize-UserInput {
|
|
10
|
+
param([string]$Input)
|
|
11
|
+
$sanitized = $Input -replace '(?i)(ignore previous|disregard|system:|</?script)', '[FILTERED]'
|
|
12
|
+
$sanitized = $sanitized -replace '(?i)ignore all previous instructions', '[FILTERED]'
|
|
13
|
+
return $sanitized.Trim()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$rawInput = $args -join ' '
|
|
17
|
+
if (-not $rawInput) {
|
|
18
|
+
Write-Host "Usage: /sdd-bmad <feature description>"
|
|
19
|
+
exit 1
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$sanitizedInput = Sanitize-UserInput -Input $rawInput
|
|
23
|
+
Write-Host "Generating BMAD brief..."
|
|
24
|
+
Write-Host "Input sanitized. Prompt injection protection active."
|
|
25
|
+
|
|
26
|
+
$date = Get-Date -Format 'yyyy-MM-dd'
|
|
27
|
+
$expiry = (Get-Date).AddDays(30).ToString('yyyy-MM-dd')
|
|
28
|
+
|
|
29
|
+
@"
|
|
30
|
+
# BMAD Brief — [Project Name]
|
|
31
|
+
|
|
32
|
+
> Generated: $date. Expires: $expiry.
|
|
33
|
+
|
|
34
|
+
## Input
|
|
35
|
+
> $sanitizedInput
|
|
36
|
+
|
|
37
|
+
## PM Perspective
|
|
38
|
+
**Target user:** [Who benefits most from this feature]
|
|
39
|
+
**User needs:** [Top 3 needs this feature addresses]
|
|
40
|
+
**Primary conversion action:** [What user does that matters to business]
|
|
41
|
+
|
|
42
|
+
## Architect Perspective
|
|
43
|
+
**Minimum viable approach:** [One paragraph — simplest thing that works]
|
|
44
|
+
**Technical risks:**
|
|
45
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
46
|
+
|------|-----------|--------|------------|
|
|
47
|
+
| [Risk 1] | [H/M/L] | [H/M/L] | [How to mitigate] |
|
|
48
|
+
|
|
49
|
+
## UX Perspective
|
|
50
|
+
**First impression goal:** [What the user experiences in first 30 seconds]
|
|
51
|
+
**Microcopy needed:** [List key phrases, error messages, labels]
|
|
52
|
+
|
|
53
|
+
## Synthesis
|
|
54
|
+
**What we're building:** [2-3 sentences describing the feature]
|
|
55
|
+
|
|
56
|
+
**What we're NOT building:** [Explicit exclusions — prevents scope creep]
|
|
57
|
+
1. [Not building this]
|
|
58
|
+
2. [Not building this]
|
|
59
|
+
|
|
60
|
+
## Open Questions
|
|
61
|
+
| # | Question | Impact |
|
|
62
|
+
|---|----------|--------|
|
|
63
|
+
| 1 | [Question] | [Blocking?] |
|
|
64
|
+
|
|
65
|
+
## Prompt Injection Check
|
|
66
|
+
- Input was sanitized before processing
|
|
67
|
+
- No system prompt overrides accepted
|
|
68
|
+
"@ | Set-Content "BMAD-brief.md" -Encoding UTF8
|
|
69
|
+
|
|
70
|
+
Write-Host "BMAD-brief.md created successfully." -ForegroundColor Green
|
|
71
|
+
Write-Host "Next: Run /sdd-spec to generate SPEC.md"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Run SDD Converge validation
|
|
2
|
+
---
|
|
3
|
+
tool: Bash
|
|
4
|
+
when: always
|
|
5
|
+
---
|
|
6
|
+
$required = @("SPEC.md", "PLAN.md", "TASKS.md", "CONSTITUTION.md")
|
|
7
|
+
$missing = @()
|
|
8
|
+
foreach ($file in $required) {
|
|
9
|
+
if (!(Test-Path $file)) {
|
|
10
|
+
Write-Host "ERROR: $file not found" -ForegroundColor Red
|
|
11
|
+
$missing += $file
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if ($missing.Count -gt 0) {
|
|
15
|
+
Write-Host "Missing artifacts: $($missing -join ', ')" -ForegroundColor Red
|
|
16
|
+
Write-Host "Run /sdd-init and complete all phases first."
|
|
17
|
+
exit 1
|
|
18
|
+
}
|
|
19
|
+
Write-Host "All required artifacts verified." -ForegroundColor Green
|
|
20
|
+
Write-Host "Running converge validation..."
|
|
21
|
+
Write-Host "Run: pwsh run-converge.ps1 -Url 'http://localhost:3000' -Strict"
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# Run converge automation: pwsh run-converge.ps1
|
|
26
|
+
# This is wired up in Phase 5
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Initialize a new SDD project
|
|
2
|
+
---
|
|
3
|
+
tool: Bash
|
|
4
|
+
when: always
|
|
5
|
+
---
|
|
6
|
+
New-Item -ItemType Directory -Force -Path ".sdd", "templates", "converge", ".claude/commands" | Out-Null
|
|
7
|
+
|
|
8
|
+
$config = @{
|
|
9
|
+
version = "1.0"
|
|
10
|
+
phases = @{
|
|
11
|
+
current = 0
|
|
12
|
+
phase0 = @{ status = "pending"; brief = "BMAD-brief.md" }
|
|
13
|
+
phase1 = @{ status = "pending" }
|
|
14
|
+
phase2 = @{ status = "pending"; specFile = "SPEC.md" }
|
|
15
|
+
phase3 = @{ status = "pending"; tasksFile = "TASKS.md" }
|
|
16
|
+
phase4 = @{ status = "pending" }
|
|
17
|
+
phase5 = @{ status = "pending"; validationFile = "converge/validation.md" }
|
|
18
|
+
}
|
|
19
|
+
templateVersions = @{
|
|
20
|
+
constitution = "1.0.0"
|
|
21
|
+
bmad = "1.0.0"
|
|
22
|
+
spec = "1.0.0"
|
|
23
|
+
plan = "1.0.0"
|
|
24
|
+
tasks = "1.0.0"
|
|
25
|
+
}
|
|
26
|
+
project = @{ name = "TODO"; domain = "general" }
|
|
27
|
+
settings = @{ autoConverge = $false; strictMode = $true; maxTaskHours = 2 }
|
|
28
|
+
}
|
|
29
|
+
$config | ConvertTo-Json | Set-Content ".sdd/config.json"
|
|
30
|
+
|
|
31
|
+
Write-Host "SDD project initialized." -ForegroundColor Green
|
|
32
|
+
Write-Host "Phase: 0 (BMAD)"
|
|
33
|
+
Write-Host "Run /sdd-bmad <feature description> to start."
|
|
34
|
+
|
|
35
|
+
---
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Generate SPEC.md from BMAD brief
|
|
2
|
+
---
|
|
3
|
+
tool: Bash
|
|
4
|
+
when: always
|
|
5
|
+
---
|
|
6
|
+
# Phase 0 Gate: Verify BMAD-brief.md exists
|
|
7
|
+
if (!(Test-Path "BMAD-brief.md")) {
|
|
8
|
+
Write-Host "ERROR: Phase 0 not complete."
|
|
9
|
+
Write-Host "BMAD-brief.md not found."
|
|
10
|
+
Write-Host "Run /sdd-bmad first."
|
|
11
|
+
exit 1
|
|
12
|
+
}
|
|
13
|
+
Write-Host "Phase 0 gate: BMAD-brief.md verified" -ForegroundColor Green
|
|
14
|
+
|
|
15
|
+
# Verify template exists
|
|
16
|
+
if (!(Test-Path "templates/SPEC.template.md")) {
|
|
17
|
+
Write-Host "ERROR: templates/SPEC.template.md not found. Run Phase 2."
|
|
18
|
+
exit 1
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# Prompt injection protection
|
|
22
|
+
function Sanitize-UserInput {
|
|
23
|
+
param([string]$Input)
|
|
24
|
+
$sanitized = $Input -replace '(?i)(ignore previous|disregard|system:|</?script)', '[FILTERED]'
|
|
25
|
+
$sanitized = $sanitized -replace '(?i)ignore all previous instructions', '[FILTERED]'
|
|
26
|
+
return $sanitized.Trim()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$rawBrief = Get-Content "BMAD-brief.md" -Raw
|
|
30
|
+
$sanitizedBrief = Sanitize-UserInput -Input $rawBrief
|
|
31
|
+
Write-Host "Generating SPEC.md from BMAD-brief.md..."
|
|
32
|
+
|
|
33
|
+
# Update config
|
|
34
|
+
if (Test-Path ".sdd/config.json") {
|
|
35
|
+
$config = Get-Content ".sdd/config.json" | ConvertFrom-Json
|
|
36
|
+
$config.phases.current = 2
|
|
37
|
+
$config.phases.phase0.status = "completed"
|
|
38
|
+
$config.phases.phase0.completedAt = (Get-Date -Format "yyyy-MM-dd")
|
|
39
|
+
$config.phases.phase2.status = "in-progress"
|
|
40
|
+
$config | ConvertTo-Json | Set-Content ".sdd/config.json"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Write-Host "SPEC.md generation ready."
|
|
44
|
+
Write-Host "Populate SPEC.md by synthesizing from BMAD-brief.md content."
|
|
45
|
+
Write-Host "Follow all section headers from templates/SPEC.template.md exactly."
|
|
46
|
+
Write-Host "Config updated: Phase 0 completed, Phase 2 in-progress."
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
# Generate SPEC.md following templates/SPEC.template.md structure
|
|
51
|
+
# Read the template, then write SPEC.md with synthesized content from BMAD-brief.md
|
|
52
|
+
# Use section headers from SPEC.template.md as the output contract
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generate TASKS.md from SPEC.md and PLAN.md
|
|
2
|
+
---
|
|
3
|
+
tool: Bash
|
|
4
|
+
when: always
|
|
5
|
+
---
|
|
6
|
+
if (!(Test-Path "SPEC.md")) {
|
|
7
|
+
Write-Host "ERROR: SPEC.md not found. Run /sdd-spec first."
|
|
8
|
+
exit 1
|
|
9
|
+
}
|
|
10
|
+
if (!(Test-Path "PLAN.md")) {
|
|
11
|
+
Write-Host "ERROR: PLAN.md not found. Create PLAN.md first."
|
|
12
|
+
exit 1
|
|
13
|
+
}
|
|
14
|
+
if (!(Test-Path "templates/TASKS.template.md")) {
|
|
15
|
+
Write-Host "ERROR: templates/TASKS.template.md not found. Run Phase 2."
|
|
16
|
+
exit 1
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Write-Host "Generating TASKS.md from SPEC.md and PLAN.md..."
|
|
20
|
+
|
|
21
|
+
if (Test-Path ".sdd/config.json") {
|
|
22
|
+
$config = Get-Content ".sdd/config.json" | ConvertFrom-Json
|
|
23
|
+
$config.phases.current = 3
|
|
24
|
+
$config.phases.phase2.status = "completed"
|
|
25
|
+
$config.phases.phase2.completedAt = (Get-Date -Format "yyyy-MM-dd")
|
|
26
|
+
$config.phases.phase3.status = "in-progress"
|
|
27
|
+
$config | ConvertTo-Json | Set-Content ".sdd/config.json"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Write-Host "TASKS.md generation ready."
|
|
31
|
+
Write-Host "Break SPEC.md features into discrete tasks with estimates."
|
|
32
|
+
Write-Host "Follow TASKS.template.md section headers exactly."
|
|
33
|
+
Write-Host "Config updated: Phase 2 completed, Phase 3 in-progress."
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# Generate TASKS.md by analyzing SPEC.md and PLAN.md
|
|
38
|
+
# Follow templates/TASKS.template.md section headers exactly
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: SDD Converge Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
issues: write
|
|
12
|
+
pull-requests: write
|
|
13
|
+
actions: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
converge:
|
|
17
|
+
name: Converge Validation
|
|
18
|
+
runs-on: windows-latest
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Setup Node.js
|
|
25
|
+
uses: actions/setup-node@v4
|
|
26
|
+
with:
|
|
27
|
+
node-version: '22'
|
|
28
|
+
|
|
29
|
+
- name: Install npm tools
|
|
30
|
+
run: |
|
|
31
|
+
npm install -g --ignore-scripts lighthouse @axe-core/cli @stoplight/spectral-cli
|
|
32
|
+
|
|
33
|
+
- name: Verify npm tools
|
|
34
|
+
run: |
|
|
35
|
+
lighthouse --version
|
|
36
|
+
npx @axe-core/cli --version
|
|
37
|
+
spectral --version
|
|
38
|
+
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: npm ci
|
|
41
|
+
|
|
42
|
+
- name: Start dev server
|
|
43
|
+
run: |
|
|
44
|
+
npm run dev &
|
|
45
|
+
for ($i=0; $i -lt 30; $i++) {
|
|
46
|
+
try {
|
|
47
|
+
$r = Invoke-WebRequest -Uri "http://localhost:3000" -TimeoutSec 2 -UseBasicParsing -ErrorAction Stop
|
|
48
|
+
if ($r.StatusCode -eq 200) { break }
|
|
49
|
+
} catch {}
|
|
50
|
+
Start-Sleep 2
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- name: Run Converge
|
|
54
|
+
run: |
|
|
55
|
+
pwsh -File run-converge.ps1 -Url "http://localhost:3000" -Strict
|
|
56
|
+
|
|
57
|
+
- name: Upload reports
|
|
58
|
+
if: always()
|
|
59
|
+
uses: actions/upload-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
name: converge-reports
|
|
62
|
+
path: converge/
|
|
63
|
+
retention-days: 30
|
|
64
|
+
|
|
65
|
+
- name: Create Converge Issue
|
|
66
|
+
if: failure()
|
|
67
|
+
env:
|
|
68
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
run: |
|
|
70
|
+
$body = "## Converge Validation Failed\n\n**Date:** $(Get-Date -Format 'yyyy-MM-dd')\n**Run:** ${{ github.run_id }}\n\nSee attached converge reports. Fix issues and push changes to re-run."
|
|
71
|
+
gh issue create `
|
|
72
|
+
--repo "${{ github.repository }}" `
|
|
73
|
+
--title "Converge Failed: $(git log -1 --oneline)" `
|
|
74
|
+
--body "$body" `
|
|
75
|
+
--label "converge-failure"
|
|
76
|
+
|
|
77
|
+
- name: Fail on convergence failure
|
|
78
|
+
if: failure()
|
|
79
|
+
run: |
|
|
80
|
+
echo "Converge validation failed."
|
|
81
|
+
exit 1
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"phases": {
|
|
4
|
+
"current": 1,
|
|
5
|
+
"phase0": { "status": "pending", "brief": "BMAD-brief.md" },
|
|
6
|
+
"phase1": { "status": "completed", "completedAt": "2026-08-27" },
|
|
7
|
+
"phase2": { "status": "pending", "specFile": "SPEC.md" },
|
|
8
|
+
"phase3": { "status": "pending", "tasksFile": "TASKS.md" },
|
|
9
|
+
"phase4": { "status": "pending" },
|
|
10
|
+
"phase5": { "status": "pending", "validationFile": "converge/validation.md" }
|
|
11
|
+
},
|
|
12
|
+
"templateVersions": {
|
|
13
|
+
"constitution": "1.0.0",
|
|
14
|
+
"bmad": "1.0.0",
|
|
15
|
+
"spec": "1.0.0",
|
|
16
|
+
"plan": "1.0.0",
|
|
17
|
+
"tasks": "1.0.0"
|
|
18
|
+
},
|
|
19
|
+
"project": {
|
|
20
|
+
"name": "TODO",
|
|
21
|
+
"domain": "general"
|
|
22
|
+
},
|
|
23
|
+
"settings": {
|
|
24
|
+
"autoConverge": false,
|
|
25
|
+
"strictMode": true,
|
|
26
|
+
"maxTaskHours": 2
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
$ErrorActionPreference = "Stop"
|
|
2
|
+
$coreTools = @("uv", "git", "node", "npm")
|
|
3
|
+
$failed = @()
|
|
4
|
+
foreach ($tool in $coreTools) {
|
|
5
|
+
try {
|
|
6
|
+
$result = & $tool --version 2>&1
|
|
7
|
+
if ($LASTEXITCODE -ne 0) { throw "exit code $($LASTEXITCODE)" }
|
|
8
|
+
Write-Host "[PASS] $tool" -ForegroundColor Green
|
|
9
|
+
} catch {
|
|
10
|
+
Write-Host "[FAIL] $tool : $_" -ForegroundColor Red
|
|
11
|
+
$failed += $tool
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if ($failed.Count -gt 0) {
|
|
15
|
+
Write-Host "Failed tools: $($failed -join ', ')" -ForegroundColor Red
|
|
16
|
+
exit 1
|
|
17
|
+
} else {
|
|
18
|
+
Write-Host "Core tools verified!" -ForegroundColor Green
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# SDD Project Configuration
|
|
2
|
+
|
|
3
|
+
This is a Spec-Driven Development project.
|
|
4
|
+
|
|
5
|
+
## Current Phase
|
|
6
|
+
|
|
7
|
+
- Phase: <!-- Update via /sdd-status -->
|
|
8
|
+
- Last converge: <!-- Update via /sdd-converge -->
|
|
9
|
+
|
|
10
|
+
## Pipeline Rules
|
|
11
|
+
|
|
12
|
+
1. Never skip converge. Even under deadline pressure.
|
|
13
|
+
2. SPEC.md is a contract. Implementation must match spec.
|
|
14
|
+
3. Run `/sdd-init` to start a new SDD project.
|
|
15
|
+
4. Run `/sdd-spec` to generate SPEC.md.
|
|
16
|
+
5. Run `/sdd-tasks` to generate TASKS.md.
|
|
17
|
+
6. Run `/sdd-converge` to validate implementation.
|
|
18
|
+
|
|
19
|
+
## Phase Gates
|
|
20
|
+
|
|
21
|
+
| Phase | Gate |
|
|
22
|
+
|-------|------|
|
|
23
|
+
| SPEC.md | Requires BMAD-brief.md (enforced) |
|
|
24
|
+
| TASKS.md | Requires SPEC.md + PLAN.md |
|
|
25
|
+
| Converge | Requires all artifacts |
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
Raw Idea -> /sdd-bmad -> BMAD-brief.md -> /sdd-spec -> SPEC.md -> /sdd-tasks -> TASKS.md -> Implement -> /sdd-converge
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
param([switch]$Verify)
|
|
2
|
+
|
|
3
|
+
$configPath = ".sdd/config.json"
|
|
4
|
+
if (!(Test-Path $configPath)) {
|
|
5
|
+
Write-Host "ERROR: .sdd/config.json not found. Run /sdd-init first." -ForegroundColor Red
|
|
6
|
+
exit 1
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$config = Get-Content $configPath | ConvertFrom-Json
|
|
10
|
+
|
|
11
|
+
Write-Host "=== SDD Pipeline Status ===" -ForegroundColor Cyan
|
|
12
|
+
Write-Host "Project: $($config.project.name)"
|
|
13
|
+
Write-Host "Phase: $($config.phases.current)"
|
|
14
|
+
Write-Host "Domain: $($config.project.domain)"
|
|
15
|
+
Write-Host ""
|
|
16
|
+
|
|
17
|
+
$phases = @("phase0","phase1","phase2","phase3","phase4","phase5")
|
|
18
|
+
foreach ($p in $phases) {
|
|
19
|
+
$phaseData = $config.phases.$p
|
|
20
|
+
$status = if ($phaseData.status) { $phaseData.status } else { "unknown" }
|
|
21
|
+
$color = switch ($status) {
|
|
22
|
+
"completed" { "Green" }
|
|
23
|
+
"in-progress" { "Yellow" }
|
|
24
|
+
default { "Gray" }
|
|
25
|
+
}
|
|
26
|
+
$icon = switch ($status) {
|
|
27
|
+
"completed" { "[V]" }
|
|
28
|
+
"in-progress" { "[>]" }
|
|
29
|
+
default { "[ ]" }
|
|
30
|
+
}
|
|
31
|
+
Write-Host "$icon $p : $status" -ForegroundColor $color
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if ($Verify) {
|
|
35
|
+
Write-Host ""
|
|
36
|
+
Write-Host "=== Verification ===" -ForegroundColor Cyan
|
|
37
|
+
$artifacts = @(
|
|
38
|
+
@{ File = "BMAD-brief.md"; Phase = "phase0" },
|
|
39
|
+
@{ File = "SPEC.md"; Phase = "phase2" },
|
|
40
|
+
@{ File = "PLAN.md"; Phase = "phase3" },
|
|
41
|
+
@{ File = "TASKS.md"; Phase = "phase3" },
|
|
42
|
+
@{ File = "CONSTITUTION.md"; Phase = "phase1" }
|
|
43
|
+
)
|
|
44
|
+
foreach ($a in $artifacts) {
|
|
45
|
+
$exists = Test-Path $a.File
|
|
46
|
+
$configStatus = if ($config.phases.($a.Phase).status) { $config.phases.($a.Phase).status } else { "unknown" }
|
|
47
|
+
if ($exists -and $configStatus -eq "completed") {
|
|
48
|
+
Write-Host "[V] $a.File (in sync)" -ForegroundColor Green
|
|
49
|
+
} elseif ($exists -and $configStatus -ne "completed") {
|
|
50
|
+
Write-Host "[!] $a.File (exists but config shows $configStatus)" -ForegroundColor Yellow
|
|
51
|
+
} else {
|
|
52
|
+
Write-Host "[ ] $a.File (missing)" -ForegroundColor Gray
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Write-Host ""
|
|
58
|
+
Write-Host "Next: Phase $($config.phases.current + 1)"
|
|
59
|
+
Write-Host "Run /sdd-status --verify to check artifact sync."
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Converge Validation Results
|
|
2
|
+
|
|
3
|
+
> Generated: [DATE] by run-converge.ps1
|
|
4
|
+
|
|
5
|
+
## Summary
|
|
6
|
+
| Check | Status |
|
|
7
|
+
|-------|--------|
|
|
8
|
+
| Artifact completeness | [PASS/FAIL] |
|
|
9
|
+
| SPEC.md sections | [PASS/FAIL] |
|
|
10
|
+
| TASKS.md structure | [PASS/FAIL] |
|
|
11
|
+
| URL validation | [PASS/FAIL] |
|
|
12
|
+
| Dev server health | [PASS/FAIL/SKIP] |
|
|
13
|
+
|
|
14
|
+
## Details
|
|
15
|
+
[Validation output from run-converge.ps1]
|
|
16
|
+
|
|
17
|
+
## Last Run
|
|
18
|
+
- Date: [DATE]
|
|
19
|
+
- Config: [Domain]
|
|
20
|
+
- Commit: [SHA]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# SDD Extensions
|
|
2
|
+
|
|
3
|
+
Domain-specific extensions for the Spec-Driven Development pipeline.
|
|
4
|
+
|
|
5
|
+
## Available Extensions
|
|
6
|
+
|
|
7
|
+
### sdd-api
|
|
8
|
+
API-focused extension with OpenAPI spec support, endpoint validation, and REST conventions.
|
|
9
|
+
- Templates: SPEC.template.md (API variant)
|
|
10
|
+
- Validation: api-checklist.md, openapi-rules.spectral.yaml
|
|
11
|
+
- Prompts: api-design.md
|
|
12
|
+
|
|
13
|
+
### sdd-frontend
|
|
14
|
+
Frontend-focused extension with design system, component specs, and performance targets.
|
|
15
|
+
- Templates: SPEC.template.md (Frontend variant)
|
|
16
|
+
- Validation: frontend-checklist.md
|
|
17
|
+
- Prompts: ux-design.md
|
|
18
|
+
|
|
19
|
+
### sdd-backend
|
|
20
|
+
Backend-focused extension with data models, business logic, and security requirements.
|
|
21
|
+
- Templates: SPEC.template.md (Backend variant)
|
|
22
|
+
- Validation: backend-checklist.md
|
|
23
|
+
- Prompts: data-model.md
|
|
24
|
+
|
|
25
|
+
## Enabling an Extension
|
|
26
|
+
|
|
27
|
+
Set the domain in `.sdd/config.json`:
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"project": {
|
|
31
|
+
"domain": "api"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Creating Custom Extensions
|
|
37
|
+
|
|
38
|
+
1. Create `extensions/sdd-[domain]/`
|
|
39
|
+
2. Add SPEC.template.md with domain-specific sections
|
|
40
|
+
3. Add validation/ directory with checklist
|
|
41
|
+
4. Add prompts/ directory with specialized prompts
|
|
42
|
+
5. Update `.sdd/config.json` domain to your extension name
|
|
43
|
+
|
|
44
|
+
## Versioning
|
|
45
|
+
Extensions are versioned to match the base pipeline version.
|
|
46
|
+
Check `.sdd/config.json` for the current pipeline version.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!-- Template: SPEC.md v1.0.0 (API Extension) -->
|
|
2
|
+
# SPEC.md — [API Project Name]
|
|
3
|
+
|
|
4
|
+
> Generated via SDD Pipeline (API Extension).
|
|
5
|
+
|
|
6
|
+
## 1. Overview
|
|
7
|
+
[API service name and purpose]
|
|
8
|
+
|
|
9
|
+
## 2. Resources
|
|
10
|
+
### 2.1 Data Models
|
|
11
|
+
| Resource | Fields | Type |
|
|
12
|
+
|----------|--------|------|
|
|
13
|
+
| [Resource] | [field1, field2] | [Type] |
|
|
14
|
+
|
|
15
|
+
### 2.2 Endpoints
|
|
16
|
+
| Method | Path | Description | Auth | Rate Limit |
|
|
17
|
+
|--------|------|-------------|------|------------|
|
|
18
|
+
| GET | /api/v1/... | [Description] | [Auth] | [Limit] |
|
|
19
|
+
|
|
20
|
+
## 3. API Contract
|
|
21
|
+
### 3.1 Request/Response Schemas
|
|
22
|
+
### 3.2 Authentication
|
|
23
|
+
- [ ] API Key
|
|
24
|
+
- [ ] OAuth2
|
|
25
|
+
- [ ] JWT
|
|
26
|
+
|
|
27
|
+
### 3.3 Error Handling
|
|
28
|
+
| HTTP Code | Error Code | Meaning |
|
|
29
|
+
|-----------|------------|---------|
|
|
30
|
+
| 400 | BAD_REQUEST | Invalid input |
|
|
31
|
+
| 401 | UNAUTHORIZED | Missing/invalid auth |
|
|
32
|
+
| 404 | NOT_FOUND | Resource not found |
|
|
33
|
+
| 429 | RATE_LIMITED | Too many requests |
|
|
34
|
+
|
|
35
|
+
### 3.4 Rate Limiting
|
|
36
|
+
|
|
37
|
+
## 4. OpenAPI Specification
|
|
38
|
+
[OpenAPI 3.x YAML or reference to openapi.yaml]
|
|
39
|
+
|
|
40
|
+
## 5. Non-Functional Requirements
|
|
41
|
+
| Requirement | Target | Measurement |
|
|
42
|
+
|-------------|--------|-------------|
|
|
43
|
+
| Latency | <[X]ms p99 | Load test |
|
|
44
|
+
| Availability | [X]% uptime | SLA monitoring |
|
|
45
|
+
|
|
46
|
+
## 6. Success Criteria
|
|
47
|
+
| Criterion | Measurement |
|
|
48
|
+
|-----------|-------------|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# API Design Prompts
|
|
2
|
+
|
|
3
|
+
## REST Conventions
|
|
4
|
+
- Use nouns for resources: /users, /orders
|
|
5
|
+
- Use HTTP methods correctly: GET=read, POST=create, PUT=replace, PATCH=update, DELETE=delete
|
|
6
|
+
- Return appropriate status codes
|
|
7
|
+
|
|
8
|
+
## Versioning Strategy
|
|
9
|
+
- Path-based: /api/v1/, /api/v2/
|
|
10
|
+
- Deprecation policy: 6 months minimum
|
|
11
|
+
|
|
12
|
+
## Pagination
|
|
13
|
+
- Cursor-based for large datasets
|
|
14
|
+
- Default page size: 20
|
|
15
|
+
- Max page size: 100
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# API Validation Checklist
|
|
2
|
+
|
|
3
|
+
## Endpoints
|
|
4
|
+
- [ ] All endpoints defined in SPEC.md are implemented
|
|
5
|
+
- [ ] HTTP methods match specification
|
|
6
|
+
- [ ] Path parameters handled correctly
|
|
7
|
+
|
|
8
|
+
## Authentication
|
|
9
|
+
- [ ] API key validation implemented
|
|
10
|
+
- [ ] OAuth2 flow implemented (if applicable)
|
|
11
|
+
- [ ] JWT validation with expiry check
|
|
12
|
+
|
|
13
|
+
## Request/Response
|
|
14
|
+
- [ ] Request body validation (schema)
|
|
15
|
+
- [ ] Response body matches OpenAPI spec
|
|
16
|
+
|
|
17
|
+
## Error Handling
|
|
18
|
+
- [ ] All 4xx codes return proper error format
|
|
19
|
+
- [ ] Error messages are user-safe (no stack traces)
|
|
20
|
+
|
|
21
|
+
## Security
|
|
22
|
+
- [ ] No hardcoded credentials
|
|
23
|
+
- [ ] CORS configured correctly
|
|
24
|
+
- [ ] Input sanitization in place
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Spectral Ruleset — API Extension
|
|
2
|
+
extends: ["spectral:oas"]
|
|
3
|
+
rules:
|
|
4
|
+
oas3-api-servers: error
|
|
5
|
+
info-contact: warn
|
|
6
|
+
info-description: warn
|
|
7
|
+
operation-description: warn
|
|
8
|
+
operation-tags: warn
|
|
9
|
+
oas3-operation-security-defined: error
|
|
10
|
+
path-not-include-query: error
|
|
11
|
+
operation-parameters: error
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!-- Template: SPEC.md v1.0.0 (Backend Extension) -->
|
|
2
|
+
# SPEC.md — [Backend Project Name]
|
|
3
|
+
|
|
4
|
+
> Generated via SDD Pipeline (Backend Extension).
|
|
5
|
+
|
|
6
|
+
## 1. Overview
|
|
7
|
+
[Service name and purpose]
|
|
8
|
+
|
|
9
|
+
## 2. Data Models
|
|
10
|
+
### 2.1 Entities
|
|
11
|
+
#### [Entity Name]
|
|
12
|
+
| Field | Type | Constraints |
|
|
13
|
+
|-------|------|-------------|
|
|
14
|
+
| id | UUID | PK |
|
|
15
|
+
| [field] | [type] | [constraints] |
|
|
16
|
+
|
|
17
|
+
### 2.2 Relationships
|
|
18
|
+
|
|
19
|
+
## 3. API Endpoints
|
|
20
|
+
| Method | Path | Description |
|
|
21
|
+
|--------|------|-------------|
|
|
22
|
+
| GET | /api/... | [Description] |
|
|
23
|
+
|
|
24
|
+
## 4. Business Logic
|
|
25
|
+
### 4.1 Auth Flows
|
|
26
|
+
### 4.2 Authorization Rules
|
|
27
|
+
| Role | Permissions |
|
|
28
|
+
|------|-------------|
|
|
29
|
+
| admin | [All] |
|
|
30
|
+
| user | [Scoped] |
|
|
31
|
+
|
|
32
|
+
## 5. Database
|
|
33
|
+
- **Engine:** [PostgreSQL/MongoDB/SQLite]
|
|
34
|
+
- **Migrations:** [Tool]
|
|
35
|
+
|
|
36
|
+
## 6. Security
|
|
37
|
+
- [ ] Password hashing: bcrypt/argon2
|
|
38
|
+
- [ ] Input validation
|
|
39
|
+
- [ ] SQL injection prevention
|
|
40
|
+
- [ ] Rate limiting
|
|
41
|
+
|
|
42
|
+
## 7. Logging & Monitoring
|
|
43
|
+
- Structured JSON logs
|
|
44
|
+
- Metrics: request latency, error rate
|
|
45
|
+
|
|
46
|
+
## 8. Testing Strategy
|
|
47
|
+
- Unit: [X]% coverage target
|
|
48
|
+
- Integration: critical paths
|
|
49
|
+
|
|
50
|
+
## 9. Success Criteria
|
|
51
|
+
| Criterion | Measurement |
|
|
52
|
+
|-----------|-------------|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Data Modeling Prompts
|
|
2
|
+
|
|
3
|
+
## Naming Conventions
|
|
4
|
+
- Tables/collections: plural snake_case
|
|
5
|
+
- Columns/fields: snake_case
|
|
6
|
+
- Primary keys: id
|
|
7
|
+
- Foreign keys: [table]_id
|
|
8
|
+
|
|
9
|
+
## Normalization
|
|
10
|
+
- 3NF minimum
|
|
11
|
+
- Denormalize only for performance
|
|
12
|
+
|
|
13
|
+
## Migrations
|
|
14
|
+
- Always forward + backward migrations
|
|
15
|
+
- Never drop columns in same PR as adding
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Backend Validation Checklist
|
|
2
|
+
|
|
3
|
+
## Data Models
|
|
4
|
+
- [ ] All entities defined in SPEC.md implemented
|
|
5
|
+
- [ ] Field types and constraints enforced
|
|
6
|
+
|
|
7
|
+
## Endpoints
|
|
8
|
+
- [ ] All endpoints implemented
|
|
9
|
+
- [ ] HTTP methods correct
|
|
10
|
+
- [ ] Status codes correct
|
|
11
|
+
|
|
12
|
+
## Authentication/Authorization
|
|
13
|
+
- [ ] Password hashing verified
|
|
14
|
+
- [ ] JWT validation working
|
|
15
|
+
- [ ] RBAC enforced
|
|
16
|
+
|
|
17
|
+
## Security
|
|
18
|
+
- [ ] Input validation on all endpoints
|
|
19
|
+
- [ ] No secrets in code
|
|
20
|
+
|
|
21
|
+
## Performance
|
|
22
|
+
- [ ] Database queries optimized
|
|
23
|
+
- [ ] Latency < [target]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!-- Template: SPEC.md v1.0.0 (Frontend Extension) -->
|
|
2
|
+
# SPEC.md — [Frontend Project Name]
|
|
3
|
+
|
|
4
|
+
> Generated via SDD Pipeline (Frontend Extension).
|
|
5
|
+
|
|
6
|
+
## 1. Overview
|
|
7
|
+
[App name and purpose]
|
|
8
|
+
|
|
9
|
+
## 2. Design System
|
|
10
|
+
### 2.1 Colors
|
|
11
|
+
| Token | Hex | Usage |
|
|
12
|
+
|-------|-----|-------|
|
|
13
|
+
| primary | [#HEX] | [Usage] |
|
|
14
|
+
|
|
15
|
+
### 2.2 Typography
|
|
16
|
+
### 2.3 Spacing
|
|
17
|
+
### 2.4 Breakpoints
|
|
18
|
+
|
|
19
|
+
## 3. Components
|
|
20
|
+
### 3.1 Button
|
|
21
|
+
- **States:** default, hover, active, disabled
|
|
22
|
+
- **Variants:** primary, secondary, ghost
|
|
23
|
+
|
|
24
|
+
### 3.2 Input
|
|
25
|
+
### 3.3 Card
|
|
26
|
+
### 3.4 Modal
|
|
27
|
+
|
|
28
|
+
## 4. Pages & Routes
|
|
29
|
+
| Route | Page | Auth |
|
|
30
|
+
|-------|------|------|
|
|
31
|
+
| / | Home | No |
|
|
32
|
+
| /dashboard | Dashboard | Yes |
|
|
33
|
+
|
|
34
|
+
## 5. Performance Targets
|
|
35
|
+
| Metric | Target | Measurement |
|
|
36
|
+
|--------|--------|-------------|
|
|
37
|
+
| Lighthouse Performance | >= 90 | Lighthouse CI |
|
|
38
|
+
| LCP | < 2.5s | Core Web Vitals |
|
|
39
|
+
| CLS | < 0.1 | Core Web Vitals |
|
|
40
|
+
|
|
41
|
+
## 6. Accessibility (WCAG 2.1 AA)
|
|
42
|
+
- [ ] Color contrast >= 4.5:1
|
|
43
|
+
- [ ] Focus visible on all interactive elements
|
|
44
|
+
- [ ] ARIA labels on icon-only buttons
|
|
45
|
+
- [ ] Keyboard navigation for all flows
|
|
46
|
+
|
|
47
|
+
## 7. Success Criteria
|
|
48
|
+
| Criterion | Measurement |
|
|
49
|
+
|-----------|-------------|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# UX Design Prompts
|
|
2
|
+
|
|
3
|
+
## Design Principles
|
|
4
|
+
1. Consistency: Match existing patterns
|
|
5
|
+
2. Feedback: Every action has visible response
|
|
6
|
+
3. Recovery: Easy to undo mistakes
|
|
7
|
+
4. Clarity: No jargon, clear labels
|
|
8
|
+
|
|
9
|
+
## Accessibility Checklist
|
|
10
|
+
- [ ] Color is not the only indicator
|
|
11
|
+
- [ ] Focus indicators visible
|
|
12
|
+
- [ ] Labels for all form inputs
|
|
13
|
+
- [ ] Alt text for all images
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Frontend Validation Checklist
|
|
2
|
+
|
|
3
|
+
## Design System
|
|
4
|
+
- [ ] Colors match design tokens
|
|
5
|
+
- [ ] Typography matches specification
|
|
6
|
+
- [ ] Spacing is consistent (4px grid)
|
|
7
|
+
|
|
8
|
+
## Components
|
|
9
|
+
- [ ] Button states implemented
|
|
10
|
+
- [ ] Input validation feedback
|
|
11
|
+
- [ ] Card layout correct
|
|
12
|
+
- [ ] Modal accessible (focus trap, ESC to close)
|
|
13
|
+
|
|
14
|
+
## Pages
|
|
15
|
+
- [ ] All routes defined in SPEC implemented
|
|
16
|
+
- [ ] Responsive at all breakpoints
|
|
17
|
+
- [ ] Loading states implemented
|
|
18
|
+
- [ ] Error states implemented
|
|
19
|
+
|
|
20
|
+
## Performance
|
|
21
|
+
- [ ] Lighthouse Performance >= 90
|
|
22
|
+
- [ ] axe-core: 0 violations
|
|
23
|
+
|
|
24
|
+
## Accessibility
|
|
25
|
+
- [ ] Keyboard navigation works
|
|
26
|
+
- [ ] Color contrast >= 4.5:1
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[string]$Url = "http://localhost:3000",
|
|
3
|
+
[switch]$Strict,
|
|
4
|
+
[string]$ProjectDomain = "general"
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
$ErrorActionPreference = "Stop"
|
|
8
|
+
$overallPass = $true
|
|
9
|
+
|
|
10
|
+
function Test-UrlSafe {
|
|
11
|
+
param([string]$Url)
|
|
12
|
+
$parsed = [System.Uri]::new($Url)
|
|
13
|
+
if ($parsed.Scheme -ne "https" -and $parsed.Scheme -ne "http") {
|
|
14
|
+
throw "URL must use HTTP or HTTPS"
|
|
15
|
+
}
|
|
16
|
+
$ip = $parsed.Host
|
|
17
|
+
if ($ip -match '^(127\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.)') {
|
|
18
|
+
throw "URL cannot point to private IP ranges"
|
|
19
|
+
}
|
|
20
|
+
if ($ip -eq "localhost" -or $ip -eq "127.0.0.1") {
|
|
21
|
+
throw "URL cannot point to localhost"
|
|
22
|
+
}
|
|
23
|
+
if ($ip -eq "169.254.169.254") {
|
|
24
|
+
throw "URL cannot point to cloud metadata endpoint"
|
|
25
|
+
}
|
|
26
|
+
return $true
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function Wait-ForDevServer {
|
|
30
|
+
param(
|
|
31
|
+
[string]$Url = "http://localhost:3000",
|
|
32
|
+
[int]$TimeoutSeconds = 60,
|
|
33
|
+
[int]$RetryIntervalSeconds = 2
|
|
34
|
+
)
|
|
35
|
+
$startTime = Get-Date
|
|
36
|
+
while ((Get-Date) - $startTime -lt [TimeSpan]::FromSeconds($TimeoutSeconds)) {
|
|
37
|
+
try {
|
|
38
|
+
$response = Invoke-WebRequest -Uri $Url -Method Get -TimeoutSec 5 -UseBasicParsing
|
|
39
|
+
if ($response.StatusCode -eq 200 -or $response.StatusCode -eq 301 -or $response.StatusCode -eq 302) {
|
|
40
|
+
Write-Host "[OK] Dev server ready at $Url" -ForegroundColor Green
|
|
41
|
+
return $true
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
Write-Host "[WAIT] Dev server not ready: $_" -ForegroundColor Yellow
|
|
45
|
+
}
|
|
46
|
+
Start-Sleep -Seconds $RetryIntervalSeconds
|
|
47
|
+
}
|
|
48
|
+
Write-Host "[ERROR] Dev server failed to start within $TimeoutSeconds seconds" -ForegroundColor Red
|
|
49
|
+
return $false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function Update-SddConfig {
|
|
53
|
+
param([string]$Phase, [string]$Status)
|
|
54
|
+
if (Test-Path ".sdd/config.json") {
|
|
55
|
+
$config = Get-Content ".sdd/config.json" | ConvertFrom-Json
|
|
56
|
+
$config.phases.($Phase).status = $Status
|
|
57
|
+
if ($Status -eq "completed") {
|
|
58
|
+
$config.phases.($Phase).completedAt = (Get-Date -Format "yyyy-MM-dd")
|
|
59
|
+
}
|
|
60
|
+
$config | ConvertTo-Json | Set-Content ".sdd/config.json"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Write-Host "=== SDD Converge Validation ===" -ForegroundColor Cyan
|
|
65
|
+
Write-Host "Domain: $ProjectDomain"
|
|
66
|
+
Write-Host ""
|
|
67
|
+
|
|
68
|
+
$requiredArtifacts = @("SPEC.md", "PLAN.md", "TASKS.md")
|
|
69
|
+
foreach ($artifact in $requiredArtifacts) {
|
|
70
|
+
if (Test-Path $artifact) {
|
|
71
|
+
Write-Host "[V] $artifact exists" -ForegroundColor Green
|
|
72
|
+
} else {
|
|
73
|
+
Write-Host "[X] $artifact MISSING" -ForegroundColor Red
|
|
74
|
+
$overallPass = $false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (-not $overallPass) {
|
|
79
|
+
Write-Host ""
|
|
80
|
+
Write-Host "Converge FAILED: Missing artifacts" -ForegroundColor Red
|
|
81
|
+
exit 1
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
Write-Host ""
|
|
85
|
+
Write-Host "--- URL Validation ---" -ForegroundColor Cyan
|
|
86
|
+
try {
|
|
87
|
+
Test-UrlSafe -Url $Url
|
|
88
|
+
Write-Host "[V] URL is safe: $Url" -ForegroundColor Green
|
|
89
|
+
} catch {
|
|
90
|
+
Write-Host "[X] URL validation failed: $_" -ForegroundColor Red
|
|
91
|
+
$overallPass = $false
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Write-Host ""
|
|
95
|
+
Write-Host "--- Dev Server Health Check ---" -ForegroundColor Cyan
|
|
96
|
+
$serverReady = Wait-ForDevServer -Url $Url -TimeoutSeconds 30
|
|
97
|
+
if (-not $serverReady) {
|
|
98
|
+
Write-Host "[WARN] Dev server not available -- skipping live checks" -ForegroundColor Yellow
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Write-Host ""
|
|
102
|
+
Write-Host "--- SPEC.md Validation ---" -ForegroundColor Cyan
|
|
103
|
+
if (Test-Path "SPEC.md") {
|
|
104
|
+
$specContent = Get-Content "SPEC.md" -Raw
|
|
105
|
+
$requiredSections = @("Overview", "User Stories", "Functional Requirements", "Success Criteria")
|
|
106
|
+
foreach ($section in $requiredSections) {
|
|
107
|
+
if ($specContent -match $section) {
|
|
108
|
+
Write-Host "[V] SPEC.md has '$section' section" -ForegroundColor Green
|
|
109
|
+
} else {
|
|
110
|
+
Write-Host "[X] SPEC.md missing '$section' section" -ForegroundColor Red
|
|
111
|
+
$overallPass = $false
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Write-Host ""
|
|
117
|
+
Write-Host "--- TASKS.md Validation ---" -ForegroundColor Cyan
|
|
118
|
+
if (Test-Path "TASKS.md") {
|
|
119
|
+
$tasksContent = Get-Content "TASKS.md" -Raw
|
|
120
|
+
if ($tasksContent -match "T-\d{3}") {
|
|
121
|
+
Write-Host "[V] TASKS.md has task IDs" -ForegroundColor Green
|
|
122
|
+
} else {
|
|
123
|
+
Write-Host "[X] TASKS.md missing task IDs" -ForegroundColor Red
|
|
124
|
+
$overallPass = $false
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
Write-Host ""
|
|
129
|
+
if ($overallPass) {
|
|
130
|
+
Write-Host "=== CONVERGE PASSED ===" -ForegroundColor Green
|
|
131
|
+
Update-SddConfig -Phase "phase5" -Status "completed"
|
|
132
|
+
Update-SddConfig -Phase "phase4" -Status "completed"
|
|
133
|
+
exit 0
|
|
134
|
+
} else {
|
|
135
|
+
Write-Host "=== CONVERGE FAILED ===" -ForegroundColor Red
|
|
136
|
+
if ($Strict) {
|
|
137
|
+
Update-SddConfig -Phase "phase5" -Status "failed"
|
|
138
|
+
exit 1
|
|
139
|
+
}
|
|
140
|
+
exit 0
|
|
141
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
<!-- Template: BMAD-brief.md v1.0.0 -->
|
|
3
|
+
# BMAD Brief — [Project Name]
|
|
4
|
+
|
|
5
|
+
> Generated: [DATE]. Expires: [DATE + 30 days].
|
|
6
|
+
|
|
7
|
+
## Input
|
|
8
|
+
> [Original request]
|
|
9
|
+
|
|
10
|
+
## PM Perspective
|
|
11
|
+
**Target user:** [Description]
|
|
12
|
+
**User needs:** [List]
|
|
13
|
+
**Primary conversion action:** [What matters to business]
|
|
14
|
+
|
|
15
|
+
## Architect Perspective
|
|
16
|
+
**Minimum viable approach:** [One paragraph]
|
|
17
|
+
**Technical risks:
|
|
18
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
19
|
+
|------|-----------|--------|------------|
|
|
20
|
+
| [Risk 1] | [H/M/L] | [H/M/L] | [Mitigation] |
|
|
21
|
+
|
|
22
|
+
## UX Perspective
|
|
23
|
+
**First impression goal:** [Description]
|
|
24
|
+
**Microcopy needed:** [List]
|
|
25
|
+
|
|
26
|
+
## Synthesis
|
|
27
|
+
**What we're building:** [2-3 sentences]
|
|
28
|
+
|
|
29
|
+
**What we're NOT building:** [Explicit exclusions]
|
|
30
|
+
1. [Exclusion]
|
|
31
|
+
|
|
32
|
+
## Open Questions
|
|
33
|
+
| # | Question | Impact |
|
|
34
|
+
|---|----------|--------|
|
|
35
|
+
| 1 | [Question] | [Blocking?] |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!-- Template: CONSTITUTION.md v1.0.0 -->
|
|
2
|
+
# Project Constitution
|
|
3
|
+
|
|
4
|
+
> Immutable principles governing all project decisions.
|
|
5
|
+
> Changes require Phase 0 (BMAD) approval.
|
|
6
|
+
|
|
7
|
+
## Principles
|
|
8
|
+
|
|
9
|
+
### P1 — Non-Negotiable
|
|
10
|
+
- **[Principle]:** [What it means]
|
|
11
|
+
|
|
12
|
+
### P2 — Strong Preferences
|
|
13
|
+
- **[Principle]:** [What it means]
|
|
14
|
+
|
|
15
|
+
## Technology Constraints
|
|
16
|
+
| Category | Choice | Rationale |
|
|
17
|
+
|----------|--------|-----------|
|
|
18
|
+
| Language | [e.g., TypeScript] | [Why] |
|
|
19
|
+
|
|
20
|
+
## What We Never Do
|
|
21
|
+
1. [Forbidden action]
|
|
22
|
+
|
|
23
|
+
## What We Always Do
|
|
24
|
+
1. [Required action]
|
|
25
|
+
|
|
26
|
+
## Extension Points
|
|
27
|
+
$DOMAIN:api: Add API-specific sections
|
|
28
|
+
$DOMAIN:frontend: Add design system sections
|
|
29
|
+
$DOMAIN:backend: Add data model sections
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!-- Template: PLAN.md v1.0.0 -->
|
|
2
|
+
# PLAN.md — [Project Name]
|
|
3
|
+
|
|
4
|
+
> Technical plan derived from SPEC.md.
|
|
5
|
+
|
|
6
|
+
## Architecture Overview
|
|
7
|
+
[1-2 paragraph overview]
|
|
8
|
+
|
|
9
|
+
## File Structure
|
|
10
|
+
```
|
|
11
|
+
/
|
|
12
|
+
├── [files]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Technology Decisions
|
|
16
|
+
| Component | Choice | Rationale |
|
|
17
|
+
|-----------|--------|-----------|
|
|
18
|
+
| [Component] | [Choice] | [Why] |
|
|
19
|
+
|
|
20
|
+
## Milestones
|
|
21
|
+
| Milestone | Deliverables |
|
|
22
|
+
|-----------|--------------|
|
|
23
|
+
| M1 | [Deliverables] |
|
|
24
|
+
|
|
25
|
+
## Risks
|
|
26
|
+
| Risk | Mitigation |
|
|
27
|
+
|------|------------|
|
|
28
|
+
| [Risk] | [Mitigation] |
|
|
29
|
+
|
|
30
|
+
## Extension Points
|
|
31
|
+
$DOMAIN:api: API design table
|
|
32
|
+
$DOMAIN:frontend: Design system tokens
|
|
33
|
+
$DOMAIN:backend: Data model diagram
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Template: README.md v1.0.0 -->
|
|
2
|
+
# SDD Templates
|
|
3
|
+
|
|
4
|
+
Templates for the Spec-Driven Development pipeline.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
1. Read the template before generating artifacts
|
|
8
|
+
2. Fill in all sections
|
|
9
|
+
3. Keep section headers — they are the contract
|
|
10
|
+
|
|
11
|
+
## Template Version
|
|
12
|
+
Templates are versioned: check `.sdd/config.json` for current version.
|
|
13
|
+
|
|
14
|
+
## Extension Points
|
|
15
|
+
Templates support domain-specific extensions via `$DOMAIN:` markers.
|
|
16
|
+
- `$DOMAIN:api` — API-specific sections
|
|
17
|
+
- `$DOMAIN:frontend` — Frontend-specific sections
|
|
18
|
+
- `$DOMAIN:backend` — Backend-specific sections
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!-- Template: SPEC.md v1.0.0 -->
|
|
2
|
+
# SPEC.md — [Project Name]
|
|
3
|
+
|
|
4
|
+
> Generated via SDD Pipeline. Do not edit below the line.
|
|
5
|
+
|
|
6
|
+
## 1. Overview
|
|
7
|
+
[2-3 sentences]
|
|
8
|
+
|
|
9
|
+
## 2. User Stories
|
|
10
|
+
### 2.1 Must Have (V1)
|
|
11
|
+
- **As a** [user], **I want** [action], **so that** [benefit]
|
|
12
|
+
|
|
13
|
+
### 2.2 Nice to Have (V2+)
|
|
14
|
+
- **As a** [user], **I want** [action], **so that** [benefit]
|
|
15
|
+
|
|
16
|
+
## 3. Functional Requirements
|
|
17
|
+
### 3.1 Core Features
|
|
18
|
+
#### [Feature Name]
|
|
19
|
+
- **Description:** [What it does]
|
|
20
|
+
- **Acceptance criteria:**
|
|
21
|
+
- [ ] [Specific, measurable condition]
|
|
22
|
+
|
|
23
|
+
### 3.2 Edge Cases
|
|
24
|
+
- [Edge case 1]
|
|
25
|
+
- [Edge case 2]
|
|
26
|
+
|
|
27
|
+
## 4. Non-Functional Requirements
|
|
28
|
+
| Requirement | Target | Measurement |
|
|
29
|
+
|-------------|--------|-------------|
|
|
30
|
+
| Performance | [Target] | [Measurement] |
|
|
31
|
+
| Accessibility | [Target] | [Measurement] |
|
|
32
|
+
| Security | [Target] | [Measurement] |
|
|
33
|
+
|
|
34
|
+
## 5. Technical Constraints
|
|
35
|
+
- **Stack:** [Tech stack]
|
|
36
|
+
- **No:** [Forbidden tech]
|
|
37
|
+
|
|
38
|
+
## 6. Open Questions
|
|
39
|
+
| # | Question | Impact |
|
|
40
|
+
|---|----------|--------|
|
|
41
|
+
| 1 | [Question] | [Blocking?] |
|
|
42
|
+
|
|
43
|
+
## 7. Success Criteria
|
|
44
|
+
| Criterion | Measurement |
|
|
45
|
+
|-----------|-------------|
|
|
46
|
+
| [Criterion] | [How measured] |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Template: TASKS.md v1.0.0 -->
|
|
2
|
+
# TASKS.md — [Project Name]
|
|
3
|
+
|
|
4
|
+
## Task Index
|
|
5
|
+
| T-# | Name | Estimate | Dependencies |
|
|
6
|
+
|------|------|---------|-------------|
|
|
7
|
+
| T-001 | [Name] | [Xh] | [None/T-XXX] |
|
|
8
|
+
|
|
9
|
+
## Task Detail
|
|
10
|
+
### T-001: [Task Name]
|
|
11
|
+
**Phase:** [Phase from PLAN]
|
|
12
|
+
**Estimate:** [X hours]
|
|
13
|
+
**Dependencies:** [None/T-XXX]
|
|
14
|
+
|
|
15
|
+
**Description:** [What to do]
|
|
16
|
+
|
|
17
|
+
**Verification:**
|
|
18
|
+
- [ ] [Specific check]
|
|
19
|
+
|
|
20
|
+
## Dependency Graph
|
|
21
|
+
```
|
|
22
|
+
T-001
|
|
23
|
+
T-002 -> T-003
|
|
24
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sdd-pipeline",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Spec-Driven Development pipeline for Claude Code",
|
|
5
|
+
"main": "bin/sdd.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"sdd": "./bin/sdd.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"lib/bundle"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18"
|
|
15
|
+
},
|
|
16
|
+
"preferGlobal": true,
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "echo 'No build step needed — pure JS'"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"sdd",
|
|
22
|
+
"spec-driven",
|
|
23
|
+
"claude-code",
|
|
24
|
+
"pipeline"
|
|
25
|
+
],
|
|
26
|
+
"license": "MIT"
|
|
27
|
+
}
|