@devtrack-solution/codesdd 1.2.2 → 1.2.4-rc3

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 (413) hide show
  1. package/.sdd/skills/curated/api-clean-flask-langgraph/SKILL.md +17 -17
  2. package/.sdd/skills/curated/devtrack-api/SKILL.md +170 -31
  3. package/.sdd/skills/curated/devtrack-api/agents/claude-code.yaml +8 -0
  4. package/.sdd/skills/curated/devtrack-api/agents/codex.yaml +8 -0
  5. package/.sdd/skills/curated/devtrack-api/agents/cursor.yaml +8 -0
  6. package/.sdd/skills/curated/devtrack-api/agents/gemini.yaml +8 -0
  7. package/.sdd/skills/curated/devtrack-api/agents/kimi.yaml +8 -0
  8. package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +4 -2
  9. package/.sdd/skills/curated/devtrack-api/agents/opencode.yaml +10 -0
  10. package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +2 -2
  11. package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +8 -7
  12. package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +93 -0
  13. package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +372 -0
  14. package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +13 -13
  15. package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +95 -0
  16. package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +294 -0
  17. package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +5 -5
  18. package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +4 -0
  19. package/.sdd/skills/curated/devtrack-api/references/portable-agent-contract.md +41 -0
  20. package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +2 -2
  21. package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +7 -9
  22. package/LICENSE +1 -1
  23. package/README.md +399 -53
  24. package/bin/codesdd.js +3 -2
  25. package/dist/applications/sdd/index.d.ts +16 -0
  26. package/dist/applications/sdd/index.js +16 -0
  27. package/dist/cli/index.d.ts +2 -2
  28. package/dist/cli/index.js +11 -558
  29. package/dist/cli/program.d.ts +14 -0
  30. package/dist/cli/program.js +645 -0
  31. package/dist/commands/change.js +5 -5
  32. package/dist/commands/completion.d.ts +1 -1
  33. package/dist/commands/completion.js +9 -2
  34. package/dist/commands/config.js +320 -20
  35. package/dist/commands/feedback.js +1 -1
  36. package/dist/commands/schema.d.ts +63 -0
  37. package/dist/commands/schema.js +12 -12
  38. package/dist/commands/sdd/backlog.d.ts +3 -0
  39. package/dist/commands/sdd/backlog.js +54 -0
  40. package/dist/commands/sdd/execution.js +489 -28
  41. package/dist/commands/sdd/plugin.d.ts +3 -0
  42. package/dist/commands/sdd/plugin.js +158 -0
  43. package/dist/commands/sdd/shared.d.ts +1 -0
  44. package/dist/commands/sdd/shared.js +11 -22
  45. package/dist/commands/sdd/skills.js +7 -0
  46. package/dist/commands/sdd.js +107 -15
  47. package/dist/commands/spec.js +9 -9
  48. package/dist/commands/validate.js +6 -6
  49. package/dist/commands/workflow/instructions.js +6 -6
  50. package/dist/commands/workflow/new-change.js +3 -3
  51. package/dist/commands/workflow/shared.d.ts +1 -1
  52. package/dist/commands/workflow/shared.js +4 -4
  53. package/dist/core/archive.js +15 -5
  54. package/dist/core/artifact-graph/instruction-loader.d.ts +1 -1
  55. package/dist/core/artifact-graph/instruction-loader.js +3 -3
  56. package/dist/core/artifact-graph/resolver.d.ts +4 -4
  57. package/dist/core/artifact-graph/resolver.js +6 -6
  58. package/dist/core/branding.js +3 -3
  59. package/dist/core/cli/command-matrix.js +19 -1
  60. package/dist/core/cli-command-quality.d.ts +27 -0
  61. package/dist/core/cli-command-quality.js +180 -0
  62. package/dist/core/command-generation/adapters/costrict.d.ts +1 -1
  63. package/dist/core/command-generation/adapters/costrict.js +2 -2
  64. package/dist/core/command-generation/types.d.ts +1 -1
  65. package/dist/core/completions/command-registry.d.ts +1 -1
  66. package/dist/core/completions/command-registry.js +200 -12
  67. package/dist/core/completions/completion-provider.d.ts +14 -1
  68. package/dist/core/completions/completion-provider.js +29 -1
  69. package/dist/core/completions/generators/bash-generator.d.ts +1 -1
  70. package/dist/core/completions/generators/bash-generator.js +20 -12
  71. package/dist/core/completions/generators/fish-generator.d.ts +9 -1
  72. package/dist/core/completions/generators/fish-generator.js +39 -25
  73. package/dist/core/completions/generators/powershell-generator.d.ts +1 -1
  74. package/dist/core/completions/generators/powershell-generator.js +21 -11
  75. package/dist/core/completions/generators/zsh-generator.d.ts +3 -6
  76. package/dist/core/completions/generators/zsh-generator.js +21 -42
  77. package/dist/core/completions/installers/bash-installer.js +6 -6
  78. package/dist/core/completions/installers/fish-installer.js +1 -1
  79. package/dist/core/completions/installers/powershell-installer.js +14 -14
  80. package/dist/core/completions/installers/zsh-installer.d.ts +7 -1
  81. package/dist/core/completions/installers/zsh-installer.js +36 -8
  82. package/dist/core/completions/templates/bash-templates.d.ts +1 -1
  83. package/dist/core/completions/templates/bash-templates.js +12 -6
  84. package/dist/core/completions/templates/fish-templates.d.ts +2 -2
  85. package/dist/core/completions/templates/fish-templates.js +20 -9
  86. package/dist/core/completions/templates/powershell-templates.d.ts +1 -1
  87. package/dist/core/completions/templates/powershell-templates.js +13 -4
  88. package/dist/core/completions/templates/zsh-templates.d.ts +1 -1
  89. package/dist/core/completions/templates/zsh-templates.js +18 -9
  90. package/dist/core/config-schema.d.ts +20 -1
  91. package/dist/core/config-schema.js +70 -2
  92. package/dist/core/config.d.ts +3 -3
  93. package/dist/core/config.js +4 -4
  94. package/dist/core/global-config.d.ts +57 -12
  95. package/dist/core/global-config.js +344 -27
  96. package/dist/core/index.d.ts +1 -1
  97. package/dist/core/index.js +2 -2
  98. package/dist/core/init.d.ts +6 -1
  99. package/dist/core/init.js +99 -77
  100. package/dist/core/legacy-cleanup.d.ts +17 -17
  101. package/dist/core/legacy-cleanup.js +96 -79
  102. package/dist/core/list.js +18 -4
  103. package/dist/core/migration.d.ts +3 -1
  104. package/dist/core/migration.js +7 -8
  105. package/dist/core/parsers/change-parser.js +1 -1
  106. package/dist/core/parsers/markdown-parser.js +2 -2
  107. package/dist/core/profile-sync-drift.d.ts +1 -1
  108. package/dist/core/profile-sync-drift.js +13 -13
  109. package/dist/core/project-config.d.ts +4 -4
  110. package/dist/core/project-config.js +11 -11
  111. package/dist/core/schemas/change.schema.d.ts +1 -1
  112. package/dist/core/schemas/change.schema.js +1 -1
  113. package/dist/core/schemas/spec.schema.d.ts +1 -1
  114. package/dist/core/schemas/spec.schema.js +1 -1
  115. package/dist/core/sdd/adr.js +23 -1
  116. package/dist/core/sdd/agent-binding.d.ts +346 -0
  117. package/dist/core/sdd/agent-binding.js +343 -0
  118. package/dist/core/sdd/agent-runtime-contract.d.ts +204 -0
  119. package/dist/core/sdd/agent-runtime-contract.js +200 -0
  120. package/dist/core/sdd/backlog-cli.d.ts +16 -0
  121. package/dist/core/sdd/backlog-cli.js +146 -0
  122. package/dist/core/sdd/backlog-conflict-policy.d.ts +58 -0
  123. package/dist/core/sdd/backlog-conflict-policy.js +230 -0
  124. package/dist/core/sdd/backlog-projection.d.ts +8 -0
  125. package/dist/core/sdd/backlog-projection.js +89 -0
  126. package/dist/core/sdd/backlog-provider-contract.d.ts +252 -0
  127. package/dist/core/sdd/backlog-provider-contract.js +158 -0
  128. package/dist/core/sdd/bootstrap.js +2 -2
  129. package/dist/core/sdd/check.d.ts +44 -0
  130. package/dist/core/sdd/check.js +62 -24
  131. package/dist/core/sdd/contract.d.ts +13 -0
  132. package/dist/core/sdd/contract.js +36 -0
  133. package/dist/core/sdd/coordination/coordination-adapters.d.ts +53 -8
  134. package/dist/core/sdd/coordination/coordination-adapters.js +182 -16
  135. package/dist/core/sdd/coordination/index.d.ts +1 -0
  136. package/dist/core/sdd/coordination/index.js +1 -0
  137. package/dist/core/sdd/coordination/redis-runtime.d.ts +131 -0
  138. package/dist/core/sdd/coordination/redis-runtime.js +698 -0
  139. package/dist/core/sdd/deepagent-contracts.d.ts +370 -0
  140. package/dist/core/sdd/deepagent-contracts.js +235 -0
  141. package/dist/core/sdd/deepagents/adr-governor.d.ts +2 -0
  142. package/dist/core/sdd/deepagents/adr-governor.js +30 -0
  143. package/dist/core/sdd/deepagents/backend.d.ts +63 -0
  144. package/dist/core/sdd/deepagents/backend.js +174 -0
  145. package/dist/core/sdd/deepagents/codesdd-tools.d.ts +39 -0
  146. package/dist/core/sdd/deepagents/codesdd-tools.js +83 -0
  147. package/dist/core/sdd/deepagents/evidence-mapper.d.ts +86 -0
  148. package/dist/core/sdd/deepagents/evidence-mapper.js +178 -0
  149. package/dist/core/sdd/deepagents/model-provider.d.ts +53 -0
  150. package/dist/core/sdd/deepagents/model-provider.js +379 -0
  151. package/dist/core/sdd/deepagents/policy-enforcement.d.ts +30 -0
  152. package/dist/core/sdd/deepagents/policy-enforcement.js +90 -0
  153. package/dist/core/sdd/deepagents/policy.d.ts +75 -0
  154. package/dist/core/sdd/deepagents/policy.js +358 -0
  155. package/dist/core/sdd/deepagents/quality-witness.d.ts +3 -0
  156. package/dist/core/sdd/deepagents/quality-witness.js +77 -0
  157. package/dist/core/sdd/deepagents/reversa-subagents.d.ts +75 -0
  158. package/dist/core/sdd/deepagents/reversa-subagents.js +182 -0
  159. package/dist/core/sdd/deepagents/runtime-factory.d.ts +90 -0
  160. package/dist/core/sdd/deepagents/runtime-factory.js +231 -0
  161. package/dist/core/sdd/deepagents/runtime-loader.d.ts +16 -0
  162. package/dist/core/sdd/deepagents/runtime-loader.js +65 -0
  163. package/dist/core/sdd/default-bootstrap-files.d.ts +3 -3
  164. package/dist/core/sdd/default-bootstrap-files.js +50 -10
  165. package/dist/core/sdd/default-skills.d.ts +30 -0
  166. package/dist/core/sdd/default-skills.js +288 -8
  167. package/dist/core/sdd/devtrack-api-appliance.d.ts +91 -0
  168. package/dist/core/sdd/devtrack-api-appliance.js +280 -0
  169. package/dist/core/sdd/devtrack-api-architecture.d.ts +31 -0
  170. package/dist/core/sdd/devtrack-api-architecture.js +608 -0
  171. package/dist/core/sdd/devtrack-api-import-boundary.d.ts +19 -0
  172. package/dist/core/sdd/devtrack-api-import-boundary.js +32 -0
  173. package/dist/core/sdd/diagnose.d.ts +59 -0
  174. package/dist/core/sdd/diagnose.js +37 -37
  175. package/dist/core/sdd/docs-sync.js +54 -20
  176. package/dist/core/sdd/domain/capability-diff.d.ts +63 -0
  177. package/dist/core/sdd/domain/capability-diff.js +200 -0
  178. package/dist/core/sdd/domain/change-safety-guardrails.d.ts +74 -0
  179. package/dist/core/sdd/domain/change-safety-guardrails.js +333 -0
  180. package/dist/core/sdd/domain/post-active-validation.d.ts +7 -0
  181. package/dist/core/sdd/domain/post-active-validation.js +61 -0
  182. package/dist/core/sdd/domain/semantic-intent-classifier.d.ts +29 -0
  183. package/dist/core/sdd/domain/semantic-intent-classifier.js +117 -0
  184. package/dist/core/sdd/domain/transition-engine.js +1 -0
  185. package/dist/core/sdd/entity-reference.d.ts +5 -0
  186. package/dist/core/sdd/entity-reference.js +22 -0
  187. package/dist/core/sdd/foundation-artifact-map-validator.d.ts +16 -0
  188. package/dist/core/sdd/foundation-artifact-map-validator.js +71 -0
  189. package/dist/core/sdd/foundation-layer-manifest.d.ts +24 -0
  190. package/dist/core/sdd/foundation-layer-manifest.js +117 -0
  191. package/dist/core/sdd/governance-backfill.d.ts +31 -0
  192. package/dist/core/sdd/governance-backfill.js +359 -0
  193. package/dist/core/sdd/governance-parser.d.ts +21 -0
  194. package/dist/core/sdd/governance-parser.js +91 -0
  195. package/dist/core/sdd/governance-schemas.d.ts +245 -0
  196. package/dist/core/sdd/governance-schemas.js +143 -0
  197. package/dist/core/sdd/{import-openspec.d.ts → import-legacy-spec.d.ts} +7 -7
  198. package/dist/core/sdd/{import-openspec.js → import-legacy-spec.js} +21 -29
  199. package/dist/core/sdd/init.d.ts +3 -0
  200. package/dist/core/sdd/init.js +6 -3
  201. package/dist/core/sdd/intent-guard.d.ts +22 -0
  202. package/dist/core/sdd/intent-guard.js +67 -0
  203. package/dist/core/sdd/json-schema.js +108 -6
  204. package/dist/core/sdd/knowledge-graph.d.ts +45 -0
  205. package/dist/core/sdd/knowledge-graph.js +288 -0
  206. package/dist/core/sdd/legacy-operations.js +507 -44
  207. package/dist/core/sdd/lenses.d.ts +1 -0
  208. package/dist/core/sdd/lenses.js +29 -1
  209. package/dist/core/sdd/migrate-workspace.js +95 -2
  210. package/dist/core/sdd/migrate.d.ts +1 -1
  211. package/dist/core/sdd/migrate.js +36 -2
  212. package/dist/core/sdd/package-security-gates.d.ts +21 -0
  213. package/dist/core/sdd/package-security-gates.js +119 -0
  214. package/dist/core/sdd/package-structure-gate.d.ts +83 -0
  215. package/dist/core/sdd/package-structure-gate.js +357 -0
  216. package/dist/core/sdd/parallel-feat-automation.d.ts +330 -0
  217. package/dist/core/sdd/parallel-feat-automation.js +424 -0
  218. package/dist/core/sdd/plugin-broker.d.ts +777 -0
  219. package/dist/core/sdd/plugin-broker.js +492 -0
  220. package/dist/core/sdd/plugin-certification.d.ts +79 -0
  221. package/dist/core/sdd/plugin-certification.js +453 -0
  222. package/dist/core/sdd/plugin-cli.d.ts +139 -0
  223. package/dist/core/sdd/plugin-cli.js +265 -0
  224. package/dist/core/sdd/plugin-evidence.d.ts +348 -0
  225. package/dist/core/sdd/plugin-evidence.js +307 -0
  226. package/dist/core/sdd/plugin-manifest.d.ts +232 -0
  227. package/dist/core/sdd/plugin-manifest.js +225 -0
  228. package/dist/core/sdd/plugin-policy-pack.d.ts +88 -0
  229. package/dist/core/sdd/plugin-policy-pack.js +236 -0
  230. package/dist/core/sdd/plugin-policy.d.ts +68 -0
  231. package/dist/core/sdd/plugin-policy.js +212 -0
  232. package/dist/core/sdd/plugin-registry.d.ts +447 -0
  233. package/dist/core/sdd/plugin-registry.js +138 -0
  234. package/dist/core/sdd/plugin-sdk-contract.d.ts +363 -0
  235. package/dist/core/sdd/plugin-sdk-contract.js +268 -0
  236. package/dist/core/sdd/plugin-skill-binding.d.ts +151 -0
  237. package/dist/core/sdd/plugin-skill-binding.js +339 -0
  238. package/dist/core/sdd/quality-artifact-manifest-validator.d.ts +28 -0
  239. package/dist/core/sdd/quality-artifact-manifest-validator.js +167 -0
  240. package/dist/core/sdd/quality-evidence-renderer.d.ts +65 -0
  241. package/dist/core/sdd/quality-evidence-renderer.js +218 -0
  242. package/dist/core/sdd/quality-scenario-runner.d.ts +42 -0
  243. package/dist/core/sdd/quality-scenario-runner.js +613 -0
  244. package/dist/core/sdd/quality-validation.d.ts +620 -0
  245. package/dist/core/sdd/quality-validation.js +239 -0
  246. package/dist/core/sdd/release-readiness.d.ts +19 -0
  247. package/dist/core/sdd/release-readiness.js +472 -0
  248. package/dist/core/sdd/resolve-project-root.d.ts +2 -2
  249. package/dist/core/sdd/resolve-project-root.js +11 -5
  250. package/dist/core/sdd/runtime-boundary-contract.d.ts +45 -0
  251. package/dist/core/sdd/runtime-boundary-contract.js +90 -0
  252. package/dist/core/sdd/sanitize.d.ts +30 -1
  253. package/dist/core/sdd/sanitize.js +23 -23
  254. package/dist/core/sdd/sdk-agent-plugin-quality-gates.d.ts +150 -0
  255. package/dist/core/sdd/sdk-agent-plugin-quality-gates.js +258 -0
  256. package/dist/core/sdd/services/agent-run.service.d.ts +97 -0
  257. package/dist/core/sdd/services/agent-run.service.js +261 -0
  258. package/dist/core/sdd/services/breakdown.service.js +2 -1
  259. package/dist/core/sdd/services/capability-diff.service.d.ts +18 -0
  260. package/dist/core/sdd/services/capability-diff.service.js +26 -0
  261. package/dist/core/sdd/services/change-safety-preflight.service.d.ts +17 -0
  262. package/dist/core/sdd/services/change-safety-preflight.service.js +17 -0
  263. package/dist/core/sdd/services/context.service.d.ts +43 -340
  264. package/dist/core/sdd/services/context.service.js +341 -25
  265. package/dist/core/sdd/services/debate.service.js +15 -2
  266. package/dist/core/sdd/services/feature-lint.service.d.ts +22 -0
  267. package/dist/core/sdd/services/feature-lint.service.js +105 -5
  268. package/dist/core/sdd/services/finalize.service.d.ts +105 -0
  269. package/dist/core/sdd/services/finalize.service.js +499 -38
  270. package/dist/core/sdd/services/frontend-gap.service.js +22 -7
  271. package/dist/core/sdd/services/frontend-impact.service.d.ts +1 -1
  272. package/dist/core/sdd/services/governance-control-plane-runtime-adapters.d.ts +17 -0
  273. package/dist/core/sdd/services/governance-control-plane-runtime-adapters.js +38 -0
  274. package/dist/core/sdd/services/governance-control-plane.service.d.ts +66 -0
  275. package/dist/core/sdd/services/governance-control-plane.service.js +134 -0
  276. package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
  277. package/dist/core/sdd/services/legacy-capability.service.d.ts +10 -7
  278. package/dist/core/sdd/services/legacy-capability.service.js +38 -21
  279. package/dist/core/sdd/services/mcp-runtime.service.d.ts +123 -8
  280. package/dist/core/sdd/services/mcp-runtime.service.js +1085 -33
  281. package/dist/core/sdd/services/onboard.service.js +2 -1
  282. package/dist/core/sdd/services/rebuild.service.js +6 -1
  283. package/dist/core/sdd/services/semantic-intent-classifier.service.d.ts +6 -0
  284. package/dist/core/sdd/services/semantic-intent-classifier.service.js +7 -0
  285. package/dist/core/sdd/services/skills-sync.service.d.ts +17 -5
  286. package/dist/core/sdd/services/skills-sync.service.js +55 -2
  287. package/dist/core/sdd/services/start.service.js +6 -4
  288. package/dist/core/sdd/skill-bundles-curation-schema.d.ts +66 -0
  289. package/dist/core/sdd/skill-bundles-curation-schema.js +52 -0
  290. package/dist/core/sdd/skill-evidence.d.ts +19 -0
  291. package/dist/core/sdd/skill-evidence.js +38 -0
  292. package/dist/core/sdd/skill-policy-pool.d.ts +46 -0
  293. package/dist/core/sdd/skill-policy-pool.js +185 -0
  294. package/dist/core/sdd/state.d.ts +23 -0
  295. package/dist/core/sdd/state.js +313 -66
  296. package/dist/core/sdd/store/sdd-stores.js +2 -2
  297. package/dist/core/sdd/structural-health.d.ts +55 -55
  298. package/dist/core/sdd/types.d.ts +60 -19
  299. package/dist/core/sdd/types.js +21 -0
  300. package/dist/core/sdd/upgrade-to-codesdd.d.ts +45 -0
  301. package/dist/core/sdd/upgrade-to-codesdd.js +179 -0
  302. package/dist/core/sdd/views.js +17 -0
  303. package/dist/core/sdd/workspace-schemas.d.ts +670 -19
  304. package/dist/core/sdd/workspace-schemas.js +285 -5
  305. package/dist/core/sdd/write-manifest.js +22 -4
  306. package/dist/core/shared/skill-generation.d.ts +1 -1
  307. package/dist/core/shared/skill-generation.js +15 -15
  308. package/dist/core/shared/tool-detection.d.ts +3 -3
  309. package/dist/core/shared/tool-detection.js +14 -14
  310. package/dist/core/specs-apply.js +6 -6
  311. package/dist/core/templates/index.d.ts +1 -1
  312. package/dist/core/templates/index.js +1 -1
  313. package/dist/core/templates/workflows/apply-change.js +14 -14
  314. package/dist/core/templates/workflows/archive-change.js +32 -32
  315. package/dist/core/templates/workflows/bulk-archive-change.js +25 -25
  316. package/dist/core/templates/workflows/continue-change.js +12 -12
  317. package/dist/core/templates/workflows/explore.js +29 -29
  318. package/dist/core/templates/workflows/feedback.js +6 -6
  319. package/dist/core/templates/workflows/ff-change.js +24 -24
  320. package/dist/core/templates/workflows/new-change.js +20 -20
  321. package/dist/core/templates/workflows/onboard.js +33 -33
  322. package/dist/core/templates/workflows/propose.js +23 -23
  323. package/dist/core/templates/workflows/sdd.js +8 -8
  324. package/dist/core/templates/workflows/sync-specs.js +19 -19
  325. package/dist/core/templates/workflows/verify-change.js +17 -17
  326. package/dist/core/update.d.ts +2 -2
  327. package/dist/core/update.js +16 -15
  328. package/dist/core/validation/constants.d.ts +1 -1
  329. package/dist/core/validation/constants.js +1 -1
  330. package/dist/core/view.js +11 -11
  331. package/dist/domains/sdd/index.d.ts +6 -0
  332. package/dist/domains/sdd/index.js +6 -0
  333. package/dist/infrastructures/sdd/index.d.ts +7 -0
  334. package/dist/infrastructures/sdd/index.js +6 -0
  335. package/dist/presentations/cli/sdd/index.d.ts +3 -0
  336. package/dist/presentations/cli/sdd/index.js +3 -0
  337. package/dist/shared/sdd/index.d.ts +3 -0
  338. package/dist/shared/sdd/index.js +2 -0
  339. package/dist/telemetry/config.d.ts +2 -1
  340. package/dist/telemetry/config.js +17 -8
  341. package/dist/telemetry/index.d.ts +10 -2
  342. package/dist/telemetry/index.js +40 -7
  343. package/dist/ui/ascii-patterns.d.ts +2 -2
  344. package/dist/ui/ascii-patterns.js +2 -2
  345. package/dist/ui/welcome-screen.js +2 -2
  346. package/dist/utils/change-metadata.d.ts +4 -4
  347. package/dist/utils/change-metadata.js +6 -6
  348. package/dist/utils/change-utils.d.ts +3 -3
  349. package/dist/utils/change-utils.js +5 -5
  350. package/dist/utils/file-system.js +1 -1
  351. package/dist/utils/interactive.js +1 -1
  352. package/dist/utils/item-discovery.js +4 -4
  353. package/dist/utils/legacy-spec-compat.d.ts +2 -0
  354. package/dist/utils/legacy-spec-compat.js +2 -0
  355. package/dist/utils/shell-detection.d.ts +1 -0
  356. package/dist/utils/shell-detection.js +16 -0
  357. package/package.json +34 -21
  358. package/schemas/sdd/1-spec.schema.json +1 -1
  359. package/schemas/sdd/2-plan.schema.json +280 -3
  360. package/schemas/sdd/3-tasks.schema.json +73 -1
  361. package/schemas/sdd/4-changelog.schema.json +1 -1
  362. package/schemas/sdd/5-quality.schema.json +701 -5
  363. package/schemas/sdd/adr.schema.json +148 -0
  364. package/schemas/sdd/agent-binding-adapter.schema.json +210 -0
  365. package/schemas/sdd/agent-binding-resolution.schema.json +338 -0
  366. package/schemas/sdd/agent-runtime-command-plan.schema.json +212 -0
  367. package/schemas/sdd/agent-runtime-opencode-run-evidence.schema.json +270 -0
  368. package/schemas/sdd/backlog-projection-plan.schema.json +180 -0
  369. package/schemas/sdd/backlog-provider-contract.schema.json +260 -0
  370. package/schemas/sdd/codesdd-plugin.schema.json +645 -0
  371. package/schemas/sdd/debate.schema.json +244 -0
  372. package/schemas/sdd/deepagent-decision-evidence.schema.json +58 -0
  373. package/schemas/sdd/deepagent-env-contract.schema.json +143 -0
  374. package/schemas/sdd/deepagent-quality-evidence.schema.json +108 -0
  375. package/schemas/sdd/deepagent-run-evidence.schema.json +192 -0
  376. package/schemas/sdd/deepagent-run-plan.schema.json +197 -0
  377. package/schemas/sdd/deepagent-run-request.schema.json +637 -0
  378. package/schemas/sdd/deepagent-subagent-evidence.schema.json +110 -0
  379. package/schemas/sdd/deepagent-tool-call-evidence.schema.json +78 -0
  380. package/schemas/sdd/discarded.schema.json +127 -0
  381. package/schemas/sdd/epic.schema.json +147 -0
  382. package/schemas/sdd/insight.schema.json +136 -0
  383. package/schemas/sdd/parallel-feat-automation-plan.schema.json +304 -0
  384. package/schemas/sdd/parallel-feat-automation-request.schema.json +109 -0
  385. package/schemas/sdd/parallel-feat-scheduler-request.schema.json +116 -0
  386. package/schemas/sdd/parallel-feat-scheduler-result.schema.json +404 -0
  387. package/schemas/sdd/plugin-artifact-manifest.schema.json +259 -0
  388. package/schemas/sdd/plugin-artifact-map.schema.json +223 -0
  389. package/schemas/sdd/plugin-compliance-index.schema.json +136 -0
  390. package/schemas/sdd/plugin-dry-run-plan.schema.json +260 -0
  391. package/schemas/sdd/plugin-evidence-manifest.schema.json +678 -0
  392. package/schemas/sdd/plugin-language-runtime.schema.json +103 -0
  393. package/schemas/sdd/plugin-package-governance.schema.json +74 -0
  394. package/schemas/sdd/plugin-policy-evaluation.schema.json +92 -0
  395. package/schemas/sdd/plugin-policy-pack-evaluation.schema.json +94 -0
  396. package/schemas/sdd/plugin-policy-pack.schema.json +196 -0
  397. package/schemas/sdd/plugin-registry.schema.json +729 -0
  398. package/schemas/sdd/plugin-rollback-manifest.schema.json +87 -0
  399. package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +954 -0
  400. package/schemas/sdd/plugin-skill-binding-resolution.schema.json +305 -0
  401. package/schemas/sdd/plugin-skill-binding.schema.json +88 -0
  402. package/schemas/sdd/plugin-validation-manifest.schema.json +123 -0
  403. package/schemas/sdd/quality-architecture-schema.schema.json +216 -0
  404. package/schemas/sdd/quality-evidence-bundle.schema.json +1337 -0
  405. package/schemas/sdd/quality-run.schema.json +197 -0
  406. package/schemas/sdd/quality-scenario.schema.json +252 -0
  407. package/schemas/sdd/sdk-agent-plugin-quality-gate-input.schema.json +168 -0
  408. package/schemas/sdd/sdk-agent-plugin-quality-gate-report.schema.json +160 -0
  409. package/schemas/sdd/workspace-catalog.schema.json +13232 -35
  410. package/schemas/spec-driven/schema.yaml +4 -4
  411. package/schemas/spec-driven/templates/proposal.md +1 -1
  412. package/dist/utils/openspec-compat.d.ts +0 -2
  413. package/dist/utils/openspec-compat.js +0 -2
