@rsaglobaltech/specgate 0.8.1

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 (494) hide show
  1. package/CHANGELOG.md +1016 -0
  2. package/README.md +148 -0
  3. package/bin/specgate.js +2 -0
  4. package/bin/specgate.ts +383 -0
  5. package/dist/bin/specgate.js +342 -0
  6. package/dist/bin/specgate.js.map +1 -0
  7. package/dist/packages/core/src/application/AddRequirementUseCase.js +24 -0
  8. package/dist/packages/core/src/application/AddRequirementUseCase.js.map +1 -0
  9. package/dist/packages/core/src/application/ArchiveChangeUseCase.js +185 -0
  10. package/dist/packages/core/src/application/ArchiveChangeUseCase.js.map +1 -0
  11. package/dist/packages/core/src/application/CheckAgainstLockUseCase.js +134 -0
  12. package/dist/packages/core/src/application/CheckAgainstLockUseCase.js.map +1 -0
  13. package/dist/packages/core/src/application/GenerateAgentPromptUseCase.js +25 -0
  14. package/dist/packages/core/src/application/GenerateAgentPromptUseCase.js.map +1 -0
  15. package/dist/packages/core/src/application/GeneratePlanUseCase.js +135 -0
  16. package/dist/packages/core/src/application/GeneratePlanUseCase.js.map +1 -0
  17. package/dist/packages/core/src/application/LinkRequirementUseCase.js +25 -0
  18. package/dist/packages/core/src/application/LinkRequirementUseCase.js.map +1 -0
  19. package/dist/packages/core/src/application/RemovePackUseCase.js +28 -0
  20. package/dist/packages/core/src/application/RemovePackUseCase.js.map +1 -0
  21. package/dist/packages/core/src/application/UpdateRequirementStatusUseCase.js +37 -0
  22. package/dist/packages/core/src/application/UpdateRequirementStatusUseCase.js.map +1 -0
  23. package/dist/packages/core/src/application/ValidateChangeUseCase.js +86 -0
  24. package/dist/packages/core/src/application/ValidateChangeUseCase.js.map +1 -0
  25. package/dist/packages/core/src/application/ValidateProjectUseCase.js +101 -0
  26. package/dist/packages/core/src/application/ValidateProjectUseCase.js.map +1 -0
  27. package/dist/packages/core/src/application/ports/IDomainPackRepository.js +3 -0
  28. package/dist/packages/core/src/application/ports/IDomainPackRepository.js.map +1 -0
  29. package/dist/packages/core/src/application/ports/IHarnessConfigRepository.js +3 -0
  30. package/dist/packages/core/src/application/ports/IHarnessConfigRepository.js.map +1 -0
  31. package/dist/packages/core/src/application/ports/ILockfileRepository.js +3 -0
  32. package/dist/packages/core/src/application/ports/ILockfileRepository.js.map +1 -0
  33. package/dist/packages/core/src/application/ports/IManifestRepository.js +3 -0
  34. package/dist/packages/core/src/application/ports/IManifestRepository.js.map +1 -0
  35. package/dist/packages/core/src/application/ports/IProjectRepository.js +3 -0
  36. package/dist/packages/core/src/application/ports/IProjectRepository.js.map +1 -0
  37. package/dist/packages/core/src/application/ports/IRequirementGraphRepository.js +3 -0
  38. package/dist/packages/core/src/application/ports/IRequirementGraphRepository.js.map +1 -0
  39. package/dist/packages/core/src/application/ports/ITraceabilityRepository.js +3 -0
  40. package/dist/packages/core/src/application/ports/ITraceabilityRepository.js.map +1 -0
  41. package/dist/packages/core/src/domain/AgentPrompt.js +79 -0
  42. package/dist/packages/core/src/domain/AgentPrompt.js.map +1 -0
  43. package/dist/packages/core/src/domain/ArchivePlan.js +26 -0
  44. package/dist/packages/core/src/domain/ArchivePlan.js.map +1 -0
  45. package/dist/packages/core/src/domain/AuthoringScope.js +48 -0
  46. package/dist/packages/core/src/domain/AuthoringScope.js.map +1 -0
  47. package/dist/packages/core/src/domain/ChangeTemplates.js +133 -0
  48. package/dist/packages/core/src/domain/ChangeTemplates.js.map +1 -0
  49. package/dist/packages/core/src/domain/CucumberMessages.js +256 -0
  50. package/dist/packages/core/src/domain/CucumberMessages.js.map +1 -0
  51. package/dist/packages/core/src/domain/DeclaredArtifacts.js +117 -0
  52. package/dist/packages/core/src/domain/DeclaredArtifacts.js.map +1 -0
  53. package/dist/packages/core/src/domain/DeltaSpec.js +219 -0
  54. package/dist/packages/core/src/domain/DeltaSpec.js.map +1 -0
  55. package/dist/packages/core/src/domain/Diagnostic.js +75 -0
  56. package/dist/packages/core/src/domain/Diagnostic.js.map +1 -0
  57. package/dist/packages/core/src/domain/DomainPack.js +62 -0
  58. package/dist/packages/core/src/domain/DomainPack.js.map +1 -0
  59. package/dist/packages/core/src/domain/EmptyAttempt.js +60 -0
  60. package/dist/packages/core/src/domain/EmptyAttempt.js.map +1 -0
  61. package/dist/packages/core/src/domain/FileChangeSet.js +37 -0
  62. package/dist/packages/core/src/domain/FileChangeSet.js.map +1 -0
  63. package/dist/packages/core/src/domain/Gherkin.js +272 -0
  64. package/dist/packages/core/src/domain/Gherkin.js.map +1 -0
  65. package/dist/packages/core/src/domain/GherkinDialects.js +97 -0
  66. package/dist/packages/core/src/domain/GherkinDialects.js.map +1 -0
  67. package/dist/packages/core/src/domain/GherkinQuality.js +160 -0
  68. package/dist/packages/core/src/domain/GherkinQuality.js.map +1 -0
  69. package/dist/packages/core/src/domain/GherkinTags.js +119 -0
  70. package/dist/packages/core/src/domain/GherkinTags.js.map +1 -0
  71. package/dist/packages/core/src/domain/GitSafety.js +77 -0
  72. package/dist/packages/core/src/domain/GitSafety.js.map +1 -0
  73. package/dist/packages/core/src/domain/HarnessConfig.js +58 -0
  74. package/dist/packages/core/src/domain/HarnessConfig.js.map +1 -0
  75. package/dist/packages/core/src/domain/HarnessReport.js +162 -0
  76. package/dist/packages/core/src/domain/HarnessReport.js.map +1 -0
  77. package/dist/packages/core/src/domain/HarnessRun.js +154 -0
  78. package/dist/packages/core/src/domain/HarnessRun.js.map +1 -0
  79. package/dist/packages/core/src/domain/InboundChange.js +127 -0
  80. package/dist/packages/core/src/domain/InboundChange.js.map +1 -0
  81. package/dist/packages/core/src/domain/Language.js +112 -0
  82. package/dist/packages/core/src/domain/Language.js.map +1 -0
  83. package/dist/packages/core/src/domain/Lockfile.js +64 -0
  84. package/dist/packages/core/src/domain/Lockfile.js.map +1 -0
  85. package/dist/packages/core/src/domain/PackContribution.js +106 -0
  86. package/dist/packages/core/src/domain/PackContribution.js.map +1 -0
  87. package/dist/packages/core/src/domain/PackDelta.js +298 -0
  88. package/dist/packages/core/src/domain/PackDelta.js.map +1 -0
  89. package/dist/packages/core/src/domain/PackSpec.js +481 -0
  90. package/dist/packages/core/src/domain/PackSpec.js.map +1 -0
  91. package/dist/packages/core/src/domain/ProfileMatch.js +87 -0
  92. package/dist/packages/core/src/domain/ProfileMatch.js.map +1 -0
  93. package/dist/packages/core/src/domain/Reconciliation.js +72 -0
  94. package/dist/packages/core/src/domain/Reconciliation.js.map +1 -0
  95. package/dist/packages/core/src/domain/RequirementGraph.js +197 -0
  96. package/dist/packages/core/src/domain/RequirementGraph.js.map +1 -0
  97. package/dist/packages/core/src/domain/RequirementPlan.js +85 -0
  98. package/dist/packages/core/src/domain/RequirementPlan.js.map +1 -0
  99. package/dist/packages/core/src/domain/RequirementReadiness.js +115 -0
  100. package/dist/packages/core/src/domain/RequirementReadiness.js.map +1 -0
  101. package/dist/packages/core/src/domain/RequirementSyntax.js +91 -0
  102. package/dist/packages/core/src/domain/RequirementSyntax.js.map +1 -0
  103. package/dist/packages/core/src/domain/ResumeState.js +115 -0
  104. package/dist/packages/core/src/domain/ResumeState.js.map +1 -0
  105. package/dist/packages/core/src/domain/RunBudget.js +103 -0
  106. package/dist/packages/core/src/domain/RunBudget.js.map +1 -0
  107. package/dist/packages/core/src/domain/SpecDiff.js +48 -0
  108. package/dist/packages/core/src/domain/SpecDiff.js.map +1 -0
  109. package/dist/packages/core/src/domain/SpecParser.js +406 -0
  110. package/dist/packages/core/src/domain/SpecParser.js.map +1 -0
  111. package/dist/packages/core/src/domain/SpecopsManifest.js +90 -0
  112. package/dist/packages/core/src/domain/SpecopsManifest.js.map +1 -0
  113. package/dist/packages/core/src/domain/TraceabilityFormat.js +317 -0
  114. package/dist/packages/core/src/domain/TraceabilityFormat.js.map +1 -0
  115. package/dist/packages/core/src/domain/TraceabilityMatrix.js +200 -0
  116. package/dist/packages/core/src/domain/TraceabilityMatrix.js.map +1 -0
  117. package/dist/packages/core/src/domain/TraceabilityMerge.js +180 -0
  118. package/dist/packages/core/src/domain/TraceabilityMerge.js.map +1 -0
  119. package/dist/packages/core/src/domain/ValidationReport.js +53 -0
  120. package/dist/packages/core/src/domain/ValidationReport.js.map +1 -0
  121. package/dist/packages/core/src/domain/ValueAnnotations.js +138 -0
  122. package/dist/packages/core/src/domain/ValueAnnotations.js.map +1 -0
  123. package/dist/packages/core/src/domain/WriteScope.js +155 -0
  124. package/dist/packages/core/src/domain/WriteScope.js.map +1 -0
  125. package/dist/packages/core/src/domain/YamlLite.js +226 -0
  126. package/dist/packages/core/src/domain/YamlLite.js.map +1 -0
  127. package/dist/packages/core/src/index.js +120 -0
  128. package/dist/packages/core/src/index.js.map +1 -0
  129. package/dist/packages/core/src/infrastructure/ChangeWorkspace.js +276 -0
  130. package/dist/packages/core/src/infrastructure/ChangeWorkspace.js.map +1 -0
  131. package/dist/packages/core/src/infrastructure/ConsoleReporter.js +19 -0
  132. package/dist/packages/core/src/infrastructure/ConsoleReporter.js.map +1 -0
  133. package/dist/packages/core/src/infrastructure/DirectorySnapshot.js +106 -0
  134. package/dist/packages/core/src/infrastructure/DirectorySnapshot.js.map +1 -0
  135. package/dist/packages/core/src/infrastructure/DiskDomainPackRepository.js +57 -0
  136. package/dist/packages/core/src/infrastructure/DiskDomainPackRepository.js.map +1 -0
  137. package/dist/packages/core/src/infrastructure/DiskHarnessConfigRepository.js +58 -0
  138. package/dist/packages/core/src/infrastructure/DiskHarnessConfigRepository.js.map +1 -0
  139. package/dist/packages/core/src/infrastructure/DiskLanguageRepository.js +69 -0
  140. package/dist/packages/core/src/infrastructure/DiskLanguageRepository.js.map +1 -0
  141. package/dist/packages/core/src/infrastructure/DiskLockfileRepository.js +64 -0
  142. package/dist/packages/core/src/infrastructure/DiskLockfileRepository.js.map +1 -0
  143. package/dist/packages/core/src/infrastructure/DiskManifestRepository.js +88 -0
  144. package/dist/packages/core/src/infrastructure/DiskManifestRepository.js.map +1 -0
  145. package/dist/packages/core/src/infrastructure/DiskPackDeltaRepository.js +138 -0
  146. package/dist/packages/core/src/infrastructure/DiskPackDeltaRepository.js.map +1 -0
  147. package/dist/packages/core/src/infrastructure/DiskPackRepository.js +130 -0
  148. package/dist/packages/core/src/infrastructure/DiskPackRepository.js.map +1 -0
  149. package/dist/packages/core/src/infrastructure/DiskProjectRepository.js +127 -0
  150. package/dist/packages/core/src/infrastructure/DiskProjectRepository.js.map +1 -0
  151. package/dist/packages/core/src/infrastructure/DiskRequirementGraphRepository.js +124 -0
  152. package/dist/packages/core/src/infrastructure/DiskRequirementGraphRepository.js.map +1 -0
  153. package/dist/packages/core/src/infrastructure/DiskTraceabilityRepository.js +53 -0
  154. package/dist/packages/core/src/infrastructure/DiskTraceabilityRepository.js.map +1 -0
  155. package/dist/packages/core/src/infrastructure/GitContributionStager.js +99 -0
  156. package/dist/packages/core/src/infrastructure/GitContributionStager.js.map +1 -0
  157. package/dist/packages/core/src/infrastructure/GitMergeDriver.js +103 -0
  158. package/dist/packages/core/src/infrastructure/GitMergeDriver.js.map +1 -0
  159. package/dist/packages/core/src/infrastructure/HarnessConfigFile.js +348 -0
  160. package/dist/packages/core/src/infrastructure/HarnessConfigFile.js.map +1 -0
  161. package/dist/packages/core/src/infrastructure/PackChangeDeposit.js +106 -0
  162. package/dist/packages/core/src/infrastructure/PackChangeDeposit.js.map +1 -0
  163. package/dist/packages/core/src/infrastructure/RemotePackResolver.js +181 -0
  164. package/dist/packages/core/src/infrastructure/RemotePackResolver.js.map +1 -0
  165. package/dist/packages/core/src/infrastructure/SpecopsConfigFile.js +94 -0
  166. package/dist/packages/core/src/infrastructure/SpecopsConfigFile.js.map +1 -0
  167. package/dist/packages/core/test/unit/authoring-scope.test.js +102 -0
  168. package/dist/packages/core/test/unit/authoring-scope.test.js.map +1 -0
  169. package/dist/packages/core/test/unit/change-templates.test.js +96 -0
  170. package/dist/packages/core/test/unit/change-templates.test.js.map +1 -0
  171. package/dist/packages/core/test/unit/cucumber-messages.test.js +232 -0
  172. package/dist/packages/core/test/unit/cucumber-messages.test.js.map +1 -0
  173. package/dist/packages/core/test/unit/declared-artifacts.test.js +124 -0
  174. package/dist/packages/core/test/unit/declared-artifacts.test.js.map +1 -0
  175. package/dist/packages/core/test/unit/empty-attempt.test.js +79 -0
  176. package/dist/packages/core/test/unit/empty-attempt.test.js.map +1 -0
  177. package/dist/packages/core/test/unit/gherkin-dialects.test.js +115 -0
  178. package/dist/packages/core/test/unit/gherkin-dialects.test.js.map +1 -0
  179. package/dist/packages/core/test/unit/gherkin-keyword-case.test.js +110 -0
  180. package/dist/packages/core/test/unit/gherkin-keyword-case.test.js.map +1 -0
  181. package/dist/packages/core/test/unit/gherkin-quality.test.js +151 -0
  182. package/dist/packages/core/test/unit/gherkin-quality.test.js.map +1 -0
  183. package/dist/packages/core/test/unit/gherkin-tags.test.js +127 -0
  184. package/dist/packages/core/test/unit/gherkin-tags.test.js.map +1 -0
  185. package/dist/packages/core/test/unit/git-safety.test.js +104 -0
  186. package/dist/packages/core/test/unit/git-safety.test.js.map +1 -0
  187. package/dist/packages/core/test/unit/harness-report.test.js +192 -0
  188. package/dist/packages/core/test/unit/harness-report.test.js.map +1 -0
  189. package/dist/packages/core/test/unit/harness-roles.test.js +86 -0
  190. package/dist/packages/core/test/unit/harness-roles.test.js.map +1 -0
  191. package/dist/packages/core/test/unit/inbound-change.test.js +145 -0
  192. package/dist/packages/core/test/unit/inbound-change.test.js.map +1 -0
  193. package/dist/packages/core/test/unit/matrix-dependencies.test.js +100 -0
  194. package/dist/packages/core/test/unit/matrix-dependencies.test.js.map +1 -0
  195. package/dist/packages/core/test/unit/profile-match.test.js +115 -0
  196. package/dist/packages/core/test/unit/profile-match.test.js.map +1 -0
  197. package/dist/packages/core/test/unit/reconciliation.test.js +112 -0
  198. package/dist/packages/core/test/unit/reconciliation.test.js.map +1 -0
  199. package/dist/packages/core/test/unit/requirement-readiness.test.js +161 -0
  200. package/dist/packages/core/test/unit/requirement-readiness.test.js.map +1 -0
  201. package/dist/packages/core/test/unit/resume-state.test.js +124 -0
  202. package/dist/packages/core/test/unit/resume-state.test.js.map +1 -0
  203. package/dist/packages/core/test/unit/run-budget.test.js +113 -0
  204. package/dist/packages/core/test/unit/run-budget.test.js.map +1 -0
  205. package/dist/packages/core/test/unit/traceability-merge.test.js +159 -0
  206. package/dist/packages/core/test/unit/traceability-merge.test.js.map +1 -0
  207. package/dist/packages/core/test/unit/validate-project.test.js +156 -0
  208. package/dist/packages/core/test/unit/validate-project.test.js.map +1 -0
  209. package/dist/packages/core/test/unit/value-annotations.test.js +149 -0
  210. package/dist/packages/core/test/unit/value-annotations.test.js.map +1 -0
  211. package/dist/packages/core/test/unit/write-scope.test.js +165 -0
  212. package/dist/packages/core/test/unit/write-scope.test.js.map +1 -0
  213. package/dist/packages/core/test/unit/yaml-lite.test.js +78 -0
  214. package/dist/packages/core/test/unit/yaml-lite.test.js.map +1 -0
  215. package/dist/scripts/adopt_project.js +11 -0
  216. package/dist/scripts/adopt_project.js.map +1 -0
  217. package/dist/scripts/agents/commands.js +100 -0
  218. package/dist/scripts/agents/commands.js.map +1 -0
  219. package/dist/scripts/agents/init.js +482 -0
  220. package/dist/scripts/agents/init.js.map +1 -0
  221. package/dist/scripts/alm/cli.js +154 -0
  222. package/dist/scripts/alm/cli.js.map +1 -0
  223. package/dist/scripts/alm/clients.js +30 -0
  224. package/dist/scripts/alm/clients.js.map +1 -0
  225. package/dist/scripts/alm/core.js +258 -0
  226. package/dist/scripts/alm/core.js.map +1 -0
  227. package/dist/scripts/alm/port.js +116 -0
  228. package/dist/scripts/alm/port.js.map +1 -0
  229. package/dist/scripts/alm/providers/azure.js +79 -0
  230. package/dist/scripts/alm/providers/azure.js.map +1 -0
  231. package/dist/scripts/alm/providers/github.js +124 -0
  232. package/dist/scripts/alm/providers/github.js.map +1 -0
  233. package/dist/scripts/alm/providers/http-client.js +47 -0
  234. package/dist/scripts/alm/providers/http-client.js.map +1 -0
  235. package/dist/scripts/alm/providers/index.js +107 -0
  236. package/dist/scripts/alm/providers/index.js.map +1 -0
  237. package/dist/scripts/alm/providers/jira.js +129 -0
  238. package/dist/scripts/alm/providers/jira.js.map +1 -0
  239. package/dist/scripts/bundle_pack.js +10 -0
  240. package/dist/scripts/bundle_pack.js.map +1 -0
  241. package/dist/scripts/change/archive.js +68 -0
  242. package/dist/scripts/change/archive.js.map +1 -0
  243. package/dist/scripts/change/artifacts.js +143 -0
  244. package/dist/scripts/change/artifacts.js.map +1 -0
  245. package/dist/scripts/change/cli.js +39 -0
  246. package/dist/scripts/change/cli.js.map +1 -0
  247. package/dist/scripts/change/delta.js +20 -0
  248. package/dist/scripts/change/delta.js.map +1 -0
  249. package/dist/scripts/change/instructions.js +339 -0
  250. package/dist/scripts/change/instructions.js.map +1 -0
  251. package/dist/scripts/ci_init.js +12 -0
  252. package/dist/scripts/ci_init.js.map +1 -0
  253. package/dist/scripts/cli/commands/alm/PullCommand.js +238 -0
  254. package/dist/scripts/cli/commands/alm/PullCommand.js.map +1 -0
  255. package/dist/scripts/cli/commands/change/ChangeCommand.js +867 -0
  256. package/dist/scripts/cli/commands/change/ChangeCommand.js.map +1 -0
  257. package/dist/scripts/cli/commands/config/CiInitCommand.js +144 -0
  258. package/dist/scripts/cli/commands/config/CiInitCommand.js.map +1 -0
  259. package/dist/scripts/cli/commands/config/CompletionCommand.js +160 -0
  260. package/dist/scripts/cli/commands/config/CompletionCommand.js.map +1 -0
  261. package/dist/scripts/cli/commands/config/ConfigInitCommand.js +108 -0
  262. package/dist/scripts/cli/commands/config/ConfigInitCommand.js.map +1 -0
  263. package/dist/scripts/cli/commands/config/ConfigSetCommand.js +166 -0
  264. package/dist/scripts/cli/commands/config/ConfigSetCommand.js.map +1 -0
  265. package/dist/scripts/cli/commands/config/GenAgentContractCommand.js +212 -0
  266. package/dist/scripts/cli/commands/config/GenAgentContractCommand.js.map +1 -0
  267. package/dist/scripts/cli/commands/harness/RunCommand.js +1922 -0
  268. package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -0
  269. package/dist/scripts/cli/commands/mcp/McpInstallCommand.js +114 -0
  270. package/dist/scripts/cli/commands/mcp/McpInstallCommand.js.map +1 -0
  271. package/dist/scripts/cli/commands/mcp/index.js +29 -0
  272. package/dist/scripts/cli/commands/mcp/index.js.map +1 -0
  273. package/dist/scripts/cli/commands/pack/BundlePackCommand.js +59 -0
  274. package/dist/scripts/cli/commands/pack/BundlePackCommand.js.map +1 -0
  275. package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js +559 -0
  276. package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js.map +1 -0
  277. package/dist/scripts/cli/commands/pack/InferPackCommand.js +304 -0
  278. package/dist/scripts/cli/commands/pack/InferPackCommand.js.map +1 -0
  279. package/dist/scripts/cli/commands/pack/InitPackCommand.js +368 -0
  280. package/dist/scripts/cli/commands/pack/InitPackCommand.js.map +1 -0
  281. package/dist/scripts/cli/commands/pack/LintPackCommand.js +631 -0
  282. package/dist/scripts/cli/commands/pack/LintPackCommand.js.map +1 -0
  283. package/dist/scripts/cli/commands/pack/pack-args.js +83 -0
  284. package/dist/scripts/cli/commands/pack/pack-args.js.map +1 -0
  285. package/dist/scripts/cli/commands/project/AdoptCommand.js +414 -0
  286. package/dist/scripts/cli/commands/project/AdoptCommand.js.map +1 -0
  287. package/dist/scripts/cli/commands/project/InitFromPackCommand.js +188 -0
  288. package/dist/scripts/cli/commands/project/InitFromPackCommand.js.map +1 -0
  289. package/dist/scripts/cli/commands/project/InitProjectCommand.js +791 -0
  290. package/dist/scripts/cli/commands/project/InitProjectCommand.js.map +1 -0
  291. package/dist/scripts/cli/commands/project/OnboardCommand.js +655 -0
  292. package/dist/scripts/cli/commands/project/OnboardCommand.js.map +1 -0
  293. package/dist/scripts/cli/commands/project/UpdateCommand.js +206 -0
  294. package/dist/scripts/cli/commands/project/UpdateCommand.js.map +1 -0
  295. package/dist/scripts/cli/commands/project/WizardCommand.js +166 -0
  296. package/dist/scripts/cli/commands/project/WizardCommand.js.map +1 -0
  297. package/dist/scripts/cli/commands/quality/DoctorCommand.js +553 -0
  298. package/dist/scripts/cli/commands/quality/DoctorCommand.js.map +1 -0
  299. package/dist/scripts/cli/commands/quality/FixCommand.js +201 -0
  300. package/dist/scripts/cli/commands/quality/FixCommand.js.map +1 -0
  301. package/dist/scripts/cli/commands/quality/LicenseCheckCommand.js +187 -0
  302. package/dist/scripts/cli/commands/quality/LicenseCheckCommand.js.map +1 -0
  303. package/dist/scripts/cli/commands/quality/ReportCommand.js +557 -0
  304. package/dist/scripts/cli/commands/quality/ReportCommand.js.map +1 -0
  305. package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js +764 -0
  306. package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js.map +1 -0
  307. package/dist/scripts/cli/commands/spec/DoneCommand.js +116 -0
  308. package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -0
  309. package/dist/scripts/cli/commands/spec/PlanCommand.js +397 -0
  310. package/dist/scripts/cli/commands/spec/PlanCommand.js.map +1 -0
  311. package/dist/scripts/cli/commands/spec/ReqCommand.js +303 -0
  312. package/dist/scripts/cli/commands/spec/ReqCommand.js.map +1 -0
  313. package/dist/scripts/cli/commands/spec/StatusCommand.js +206 -0
  314. package/dist/scripts/cli/commands/spec/StatusCommand.js.map +1 -0
  315. package/dist/scripts/cli/commands/spec/StudioCommand.js +241 -0
  316. package/dist/scripts/cli/commands/spec/StudioCommand.js.map +1 -0
  317. package/dist/scripts/cli/commands/specops/ContributeCommand.js +313 -0
  318. package/dist/scripts/cli/commands/specops/ContributeCommand.js.map +1 -0
  319. package/dist/scripts/cli/commands/specops/DiffCommand.js +394 -0
  320. package/dist/scripts/cli/commands/specops/DiffCommand.js.map +1 -0
  321. package/dist/scripts/cli/commands/specops/SyncCommand.js +380 -0
  322. package/dist/scripts/cli/commands/specops/SyncCommand.js.map +1 -0
  323. package/dist/scripts/completion.js +24 -0
  324. package/dist/scripts/completion.js.map +1 -0
  325. package/dist/scripts/config_init.js +12 -0
  326. package/dist/scripts/config_init.js.map +1 -0
  327. package/dist/scripts/config_set.js +20 -0
  328. package/dist/scripts/config_set.js.map +1 -0
  329. package/dist/scripts/docs/blocks.js +137 -0
  330. package/dist/scripts/docs/blocks.js.map +1 -0
  331. package/dist/scripts/docs/build-site.js +425 -0
  332. package/dist/scripts/docs/build-site.js.map +1 -0
  333. package/dist/scripts/docs/nav.js +198 -0
  334. package/dist/scripts/docs/nav.js.map +1 -0
  335. package/dist/scripts/docs/record-terminal.js +477 -0
  336. package/dist/scripts/docs/record-terminal.js.map +1 -0
  337. package/dist/scripts/docs/terminal-storyboard.js +121 -0
  338. package/dist/scripts/docs/terminal-storyboard.js.map +1 -0
  339. package/dist/scripts/doctor.js +14 -0
  340. package/dist/scripts/doctor.js.map +1 -0
  341. package/dist/scripts/done.js +17 -0
  342. package/dist/scripts/done.js.map +1 -0
  343. package/dist/scripts/expand_domain_pack.js +18 -0
  344. package/dist/scripts/expand_domain_pack.js.map +1 -0
  345. package/dist/scripts/fix.js +12 -0
  346. package/dist/scripts/fix.js.map +1 -0
  347. package/dist/scripts/gen_agent_contract.js +14 -0
  348. package/dist/scripts/gen_agent_contract.js.map +1 -0
  349. package/dist/scripts/gen_mcp_tools.js +264 -0
  350. package/dist/scripts/gen_mcp_tools.js.map +1 -0
  351. package/dist/scripts/harness/init.js +358 -0
  352. package/dist/scripts/harness/init.js.map +1 -0
  353. package/dist/scripts/harness/prompt.js +18 -0
  354. package/dist/scripts/harness/prompt.js.map +1 -0
  355. package/dist/scripts/harness/report.js +323 -0
  356. package/dist/scripts/harness/report.js.map +1 -0
  357. package/dist/scripts/harness/run.js +33 -0
  358. package/dist/scripts/harness/run.js.map +1 -0
  359. package/dist/scripts/infer_pack.js +17 -0
  360. package/dist/scripts/infer_pack.js.map +1 -0
  361. package/dist/scripts/init_from_pack.js +16 -0
  362. package/dist/scripts/init_from_pack.js.map +1 -0
  363. package/dist/scripts/init_pack.js +16 -0
  364. package/dist/scripts/init_pack.js.map +1 -0
  365. package/dist/scripts/init_project.js +17 -0
  366. package/dist/scripts/init_project.js.map +1 -0
  367. package/dist/scripts/lib/agent.js +99 -0
  368. package/dist/scripts/lib/agent.js.map +1 -0
  369. package/dist/scripts/lib/capability-specs.js +80 -0
  370. package/dist/scripts/lib/capability-specs.js.map +1 -0
  371. package/dist/scripts/lib/command.js +17 -0
  372. package/dist/scripts/lib/command.js.map +1 -0
  373. package/dist/scripts/lib/diagnostics.js +62 -0
  374. package/dist/scripts/lib/diagnostics.js.map +1 -0
  375. package/dist/scripts/lib/monorepo-fanout.js +118 -0
  376. package/dist/scripts/lib/monorepo-fanout.js.map +1 -0
  377. package/dist/scripts/lib/placeholders.js +190 -0
  378. package/dist/scripts/lib/placeholders.js.map +1 -0
  379. package/dist/scripts/lib/project-root.js +124 -0
  380. package/dist/scripts/lib/project-root.js.map +1 -0
  381. package/dist/scripts/lib/requirement-graph.js +31 -0
  382. package/dist/scripts/lib/requirement-graph.js.map +1 -0
  383. package/dist/scripts/lib/surface.js +609 -0
  384. package/dist/scripts/lib/surface.js.map +1 -0
  385. package/dist/scripts/license_check.js +15 -0
  386. package/dist/scripts/license_check.js.map +1 -0
  387. package/dist/scripts/lint_pack.js +18 -0
  388. package/dist/scripts/lint_pack.js.map +1 -0
  389. package/dist/scripts/merge-traceability.js +106 -0
  390. package/dist/scripts/merge-traceability.js.map +1 -0
  391. package/dist/scripts/onboard.js +22 -0
  392. package/dist/scripts/onboard.js.map +1 -0
  393. package/dist/scripts/plan.js +17 -0
  394. package/dist/scripts/plan.js.map +1 -0
  395. package/dist/scripts/plugin/gate-hook.js +171 -0
  396. package/dist/scripts/plugin/gate-hook.js.map +1 -0
  397. package/dist/scripts/report.js +17 -0
  398. package/dist/scripts/report.js.map +1 -0
  399. package/dist/scripts/req.js +22 -0
  400. package/dist/scripts/req.js.map +1 -0
  401. package/dist/scripts/schema/cli.js +215 -0
  402. package/dist/scripts/schema/cli.js.map +1 -0
  403. package/dist/scripts/schema/registry.js +264 -0
  404. package/dist/scripts/schema/registry.js.map +1 -0
  405. package/dist/scripts/specops/add.js +180 -0
  406. package/dist/scripts/specops/add.js.map +1 -0
  407. package/dist/scripts/specops/against_lock.js +100 -0
  408. package/dist/scripts/specops/against_lock.js.map +1 -0
  409. package/dist/scripts/specops/as_change.js +49 -0
  410. package/dist/scripts/specops/as_change.js.map +1 -0
  411. package/dist/scripts/specops/contribute.js +24 -0
  412. package/dist/scripts/specops/contribute.js.map +1 -0
  413. package/dist/scripts/specops/diff.js +32 -0
  414. package/dist/scripts/specops/diff.js.map +1 -0
  415. package/dist/scripts/specops/lock.js +39 -0
  416. package/dist/scripts/specops/lock.js.map +1 -0
  417. package/dist/scripts/specops/manifest.js +90 -0
  418. package/dist/scripts/specops/manifest.js.map +1 -0
  419. package/dist/scripts/specops/remove.js +102 -0
  420. package/dist/scripts/specops/remove.js.map +1 -0
  421. package/dist/scripts/specops/sync.js +27 -0
  422. package/dist/scripts/specops/sync.js.map +1 -0
  423. package/dist/scripts/specops/verify.js +149 -0
  424. package/dist/scripts/specops/verify.js.map +1 -0
  425. package/dist/scripts/status.js +17 -0
  426. package/dist/scripts/status.js.map +1 -0
  427. package/dist/scripts/studio.js +14 -0
  428. package/dist/scripts/studio.js.map +1 -0
  429. package/dist/scripts/update.js +17 -0
  430. package/dist/scripts/update.js.map +1 -0
  431. package/dist/scripts/validate_specs.js +10 -0
  432. package/dist/scripts/validate_specs.js.map +1 -0
  433. package/examples/project.config.example +19 -0
  434. package/examples/project.yaml.example +17 -0
  435. package/package.json +105 -0
  436. package/templates/adopt/AI_RULES.md.tpl +27 -0
  437. package/templates/adopt/adr-readme.md.tpl +5 -0
  438. package/templates/adopt/baseline.feature.tpl +9 -0
  439. package/templates/adopt/spec.md.tpl +25 -0
  440. package/templates/adopt/traceability.md.tpl +11 -0
  441. package/templates/backend/AI_RULES.md.tpl +35 -0
  442. package/templates/backend/features/core/health.feature.tpl +7 -0
  443. package/templates/base/.devcontainer/devcontainer.json.tpl +18 -0
  444. package/templates/base/.dockerignore.tpl +11 -0
  445. package/templates/base/.env.dev.app.tpl +13 -0
  446. package/templates/base/.env.dev.infra.tpl +6 -0
  447. package/templates/base/.env.dev.tpl +16 -0
  448. package/templates/base/.env.example.tpl +17 -0
  449. package/templates/base/.env.feature.app.tpl +11 -0
  450. package/templates/base/.env.feature.infra.tpl +4 -0
  451. package/templates/base/.env.feature.tpl +16 -0
  452. package/templates/base/.env.prod.app.tpl +13 -0
  453. package/templates/base/.env.prod.infra.tpl +6 -0
  454. package/templates/base/.env.prod.tpl +16 -0
  455. package/templates/base/.github/workflows/specs.yml.tpl +26 -0
  456. package/templates/base/.gitignore.tpl +9 -0
  457. package/templates/base/.pre-commit-config.yaml.tpl +10 -0
  458. package/templates/base/AGENTS.md.tpl +32 -0
  459. package/templates/base/README.md.tpl +32 -0
  460. package/templates/base/docker-compose.yml.tpl +13 -0
  461. package/templates/base/docs/specs/adr/README.md.tpl +10 -0
  462. package/templates/base/docs/specs/aggregates.md.tpl +5 -0
  463. package/templates/base/docs/specs/commands.md.tpl +13 -0
  464. package/templates/base/docs/specs/domain-model.md.tpl +30 -0
  465. package/templates/base/docs/specs/events.md.tpl +5 -0
  466. package/templates/base/docs/specs/review-checklist.md.tpl +18 -0
  467. package/templates/base/docs/specs/runtime-environments.md.tpl +26 -0
  468. package/templates/base/docs/specs/status-model.md.tpl +16 -0
  469. package/templates/base/docs/specs/traceability.md.tpl +7 -0
  470. package/templates/base/docs/specs/use-cases.md.tpl +5 -0
  471. package/templates/base/spec.md.tpl +63 -0
  472. package/templates/ci/azure.yml.tpl +40 -0
  473. package/templates/ci/github.yml.tpl +40 -0
  474. package/templates/ci/gitlab.yml.tpl +21 -0
  475. package/templates/ci/jenkins.tpl +35 -0
  476. package/templates/contracts/AI_RULES.md.tpl +55 -0
  477. package/templates/contracts/asyncapi-stub.yaml.tpl +24 -0
  478. package/templates/contracts/contract-traceability.md.tpl +10 -0
  479. package/templates/contracts/openapi-stub.yaml.tpl +29 -0
  480. package/templates/contracts/pacts-gitkeep.tpl +0 -0
  481. package/templates/contracts/test-strategy.md.tpl +94 -0
  482. package/templates/frontend/AI_RULES.md.tpl +34 -0
  483. package/templates/frontend/features/core/health.feature.tpl +6 -0
  484. package/templates/harness/harness.config.yaml.tpl +74 -0
  485. package/templates/harness/prompt-prefix.md.tpl +60 -0
  486. package/templates/mobile/AI_RULES.md.tpl +56 -0
  487. package/templates/mobile/features/core/health.feature.tpl +7 -0
  488. package/templates/modules/auth/backend/registration_and_login.feature.tpl +10 -0
  489. package/templates/modules/auth/frontend/login.feature.tpl +5 -0
  490. package/templates/modules/billing/backend/billing_settlement.feature.tpl +5 -0
  491. package/templates/modules/billing/frontend/billing_summary.feature.tpl +5 -0
  492. package/templates/modules/dashboard/backend/dashboard_kpi.feature.tpl +5 -0
  493. package/templates/modules/dashboard/frontend/dashboard.feature.tpl +5 -0
  494. package/vendor/mermaid.min.js +3636 -0
