specfact-cli 0.9.1__tar.gz → 0.11.2__tar.gz

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 (155) hide show
  1. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/PKG-INFO +18 -8
  2. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/README.md +5 -4
  3. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/pyproject.toml +38 -5
  4. specfact_cli-0.11.2/resources/prompts/shared/cli-enforcement.md +31 -0
  5. specfact_cli-0.11.2/resources/prompts/specfact.01-import.md +61 -0
  6. specfact_cli-0.11.2/resources/prompts/specfact.02-plan.md +151 -0
  7. specfact_cli-0.11.2/resources/prompts/specfact.03-review.md +152 -0
  8. specfact_cli-0.11.2/resources/prompts/specfact.04-sdd.md +132 -0
  9. specfact_cli-0.11.2/resources/prompts/specfact.05-enforce.md +140 -0
  10. specfact_cli-0.11.2/resources/prompts/specfact.06-sync.md +136 -0
  11. specfact_cli-0.11.2/resources/prompts/specfact.compare.md +132 -0
  12. specfact_cli-0.11.2/resources/prompts/specfact.validate.md +128 -0
  13. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/__init__.py +1 -1
  14. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/__init__.py +1 -1
  15. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/code_analyzer.py +151 -39
  16. specfact_cli-0.11.2/src/specfact_cli/analyzers/graph_analyzer.py +387 -0
  17. specfact_cli-0.11.2/src/specfact_cli/analyzers/relationship_mapper.py +427 -0
  18. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/test_pattern_extractor.py +37 -5
  19. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/cli.py +156 -32
  20. specfact_cli-0.11.2/src/specfact_cli/commands/__init__.py +22 -0
  21. specfact_cli-0.11.2/src/specfact_cli/commands/analyze.py +315 -0
  22. specfact_cli-0.9.1/src/specfact_cli/commands/constitution.py → specfact_cli-0.11.2/src/specfact_cli/commands/bridge.py +51 -37
  23. specfact_cli-0.11.2/src/specfact_cli/commands/drift.py +220 -0
  24. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/commands/enforce.py +175 -42
  25. specfact_cli-0.11.2/src/specfact_cli/commands/generate.py +515 -0
  26. specfact_cli-0.11.2/src/specfact_cli/commands/implement.py +409 -0
  27. specfact_cli-0.11.2/src/specfact_cli/commands/import_cmd.py +1407 -0
  28. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/commands/init.py +9 -6
  29. specfact_cli-0.11.2/src/specfact_cli/commands/migrate.py +406 -0
  30. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/commands/plan.py +591 -289
  31. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/commands/repro.py +13 -9
  32. specfact_cli-0.11.2/src/specfact_cli/commands/run.py +469 -0
  33. specfact_cli-0.11.2/src/specfact_cli/commands/sdd.py +129 -0
  34. specfact_cli-0.11.2/src/specfact_cli/commands/spec.py +402 -0
  35. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/commands/sync.py +296 -15
  36. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/generators/contract_generator.py +11 -3
  37. specfact_cli-0.11.2/src/specfact_cli/generators/openapi_extractor.py +877 -0
  38. specfact_cli-0.11.2/src/specfact_cli/generators/task_generator.py +399 -0
  39. specfact_cli-0.11.2/src/specfact_cli/generators/test_to_openapi.py +387 -0
  40. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/importers/speckit_converter.py +3 -0
  41. specfact_cli-0.11.2/src/specfact_cli/integrations/__init__.py +7 -0
  42. specfact_cli-0.11.2/src/specfact_cli/integrations/specmatic.py +385 -0
  43. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/__init__.py +2 -0
  44. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/plan.py +15 -0
  45. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/project.py +190 -61
  46. specfact_cli-0.11.2/src/specfact_cli/models/quality.py +31 -0
  47. specfact_cli-0.11.2/src/specfact_cli/models/source_tracking.py +96 -0
  48. specfact_cli-0.11.2/src/specfact_cli/models/task.py +121 -0
  49. specfact_cli-0.11.2/src/specfact_cli/sync/change_detector.py +195 -0
  50. specfact_cli-0.11.2/src/specfact_cli/sync/code_to_spec.py +75 -0
  51. specfact_cli-0.11.2/src/specfact_cli/sync/drift_detector.py +157 -0
  52. specfact_cli-0.11.2/src/specfact_cli/sync/spec_to_code.py +258 -0
  53. specfact_cli-0.11.2/src/specfact_cli/sync/spec_to_tests.py +103 -0
  54. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/bundle_loader.py +76 -21
  55. specfact_cli-0.11.2/src/specfact_cli/utils/enrichment_context.py +155 -0
  56. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/enrichment_parser.py +3 -0
  57. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/ide_setup.py +67 -30
  58. specfact_cli-0.11.2/src/specfact_cli/utils/incremental_check.py +334 -0
  59. specfact_cli-0.11.2/src/specfact_cli/utils/optional_deps.py +173 -0
  60. specfact_cli-0.11.2/src/specfact_cli/utils/sdd_discovery.py +185 -0
  61. specfact_cli-0.11.2/src/specfact_cli/utils/source_scanner.py +282 -0
  62. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/structure.py +41 -0
  63. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/structured_io.py +31 -4
  64. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/yaml_utils.py +5 -0
  65. specfact_cli-0.9.1/resources/prompts/specfact-enforce.md +0 -196
  66. specfact_cli-0.9.1/resources/prompts/specfact-import-from-code.md +0 -620
  67. specfact_cli-0.9.1/resources/prompts/specfact-plan-add-feature.md +0 -191
  68. specfact_cli-0.9.1/resources/prompts/specfact-plan-add-story.md +0 -215
  69. specfact_cli-0.9.1/resources/prompts/specfact-plan-compare.md +0 -602
  70. specfact_cli-0.9.1/resources/prompts/specfact-plan-init.md +0 -549
  71. specfact_cli-0.9.1/resources/prompts/specfact-plan-promote.md +0 -373
  72. specfact_cli-0.9.1/resources/prompts/specfact-plan-review.md +0 -1357
  73. specfact_cli-0.9.1/resources/prompts/specfact-plan-select.md +0 -488
  74. specfact_cli-0.9.1/resources/prompts/specfact-plan-update-feature.md +0 -286
  75. specfact_cli-0.9.1/resources/prompts/specfact-plan-update-idea.md +0 -214
  76. specfact_cli-0.9.1/resources/prompts/specfact-repro.md +0 -271
  77. specfact_cli-0.9.1/resources/prompts/specfact-sync.md +0 -502
  78. specfact_cli-0.9.1/src/specfact_cli/commands/__init__.py +0 -7
  79. specfact_cli-0.9.1/src/specfact_cli/commands/generate.py +0 -231
  80. specfact_cli-0.9.1/src/specfact_cli/commands/import_cmd.py +0 -807
  81. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/.gitignore +0 -0
  82. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/LICENSE.md +0 -0
  83. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/mappings/node-async.yaml +0 -0
  84. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/mappings/python-async.yaml +0 -0
  85. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/mappings/speckit-default.yaml +0 -0
  86. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/schemas/deviation.schema.json +0 -0
  87. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/schemas/plan.schema.json +0 -0
  88. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/schemas/protocol.schema.json +0 -0
  89. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/templates/github-action.yml.j2 +0 -0
  90. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/templates/plan.bundle.yaml.j2 +0 -0
  91. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/templates/pr-template.md.j2 +0 -0
  92. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/templates/protocol.yaml.j2 +0 -0
  93. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/resources/templates/telemetry.yaml.example +0 -0
  94. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/agents/__init__.py +0 -0
  95. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/agents/analyze_agent.py +0 -0
  96. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/agents/base.py +0 -0
  97. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/agents/plan_agent.py +0 -0
  98. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/agents/registry.py +0 -0
  99. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/agents/sync_agent.py +0 -0
  100. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/__init__.py +0 -0
  101. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/ambiguity_scanner.py +0 -0
  102. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/constitution_evidence_extractor.py +0 -0
  103. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/contract_extractor.py +0 -0
  104. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/control_flow_analyzer.py +0 -0
  105. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/analyzers/requirement_extractor.py +0 -0
  106. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/common/__init__.py +0 -0
  107. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/common/logger_setup.py +0 -0
  108. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/common/logging_utils.py +0 -0
  109. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/common/text_utils.py +0 -0
  110. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/common/utils.py +0 -0
  111. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/comparators/__init__.py +0 -0
  112. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/comparators/plan_comparator.py +0 -0
  113. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/enrichers/constitution_enricher.py +0 -0
  114. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/enrichers/plan_enricher.py +0 -0
  115. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/generators/__init__.py +0 -0
  116. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/generators/plan_generator.py +0 -0
  117. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/generators/protocol_generator.py +0 -0
  118. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/generators/report_generator.py +0 -0
  119. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/generators/workflow_generator.py +0 -0
  120. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/importers/__init__.py +0 -0
  121. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/importers/speckit_scanner.py +0 -0
  122. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/migrations/__init__.py +0 -0
  123. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/migrations/plan_migrator.py +0 -0
  124. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/bridge.py +0 -0
  125. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/deviation.py +0 -0
  126. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/enforcement.py +0 -0
  127. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/protocol.py +0 -0
  128. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/models/sdd.py +0 -0
  129. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/modes/__init__.py +0 -0
  130. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/modes/detector.py +0 -0
  131. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/modes/router.py +0 -0
  132. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/resources/semgrep/async.yml +0 -0
  133. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/runtime.py +0 -0
  134. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/__init__.py +0 -0
  135. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/bridge_probe.py +0 -0
  136. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/bridge_sync.py +0 -0
  137. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/bridge_watch.py +0 -0
  138. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/repository_sync.py +0 -0
  139. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/speckit_sync.py +0 -0
  140. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/sync/watcher.py +0 -0
  141. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/telemetry.py +0 -0
  142. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/templates/__init__.py +0 -0
  143. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/templates/bridge_templates.py +0 -0
  144. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/__init__.py +0 -0
  145. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/acceptance_criteria.py +0 -0
  146. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/console.py +0 -0
  147. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/feature_keys.py +0 -0
  148. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/git.py +0 -0
  149. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/github_annotations.py +0 -0
  150. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/utils/prompts.py +0 -0
  151. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/validators/__init__.py +0 -0
  152. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/validators/contract_validator.py +0 -0
  153. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/validators/fsm.py +0 -0
  154. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/validators/repro_checker.py +0 -0
  155. {specfact_cli-0.9.1 → specfact_cli-0.11.2}/src/specfact_cli/validators/schema.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: specfact-cli