@@ -0,0 +1,294 @@
1
+ # Foundation Layout — Canonical Ground Truth
2
+
3
+ This reference is the **authoritative physical layout** of `devtrack-foundation-api`. It is the ground truth that every implementation plan, debate, ADR, and code change for the Foundation or any derived API must respect. The skill's "Canonical Paths" and "Forbidden Patterns" sections in `SKILL.md` are summaries of this document; when they conflict (they should not), this document wins.
4
+
5
+ This is not a style guide. It is an inventory of what Foundation actually does, derived from `/Volumes/WORKSPACE/DEVTRACK_TOOLS/devtrack-foundation-api/src/`. When you propose a path that diverges from this layout, you are proposing to fork the contract — which requires an explicit ADR, not a guess.
6
+
7
+ ## How To Use This Reference
8
+
9
+ - Load it before producing **any** debate, plan, or code change that introduces new files.
10
+ - For every proposed path, perform a literal lookup in the tables below. If the pattern is not present, the path is forbidden.
11
+ - For every new domain context, decide BO-pattern vs. entity-pattern using the rule in section 2 before drafting the plan.
12
+ - For every ADR that introduces a deliberate divergence from this layout, record the deviation, the justification, and the migration path back to the canonical layout (if any).
13
+
14
+ ## 1. Top-Level Tree
15
+
16
+ ```text
17
+ src/
18
+ ├── application/
19
+ │ └── business/<context>/
20
+ ├── domain/
21
+ │ ├── <context>/ (per business context)
22
+ │ └── ...
23
+ ├── infrastructure/
24
+ │ ├── adapters/<subsystem>/ (centralized by subsystem)
25
+ │ ├── settings/
26
+ │ └── infrastructure.module.ts
27
+ ├── presentation/
28
+ │ └── <transport>/<context>/ (transport before context)
29
+ ├── shared/
30
+ │ ├── domain/
31
+ │ ├── infrastructure/
32
+ │ ├── presentation/
33
+ │ └── agent/
34
+ ├── app.module.ts
35
+ ├── main.ts
36
+ └── schema.gql
37
+ ```
38
+
39
+ ## 2. Domain — Two Coexisting Patterns
40
+
41
+ Domain contexts use exactly one of two patterns. There is no third pattern. The choice is observable from the physical folder layout in `src/domain/<context>/`.
42
+
43
+ ### 2.1 BO-pattern (canonical default for new contexts)
44
+
45
+ Folders allowed:
46
+
47
+ ```text
48
+ src/domain/<context>/business-objects/<name>.bo.ts
49
+ src/domain/<context>/value-objects/<name>.vo.ts (optional, present only when context defines its own VOs)
50
+ src/domain/<context>/types/<name>.type.ts
51
+ src/domain/<context>/constants/<name>.const.ts (optional)
52
+ ```
53
+
54
+ Folders forbidden in BO-pattern:
55
+
56
+ - `entities/` — would conflate the pattern with legacy entity-pattern.
57
+ - `repository-ports/` — repository ports for BO-pattern live in **application** (`ports/out/`).
58
+ - `events/` — emit domain events from application use cases, not domain artifacts, when the context is BO-pattern. Foundation emits events from application handlers.
59
+ - `validators/` — present only in legacy entity-pattern; BO-pattern validates inside the BO (`validate()` method).
60
+
61
+ Contexts currently using BO-pattern in Foundation:
62
+
63
+ | Context | Path | Notes |
64
+ |---|---|---|
65
+ | `auth` | `src/domain/auth/` | `business-objects/auth-user.bo.ts`, `business-objects/api-keys.bo.ts`, `types/`. **No** `entities/`, **no** `repository-ports/`. |
66
+ | `files` | `src/domain/files/` | `business-objects/`, `types/`. |
67
+ | `integrations` | `src/domain/integrations/` | `business-objects/`, `types/`. |
68
+ | `intelligence` | `src/domain/intelligence/` | `business-objects/`, `value-objects/`, `types/`. The only BO-pattern context with its own `value-objects/`. **Status:** the domain folder is currently a BO/VO shell — the active intelligence runtime lives in `src/application/intelligence/*` (`conversation`, `course-agents`, `report-chat`) and does not import the domain shell. Keep the shell as an expansion-ready surface; do not delete, but do not assume runtime coupling. |
69
+ | `knowledge` | `src/domain/knowledge/` | `business-objects/`, `types/`. |
70
+ | `notifications` | `src/domain/notifications/` | `constants/`, `types/`. No BO yet, but follows BO-pattern shape. |
71
+
72
+ ### 2.2 Entity-pattern (legacy — extension only)
73
+
74
+ Folders allowed:
75
+
76
+ ```text
77
+ src/domain/<context>/entities/<name>.entity.ts
78
+ src/domain/<context>/repository-ports/<name>-repository.port.ts
79
+ src/domain/<context>/validators/<name>.validator.ts
80
+ src/domain/<context>/events/<name>-<event>.event.ts (optional)
81
+ src/domain/<context>/types/<name>.type.ts
82
+ ```
83
+
84
+ Contexts currently using entity-pattern in Foundation:
85
+
86
+ | Context | Path | Notes |
87
+ |---|---|---|
88
+ | `pessoas` | `src/domain/pessoas/` | Full entity-pattern: `entities/pessoa.entity.ts`, `repository-ports/pessoa-repository.port.ts`, `validators/`, `events/pessoa-created.event.ts`, `types/`. |
89
+ | `wallets` | `src/domain/wallets/` | `entities/wallet.entity.ts`, `repository-ports/wallet-repository.port.ts`, `validators/`, `types/`. No `events/`. |
90
+
91
+ The legacy set is closed. Do not add new contexts to it without an ADR.
92
+
93
+ ### 2.3 Application-only contexts (no domain counterpart)
94
+
95
+ Foundation also ships application contexts that legitimately have **no
96
+ `src/domain/<context>/` counterpart** because their work is composition,
97
+ adaptation, or coordination — not new business invariants. The currently
98
+ allowed application-only contexts are:
99
+
100
+ | Application path | Reason no domain |
101
+ |---|---|
102
+ | `src/application/business/aws-integrations/` | Orchestrates AWS adapter wiring across infrastructure subsystems; the invariants live in the AWS adapters themselves under `src/infrastructure/adapters/aws/*`. |
103
+ | `src/application/business/foundation/` | Composition root for Foundation-wide use-cases shared by other contexts; does not introduce its own bounded-context vocabulary. |
104
+
105
+ Adding a new application-only context is **not free**: it requires an ADR
106
+ that names the orchestration responsibility and explains why no domain
107
+ artifacts are introduced. The validator rule covering this case is
108
+ `DTAPI-P1-APPONLY-001` (see [contract-pack.yaml](contract-pack.yaml)).
109
+
110
+ ### 2.4 Decision Rule (summary)
111
+
112
+ - New domain context → BO-pattern. Always.
113
+ - Extending `pessoas` or `wallets` → entity-pattern. Match what is already there.
114
+ - New application context without domain artifacts → forbidden unless ADR-justified per `DTAPI-P1-APPONLY-001`.
115
+ - Anything else → forbidden until an ADR justifies the deviation.
116
+
117
+ ## 3. Shared Domain (Centralized Primitives)
118
+
119
+ `src/shared/domain/` holds primitives reused across contexts. Never duplicate these per-context.
120
+
121
+ ```text
122
+ src/shared/domain/exceptions/business-validation.exception.ts
123
+ src/shared/domain/exceptions/entity-not-found.exception.ts
124
+ src/shared/domain/exceptions/duplicate-entity.exception.ts
125
+ src/shared/domain/value-objects/email.vo.ts
126
+ src/shared/domain/value-objects/telefone.vo.ts
127
+ src/shared/domain/validators/...
128
+ src/shared/domain/types/...
129
+ src/shared/domain/generic-business-object.ts
130
+ src/shared/domain/generic.validator.ts
131
+ ```
132
+
133
+ The alias `@domain/*` resolves to **both** `src/domain/*` and `src/shared/domain/*` (tsconfig `paths`). That is why `import { BusinessValidationException } from '@domain/exceptions/business-validation.exception'` works even though the file physically lives under `src/shared/domain/exceptions/`. Do not interpret this as a license to create `src/domain/<context>/exceptions/` — the resolution is convenience, not permission.
134
+
135
+ **Domain exceptions are centralized in `src/shared/domain/exceptions/`. Period.** Context-specific exception names (`InvalidCredentialsException`, `TokenExpiredException`) belong nowhere in domain; if you need such precision, throw `BusinessValidationException` with a context-specific message payload, or model the failure as a return type from the use case.
136
+
137
+ ## 4. Application
138
+
139
+ ```text
140
+ src/application/business/<context>/use-cases/<verb-noun>.use-case.ts
141
+ src/application/business/<context>/ports/in/<verb-noun>.use-case.port.ts
142
+ src/application/business/<context>/ports/out/<name>.port.ts
143
+ src/application/business/<context>/ports/out/<name>-repository.port.ts (BO-pattern only)
144
+ src/application/business/<context>/services/<name>.service.ts
145
+ src/application/business/<context>/handlers/<name>.handler.ts
146
+ src/application/business/<context>/<context>.application.module.ts
147
+ ```
148
+
149
+ Repository ports for BO-pattern contexts live here, not in domain. Example: `src/application/business/auth/ports/out/user-repository.port.ts`, `api-key-repository.port.ts`, `role-repository.port.ts`.
150
+
151
+ Service ports (collaborator interfaces that are not repositories) also live in `ports/out/`. Example: `password-hash.service.port.ts`, `access-control.service.port.ts`, `api-key.service.port.ts`.
152
+
153
+ Use case ports (entry points to the application from presentation) live in `ports/in/`. One port per use case.
154
+
155
+ ### 4.1 Intelligence Modules
156
+
157
+ Foundation also has application-layer intelligence modules. They are canonical application modules, not an exception to the layer model.
158
+
159
+ ```text
160
+ src/application/intelligence/<context>/use-cases/<verb-noun>.use-case.ts
161
+ src/application/intelligence/<context>/ports/in/<verb-noun>.use-case.port.ts
162
+ src/application/intelligence/<context>/ports/out/<name>.port.ts
163
+ src/application/intelligence/<context>/services/<name>.service.ts
164
+ src/application/intelligence/<context>/handlers/<name>.handler.ts
165
+ src/application/intelligence/<context>/agents/<name>.agent.ts
166
+ src/application/intelligence/<context>/tools/<name>.tool.ts
167
+ src/application/intelligence/common/agent-runtime/<name>.ts
168
+ ```
169
+
170
+ Observed intelligence contexts in Foundation: `common`, `conversation`, `course-agents`, `report-chat`.
171
+
172
+ Provider-specific SDKs, credentials, retries, and transport details stay in infrastructure adapters. Intelligence application code owns provider-neutral ports, use cases, tool orchestration, and conversation semantics.
173
+
174
+ ## 5. Infrastructure (Centralized by Subsystem)
175
+
176
+ Infrastructure is segmented by **subsystem**, never by business context. A subsystem is a category of external concern (persistence, cache, queue, AWS, LLM, etc.), independent of which business contexts use it.
177
+
178
+ ```text
179
+ src/infrastructure/adapters/<subsystem>/<name>.adapter.ts
180
+ src/infrastructure/adapters/<subsystem>/<subsystem>.module.ts
181
+ ```
182
+
183
+ Observed subsystems in Foundation (closed set; new subsystems require ADR):
184
+
185
+ | Subsystem | Path | Purpose |
186
+ |---|---|---|
187
+ | `auth` | `src/infrastructure/adapters/auth/` | JWT, password hashing, API key signing. |
188
+ | `aws` | `src/infrastructure/adapters/aws/` | S3, Cognito, SES, SNS, SQS clients. |
189
+ | `cache` | `src/infrastructure/adapters/cache/` | Redis cache adapters. |
190
+ | `configuration` | `src/infrastructure/adapters/configuration/` | Settings loaders. |
191
+ | `http` | `src/infrastructure/adapters/http/` | Outbound HTTP clients. |
192
+ | `llm` | `src/infrastructure/adapters/llm/` | LLM provider adapters. |
193
+ | `orm` | `src/infrastructure/adapters/orm/` | TypeORM entities, repositories, mappers, migrations. |
194
+ | `queue` | `src/infrastructure/adapters/queue/` | Queue producers/consumers. |
195
+ | `redis` | `src/infrastructure/adapters/redis/` | Redis raw client. |
196
+ | `sync-engine` | `src/infrastructure/adapters/sync-engine/` | Sync orchestration adapter. |
197
+ | `temporal` | `src/infrastructure/adapters/temporal/` | Temporal workflow adapter. |
198
+ | `vector-store` | `src/infrastructure/adapters/vector-store/` | Vector DB adapters. |
199
+
200
+ ### 5.1 TypeORM (subsystem `orm`)
201
+
202
+ Fixed sub-layout — no variation tolerated:
203
+
204
+ ```text
205
+ src/infrastructure/adapters/orm/entities/<name>.orm-entity.ts
206
+ src/infrastructure/adapters/orm/repositories/<name>.typeorm-repository.ts
207
+ src/infrastructure/adapters/orm/mappers/<name>.mapper.ts
208
+ src/infrastructure/adapters/orm/migrations/<timestamp>-<action>.migration.ts
209
+ src/infrastructure/adapters/orm/orm.module.ts
210
+ src/infrastructure/adapters/orm/typeorm.config.ts
211
+ src/infrastructure/adapters/orm/typeorm-cli.datasource.ts
212
+ ```
213
+
214
+ The ORM subsystem has one Nest module only: `src/infrastructure/adapters/orm/orm.module.ts`. It registers TypeORM entities, concrete `*.typeorm-repository.ts` providers, mapper dependencies when needed, and exports the repository providers/tokens required by application ports. Do **not** create per-context or per-entity modules such as `auth-orm.module.ts`, `pessoas-orm.module.ts`, `wallets-orm.module.ts`, or `sync-engine-orm.module.ts`. Do **not** create `src/infrastructure/<context>/persistence/typeorm/`.
215
+
216
+ ### 5.2 Adapter ports (shared)
217
+
218
+ Ports for shared adapters live in `src/shared/infrastructure/adapter/<subsystem>/<name>.port.ts`. Example: `src/shared/infrastructure/adapter/auth/jwt.port.ts`. The alias `@infrastructure/adapter/*` resolves to both `src/shared/infrastructure/adapter/*` and `src/infrastructure/adapters/*`.
219
+
220
+ ## 6. Presentation (Transport Before Context)
221
+
222
+ ```text
223
+ src/presentation/<transport>/<context>/controllers/<verb-noun>.controller.ts
224
+ src/presentation/<transport>/<context>/dtos/<verb-noun>.dto.ts
225
+ src/presentation/<transport>/<context>/presentation-validators/<verb-noun>.presentation-validator.ts
226
+ src/presentation/<transport>/<context>/guards/<name>.guard.ts
227
+ src/presentation/<transport>/<context>/decorators/<name>.decorator.ts
228
+ src/presentation/<transport>/<context>/<context>.module.ts
229
+ ```
230
+
231
+ Observed transports in the current Foundation tree: `rest/`, `graphql/`, `cli/`, `websocket/`. `agent/` follows the same transport-before-context shape when a derived API explicitly introduces that transport.
232
+
233
+ REST `dtos/` are Foundation-compatible presentation contracts. Keep DTOs thin and transport-scoped; validation, mapping, and use case orchestration must remain in presentation validators and application.
234
+
235
+ **Never** `src/presentation/<context>/` without a transport segment. Even if a context is REST-only today, the path must be `src/presentation/rest/<context>/` to preserve room for future transports.
236
+
237
+ ## 7. Shared Infrastructure And Presentation
238
+
239
+ ```text
240
+ src/shared/infrastructure/<subsystem>/...
241
+ src/shared/infrastructure/adapter/<subsystem>/<name>.port.ts
242
+ src/shared/presentation/filters/<name>.filter.ts
243
+ src/shared/presentation/interceptors/<name>.interceptor.ts
244
+ src/shared/presentation/pipes/<name>.pipe.ts
245
+ ```
246
+
247
+ ## 8. TSConfig Aliases (Path Resolution)
248
+
249
+ From `devtrack-foundation-api/tsconfig.json`:
250
+
251
+ | Alias | Resolves to (in order) |
252
+ |---|---|
253
+ | `@application/business/notifications/ports/out/*` | `src/application/business/notifications/ports/out/*` |
254
+ | `@domain/*` | `src/domain/*`, `src/shared/domain/*` |
255
+ | `@application/*` | `src/application/*` |
256
+ | `@presentation/*` | `src/presentation/*`, `src/shared/presentation/*` |
257
+ | `@infrastructure/adapter/*` | `src/shared/infrastructure/adapter/*`, `src/infrastructure/adapters/*` |
258
+ | `@infrastructure/*` | `src/infrastructure/*`, `src/shared/infrastructure/*` |
259
+ | `@shared/*` | `src/shared/*` |
260
+ | `@src/presentation.module` | `src/presentation/presentation.module` |
261
+ | `@src/application.module` | `src/application/application.module` |
262
+ | `@src/*` | `src/*` |
263
+ | `@tests/*` | `tests/*` |
264
+
265
+ Aliases are mandatory in `src/` and tests. Same-folder relative imports are forbidden.
266
+
267
+ ## 9. Forbidden Patterns (Quick Reference)
268
+
269
+ | Forbidden | Canonical Replacement |
270
+ |---|---|
271
+ | `src/domain/<context>/exceptions/` | `src/shared/domain/exceptions/` |
272
+ | `<name>.schema.ts` (TypeORM) | `<name>.orm-entity.ts` |
273
+ | `<name>.value-object.ts` | `<name>.vo.ts` |
274
+ | `<name>.repository.ts` | `<name>.typeorm-repository.ts` (infrastructure) or `<name>-repository.port.ts` (port) |
275
+ | `src/infrastructure/<context>/persistence/typeorm/` | `src/infrastructure/adapters/orm/` |
276
+ | `src/infrastructure/<context>/adapters/` | `src/infrastructure/adapters/<subsystem>/` |
277
+ | `src/infrastructure/<context>/repositories/` | `src/infrastructure/adapters/orm/repositories/` |
278
+ | `src/presentation/<context>/` (no transport) | `src/presentation/rest/<context>/` (or other transport) |
279
+ | `entities/` in new domain context | `business-objects/` |
280
+ | `repository-ports/` in new domain context | application `ports/out/<name>-repository.port.ts` |
281
+ | `events/` in BO-pattern domain context | emit from application handlers |
282
+ | Custom domain exception class per context | `BusinessValidationException` from `shared/domain/exceptions` with payload |
283
+
284
+ ## 10. Compliance Verification
285
+
286
+ For any debate or plan that proposes new files:
287
+
288
+ 1. For each proposed path, perform a literal substring lookup against the patterns in sections 2–6.
289
+ 2. If no pattern matches, the path is **non-canonical** and must either:
290
+ - be rewritten to match a canonical pattern, or
291
+ - be accompanied by an ADR justifying the deviation, the migration cost, and the planned re-alignment.
292
+ 3. If a new subsystem, transport, or domain context is proposed, list it explicitly in the debate's ADR section.
293
+
294
+ The skill `devtrack-api` is the contract; this reference is the contract's evidence. Drift between this document and `devtrack-foundation-api/src/` is a defect in this document — submit a correction insight before relying on the divergent state.
@@ -3,13 +3,13 @@
3
3
  ## Before Editing
