sdd-workflow 1.1.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.
Files changed (41) hide show
  1. package/README.md +226 -0
  2. package/bin/sdd-init.js +59 -0
  3. package/package.json +30 -0
  4. package/src/installer.js +558 -0
  5. package/templates/skills/sdd-constitution/SKILL.md +128 -0
  6. package/templates/skills/sdd-implement/SKILL.md +153 -0
  7. package/templates/skills/sdd-init/SKILL.md +302 -0
  8. package/templates/skills/sdd-plan/SKILL.md +226 -0
  9. package/templates/skills/sdd-review/SKILL.md +498 -0
  10. package/templates/skills/sdd-run/SKILL.md +439 -0
  11. package/templates/skills/sdd-specify/SKILL.md +280 -0
  12. package/templates/skills/sdd-split/SKILL.md +432 -0
  13. package/templates/skills/sdd-tasks/SKILL.md +199 -0
  14. package/templates/skills/sdd-testcases/SKILL.md +235 -0
  15. package/templates/specify/README.md +179 -0
  16. package/templates/specify/scripts/create-feature.sh +144 -0
  17. package/templates/specify/templates/constitution-template.md +74 -0
  18. package/templates/specify/templates/plan-modular-template/README.md +98 -0
  19. package/templates/specify/templates/plan-modular-template/architecture.md +127 -0
  20. package/templates/specify/templates/plan-modular-template/backend-api.md +191 -0
  21. package/templates/specify/templates/plan-modular-template/backend-impl.md +134 -0
  22. package/templates/specify/templates/plan-modular-template/changelog.md +34 -0
  23. package/templates/specify/templates/plan-modular-template/data-model.md +130 -0
  24. package/templates/specify/templates/plan-modular-template/frontend-api.md +126 -0
  25. package/templates/specify/templates/plan-modular-template/frontend-impl.md +108 -0
  26. package/templates/specify/templates/plan-modular-template/performance.md +112 -0
  27. package/templates/specify/templates/plan-modular-template/security.md +85 -0
  28. package/templates/specify/templates/plan-template.md +190 -0
  29. package/templates/specify/templates/requirements/metadata-template.json +12 -0
  30. package/templates/specify/templates/requirements/original-template.md +26 -0
  31. package/templates/specify/templates/spec-modular-template/README.md +69 -0
  32. package/templates/specify/templates/spec-modular-template/acceptance-criteria.md +49 -0
  33. package/templates/specify/templates/spec-modular-template/changelog.md +27 -0
  34. package/templates/specify/templates/spec-modular-template/constraints.md +125 -0
  35. package/templates/specify/templates/spec-modular-template/overview.md +60 -0
  36. package/templates/specify/templates/spec-modular-template/user-stories.md +59 -0
  37. package/templates/specify/templates/spec-template.md +214 -0
  38. package/templates/specify/templates/tasks-modular-template/README.md +79 -0
  39. package/templates/specify/templates/tasks-template.md +232 -0
  40. package/templates/specify/templates/testcases-template.md +434 -0
  41. package/templates/teams/sdd-development-team.md +318 -0
