specdrive-cli 0.1.10 → 0.1.12
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 +955 -697
- package/agents/00-onboarding.md +261 -0
- package/agents/01-constitution.md +214 -201
- package/agents/02-specification.md +249 -226
- package/agents/03-uiux.md +156 -144
- package/agents/04-cascade.md +151 -122
- package/agents/05-discover-skills.md +136 -136
- package/agents/06-documentation.md +158 -145
- package/agents/07-implementation.md +201 -169
- package/agents/08-performance.md +179 -165
- package/agents/09-review-complete.md +239 -168
- package/agents/10-security.md +180 -167
- package/agents/11-test.md +195 -0
- package/commands/gates.js +73 -73
- package/commands/manifest.json +113 -95
- package/commands/permissions.json +39 -0
- package/commands/router.js +151 -127
- package/commands/tools.json +19 -19
- package/dashboard/app.js +394 -0
- package/dashboard/index.html +74 -0
- package/dashboard/server.js +166 -0
- package/dashboard/style.css +157 -0
- package/mcp/mcp.json +31 -0
- package/mcp/server.js +108 -0
- package/package.json +35 -32
- package/schemas/config.schema.json +20 -0
- package/schemas/workflow-state.schema.json +149 -38
- package/scripts/anti-redundancy.js +176 -176
- package/scripts/audit-log.js +46 -46
- package/scripts/check-permission.js +87 -0
- package/scripts/diff-spec.js +50 -50
- package/scripts/diff-version.js +96 -0
- package/scripts/generate-adapters.js +80 -80
- package/scripts/generate-from-template.js +97 -97
- package/scripts/generate-openapi.js +75 -75
- package/scripts/github-team-sync.js +80 -80
- package/scripts/install-hooks.js +20 -20
- package/scripts/load-plugins.js +65 -65
- package/scripts/migrate-openspec.js +318 -0
- package/scripts/migrate-speckit.js +322 -0
- package/scripts/migrate.js +12 -62
- package/scripts/onboard.js +312 -0
- package/scripts/pre-commit.js +56 -20
- package/scripts/team.js +113 -113
- package/scripts/test-adapters.js +118 -118
- package/scripts/test-create.js +13 -13
- package/scripts/test-end-to-end.js +137 -137
- package/scripts/test-router.js +110 -110
- package/scripts/test-state-transitions.js +146 -146
- package/scripts/test-validator.js +152 -152
- package/scripts/validate-config.js +36 -0
- package/scripts/validate-governance.js +150 -130
- package/scripts/verify.js +525 -0
- package/scripts/version-new.js +202 -0
- package/src/index.js +1010 -807
- package/templates/expo/plan.json +12 -0
- package/templates/expo/spec.json +12 -0
- package/templates/expo/tasks.json +5 -0
- package/templates/fastapi/plan.json +12 -0
- package/templates/fastapi/spec.json +12 -0
- package/templates/fastapi/tasks.json +5 -0
- package/templates/generic/plan.json +12 -0
- package/templates/generic/spec.json +11 -0
- package/templates/generic/tasks.json +5 -0
- package/templates/nextjs/plan.json +23 -0
- package/templates/nextjs/spec.json +12 -0
- package/templates/nextjs/tasks.json +5 -0
- package/templates/react-node/plan.json +15 -0
- package/templates/react-node/spec.json +12 -0
- package/templates/react-node/tasks.json +5 -0
- package/templates/registry.json +30 -0
- package/templates/turborepo/plan.json +12 -0
- package/templates/turborepo/spec.json +12 -0
- package/templates/turborepo/tasks.json +5 -0
package/README.md
CHANGED
|
@@ -1,697 +1,955 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
|
-
##
|
|
366
|
-
|
|
367
|
-
|
|
|
368
|
-
|
|
369
|
-
|
|
|
370
|
-
|
|
|
371
|
-
|
|
|
372
|
-
|
|
|
373
|
-
|
|
|
374
|
-
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
sdrive
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
|
542
|
-
|
|
|
543
|
-
|
|
|
544
|
-
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
###
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
|
595
|
-
|
|
596
|
-
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
```
|
|
611
|
-
sdrive
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
1
|
+
# SpecDrive
|
|
2
|
+
|
|
3
|
+
**Enterprise Spec-Driven Development for AI Coding Tools**
|
|
4
|
+
|
|
5
|
+
SpecDrive gives AI coding tools like GitHub Copilot, Cline, Claude Code, and Cursor a deterministic governance layer for spec-driven development.
|
|
6
|
+
|
|
7
|
+
It adds:
|
|
8
|
+
|
|
9
|
+
- 12 specialized governance agents
|
|
10
|
+
- Machine-readable JSON schemas
|
|
11
|
+
- Requirement → AC → task → test traceability
|
|
12
|
+
- Per-version lifecycle tracking
|
|
13
|
+
- Human approval gates
|
|
14
|
+
- Anti-redundancy checks
|
|
15
|
+
- Spec-to-code verification
|
|
16
|
+
- Brownfield onboarding for existing projects
|
|
17
|
+
- OpenSpec and Spec-Kit migration
|
|
18
|
+
- Anti-hallucination controls
|
|
19
|
+
- CI/CD integration
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Table of Contents
|
|
24
|
+
|
|
25
|
+
- [Why SpecDrive](#why-specdrive)
|
|
26
|
+
- [Prerequisites](#prerequisites)
|
|
27
|
+
- [Installation](#installation)
|
|
28
|
+
- [Where to Run Commands](#where-to-run-commands)
|
|
29
|
+
- [Quickstart](#quickstart)
|
|
30
|
+
- [Onboarding an Existing Project](#onboarding-an-existing-project)
|
|
31
|
+
- [Migrating from OpenSpec or Spec-Kit](#migrating-from-openspec-or-spec-kit)
|
|
32
|
+
- [Core Workflow](#core-workflow)
|
|
33
|
+
- [Optional Commands](#optional-commands)
|
|
34
|
+
- [Terminal Commands](#terminal-commands)
|
|
35
|
+
- [Agents](#agents)
|
|
36
|
+
- [Templates](#templates)
|
|
37
|
+
- [Versions](#versions)
|
|
38
|
+
- [Directory Structure](#directory-structure)
|
|
39
|
+
- [Validation](#validation)
|
|
40
|
+
- [Spec-to-Code Verification](#spec-to-code-verification)
|
|
41
|
+
- [CI/CD Integration](#cicd-integration)
|
|
42
|
+
- [MCP Server](#mcp-server)
|
|
43
|
+
- [Tool Support](#tool-support)
|
|
44
|
+
- [Web Dashboard](#web-dashboard)
|
|
45
|
+
- [Team Collaboration](#team-collaboration)
|
|
46
|
+
- [Permissions](#permissions)
|
|
47
|
+
- [Contributing](#contributing)
|
|
48
|
+
- [License](#license)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Why SpecDrive
|
|
53
|
+
|
|
54
|
+
OpenSpec and Spec-Kit are great, but they lack strict governance controls.
|
|
55
|
+
|
|
56
|
+
SpecDrive adds:
|
|
57
|
+
|
|
58
|
+
- Strict JSON Schema validation
|
|
59
|
+
- Complete requirement-to-test traceability
|
|
60
|
+
- Human approval at every critical phase
|
|
61
|
+
- Anti-redundancy engine
|
|
62
|
+
- Deterministic governance validator
|
|
63
|
+
- Spec-to-code verification
|
|
64
|
+
- Per-version lifecycle tracking
|
|
65
|
+
- Brownfield onboarding without breaking existing code
|
|
66
|
+
- OpenSpec and Spec-Kit migration
|
|
67
|
+
|
|
68
|
+
This makes AI-generated specs and code safe for enterprise use.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Prerequisites
|
|
73
|
+
|
|
74
|
+
- Node.js 18 or later
|
|
75
|
+
- npm 9 or later
|
|
76
|
+
- Git
|
|
77
|
+
- An AI coding tool that supports custom commands or instructions
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Installation
|
|
82
|
+
|
|
83
|
+
### Global Install
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm install -g specdrive-cli@latest
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Verify Install
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
sdrive --version
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Initialize a Project
|
|
96
|
+
|
|
97
|
+
Inside your project root, run:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
sdrive init
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
SpecDrive will ask you to:
|
|
104
|
+
|
|
105
|
+
1. Select which AI tools you use
|
|
106
|
+
2. Select a default template
|
|
107
|
+
3. Wire MCP clients (optional)
|
|
108
|
+
|
|
109
|
+
It then creates the `.sdrive/` folder, tool adapters, and MCP server.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Where to Run Commands
|
|
114
|
+
|
|
115
|
+
| Command Type | Where to Run | Example |
|
|
116
|
+
|--------------|--------------|---------|
|
|
117
|
+
| Terminal command | In your terminal / shell | `sdrive init` |
|
|
118
|
+
| Slash command | In your AI tool's chat | `/sdrive:propose "User login"` |
|
|
119
|
+
|
|
120
|
+
**Rule:** If it starts with `sdrive`, run it in the terminal. If it starts with `/sdrive:`, run it in your AI chat.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Quickstart
|
|
125
|
+
|
|
126
|
+
1. Initialize the project:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
sdrive init
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
2. Create your constitution:
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
/sdrive:constitution
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
3. Propose a feature:
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
/sdrive:propose "User login with email and password"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
4. Implement:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
/sdrive:apply
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
5. Write tests:
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
/sdrive:test user-login
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
6. Review and merge:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
/sdrive:review
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Onboarding an Existing Project
|
|
165
|
+
|
|
166
|
+
If your project already has code but no SpecDrive governance, run:
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
/sdrive:onboard
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
That is the only command you need.
|
|
173
|
+
|
|
174
|
+
The Onboarding Agent will:
|
|
175
|
+
|
|
176
|
+
1. Scan your project automatically
|
|
177
|
+
2. Detect any `openspec/` or `.specify/` folders
|
|
178
|
+
3. Write `.sdrive/onboarding/inventory.json` and `report.md`
|
|
179
|
+
4. Show the inventory for your approval
|
|
180
|
+
5. Ask which missing pieces to fill vs. defer
|
|
181
|
+
6. Optionally generate a baseline constitution
|
|
182
|
+
7. Optionally generate retroactive specs for existing features
|
|
183
|
+
8. Optionally migrate OpenSpec or Spec-Kit specs
|
|
184
|
+
9. Record onboarding state in `workflow-state.json`
|
|
185
|
+
|
|
186
|
+
### What onboarding does NOT do
|
|
187
|
+
|
|
188
|
+
- Does not overwrite existing files
|
|
189
|
+
- Does not delete anything
|
|
190
|
+
- Does not modify code
|
|
191
|
+
- Does not fabricate spec IDs or history
|
|
192
|
+
|
|
193
|
+
### Optional: manual scan
|
|
194
|
+
|
|
195
|
+
If you prefer to scan from the terminal before opening your AI tool:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
sdrive onboard
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
This only writes the inventory. Adoption still happens via `/sdrive:onboard`.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Migrating from OpenSpec or Spec-Kit
|
|
206
|
+
|
|
207
|
+
Migration is part of onboarding. It runs automatically when OpenSpec or Spec-Kit is detected and the user approves.
|
|
208
|
+
|
|
209
|
+
### Step 1: Detect
|
|
210
|
+
|
|
211
|
+
When the Onboarding Agent runs, it scans for:
|
|
212
|
+
|
|
213
|
+
- `openspec/` folder
|
|
214
|
+
- `.specify/` folder
|
|
215
|
+
|
|
216
|
+
If found, it records them in `.sdrive/onboarding/inventory.json` under `detectedSystems`.
|
|
217
|
+
|
|
218
|
+
### Step 2: Migrate
|
|
219
|
+
|
|
220
|
+
The agent will ask:
|
|
221
|
+
|
|
222
|
+
> "I found an OpenSpec project with 3 specs and 2 changes. Migrate them into SpecDrive?"
|
|
223
|
+
|
|
224
|
+
Options:
|
|
225
|
+
|
|
226
|
+
1. Migrate all
|
|
227
|
+
2. Skip migration
|
|
228
|
+
|
|
229
|
+
### What Migration Does
|
|
230
|
+
|
|
231
|
+
**OpenSpec → SpecDrive:**
|
|
232
|
+
|
|
233
|
+
- `openspec/specs/<feature>/` → `.sdrive/specs/ongoing/<feature>/v1/`
|
|
234
|
+
- `openspec/changes/<name>/` → `.sdrive/specs/ongoing/<name>/v1/`
|
|
235
|
+
- `openspec/archive/<feature>/` → `.sdrive/specs/completed/<feature>/v1/`
|
|
236
|
+
|
|
237
|
+
**Spec-Kit → SpecDrive:**
|
|
238
|
+
|
|
239
|
+
- `.specify/specs/###-<feature>/` → `.sdrive/specs/ongoing/<feature>/v1/`
|
|
240
|
+
- `.specify/memory/constitution.md` → merged into `.sdrive/constitution.md`
|
|
241
|
+
|
|
242
|
+
### What Migration Preserves
|
|
243
|
+
|
|
244
|
+
- Original `openspec/` and `.specify/` folders are never deleted
|
|
245
|
+
- All migrated features are marked `retroactive: true`
|
|
246
|
+
- Every migrated feature records `migratedFrom: openspec` or `migratedFrom: speckit`
|
|
247
|
+
- Every migration is logged in `workflow-state.json` under `onboarding.migrated`
|
|
248
|
+
- Skipped migrations are logged under `onboarding.skipped`
|
|
249
|
+
|
|
250
|
+
### What Migration Does NOT Do
|
|
251
|
+
|
|
252
|
+
- Does not overwrite existing SpecDrive files
|
|
253
|
+
- Does not invent requirements
|
|
254
|
+
- Does not link tests
|
|
255
|
+
- Does not run verification
|
|
256
|
+
- Does not modify source code
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Core Workflow
|
|
261
|
+
|
|
262
|
+
### 1. `/sdrive:constitution`
|
|
263
|
+
|
|
264
|
+
Creates or updates the project constitution.
|
|
265
|
+
|
|
266
|
+
**What it does:**
|
|
267
|
+
|
|
268
|
+
- Discovers project stack, standards, and architecture
|
|
269
|
+
- Detects test framework, command, and folder
|
|
270
|
+
- Creates context files under `.sdrive/context/`
|
|
271
|
+
- Merges rules into `.sdrive/constitution.md`
|
|
272
|
+
- Includes versioning rules (`CON-603` to `CON-605`)
|
|
273
|
+
- Requires human approval before writing
|
|
274
|
+
|
|
275
|
+
**When to use:**
|
|
276
|
+
|
|
277
|
+
- First time setting up a project
|
|
278
|
+
- When project standards change
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
### 2. `/sdrive:propose`
|
|
283
|
+
|
|
284
|
+
Creates the feature specification, traceability matrix, technical plan, and execution tasks.
|
|
285
|
+
|
|
286
|
+
**What it does:**
|
|
287
|
+
|
|
288
|
+
- Accepts a natural feature description
|
|
289
|
+
- Generates a kebab-case feature name
|
|
290
|
+
- Uses default template from `.sdrive/config.json`
|
|
291
|
+
- Creates spec, plan, tasks, and traceability files
|
|
292
|
+
- Assigns the feature to `v1` automatically if new
|
|
293
|
+
- Runs anti-redundancy check
|
|
294
|
+
- Requires two human approval gates
|
|
295
|
+
|
|
296
|
+
**When to use:**
|
|
297
|
+
|
|
298
|
+
- Whenever a new feature is needed
|
|
299
|
+
- Before any code is written
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### 3. `/sdrive:apply`
|
|
304
|
+
|
|
305
|
+
Writes production code from the approved tasks.
|
|
306
|
+
|
|
307
|
+
**What it does:**
|
|
308
|
+
|
|
309
|
+
- Reads approved tasks and plan from the current version
|
|
310
|
+
- Asks which base branch to pull from
|
|
311
|
+
- Creates a feature branch with user approval
|
|
312
|
+
- Implements production code only (no tests)
|
|
313
|
+
- Runs `sdrive verify <feature>`
|
|
314
|
+
- Commits and pushes
|
|
315
|
+
|
|
316
|
+
**When to use:**
|
|
317
|
+
|
|
318
|
+
- After spec and plan are approved
|
|
319
|
+
- When implementation is ready
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
### 4. `/sdrive:test`
|
|
324
|
+
|
|
325
|
+
Writes tests for every acceptance criterion, runs them, and reports coverage.
|
|
326
|
+
|
|
327
|
+
**What it does:**
|
|
328
|
+
|
|
329
|
+
- Reads spec, plan, tasks, and traceability from the current version
|
|
330
|
+
- Detects the project's test framework
|
|
331
|
+
- Writes one test per AC
|
|
332
|
+
- Requires approval before writing
|
|
333
|
+
- Runs tests and updates `traceability.json`
|
|
334
|
+
- Generates a coverage report
|
|
335
|
+
- Runs `sdrive verify <feature>` and the governance validator
|
|
336
|
+
|
|
337
|
+
**When to use:**
|
|
338
|
+
|
|
339
|
+
- After `/sdrive:apply`
|
|
340
|
+
- Before `/sdrive:review`
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
### 5. `/sdrive:review`
|
|
345
|
+
|
|
346
|
+
Final audit, merge, and archive.
|
|
347
|
+
|
|
348
|
+
**What it does:**
|
|
349
|
+
|
|
350
|
+
- Verifies coverage: every AC has a linked, existing, passing test
|
|
351
|
+
- Runs spec-to-code verification
|
|
352
|
+
- Audits code against spec and traceability
|
|
353
|
+
- Requires human approval before merging
|
|
354
|
+
- Merges to main and archives the feature
|
|
355
|
+
- Marks the current version as `completed`
|
|
356
|
+
- Preserves older versions
|
|
357
|
+
|
|
358
|
+
**When to use:**
|
|
359
|
+
|
|
360
|
+
- After `/sdrive:test`
|
|
361
|
+
- Before shipping to production
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Optional Commands
|
|
366
|
+
|
|
367
|
+
| Command | Purpose | When to Use |
|
|
368
|
+
|---------|---------|-------------|
|
|
369
|
+
| `/sdrive:design` | Build UI/UX prototype | When there is no existing prototype |
|
|
370
|
+
| `/sdrive:secure` | Security audit and fixes | When security is a concern |
|
|
371
|
+
| `/sdrive:performance` | Benchmark and optimize | When performance NFRs are not met |
|
|
372
|
+
| `/sdrive:docs` | Generate documentation | When docs are outdated or missing |
|
|
373
|
+
| `/sdrive:sync` | Sync spec → plan → tasks | When higher-level files change |
|
|
374
|
+
| `/sdrive:skills` | Manage AI skills | When auditing or discovering skills |
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
### `/sdrive:design`
|
|
379
|
+
|
|
380
|
+
Builds interactive prototype using vanilla HTML, CSS, and JavaScript.
|
|
381
|
+
|
|
382
|
+
**What it does:**
|
|
383
|
+
|
|
384
|
+
- Creates design system under `.sdrive/prototype/`
|
|
385
|
+
- Builds screens and user flows
|
|
386
|
+
- Supports light/dark mode
|
|
387
|
+
- Maps screens to user stories
|
|
388
|
+
|
|
389
|
+
**When to use:**
|
|
390
|
+
|
|
391
|
+
- When there is no existing UI/UX prototype
|
|
392
|
+
- When visual validation is needed before coding
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### `/sdrive:secure`
|
|
397
|
+
|
|
398
|
+
Performs deep security audit.
|
|
399
|
+
|
|
400
|
+
**What it does:**
|
|
401
|
+
|
|
402
|
+
- Threat modeling
|
|
403
|
+
- OWASP Top 10 checks
|
|
404
|
+
- Dependency scanning
|
|
405
|
+
- Secret detection
|
|
406
|
+
- CVSS scoring
|
|
407
|
+
- Applies fixes after approval
|
|
408
|
+
|
|
409
|
+
**When to use:**
|
|
410
|
+
|
|
411
|
+
- Before release
|
|
412
|
+
- After adding new dependencies
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
### `/sdrive:performance`
|
|
417
|
+
|
|
418
|
+
Benchmarks and optimizes performance.
|
|
419
|
+
|
|
420
|
+
**What it does:**
|
|
421
|
+
|
|
422
|
+
- Measures baseline metrics
|
|
423
|
+
- Identifies bottlenecks
|
|
424
|
+
- Applies optimizations with approval
|
|
425
|
+
- Verifies improvements
|
|
426
|
+
|
|
427
|
+
**When to use:**
|
|
428
|
+
|
|
429
|
+
- When performance NFRs are not met
|
|
430
|
+
- After major feature implementations
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
### `/sdrive:docs`
|
|
435
|
+
|
|
436
|
+
Generates documentation.
|
|
437
|
+
|
|
438
|
+
**What it does:**
|
|
439
|
+
|
|
440
|
+
- Adds inline comments with traceability IDs
|
|
441
|
+
- Updates README
|
|
442
|
+
- Detects code/spec drift
|
|
443
|
+
- Generates coverage report
|
|
444
|
+
|
|
445
|
+
**When to use:**
|
|
446
|
+
|
|
447
|
+
- After implementation
|
|
448
|
+
- When docs are stale
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
### `/sdrive:sync`
|
|
453
|
+
|
|
454
|
+
Cascades changes across spec, plan, tasks, and traceability.
|
|
455
|
+
|
|
456
|
+
**What it does:**
|
|
457
|
+
|
|
458
|
+
- Detects changes in higher-level files
|
|
459
|
+
- Updates downstream files
|
|
460
|
+
- Preserves task status and IDs
|
|
461
|
+
- Runs `sdrive verify <feature>` after sync
|
|
462
|
+
|
|
463
|
+
**When to use:**
|
|
464
|
+
|
|
465
|
+
- When spec or plan changes after implementation has started
|
|
466
|
+
|
|
467
|
+
---
|
|
468
|
+
|
|
469
|
+
### `/sdrive:skills`
|
|
470
|
+
|
|
471
|
+
Audits and manages AI skills.
|
|
472
|
+
|
|
473
|
+
**What it does:**
|
|
474
|
+
|
|
475
|
+
- Scans existing skills
|
|
476
|
+
- Discovers new skills from GitHub
|
|
477
|
+
- Verifies security of community skills
|
|
478
|
+
- Installs approved skills
|
|
479
|
+
|
|
480
|
+
**When to use:**
|
|
481
|
+
|
|
482
|
+
- When setting up a new workspace
|
|
483
|
+
- When auditing existing AI skills
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Terminal Commands
|
|
488
|
+
|
|
489
|
+
| Command | Purpose |
|
|
490
|
+
|---------|---------|
|
|
491
|
+
| `sdrive init` | Initialize SpecDrive structure |
|
|
492
|
+
| `sdrive onboard` | Scan an existing project (usually run automatically by `/sdrive:onboard`) |
|
|
493
|
+
| `sdrive validate` | Validate governance files |
|
|
494
|
+
| `sdrive config:validate` | Validate `.sdrive/config.json` |
|
|
495
|
+
| `sdrive status` | Show feature lifecycle state |
|
|
496
|
+
| `sdrive approve <gate>` | Approve a workflow gate |
|
|
497
|
+
| `sdrive create <feature>` | Create feature scaffold (internal) |
|
|
498
|
+
| `sdrive team:add <username> <role>` | Add a new team member |
|
|
499
|
+
| `sdrive team:remove <username>` | Remove a team member |
|
|
500
|
+
| `sdrive team:list` | List all team members |
|
|
501
|
+
| `sdrive team:update <username> <role>` | Update a member's role |
|
|
502
|
+
| `sdrive team:sync` | Sync team members from GitHub collaborators |
|
|
503
|
+
| `sdrive template:list` | List available templates |
|
|
504
|
+
| `sdrive template:set <name>` | Set default template |
|
|
505
|
+
| `sdrive hooks:install` | Install pre-commit validation hook |
|
|
506
|
+
| `sdrive diff <old> <new>` | Show differences between two spec files |
|
|
507
|
+
| `sdrive openapi:generate <feature>` | Generate OpenAPI spec from plan.json |
|
|
508
|
+
| `sdrive dashboard` | Start local web dashboard |
|
|
509
|
+
| `sdrive reopen <feature>` | Reopen a completed feature |
|
|
510
|
+
| `sdrive verify <feature>` | Verify code matches plan.json |
|
|
511
|
+
| `sdrive version:new <feature>` | Create a new version of a feature |
|
|
512
|
+
| `sdrive diff:version <feature> <vA> <vB>` | Compare two versions of a feature |
|
|
513
|
+
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## Agents
|
|
517
|
+
|
|
518
|
+
| Agent | File | Role |
|
|
519
|
+
|-------|------|------|
|
|
520
|
+
| Onboarding | `00-onboarding.md` | Adopt SpecDrive into an existing project, migrate OpenSpec and Spec-Kit |
|
|
521
|
+
| Constitution | `01-constitution.md` | Discover project rules, merge into constitution |
|
|
522
|
+
| Specification | `02-specification.md` | Generate spec, plan, tasks, traceability |
|
|
523
|
+
| UI/UX | `03-uiux.md` | Build interactive prototype |
|
|
524
|
+
| Cascade | `04-cascade.md` | Sync spec → plan → tasks |
|
|
525
|
+
| Discover-skills | `05-discover-skills.md` | Audit AI skills |
|
|
526
|
+
| Documentation | `06-documentation.md` | Generate docs, detect drift |
|
|
527
|
+
| Implementation | `07-implementation.md` | Write production code |
|
|
528
|
+
| Performance | `08-performance.md` | Benchmark and optimize |
|
|
529
|
+
| Review & Complete | `09-review-complete.md` | Final audit and merge |
|
|
530
|
+
| Security | `10-security.md` | Security audit and fixes |
|
|
531
|
+
| Test | `11-test.md` | Write tests, run them, report coverage |
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## Templates
|
|
536
|
+
|
|
537
|
+
SpecDrive includes starter templates for common stacks.
|
|
538
|
+
|
|
539
|
+
| Template | Stack |
|
|
540
|
+
|----------|-------|
|
|
541
|
+
| `generic` | Any project |
|
|
542
|
+
| `react-node` | React + Node |
|
|
543
|
+
| `nextjs` | Next.js |
|
|
544
|
+
| `expo` | Expo / React Native |
|
|
545
|
+
| `fastapi` | Python FastAPI |
|
|
546
|
+
| `turborepo` | Turborepo monorepo |
|
|
547
|
+
|
|
548
|
+
The default template is stored in `.sdrive/config.json`.
|
|
549
|
+
|
|
550
|
+
Manage templates:
|
|
551
|
+
|
|
552
|
+
```bash
|
|
553
|
+
sdrive template:list
|
|
554
|
+
sdrive template:set nextjs
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
## Versions
|
|
560
|
+
|
|
561
|
+
Every feature is versioned. Each version has its own phase, gates, tasks, and history.
|
|
562
|
+
|
|
563
|
+
### Automatic `v1`
|
|
564
|
+
|
|
565
|
+
When you run `/sdrive:propose` on a new feature, SpecDrive assigns it to `v1` automatically.
|
|
566
|
+
|
|
567
|
+
### Creating a New Version
|
|
568
|
+
|
|
569
|
+
For structural changes (new workflow, new user story, behavior change), create a new version:
|
|
570
|
+
|
|
571
|
+
```bash
|
|
572
|
+
sdrive version:new user-login
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
This:
|
|
576
|
+
|
|
577
|
+
- Migrates the current files into `v1/` (if they weren't already)
|
|
578
|
+
- Creates a new `v2/` folder
|
|
579
|
+
- Preserves `v1` history
|
|
580
|
+
- Sets `v2` as the current version
|
|
581
|
+
|
|
582
|
+
Then run `/sdrive:propose` to fill in `v2`.
|
|
583
|
+
|
|
584
|
+
### Comparing Versions
|
|
585
|
+
|
|
586
|
+
```bash
|
|
587
|
+
sdrive diff:version user-login v1 v2
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Shows added and removed lines across spec, plan, and tasks.
|
|
591
|
+
|
|
592
|
+
### When to Use Versions
|
|
593
|
+
|
|
594
|
+
| Change | Version? |
|
|
595
|
+
|--------|----------|
|
|
596
|
+
| Typo fix | No |
|
|
597
|
+
| Small edge case | No |
|
|
598
|
+
| New user story | Yes |
|
|
599
|
+
| New workflow | Yes |
|
|
600
|
+
| Behavior change | Yes |
|
|
601
|
+
|
|
602
|
+
### Version Isolation
|
|
603
|
+
|
|
604
|
+
All agents operate within the **current version** folder only. Older versions are never modified.
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Directory Structure
|
|
609
|
+
|
|
610
|
+
```text
|
|
611
|
+
.sdrive/
|
|
612
|
+
├── agents/ # 12 agent definitions
|
|
613
|
+
├── commands/ # Manifest, router, gates, permissions
|
|
614
|
+
├── schemas/ # JSON schemas
|
|
615
|
+
├── specs/ # Human-readable specs
|
|
616
|
+
│ ├── backlog/
|
|
617
|
+
│ │ └── <feature>/
|
|
618
|
+
│ │ └── <version>/
|
|
619
|
+
│ ├── ongoing/
|
|
620
|
+
│ └── completed/
|
|
621
|
+
├── governance/ # Machine-readable JSON
|
|
622
|
+
│ └── <feature>/
|
|
623
|
+
│ └── <version>/
|
|
624
|
+
├── onboarding/ # Brownfield onboarding inventory + migration results
|
|
625
|
+
├── mcp/ # MCP server for AI chat integration
|
|
626
|
+
├── prototype/ # UI/UX prototypes
|
|
627
|
+
├── reports/ # Security, performance, docs, tests reports
|
|
628
|
+
├── context/ # Discovered project context
|
|
629
|
+
├── dashboard/ # Local web dashboard
|
|
630
|
+
├── skills/ # AI skills
|
|
631
|
+
├── templates/ # Starter templates
|
|
632
|
+
├── constitution.md # Governance source of truth
|
|
633
|
+
├── config.json # Default template + settings
|
|
634
|
+
├── team.json # Team roles and rules
|
|
635
|
+
└── workflow-state.json # Feature lifecycle state (per-version + onboarding)
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
640
|
+
## Validation
|
|
641
|
+
|
|
642
|
+
Run the governance validator:
|
|
643
|
+
|
|
644
|
+
```bash
|
|
645
|
+
sdrive validate
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
This checks all governance JSON against the schemas, including `config.json`.
|
|
649
|
+
|
|
650
|
+
If anything is invalid, it reports exact errors.
|
|
651
|
+
|
|
652
|
+
### Config Validation
|
|
653
|
+
|
|
654
|
+
```bash
|
|
655
|
+
sdrive config:validate
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
Checks only `.sdrive/config.json`.
|
|
659
|
+
|
|
660
|
+
### Pre-commit Hook
|
|
661
|
+
|
|
662
|
+
Automatically validate governance files before every commit:
|
|
663
|
+
|
|
664
|
+
```bash
|
|
665
|
+
sdrive hooks:install
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
---
|
|
669
|
+
|
|
670
|
+
## Spec-to-Code Verification
|
|
671
|
+
|
|
672
|
+
SpecDrive includes a deterministic validator that compares `plan.json` against actual code.
|
|
673
|
+
|
|
674
|
+
It detects:
|
|
675
|
+
|
|
676
|
+
- Missing implementation
|
|
677
|
+
- Renamed components, functions, endpoints, fields
|
|
678
|
+
- Extra code not in the plan
|
|
679
|
+
- Dependencies not installed
|
|
680
|
+
|
|
681
|
+
### Run Verification
|
|
682
|
+
|
|
683
|
+
```bash
|
|
684
|
+
sdrive verify user-login
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### Where It Runs
|
|
688
|
+
|
|
689
|
+
- After `/sdrive:apply`
|
|
690
|
+
- Before `/sdrive:review`
|
|
691
|
+
- On every `git commit` (if hooks installed)
|
|
692
|
+
- In CI on every PR
|
|
693
|
+
|
|
694
|
+
### Report
|
|
695
|
+
|
|
696
|
+
Results saved to:
|
|
697
|
+
|
|
698
|
+
```text
|
|
699
|
+
.sdrive/governance/<feature>/<version>/verification.json
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
Status can be:
|
|
703
|
+
|
|
704
|
+
| Status | Meaning |
|
|
705
|
+
|--------|---------|
|
|
706
|
+
| `pass` | Everything matches |
|
|
707
|
+
| `warn` | Extra code detected |
|
|
708
|
+
| `fail` | Missing or renamed code detected |
|
|
709
|
+
|
|
710
|
+
### Source Roots
|
|
711
|
+
|
|
712
|
+
SpecDrive reads source folders from the constitution.
|
|
713
|
+
|
|
714
|
+
If no source root is defined, it scans common folders:
|
|
715
|
+
|
|
716
|
+
- `src`, `app`, `lib`, `pages`, `server`, `internal`, `cmd`, `pkg`, `api`, `apps`, `packages`
|
|
717
|
+
|
|
718
|
+
---
|
|
719
|
+
|
|
720
|
+
## CI/CD Integration
|
|
721
|
+
|
|
722
|
+
SpecDrive ships with a GitHub Actions workflow.
|
|
723
|
+
|
|
724
|
+
Create `.github/workflows/sdrive-governance.yml`:
|
|
725
|
+
|
|
726
|
+
```yaml
|
|
727
|
+
name: SpecDrive Governance Validation
|
|
728
|
+
|
|
729
|
+
on:
|
|
730
|
+
pull_request:
|
|
731
|
+
branches:
|
|
732
|
+
- main
|
|
733
|
+
paths:
|
|
734
|
+
- '.sdrive/**'
|
|
735
|
+
- 'package.json'
|
|
736
|
+
|
|
737
|
+
jobs:
|
|
738
|
+
validate-governance:
|
|
739
|
+
runs-on: ubuntu-latest
|
|
740
|
+
steps:
|
|
741
|
+
- uses: actions/checkout@v4
|
|
742
|
+
- uses: actions/setup-node@v4
|
|
743
|
+
with:
|
|
744
|
+
node-version: '20'
|
|
745
|
+
- name: Install Dependencies
|
|
746
|
+
run: |
|
|
747
|
+
cd .sdrive
|
|
748
|
+
npm install
|
|
749
|
+
- name: Run Governance Validation
|
|
750
|
+
run: node .sdrive/scripts/validate-governance.js
|
|
751
|
+
- name: Run Spec-to-Code Verification
|
|
752
|
+
run: node .sdrive/scripts/verify.js
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
---
|
|
756
|
+
|
|
757
|
+
## MCP Server
|
|
758
|
+
|
|
759
|
+
SpecDrive ships with an MCP server so AI tools can call SpecDrive directly from chat.
|
|
760
|
+
|
|
761
|
+
You can ask in plain language:
|
|
762
|
+
|
|
763
|
+
```text
|
|
764
|
+
Show me all features
|
|
765
|
+
Is the governance valid?
|
|
766
|
+
Get the traceability for user-login
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
The AI tool calls SpecDrive automatically through MCP.
|
|
770
|
+
|
|
771
|
+
### Setup
|
|
772
|
+
|
|
773
|
+
`sdrive init` creates the MCP server at:
|
|
774
|
+
|
|
775
|
+
```text
|
|
776
|
+
.sdrive/mcp/server.js
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
It also asks which MCP clients to wire. Supported:
|
|
780
|
+
|
|
781
|
+
| Client | Config Path |
|
|
782
|
+
|--------|-------------|
|
|
783
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
784
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
785
|
+
| Cursor | `.cursor/mcp.json` |
|
|
786
|
+
| Cline | `.cline/mcp.json` |
|
|
787
|
+
| VS Code | `.vscode/mcp.json` |
|
|
788
|
+
|
|
789
|
+
SpecDrive never overwrites existing MCP entries. It merges safely.
|
|
790
|
+
|
|
791
|
+
### Available MCP Methods
|
|
792
|
+
|
|
793
|
+
| Method | Purpose |
|
|
794
|
+
|--------|---------|
|
|
795
|
+
| `specdrive.list_features` | List all features |
|
|
796
|
+
| `specdrive.get_feature` | Get details for a feature |
|
|
797
|
+
| `specdrive.get_spec` | Get `spec.json` for a feature |
|
|
798
|
+
| `specdrive.get_traceability` | Get traceability matrix |
|
|
799
|
+
| `specdrive.validate` | Run governance validator |
|
|
800
|
+
| `specdrive.status` | Get status summary |
|
|
801
|
+
|
|
802
|
+
---
|
|
803
|
+
|
|
804
|
+
## Tool Support
|
|
805
|
+
|
|
806
|
+
SpecDrive supports 15 AI tools.
|
|
807
|
+
|
|
808
|
+
| Tool | Adapter |
|
|
809
|
+
|------|---------|
|
|
810
|
+
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
811
|
+
| Cline | `.clinerules/sdrive.md` |
|
|
812
|
+
| Claude Code | `.claude/commands/sdrive.md` |
|
|
813
|
+
| Cursor | `.cursor/rules/sdrive.md` |
|
|
814
|
+
| VS Code | `.vscode/sdrive-commands.json` |
|
|
815
|
+
| Amazon Q Developer | `.amazonq/rules/sdrive.md` |
|
|
816
|
+
| Gemini CLI | `.gemini/commands/sdrive.md` |
|
|
817
|
+
| Continue | `.continue/rules/sdrive.md` |
|
|
818
|
+
| Codex | `.codex/rules/sdrive.md` |
|
|
819
|
+
| Windsurf | `.windsurf/rules/sdrive.md` |
|
|
820
|
+
| Kilo Code | `.kilocode/rules/sdrive.md` |
|
|
821
|
+
| OpenCode | `.opencode/rules/sdrive.md` |
|
|
822
|
+
| Qoder | `.qoder/rules/sdrive.md` |
|
|
823
|
+
| Qwen Code | `.qwen/rules/sdrive.md` |
|
|
824
|
+
| Rovo Dev CLI | `.rovo/rules/sdrive.md` |
|
|
825
|
+
|
|
826
|
+
Adapters are generated automatically when you run `sdrive init`.
|
|
827
|
+
|
|
828
|
+
During initialization, you select which tools you use. Only selected tools get adapters.
|
|
829
|
+
|
|
830
|
+
---
|
|
831
|
+
|
|
832
|
+
## Web Dashboard
|
|
833
|
+
|
|
834
|
+
SpecDrive includes a local web dashboard for visual inspection of your specs, features, and team.
|
|
835
|
+
|
|
836
|
+
### Start the Dashboard
|
|
837
|
+
|
|
838
|
+
```bash
|
|
839
|
+
sdrive dashboard
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
Then open:
|
|
843
|
+
|
|
844
|
+
```text
|
|
845
|
+
http://localhost:4747
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
### What It Shows
|
|
849
|
+
|
|
850
|
+
- Onboarding status (greenfield, brownfield partial, brownfield complete)
|
|
851
|
+
- Detected external spec systems (OpenSpec, Spec-Kit)
|
|
852
|
+
- Migrated features and their source
|
|
853
|
+
- Skipped migrations and reasons
|
|
854
|
+
- Missing and deferred items
|
|
855
|
+
- All features and their current version
|
|
856
|
+
- All versions per feature, with their own phase and gates
|
|
857
|
+
- Branch name for each feature
|
|
858
|
+
- Gate status per version
|
|
859
|
+
- Who approved each gate
|
|
860
|
+
- Traceability coverage per version
|
|
861
|
+
- Spec-to-code verification status per version
|
|
862
|
+
- Test coverage per version
|
|
863
|
+
- Team members and roles
|
|
864
|
+
- Recent audit activity
|
|
865
|
+
|
|
866
|
+
### Filters
|
|
867
|
+
|
|
868
|
+
The dashboard includes a filter bar:
|
|
869
|
+
|
|
870
|
+
- Search by feature name
|
|
871
|
+
- Filter by phase
|
|
872
|
+
- Filter by verification status
|
|
873
|
+
- Filter by test coverage
|
|
874
|
+
- Show current version only
|
|
875
|
+
|
|
876
|
+
### Notes
|
|
877
|
+
|
|
878
|
+
- The dashboard runs locally on port `4747`
|
|
879
|
+
- It reads directly from `.sdrive/`
|
|
880
|
+
- No data leaves your machine
|
|
881
|
+
|
|
882
|
+
---
|
|
883
|
+
|
|
884
|
+
## Team Collaboration
|
|
885
|
+
|
|
886
|
+
SpecDrive supports team roles.
|
|
887
|
+
|
|
888
|
+
| Role | Can approve | Can implement |
|
|
889
|
+
|------|-------------|---------------|
|
|
890
|
+
| admin | ✅ | ✅ |
|
|
891
|
+
| reviewer | ✅ | ❌ |
|
|
892
|
+
| developer | ❌ | ✅ |
|
|
893
|
+
|
|
894
|
+
Manage team:
|
|
895
|
+
|
|
896
|
+
```bash
|
|
897
|
+
sdrive team:add alice admin
|
|
898
|
+
sdrive team:list
|
|
899
|
+
sdrive team:update bob reviewer
|
|
900
|
+
sdrive team:remove carol
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
### Sync from GitHub
|
|
904
|
+
|
|
905
|
+
Automatically pull collaborators from your GitHub repository:
|
|
906
|
+
|
|
907
|
+
```bash
|
|
908
|
+
sdrive team:sync
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
Roles are auto-assigned:
|
|
912
|
+
|
|
913
|
+
- GitHub admins → `admin`
|
|
914
|
+
- Others → `developer`
|
|
915
|
+
|
|
916
|
+
Reviewer roles must be assigned manually.
|
|
917
|
+
|
|
918
|
+
---
|
|
919
|
+
|
|
920
|
+
## Permissions
|
|
921
|
+
|
|
922
|
+
SpecDrive enforces role-based permissions on both slash commands and CLI commands.
|
|
923
|
+
|
|
924
|
+
Permission rules live in:
|
|
925
|
+
|
|
926
|
+
```text
|
|
927
|
+
.sdrive/commands/permissions.json
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
The current Git user is detected via:
|
|
931
|
+
|
|
932
|
+
```bash
|
|
933
|
+
git config user.name
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
That user must exist in `.sdrive/team.json`.
|
|
937
|
+
|
|
938
|
+
If they are not in the team, or their role is not allowed, the command is blocked before execution.
|
|
939
|
+
|
|
940
|
+
Customize rules by editing `.sdrive/commands/permissions.json`.
|
|
941
|
+
|
|
942
|
+
---
|
|
943
|
+
|
|
944
|
+
## Contributing
|
|
945
|
+
|
|
946
|
+
Contributions are welcome.
|
|
947
|
+
|
|
948
|
+
Please read the constitution and agent definitions before contributing.
|
|
949
|
+
|
|
950
|
+
---
|
|
951
|
+
|
|
952
|
+
## License
|
|
953
|
+
|
|
954
|
+
MIT
|
|
955
|
+
```
|