create-sdd-project 0.2.2 → 0.3.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 (44) hide show
  1. package/README.md +120 -110
  2. package/lib/config.js +2 -2
  3. package/lib/generator.js +7 -28
  4. package/lib/init-generator.js +48 -37
  5. package/lib/init-wizard.js +2 -1
  6. package/lib/scanner.js +16 -0
  7. package/package.json +1 -1
  8. package/template/.claude/agents/backend-developer.md +1 -1
  9. package/template/.claude/agents/frontend-developer.md +1 -1
  10. package/template/.claude/settings.json +1 -1
  11. package/template/.claude/skills/bug-workflow/SKILL.md +2 -2
  12. package/template/.claude/skills/development-workflow/SKILL.md +18 -18
  13. package/template/.claude/skills/development-workflow/references/add-feature-template.md +16 -0
  14. package/template/.claude/skills/development-workflow/references/branching-strategy.md +1 -1
  15. package/template/.claude/skills/development-workflow/references/complexity-guide.md +6 -6
  16. package/template/.claude/skills/development-workflow/references/failure-handling.md +3 -3
  17. package/template/.claude/skills/development-workflow/references/pr-template.md +3 -3
  18. package/template/.claude/skills/development-workflow/references/ticket-template.md +3 -3
  19. package/template/.claude/skills/development-workflow/references/workflow-example.md +7 -7
  20. package/template/.claude/skills/project-memory/SKILL.md +9 -9
  21. package/template/.gemini/agents/backend-developer.md +1 -1
  22. package/template/.gemini/agents/frontend-developer.md +1 -1
  23. package/template/.gemini/commands/add-feature.toml +2 -0
  24. package/template/.gemini/commands/next-task.toml +2 -2
  25. package/template/.gemini/commands/show-progress.toml +2 -2
  26. package/template/.gemini/commands/start-task.toml +1 -1
  27. package/template/.gemini/skills/bug-workflow/SKILL.md +4 -4
  28. package/template/.gemini/skills/development-workflow/SKILL.md +18 -18
  29. package/template/.gemini/skills/development-workflow/references/add-feature-template.md +16 -0
  30. package/template/.gemini/skills/development-workflow/references/branching-strategy.md +1 -1
  31. package/template/.gemini/skills/development-workflow/references/complexity-guide.md +6 -6
  32. package/template/.gemini/skills/development-workflow/references/failure-handling.md +3 -3
  33. package/template/.gemini/skills/development-workflow/references/pr-template.md +3 -3
  34. package/template/.gemini/skills/development-workflow/references/ticket-template.md +3 -3
  35. package/template/.gemini/skills/development-workflow/references/workflow-example.md +7 -7
  36. package/template/.gemini/skills/project-memory/SKILL.md +8 -8
  37. package/template/AGENTS.md +5 -5
  38. package/template/CLAUDE.md +2 -2
  39. package/template/ai-specs/specs/base-standards.mdc +8 -8
  40. package/template/docs/project_notes/product-tracker.md +56 -0
  41. package/template/.claude/skills/development-workflow/references/sprint-init-template.md +0 -82
  42. package/template/.gemini/commands/init-sprint.toml +0 -2
  43. package/template/.gemini/skills/development-workflow/references/sprint-init-template.md +0 -82
  44. package/template/docs/project_notes/sprint-0-tracker.md +0 -66
package/README.md CHANGED
@@ -1,18 +1,67 @@
1
1
  # SDD DevFlow
2
2
 