3
- Version: 0.9.1
3
+ Version: 0.11.2
4
4
  Summary: Brownfield-first CLI: Reverse engineer legacy Python → specs → enforced contracts. Automate legacy code documentation and prevent modernization regressions.
5
5
  Project-URL: Homepage, https://github.com/nold-ai/specfact-cli
6
6
  Project-URL: Repository, https://github.com/nold-ai/specfact-cli.git
@@ -226,6 +226,7 @@ Requires-Python: >=3.11
226
226
  Requires-Dist: beartype>=0.22.4
227
227
  Requires-Dist: crosshair-tool>=0.0.97
228
228
  Requires-Dist: gitpython>=3.1.45
229
+ Requires-Dist: graphviz>=0.20.1
229
230
  Requires-Dist: hypothesis>=6.142.4
230
231
  Requires-Dist: icontract>=2.7.1
231
232
  Requires-Dist: jinja2>=3.1.6
@@ -236,7 +237,7 @@ Requires-Dist: opentelemetry-sdk>=1.27.0
236
237
  Requires-Dist: pydantic>=2.12.3
237
238
  Requires-Dist: python-dotenv>=1.2.1
238
239
  Requires-Dist: pyyaml>=6.0.3
239
- Requires-Dist: rich<14.0.0,>=13.0.0
240
+ Requires-Dist: rich<13.6.0,>=13.5.2
240
241
  Requires-Dist: ruamel-yaml>=0.18.16