4
4
 
5
5
  - Read nearest `AGENTS.md` and `AGENT.md`.
6
- - Run `opensdd sdd onboard system`.
7
- - Run `opensdd sdd next`.
8
- - Run `opensdd sdd context <FEAT-ID>` if a feature id is available.
6
+ - Run `codesdd sdd onboard system`.
7
+ - Run `codesdd sdd next`.
8
+ - Run `codesdd sdd context <FEAT-ID>` if a feature id is available.
9
9
  - Check `git status --short`.
10
10
  - Inspect nearby files before creating new patterns.
11
11
  - Identify user changes in the dirty worktree and avoid overwriting them.
12
- - If SDD has no ready feature and work proceeds because the user explicitly requested it, state that exception in the final handoff and create an OpenSDD insight/feature only when durable follow-up is required.
12
+ - If SDD has no ready feature and work proceeds because the user explicitly requested it, state that exception in the final handoff and create an CodeSDD insight/feature only when durable follow-up is required.
13
13
  - Do not persist planning, backlog, workflow status, project memory, scratchpad, or handoff in external context stores.
14
14
 
15
15
  ## Task Understanding
@@ -78,7 +78,7 @@
78
78
  - Mapper ends with `.mapper.ts`.
79
79
  - Repository implements a port.
80
80
  - Mapper is stateless and maps domain <-> ORM only.
