speckeeper 0.9.4 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
 
3
3
  TypeScript-first specification validation framework — validate design consistency, external SSOT integrity, and traceability with type-safe TypeScript DSL. Supports design lint, external source checks (OpenAPI, DDL, annotations), drift detection, impact analysis, and scaffolding from Mermaid flowcharts.
4
4
 
5
- **Version:** 0.9.4
5
+ **Version:** 0.10.0
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -15,6 +15,10 @@ TypeScript-first specification validation framework — validate design consiste
15
15
  - [new](#speckeeper-new)
16
16
  - [impact](#speckeeper-impact)
17
17
  - [scaffold](#speckeeper-scaffold)
18
+ - [audit-requirements](#speckeeper-audit-requirements)
19
+ - [propose-trace-links](#speckeeper-propose-trace-links)
20
+ - [explain-impact](#speckeeper-explain-impact)
21
+ - [propose-acceptance-criteria](#speckeeper-propose-acceptance-criteria)
18
22
 
19
23
  ---
20
24
 
@@ -48,7 +52,7 @@ speckeeper init --force
48
52
 
49
53
  | Option | Aliases | Required | Default | Description |
50
54
  |---|---|---|---|---|
51
- | `--force` | -f | No | `false` | Overwrite existing files. |
55
+ | `--force` | -F | No | `false` | Overwrite existing files. |
52
56
 
53
57
  #### Exit Codes
54
58
 
@@ -64,11 +68,12 @@ speckeeper init --force
64
68
 
65
69
  ```yaml
66
70
  x-agent:
67
- riskLevel: low
68
- requiresConfirmation: false
71
+ riskLevel: medium
72
+ requiresConfirmation: true
69
73
  idempotent: false
70
74
  sideEffects:
71
75
  - file_write
76
+ sideEffectNote: Creates config file and design/ directory structure. With --force, overwrites existing files.
72
77
  ```
73
78
 
74
79
  ---
@@ -120,6 +125,7 @@ x-agent:
120
125
  idempotent: true
121
126
  sideEffects:
122
127
  - file_write
128
+ sideEffectNote: When --watch is used, the process runs indefinitely and is unsuitable for non-interactive agent invocation. Always writes generated files to docs/ and specs/.
123
129
  ```
124
130
 
125
131
  ---
@@ -156,11 +162,11 @@ speckeeper lint --phase HLD --fix
156
162
 
157
163
  **Exit 0:** No lint issues found (or all issues auto-fixed).
158
164
 
159
- - **stdout:** format=`text`
165
+ - **stdout:** format=`{options.format}`
160
166
 
161
167
  **Exit 1:** Lint issues found (errors or warnings with --strict).
162
168
 
163
- - **stderr:** format=`text`
169
+ - **stdout:** format=`{options.format}`
164
170
 
165
171
  #### Extensions
166
172
 
@@ -170,7 +176,9 @@ x-agent:
170
176
  requiresConfirmation: false
171
177
  idempotent: true
172
178
  sideEffects:
173
-
179
+ - file_write
180
+ sideEffectNote: file_write applies only when --fix is provided. Without --fix the command is read-only.
181
+ safeDryRunOption: Omit --fix to run in read-only mode.
174
182
  ```
175
183
 
176
184
  ---
@@ -206,21 +214,22 @@ speckeeper drift --update --format diff
206
214
 
207
215
  **Exit 0:** No drift detected (or drift auto-updated with --update).
208
216
 
209
- - **stdout:** format=`text`
217
+ - **stdout:** format=`{options.format}`
210
218
 
211
219
  **Exit 1:** Drift detected (with --fail-on-drift), or update failed.
212
220
 
213
- - **stderr:** format=`text`
221
+ - **stdout:** format=`{options.format}`
214
222
 
215
223
  #### Extensions
216
224
 
217
225
  ```yaml
218
226
  x-agent:
219
- riskLevel: low
220
- requiresConfirmation: false
227
+ riskLevel: medium
228
+ requiresConfirmation: true
221
229
  idempotent: true
222
230
  sideEffects:
223
-
231
+ - file_write
232
+ sideEffectNote: file_write applies only when --update is provided. Without --update the command is read-only.
224
233
  safeDryRunOption: Omit --update to run in read-only mode.
225
234
  ```
226
235
 
@@ -261,16 +270,17 @@ speckeeper check openapi --strict
261
270
  | `--strict` | | No | `false` | Treat warnings as errors. |
262
271
  | `--verbose` | -v | No | `false` | Show detailed output (e.g. list unmatched specs). |
263
272
  | `--coverage` | | No | `false` | Check if all testable acceptance criteria are covered by TestRefs. |
273
+ | `--format` | -f | No | `"text"` | Output format: text, json, github. |
264
274
 
265
275
  #### Exit Codes
266
276
 
267
277
  **Exit 0:** All checks passed (all specs found in sources, deep validation passed).
268
278
 
269
- - **stdout:** format=`text`
279
+ - **stdout:** format=`{options.format}`
270
280
 
271
281
  **Exit 1:** Check failures found (missing specs, structural mismatches, or coverage gaps).
272
282
 
273
- - **stderr:** format=`text`
283
+ - **stdout:** format=`{options.format}`
274
284
 
275
285
  #### Extensions
276
286
 
@@ -317,10 +327,11 @@ speckeeper new usecase --template custom-template.ts
317
327
  | `--name` | -n | No | | Name of the element. |
318
328
  | `--output` | -o | No | | Output directory path. |
319
329
  | `--template` | -t | No | | Path to template file. |
330
+ | `--dry-run` | | No | `false` | Preview generated file content and ID without writing to disk. |
320
331
 
321
332
  #### Exit Codes
322
333
 
323
- **Exit 0:** Element file created with auto-generated ID.
334
+ **Exit 0:** Element file created (or previewed with --dry-run) with auto-generated ID.
324
335
 
325
336
  - **stdout:** format=`text`
326
337
 
@@ -337,6 +348,8 @@ x-agent:
337
348
  idempotent: false
338
349
  sideEffects:
339
350
  - file_write
351
+ sideEffectNote: Creates a new TypeScript spec file with auto-generated ID. With --dry-run, only previews the generated content without writing.
352
+ safeDryRunOption: --dry-run
340
353
  ```
341
354
 
342
355
  ---
@@ -370,7 +383,7 @@ speckeeper impact COMP-AUTH --format mermaid
370
383
  | Option | Aliases | Required | Default | Description |
371
384
  |---|---|---|---|---|
372
385
  | `--config` | -c | No | | Path to config file. |
373
- | `--depth` | -d | No | `"3"` | Analysis depth (reference tracking level). |
386
+ | `--depth` | -d | No | `3` | Analysis depth (reference tracking level). |
374
387
  | `--direction` | | No | `"both"` | Analysis direction: upstream, downstream, both. |
375
388
  | `--format` | -f | No | `"text"` | Output format: text, json, mermaid. |
376
389
 
@@ -378,7 +391,7 @@ speckeeper impact COMP-AUTH --format mermaid
378
391
 
379
392
  **Exit 0:** Impact analysis completed and displayed.
380
393
 
381
- - **stdout:** format=`text`
394
+ - **stdout:** format=`{options.format}`
382
395
 
383
396
  **Exit 1:** Analysis failed (ID not found or config error).
384
397
 
@@ -421,7 +434,7 @@ speckeeper scaffold --source arch.md --dry-run
421
434
  |---|---|---|---|---|
422
435
  | `--source` | -s | Yes | | Path to Markdown file containing Mermaid flowchart. |
423
436
  | `--output` | -o | No | `"design/"` | Output directory. |
424
- | `--force` | -f | No | `false` | Overwrite existing files. |
437
+ | `--force` | -F | No | `false` | Overwrite existing files. |
425
438
  | `--dry-run` | | No | `false` | Preview generated files without writing. |
426
439
 
427
440
  #### Exit Codes
@@ -438,12 +451,324 @@ speckeeper scaffold --source arch.md --dry-run
438
451
 
439
452
  ```yaml
440
453
  x-agent:
441
- riskLevel: low
442
- requiresConfirmation: false
454
+ riskLevel: high
455
+ requiresConfirmation: true
443
456
  idempotent: false
444
457
  sideEffects:
445
458
  - file_write
459
+ sideEffectNote: --force overwrites existing TypeScript model source files.
460
+ safeDryRunOption: --dry-run
461
+ ```
462
+
463
+ ---
464
+
465
+ ### audit-requirements
466
+
467
+ Run LLM-based requirement quality audit.
468
+
469
+ Performs semantic analysis of design specs using LLM to identify quality issues that static lint cannot detect. Evaluates verifiability, ambiguity, granularity, terminology consistency, and design-mixing. Requires agent-contracts-runtime as an optional peer dependency.
470
+
471
+ **Usage:**
472
+
473
+ ```
474
+ speckeeper audit-requirements
475
+ ```
476
+ ```
477
+ speckeeper audit-requirements --adapter gemini --dry-run
478
+ ```
479
+ ```
480
+ speckeeper audit-requirements --report-format json --output audit.json
481
+ ```
482
+
483
+ #### Options
484
+
485
+ | Option | Aliases | Required | Default | Description |
486
+ |---|---|---|---|---|
487
+ | `--config` | -c | No | | Path to config file. |
488
+ | `--adapter` | -a | No | | SDK adapter to use for LLM execution. |
489
+ | `--model` | | No | | LLM model override. |
490
+ | `--dry-run` | -n | No | `false` | Output the constructed prompt without calling LLM. |
491
+ | `--show-prompt` | | No | `false` | Display the constructed LLM prompt on stderr. |
492
+ | `--fail-on` | | No | `"error"` | Minimum severity that causes a non-zero exit. |
493
+ | `--output` | -o | No | | Write result to a file instead of stdout. |
494
+ | `--report-format` | | No | `"json"` | Output format for the audit report. |
495
+
496
+ #### Exit Codes
497
+
498
+ **Exit 0:** Audit completed, no blocking findings.
499
+
500
+ - **stdout:** format=`{options.report-format}`
501
+
502
+ **Exit 1:** Unexpected error.
503
+
504
+ - **stderr:** format=`text`
505
+
506
+ **Exit 2:** Configuration or input error.
507
+
508
+ - **stderr:** format=`text`
509
+
510
+ **Exit 10:** Completed with blocking findings.
511
+
512
+ - **stdout:** format=`{options.report-format}`
513
+
514
+ **Exit 11:** Runtime dependency missing (agent-contracts-runtime).
515
+
516
+ - **stderr:** format=`text`
517
+
518
+ **Exit 12:** LLM provider or adapter error.
519
+
520
+ - **stderr:** format=`text`
521
+
522
+ #### Extensions
523
+
524
+ ```yaml
525
+ x-agent:
526
+ riskLevel: medium
527
+ requiresConfirmation: false
528
+ idempotent: true
529
+ sideEffects:
530
+ - network
531
+ - file_write
532
+ sideEffectNote: Network calls to LLM provider when adapter is not mock. Filesystem write when --output is specified. Exit 10 = valid output with blocking findings (stdout contains result). Exit 11 = missing runtime dependency (non-retryable).
533
+ safeDryRunOption: --dry-run
534
+ expectedDurationMs: 120000
535
+ retryableExitCodes:
536
+ - 12
537
+ ```
538
+
539
+ ---
540
+
541
+ ### propose-trace-links
542
+
543
+ LLM-based traceability link proposal.
544
+
545
+ Analyzes spec definitions and external source scan results to propose candidate traceability links between specs and implementation artifacts. Each link includes a confidence score and rationale.
546
+
547
+ **Usage:**
548
+
549
+ ```
550
+ speckeeper propose-trace-links
551
+ ```
552
+ ```
553
+ speckeeper propose-trace-links --adapter claude --report-format json
554
+ ```
555
+ ```
556
+ speckeeper propose-trace-links --dry-run
557
+ ```
558
+
559
+ #### Options
560
+
561
+ | Option | Aliases | Required | Default | Description |
562
+ |---|---|---|---|---|
563
+ | `--config` | -c | No | | Path to config file. |
564
+ | `--adapter` | -a | No | | SDK adapter to use for LLM execution. |
565
+ | `--model` | | No | | LLM model override. |
566
+ | `--dry-run` | -n | No | `false` | Output the constructed prompt without calling LLM. |
567
+ | `--show-prompt` | | No | `false` | Display the constructed LLM prompt on stderr. |
568
+ | `--fail-on` | | No | `"error"` | Minimum severity that causes a non-zero exit. |
569
+ | `--output` | -o | No | | Write result to a file instead of stdout. |
570
+ | `--report-format` | | No | `"json"` | Output format for the report. |
571
+
572
+ #### Exit Codes
573
+
574
+ **Exit 0:** Proposal completed, no blocking findings.
575
+
576
+ - **stdout:** format=`{options.report-format}`
577
+
578
+ **Exit 1:** Unexpected error.
579
+
580
+ - **stderr:** format=`text`
581
+
582
+ **Exit 2:** Configuration or input error.
583
+
584
+ - **stderr:** format=`text`
585
+
586
+ **Exit 10:** Completed with blocking findings.
587
+
588
+ - **stdout:** format=`{options.report-format}`
589
+
590
+ **Exit 11:** Runtime dependency missing (agent-contracts-runtime).
591
+
592
+ - **stderr:** format=`text`
593
+
594
+ **Exit 12:** LLM provider or adapter error.
595
+
596
+ - **stderr:** format=`text`
597
+
598
+ #### Extensions
599
+
600
+ ```yaml
601
+ x-agent:
602
+ riskLevel: medium
603
+ requiresConfirmation: false
604
+ idempotent: true
605
+ sideEffects:
606
+ - network
607
+ - file_write
608
+ sideEffectNote: Network calls to LLM provider when adapter is not mock. Filesystem write when --output is specified. Exit 10 = valid output with blocking findings (stdout contains result). Exit 11 = missing runtime dependency (non-retryable).
609
+ safeDryRunOption: --dry-run
610
+ expectedDurationMs: 120000
611
+ retryableExitCodes:
612
+ - 12
613
+ ```
614
+
615
+ ---
616
+
617
+ ### explain-impact
618
+
619
+ LLM-based explanation of impact analysis output.
620
+
621
+ Reads JSON output from speckeeper impact on stdin and generates a human-readable explanation suitable for PM/executive audiences. Includes affected artifact categorization, test considerations, and release risk assessment.
622
+
623
+ **Usage:**
624
+
625
+ ```
626
+ speckeeper impact FR-001 --format json | speckeeper explain-impact
627
+ ```
628
+ ```
629
+ speckeeper impact ENT-ORDER --format json | speckeeper explain-impact --adapter claude
630
+ ```
631
+
632
+ #### Options
633
+
634
+ | Option | Aliases | Required | Default | Description |
635
+ |---|---|---|---|---|
636
+ | `--config` | -c | No | | Path to config file. |
637
+ | `--adapter` | -a | No | | SDK adapter to use for LLM execution. |
638
+ | `--model` | | No | | LLM model override. |
639
+ | `--dry-run` | -n | No | `false` | Output the constructed prompt without calling LLM. |
640
+ | `--show-prompt` | | No | `false` | Display the constructed LLM prompt on stderr. |
641
+ | `--fail-on` | | No | `"error"` | Minimum severity that causes a non-zero exit. |
642
+ | `--output` | -o | No | | Write result to a file instead of stdout. |
643
+ | `--report-format` | | No | `"json"` | Output format for the report. |
644
+
645
+ #### Exit Codes
646
+
647
+ **Exit 0:** Explanation completed successfully.
648
+
649
+ - **stdout:** format=`{options.report-format}`
650
+
651
+ **Exit 1:** Unexpected error.
652
+
653
+ - **stderr:** format=`text`
654
+
655
+ **Exit 2:** Configuration or input error.
656
+
657
+ - **stderr:** format=`text`
658
+
659
+ **Exit 3:** No input on stdin.
660
+
661
+ - **stderr:** format=`text`
662
+
663
+ **Exit 10:** Completed with blocking findings.
664
+
665
+ - **stdout:** format=`{options.report-format}`
666
+
667
+ **Exit 11:** Runtime dependency missing (agent-contracts-runtime).
668
+
669
+ - **stderr:** format=`text`
670
+
671
+ **Exit 12:** LLM provider or adapter error.
672
+
673
+ - **stderr:** format=`text`
674
+
675
+ #### Extensions
676
+
677
+ ```yaml
678
+ x-agent:
679
+ riskLevel: medium
680
+ requiresConfirmation: false
681
+ idempotent: true
682
+ sideEffects:
683
+ - network
684
+ - file_write
685
+ sideEffectNote: Network calls to LLM provider when adapter is not mock. Filesystem write when --output is specified. Exit 10 = valid output with blocking findings (stdout contains result). Exit 11 = missing runtime dependency (non-retryable).
686
+ safeDryRunOption: --dry-run
687
+ expectedDurationMs: 120000
688
+ retryableExitCodes:
689
+ - 12
690
+ ```
691
+
692
+ ---
693
+
694
+ ### propose-acceptance-criteria
695
+
696
+ LLM-based acceptance criteria proposal.
697
+
698
+ Analyzes design specs and proposes testable acceptance criteria for each target spec. Optionally takes spec IDs as arguments to scope the proposal. Criteria are proposed in Given/When/Then or verification format.
699
+
700
+ **Usage:**
701
+
702
+ ```
703
+ speckeeper propose-acceptance-criteria
704
+ ```
705
+ ```
706
+ speckeeper propose-acceptance-criteria FR-001 FR-002
707
+ ```
708
+ ```
709
+ speckeeper propose-acceptance-criteria --adapter gemini --dry-run
710
+ ```
711
+
712
+ #### Arguments
713
+
714
+ | Name | Required | Description |
715
+ |---|---|---|
716
+ | `specIds` *(variadic)* | No | Spec IDs to propose criteria for. Defaults to all specs if omitted. |
717
+
718
+ #### Options
719
+
720
+ | Option | Aliases | Required | Default | Description |
721
+ |---|---|---|---|---|
722
+ | `--config` | -c | No | | Path to config file. |
723
+ | `--adapter` | -a | No | | SDK adapter to use for LLM execution. |
724
+ | `--model` | | No | | LLM model override. |
725
+ | `--dry-run` | -n | No | `false` | Output the constructed prompt without calling LLM. |
726
+ | `--show-prompt` | | No | `false` | Display the constructed LLM prompt on stderr. |
727
+ | `--fail-on` | | No | `"error"` | Minimum severity that causes a non-zero exit. |
728
+ | `--output` | -o | No | | Write result to a file instead of stdout. |
729
+ | `--report-format` | | No | `"json"` | Output format for the report. |
730
+
731
+ #### Exit Codes
732
+
733
+ **Exit 0:** Proposal completed, no blocking findings.
734
+
735
+ - **stdout:** format=`{options.report-format}`
736
+
737
+ **Exit 1:** Unexpected error.
738
+
739
+ - **stderr:** format=`text`
740
+
741
+ **Exit 2:** Configuration or input error.
742
+
743
+ - **stderr:** format=`text`
744
+
745
+ **Exit 10:** Completed with blocking findings.
746
+
747
+ - **stdout:** format=`{options.report-format}`
748
+
749
+ **Exit 11:** Runtime dependency missing (agent-contracts-runtime).
750
+
751
+ - **stderr:** format=`text`
752
+
753
+ **Exit 12:** LLM provider or adapter error.
754
+
755
+ - **stderr:** format=`text`
756
+
757
+ #### Extensions
758
+
759
+ ```yaml
760
+ x-agent:
761
+ riskLevel: medium
762
+ requiresConfirmation: false
763
+ idempotent: true
764
+ sideEffects:
765
+ - network
766
+ - file_write
767
+ sideEffectNote: Network calls to LLM provider when adapter is not mock. Filesystem write when --output is specified. Exit 10 = valid output with blocking findings (stdout contains result). Exit 11 = missing runtime dependency (non-retryable).
446
768
  safeDryRunOption: --dry-run
769
+ expectedDurationMs: 120000
770
+ retryableExitCodes:
771
+ - 12
447
772
  ```
448
773
 
449
774
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speckeeper",
3
- "version": "0.9.4",
3
+ "version": "0.10.0",
4
4
  "description": "TypeScript-first specification validation framework with external SSOT integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -40,6 +40,7 @@
40
40
  "prepublishOnly": "npm run build",
41
41
  "docs": "embedoc build",
42
42
  "docs:watch": "embedoc watch",
43
+ "dsl:generate": "npx agent-runtime generate --config dsl/agent-runtime.config.yaml",
43
44
  "contract:validate": "npx cli-contracts validate",
44
45
  "contract:generate": "npx cli-contracts generate",
45
46
  "ci": "npm run ci:validate && npm run ci:generate && npm run ci:verify",
@@ -70,6 +71,14 @@
70
71
  "yaml": "^2.3.4",
71
72
  "zod": "^3.22.4"
72
73
  },
74
+ "peerDependencies": {
75
+ "agent-contracts-runtime": ">=0.13.0"
76
+ },
77
+ "peerDependenciesMeta": {
78
+ "agent-contracts-runtime": {
79
+ "optional": true
80
+ }
81
+ },
73
82
  "devDependencies": {
74
83
  "@eslint/js": "^9.39.2",
75
84
  "@types/node": "^20.11.0",
@@ -77,7 +86,9 @@
77
86
  "@typescript-eslint/eslint-plugin": "^8.54.0",
78
87
  "@typescript-eslint/parser": "^8.54.0",
79
88
  "@vitest/coverage-v8": "^1.6.1",
80
- "cli-contracts": "^0.2.0",
89
+ "agent-contracts": "^0.21.0",
90
+ "agent-contracts-runtime": "^0.13.0",
91
+ "cli-contracts": "^0.6.1",
81
92
  "eslint": "^9.39.2",
82
93
  "tsup": "^8.0.1",
83
94
  "typescript": "^5.3.3",