241
242
  Requires-Dist: ruff>=0.14.2
242
243
  Requires-Dist: typer>=0.20.0
@@ -244,12 +245,15 @@ Requires-Dist: typing-extensions>=4.15.0
244
245
  Requires-Dist: watchdog>=6.0.0
245
246
  Provides-Extra: dev
246
247
  Requires-Dist: basedpyright>=1.32.1; extra == 'dev'
248
+ Requires-Dist: bearer>=3.1.0; extra == 'dev'
247
249
  Requires-Dist: beartype>=0.22.4; extra == 'dev'
248
250
  Requires-Dist: crosshair-tool>=0.0.97; extra == 'dev'
251
+ Requires-Dist: graphviz>=0.20.1; extra == 'dev'
249
252
  Requires-Dist: hypothesis>=6.142.4; extra == 'dev'
250
253
  Requires-Dist: icontract>=2.7.1; extra == 'dev'
251
254
  Requires-Dist: isort>=7.0.0; extra == 'dev'
252
255
  Requires-Dist: pip-tools>=7.5.1; extra == 'dev'
256
+ Requires-Dist: pyan3>=1.2.0; extra == 'dev'
253
257
  Requires-Dist: pylint>=4.0.2; extra == 'dev'
254
258
  Requires-Dist: pytest-asyncio>=1.2.0; extra == 'dev'
255
259
  Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
@@ -257,11 +261,16 @@ Requires-Dist: pytest-mock>=3.15.1; extra == 'dev'
257
261
  Requires-Dist: pytest-xdist>=3.8.0; extra == 'dev'
258
262
  Requires-Dist: pytest>=8.4.2; extra == 'dev'
259
263
  Requires-Dist: ruff>=0.14.2; extra == 'dev'
260
- Requires-Dist: semgrep>=1.141.1; extra == 'dev'
264
+ Requires-Dist: semgrep>=1.144.0; extra == 'dev'
261
265
  Requires-Dist: tomlkit>=0.13.3; extra == 'dev'
262
266
  Requires-Dist: types-pyyaml>=6.0.12.20250516; extra == 'dev'
267
+ Provides-Extra: enhanced-analysis
268
+ Requires-Dist: bearer>=3.1.0; extra == 'enhanced-analysis'
269
+ Requires-Dist: graphviz>=0.20.1; extra == 'enhanced-analysis'
270
+ Requires-Dist: pyan3>=1.2.0; extra == 'enhanced-analysis'
271
+ Requires-Dist: syft>=0.9.5; extra == 'enhanced-analysis'
263
272
  Provides-Extra: scanning
264
- Requires-Dist: semgrep>=1.141.1; extra == 'scanning'
273
+ Requires-Dist: semgrep>=1.144.0; extra == 'scanning'
265
274
  Description-Content-Type: text/markdown
266
275
 
267
276
  # SpecFact CLI
@@ -316,6 +325,7 @@ A brownfield-first CLI that **reverse engineers your legacy code** into document
316
325
  - ✅ **Reverse engineer legacy code** → Extract specs automatically from existing code