81
- - New entity is added to TypeORM config, CLI datasource, root module, ORM feature module, and infrastructure module as needed.
81
+ - New entity is added to TypeORM config, CLI datasource, the single `orm.module.ts`, and infrastructure module as needed.
82
82
  - Migration SQL matches entity decorators.
83
83
  - Unique violations are translated to domain/shared exceptions.
84
84
  - No Prisma artifacts.
@@ -23,13 +23,17 @@ Do not claim these commands passed unless they were executed successfully.
23
23
  Use aliases from `tsconfig.json`:
24
24
 
25
25
  ```text
26
+ @application/business/notifications/ports/out/* -> src/application/business/notifications/ports/out/*
26
27
  @domain/* -> src/domain/*, src/shared/domain/*
27
28
  @application/* -> src/application/*
28
29
  @presentation/* -> src/presentation/*, src/shared/presentation/*
29
30
  @infrastructure/adapter/* -> src/shared/infrastructure/adapter/*, src/infrastructure/adapters/*
30
31
  @infrastructure/* -> src/infrastructure/*, src/shared/infrastructure/*
31
32
  @shared/* -> src/shared/*
33
+ @src/presentation.module -> src/presentation/presentation.module
34
+ @src/application.module -> src/application/application.module
32
35
  @src/* -> src/*
36
+ @tests/* -> tests/*
33
37
  ```