@@ -0,0 +1,16 @@
1
+ # Status Model
2
+
3
+ Use these statuses for requirements, scenarios, use cases, and traceability rows.
4
+
5
+ | Status | Meaning |
6
+ |---|---|
7
+ | Draft | A first version exists. |
8
+ | Needs Clarification | Ambiguities block implementation. |
9
+ | Domain Reviewed | The domain model was reviewed. |
10
+ | Architecture Reviewed | Technical solution and ADRs were reviewed. |
11
+ | Ready for Dev | Implementation can start. |
12
+ | In Dev | Implementation is in progress. |
13
+ | In Review | Change is ready for review. |
14
+ | Verified | Tests, contracts, or acceptance criteria pass. |
15
+ | Released | Available to users or the target environment. |
16
+ | Deprecated | Requirement or scenario was retired. |
@@ -0,0 +1,7 @@
1
+ # Traceability Matrix
2
+
3
+ Map requirements to scenarios, domain model elements, implementation artifacts, and tests.
4
+
5
+ | Requirement | Scenario ID | Feature file | Use Case | Command/Query | Aggregate | Event | Technical artifact | Test artifact | Status |
6
+ |---|---|---|---|---|---|---|---|---|---|
7
+ | REQ-000 | SCN-000 | `features/core/health.feature` | UC-000 Health baseline | QRY-000 HealthCheckQuery | - | - | `API /health`, smoke test | TBD | Draft |
@@ -0,0 +1,5 @@
1
+ # Use Cases
2
+
3
+ | ID | Use Case | Actor | Requirement | Command/Query | Aggregate | Emits | Status |
4
+ |---|---|---|---|---|---|---|---|
5
+ | UC-001 | Describe the first use case | Primary actor | REQ-TBD | CMD-001 ExampleCommand | AGG-001 CoreAggregate | EVT-001 ExampleEvent | Draft |
@@ -0,0 +1,63 @@
1
+ # Spec: {{PROJECT_NAME}}
2
+
3
+ ## 1. Product context
4
+ {{PROJECT_NAME}} operates in the **{{DOMAIN}}** domain and follows a Spec-Driven Development approach.
5
+
6
+ ## 2. Target users
7
+ - Primary users:
8
+ - Secondary users:
9
+ - Internal stakeholders:
10
+
11
+ ## 3. Main objective
12
+ Define functional requirements, domain language, and acceptance criteria clearly before writing implementation code.
13
+
14
+ ## 4. In scope
15
+ - Core workflows for the first release.
16
+ - Acceptance criteria for externally visible behavior.
17
+ - Traceability from requirements to scenarios, domain model, implementation, and tests.
18
+
19
+ ## 5. Out of scope
20
+ - Features that are not mapped to requirements or scenarios.
21
+ - Infrastructure decisions that do not affect the initial implementation.
22
+ - Premature workflow, microservice, CQRS, or Event Sourcing complexity.
23
+
24
+ ## 6. Success criteria
25
+ - Every business feature has traceable Gherkin scenarios.
26
+ - Every scenario maps to a requirement and a technical artifact.
27
+ - Domain terminology is captured before implementation starts.
28
+ - The team can reuse this structure in new projects.
29
+
30
+ ## 7. Initial bounded contexts
31
+ - Core Domain: central business rules.
32
+ - Supporting Domain: integrations and reporting.
33
+ - Generic Domain: identity, auditing, and notifications.
34
+
35
+ ## 8. Key requirements
36
+
37
+ <!--
38
+ Add requirements with `specgate req add "<what the requirement does>"`, which
39
+ writes the row here **and** in docs/specs/traceability.md at the same time.
40
+
41
+ Do not hand-write a row here alone. A requirement that exists in this file and
42
+ not in the matrix fails `specgate validate --strict-tdd` with [TDD-3], and the
43
+ table below is the one a generated project used to ship pre-filled with an
44
+ example — so every new project was born with a red gate (H20).
45
+ -->
46
+
47
+ | ID | Requirement | Priority | Status |
48
+ |---|---|---|---|
49
+
50
+ ## 9. Non-functional requirements
51
+ | ID | Requirement | Quality attribute | Status |
52
+ |---|---|---|---|
53
+ | NFR-001 | Define the first measurable non-functional requirement. | Reliability | Draft |
54
+
55
+ ## 10. Risks and open questions
56
+ | ID | Topic | Impact | Owner | Status |
57
+ |---|---|---|---|---|
58
+ | RISK-001 | Capture the first domain, delivery, or architecture risk. | Medium | TBD | Draft |
59
+
60
+ ## 11. Domain language
61
+ | Term | Meaning | Notes |
62
+ |---|---|---|
63
+ | Example term | Define the term using business language. | Replace with project language. |
@@ -0,0 +1,40 @@
1
+ # Generated by `specgate ci init --provider azure`
2
+ # Spec-Driven Development gate for Azure Pipelines.
3
+ trigger:
4
+ branches:
5
+ include: [main]
6
+ pr:
7
+ branches:
8
+ include: ['*']
9
+
10
+ pool:
11
+ vmImage: ubuntu-latest
12
+
13
+ steps:
14
+ - task: NodeTool@0
15
+ inputs:
16
+ versionSpec: '22.x'
17
+ displayName: Use Node.js 22
18
+
19
+ - script: npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --strict-tdd
20
+ displayName: Validate specs (strict TDD)
21
+
22
+ # Supply-chain gate: fails when rendered pack content no longer matches the
23
+ # digest pinned in .specops.lock. Skipped when no packs are installed.
24
+ - script: |
25
+ if [ -f .specops.lock ]; then
26
+ npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --against-lock
27
+ else
28
+ echo "No .specops.lock — no packs installed, nothing to check."
29
+ fi
30
+ displayName: Check pack drift
31
+
32
+ - script: npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} plan --project-dir . --format json > $(Build.ArtifactStagingDirectory)/spec-plan.json
33
+ condition: always()
34
+ displayName: Export pending-work plan
35
+
36
+ - task: PublishBuildArtifacts@1
37
+ condition: always()
38
+ inputs:
39
+ pathToPublish: $(Build.ArtifactStagingDirectory)/spec-plan.json
40
+ artifactName: spec-plan
@@ -0,0 +1,40 @@
1
+ # Generated by `specgate ci init --provider github`
2
+ # Spec-Driven Development gate: no PR merges if a requirement loses its
3
+ # feature file, its test artifact, or its traceability row.
4
+ name: Spec gate
5
+
6
+ on:
7
+ pull_request:
8
+ push:
9
+ branches: [main]
10
+
11
+ jobs:
12
+ spec-gate:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version: '22'
19
+ - name: Validate specs (strict TDD)
20
+ run: npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --strict-tdd
21
+ # Supply-chain gate: fails when the rendered pack content no longer
22
+ # matches the digest pinned in .specops.lock — a moved tag, a rewritten
23
+ # history, or a hand-edited generated file. Skipped when the project
24
+ # installs no packs.
25
+ - name: Check pack drift
26
+ run: |
27
+ if [ -f .specops.lock ]; then
28
+ npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --against-lock
29
+ else
30
+ echo "No .specops.lock — no packs installed, nothing to check."
31
+ fi
32
+ - name: Export pending-work plan
33
+ if: always()
34
+ run: npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} plan --project-dir . --format json > spec-plan.json
35
+ - name: Upload plan artifact
36
+ if: always()
37
+ uses: actions/upload-artifact@v4
38
+ with:
39
+ name: spec-plan
40
+ path: spec-plan.json
@@ -0,0 +1,21 @@
1
+ # Generated by `specgate ci init --provider gitlab`
2
+ # Spec-Driven Development gate for GitLab CI. If your project already has a
3
+ # .gitlab-ci.yml, paste the `spec-gate` job into it instead.
4
+ spec-gate:
5
+ image: node:22
6
+ stage: test
7
+ script:
8
+ - npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --strict-tdd
9
+ # Supply-chain gate: fails when rendered pack content no longer matches the
10
+ # digest pinned in .specops.lock. Skipped when no packs are installed.
11
+ - >
12
+ if [ -f .specops.lock ]; then
13
+ npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --against-lock;
14
+ else
15
+ echo "No .specops.lock — no packs installed, nothing to check.";
16
+ fi
17
+ - npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} plan --project-dir . --format json > spec-plan.json
18
+ artifacts:
19
+ when: always
20
+ paths:
21
+ - spec-plan.json
@@ -0,0 +1,35 @@
1
+ // Generated by `specgate ci init --provider jenkins`
2
+ // Spec-Driven Development gate for Jenkins (declarative pipeline).
3
+ // If your project already has a Jenkinsfile, paste the 'Spec gate' stage in.
4
+ pipeline {
5
+ agent {
6
+ docker { image 'node:22' }
7
+ }
8
+ stages {
9
+ stage('Spec gate') {
10
+ steps {
11
+ sh 'npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --strict-tdd'
12
+ }
13
+ }
14
+ // Supply-chain gate: fails when rendered pack content no longer
15
+ // matches the digest pinned in .specops.lock. Skipped when the
16
+ // project installs no packs.
17
+ stage('Pack drift') {
18
+ steps {
19
+ sh '''
20
+ if [ -f .specops.lock ]; then
21
+ npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} validate . --against-lock
22
+ else
23
+ echo "No .specops.lock — no packs installed, nothing to check."
24
+ fi
25
+ '''
26
+ }
27
+ }
28
+ }
29
+ post {
30
+ always {
31
+ sh 'npx @rsaglobaltech/specgate@{{SPECGATE_VERSION}} plan --project-dir . --format json > spec-plan.json || true'
32
+ archiveArtifacts artifacts: 'spec-plan.json', allowEmptyArchive: true
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,55 @@
1
+ # AI_RULES.md — {{PROJECT_NAME}} Contract Layer
2
+
3
+ > **Scope:** This file governs AI-assisted development in the `{{PROJECT_SLUG}}` contract layer.
4
+ > All AI tools (Claude, Copilot, etc.) must follow these rules before generating or modifying any contract artefact.
5
+
6
+ ## 1. Contract-First Mandate
7
+
8
+ Never write provider implementation code before the OpenAPI / AsyncAPI specification exists and is reviewed.
9
+ Every endpoint and every event must have a corresponding entry in `contracts/openapi/` or `contracts/asyncapi/` **before** any code is generated for it.
10
+
11
+ ## 2. Consumer-Driven Test Coverage (TDD Rule 1)
12
+
13
+ For every API contract (`AC-*` in `pack.yaml`), at least one Pact interaction must exist in `contracts/pacts/`.
14
+ Do not mark a contract as `Verified` in the traceability matrix until the Pact test passes in CI.
15
+
16
+ ## 3. No Breaking Changes Without Versioning (TDD Rule 2)
17
+
18
+ Before modifying any schema file:
19
+ 1. Check `breaking_change_rules` in `pack.yaml` for the relevant contract.
20
+ 2. If the change matches a breaking-change rule, bump the contract's major version and create a new schema file (`provider-v2.yaml`). Do **not** overwrite the existing version.
21
+ 3. Update `api_contracts[].schema_ref` to point to the new version.
22
+
23
+ ## 4. Traceability Gate (TDD Rule 3)
24
+
25
+ Every contract entry (`AC-*`) must be traceable to a requirement (`REQ-*`) via `api_contracts[].requirement`.
26
+ Do not add a contract without a corresponding requirement, and do not close a requirement without at least one associated contract or consumer-driven test.
27
+
28
+ ## 5. Status Promotion Rules (TDD Rule 4)
29
+
30
+ A contract record in `docs/specs/contract-traceability.md` may only advance past `Ready for Dev` when:
31
+ - The schema file referenced by `schema_ref` exists and validates against its format spec (OpenAPI 3.x / AsyncAPI 2.x).
32
+ - At least one `CDT-*` entry links this contract's provider.
33
+ - The corresponding Pact file exists on disk.
34
+
35
+ Do not auto-promote status. Status changes must be explicit edits to the traceability document, committed with a message explaining the promotion reason.
36
+
37
+ ## 6. Test Artifact Must Not Be TBD (TDD Rule 5)
38
+
39
+ In `docs/specs/contract-traceability.md`, the **Test Artifact** column must never contain `TBD` for a record whose **Status** is `In Dev` or later.
40
+ If the test artifact is not yet known, keep the record at `Draft` or `Needs Clarification`.
41
+
42
+ ## 7. Schema Files Are Source of Truth
43
+
44
+ - OpenAPI / AsyncAPI files in `contracts/` are the authoritative contract.
45
+ - Generated client stubs, server stubs, and mock servers derive from these — never the reverse.
46
+ - If a generated file conflicts with the schema, the schema wins. Update the schema deliberately, not the generated file.
47
+
48
+ ## References
49
+
50
+ - Requirements: see `pack.yaml` → `requirements[]`
51
+ - API Contracts: see `pack.yaml` → `api_contracts[]`
52
+ - Consumer-Driven Tests: see `pack.yaml` → `consumer_driven_tests[]`
53
+ - Breaking-Change Rules: see `pack.yaml` → `breaking_change_rules[]`
54
+ - Traceability: `docs/specs/contract-traceability.md`
55
+ - Test Strategy: `docs/specs/test-strategy.md`
@@ -0,0 +1,24 @@
1
+ asyncapi: "2.6.0"
2
+ info:
3
+ title: "{{PROVIDER_SERVICE}} Events"
4
+ version: "1.0.0"
5
+ description: |
6
+ AsyncAPI contract for events published by {{PROVIDER_SERVICE}}.
7
+ Generated by specgate from the contracts pack.
8
+ channels:
9
+ {{PROJECT_SLUG}}/events:
10
+ subscribe:
11
+ summary: Domain events published by {{PROVIDER_SERVICE}}
12
+ message:
13
+ name: DomainEvent
14
+ payload:
15
+ type: object
16
+ properties:
17
+ eventId:
18
+ type: string
19
+ format: uuid
20
+ occurredAt:
21
+ type: string
22
+ format: date-time
23
+ eventType:
24
+ type: string
@@ -0,0 +1,10 @@
1
+ # Contract Traceability Matrix — {{PROJECT_NAME}}
2
+
3
+ | Requirement | Contract ID | Contract Title | Type | Test Artifact | Status |
4
+ |---|---|---|---|---|---|
5
+ | REQ-001 | AC-001 | {{PROVIDER_SERVICE}} REST API — v1 | REST | CDT-001 | Draft |
6
+ | REQ-004 | AC-002 | {{PROVIDER_SERVICE}} Events — v1 | AsyncAPI | TBD | Draft |
7
+
8
+ **Legend:**
9
+ - `TBD` in Test Artifact = no Pact test exists yet (blocks promotion past `Ready for Dev`)
10
+ - Status values follow the same lifecycle as the domain traceability matrix
@@ -0,0 +1,29 @@
1
+ openapi: "3.1.0"
2
+ info:
3
+ title: "{{PROVIDER_SERVICE}} API"
4
+ version: "1.0.0"
5
+ description: |
6
+ REST API contract for {{PROJECT_NAME}}.
7
+ Generated by specgate from the contracts pack.
8
+ Replace stub paths with real endpoint definitions.
9
+ servers:
10
+ - url: "https://api.{{PROJECT_SLUG}}.example.com/v1"
11
+ description: Production
12
+ - url: "http://localhost:8080/v1"
13
+ description: Local development
14
+ paths:
15
+ /health:
16
+ get:
17
+ operationId: getHealth
18
+ summary: Health check
19
+ responses:
20
+ "200":
21
+ description: Service is healthy
22
+ content:
23
+ application/json:
24
+ schema:
25
+ type: object
26
+ properties:
27
+ status:
28
+ type: string
29
+ example: ok
File without changes
@@ -0,0 +1,94 @@
1
+ # Test Strategy — {{PROJECT_NAME}} Contract Layer
2
+
3
+ **Project:** {{PROJECT_NAME}} (`{{PROJECT_SLUG}}`)
4
+ **Provider:** {{PROVIDER_SERVICE}}
5
+ **Consumer:** {{CONSUMER_SERVICE}}
6
+ **Date:** <!-- filled in at expand time -->
7
+ **Status:** Draft
8
+
9
+ ## Overview
10
+
11
+ This document describes the contract-testing strategy for the `{{PROJECT_SLUG}}` project.
12
+ It follows the **Consumer-Driven Contract Testing** (CDCT) pattern, where consumers publish their
13
+ expected interactions (Pact files) and providers verify them in CI before any release.
14
+
15
+ ## Testing Pyramid
16
+
17
+ ```
18
+ ┌───────────────────┐
19
+ │ E2E / Integration│ ← minimal; catch wiring errors only
20
+ ├───────────────────┤
21
+ │ Contract Tests │ ← primary gate; Pact consumer + provider
22
+ ├───────────────────┤
23
+ │ Schema Tests │ ← validate OpenAPI / AsyncAPI files on every commit
24
+ ├───────────────────┤
25
+ │ Unit Tests │ ← serialisation, mapping, validation logic
26
+ └───────────────────┘
27
+ ```
28
+
29
+ ## TDD Rules Enforced by `validate --strict-tdd`
30
+
31
+ | Rule | Check | Gate |
32
+ |------|-------|------|
33
+ | **TDD-1** | Every `AC-*` has at least one `CDT-*` linking it | Pre-merge |
34
+ | **TDD-2** | No `Test Artifact = TBD` when Status ≥ `In Dev` | Pre-merge |
35
+ | **TDD-3** | Every requirement has a traceability row | Pre-merge |
36
+ | **TDD-4** | No duplicate scenario/contract IDs | Pre-merge |
37
+ | **TDD-5** | Breaking-change rules documented for every `AC-*` | Pre-merge |
38
+ | **TDD-6** | Schema files referenced by `schema_ref` must exist on disk | Pre-merge |
39
+
40
+ ## Contract Test Workflow
41
+
42
+ ### Consumer side
43
+
44
+ 1. Write a failing Pact test describing the expected HTTP interaction.
45
+ 2. Run the Pact test — it generates `contracts/pacts/{{CONSUMER_SERVICE}}-{{PROVIDER_SERVICE}}.json`.
46
+ 3. Commit the Pact file alongside the consumer feature.
47
+ 4. Open a PR — CI runs `validate --strict-tdd` to confirm the Pact file is registered.
48
+
49
+ ### Provider side
50
+
51
+ 1. Pull the latest Pact file from the repository (or Pact Broker if configured).
52
+ 2. Run provider verification: `pact-provider-verifier` or the framework-native equivalent.
53
+ 3. Only after verification passes may the provider merge a change that touches a contracted endpoint.
54
+
55
+ ## Schema Validation
56
+
57
+ OpenAPI files are validated on every CI run:
58
+
59
+ ```bash
60
+ npx @redocly/cli lint contracts/openapi/provider-v1.yaml
61
+ ```
62
+
63
+ AsyncAPI files:
64
+
65
+ ```bash
66
+ npx @asyncapi/cli validate contracts/asyncapi/provider-events-v1.yaml
67
+ ```
68
+
69
+ These commands run in the `contract-lint` CI step before any contract tests.
70
+
71
+ ## Breaking-Change Detection
72
+
73
+ Before merging any change to a `contracts/` schema file:
74
+
75
+ 1. Run `oasdiff breaking contracts/openapi/provider-v1.yaml contracts/openapi/provider-v1-proposed.yaml`.
76
+ 2. If any breaking change is detected, increment the major version and update `pack.yaml`.
77
+ 3. Maintain the old version for consumers still pinned to it.
78
+
79
+ ## Coverage Requirements
80
+
81
+ | Metric | Threshold |
82
+ |--------|-----------|
83
+ | Pact interactions per endpoint | ≥ 1 happy path + ≥ 1 error path |
84
+ | Provider verification pass rate | 100% on main |
85
+ | Schema lint errors | 0 on main |
86
+ | Strict-TDD gate (`validate --strict-tdd`) | Must pass on every PR |
87
+
88
+ ## References
89
+
90
+ - API Contracts: `pack.yaml` → `api_contracts[]`
91
+ - Consumer-Driven Tests: `pack.yaml` → `consumer_driven_tests[]`
92
+ - Breaking-Change Rules: `pack.yaml` → `breaking_change_rules[]`
93
+ - AI Rules: `AI_RULES.md`
94
+ - Traceability: `docs/specs/contract-traceability.md`
@@ -0,0 +1,34 @@
1
+ # AI Rules - Frontend ({{PROJECT_NAME}})
2
+
3
+ ## Role
4
+ You are the Lead Frontend Engineer and UX owner. Implement strictly from `spec.md` and `features/`.
5
+
6
+ ## Project Initialization & Stack
7
+ - Project: {{PROJECT_NAME}} ({{PROJECT_SLUG}})
8
+ - Domain: {{DOMAIN}}
9
+ - Stack: {{STACK}}
10
+ - Architecture: {{ARCHITECTURE}}
11
+ - API integration: {{API_STYLE}}
12
+ - Testing: {{TESTING}}
13
+
14
+ ## Stack Rules
15
+ - Do not infer or replace the stack from preference or prior projects.
16
+ - If any stack field is `TBD`, stop implementation and update `AI_RULES.md` or `spec.md` with the Product Owner first.
17
+
18
+ ## Non-Negotiables
19
+ - Componentization and reusability by default.
20
+ - Responsive behavior as acceptance criteria.
21
+ - No implementation without a traceability entry.
22
+
23
+ ## Domain Modeling Rules
24
+ {{ARCHITECTURE_MODELING_RULES}}
25
+
26
+ ## Pre-Implementation Gates
27
+ {{ARCHITECTURE_GATES}}
28
+
29
+ ## Workflow
30
+ 1. Read `spec.md`.
31
+ {{ARCHITECTURE_READS}}
32
+ 3. Read scenarios in `features/`.
33
+ 4. Update `docs/specs/traceability.md`.
34
+ 5. Build UI until acceptance criteria pass.
@@ -0,0 +1,6 @@
1
+ Feature: Frontend baseline availability
2
+ @REQ-000 @SCN-000
3
+ Scenario: Main entry page is reachable
4
+ Given the web application is running
5
+ When I navigate to the "/" route
6
+ Then I should see the main application shell
@@ -0,0 +1,74 @@
1
+ # Generated by `specgate harness init`
2
+ #
3
+ # Per-project defaults for `specgate harness run`. Every key is optional, and any
4
+ # CLI flag overrides what is written here.
5
+ harness_version: 1
6
+
7
+ # The agent invocation. `{prompt_file}` is replaced with the path to the
8
+ # generated per-requirement prompt.
9
+ #
10
+ # Left commented out on purpose: which agent runs this is your choice and your
11
+ # credentials, and a default committed here is a default somebody pays for by
12
+ # accident. Pass it explicitly the first few times:
13
+ #
14
+ # specgate harness run --req REQ-001 --agent "claude -p < {prompt_file}"
15
+ #
16
+ # Then uncomment the line you settled on.
17
+ #
18
+ # agent: "claude -p < {prompt_file}"
19
+ # agent: "cursor-agent -p < {prompt_file}"
20
+ # agent: "aider --yes --message-file {prompt_file}"
21
+
22
+ # Or name a profile from .harness/profiles.yaml, so the team commits the
23
+ # commands it uses and each environment picks one:
24
+ #
25
+ # agent_profile: local-claude
26
+ #
27
+ # # .harness/profiles.yaml
28
+ # profiles_version: 1
29
+ # profiles:
30
+ # local-claude:
31
+ # agent: "claude -p < {prompt_file}"
32
+ # ci:
33
+ # agent: "aider --yes --message-file {prompt_file}"
34
+ #
35
+ # An explicit `agent:` wins over a profile.
36
+
37
+ # An *additional* gate, on top of the `validate --strict-tdd` the harness always
38
+ # runs. Left commented out when no build file gave it away — an unset key is
39
+ # safe, whereas a placeholder that exits 0 would be a gate that always passes.
40
+ #
41
+ # Three placeholders are substituted per requirement, so the gate can run the
42
+ # scenario belonging to the requirement under test:
43
+ #
44
+ # {req} REQ-007
45
+ # {scenario} SCN-007
46
+ # {feature_file} features/billing/refund.feature
47
+ #
48
+ # Worth using. The gate runs before `specgate done`, so the requirement is still
49
+ # Draft and `validate --strict-tdd` does not yet demand its test — without one
50
+ # of these, a requirement can be marked Implemented with its scenario never run:
51
+ #
52
+ # test_cmd: "npm run verify && npm run test:e2e -- {feature_file}"
53
+ #
54
+ # The harness runs each requirement in a fresh git worktree, which contains only
55
+ # what git tracks — so there is no node_modules. Install first if your gate
56
+ # needs one, or the agent will spend its attempt doing it:
57
+ #
58
+ # test_cmd: "npm ci && npm run verify && npm run test:e2e -- {feature_file}"
59
+ {{TEST_CMD_LINE}}
60
+
61
+ # Retries per requirement, each one fed the previous failure. Past three, the
62
+ # loop is usually stuck on something a human needs to read.
63
+ max_attempts: 3
64
+
65
+ # Universal directives — Role, Active Project Boundary, Execution Policy —
66
+ # prepended to every per-requirement prompt. Use `prompt_prefix` for a
67
+ # one-liner; the file form exists because the realistic version is multi-line.
68
+ prompt_prefix_file: ./.harness/prompt-prefix.md
69
+
70
+ # CI mode: push each green branch and open a PR, leaving review to a human.
71
+ # The harness never merges.
72
+ # push: true
73
+ # remote: origin
74
+ # pr_cmd: "gh pr create --head {branch} --title '{req} via harness' --fill"
@@ -0,0 +1,60 @@
1
+ <!-- Generated by `specgate harness init`. Edit freely — this is
2
+ your project's voice, and the harness prepends it verbatim to every
3
+ per-requirement prompt. -->
4
+
5
+ # Role
6
+
7
+ You are a senior engineer implementing **one requirement** of {{PROJECT_NAME}}.
8
+
9
+ The specification is not a suggestion. Every requirement already has a
10
+ scenario, a use case and a place in the traceability matrix, written before
11
+ any code existed. Your job is to satisfy the scenario, not to redesign the
12
+ domain.
13
+
14
+ # Active project boundary
15
+
16
+ **Do not edit these.** They are the specification, and several are regenerated
17
+ from a domain pack:
18
+
19
+ - `features/**/*.feature` — the Gherkin scenarios. If a scenario looks wrong,
20
+ stop and say so in your final message. Editing a scenario so your code
21
+ passes is the one failure mode that makes this whole exercise worthless.
22
+ - `docs/specs/**` — spec.md, the traceability matrix, domain model, use cases,
23
+ commands, events, aggregates, ADRs. `specgate done` updates the matrix; you do
24
+ not.
25
+ - `AI_RULES.md`, `spec.md`, `.specops.lock`, `.specops/**`.
26
+
27
+ **Do edit these:**
28
+
29
+ - the implementation source tree.
30
+ - the tests.
31
+ - `features/step_definitions/**` and `features/support/**` — step definitions
32
+ are code, not specification. This is the one place inside `features/` you
33
+ own.
34
+
35
+ # Execution policy
36
+
37
+ 1. Read the requirement and its scenario under `features/` before writing
38
+ anything.
39
+ 2. Write or extend the step definitions so the scenario fails **for the right
40
+ reason** — a missing implementation, not a typo in a step.
41
+ 3. Implement the smallest thing that makes it pass. Unit-test the pure parts:
42
+ the scenario proves the wiring, the unit tests pin the rules.
43
+ 4. Run the gate before declaring done:
44
+
45
+ ```bash
46
+ {{GATE_COMMAND}}
47
+ ```
48
+
49
+ 5. Do not invent requirements. If the scenario does not ask for it, it is not
50
+ in scope, however obviously useful it seems.
51
+
52
+ # Definition of done
53
+
54
+ - The scenario for this requirement passes.
55
+ - The gate command above is green.
56
+ - You have not touched `features/**/*.feature` or `docs/specs/**`.
57
+
58
+ If you cannot meet the definition of done, say precisely which part failed and
59
+ why. A clear report of a blocked requirement is worth more than a green run
60
+ that skipped the scenario.