317
326
  - ✅ **Runtime contract enforcement** → Prevent regressions during modernization
318
327
  - ✅ **Symbolic execution** → Discover hidden edge cases with CrossHair
328
+ - ✅ **API contract testing** → Validate OpenAPI/AsyncAPI specs with Specmatic integration
319
329
  - ✅ **Works offline** → No cloud required, fully local
320
330
  - ✅ **CLI integrations** → Works seamlessly with VS Code, Cursor, GitHub Actions, and any agentic workflow
321
331
 
@@ -343,7 +353,7 @@ SpecFact CLI works with your existing tools—no new platform to learn. See real
343
353
 
344
354
  ```bash
345
355
  # Zero-install (just run it)
346
- uvx specfact-cli@latest --help
356
+ uvx specfact-cli@latest
347
357
 
348
358
  # Or install with pip
349
359
  pip install specfact-cli
@@ -353,13 +363,13 @@ pip install specfact-cli
353
363
 
354
364
  ```bash
355
365
  # Modernizing legacy code? (Recommended)
356
- specfact import from-code my-project --repo .
366
+ specfact import from-code legacy-api --repo .
357
367
 
358
368
  # Starting a new project?
359
- specfact plan init my-project --interactive
369
+ specfact plan init legacy-api --interactive
360
370
 
361
371
  # Using GitHub Spec-Kit or other tools?
362
- specfact import from-bridge --repo ./my-project --adapter speckit --write
372
+ specfact import from-bridge --repo . --adapter speckit --write
363
373
  ```
364
374
 
365
375
  That's it! 🎉
@@ -50,6 +50,7 @@ A brownfield-first CLI that **reverse engineers your legacy code** into document
50
50
  - ✅ **Reverse engineer legacy code** → Extract specs automatically from existing code
51
51
  - ✅ **Runtime contract enforcement** → Prevent regressions during modernization
52
52
  - ✅ **Symbolic execution** → Discover hidden edge cases with CrossHair
53
+ - ✅ **API contract testing** → Validate OpenAPI/AsyncAPI specs with Specmatic integration
53
54
  - ✅ **Works offline** → No cloud required, fully local
54
55
  - ✅ **CLI integrations** → Works seamlessly with VS Code, Cursor, GitHub Actions, and any agentic workflow
55
56
 
@@ -77,7 +78,7 @@ SpecFact CLI works with your existing tools—no new platform to learn. See real
77
78
 
78
79
  ```bash
79
80
  # Zero-install (just run it)
80
- uvx specfact-cli@latest --help
81
+ uvx specfact-cli@latest
81
82
 
82
83
  # Or install with pip
83
84
  pip install specfact-cli
@@ -87,13 +88,13 @@ pip install specfact-cli
87
88
 
88
89
  ```bash
89
90
  # Modernizing legacy code? (Recommended)
90
- specfact import from-code my-project --repo .
91
+ specfact import from-code legacy-api --repo .
91
92
 
92
93
  # Starting a new project?
93
- specfact plan init my-project --interactive
94
+ specfact plan init legacy-api --interactive
94
95
 
95
96
  # Using GitHub Spec-Kit or other tools?
96
- specfact import from-bridge --repo ./my-project --adapter speckit --write
97
+ specfact import from-bridge --repo . --adapter speckit --write
97
98
  ```
98
99
 