34
38
 
35
39
  The lint rule `no-relative-import-paths/no-relative-import-paths` forbids relative imports in `src`, with `allowSameFolder: false`.
@@ -0,0 +1,41 @@
1
+ # Portable Agent Contract
2
+
3
+ Use this reference when adapting `devtrack-api` for Codex, Claude Code, Cursor, Gemini, Kimi, OpenCode, or any markdown/CLI coding agent.
4
+
5
+ ## Common Rules
6
+
7
+ - The `SKILL.md` frontmatter is the trigger surface; keep `name: devtrack-api` and a direct description of NestJS, TypeORM, DDD, Clean Architecture, CodeSDD, and Foundation-compatible API work.
8
+ - The body is the runtime contract; detailed Foundation rules live in `references/`.
9
+ - Agent-specific files in `agents/` are adapters, not separate sources of truth.
10
+ - CodeSDD state remains canonical for planning, quality, and finalize evidence.
11
+ - `devtrack-foundation-api` source and the Foundation layout reference win over generated assumptions.
12
+ - Do not persist hidden memory or parallel backlog outside `.sdd`.
13
+ - If the host cannot read `agents/*.yaml`, it must still be able to follow `SKILL.md` and this reference.
14
+
15
+ ## Agent Matrix
16
+
17
+ | Agent | Canonical id | Adapter file | Expected behavior |
18
+ | --- | --- | --- | --- |
19
+ | OpenAI host adapter | `openai` | `agents/openai.yaml` | Provide interface metadata for OpenAI/Codex-compatible skill hosts; not a separate planning source. |
20
+ | Codex | `codex` | `agents/codex.yaml` | Read CodeSDD policy first, load FEAT context, use repository evidence, and preserve user changes. |
21
+ | Claude Code | `claude` | `agents/claude-code.yaml` | Read AGENTS/CLAUDE files, keep changes scoped, and report unavailable tools honestly. |
22
+ | Cursor | `cursor` | `agents/cursor.yaml` | Use repository-local context and avoid detached plans that bypass CodeSDD. |
23
+ | Gemini | `gemini` | `agents/gemini.yaml` | Prefer explicit references and validation commands over inferred NestJS or TypeORM APIs. |
24
+ | Kimi | `kimi` | `agents/kimi.yaml` | Treat markdown skill text as authoritative and produce compact, evidence-backed edits. |
25
+ | OpenCode | `opencode` | `agents/opencode.yaml` | Use `opencode` for local skill sync and `open-code` only when an MCP provider contract requires it. |
26
+ | Generic | `generic-markdown-cli` | none required | Read `SKILL.md`, then relevant references, then report evidence in CodeSDD quality artifacts. |
27
+
28
+ ## Evidence Expectations
29
+
30
+ Every agent must leave enough evidence for another agent to continue:
31
+
32
+ - files changed and why;
33
+ - selected derivation profile from `contract-pack.yaml`;
34
+ - Foundation source/layout evidence used;
35
+ - relevant DTAPI rule ids checked;
36
+ - validation commands run, skipped, or unavailable;
37
+ - residual drift, exception status, and ADR or follow-up FEAT references.
38
+
39
+ ## Isolation
40
+
41
+ `devtrack-api` governs backend/API layout and Foundation fidelity. It may publish API contracts or DTO expectations to frontend or mobile consumers, but it does not govern Angular page structure, UI-kit adapters, Formly schemas, NGXS state, Flutter widget layout, Flutter routing, Flutter localization, or frontend/mobile accessibility gates. Angular Admin belongs to `devtrack-angular`; Flutter/Dart app work belongs to `devtrack-flutter`.
@@ -133,7 +133,7 @@ When an active SDD feature exists and the task is feature completion:
133
133
  2. Declare frontend impact:
134
134
 
135
135
  ```bash
136
- opensdd sdd frontend-impact <FEAT-ID> ...
136
+ codesdd sdd frontend-impact <FEAT-ID> ...
137
137
  ```
138
138
 
139
139
  3. Update affected docs when behavior or architecture changes:
@@ -149,7 +149,7 @@ AGENT.md
149
149
  4. Finalize:
150
150
 
151
151
  ```bash
152
- opensdd sdd finalize --ref <FEAT-ID>
152
+ codesdd sdd finalize --ref <FEAT-ID>
153
153
  ```
154
154
 
155
155
  Do not finalize when the user asked only for a narrow code edit and feature archiving is not in scope.
@@ -32,10 +32,9 @@ src/infrastructure/adapters/orm/entities/<name>.orm-entity.ts
32
32
  src/infrastructure/adapters/orm/mappers/<name>.mapper.ts
33
33
  src/infrastructure/adapters/orm/repositories/<name>.typeorm-repository.ts
34
34
  src/infrastructure/adapters/orm/migrations/<timestamp>-<action>.migration.ts
35
- src/infrastructure/adapters/orm/<module>-orm.module.ts
35
+ src/infrastructure/adapters/orm/orm.module.ts
36
36
  src/infrastructure/adapters/orm/typeorm.config.ts