3
- **Spec-Driven Development workflow template for AI-assisted coding.**
3
+ [![npm version](https://img.shields.io/npm/v/create-sdd-project)](https://www.npmjs.com/package/create-sdd-project)
4
+ [![license](https://img.shields.io/npm/l/create-sdd-project)](LICENSE)
5
+ [![node](https://img.shields.io/node/v/create-sdd-project)](package.json)
4
6
 
5
- A development methodology designed for Claude Code and Gemini that combines specialized AI agents, workflow orchestration with human checkpoints, and institutional memory. Built for creating robust, maintainable, and scalable TypeScript projects.
7
+ **Spec-Driven Development workflow for AI-assisted coding.**
8
+
9
+ A complete development methodology for Claude Code and Gemini that combines specialized AI agents, workflow orchestration with human checkpoints, and institutional memory. Works with new and existing TypeScript/JavaScript projects.
10
+
11
+ ## Quick Start
12
+
13
+ ### New Project
14
+
15
+ ```bash
16
+ npx create-sdd-project my-app
17
+ ```
18
+
19
+ The interactive wizard asks about your stack, AI tools, and autonomy level. For defaults (fullstack Express+Next.js):
20
+
21
+ ```bash
22
+ npx create-sdd-project my-app --yes
23
+ ```
24
+
25
+ ### Existing Project
26
+
27
+ ```bash
28
+ cd your-existing-project
29
+ npx create-sdd-project --init
30
+ ```
31
+
32
+ Scans your project, detects your stack and architecture, and installs SDD files adapted to your project. Never modifies existing code or overwrites existing files.
33
+
34
+ ### After Setup
35
+
36
+ Open in your AI coding tool and run:
37
+
38
+ ```
39
+ add feature "your first feature"
40
+ start task F001
41
+ ```
42
+
43
+ The workflow skill guides you through each step with checkpoints based on your autonomy level.
44
+
45
+ ---
6
46
 
7
47
  ## What is SDD?
8
48
 
9
49
  SDD DevFlow combines three proven practices:
10
50
 
11
51
  1. **Spec-Driven Development** — Write specifications before code. Specs are the contract between planning and implementation.
12
- 2. **Test-Driven Development** — Red-Green-Refactor cycle for every feature. Tests define expected behavior before implementation.
13
- 3. **Human-in-the-Loop** — Strategic checkpoints (spec, ticket, plan, commit, merge) with configurable autonomy levels that reduce human intervention as trust increases.
52
+ 2. **Test-Driven Development** — Red-Green-Refactor cycle for every feature.
53
+ 3. **Human-in-the-Loop** — Strategic checkpoints with configurable autonomy levels that reduce human intervention as trust increases.
54
+
55
+ ### Why use SDD DevFlow?
56
+
57
+ - **AI agents work better with structure.** Without guardrails, AI coding assistants produce inconsistent results. SDD provides the methodology, standards, and workflow that make AI output predictable and high-quality.
58
+ - **Institutional memory across sessions.** Product tracker, bug logs, and decision records survive context compaction and session boundaries.
59
+ - **Scales from solo to team.** Start at L1 (full control) while learning, scale to L4 (full auto) for repetitive tasks.
60
+ - **Works with your stack.** Not opinionated about frameworks — detects and adapts to Express, Fastify, NestJS, Next.js, Nuxt, Vue, Angular, and many more.
61
+
62
+ ---
14
63
 
15
- ## What's Inside
64
+ ## What's Included
16
65
 
17
66
  ### 9 Specialized Agents
18
67
 
@@ -26,126 +75,86 @@ SDD DevFlow combines three proven practices:
26
75
  | `qa-engineer` | Edge cases, spec verification | 5 |
27
76
  | `database-architect` | Schema design, optimization | Any |
28
77
 
78
+ ### 3 Skills (Slash Commands)
79
+
80
+ | Skill | Trigger | What it does |
81
+ |-------|---------|-------------|
82
+ | `development-workflow` | `start task F001`, `next task`, `add feature` | Orchestrates the complete 7-step workflow |
83
+ | `bug-workflow` | `report bug`, `fix bug`, `hotfix needed` | Bug triage, investigation, and resolution |
84
+ | `project-memory` | `set up project memory`, `log a bug fix` | Maintains institutional knowledge |
85
+
29
86
  ### Workflow (Steps 0–6)
30
87
 
31
88
  ```
32
- 0. SPEC → spec-creator drafts specs → Spec Approval (Std/Cplx)
33
- 1. SETUP → Branch, ticket, sprint tracker → Ticket Approval (Std/Cplx)
34
- 2. PLAN → Planner creates implementation plan → Plan Approval (Std/Cplx)
89
+ 0. SPEC → spec-creator drafts specs → Spec Approval
90
+ 1. SETUP → Branch, ticket, product tracker → Ticket Approval
91
+ 2. PLAN → Planner creates implementation plan → Plan Approval
35
92
  3. IMPLEMENT → Developer agent, TDD
36
93
  4. FINALIZE → Tests/lint/build, validator → Commit Approval
37
94
  5. REVIEW → PR, code review, QA → Merge Approval
38
95
  6. COMPLETE → Clean up, update tracker
39
96
  ```
40
97
 
41
- **Step flow by complexity:**
42
- - **Simple**: 1 → 3 → 4 → 5 → 6
43
- - **Standard**: 0 → 1 → 2 → 3 → 4 → 5 (+QA) → 6
44
- - **Complex**: 0 → 1 (+ADR) → 2 → 3 → 4 → 5 (+QA) → 6
45
-
46
- ### 3 Complexity Tiers
47
-
48
- | Tier | Spec | Ticket | Plan | QA |
49
- |------|:----:|:------:|:----:|:--:|
50
- | Simple | Skip | Skip | Skip | Skip |
51
- | Standard | Yes | Yes | Yes | Yes |
52
- | Complex | Yes | Yes + ADR | Yes | Yes |
98
+ **By complexity:**
99
+ - **Simple** (bug fixes, small tweaks): 1 → 3 → 4 → 5 → 6
100
+ - **Standard** (features): 0 → 1 → 2 → 3 → 4 → 5 (+QA) → 6
101
+ - **Complex** (architectural changes): 0 → 1 (+ADR) → 2 → 3 → 4 → 5 (+QA) → 6
53
102
 
54
103
  ### 4 Autonomy Levels
55
104
 
56
- Control how many human approval checkpoints are active:
57
-
58
105
  | Level | Name | Human Checkpoints | Best For |
59
106
  |-------|------|-------------------|----------|
60
- | L1 | Full Control | All 5 | First sprint, learning SDD |
107
+ | L1 | Full Control | All 5 | First feature, learning SDD |
61
108
  | L2 | Trusted | Plan + Merge | Normal development **(default)** |
62
109
  | L3 | Autopilot | Merge only | Well-defined, repetitive tasks |
63
110
  | L4 | Full Auto | None (CI/CD gates only) | Bulk simple tasks |
64
111
 
65
112
  Quality gates (tests, lint, build, validators) **always run** regardless of level.
66
113
 
67
- ### Branching Strategy
68
-
69
- Configurable per-project in `key_facts.md`:
70
-
71
- - **GitHub Flow** (default): `main` + `feature/*` + `hotfix/*`. Best for MVPs.
72
- - **GitFlow** (scaled): `main` + `develop` + `feature/*` + `release/*` + `hotfix/*`. For larger projects.
73
-
74
114
  ### Project Memory
75
115
 
76
116
  Tracks institutional knowledge across sessions in `docs/project_notes/`:
77
117
 
78
- - **sprint-X-tracker.md** — Sprint progress + Active Session (context recovery after compaction)
118
+ - **product-tracker.md** — Feature backlog + Active Session (context recovery after compaction)
79
119
  - **bugs.md** — Bug log with solutions and prevention notes
80
120
  - **decisions.md** — Architectural Decision Records (ADRs)
81
121
  - **key_facts.md** — Project configuration, ports, URLs, branching strategy
82
122
 
83
123
  ### Automated Hooks (Claude Code)
84
124
 
85
- - **Quick Scan** — After developer agents finish, a fast grep-based scan (~2s, no API calls) checks for debug code, secrets, and TODOs. Critical issues block; warnings pass through.
86
- - **Compaction Recovery** — After context compaction, injects a reminder to read the sprint tracker for context recovery.
87
- - **Notifications** — Personal notification hooks (macOS/Linux) in `.claude/settings.local.json`.
125
+ - **Quick Scan** — After developer agents finish, a fast grep-based scan (~2s, no API calls) checks for debug code, secrets, and TODOs
126
+ - **Compaction Recovery** — After context compaction, injects a reminder to read the product tracker for context recovery
88
127
 
89
128
  ### Multi-Tool Support
90
129
 
91
- - **Claude Code**: Full support with agents, skills, hooks, and settings (`.claude/`)
92
- - **Gemini**: Adapted agent format (`.gemini/`), same methodology via `ai-specs/specs/`
93
- - **Other tools**: `AGENTS.md` provides universal instructions readable by 21+ AI coding tools
130
+ | Tool | Support Level |
131
+ |------|--------------|
132
+ | **Claude Code** | Full agents, skills, hooks, settings (`.claude/`) |
133
+ | **Gemini** | Full — agents, skills, commands, settings (`.gemini/`) |
134
+ | **Other AI tools** | `AGENTS.md` provides universal instructions (Cursor, Copilot, Windsurf, etc.) |
94
135
 
95
- ## Quick Start
136
+ ---
96
137
 
97
- ### Option A: New Project (recommended)
138
+ ## `--init` Stack Detection
98
139
 
99
- ```bash
100
- npx create-sdd-project my-app
101
- ```
102
-
103
- The interactive wizard guides you through:
104
-
105
- 1. **Project basics** — name, description, business context
106
- 2. **Tech stack** — backend (Express+Prisma+PG, Express+MongoDB, or custom), frontend (Next.js+Tailwind or custom), or both
107
- 3. **Configuration** — AI tools (Claude/Gemini/both), autonomy level (L1-L4), branching strategy
108
-
109
- Non-interactive mode with defaults:
110
- ```bash
111
- npx create-sdd-project my-app --yes
112
- ```
113
-
114
- ### Option B: Existing Project
115
-
116
- Add SDD DevFlow to a project that already has code:
117
-
118
- ```bash
119
- cd your-existing-project
120
- npx create-sdd-project --init
121
- ```
122
-
123
- The `--init` flag:
124
- - **Scans** your project: detects stack (Express, Next.js, Prisma, etc.), architecture (MVC, DDD, feature-based), tests, and existing docs
125
- - **Adapts** standards files to match your real architecture (not generic DDD defaults)
126
- - **Imports** existing OpenAPI/Swagger specs and references Prisma schemas
127
- - **Audits** test coverage and suggests retrofit testing tasks if coverage is low
128
- - **Never** modifies your existing code or overwrites existing files
129
-
130
- ### After setup
131
-
132
- ```
133
- # Open in your AI coding tool and run:
134
- init sprint 0
135
- start task B0.1
136
- ```
140
+ When running `--init` on an existing project, the scanner automatically detects:
137
141
 
138
- The workflow skill will guide you through each step with checkpoints based on your autonomy level.
142
+ | Category | Detected |
143
+ |----------|----------|
144
+ | **Backend frameworks** | Express, Fastify, Koa, NestJS, Hapi, AdonisJS |
145
+ | **ORMs** | Prisma, Mongoose, TypeORM, Sequelize, Drizzle, Knex, MikroORM, Objection.js |
146
+ | **Databases** | PostgreSQL, MySQL, SQLite, MongoDB, SQL Server, CockroachDB (from Prisma schema, `.env`, or dependencies) |
147
+ | **Frontend frameworks** | Next.js, Nuxt, Remix, Astro, SolidJS, React, Vue, Angular, Svelte |
148
+ | **Styling** | Tailwind CSS, styled-components, Emotion, Sass |
149
+ | **Component libraries** | Radix UI, Headless UI, Material UI, Chakra UI, Ant Design |
150
+ | **State management** | Zustand, Redux, Jotai, TanStack Query, Recoil, Pinia, MobX |
151
+ | **Testing** | Jest, Vitest, Mocha (unit) + Playwright, Cypress (e2e) |
152
+ | **Architecture** | MVC, DDD, feature-based, handler-based, flat |
153
+ | **Project type** | Monorepo (workspaces, Lerna, Turbo, pnpm) or single-package |
139
154
 
140
- ### Manual Setup (alternative)
155
+ Standards files are adapted to match your actual architecture — not generic defaults.
141
156
 
142
- If you prefer manual configuration, copy the template directly:
143
-
144
- ```bash
145
- cp -r template/ /path/to/your-project/
146
- ```
147
-
148
- Then look for `<!-- CONFIG: ... -->` comments in the files to customize.
157
+ ---
149
158
 
150
159
  ## Template Structure
151
160
 
@@ -155,7 +164,6 @@ project/
155
164
  ├── CLAUDE.md # Claude Code config (autonomy, recovery)
156
165
  ├── GEMINI.md # Gemini config (autonomy)
157
166
  ├── .env.example # Environment variables template
158
- ├── .gitignore # Git ignore with secrets protection
159
167
 
160
168
  ├── .claude/
161
169
  │ ├── agents/ # 9 specialized agents
@@ -165,45 +173,37 @@ project/
165
173
  │ │ ├── bug-workflow/ # Bug triage and resolution
166
174
  │ │ └── project-memory/ # Memory system setup
167
175
  │ ├── hooks/quick-scan.sh # Post-developer quality scan
168
- ├── settings.json # Shared hooks (git-tracked)
169
- │ └── settings.local.json # Personal hooks (gitignored)
176
+ └── settings.json # Shared hooks (git-tracked)
170
177
 
171
178
  ├── .gemini/
172
179
  │ ├── agents/ # 9 agents (Gemini format)
173
- │ ├── skills/
174
- │ │ ├── development-workflow/ # Main task workflow (Steps 0-6)
175
- │ │ │ └── references/ # Templates, guides, examples
176
- │ │ ├── bug-workflow/ # Bug triage and resolution
177
- │ │ └── project-memory/ # Memory system setup
180
+ │ ├── skills/ # Same 3 skills
178
181
  │ ├── commands/ # Slash command shortcuts
179
- ├── settings.json # Gemini configuration
180
- │ └── styles/default.md # Response style
182
+ └── settings.json # Gemini configuration
181
183
 
182
184
  ├── ai-specs/specs/
183
185
  │ ├── base-standards.mdc # Constitution + methodology
184
- │ ├── backend-standards.mdc # Backend patterns (DDD, Express, Prisma)
185
- │ ├── frontend-standards.mdc # Frontend patterns (Next.js, Tailwind, Radix)
186
- │ └── documentation-standards.mdc # Documentation update rules
186
+ │ ├── backend-standards.mdc # Backend patterns
187
+ │ ├── frontend-standards.mdc # Frontend patterns
188
+ │ └── documentation-standards.mdc # Documentation rules
187
189
 
188
190
  └── docs/
189
191
  ├── project_notes/ # Project memory
190
- │ ├── sprint-0-tracker.md # Sprint tracker template
191
- │ ├── key_facts.md # Project configuration
192
- │ ├── bugs.md # Bug log
193
- │ └── decisions.md # ADRs
194
- ├── specs/
195
- │ ├── api-spec.yaml # OpenAPI spec (backend)
196
- │ └── ui-components.md # Component spec (frontend)
197
- └── tickets/ # Task tickets (generated by workflow)
192
+ │ ├── product-tracker.md
193
+ │ ├── key_facts.md
194
+ │ ├── bugs.md
195
+ │ └── decisions.md
196
+ ├── specs/ # API and UI specs
197
+ └── tickets/ # Task tickets (workflow-generated)
198
198
  ```
199
199
 
200
200
  ## Default Tech Stack
201
201
 
202
- The template defaults to (configurable via `<!-- CONFIG -->` comments):
202
+ Configurable via the wizard or `<!-- CONFIG -->` comments in template files:
203
203
 
204
204
  - **Backend**: Node.js + Express + Prisma + PostgreSQL
205
205
  - **Frontend**: Next.js (App Router) + Tailwind CSS + Radix UI + Zustand
206
- - **Shared Types**: Zod schemas in `shared/` workspace → `z.infer<>` for TypeScript types
206
+ - **Shared Types**: Zod schemas with `z.infer<>` for TypeScript types
207
207
  - **Testing**: Jest (unit) + Playwright (e2e)
208
208
  - **Methodology**: TDD + DDD + Spec-Driven Development
209
209
 
@@ -224,10 +224,20 @@ These 6 principles apply to ALL tasks, ALL agents, ALL complexity levels:
224
224
  - Node.js 18+
225
225
  - `jq` (for quick-scan hook): `brew install jq` (macOS) or `apt install jq` (Linux)
226
226
 
227
+ ## Manual Setup (Alternative)
228
+
229
+ If you prefer manual configuration over the CLI wizard:
230
+
231
+ ```bash
232
+ cp -r template/ /path/to/your-project/
233
+ ```
234
+
235
+ Then look for `<!-- CONFIG: ... -->` comments in the files to customize.
236
+
227
237
  ## Roadmap
228
238
 
229
239
  - **Agent Teams**: Parallel execution of independent tasks (waiting for Claude Code Agent Teams to stabilize)
230
- - **PM Agent + L5 Autonomous**: AI-driven sprint orchestration with human review at sprint boundaries
240
+ - **PM Agent + L5 Autonomous**: AI-driven feature orchestration with human review at milestone boundaries
231
241
  - **Retrofit Testing**: Automated test generation for existing projects with low coverage
232
242
 
233
243
  ## License
package/lib/config.js CHANGED
@@ -78,8 +78,8 @@ const AI_TOOLS = [
78
78
  ];
79
79
 
80
80
  const AUTONOMY_LEVELS = [
81
- { level: 1, name: 'Full Control', desc: 'Human approves every checkpoint (first sprint, learning SDD)' },
82
- { level: 2, name: 'Trusted', desc: 'Human reviews plans + merges only (default, normal development)', default: true },
81
+ { level: 1, name: 'Full Control', desc: 'Human approves every checkpoint (first feature, learning SDD)' },
82
+ { level: 2, name: 'Trusted', desc: 'Human reviews plans + merges only (normal development)', default: true },
83
83
  { level: 3, name: 'Autopilot', desc: 'Human only approves merges (well-defined, repetitive tasks)' },
84
84
  { level: 4, name: 'Full Auto', desc: 'No human checkpoints, CI/CD gates only (bulk simple tasks)' },
85
85
  ];
package/lib/generator.js CHANGED
@@ -41,11 +41,7 @@ function generate(config) {
41
41
  step(`Setting branching: ${config.branching}`);
42
42
  updateBranching(dest, config);
43
43
 
44
- // 6. Set sprint dates
45
- step('Setting sprint dates to today');
46
- updateSprintDates(dest);
47
-
48
- // 7. Remove agents/specs based on project type
44
+ // 6. Remove agents/specs based on project type
49
45
  if (config.projectType === 'backend') {
50
46
  step('Removing frontend agents (backend only)');
51
47
  removeFrontendFiles(dest, config);
@@ -54,7 +50,7 @@ function generate(config) {
54
50
  removeBackendFiles(dest, config);
55
51
  }
56
52
 
57
- // 8. Remove AI tool config if single tool selected
53
+ // 7. Remove AI tool config if single tool selected
58
54
  if (config.aiTools === 'claude') {
59
55
  step('Removing Gemini config (Claude only)');
60
56
  fs.rmSync(path.join(dest, '.gemini'), { recursive: true, force: true });
@@ -76,7 +72,7 @@ function generate(config) {
76
72
  console.log(`\nDone! Next steps:`);
77
73
  console.log(` cd ${path.relative(process.cwd(), dest)}`);
78
74
  console.log(` git init && git add -A && git commit -m "chore: initialize SDD DevFlow project"`);
79
- console.log(` # Open in your AI coding tool and run: init sprint 0\n`);
75
+ console.log(` # Open in your AI coding tool and run: add feature "your first feature"\n`);
80
76
  }
81
77
 
82
78
  // --- Helpers ---
@@ -230,19 +226,6 @@ function updateBranching(dest, config) {
230
226
  // Nothing else to update — branching is read from key_facts.md at runtime
231
227
  }
232
228
 
233
- function updateSprintDates(dest) {
234
- const file = path.join(dest, 'docs', 'project_notes', 'sprint-0-tracker.md');
235
- const today = new Date().toISOString().split('T')[0];
236
- // Calculate 2-week sprint end
237
- const endDate = new Date();
238
- endDate.setDate(endDate.getDate() + 14);
239
- const end = endDate.toISOString().split('T')[0];
240
-
241
- replaceInFile(file, [
242
- [/\[YYYY-MM-DD\] to \[YYYY-MM-DD\]/, `${today} to ${end}`],
243
- ]);
244
- }
245
-
246
229
  function removeFrontendFiles(dest, config) {
247
230
  // Remove frontend agents
248
231
  for (const agent of FRONTEND_AGENTS) {
@@ -262,11 +245,7 @@ function removeFrontendFiles(dest, config) {
262
245
  ['├── frontend/ ← Frontend (has its own package.json)\n', ''],
263
246
  ]);
264
247
 
265
- // Remove frontend tasks from sprint tracker
266
- const trackerFile = path.join(dest, 'docs', 'project_notes', 'sprint-0-tracker.md');
267
- replaceInFile(trackerFile, [
268
- [/\n### Frontend\n\n\|.*\n\|.*\n\|.*\n/, '\n'],
269
- ]);
248
+ // Product tracker already defaults to backend — no change needed
270
249
  }
271
250
 
272
251
  function removeBackendFiles(dest, config) {
@@ -288,10 +267,10 @@ function removeBackendFiles(dest, config) {
288
267
  ['├── backend/ ← Backend (has its own package.json)\n', ''],
289
268
  ]);
290
269
 
291
- // Remove backend tasks from sprint tracker
292
- const trackerFile = path.join(dest, 'docs', 'project_notes', 'sprint-0-tracker.md');
270
+ // Update product tracker default feature type to frontend
271
+ const trackerFile = path.join(dest, 'docs', 'project_notes', 'product-tracker.md');
293
272
  replaceInFile(trackerFile, [
294
- [/\n### Backend\n\n\|.*\n\|.*\n\|.*\n/, '\n'],
273
+ ['| backend | pending', '| frontend | pending'],
295
274
  ]);
296
275
  }
297
276
 
@@ -72,7 +72,7 @@ function generateInit(config) {
72
72
  }
73
73
 
74
74
  // 3. Copy and configure docs/
75
- step('Creating docs/project_notes/ (sprint tracker, memory)');
75
+ step('Creating docs/project_notes/ (product tracker, memory)');
76
76
  ensureDir(path.join(dest, 'docs', 'project_notes'));
77
77
  ensureDir(path.join(dest, 'docs', 'specs'));
78
78
  ensureDir(path.join(dest, 'docs', 'tickets'));
@@ -99,14 +99,14 @@ function generateInit(config) {
99
99
  skipped
100
100
  );
101
101
 
102
- // sprint-0-tracker.md — configure dates and add retrofit tasks
103
- const trackerPath = path.join(dest, 'docs', 'project_notes', 'sprint-0-tracker.md');
102
+ // product-tracker.md — configure and add retrofit tasks
103
+ const trackerPath = path.join(dest, 'docs', 'project_notes', 'product-tracker.md');
104
104
  if (!fs.existsSync(trackerPath)) {
105
- const template = fs.readFileSync(path.join(templateDir, 'docs', 'project_notes', 'sprint-0-tracker.md'), 'utf8');
106
- const configured = configureSprintTracker(template, scan);
105
+ const template = fs.readFileSync(path.join(templateDir, 'docs', 'project_notes', 'product-tracker.md'), 'utf8');
106
+ const configured = configureProductTracker(template, scan);
107
107
  fs.writeFileSync(trackerPath, configured, 'utf8');
108
108
  } else {
109
- skipped.push('docs/project_notes/sprint-0-tracker.md');
109
+ skipped.push('docs/project_notes/product-tracker.md');
110
110
  }
111
111
 
112
112
  // docs/specs/
@@ -195,7 +195,7 @@ function generateInit(config) {
195
195
 
196
196
  // Show review notes
197
197
  console.log('');
198
- console.log(' ⚠ REVIEW BEFORE YOUR FIRST SPRINT:');
198
+ console.log(' ⚠ REVIEW BEFORE YOUR FIRST FEATURE:');
199
199
  if (config.projectType !== 'frontend') {
200
200
  console.log(' - ai-specs/specs/backend-standards.mdc — Architecture section adapted from scan');
201
201
  }
@@ -214,7 +214,7 @@ function generateInit(config) {
214
214
  } else {
215
215
  console.log(` 📝 Test coverage appears low (${fileCount} test files found).`);
216
216
  }
217
- console.log(' Consider starting Sprint 0 with retrofit testing tasks.');
217
+ console.log(' Consider adding retrofit testing as your first feature.');
218
218
  }
219
219
 
220
220
  // Prisma schema note
@@ -226,7 +226,7 @@ function generateInit(config) {
226
226
  // Done
227
227
  console.log(`\nDone! Next steps:`);
228
228
  console.log(` git add -A && git commit -m "chore: add SDD DevFlow to existing project"`);
229
- console.log(` # Open in your AI coding tool and run: init sprint 0\n`);
229
+ console.log(` # Open in your AI coding tool and run: add feature "your first feature"\n`);
230
230
  }
231
231
 
232
232
  // --- Helpers ---
@@ -305,9 +305,10 @@ function adaptBackendStandards(template, scan) {
305
305
  '<!-- TODO: Review and adjust the sections below to match your project\'s conventions. -->\n<!-- This file was generated from project analysis by create-sdd-project --init. -->'
306
306
  );
307
307
 
308
- // Update globs in frontmatter
308
+ // Update globs in frontmatter — only include tsx/jsx if frontend detected
309
309
  const srcRoot = findSrcRootName(scan);
310
- const globPattern = srcRoot ? `${srcRoot}/**/*.{ts,js,tsx,jsx}` : '**/*.{ts,js,tsx,jsx}';
310
+ const exts = scan.frontend.detected ? 'ts,js,tsx,jsx' : 'ts,js';
311
+ const globPattern = srcRoot ? `${srcRoot}/**/*.{${exts}}` : `**/*.{${exts}}`;
311
312
  content = content.replace(
312
313
  /globs: \[.*?\]/,
313
314
  `globs: ["${globPattern}"]`
@@ -373,6 +374,21 @@ function adaptBackendStandards(template, scan) {
373
374
  );
374
375
  }
375
376
 
377
+ // Adapt Validation section based on detected validation library
378
+ if (scan.backend.validation && scan.backend.validation !== 'Zod') {
379
+ // Has a validator, but not Zod — replace with detected library name
380
+ content = content.replace(
381
+ /## Validation\n\n[\s\S]*?(?=\n## Database Patterns)/,
382
+ `## Validation\n\n- Validate all inputs at the application layer using ${scan.backend.validation}\n- Validate before executing business logic\n- Return descriptive validation errors\n\n<!-- TODO: Add ${scan.backend.validation} validation patterns for your project. -->\n\n`
383
+ );
384
+ } else if (!scan.backend.validation) {
385
+ // No validation library detected — generic guidance
386
+ content = content.replace(
387
+ /## Validation\n\n[\s\S]*?(?=\n## Database Patterns)/,
388
+ `## Validation\n\n- Validate all inputs at the application layer\n- Validate before executing business logic\n- Return descriptive validation errors\n\n<!-- TODO: Add validation patterns for your project (e.g., Zod, Joi, class-validator). -->\n\n`
389
+ );
390
+ }
391
+
376
392
  // Replace Prisma-specific references in Security and Performance sections
377
393
  if (scan.backend.orm !== 'Prisma') {
378
394
  content = content.replace(
@@ -499,6 +515,12 @@ function adaptAgentsMd(template, config, scan) {
499
515
  'Frontend patterns (Next.js, Tailwind, Radix)',
500
516
  `Frontend patterns (${parts.join(', ')})`
501
517
  );
518
+ } else {
519
+ // Remove frontend-standards reference for backend-only projects
520
+ content = content.replace(
521
+ /- \[Frontend Standards\].*\n/,
522
+ ''
523
+ );
502
524
  }
503
525
 
504
526
  return content;
@@ -624,40 +646,29 @@ function configureKeyFacts(template, config, scan) {
624
646
  return content;
625
647
  }
626
648
 
627
- // --- Sprint Tracker Configuration ---
649
+ // --- Product Tracker Configuration ---
628
650
 
629
- function configureSprintTracker(template, scan) {
651
+ function configureProductTracker(template, scan) {
630
652
  let content = template;
631
653
 
632
- // Set dates
633
- const today = new Date().toISOString().split('T')[0];
634
- const endDate = new Date();
635
- endDate.setDate(endDate.getDate() + 14);
636
- const end = endDate.toISOString().split('T')[0];
637
- content = content.replace(/\[YYYY-MM-DD\] to \[YYYY-MM-DD\]/, `${today} to ${end}`);
654
+ // Determine default feature type based on detected stack
655
+ const featureType = !scan.backend.detected && scan.frontend.detected
656
+ ? 'frontend'
657
+ : scan.backend.detected && scan.frontend.detected
658
+ ? 'fullstack'
659
+ : 'backend';
638
660
 
639
- // Remove irrelevant task tables based on detected stack
640
- if (!scan.frontend.detected) {
641
- content = content.replace(
642
- /\n### Frontend\n\n\| # \| Task \| Status \| Notes \|\n\|---\|------\|--------\|-------\|\n\| F0\.1 \| \[Task description\] \| ⬚ \| \|\n/,
643
- ''
644
- );
645
- }
646
- if (!scan.backend.detected) {
647
- content = content.replace(
648
- /\n### Backend\n\n\| # \| Task \| Status \| Notes \|\n\|---\|------\|--------\|-------\|\n\| B0\.1 \| \[Task description\] \| ⬚ \| \|\n/,
649
- ''
650
- );
661
+ // Update default feature type in the placeholder row
662
+ if (featureType !== 'backend') {
663
+ content = content.replace('| backend | pending', `| ${featureType} | pending`);
651
664
  }
652
665
 
653
- // Add retrofit testing tasks if coverage is low
666
+ // Add retrofit testing as first feature if coverage is low
654
667
  if (scan.tests.estimatedCoverage === 'none' || scan.tests.estimatedCoverage === 'low') {
655
- const retrofitSection = `\n### Retrofit Testing (recommended)\n\n| # | Task | Status | Notes |\n|---|------|--------|-------|\n| R0.1 | Audit existing test coverage | ⬚ | |\n| R0.2 | Add missing unit tests for critical paths | ⬚ | |\n| R0.3 | Set up CI test pipeline | ⬚ | |\n`;
656
-
657
- // Insert before Status Legend
668
+ // Use regex to match the F001 placeholder row resiliently (handles column changes)
658
669
  content = content.replace(
659
- '**Status Legend:**',
660
- `${retrofitSection}\n**Status Legend:**`
670
+ /\| F001 \|[^\n]*\n/,
671
+ `| F001 | Retrofit: audit and improve test coverage | ${featureType} | pending | — | Recommended — low test coverage detected |\n| F002 | [Feature description] | ${featureType} | pending | — | |\n`
661
672
  );
662
673
  }
663
674
 
@@ -33,6 +33,7 @@ function formatScanSummary(scanResult) {
33
33
  const patternLabels = {
34
34
  mvc: 'MVC',
35
35
  ddd: 'DDD (Domain-Driven Design)',
36
+ layered: 'Layered (controllers + handlers + managers)',
36
37
  'feature-based': 'Feature-based',
37
38
  'handler-based': 'Handler-based',
38
39
  flat: 'Flat structure',
@@ -219,7 +220,7 @@ async function runInitWizard(scanResult) {
219
220
 
220
221
  console.log('\n Files to be created:');
221
222
  console.log(' ai-specs/specs/ (4 files — standards adapted to your stack)');
222
- console.log(' docs/project_notes/ (4 files — sprint tracker, memory)');
223
+ console.log(' docs/project_notes/ (4 files — product tracker, memory)');
223
224
  console.log(' docs/specs/ (API spec, UI components)');
224
225
  console.log(' docs/tickets/ (.gitkeep)');
225
226
  if (config.aiTools !== 'gemini') {
package/lib/scanner.js CHANGED
@@ -121,6 +121,22 @@ function detectBackend(dir, pkg) {
121
121
  // Port detection
122
122
  result.port = detectPort(dir, pkg);
123
123
 
124
+ // Validation library detection
125
+ const validators = [
126
+ { dep: 'zod', label: 'Zod' },
127
+ { dep: 'joi', label: 'Joi' },
128
+ { dep: 'class-validator', label: 'class-validator' },
129
+ { dep: 'yup', label: 'Yup' },
130
+ { dep: 'ajv', label: 'Ajv' },
131
+ ];
132
+ result.validation = null;
133
+ for (const v of validators) {
134
+ if (deps[v.dep]) {
135
+ result.validation = v.label;
136
+ break;
137
+ }
138
+ }
139
+
124
140
  // If no framework but has a server-like structure, still mark as detected
125
141
  if (!result.detected && (result.orm || result.db)) {
126
142
  result.detected = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sdd-project",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Create a new SDD DevFlow project with AI-assisted development workflow",
5
5
  "bin": {
6
6
  "create-sdd-project": "bin/cli.js"
@@ -57,4 +57,4 @@ Follow the DDD layer order from the plan:
57
57
  - **ALWAYS** run `npm test` after each TDD cycle to verify
58
58
  - **NEVER** skip tests for "simple" code
59
59
  - **NEVER** modify code outside the scope of the current ticket
60
- - **ALWAYS** verify implementation matches the approved spec. If a deviation is needed, document it in the sprint tracker's Active Session and ask for approval
60
+ - **ALWAYS** verify implementation matches the approved spec. If a deviation is needed, document it in the product tracker's Active Session and ask for approval
@@ -65,4 +65,4 @@ Follow the logical order from the plan:
65
65
  - **ALWAYS** run `npm test` after each TDD cycle to verify
66
66
  - **NEVER** skip tests for "simple" components
67
67
  - **NEVER** modify code outside the scope of the current ticket
68
- - **ALWAYS** verify implementation matches the approved spec. If a deviation is needed, document it in the sprint tracker's Active Session and ask for approval
68
+ - **ALWAYS** verify implementation matches the approved spec. If a deviation is needed, document it in the product tracker's Active Session and ask for approval
@@ -19,7 +19,7 @@
19
19
  "hooks": [
20
20
  {
21
21
  "type": "command",
22
- "command": "echo '{\"additionalContext\": \"Context was compacted. BEFORE doing anything else: read the sprint tracker Active Session section (docs/project_notes/sprint-*-tracker.md) for context recovery. Follow the Session Recovery protocol in CLAUDE.md.\"}'",
22
+ "command": "echo '{\"additionalContext\": \"Context was compacted. BEFORE doing anything else: read the product tracker Active Session section (docs/project_notes/product-tracker.md) for context recovery. Follow the Session Recovery protocol in CLAUDE.md.\"}'",
23
23
  "statusMessage": "Injecting recovery context..."
24
24
  }
25
25
  ]