99
100
  That's it! 🎉
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "specfact-cli"
7
- version = "0.9.1"
7
+ version = "0.11.2"
8
8
  description = "Brownfield-first CLI: Reverse engineer legacy Python → specs → enforced contracts. Automate legacy code documentation and prevent modernization regressions."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -34,13 +34,14 @@ dependencies = [
34
34
 
35
35
  # CLI framework
36
36
  "typer>=0.20.0",
37
- "rich>=13.0.0,<14.0.0",
37
+ "rich>=13.5.2,<13.6.0", # Compatible with semgrep (requires rich~=13.5.2)
38
38
 
39
39
  # Template engine
40
40
  "jinja2>=3.1.6",
41
41
 
42
42
  # Graph analysis
43
43
  "networkx>=3.4.2",
44
+ "graphviz>=0.20.1", # Graph visualization (requires system Graphviz: apt-get install graphviz)
44
45
 
45
46
  # Git operations
46
47
  "gitpython>=3.1.45",
@@ -82,19 +83,39 @@ dev = [
82
83
  "tomlkit>=0.13.3", # Style-preserving TOML library (recommended successor to pytoml)
83
84
  "types-PyYAML>=6.0.12.20250516",
84
85
  "pip-tools>=7.5.1",
85
- "semgrep>=1.141.1",
86
+ "semgrep>=1.144.0", # Latest version compatible with rich~=13.5.2
86
87
 
87
88
  # Contract-First Development Dependencies (dev)
88
89
  "icontract>=2.7.1",
89
90
  "beartype>=0.22.4",
90
91
  "crosshair-tool>=0.0.97",
91
92
  "hypothesis>=6.142.4",
93
+
94
+ # Enhanced Analysis Tools (for local development)
95
+ # Note: syft excluded from dev/test due to rich version conflict with semgrep
96
+ # Install separately: pip install specfact-cli[enhanced-analysis] if needed
97
+ "graphviz>=0.20.1", # Graph visualization (requires system Graphviz: apt-get install graphviz)
98
+ "pyan3>=1.2.0", # Python call graph analysis
99
+ "bearer>=3.1.0", # Data flow analysis for security
92
100
  ]
93
101
 
94
102
  scanning = [
95
- "semgrep>=1.141.1", # Optional: Only needed for code scanning features
103
+ "semgrep>=1.144.0", # Optional: Only needed for code scanning features
104
+ ]
105
+
106
+ enhanced-analysis = [
107
+ "graphviz>=0.20.1", # Graph visualization (requires system Graphviz: apt-get install graphviz)
108
+ "pyan3>=1.2.0", # Python call graph analysis
109
+ "syft>=0.9.5", # Software Bill of Materials (SBOM) generation
110
+ "bearer>=3.1.0", # Data flow analysis for security
96
111
  ]
97
112
 
113
+ # Note: Specmatic integration (specfact spec commands) requires the Specmatic CLI tool
114
+ # to be installed separately. Specmatic is a Java-based CLI tool, not a Python package.
115
+ # Install from: https://docs.specmatic.io/
116
+ # The specfact spec commands will check for Specmatic availability and provide
117
+ # helpful error messages if it's not found.
118
+
98
119
  # Add other optional dependency groups from your original if they existed and are still needed (e.g., server, client, devtools, full from tpl)
99
120
 
100
121
  [project.urls]
@@ -127,12 +148,18 @@ dependencies = [
127
148
  "pylint>=4.0.2",
128
149
  "ruff>=0.14.2",
129
150
  "yamllint>=1.37.1",
130
- "semgrep>=1.141.1",
151
+ "semgrep>=1.144.0", # Latest version compatible with rich~=13.5.2
131
152
  # Contract-First Development Dependencies
132
153
  "icontract>=2.7.1",
133
154
  "beartype>=0.22.4",
134
155
  "crosshair-tool>=0.0.97",
135
156
  "hypothesis>=6.142.4",
157
+ # Enhanced Analysis Tools (for local development)
158
+ # Note: syft excluded from dev/test due to rich version conflict with semgrep
159
+ # Install separately: pip install specfact-cli[enhanced-analysis] if needed
160
+ "graphviz>=0.20.1", # Graph visualization (requires system Graphviz: apt-get install graphviz)
161
+ "pyan3>=1.2.0", # Python call graph analysis
162
+ "bearer>=3.1.0", # Data flow analysis for security
136
163
  ]
137
164
 
138
165
  [tool.hatch.envs.default.scripts]
@@ -227,6 +254,12 @@ dependencies = [
227
254
  "crosshair-tool>=0.0.97",
228
255
  "hypothesis>=6.142.4",
229
256
  "yamllint>=1.37.1",
257
+ # Enhanced Analysis Tools (for testing)
258
+ # Note: syft excluded from test due to rich version conflict with semgrep
259
+ # Install separately: pip install specfact-cli[enhanced-analysis] if needed
260
+ "graphviz>=0.20.1", # Graph visualization (requires system Graphviz: apt-get install graphviz)
261
+ "pyan3>=1.2.0", # Python call graph analysis
262
+ "bearer>=3.1.0", # Data flow analysis for security
230
263
  ]
231
264
  dev-mode = true
232
265
  parallel = true
@@ -0,0 +1,31 @@
1
+ # CLI Usage Enforcement Rules
2
+
3
+ ## Core Principle
4
+
5
+ **ALWAYS use SpecFact CLI commands. Never create artifacts directly.**
6
+
7
+ ## Rules
8
+
9
+ 1. **Execute CLI First**: Always run CLI commands before any analysis
10
+ 2. **Use CLI for Writes**: All write operations must go through CLI
11
+ 3. **Read for Display Only**: Use file reading tools for display/analysis only
12
+ 4. **Never Modify .specfact/**: Do not create/modify files in `.specfact/` directly
13
+ 5. **Never Bypass Validation**: CLI ensures schema compliance and metadata
14
+
15
+ ## What Happens If You Don't Follow
16
+
17
+ - ❌ Artifacts may not match CLI schema versions
18
+ - ❌ Missing metadata and telemetry
19
+ - ❌ Format inconsistencies
20
+ - ❌ Validation failures
21
+ - ❌ Works only in Copilot mode, fails in CI/CD
22
+
23
+ ## Available CLI Commands
24
+
25
+ - `specfact plan init <bundle-name>` - Initialize project bundle
26
+ - `specfact import from-code <bundle-name> --repo <path>` - Import from codebase
27
+ - `specfact plan review <bundle-name>` - Review plan
28
+ - `specfact plan harden <bundle-name>` - Create SDD manifest
29
+ - `specfact enforce sdd <bundle-name>` - Validate SDD
30
+ - `specfact sync bridge --adapter <adapter> --repo <path>` - Sync with external tools
31
+ - See [Command Reference](../../docs/reference/commands.md) for full list
@@ -0,0 +1,61 @@
1
+ ---
2
+ description: Import codebase → plan bundle. CLI extracts routes/schemas/relationships. LLM enriches with context.
3
+ ---
4
+
5
+ # SpecFact Import Command
6
+
7
+ ## User Input
8
+
9
+ ```text
10
+ $ARGUMENTS
11
+ ```
12
+
13
+ You **MUST** consider the user input before proceeding (if not empty).
14
+
15
+ ## Purpose
16
+
17
+ Import codebase → plan bundle. CLI extracts (routes, schemas, relationships, contracts). LLM enriches (context, "why", completeness).
18
+
19
+ ## Parameters
20
+
21
+ **Target/Input**: `--bundle NAME` (required), `--repo PATH`, `--entry-point PATH`, `--enrichment PATH`
22
+ **Output/Results**: `--report PATH`
23
+ **Behavior/Options**: `--shadow-only`, `--enrich-for-speckit`
24
+ **Advanced/Configuration**: `--confidence FLOAT` (0.0-1.0), `--key-format FORMAT` (classname|sequential)
25
+
26
+ ## Workflow
27
+
28
+ 1. **Execute CLI**: `specfact import from-code <bundle> --repo <path> [options]`
29
+
30
+ CLI extracts (no AI): routes (FastAPI/Flask/Django), schemas (Pydantic), relationships (imports/deps), contracts (OpenAPI scaffolds), source tracking, bundle metadata.
31
+
32
+ 2. **LLM Enrichment** (if `--enrichment` provided):
33
+ - **Context file**: Read `.specfact/projects/<bundle>/enrichment_context.md` for relationships, contracts, schemas
34
+ - Use CLI output + bundle metadata + enrichment context as context
35
+ - Enrich: business context, "why" reasoning, missing acceptance criteria
36
+ - Validate: contracts vs code, feature/story alignment
37
+ - Complete: constraints, test scenarios, edge cases
38
+
39
+ 3. **Present**: Bundle location, report path, summary (features/stories/contracts/relationships)
40
+
41
+ ## CLI Enforcement
42
+
43
+ **ALWAYS execute CLI first**. Never modify `.specfact/` directly. Use CLI output as grounding.
44
+
45
+ ## Expected Output
46
+
47
+ **Success**: Bundle location, report path, summary (features/stories/contracts/relationships)
48
+ **Error**: Missing bundle name or bundle already exists
49
+
50
+ ## Common Patterns
51
+
52
+ ```bash
53
+ /specfact.01-import --bundle legacy-api --repo .
54
+ /specfact.01-import --bundle legacy-api --repo . --enrichment report.md
55
+ /specfact.01-import --bundle auth-module --repo . --entry-point src/auth/
56
+ /specfact.01-import --bundle legacy-api --repo . --enrich-for-speckit
57
+ ```
58
+
59
+ ## Context
60
+
61
+ {ARGS}
@@ -0,0 +1,151 @@
1
+ ---
2
+ description: Manage project bundles - create, add features/stories, and update plan metadata.
3
+ ---
4
+
5
+ # SpecFact Plan Management Command
6
+
7
+ ## User Input
8
+
9
+ ```text
10
+ $ARGUMENTS
11
+ ```
12
+
13
+ You **MUST** consider the user input before proceeding (if not empty).
14
+
15
+ ## Purpose
16
+
17
+ Manage project bundles: initialize new bundles, add features and stories, and update plan metadata. This unified command replaces multiple granular commands for better LLM workflow integration.
18
+
19
+ **When to use:**
20
+
21
+ - Creating a new project bundle (greenfield)
22
+ - Adding features/stories to existing bundles
23
+ - Updating plan metadata (idea, features, stories)
24
+
25
+ **Quick Example:**
26
+
27
+ ```bash
28
+ /specfact.02-plan init legacy-api
29
+ /specfact.02-plan add-feature --bundle legacy-api --key FEATURE-001 --title "User Auth"
30
+ ```
31
+
32
+ ## Parameters
33
+
34
+ ### Target/Input
35
+
36
+ - `--bundle NAME` - Project bundle name (required for most operations)
37
+ - `--key KEY` - Feature/story key (e.g., FEATURE-001, STORY-001)
38
+ - `--feature KEY` - Parent feature key (for story operations)
39
+
40
+ ### Output/Results
41
+
42
+ - (No output-specific parameters for plan management)
43
+
44
+ ### Behavior/Options
45
+
46
+ - `--interactive/--no-interactive` - Interactive mode. Default: True (interactive)
47
+ - `--scaffold/--no-scaffold` - Create directory structure. Default: True (scaffold enabled)
48
+
49
+ ### Advanced/Configuration
50
+
51
+ - `--title TEXT` - Feature/story title
52
+ - `--outcomes TEXT` - Expected outcomes (comma-separated)
53
+ - `--acceptance TEXT` - Acceptance criteria (comma-separated)
54
+ - `--constraints TEXT` - Constraints (comma-separated)
55
+ - `--confidence FLOAT` - Confidence score (0.0-1.0)
56
+ - `--draft/--no-draft` - Mark as draft
57
+
58
+ ## Workflow
59
+
60
+ ### Step 1: Parse Arguments
61
+
62
+ - Determine operation: `init`, `add-feature`, `add-story`, `update-idea`, `update-feature`, `update-story`
63
+ - Extract required parameters (bundle name, keys, etc.)
64
+
65
+ ### Step 2: Execute CLI
66
+
67
+ ```bash
68
+ # Initialize bundle
69
+ specfact plan init <bundle-name> [--interactive/--no-interactive] [--scaffold/--no-scaffold]
70
+
71
+ # Add feature
72
+ specfact plan add-feature --bundle <name> --key <key> --title <title> [--outcomes <outcomes>] [--acceptance <acceptance>]
73
+
74
+ # Add story
75
+ specfact plan add-story --bundle <name> --feature <feature-key> --key <story-key> --title <title> [--acceptance <acceptance>]
76
+
77
+ # Update idea
78
+ specfact plan update-idea --bundle <name> [--title <title>] [--narrative <narrative>] [--target-users <users>] [--value-hypothesis <hypothesis>] [--constraints <constraints>]
79
+
80
+ # Update feature
81
+ specfact plan update-feature --bundle <name> --key <key> [--title <title>] [--outcomes <outcomes>] [--acceptance <acceptance>] [--constraints <constraints>] [--confidence <score>] [--draft/--no-draft]
82
+
83
+ # Update story
84
+ specfact plan update-story --bundle <name> --feature <feature-key> --key <story-key> [--title <title>] [--acceptance <acceptance>] [--story-points <points>] [--value-points <points>] [--confidence <score>] [--draft/--no-draft]
85
+ ```
86
+
87
+ ### Step 3: Present Results
88
+
89
+ - Display bundle location
90
+ - Show created/updated features/stories
91
+ - Present summary of changes
92
+
93
+ ## CLI Enforcement
94
+
95
+ **CRITICAL**: Always use SpecFact CLI commands. See [CLI Enforcement Rules](./shared/cli-enforcement.md) for details.
96
+
97
+ **Rules:**
98
+
99
+ 1. **ALWAYS execute CLI first**: Run appropriate `specfact plan` command before any analysis
100
+ 2. **ALWAYS use non-interactive mode for CI/CD**: Use `--no-interactive` flag in Copilot environments
101
+ 3. **NEVER modify .specfact folder directly**: All operations must go through CLI
102
+ 4. **NEVER create YAML/JSON directly**: All artifacts must be CLI-generated
103
+ 5. **Use CLI output as grounding**: Parse CLI output, don't regenerate it
104
+
105
+ ## Expected Output
106
+
107
+ ## Success (Init)
108
+
109
+ ```text
110
+ ✓ Project bundle created: .specfact/projects/legacy-api/
111
+ ✓ Bundle initialized with scaffold structure
112
+ ```
113
+
114
+ ## Success (Add Feature)
115
+
116
+ ```text
117
+ ✓ Feature 'FEATURE-001' added successfully
118
+ Feature: User Authentication
119
+ Outcomes: Secure login, Session management
120
+ ```
121
+
122
+ ## Error (Missing Bundle)
123
+
124
+ ```text
125
+ ✗ Project bundle name is required
126
+ Usage: specfact plan <operation> --bundle <name> [options]
127
+ ```
128
+
129
+ ## Common Patterns
130
+
131
+ ```bash
132
+ # Initialize new bundle
133
+ /specfact.02-plan init legacy-api
134
+ /specfact.02-plan init auth-module --no-interactive
135
+
136
+ # Add feature with full metadata
137
+ /specfact.02-plan add-feature --bundle legacy-api --key FEATURE-001 --title "User Auth" --outcomes "Secure login, Session management" --acceptance "Users can log in, Sessions persist"
138
+
139
+ # Add story to feature
140
+ /specfact.02-plan add-story --bundle legacy-api --feature FEATURE-001 --key STORY-001 --title "Login API" --acceptance "API returns JWT token" --story-points 5
141
+
142
+ # Update feature metadata
143
+ /specfact.02-plan update-feature --bundle legacy-api --key FEATURE-001 --title "Updated Title" --confidence 0.9
144
+
145
+ # Update idea section
146
+ /specfact.02-plan update-idea --bundle legacy-api --target-users "Developers, DevOps" --value-hypothesis "Reduce technical debt"
147
+ ```
148
+
149
+ ## Context
150
+
151
+ {ARGS}
@@ -0,0 +1,152 @@
1
+ ---
2
+ description: Review project bundle to identify ambiguities, resolve gaps, and prepare for promotion.
3
+ ---
4
+
5
+ # SpecFact Review Command
6
+
7
+ ## User Input
8
+
9
+ ```text
10
+ $ARGUMENTS
11
+ ```
12
+
13
+ You **MUST** consider the user input before proceeding (if not empty).
14
+
15
+ ## Purpose
16
+
17
+ Review project bundle to identify and resolve ambiguities, missing information, and unclear requirements. Asks targeted questions to make the bundle ready for promotion through development stages.
18
+
19
+ **When to use:**
20
+
21
+ - After creating or importing a plan bundle
22
+ - Before promoting to review/approved stages
23
+ - When plan needs clarification or enrichment
24
+
25
+ **Quick Example:**
26
+
27
+ ```bash
28
+ /specfact.03-review legacy-api
29
+ /specfact.03-review legacy-api --max-questions 3 --category "Functional Scope"
30
+ ```
31
+
32
+ ## Parameters
33
+
34
+ ### Target/Input
35
+
36
+ - `bundle NAME` (required argument) - Project bundle name (e.g., legacy-api, auth-module)
37
+ - `--category CATEGORY` - Focus on specific taxonomy category. Default: None (all categories)
38
+
39
+ ### Output/Results
40
+
41
+ - `--list-questions` - Output questions in JSON format. Default: False
42
+ - `--list-findings` - Output all findings in structured format. Default: False
43
+ - `--findings-format FORMAT` - Output format: json, yaml, or table. Default: json for non-interactive, table for interactive
44
+
45
+ ### Behavior/Options
46
+
47
+ - `--no-interactive` - Non-interactive mode (for CI/CD). Default: False (interactive mode)
48
+ - `--answers JSON` - JSON object with question_id -> answer mappings. Default: None
49
+ - `--auto-enrich` - Automatically enrich vague acceptance criteria. Default: False
50
+
51
+ ### Advanced/Configuration
52
+
53
+ - `--max-questions INT` - Maximum questions per session. Default: 5 (range: 1-10)
54
+
55
+ ## Workflow
56
+
57
+ ### Step 1: Parse Arguments
58
+
59
+ - Extract bundle name (required)
60
+ - Extract optional parameters (max-questions, category, etc.)
61
+
62
+ ### Step 2: Execute CLI
63
+
64
+ ```bash
65
+ # Interactive review
66
+ specfact plan review <bundle-name> [--max-questions <n>] [--category <category>]
67
+
68
+ # Non-interactive with answers
69
+ specfact plan review <bundle-name> --no-interactive --answers '{"Q001": "answer1", "Q002": "answer2"}'
70
+
71
+ # List questions only
72
+ specfact plan review <bundle-name> --list-questions
73
+
74
+ # List findings
75
+ specfact plan review <bundle-name> --list-findings --findings-format json
76
+ ```
77
+
78
+ ### Step 3: Present Results
79
+
80
+ - Display questions asked and answers provided
81
+ - Show sections touched by clarifications
82
+ - Present coverage summary by category
83
+ - Suggest next steps (promotion, additional review)
84
+
85
+ ## CLI Enforcement
86
+
87
+ **CRITICAL**: Always use SpecFact CLI commands. See [CLI Enforcement Rules](./shared/cli-enforcement.md) for details.
88
+
89
+ **Rules:**
90
+
91
+ 1. **ALWAYS execute CLI first**: Run `specfact plan review` before any analysis
92
+ 2. **ALWAYS use non-interactive mode for CI/CD**: Use `--no-interactive` flag in Copilot environments
93
+ 3. **NEVER modify .specfact folder directly**: All operations must go through CLI
94
+ 4. **NEVER create YAML/JSON directly**: All plan updates must be CLI-generated
95
+ 5. **Use CLI output as grounding**: Parse CLI output, don't regenerate it
96
+
97
+ ## Expected Output
98
+
99
+ ### Success
100
+
101
+ ```text
102
+ ✓ Review complete: 5 question(s) answered
103
+
104
+ Project Bundle: legacy-api
105
+ Questions Asked: 5
106
+
107
+ Sections Touched:
108
+ • idea.narrative
109
+ • features[FEATURE-001].acceptance
110
+ • features[FEATURE-002].outcomes
111
+
112
+ Coverage Summary:
113
+ ✅ Functional Scope: clear
114
+ ✅ Technical Constraints: clear
115
+ ⚠️ Business Context: partial
116
+ ```
117
+
118
+ ### Error (Missing Bundle)
119
+
120
+ ```text
121
+ ✗ Project bundle 'legacy-api' not found
122
+ Create one with: specfact plan init legacy-api
123
+ ```
124
+
125
+ ## Common Patterns
126
+
127
+ ```bash
128
+ # Interactive review
129
+ /specfact.03-review legacy-api
130
+
131
+ # Review with question limit
132
+ /specfact.03-review legacy-api --max-questions 3
133
+
134
+ # Review specific category
135
+ /specfact.03-review legacy-api --category "Functional Scope"
136
+
137
+ # Non-interactive with answers
138
+ /specfact.03-review legacy-api --no-interactive --answers '{"Q001": "answer1", "Q002": "answer2"}'
139
+
140
+ # List questions for LLM processing
141
+ /specfact.03-review legacy-api --list-questions
142
+
143
+ # List all findings
144
+ /specfact.03-review legacy-api --list-findings --findings-format json
145
+
146
+ # Auto-enrich mode
147
+ /specfact.03-review legacy-api --auto-enrich
148
+ ```
149
+
150
+ ## Context
151
+
152
+ {ARGS}