37
37
  src/infrastructure/adapters/orm/typeorm-cli.datasource.ts
38
- src/infrastructure/adapters/orm/typeorm.module.ts
39
38
  ```
40
39
 
41
40
  ## ORM Entities
@@ -128,7 +127,7 @@ Pattern:
128
127
  import { Injectable } from '@nestjs/common';
129
128
  import { InjectRepository } from '@nestjs/typeorm';
130
129
  import type { Repository } from 'typeorm';
131
- import type { ExampleRepositoryPort } from '@domain/example/repository-ports/example-repository.port';
130
+ import type { ExampleRepositoryPort } from '@application/business/example/ports/out/example-repository.port';
132
131
  import type { Example } from '@domain/example/business-objects/example.bo';
133
132
  import { DuplicateEntityException } from '@domain/exceptions/duplicate-entity.exception';
134
133
  import { GenericRepository } from '@infrastructure/adapter/orm/generic-repository';
@@ -181,14 +180,14 @@ Rules:
181
180
  - Do not leak `Repository`, `QueryRunner`, `DataSource`, or ORM entities through ports.
182
181
  - Keep transaction ownership explicit and aligned with existing repository/unit-of-work patterns.
183
182
 
184
- ## ORM Modules
183
+ ## ORM Module
185
184
 
186
185
  Pattern:
187
186
 
188
187
  ```ts
