create-sdd-project 0.8.0 → 0.8.2

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/bin/cli.js CHANGED
@@ -38,9 +38,9 @@ function runDoctorCmd() {
38
38
 
39
39
  const cwd = process.cwd();
40
40
 
41
- // Validate: must be in an existing project
42
- if (!fs.existsSync(path.join(cwd, 'package.json'))) {
43
- console.error('Error: No package.json found in current directory.');
41
+ // Validate: must be in a project with SDD installed
42
+ if (!fs.existsSync(path.join(cwd, 'package.json')) && !fs.existsSync(path.join(cwd, 'ai-specs'))) {
43
+ console.error('Error: No package.json or ai-specs/ found in current directory.');
44
44
  console.error('The --doctor flag must be run from inside an existing project.');
45
45
  process.exit(1);
46
46
  }
@@ -142,13 +142,6 @@ async function runUpgrade() {
142
142
 
143
143
  const cwd = process.cwd();
144
144
 
145
- // Validate: must be in an existing project
146
- if (!fs.existsSync(path.join(cwd, 'package.json'))) {
147
- console.error('Error: No package.json found in current directory.');
148
- console.error('The --upgrade flag must be run from inside an existing project.');
149
- process.exit(1);
150
- }
151
-
152
145
  // Validate: SDD must be installed
153
146
  if (!fs.existsSync(path.join(cwd, 'ai-specs'))) {
154
147
  console.error('Error: ai-specs/ directory not found.');
@@ -234,13 +227,6 @@ async function runEject() {
234
227
 
235
228
  const cwd = process.cwd();
236
229
 
237
- // Validate: must be in an existing project
238
- if (!fs.existsSync(path.join(cwd, 'package.json'))) {
239
- console.error('Error: No package.json found in current directory.');
240
- console.error('The --eject flag must be run from inside an existing project.');
241
- process.exit(1);
242
- }
243
-
244
230
  // Validate: SDD must be installed
245
231
  if (!fs.existsSync(path.join(cwd, 'ai-specs'))) {
246
232
  console.error('Error: ai-specs/ directory not found.');
@@ -292,11 +278,6 @@ async function runDiff() {
292
278
 
293
279
  const cwd = process.cwd();
294
280
 
295
- if (!fs.existsSync(path.join(cwd, 'package.json'))) {
296
- console.error('Error: No package.json found in current directory.');
297
- process.exit(1);
298
- }
299
-
300
281
  if (isEject) {
301
282
  // Same validation as --eject
302
283
  if (!fs.existsSync(path.join(cwd, 'ai-specs'))) {
@@ -319,6 +300,11 @@ async function runDiff() {
319
300
 
320
301
  if (isInit) {
321
302
  // Same validation as --init
303
+ if (!fs.existsSync(path.join(cwd, 'package.json'))) {
304
+ console.error('Error: No package.json found in current directory.');
305
+ console.error('The --init flag must be run from inside an existing project.');
306
+ process.exit(1);
307
+ }
322
308
  if (fs.existsSync(path.join(cwd, 'ai-specs'))) {
323
309
  console.error('Error: ai-specs/ directory already exists.');
324
310
  console.error('SDD DevFlow appears to already be installed. Use --upgrade --diff instead.');
package/lib/generator.js CHANGED
@@ -19,6 +19,16 @@ function generate(config) {
19
19
  step('Copying template files');
20
20
  fs.cpSync(templateDir, dest, { recursive: true });
21
21
 
22
+ // 1b. Rename gitignore → .gitignore (npm strips .gitignore during publish)
23
+ const gitignoreSrc = path.join(dest, 'gitignore');
24
+ if (fs.existsSync(gitignoreSrc)) {
25
+ fs.renameSync(gitignoreSrc, path.join(dest, '.gitignore'));
26
+ }
27
+
28
+ // 1c. Generate package.json
29
+ step('Generating package.json');
30
+ generatePackageJson(dest, config);
31
+
22
32
  // 2. Configure key_facts.md
23
33
  step(`Configuring project: ${config.projectName}`);
24
34
  updateKeyFacts(dest, config);
@@ -396,4 +406,23 @@ function adaptCiWorkflow(dest, config) {
396
406
  // Default (PostgreSQL) — template already has correct services
397
407
  }
398
408
 
409
+ function generatePackageJson(dest, config) {
410
+ const pkg = {
411
+ name: config.projectName,
412
+ version: '0.0.1',
413
+ private: true,
414
+ };
415
+ if (config.description) {
416
+ pkg.description = config.description;
417
+ }
418
+ pkg.scripts = {
419
+ test: 'echo "Error: no test specified" && exit 1',
420
+ };
421
+ fs.writeFileSync(
422
+ path.join(dest, 'package.json'),
423
+ JSON.stringify(pkg, null, 2) + '\n',
424
+ 'utf8'
425
+ );
426
+ }
427
+
399
428
  module.exports = { generate };
@@ -467,6 +467,33 @@ function generateUpgrade(config) {
467
467
 
468
468
  step('Adapted files for project type and stack');
469
469
 
470
+ // --- g2) Create package.json if missing (projects created with v0.8.0 bug) ---
471
+ const pkgJsonPath = path.join(dest, 'package.json');
472
+ if (!fs.existsSync(pkgJsonPath)) {
473
+ const pkg = {
474
+ name: config.projectName,
475
+ version: '0.0.1',
476
+ private: true,
477
+ scripts: {
478
+ test: 'echo "Error: no test specified" && exit 1',
479
+ },
480
+ };
481
+ fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + '\n', 'utf8');
482
+ step('Created missing package.json');
483
+ replaced++;
484
+ }
485
+
486
+ // --- g3) Create .gitignore if missing (projects created with v0.8.0 bug) ---
487
+ const gitignorePath = path.join(dest, '.gitignore');
488
+ if (!fs.existsSync(gitignorePath)) {
489
+ const gitignoreSrc = path.join(templateDir, 'gitignore');
490
+ if (fs.existsSync(gitignoreSrc)) {
491
+ fs.copyFileSync(gitignoreSrc, gitignorePath);
492
+ }
493
+ step('Created missing .gitignore');
494
+ replaced++;
495
+ }
496
+
470
497
  // --- g) Write version marker ---
471
498
  const newVersion = getPackageVersion();
472
499
  fs.writeFileSync(path.join(dest, '.sdd-version'), newVersion + '\n', 'utf8');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sdd-project",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
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"
@@ -39,7 +39,11 @@ Verify the implementation's robustness and strict adherence to `docs/specs/`.
39
39
  - **Backend**: Write tests for error paths, validation boundaries, concurrent access
40
40
  - **Frontend**: Write tests for error states, loading interruptions, accessibility
41
41
 
42
- ### 5. Report
42
+ ### 5. Bug Documentation
43
+ - If bugs are found: record each one in `docs/project_notes/bugs.md` with root cause, solution, and prevention notes
44
+ - This ensures institutional memory — future sessions can avoid the same issues
45
+
46
+ ### 6. Report
43
47
  - If tests fail (regressions or new bugs): report them clearly with reproduction steps
44
48
  - If ALL tests pass: certify as "QA Verified"
45
49
 
@@ -0,0 +1,55 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm test:*)",
5
+ "Bash(npm run lint:*)",
6
+ "Bash(npm run build:*)",
7
+ "Bash(git status:*)",
8
+ "Bash(git diff:*)",
9
+ "Bash(git log:*)",
10
+ "Bash(git branch:*)",
11
+ "Bash(git checkout -b:*)",
12
+ "Bash(git add:*)",
13
+ "Bash(git commit:*)",
14
+ "Bash(git push:*)",
15
+ "Bash(npx prisma:*)",
16
+ "Read",
17
+ "Glob",
18
+ "Grep"
19
+ ],
20
+ "deny": []
21
+ },
22
+ "hooks": {
23
+ "Notification": [
24
+ {
25
+ "matcher": "permission_prompt",
26
+ "hooks": [
27
+ {
28
+ "type": "command",
29
+ "command": "osascript -e 'display notification \"Permission needed\" with title \"Claude Code\" with subtitle \"Waiting for approval\"'"
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ "matcher": "idle_prompt",
35
+ "hooks": [
36
+ {
37
+ "type": "command",
38
+ "command": "osascript -e 'display notification \"Task finished, waiting for input\" with title \"Claude Code\"'"
39
+ }
40
+ ]
41
+ }
42
+ ],
43
+ "Stop": [
44
+ {
45
+ "matcher": "",
46
+ "hooks": [
47
+ {
48
+ "type": "command",
49
+ "command": "osascript -e 'display notification \"Response complete\" with title \"Claude Code\"'"
50
+ }
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ }
@@ -87,7 +87,7 @@ See `references/branching-strategy.md` for details.
87
87
  2. Create feature branch: `feature/<feature-id>-<short-description>`
88
88
  3. **Std/Cplx:** Generate ticket from `references/ticket-template.md` → fill `## Spec` section
89
89
  4. **Complex:** Also review `decisions.md` for related ADRs
90
- 5. Update product tracker → Active Session: feature, step `1/6 (Setup)`, branch, complexity
90
+ 5. Update product tracker → Active Session: feature, step `1/6 (Setup)`, branch, complexity. Update Features table: status `in-progress`, step `1/6`
91
91
 
92
92
  **→ CHECKPOINT: Ticket Approval** (Std/Cplx only — Simple skips to Step 3)
93
93
 
@@ -98,7 +98,7 @@ See `references/branching-strategy.md` for details.
98
98
  1. Use Task tool with planner agent (`backend-planner` for backend features, `frontend-planner` for frontend features)
99
99
  2. **Fullstack features:** Run `backend-planner` first, then `frontend-planner`. Each writes its own section in the Implementation Plan
100
100
  3. Agent writes Implementation Plan into ticket's `## Implementation Plan`
101
- 4. Update tracker: step `2/6 (Plan)`
101
+ 4. Update tracker: step `2/6 (Plan)` (Active Session + Features table)
102
102
 
103
103
  **→ CHECKPOINT: Plan Approval**
104
104
 
@@ -122,7 +122,7 @@ See `references/branching-strategy.md` for details.
122
122
 
123
123
  **Commits:** Commit freely during implementation (one per logical unit is fine). Final history cleanup happens via squash merge in Step 5.
124
124
 
125
- Update tracker: step `3/6 (Implement)`, context summary.
125
+ Update tracker: step `3/6 (Implement)`, context summary (Active Session + Features table).
126
126
 
127
127
  ---
128
128
 
@@ -137,7 +137,7 @@ Update tracker: step `3/6 (Implement)`, context summary.
137
137
 
138
138
  **Commit format:** `<type>(<scope>): <description>` + `Co-Authored-By: Claude <noreply@anthropic.com>`
139
139
 
140
- Update tracker: step `4/6 (Finalize)`
140
+ Update tracker: step `4/6 (Finalize)` (Active Session + Features table)
141
141
 
142
142
  ---
143
143
 
@@ -148,11 +148,12 @@ Update tracker: step `4/6 (Finalize)`
148
148
  1. Push branch, create PR (use `references/pr-template.md`)
149
149
  2. **Std/Cplx:** Run `code-review-specialist` via Task tool — **do NOT skip**
150
150
  3. **Std/Cplx:** Also run `qa-engineer` via Task tool
151
- 4. **Merge strategy:** Features/bugfixes**squash merge** (clean single commit on target branch); Releases/hotfixes merge commit
151
+ 4. **Fix loop:** If review or QA finds issues fix them → commit fixes → re-run quality gates (`npm test` / lint / build). Repeat until clean.
152
+ 5. **Merge strategy:** Features/bugfixes → **squash merge** (clean single commit on target branch); Releases/hotfixes → merge commit
152
153
 
153
154
  **→ CHECKPOINT: Merge Approval**
154
155
 
155
- Update tracker: step `5/6 (Review)`
156
+ Update tracker: step `5/6 (Review)`, update Features table status
156
157
 
157
158
  ---
158
159
 
@@ -160,9 +161,8 @@ Update tracker: step `5/6 (Review)`
160
161
 
161
162
  1. **Update ticket with final state:** correct test count in acceptance criteria, mark all checkboxes, update Completion Log with all commits and key events
162
163
  2. Delete feature branch (local + remote)
163
- 3. Update product tracker: feature → done, add to Completion Log, update progress
164
- 4. Record bugs in `bugs.md`, decisions in `decisions.md`
165
- 5. Clear Active Session → "No active work"
164
+ 3. Update product tracker: Features table status `done`, add to Completion Log, clear Active Session → "No active work"
165
+ 4. Record any bugs found during the feature in `bugs.md`, decisions in `decisions.md`
166
166
 
167
167
  ---
168
168
 
@@ -195,6 +195,6 @@ Update tracker: step `5/6 (Review)`
195
195
  - **Type safety** — fully typed, no `any`
196
196
  - **English only** — all technical artifacts
197
197
  - **Memory first** — check `project_notes/` before changes
198
- - **Product tracker** — keep Active Session updated at every step
198
+ - **Product tracker** — keep Active Session AND Features table updated at every step
199
199
  - **Correct agents** — Backend → `backend-planner` + `backend-developer`, Frontend → `frontend-planner` + `frontend-developer`
200
200
  - **Correct base branch** — check `key_facts.md` before creating branches
@@ -15,7 +15,8 @@ You assume the happy path works (checked by Developer). Hunt for edge cases, sec
15
15
  2. Identify missing test cases and spec deviations
16
16
  3. Run full test suite for regressions
17
17
  4. Create new edge-case tests (e.g., `*.edge-cases.test.ts`)
18
- 5. Report findings (QA Verified or Issues Found)
18
+ 5. If bugs are found: record each one in `docs/project_notes/bugs.md` with root cause, solution, and prevention notes
19
+ 6. Report findings (QA Verified or Issues Found)
19
20
 
20
21
  ## Rules
21
22
 
@@ -87,7 +87,7 @@ See `references/branching-strategy.md` for details.
87
87
  2. Create feature branch: `feature/<feature-id>-<short-description>`
88
88
  3. **Std/Cplx:** Generate ticket from `references/ticket-template.md` → fill `## Spec` section
89
89
  4. **Complex:** Also review `decisions.md` for related ADRs
90
- 5. Update product tracker → Active Session: feature, step `1/6 (Setup)`, branch, complexity
90
+ 5. Update product tracker → Active Session: feature, step `1/6 (Setup)`, branch, complexity. Update Features table: status `in-progress`, step `1/6`
91
91
 
92
92
  **→ CHECKPOINT: Ticket Approval** (Std/Cplx only — Simple skips to Step 3)
93
93
 
@@ -98,7 +98,7 @@ See `references/branching-strategy.md` for details.
98
98
  1. Follow the planner agent instructions (`backend-planner` for backend features, `frontend-planner` for frontend features) in `.gemini/agents/`
99
99
  2. **Fullstack features:** Run `backend-planner` first, then `frontend-planner`. Each writes its own section in the Implementation Plan
100
100
  3. Write Implementation Plan into ticket's `## Implementation Plan`
101
- 4. Update tracker: step `2/6 (Plan)`
101
+ 4. Update tracker: step `2/6 (Plan)` (Active Session + Features table)
102
102
 
103
103
  **→ CHECKPOINT: Plan Approval**
104
104
 
@@ -122,7 +122,7 @@ See `references/branching-strategy.md` for details.
122
122
 
123
123
  **Commits:** Commit freely during implementation (one per logical unit is fine). Final history cleanup happens via squash merge in Step 5.
124
124
 
125
- Update tracker: step `3/6 (Implement)`, context summary.
125
+ Update tracker: step `3/6 (Implement)`, context summary (Active Session + Features table).
126
126
 
127
127
  ---
128
128
 
@@ -137,7 +137,7 @@ Update tracker: step `3/6 (Implement)`, context summary.
137
137
 
138
138
  **Commit format:** `<type>(<scope>): <description>`
139
139
 
140
- Update tracker: step `4/6 (Finalize)`
140
+ Update tracker: step `4/6 (Finalize)` (Active Session + Features table)
141
141
 
142
142
  ---
143
143
 
@@ -148,11 +148,12 @@ Update tracker: step `4/6 (Finalize)`
148
148
  1. Push branch, create PR (use `references/pr-template.md`)
149
149
  2. **Std/Cplx:** Follow `code-review-specialist` instructions in `.gemini/agents/` — **do NOT skip**
150
150
  3. **Std/Cplx:** Also follow `qa-engineer` instructions in `.gemini/agents/`
151
- 4. **Merge strategy:** Features/bugfixes**squash merge** (clean single commit on target branch); Releases/hotfixes merge commit
151
+ 4. **Fix loop:** If review or QA finds issues fix them → commit fixes → re-run quality gates (`npm test` / lint / build). Repeat until clean.
152
+ 5. **Merge strategy:** Features/bugfixes → **squash merge** (clean single commit on target branch); Releases/hotfixes → merge commit
152
153
 
153
154
  **→ CHECKPOINT: Merge Approval**
154
155
 
155
- Update tracker: step `5/6 (Review)`
156
+ Update tracker: step `5/6 (Review)`, update Features table status
156
157
 
157
158
  ---
158
159
 
@@ -160,9 +161,8 @@ Update tracker: step `5/6 (Review)`
160
161
 
161
162
  1. **Update ticket with final state:** correct test count in acceptance criteria, mark all checkboxes, update Completion Log with all commits and key events
162
163
  2. Delete feature branch (local + remote)
163
- 3. Update product tracker: feature → done, add to Completion Log, update progress
164
- 4. Record bugs in `bugs.md`, decisions in `decisions.md`
165
- 5. Clear Active Session → "No active work"
164
+ 3. Update product tracker: Features table status `done`, add to Completion Log, clear Active Session → "No active work"
165
+ 4. Record any bugs found during the feature in `bugs.md`, decisions in `decisions.md`
166
166
 
167
167
  ---
168
168
 
@@ -197,6 +197,6 @@ Agent instructions are in `.gemini/agents/`. Read the relevant agent file when e
197
197
  - **Type safety** — fully typed, no `any`
198
198
  - **English only** — all technical artifacts
199
199
  - **Memory first** — check `project_notes/` before changes
200
- - **Product tracker** — keep Active Session updated at every step
200
+ - **Product tracker** — keep Active Session AND Features table updated at every step
201
201
  - **Correct agents** — Backend → `backend-planner` + `backend-developer`, Frontend → `frontend-planner` + `frontend-developer`
202
202
  - **Correct base branch** — check `key_facts.md` before creating branches
@@ -0,0 +1,48 @@
1
+ # Dependencies
2
+ node_modules/
3
+
4
+ # Build output
5
+ dist/
6
+ .next/
7
+ out/
8
+ build/
9
+
10
+ # Environment — NEVER commit
11
+ .env
12
+ .env.local
13
+ .env.*.local
14
+ .env.development
15
+ .env.staging
16
+ .env.production
17
+ .npmrc
18
+
19
+ # OS
20
+ .DS_Store
21
+ Thumbs.db
22
+
23
+ # IDE
24
+ .idea/
25
+ .vscode/
26
+ *.swp
27
+ *.swo
28
+
29
+ # Testing
30
+ coverage/
31
+
32
+ # Prisma
33
+ backend/generated/
34
+
35
+ # Logs
36
+ *.log
37
+ npm-debug.log*
38
+
39
+ # Cache
40
+ .turbo/
41
+ .cache/
42
+
43
+ # Secrets and keys
44
+ *.pem
45
+ *.key
46
+
47
+ # Claude Code (local settings are personal — hooks, permissions, notifications)
48
+ .claude/settings.local.json