package/README.md ADDED
@@ -0,0 +1,226 @@
1
+ # SDD Workflow
2
+
3
+ Specification-Driven Development toolkit for [Claude Code](https://claude.ai/claude-code). Install skills, templates, and tooling into any project to bring structured, AI-assisted development to your workflow.
4
+
5
+ ## What is SDD?
6
+
7
+ SDD (Specification-Driven Development) is a development workflow that writes specifications before code. It combines the discipline of TDD with AI-assisted implementation, enforced through Claude Code skills.
8
+
9
+ The pipeline:
10
+
11
+ ```
12
+ Specify --> Test Cases --> Plan --> Tasks --> Implement --> Review
13
+ (What) (Verify) (How) (When) (Code) (Quality)
14
+ ```
15
+
16
+ Every phase produces a document. Documents become contracts. AI implements against those contracts. An independent review verifies compliance.
17
+
18
+ ## Quick Start
19
+
20
+ ### 1. Install
21
+
22
+ ```bash
23
+ npx sdd-workflow
24
+ ```
25
+
26
+ This copies skills, templates, and team configurations into your project:
27
+
28
+ ```
29
+ your-project/
30
+ ├── .claude/
31
+ │ ├── skills/sdd-*/ 10 SDD skills
32
+ │ └── teams/ Team configurations
33
+ └── .specify/
34
+ ├── memory/ Project constitution (generated later)
35
+ ├── specs/ Feature specifications
36
+ ├── templates/ Document templates
37
+ └── scripts/ Utility scripts
38
+ ```
39
+
40
+ ### 2. Initialize
41
+
42
+ Open Claude Code in your project and run:
43
+
44
+ ```
45
+ /sdd-init
46
+ ```
47
+
48
+ This analyzes your project structure, detects your tech stack, and generates a project-specific constitution at `.specify/memory/constitution.md`.
49
+
50
+ ### 3. Develop
51
+
52
+ Start a feature using the full auto pipeline:
53
+
54
+ ```
55
+ /sdd-run 001 Add user authentication
56
+ ```
57
+
58
+ Or step through manually:
59
+
60
+ ```
61
+ /sdd-specify User authentication
62
+ /sdd-testcases
63
+ /sdd-plan
64
+ /sdd-tasks
65
+ /sdd-implement
66
+ /sdd-review
67
+ ```
68
+
69
+ ## Installation Options
70
+
71
+ ```bash
72
+ npx sdd-workflow # Standard install (skip existing files)
73
+ npx sdd-workflow --update # Incremental update (only changed files)
74
+ npx sdd-workflow --force # Overwrite all existing files
75
+ npx sdd-workflow --dry-run # Preview what would be installed/updated
76
+ npx sdd-workflow --update --dry-run # Preview updates
77
+ ```
78
+
79
+ ### Update Modes
80
+
81
+ | Mode | Behavior | When to use |
82
+ |------|----------|-------------|
83
+ | (default) | Skip existing files | First install |
84
+ | `--update` | Only update source-changed files, skip user-customized | After upgrading sdd-workflow |
85
+ | `--force` | Overwrite everything | Reset to defaults |
86
+
87
+ **How `--update` works**: On first install, a manifest (`.specify/.sdd-manifest.json`) records file hashes. When you run `--update`, it compares source files against the manifest:
88
+ - Source changed, target is original → auto-update
89
+ - Source changed, target also modified by you → **skip** (protect your customizations)
90
+ - New files in source → auto-add
91
+ - Unchanged → skip
92
+
93
+ ## Available Commands
94
+
95
+ ### Core Pipeline
96
+
97
+ | Command | Description | Input | Output |
98
+ |---------|-------------|-------|--------|
99
+ | `/sdd-specify` | Create feature specification | Feature name or KB link | `spec.md` |
100
+ | `/sdd-testcases` | Design test cases | spec.md | `testcases.md` |
101
+ | `/sdd-plan` | Plan technical implementation | testcases.md + spec.md | `plan.md` |
102
+ | `/sdd-tasks` | Break down into development tasks | plan.md | `tasks.md` |
103
+ | `/sdd-implement` | Execute development tasks | tasks.md | Code changes |
104
+ | `/sdd-review` | Independent quality review | spec + plan + code | Review report |
105
+
106
+ ### Automation
107
+
108
+ | Command | Description |
109
+ |---------|-------------|
110
+ | `/sdd-run <id> <description>` | Full auto pipeline: specify through review |
111
+ | `/sdd-init` | Initialize SDD for the project (first time only) |
112
+ | `/sdd-constitution` | Create or update project constitution |
113
+
114
+ ### Utilities
115
+
116
+ | Command | Description |
117
+ |---------|-------------|
118
+ | `/sdd-split` | Split large SDD documents into modular structure |
119
+
120
+ ## Project Constitution
121
+
122
+ The constitution (`.specify/memory/constitution.md`) is the foundation of SDD in your project. It defines:
123
+
124
+ - **Tech stack** -- languages, frameworks, libraries detected from your project
125
+ - **Absolute rules** -- data integrity, query performance, security baselines
126
+ - **Development principles** -- simplicity, code quality, testing standards
127
+ - **Architecture constraints** -- based on your project's architecture pattern
128
+ - **Review criteria** -- scoring dimensions, weights, and pass thresholds
129
+ - **Lessons learned** -- accumulated project-specific knowledge
130
+
131
+ The constitution is generated by `/sdd-init` and can be updated with `/sdd-constitution`. All subsequent SDD commands read it as context.
132
+
133
+ ## Document Structure
134
+
135
+ Each feature is organized under `.specify/specs/`:
136
+
137
+ ```
138
+ .specify/
139
+ ├── memory/
140
+ │ └── constitution.md Project constitution
141
+ └── specs/
142
+ └── 001-feature-name/
143
+ ├── spec.md What to build
144
+ ├── testcases.md How to verify
145
+ ├── plan.md How to implement
146
+ └── tasks.md When to implement (task breakdown)
147
+ ```
148
+
149
+ ### Document Responsibilities
150
+
151
+ | Document | Answers | Does NOT contain |
152
+ |----------|---------|-----------------|
153
+ | `spec.md` | What to build and why | Technical implementation details |
154
+ | `testcases.md` | How to verify correctness | Implementation code |
155
+ | `plan.md` | How to implement technically | Specific code |
156
+ | `tasks.md` | When to implement (task order) | Implementation details |
157
+
158
+ ## How It Works with Claude Code
159
+
160
+ SDD Workflow installs as a set of Claude Code skills. Skills are markdown files that Claude Code reads as instructions when you invoke them with `/command-name`.
161
+
162
+ ### Skill Lifecycle
163
+
164
+ 1. `npx sdd-workflow` copies skill files into `.claude/skills/`
165
+ 2. Claude Code discovers skills automatically from that directory
166
+ 3. You invoke a skill with `/sdd-<name>` in the Claude Code CLI
167
+ 4. Claude Code reads the skill instructions and follows them
168
+ 5. Skills reference templates from `.specify/templates/` and the constitution from `.specify/memory/`
169
+
170
+ ### Agent Teams
171
+
172
+ The package also includes team configurations for multi-agent collaboration. Teams are useful for complex tasks that benefit from multiple perspectives:
173
+
174
+ - **Feature Development Team** (5 roles) -- full-stack feature implementation
175
+ - **Code Review Team** (3 roles) -- security, performance, quality review
176
+ - **Debug Team** (4 roles) -- complex bug investigation with adversarial reasoning
177
+ - **Research Team** (3 roles) -- technical evaluation and architecture assessment
178
+ - **SDD Planning Team** (4 roles) -- collaborative specification and planning
179
+
180
+ Enable teams by setting `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your environment.
181
+
182
+ ## Configuration Guide
183
+
184
+ ### CLAUDE.md Integration
185
+
186
+ After installation, add a section to your project's `CLAUDE.md` (if it exists) so Claude Code always knows SDD is active:
187
+
188
+ ```markdown
189
+ ## SDD Workflow
190
+
191
+ This project uses SDD (Specification-Driven Development).
192
+
193
+ ### Quick Start
194
+ 1. `/sdd-init` -- Initialize SDD for this project (first time only)
195
+ 2. `/sdd-run <id> <description>` -- Full auto pipeline (recommended)
196
+ 3. Or use individual commands: /sdd-specify, /sdd-testcases, /sdd-plan, /sdd-tasks, /sdd-implement, /sdd-review
197
+
198
+ ### Document Structure
199
+ - `.specify/memory/constitution.md` -- Project constitution
200
+ - `.specify/specs/<id>-<name>/` -- Feature specifications
201
+ ```
202
+
203
+ ### .gitignore
204
+
205
+ Consider adding:
206
+
207
+ ```
208
+ .specify/specs/ # Feature specs (project-specific, regenerable)
209
+ .specify/memory/ # Project memory (local context)
210
+ ```
211
+
212
+ ### Customization
213
+
214
+ - **Templates**: Edit files in `.specify/templates/` to match your team's documentation style
215
+ - **Constitution**: Edit `.specify/memory/constitution.md` to add project-specific rules
216
+ - **Skills**: Modify any skill in `.claude/skills/sdd-*/SKILL.md` to adjust behavior
217
+
218
+ ## Requirements
219
+
220
+ - [Claude Code](https://claude.ai/claude-code) CLI
221
+ - Node.js >= 14.0.0 (for installation only)
222
+ - Git (recommended)
223
+
224
+ ## License
225
+
226
+ MIT
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * SDD Workflow - Installation CLI
5
+ *
6
+ * Usage:
7
+ * npx sdd-workflow # Install SDD workflow to current project
8
+ * npx sdd-workflow --force # Overwrite existing files
9
+ * npx sdd-workflow --dry-run # Preview what would be installed
10
+ * npx sdd-workflow --update # Incremental update (only changed files)
11
+ * npx sdd-workflow --update --dry-run # Preview updates
12
+ */
13
+
14
+ const path = require('path');
15
+ const fs = require('fs');
16
+ const { install } = require('../src/installer');
17
+
18
+ const args = process.argv.slice(2);
19
+ const options = {
20
+ force: args.includes('--force'),
21
+ dryRun: args.includes('--dry-run'),
22
+ update: args.includes('--update'),
23
+ help: args.includes('--help') || args.includes('-h'),
24
+ };
25
+
26
+ if (options.help) {
27
+ console.log(`
28
+ SDD Workflow Installer
29
+
30
+ Usage:
31
+ npx sdd-workflow Install SDD workflow to current project
32
+ npx sdd-workflow --force Overwrite all existing files
33
+ npx sdd-workflow --dry-run Preview what would be installed
34
+ npx sdd-workflow --update Incremental update (only changed files)
35
+ npx sdd-workflow --update --dry-run Preview what would be updated
36
+
37
+ What gets installed:
38
+ .claude/skills/sdd-*/ 10 SDD skills for Claude Code
39
+ .specify/ Templates, scripts, and specs directory
40
+ .claude/teams/ Team configuration templates
41
+
42
+ Update modes:
43
+ (default) Skip existing files (safe, non-destructive)
44
+ --update Smart update: auto-update source-changed files, skip user-customized files
45
+ --force Overwrite everything (resets to default, loses customizations)
46
+
47
+ After installation:
48
+ 1. Open Claude Code in your project
49
+ 2. Run /sdd-init to generate project constitution
50
+ 3. Start using SDD workflow with /sdd-specify, /sdd-plan, etc.
51
+ `);
52
+ process.exit(0);
53
+ }
54
+
55
+ const targetDir = process.cwd();
56
+ install(targetDir, options).catch((err) => {
57
+ console.error('Installation failed:', err.message);
58
+ process.exit(1);
59
+ });
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "sdd-workflow",
3
+ "version": "1.1.0",
4
+ "description": "SDD (Specification-Driven Development) workflow toolkit for Claude Code - install skills, templates and tooling to any project",
5
+ "bin": {
6
+ "sdd-init": "./bin/sdd-init.js",
7
+ "sdd-workflow": "./bin/sdd-init.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "src/",
12
+ "templates/"
13
+ ],
14
+ "scripts": {
15
+ "test": "echo \"Error: no test specified\" && exit 1"
16
+ },
17
+ "keywords": [
18
+ "sdd",
19
+ "claude-code",
20
+ "ai-workflow",
21
+ "specification-driven",
22
+ "tdd",
23
+ "code-review"
24
+ ],
25
+ "author": "",
26
+ "license": "MIT",
27
+ "engines": {
28
+ "node": ">=14.0.0"
29
+ }
30
+ }