189
188
  import { Global, Module } from '@nestjs/common';
190
189
  import { TypeOrmModule } from '@nestjs/typeorm';
191
- import { ExampleRepositoryPortSymbol } from '@domain/example/repository-ports/example-repository.port';
190
+ import { ExampleRepositoryPortSymbol } from '@application/business/example/ports/out/example-repository.port';
192
191
  import { ExampleOrmEntity } from '@infrastructure/adapters/orm/entities/example.orm-entity';
193
192
  import { ExampleTypeOrmRepository } from '@infrastructure/adapters/orm/repositories/example.typeorm-repository';
194
193
 
@@ -204,10 +203,10 @@ import { ExampleTypeOrmRepository } from '@infrastructure/adapters/orm/repositor
204
203
  ],
205
204
  exports: [ExampleRepositoryPortSymbol],
206
205
  })
207
- export class ExamplesOrmModule {}
206
+ export class OrmModule {}
208
207
  ```
209
208
 
210
- Wire new ORM modules into `src/infrastructure/infrastructure.module.ts` when they must be available to the app.
209
+ The ORM subsystem must have one Nest module only: `src/infrastructure/adapters/orm/orm.module.ts`. Do not create `*-orm.module.ts` files per entity, context, or feature. Add every new `*.typeorm-repository.ts` provider to this module and export the repository provider and/or its application port token from this module.
211
210
 
212
211
  ## TypeORM Root Wiring
213
212
 
@@ -215,8 +214,7 @@ When adding a new ORM entity, update all relevant places:
215
214
 
216
215
  - `src/infrastructure/adapters/orm/typeorm.config.ts`
217
216
  - `src/infrastructure/adapters/orm/typeorm-cli.datasource.ts`
218
- - `src/infrastructure/adapters/orm/typeorm.module.ts`
219
- - new or existing `*-orm.module.ts`
217
+ - `src/infrastructure/adapters/orm/orm.module.ts`
220
218
  - `src/infrastructure/infrastructure.module.ts`
221
219
 
222
220
  Do not rely on glob entity discovery for new application entities unless the repo switches to that pattern.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2026 OpenSDD Contributors
3
+ Copyright (c) 2024-2026 CodeSDD Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal