sdd-tool 0.2.0 → 0.4.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 CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  **Spec-Driven Development CLI** - 명세 기반 개발을 위한 통합 CLI 도구
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/sdd-tool)](https://www.npmjs.com/package/sdd-tool)
5
6
  [![Node.js](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen)](https://nodejs.org/)
6
7
  [![TypeScript](https://img.shields.io/badge/typescript-5.x-blue)](https://www.typescriptlang.org/)
7
8
  [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
@@ -28,7 +29,7 @@ npm install -g sdd-tool
28
29
  pnpm add -g sdd-tool
29
30
 
30
31
  # 또는 로컬에서 실행
31
- git clone <repository>
32
+ git clone https://github.com/JakeB-5/sdd-tool.git
32
33
  cd sdd-tool
33
34
  pnpm install
34
35
  pnpm run build
@@ -40,13 +41,16 @@ pnpm run build
40
41
  # 1. 프로젝트 초기화
41
42
  sdd init
42
43
 
43
- # 2. 기능 생성
44
+ # 2. 워크플로우 시작 (통합 진입점)
45
+ sdd start
46
+
47
+ # 3. 새 기능 생성
44
48
  sdd new user-auth --title "사용자 인증" --all
45
49
 
46
- # 3. 스펙 검증
50
+ # 4. 스펙 검증
47
51
  sdd validate
48
52
 
49
- # 4. 프로젝트 상태 확인
53
+ # 5. 프로젝트 상태 확인
50
54
  sdd status
51
55
  ```
52
56
 
@@ -70,6 +74,19 @@ sdd init --force # 기존 파일 덮어쓰기
70
74
  ├── changes/ # 변경 제안
71
75
  ├── archive/ # 완료된 변경
72
76
  └── templates/ # 템플릿 파일
77
+ .claude/
78
+ └── commands/ # Claude 슬래시 커맨드
79
+ ```
80
+
81
+ ### `sdd start`
82
+
83
+ 통합 워크플로우 진입점입니다.
84
+
85
+ ```bash
86
+ sdd start # 상태 확인 및 워크플로우 메뉴
87
+ sdd start --status # 상태만 표시
88
+ sdd start --workflow new-feature # 특정 워크플로우 시작
89
+ sdd start --workflow change-spec # 변경 워크플로우
73
90
  ```
74
91
 
75
92
  ### `sdd new`
@@ -83,12 +100,17 @@ sdd new <feature-name>
83
100
  # 옵션
84
101
  sdd new auth --title "인증 기능" --description "사용자 인증"
85
102
  sdd new auth --all # spec, plan, tasks, checklist 모두 생성
103
+ sdd new auth --numbered # 자동 번호 부여 (feature/001-auth)
86
104
  sdd new auth --no-branch # Git 브랜치 생성 안 함
87
105
 
88
106
  # 서브커맨드
89
107
  sdd new plan <feature> # 구현 계획 생성
90
108
  sdd new tasks <feature> # 작업 분해 생성
91
109
  sdd new checklist # 워크플로우 체크리스트 생성
110
+ sdd new counter # 기능 번호 카운터 관리
111
+ sdd new counter --peek # 다음 번호 확인
112
+ sdd new counter --history # 생성 이력
113
+ sdd new counter --set <n> # 번호 설정
92
114
  ```
93
115
 
94
116
  ### `sdd validate`
@@ -99,6 +121,9 @@ sdd new checklist # 워크플로우 체크리스트 생성
99
121
  sdd validate # 전체 검증
100
122
  sdd validate path/to/spec.md # 특정 파일 검증
101
123
  sdd validate --strict # 엄격 모드 (경고도 에러)
124
+ sdd validate --check-links # 참조 링크 유효성 검사
125
+ sdd validate --constitution # Constitution 위반 검사 (기본값)
126
+ sdd validate --no-constitution # Constitution 검사 스킵
102
127
  sdd validate --quiet # 조용한 모드
103
128
  ```
104
129
 
@@ -106,6 +131,24 @@ sdd validate --quiet # 조용한 모드
106
131
  - YAML frontmatter 존재 및 형식
107
132
  - RFC 2119 키워드 사용
108
133
  - GIVEN-WHEN-THEN 시나리오 포함
134
+ - 참조 링크 유효성 (--check-links)
135
+ - Constitution 원칙 위반 (--constitution)
136
+
137
+ ### `sdd constitution`
138
+
139
+ 프로젝트 Constitution(헌법)을 관리합니다.
140
+
141
+ ```bash
142
+ sdd constitution # Constitution 표시
143
+ sdd constitution show # Constitution 내용 표시
144
+ sdd constitution version # 버전만 표시
145
+ sdd constitution validate # 형식 검증
146
+ sdd constitution history # 변경 이력 조회
147
+ sdd constitution bump # 버전 업데이트
148
+ sdd constitution bump --major # 주요 변경 (원칙 삭제 등)
149
+ sdd constitution bump --minor # 기능 추가
150
+ sdd constitution bump --patch # 문구 수정
151
+ ```
109
152
 
110
153
  ### `sdd change`
111
154
 
@@ -113,10 +156,13 @@ sdd validate --quiet # 조용한 모드
113
156
 
114
157
  ```bash
115
158
  sdd change # 새 변경 제안 생성
116
- sdd change CHG-001 # 특정 변경 조회
117
- sdd change --list # 변경 목록
118
- sdd change apply CHG-001 # 변경 적용
119
- sdd change archive CHG-001 # 변경 아카이브
159
+ sdd change -t "제목" # 제목과 함께 생성
160
+ sdd change -l # 진행 중인 변경 목록
161
+ sdd change <id> # 특정 변경 조회
162
+ sdd change diff <id> # 변경 내용 diff
163
+ sdd change validate <id> # 변경 제안 검증
164
+ sdd change apply <id> # 변경 적용
165
+ sdd change archive <id> # 변경 아카이브
120
166
  ```
121
167
 
122
168
  ### `sdd impact`
@@ -124,9 +170,60 @@ sdd change archive CHG-001 # 변경 아카이브
124
170
  스펙 변경의 영향도를 분석합니다.
125
171
 
126
172
  ```bash
173
+ # 기본 영향도 분석
127
174
  sdd impact <feature> # 특정 기능 영향도 분석
128
- sdd impact --graph # 의존성 그래프 출력 (Mermaid)
175
+ sdd impact <feature> --graph # 의존성 그래프 출력 (Mermaid)
129
176
  sdd impact <feature> --json # JSON 형식 출력
177
+
178
+ # 코드 영향도 분석
179
+ sdd impact <feature> --code # 스펙 변경이 코드에 미치는 영향 분석
180
+ sdd impact <feature> --code --json # JSON 형식
181
+
182
+ # 리포트 및 변경 분석
183
+ sdd impact report # 전체 프로젝트 리포트
184
+ sdd impact report --json # JSON 형식 리포트
185
+ sdd impact change <id> # 변경 제안 영향도 분석
186
+
187
+ # What-if 시뮬레이션
188
+ sdd impact simulate <feature> <proposal> # 변경 전 영향도 예측
189
+ sdd impact simulate auth change-001 # 예시
190
+ ```
191
+
192
+ 코드 영향도 분석은 다음 방법으로 스펙-코드 연결을 탐지합니다:
193
+ - 주석 참조: `// spec: feature-id`, `/* spec: feature-id */`, `@spec feature-id`
194
+ - 파일명/디렉토리명 매칭: `auth.ts` ↔ `auth` 스펙
195
+ - 매핑 설정: `.sdd/code-mapping.json` 파일 사용
196
+
197
+ ### `sdd transition`
198
+
199
+ 워크플로우 간 전환을 수행합니다.
200
+
201
+ ```bash
202
+ sdd transition new-to-change <spec-id> # new → change 전환
203
+ sdd transition change-to-new <change-id> # change → new 전환
204
+ sdd transition guide # 전환 가이드
205
+ ```
206
+
207
+ ### `sdd migrate`
208
+
209
+ 기존 문서를 SDD 형식으로 마이그레이션합니다.
210
+
211
+ ```bash
212
+ sdd migrate docs <source> # 문서 마이그레이션
213
+ sdd migrate analyze <file> # 문서 분석
214
+ sdd migrate scan [dir] # 디렉토리 스캔
215
+ ```
216
+
217
+ ### `sdd cicd`
218
+
219
+ CI/CD 파이프라인을 설정합니다.
220
+
221
+ ```bash
222
+ sdd cicd setup # GitHub Actions 설정
223
+ sdd cicd setup gitlab # GitLab CI 설정
224
+ sdd cicd setup all # 모든 플랫폼 설정
225
+ sdd cicd hooks # Git hooks 설정
226
+ sdd cicd check # CI 검증 실행
130
227
  ```
131
228
 
132
229
  ### `sdd status`
@@ -158,14 +255,8 @@ AI 도구용 슬래시 커맨드 프롬프트를 출력합니다.
158
255
  ```bash
159
256
  sdd prompt # 사용 가능한 명령어 목록
160
257
  sdd prompt --list # 명령어 목록
161
- sdd prompt change # /sdd:change 프롬프트
162
- sdd prompt new # /sdd:new 프롬프트
163
- sdd prompt plan # /sdd:plan 프롬프트
164
- sdd prompt tasks # /sdd:tasks 프롬프트
165
- sdd prompt apply # /sdd:apply 프롬프트
166
- sdd prompt archive # /sdd:archive 프롬프트
167
- sdd prompt impact # /sdd:impact 프롬프트
168
- sdd prompt validate # /sdd:validate 프롬프트
258
+ sdd prompt new # /sdd.new 프롬프트
259
+ sdd prompt change # /sdd.change 프롬프트
169
260
  ```
170
261
 
171
262
  ## 워크플로우
@@ -173,25 +264,101 @@ sdd prompt validate # /sdd:validate 프롬프트
173
264
  ### 신규 기능 개발
174
265
 
175
266
  ```
176
- 1. sdd new <feature> --all # 기능 생성 (spec, plan, tasks)
177
- 2. spec.md 작성 # 요구사항 정의
178
- 3. sdd validate # 명세 검증
179
- 4. plan.md 작성 # 구현 계획
180
- 5. tasks.md 기반 구현 # 작업별 구현
181
- 6. sdd change archive # 완료 후 아카이브
267
+ 1. sdd start # 워크플로우 시작
268
+ 2. sdd new <feature> --all # 기능 생성 (spec, plan, tasks)
269
+ 3. spec.md 작성 # 요구사항 정의
270
+ 4. sdd validate # 명세 검증
271
+ 5. plan.md 작성 # 구현 계획
272
+ 6. tasks.md 기반 구현 # 작업별 구현
273
+ 7. sdd change archive # 완료 후 아카이브
182
274
  ```
183
275
 
184
276
  ### 기존 기능 변경
185
277
 
186
278
  ```
187
- 1. sdd change # 변경 제안 생성
279
+ 1. sdd change -t "변경 제목" # 변경 제안 생성
188
280
  2. proposal.md 작성 # 변경 내용 정의
189
281
  3. sdd impact <feature> # 영향도 분석
190
- 4. 검토 승인
191
- 5. sdd change apply # 변경 적용
192
- 6. sdd change archive # 아카이브
282
+ 4. sdd change validate <id> # 검증
283
+ 5. sdd change apply <id> # 변경 적용
284
+ 6. sdd change archive <id> # 아카이브
193
285
  ```
194
286
 
287
+ ### 워크플로우 전환
288
+
289
+ 작업 중 워크플로우를 변경해야 할 때:
290
+
291
+ ```
292
+ # 새 기능 → 변경 제안 (기존 스펙과 중복 발견 시)
293
+ sdd transition new-to-change <spec-id>
294
+
295
+ # 변경 → 새 기능 (범위가 커서 분리 필요 시)
296
+ sdd transition change-to-new <change-id>
297
+ ```
298
+
299
+ ## Claude 슬래시 커맨드
300
+
301
+ `sdd init` 실행 시 `.claude/commands/` 디렉토리에 Claude Code용 슬래시 커맨드가 자동 생성됩니다.
302
+
303
+ ### 기본 워크플로우 커맨드
304
+
305
+ | 커맨드 | 설명 |
306
+ |--------|------|
307
+ | `/sdd.start` | 통합 진입점 - 워크플로우 시작 |
308
+ | `/sdd.new` | 새 기능 명세 작성 |
309
+ | `/sdd.plan` | 구현 계획 작성 |
310
+ | `/sdd.tasks` | 작업 분해 |
311
+ | `/sdd.implement` | 순차적 구현 진행 |
312
+ | `/sdd.validate` | 스펙 형식 검증 |
313
+ | `/sdd.status` | 프로젝트 상태 확인 |
314
+ | `/sdd.change` | 변경 제안 작성 |
315
+ | `/sdd.constitution` | Constitution 관리 |
316
+
317
+ ### 고급 커맨드
318
+
319
+ | 커맨드 | 설명 |
320
+ |--------|------|
321
+ | `/sdd.chat` | 대화형 SDD 어시스턴트 |
322
+ | `/sdd.guide` | 전체 워크플로우 가이드 |
323
+ | `/sdd.transition` | 워크플로우 전환 |
324
+ | `/sdd.analyze` | 요청 분석 및 규모 판단 |
325
+ | `/sdd.research` | 기술 리서치 문서 작성 |
326
+ | `/sdd.data-model` | 데이터 모델 문서 작성 |
327
+ | `/sdd.prepare` | 환경 준비 가이드 |
328
+
329
+ ### 사용법
330
+
331
+ Claude Code에서 슬래시 커맨드를 입력하면 해당 워크플로우가 자동으로 실행됩니다:
332
+
333
+ ```
334
+ /sdd.start # 워크플로우 시작
335
+ /sdd.new # 새 기능 명세 작성 시작
336
+ /sdd.chat # 대화형 모드로 SDD 작업
337
+ ```
338
+
339
+ ### 워크플로우 예시
340
+
341
+ 1. **대화형 모드로 시작**
342
+ ```
343
+ /sdd.chat
344
+ → 자연어로 SDD 작업 수행
345
+ → 질문/작성/검토/실행 모드 지원
346
+ ```
347
+
348
+ 2. **새 기능 개발**
349
+ ```
350
+ /sdd.new
351
+ → 기능명과 설명 입력
352
+ → spec.md 자동 생성 및 작성 안내
353
+ ```
354
+
355
+ 3. **워크플로우 전환**
356
+ ```
357
+ /sdd.transition
358
+ → new ↔ change 워크플로우 전환
359
+ → 전환 가이드 제공
360
+ ```
361
+
195
362
  ## 스펙 파일 형식
196
363
 
197
364
  ### spec.md
@@ -202,6 +369,7 @@ id: feature-id
202
369
  title: "기능 제목"
203
370
  status: draft
204
371
  created: 2025-12-21
372
+ constitution_version: 1.0.0
205
373
  depends: null
206
374
  ---
207
375
 
@@ -238,6 +406,93 @@ depends: null
238
406
  | **MAY** | 선택적 | "다크 모드를 지원할 수 있다(MAY)" |
239
407
  | **SHALL NOT** | 절대 금지 | "평문 비밀번호를 저장해서는 안 된다(SHALL NOT)" |
240
408
 
409
+ ## CI/CD 통합
410
+
411
+ ### GitHub Actions
412
+
413
+ ```bash
414
+ sdd cicd setup github
415
+ # .github/workflows/sdd-validate.yml 생성
416
+ ```
417
+
418
+ ### GitLab CI
419
+
420
+ ```bash
421
+ sdd cicd setup gitlab
422
+ # .gitlab-ci-sdd.yml 생성
423
+ ```
424
+
425
+ ### Git Hooks
426
+
427
+ ```bash
428
+ sdd cicd hooks
429
+ # .husky/pre-commit, pre-push 생성
430
+ ```
431
+
432
+ ## 고급 기능
433
+
434
+ ### 코드 매핑 설정
435
+
436
+ `.sdd/code-mapping.json` 파일을 사용하여 스펙과 코드 파일 간의 명시적 매핑을 정의할 수 있습니다:
437
+
438
+ ```json
439
+ {
440
+ "version": "1.0.0",
441
+ "mappings": [
442
+ {
443
+ "specId": "user-auth",
444
+ "files": [
445
+ "src/core/auth.ts",
446
+ "src/services/auth-service.ts"
447
+ ],
448
+ "directories": [
449
+ "src/auth/"
450
+ ]
451
+ },
452
+ {
453
+ "specId": "payment",
454
+ "files": [
455
+ "src/payment/handler.ts"
456
+ ]
457
+ }
458
+ ],
459
+ "patterns": {
460
+ "include": ["src/**/*.ts"],
461
+ "exclude": ["**/*.test.ts", "**/*.spec.ts"]
462
+ }
463
+ }
464
+ ```
465
+
466
+ ### Constitution 위반 검증
467
+
468
+ 스펙이 Constitution에 정의된 원칙을 위반하는지 자동으로 검사합니다:
469
+
470
+ ```bash
471
+ # Constitution 위반 검사 포함 (기본값)
472
+ sdd validate
473
+
474
+ # Constitution 검사 스킵
475
+ sdd validate --no-constitution
476
+ ```
477
+
478
+ 위반 감지 예시:
479
+ - Constitution: "평문 비밀번호를 저장해서는 안 된다(SHALL NOT)"
480
+ - 스펙: "비밀번호를 평문으로 저장한다" → 위반 경고 출력
481
+
482
+ ### What-if 시뮬레이션
483
+
484
+ 변경을 적용하기 전에 영향도를 예측합니다:
485
+
486
+ ```bash
487
+ sdd impact simulate <feature> <proposal>
488
+ ```
489
+
490
+ 시뮬레이션 결과:
491
+ - 현재 상태 vs 변경 후 상태 비교
492
+ - 리스크 점수 변화
493
+ - 새로 영향받는 스펙 목록
494
+ - 권장사항 및 경고
495
+
241
496
  ## 개발
242
497
 
243
498
  ```bash
@@ -278,7 +533,12 @@ sdd-tool/
278
533
  │ │ │ ├── impact.ts
279
534
  │ │ │ ├── status.ts
280
535
  │ │ │ ├── list.ts
281
- │ │ │ └── prompt.ts
536
+ │ │ │ ├── prompt.ts
537
+ │ │ │ ├── constitution.ts
538
+ │ │ │ ├── start.ts
539
+ │ │ │ ├── transition.ts
540
+ │ │ │ ├── migrate.ts
541
+ │ │ │ └── cicd.ts
282
542
  │ │ └── index.ts
283
543
  │ ├── core/ # 핵심 로직
284
544
  │ │ ├── spec/ # 스펙 파서/검증