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.
Files changed (74) hide show
  1. package/README.md +955 -697
  2. package/agents/00-onboarding.md +261 -0
  3. package/agents/01-constitution.md +214 -201
  4. package/agents/02-specification.md +249 -226
  5. package/agents/03-uiux.md +156 -144
  6. package/agents/04-cascade.md +151 -122
  7. package/agents/05-discover-skills.md +136 -136
  8. package/agents/06-documentation.md +158 -145
  9. package/agents/07-implementation.md +201 -169
  10. package/agents/08-performance.md +179 -165
  11. package/agents/09-review-complete.md +239 -168
  12. package/agents/10-security.md +180 -167
  13. package/agents/11-test.md +195 -0
  14. package/commands/gates.js +73 -73
  15. package/commands/manifest.json +113 -95
  16. package/commands/permissions.json +39 -0
  17. package/commands/router.js +151 -127
  18. package/commands/tools.json +19 -19
  19. package/dashboard/app.js +394 -0
  20. package/dashboard/index.html +74 -0
  21. package/dashboard/server.js +166 -0
  22. package/dashboard/style.css +157 -0
  23. package/mcp/mcp.json +31 -0
  24. package/mcp/server.js +108 -0
  25. package/package.json +35 -32
  26. package/schemas/config.schema.json +20 -0
  27. package/schemas/workflow-state.schema.json +149 -38
  28. package/scripts/anti-redundancy.js +176 -176
  29. package/scripts/audit-log.js +46 -46
  30. package/scripts/check-permission.js +87 -0
  31. package/scripts/diff-spec.js +50 -50
  32. package/scripts/diff-version.js +96 -0
  33. package/scripts/generate-adapters.js +80 -80
  34. package/scripts/generate-from-template.js +97 -97
  35. package/scripts/generate-openapi.js +75 -75
  36. package/scripts/github-team-sync.js +80 -80
  37. package/scripts/install-hooks.js +20 -20
  38. package/scripts/load-plugins.js +65 -65
  39. package/scripts/migrate-openspec.js +318 -0
  40. package/scripts/migrate-speckit.js +322 -0
  41. package/scripts/migrate.js +12 -62
  42. package/scripts/onboard.js +312 -0
  43. package/scripts/pre-commit.js +56 -20
  44. package/scripts/team.js +113 -113
  45. package/scripts/test-adapters.js +118 -118
  46. package/scripts/test-create.js +13 -13
  47. package/scripts/test-end-to-end.js +137 -137
  48. package/scripts/test-router.js +110 -110
  49. package/scripts/test-state-transitions.js +146 -146
  50. package/scripts/test-validator.js +152 -152
  51. package/scripts/validate-config.js +36 -0
  52. package/scripts/validate-governance.js +150 -130
  53. package/scripts/verify.js +525 -0
  54. package/scripts/version-new.js +202 -0
  55. package/src/index.js +1010 -807
  56. package/templates/expo/plan.json +12 -0
  57. package/templates/expo/spec.json +12 -0
  58. package/templates/expo/tasks.json +5 -0
  59. package/templates/fastapi/plan.json +12 -0
  60. package/templates/fastapi/spec.json +12 -0
  61. package/templates/fastapi/tasks.json +5 -0
  62. package/templates/generic/plan.json +12 -0
  63. package/templates/generic/spec.json +11 -0
  64. package/templates/generic/tasks.json +5 -0
  65. package/templates/nextjs/plan.json +23 -0
  66. package/templates/nextjs/spec.json +12 -0
  67. package/templates/nextjs/tasks.json +5 -0
  68. package/templates/react-node/plan.json +15 -0
  69. package/templates/react-node/spec.json +12 -0
  70. package/templates/react-node/tasks.json +5 -0
  71. package/templates/registry.json +30 -0
  72. package/templates/turborepo/plan.json +12 -0
  73. package/templates/turborepo/spec.json +12 -0
  74. package/templates/turborepo/tasks.json +5 -0
package/README.md CHANGED
@@ -1,697 +1,955 @@
1
- ---
2
-
3
- ```markdown
4
- # SpecDrive
5
-
6
- **Enterprise Spec-Driven Development for AI Coding Tools**
7
-
8
- SpecDrive gives AI coding tools like GitHub Copilot, Cline, Claude Code, and Cursor a deterministic governance layer for spec-driven development.
9
-
10
- It adds:
11
-
12
- - 10 specialized governance agents
13
- - Machine-readable JSON schemas
14
- - Requirement → AC → task → test traceability
15
- - Human approval gates
16
- - Anti-redundancy checks
17
- - Anti-hallucination controls
18
- - CI/CD integration
19
-
20
- ---
21
-
22
- ## Table of Contents
23
-
24
- - [Why SpecDrive](#why-specdrive)
25
- - [Prerequisites](#prerequisites)
26
- - [Installation](#installation)
27
- - [Where to Run Commands](#where-to-run-commands)
28
- - [Quickstart](#quickstart)
29
- - [Core Workflow](#core-workflow)
30
- - [Optional Commands](#optional-commands)
31
- - [Terminal Commands](#terminal-commands)
32
- - [Agents](#agents)
33
- - [Templates](#templates)
34
- - [Directory Structure](#directory-structure)
35
- - [Validation](#validation)
36
- - [CI/CD Integration](#cicd-integration)
37
- - [MCP Server](#mcp-server)
38
- - [Tool Support](#tool-support)
39
- - [Web Dashboard](#web-dashboard)
40
- - [Team Collaboration](#team-collaboration)
41
- - [Contributing](#contributing)
42
- - [License](#license)
43
-
44
- ---
45
-
46
- ## Why SpecDrive
47
-
48
- OpenSpec and Spec-Kit are great, but they lack strict governance controls.
49
-
50
- SpecDrive adds:
51
-
52
- - Strict JSON Schema validation
53
- - Complete requirement-to-test traceability
54
- - Human approval at every critical phase
55
- - Anti-redundancy engine
56
- - Deterministic governance validator
57
-
58
- This makes AI-generated specs and code safe for enterprise use.
59
-
60
- ---
61
-
62
- ## Prerequisites
63
-
64
- - Node.js 18 or later
65
- - npm 9 or later
66
- - Git
67
- - An AI coding tool that supports custom commands or instructions
68
-
69
- ---
70
-
71
- ## Installation
72
-
73
- ### Global Install
74
-
75
- ```bash
76
- npm install -g specdrive-cli@latest
77
- ```
78
-
79
- ### Verify Install
80
-
81
- ```bash
82
- sdrive --version
83
- ```
84
-
85
- ### Initialize a Project
86
-
87
- Inside your project root, run:
88
-
89
- ```bash
90
- sdrive init
91
- ```
92
-
93
- SpecDrive will ask you to select which AI tools you use.
94
-
95
- It then creates the `.sdrive/` folder and tool adapters for the selected tools.
96
-
97
- ---
98
-
99
- ## Where to Run Commands
100
-
101
- | Command Type | Where to Run | Example |
102
- |--------------|--------------|---------|
103
- | Terminal command | In your terminal / shell | `sdrive init` |
104
- | Slash command | In your AI tool's chat | `/sdrive:propose "User login"` |
105
-
106
- **Rule:** If it starts with `sdrive`, run it in the terminal. If it starts with `/sdrive:`, run it in your AI chat.
107
-
108
- ---
109
-
110
- ## Quickstart
111
-
112
- 1. Initialize the project:
113
-
114
- ```bash
115
- sdrive init
116
- ```
117
-
118
- 2. Create your constitution:
119
-
120
- ```text
121
- /sdrive:constitution
122
- ```
123
-
124
- 3. Propose a feature:
125
-
126
- ```text
127
- /sdrive:propose "User login with email and password"
128
- ```
129
-
130
- 4. Implement:
131
-
132
- ```text
133
- /sdrive:apply
134
- ```
135
-
136
- 5. Review and merge:
137
-
138
- ```text
139
- /sdrive:review
140
- ```
141
-
142
- ---
143
-
144
- ## Core Workflow
145
-
146
- ### 1. `/sdrive:constitution`
147
-
148
- Creates or updates the project constitution.
149
-
150
- **What it does:**
151
-
152
- - Discovers project stack, coding standards, and architecture
153
- - Creates context files under `.sdrive/context/`
154
- - Merges rules into `.sdrive/constitution.md`
155
- - Requires human approval before writing
156
-
157
- **When to use:**
158
-
159
- - First time setting up a project
160
- - When project standards change
161
-
162
- ---
163
-
164
- ### 2. `/sdrive:propose`
165
-
166
- Creates the feature specification, traceability matrix, technical plan, and execution tasks.
167
-
168
- **What it does:**
169
-
170
- - Accepts a natural feature description
171
- - Generates a kebab-case feature name
172
- - Creates spec, plan, tasks, and traceability files
173
- - Runs anti-redundancy check
174
- - Requires two human approval gates
175
-
176
- **When to use:**
177
-
178
- - Whenever a new feature is needed
179
- - Before any code is written
180
-
181
- ---
182
-
183
- ### 3. `/sdrive:apply`
184
-
185
- Writes production code from the approved tasks.
186
-
187
- **What it does:**
188
-
189
- - Reads approved tasks and plan
190
- - Asks which base branch to pull from
191
- - Creates a feature branch with user approval
192
- - Implements tasks one by one
193
- - Runs validators and tests
194
- - Commits and pushes
195
-
196
- **When to use:**
197
-
198
- - After spec and plan are approved
199
- - When implementation is ready
200
-
201
- ---
202
-
203
- ### 4. `/sdrive:review`
204
-
205
- Final audit, merge, and archive.
206
-
207
- **What it does:**
208
-
209
- - Audits code against spec and traceability
210
- - Runs security and quality checks
211
- - Requires human approval before merging
212
- - Merges to main and archives the feature
213
-
214
- **When to use:**
215
-
216
- - After implementation is complete
217
- - Before shipping to production
218
-
219
- ---
220
-
221
- ## Optional Commands
222
-
223
- | Command | Purpose | When to Use |
224
- |---------|---------|-------------|
225
- | `/sdrive:design` | Build UI/UX prototype | When there is no existing prototype |
226
- | `/sdrive:secure` | Security audit and fixes | When security is a concern |
227
- | `/sdrive:performance` | Benchmark and optimize | When performance NFRs are not met |
228
- | `/sdrive:docs` | Generate documentation | When docs are outdated or missing |
229
- | `/sdrive:sync` | Sync spec → plan → tasks | When higher-level files change |
230
- | `/sdrive:skills` | Manage AI skills | When auditing or discovering skills |
231
-
232
- ---
233
-
234
- ### `/sdrive:design`
235
-
236
- Builds interactive prototype using vanilla HTML, CSS, and JavaScript.
237
-
238
- **What it does:**
239
-
240
- - Creates design system under `.sdrive/prototype/`
241
- - Builds screens and user flows
242
- - Supports light/dark mode
243
- - Maps screens to user stories
244
-
245
- **When to use:**
246
-
247
- - When there is no existing UI/UX prototype
248
- - When visual validation is needed before coding
249
-
250
- ---
251
-
252
- ### `/sdrive:secure`
253
-
254
- Performs deep security audit.
255
-
256
- **What it does:**
257
-
258
- - Threat modeling
259
- - OWASP Top 10 checks
260
- - Dependency scanning
261
- - Secret detection
262
- - CVSS scoring
263
- - Applies fixes after approval
264
-
265
- **When to use:**
266
-
267
- - Before release
268
- - After adding new dependencies
269
-
270
- ---
271
-
272
- ### `/sdrive:performance`
273
-
274
- Benchmarks and optimizes performance.
275
-
276
- **What it does:**
277
-
278
- - Measures baseline metrics
279
- - Identifies bottlenecks
280
- - Applies optimizations with approval
281
- - Verifies improvements
282
-
283
- **When to use:**
284
-
285
- - When performance NFRs are not met
286
- - After major feature implementations
287
-
288
- ---
289
-
290
- ### `/sdrive:docs`
291
-
292
- Generates documentation.
293
-
294
- **What it does:**
295
-
296
- - Adds inline comments with traceability IDs
297
- - Updates README
298
- - Detects code/spec drift
299
- - Generates coverage report
300
-
301
- **When to use:**
302
-
303
- - After implementation
304
- - When docs are stale
305
-
306
- ---
307
-
308
- ### `/sdrive:sync`
309
-
310
- Cascades changes across spec, plan, tasks, and traceability.
311
-
312
- **What it does:**
313
-
314
- - Detects changes in higher-level files
315
- - Updates downstream files
316
- - Preserves task status and IDs
317
-
318
- **When to use:**
319
-
320
- - When spec or plan changes after implementation has started
321
-
322
- ---
323
-
324
- ### `/sdrive:skills`
325
-
326
- Audits and manages AI skills.
327
-
328
- **What it does:**
329
-
330
- - Scans existing skills
331
- - Discovers new skills from GitHub
332
- - Verifies security of community skills
333
- - Installs approved skills
334
-
335
- **When to use:**
336
-
337
- - When setting up a new workspace
338
- - When auditing existing AI skills
339
-
340
- ---
341
-
342
- ## Terminal Commands
343
-
344
- | Command | Purpose |
345
- |---------|---------|
346
- | `sdrive init` | Initialize SpecDrive structure |
347
- | `sdrive validate` | Validate governance files |
348
- | `sdrive status` | Show feature lifecycle state |
349
- | `sdrive approve <gate>` | Approve a workflow gate |
350
- | `sdrive create <feature>` | Create feature scaffold (internal) |
351
- | `sdrive team:add <username> <role>` | Add a new team member |
352
- | `sdrive team:remove <username>` | Remove a team member |
353
- | `sdrive team:list` | List all team members |
354
- | `sdrive team:update <username> <role>` | Update a member's role |
355
- | `sdrive template:list` | List available templates |
356
- | `sdrive template:set <name>` | Set default template |
357
- | `sdrive hooks:install` | Install pre-commit validation hook |
358
- | `sdrive migrate` | Migrate specs from OpenSpec or Spec-Kit |
359
- | `sdrive diff <old> <new>` | Show differences between two spec files |
360
- | `sdrive openapi:generate <feature>` | Generate OpenAPI spec from plan.json |
361
- | `sdrive team:sync` | Sync team members from GitHub collaborators |
362
-
363
- ---
364
-
365
- ## Agents
366
-
367
- | Agent | File | Role |
368
- |-------|------|------|
369
- | Constitution | `01-constitution.md` | Discover project rules, merge into constitution |
370
- | Specification | `02-specification.md` | Generate spec, plan, tasks, traceability |
371
- | UI/UX | `03-uiux.md` | Build interactive prototype |
372
- | Cascade | `04-cascade.md` | Sync spec → plan → tasks |
373
- | Discover-skills | `05-discover-skills.md` | Audit AI skills |
374
- | Documentation | `06-documentation.md` | Generate docs, detect drift |
375
- | Implementation | `07-implementation.md` | Write production code |
376
- | Performance | `08-performance.md` | Benchmark and optimize |
377
- | Review & Complete | `09-review-complete.md` | Final audit and merge |
378
- | Security | `10-security.md` | Security audit and fixes |
379
-
380
- ---
381
-
382
- ## Templates
383
-
384
- SpecDrive includes starter templates for common stacks.
385
-
386
- | Template | Stack |
387
- |----------|-------|
388
- | `generic` | Any project |
389
- | `react-node` | React + Node |
390
- | `nextjs` | Next.js |
391
- | `expo` | Expo / React Native |
392
- | `fastapi` | Python FastAPI |
393
- | `turborepo` | Turborepo monorepo |
394
-
395
- The default template is stored in `.sdrive/config.json`.
396
-
397
- Manage templates:
398
-
399
- ```bash
400
- sdrive template:list
401
- sdrive template:set nextjs
402
- ```
403
-
404
- ---
405
-
406
- ## Directory Structure
407
-
408
- ```text
409
- .sdrive/
410
- ├── agents/ # 10 agent definitions
411
- ├── commands/ # Manifest, router, gates
412
- ├── schemas/ # JSON schemas
413
- ├── specs/ # Human-readable specs
414
- │ ├── backlog/
415
- │ ├── ongoing/
416
- │ └── completed/
417
- ├── governance/ # Machine-readable JSON
418
- ├── mcp/ # MCP server for AI chat integration
419
- ├── prototype/ # UI/UX prototypes
420
- ├── reports/ # Security, performance, docs reports
421
- ├── context/ # Discovered project context
422
- ├── dashboard/ # Local web dashboard
423
- ├── skills/ # AI skills
424
- ├── templates/ # Starter templates
425
- ├── constitution.md # Governance source of truth
426
- └── workflow-state.json # Feature lifecycle state
427
- ```
428
-
429
- ---
430
-
431
- ## Validation
432
-
433
- Run the governance validator:
434
-
435
- ```bash
436
- sdrive validate
437
- ```
438
-
439
- This checks all governance JSON against the schemas.
440
-
441
- If anything is invalid, it reports exact errors.
442
-
443
- ---
444
-
445
- ### `sdrive openapi:generate <feature>`
446
-
447
- Generates an OpenAPI 3.0 specification from the API contracts in `plan.json`.
448
-
449
- Useful for importing into Postman, Swagger UI, or client generators.
450
-
451
- ```bash
452
- sdrive openapi:generate user-login
453
-
454
- ### Pre-commit Hook
455
-
456
- Automatically validate governance files before every commit:
457
-
458
- ```bash
459
- sdrive hooks:install
460
- ```
461
-
462
- ### `sdrive migrate`
463
-
464
- Migrates existing specs from OpenSpec or Spec-Kit into SpecDrive.
465
-
466
- ```bash
467
- sdrive migrate
468
- ```
469
-
470
- ### `sdrive diff <old> <new>`
471
-
472
- Compares two spec files and shows differences.
473
-
474
- ```bash
475
- sdrive diff spec-v1.md spec-v2.md
476
- ```
477
-
478
- ---
479
-
480
- ## CI/CD Integration
481
-
482
- SpecDrive ships with a GitHub Actions workflow.
483
-
484
- Create `.github/workflows/sdrive-governance.yml`:
485
-
486
- ```yaml
487
- name: SpecDrive Governance Validation
488
-
489
- on:
490
- pull_request:
491
- branches:
492
- - main
493
- paths:
494
- - '.sdrive/**'
495
- - 'package.json'
496
-
497
- jobs:
498
- validate-governance:
499
- runs-on: ubuntu-latest
500
- steps:
501
- - uses: actions/checkout@v4
502
- - uses: actions/setup-node@v4
503
- with:
504
- node-version: '20'
505
- - name: Install Dependencies
506
- run: |
507
- cd .sdrive
508
- npm install
509
- - name: Run Governance Validation
510
- run: node .sdrive/scripts/validate-governance.js
511
- ```
512
-
513
-
514
- ## MCP Server
515
-
516
- SpecDrive ships with an MCP server so AI tools can call SpecDrive directly from chat.
517
-
518
- You can ask in plain language:
519
-
520
- ```text
521
- Show me all features
522
- Is the governance valid?
523
- Get the traceability for user-login
524
- ```
525
-
526
- The AI tool calls SpecDrive automatically through MCP.
527
-
528
- ### Setup
529
-
530
- `sdrive init` creates the MCP server at:
531
-
532
- ```text
533
- .sdrive/mcp/server.js
534
- ```
535
-
536
- It also asks which MCP clients to wire. Supported:
537
-
538
- | Client | Config Path |
539
- |--------|-------------|
540
- | Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
541
- | Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
542
- | Cursor | `.cursor/mcp.json` |
543
- | Cline | `.cline/mcp.json` |
544
- | VS Code | `.vscode/mcp.json` |
545
-
546
- SpecDrive never overwrites existing MCP entries. It merges safely.
547
-
548
- ### Manual Config
549
-
550
- If you prefer to wire it yourself, add to your MCP client config:
551
-
552
- ```json
553
- {
554
- "mcpServers": {
555
- "specdrive": {
556
- "command": "node",
557
- "args": [".sdrive/mcp/server.js"]
558
- }
559
- }
560
- }
561
- ```
562
-
563
- ### Available MCP Methods
564
-
565
- | Method | Purpose |
566
- |--------|---------|
567
- | `specdrive.list_features` | List all features |
568
- | `specdrive.get_feature` | Get details for a feature |
569
- | `specdrive.get_spec` | Get `spec.json` for a feature |
570
- | `specdrive.get_traceability` | Get traceability matrix |
571
- | `specdrive.validate` | Run governance validator |
572
- | `specdrive.status` | Get status summary |
573
-
574
- ---
575
-
576
- ## Tool Support
577
-
578
- SpecDrive supports 15 AI tools.
579
-
580
- | Tool | Adapter |
581
- |------|---------|
582
- | GitHub Copilot | `.github/copilot-instructions.md` |
583
- | Cline | `.clinerules/sdrive.md` |
584
- | Claude Code | `.claude/commands/sdrive.md` |
585
- | Cursor | `.cursor/rules/sdrive.md` |
586
- | VS Code | `.vscode/sdrive-commands.json` |
587
- | Amazon Q Developer | `.amazonq/rules/sdrive.md` |
588
- | Gemini CLI | `.gemini/commands/sdrive.md` |
589
- | Continue | `.continue/rules/sdrive.md` |
590
- | Codex | `.codex/rules/sdrive.md` |
591
- | Windsurf | `.windsurf/rules/sdrive.md` |
592
- | Kilo Code | `.kilocode/rules/sdrive.md` |
593
- | OpenCode | `.opencode/rules/sdrive.md` |
594
- | Qoder | `.qoder/rules/sdrive.md` |
595
- | Qwen Code | `.qwen/rules/sdrive.md` |
596
- | Rovo Dev CLI | `.rovo/rules/sdrive.md` |
597
-
598
- Adapters are generated automatically when you run `sdrive init`.
599
-
600
- During initialization, you select which tools you use. Only selected tools get adapters.
601
-
602
- ---
603
-
604
- ## Web Dashboard
605
-
606
- SpecDrive includes a local web dashboard for visual inspection of your specs, features, and team.
607
-
608
- ### Start the Dashboard
609
-
610
- ```bash
611
- sdrive dashboard
612
- ```
613
-
614
- Then open:
615
-
616
- ```text
617
- http://localhost:4747
618
- ```
619
-
620
- ### What It Shows
621
-
622
- - All features and their phase
623
- - Branch name for each feature
624
- - Gate status (spec, plan, implementation, review)
625
- - Who approved each gate
626
- - Traceability coverage per feature
627
- - Team members and roles
628
- - Recent audit activity
629
-
630
- ### Notes
631
-
632
- - The dashboard runs locally on port `4747`
633
- - It reads directly from `.sdrive/`
634
- - No data leaves your machine
635
- ---
636
-
637
- ## Team Collaboration
638
-
639
- SpecDrive supports team roles.
640
-
641
- | Role | Can approve | Can implement |
642
- |------|-------------|---------------|
643
- | admin | ✅ | ✅ |
644
- | reviewer | ✅ | ❌ |
645
- | developer | ❌ | ✅ |
646
-
647
- Manage team:
648
-
649
- ```bash
650
- sdrive team:add alice admin
651
- sdrive team:list
652
- sdrive team:update bob reviewer
653
- sdrive team:remove carol
654
- ```
655
-
656
- ### Sync from GitHub
657
-
658
- Automatically pull collaborators from your GitHub repository:
659
-
660
- ```bash
661
- sdrive team:sync
662
- ```
663
-
664
- Requires:
665
-
666
- - Git repo with GitHub remote
667
- - GitHub CLI (`gh`) installed and authenticated
668
-
669
- Roles are auto-assigned:
670
-
671
- - GitHub admins → `admin`
672
- - Others → `developer`
673
-
674
- Reviewer roles must be assigned manually:
675
-
676
- ```bash
677
- sdrive team:update <username> reviewer
678
- ```
679
-
680
- ---
681
-
682
- ## Contributing
683
-
684
- Contributions are welcome.
685
-
686
- Please read the constitution and agent definitions before contributing.
687
-
688
- ---
689
-
690
- ## License
691
-
692
- MIT
693
- ```
694
-
695
- ---
696
-
697
- This README is now clean, correct, and ready to publish.
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
+ ```