@zigrivers/scaffold 3.15.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +47 -12
  2. package/content/knowledge/backend/backend-fintech-broker-integration.md +244 -0
  3. package/content/knowledge/backend/backend-fintech-compliance.md +181 -0
  4. package/content/knowledge/backend/backend-fintech-data-modeling.md +210 -0
  5. package/content/knowledge/backend/backend-fintech-ledger.md +226 -0
  6. package/content/knowledge/backend/backend-fintech-observability.md +151 -0
  7. package/content/knowledge/backend/backend-fintech-order-lifecycle.md +213 -0
  8. package/content/knowledge/backend/backend-fintech-risk-management.md +150 -0
  9. package/content/knowledge/backend/backend-fintech-testing.md +197 -0
  10. package/content/knowledge/core/automated-review-tooling.md +31 -26
  11. package/content/knowledge/core/multi-model-review-dispatch.md +30 -55
  12. package/content/knowledge/core/multi-service-api-contracts.md +634 -0
  13. package/content/knowledge/core/multi-service-architecture.md +492 -0
  14. package/content/knowledge/core/multi-service-auth.md +706 -0
  15. package/content/knowledge/core/multi-service-data-ownership.md +539 -0
  16. package/content/knowledge/core/multi-service-observability.md +545 -0
  17. package/content/knowledge/core/multi-service-resilience.md +710 -0
  18. package/content/knowledge/core/multi-service-task-decomposition.md +615 -0
  19. package/content/knowledge/core/multi-service-testing.md +728 -0
  20. package/content/methodology/backend-fintech.yml +46 -0
  21. package/content/methodology/custom-defaults.yml +6 -0
  22. package/content/methodology/deep.yml +6 -0
  23. package/content/methodology/multi-service-overlay.yml +103 -0
  24. package/content/methodology/mvp.yml +6 -0
  25. package/content/pipeline/architecture/service-ownership-map.md +83 -0
  26. package/content/pipeline/quality/cross-service-auth.md +96 -0
  27. package/content/pipeline/quality/cross-service-observability.md +104 -0
  28. package/content/pipeline/quality/integration-test-plan.md +106 -0
  29. package/content/pipeline/specification/inter-service-contracts.md +95 -0
  30. package/content/tools/post-implementation-review.md +36 -7
  31. package/content/tools/review-code.md +33 -8
  32. package/content/tools/review-pr.md +79 -95
  33. package/dist/cli/commands/adopt.cli-flags.test.js +20 -0
  34. package/dist/cli/commands/adopt.cli-flags.test.js.map +1 -1
  35. package/dist/cli/commands/adopt.d.ts.map +1 -1
  36. package/dist/cli/commands/adopt.js +11 -3
  37. package/dist/cli/commands/adopt.js.map +1 -1
  38. package/dist/cli/commands/complete.d.ts +1 -0
  39. package/dist/cli/commands/complete.d.ts.map +1 -1
  40. package/dist/cli/commands/complete.js +26 -8
  41. package/dist/cli/commands/complete.js.map +1 -1
  42. package/dist/cli/commands/dashboard.d.ts +1 -0
  43. package/dist/cli/commands/dashboard.d.ts.map +1 -1
  44. package/dist/cli/commands/dashboard.js +19 -6
  45. package/dist/cli/commands/dashboard.js.map +1 -1
  46. package/dist/cli/commands/decisions.d.ts +1 -0
  47. package/dist/cli/commands/decisions.d.ts.map +1 -1
  48. package/dist/cli/commands/decisions.js +18 -4
  49. package/dist/cli/commands/decisions.js.map +1 -1
  50. package/dist/cli/commands/info.d.ts +1 -0
  51. package/dist/cli/commands/info.d.ts.map +1 -1
  52. package/dist/cli/commands/info.js +25 -3
  53. package/dist/cli/commands/info.js.map +1 -1
  54. package/dist/cli/commands/init-from.test.d.ts +2 -0
  55. package/dist/cli/commands/init-from.test.d.ts.map +1 -0
  56. package/dist/cli/commands/init-from.test.js +315 -0
  57. package/dist/cli/commands/init-from.test.js.map +1 -0
  58. package/dist/cli/commands/init.d.ts +3 -0
  59. package/dist/cli/commands/init.d.ts.map +1 -1
  60. package/dist/cli/commands/init.js +239 -129
  61. package/dist/cli/commands/init.js.map +1 -1
  62. package/dist/cli/commands/init.test.js +20 -0
  63. package/dist/cli/commands/init.test.js.map +1 -1
  64. package/dist/cli/commands/next.d.ts +1 -0
  65. package/dist/cli/commands/next.d.ts.map +1 -1
  66. package/dist/cli/commands/next.js +40 -4
  67. package/dist/cli/commands/next.js.map +1 -1
  68. package/dist/cli/commands/next.test.js +151 -0
  69. package/dist/cli/commands/next.test.js.map +1 -1
  70. package/dist/cli/commands/reset.d.ts +1 -0
  71. package/dist/cli/commands/reset.d.ts.map +1 -1
  72. package/dist/cli/commands/reset.js +77 -29
  73. package/dist/cli/commands/reset.js.map +1 -1
  74. package/dist/cli/commands/rework.d.ts +1 -0
  75. package/dist/cli/commands/rework.d.ts.map +1 -1
  76. package/dist/cli/commands/rework.js +16 -2
  77. package/dist/cli/commands/rework.js.map +1 -1
  78. package/dist/cli/commands/run.d.ts +1 -0
  79. package/dist/cli/commands/run.d.ts.map +1 -1
  80. package/dist/cli/commands/run.js +65 -13
  81. package/dist/cli/commands/run.js.map +1 -1
  82. package/dist/cli/commands/run.test.js +192 -3
  83. package/dist/cli/commands/run.test.js.map +1 -1
  84. package/dist/cli/commands/skip.d.ts +1 -0
  85. package/dist/cli/commands/skip.d.ts.map +1 -1
  86. package/dist/cli/commands/skip.js +24 -7
  87. package/dist/cli/commands/skip.js.map +1 -1
  88. package/dist/cli/commands/status.d.ts +1 -0
  89. package/dist/cli/commands/status.d.ts.map +1 -1
  90. package/dist/cli/commands/status.js +51 -4
  91. package/dist/cli/commands/status.js.map +1 -1
  92. package/dist/cli/commands/status.test.js +128 -0
  93. package/dist/cli/commands/status.test.js.map +1 -1
  94. package/dist/cli/guards-coverage.test.d.ts +2 -0
  95. package/dist/cli/guards-coverage.test.d.ts.map +1 -0
  96. package/dist/cli/guards-coverage.test.js +26 -0
  97. package/dist/cli/guards-coverage.test.js.map +1 -0
  98. package/dist/cli/guards-integration.test.d.ts +2 -0
  99. package/dist/cli/guards-integration.test.d.ts.map +1 -0
  100. package/dist/cli/guards-integration.test.js +178 -0
  101. package/dist/cli/guards-integration.test.js.map +1 -0
  102. package/dist/cli/guards.d.ts +13 -0
  103. package/dist/cli/guards.d.ts.map +1 -0
  104. package/dist/cli/guards.js +70 -0
  105. package/dist/cli/guards.js.map +1 -0
  106. package/dist/cli/guards.test.d.ts +2 -0
  107. package/dist/cli/guards.test.d.ts.map +1 -0
  108. package/dist/cli/guards.test.js +136 -0
  109. package/dist/cli/guards.test.js.map +1 -0
  110. package/dist/cli/init-flag-families.d.ts +1 -1
  111. package/dist/cli/init-flag-families.d.ts.map +1 -1
  112. package/dist/cli/init-flag-families.js +4 -1
  113. package/dist/cli/init-flag-families.js.map +1 -1
  114. package/dist/cli/init-flag-families.test.js +10 -0
  115. package/dist/cli/init-flag-families.test.js.map +1 -1
  116. package/dist/cli/shutdown.d.ts +2 -3
  117. package/dist/cli/shutdown.d.ts.map +1 -1
  118. package/dist/cli/shutdown.js +14 -11
  119. package/dist/cli/shutdown.js.map +1 -1
  120. package/dist/cli/shutdown.test.js +2 -4
  121. package/dist/cli/shutdown.test.js.map +1 -1
  122. package/dist/config/schema.d.ts +12122 -288
  123. package/dist/config/schema.d.ts.map +1 -1
  124. package/dist/config/schema.js +74 -79
  125. package/dist/config/schema.js.map +1 -1
  126. package/dist/config/schema.test.js +230 -1
  127. package/dist/config/schema.test.js.map +1 -1
  128. package/dist/config/validators/backend.d.ts +4 -0
  129. package/dist/config/validators/backend.d.ts.map +1 -0
  130. package/dist/config/validators/backend.js +14 -0
  131. package/dist/config/validators/backend.js.map +1 -0
  132. package/dist/config/validators/browser-extension.d.ts +4 -0
  133. package/dist/config/validators/browser-extension.d.ts.map +1 -0
  134. package/dist/config/validators/browser-extension.js +24 -0
  135. package/dist/config/validators/browser-extension.js.map +1 -0
  136. package/dist/config/validators/cli.d.ts +4 -0
  137. package/dist/config/validators/cli.d.ts.map +1 -0
  138. package/dist/config/validators/cli.js +14 -0
  139. package/dist/config/validators/cli.js.map +1 -0
  140. package/dist/config/validators/data-pipeline.d.ts +4 -0
  141. package/dist/config/validators/data-pipeline.d.ts.map +1 -0
  142. package/dist/config/validators/data-pipeline.js +14 -0
  143. package/dist/config/validators/data-pipeline.js.map +1 -0
  144. package/dist/config/validators/game.d.ts +4 -0
  145. package/dist/config/validators/game.d.ts.map +1 -0
  146. package/dist/config/validators/game.js +14 -0
  147. package/dist/config/validators/game.js.map +1 -0
  148. package/dist/config/validators/index.d.ts +7 -0
  149. package/dist/config/validators/index.d.ts.map +1 -0
  150. package/dist/config/validators/index.js +27 -0
  151. package/dist/config/validators/index.js.map +1 -0
  152. package/dist/config/validators/library.d.ts +4 -0
  153. package/dist/config/validators/library.d.ts.map +1 -0
  154. package/dist/config/validators/library.js +25 -0
  155. package/dist/config/validators/library.js.map +1 -0
  156. package/dist/config/validators/ml.d.ts +4 -0
  157. package/dist/config/validators/ml.d.ts.map +1 -0
  158. package/dist/config/validators/ml.js +31 -0
  159. package/dist/config/validators/ml.js.map +1 -0
  160. package/dist/config/validators/mobile-app.d.ts +4 -0
  161. package/dist/config/validators/mobile-app.d.ts.map +1 -0
  162. package/dist/config/validators/mobile-app.js +14 -0
  163. package/dist/config/validators/mobile-app.js.map +1 -0
  164. package/dist/config/validators/registry.test.d.ts +2 -0
  165. package/dist/config/validators/registry.test.d.ts.map +1 -0
  166. package/dist/config/validators/registry.test.js +26 -0
  167. package/dist/config/validators/registry.test.js.map +1 -0
  168. package/dist/config/validators/research.d.ts +4 -0
  169. package/dist/config/validators/research.d.ts.map +1 -0
  170. package/dist/config/validators/research.js +24 -0
  171. package/dist/config/validators/research.js.map +1 -0
  172. package/dist/config/validators/research.test.d.ts +2 -0
  173. package/dist/config/validators/research.test.d.ts.map +1 -0
  174. package/dist/config/validators/research.test.js +44 -0
  175. package/dist/config/validators/research.test.js.map +1 -0
  176. package/dist/config/validators/types.d.ts +19 -0
  177. package/dist/config/validators/types.d.ts.map +1 -0
  178. package/dist/config/validators/types.js +2 -0
  179. package/dist/config/validators/types.js.map +1 -0
  180. package/dist/config/validators/validators.test.d.ts +2 -0
  181. package/dist/config/validators/validators.test.d.ts.map +1 -0
  182. package/dist/config/validators/validators.test.js +25 -0
  183. package/dist/config/validators/validators.test.js.map +1 -0
  184. package/dist/config/validators/web-app.d.ts +4 -0
  185. package/dist/config/validators/web-app.d.ts.map +1 -0
  186. package/dist/config/validators/web-app.js +31 -0
  187. package/dist/config/validators/web-app.js.map +1 -0
  188. package/dist/core/assembly/context-gatherer.d.ts.map +1 -1
  189. package/dist/core/assembly/context-gatherer.js +4 -2
  190. package/dist/core/assembly/context-gatherer.js.map +1 -1
  191. package/dist/core/assembly/cross-reads.d.ts +58 -0
  192. package/dist/core/assembly/cross-reads.d.ts.map +1 -0
  193. package/dist/core/assembly/cross-reads.js +185 -0
  194. package/dist/core/assembly/cross-reads.js.map +1 -0
  195. package/dist/core/assembly/cross-reads.test.d.ts +2 -0
  196. package/dist/core/assembly/cross-reads.test.d.ts.map +1 -0
  197. package/dist/core/assembly/cross-reads.test.js +383 -0
  198. package/dist/core/assembly/cross-reads.test.js.map +1 -0
  199. package/dist/core/assembly/overlay-loader-structural.test.d.ts +2 -0
  200. package/dist/core/assembly/overlay-loader-structural.test.d.ts.map +1 -0
  201. package/dist/core/assembly/overlay-loader-structural.test.js +114 -0
  202. package/dist/core/assembly/overlay-loader-structural.test.js.map +1 -0
  203. package/dist/core/assembly/overlay-loader.d.ts +17 -3
  204. package/dist/core/assembly/overlay-loader.d.ts.map +1 -1
  205. package/dist/core/assembly/overlay-loader.js +75 -0
  206. package/dist/core/assembly/overlay-loader.js.map +1 -1
  207. package/dist/core/assembly/overlay-resolver.d.ts +2 -2
  208. package/dist/core/assembly/overlay-resolver.d.ts.map +1 -1
  209. package/dist/core/assembly/overlay-resolver.js.map +1 -1
  210. package/dist/core/assembly/overlay-resolver.test.js.map +1 -1
  211. package/dist/core/assembly/overlay-state-resolver.d.ts +5 -0
  212. package/dist/core/assembly/overlay-state-resolver.d.ts.map +1 -1
  213. package/dist/core/assembly/overlay-state-resolver.js +41 -1
  214. package/dist/core/assembly/overlay-state-resolver.js.map +1 -1
  215. package/dist/core/assembly/overlay-state-resolver.test.js +262 -0
  216. package/dist/core/assembly/overlay-state-resolver.test.js.map +1 -1
  217. package/dist/core/assembly/update-mode.d.ts +1 -0
  218. package/dist/core/assembly/update-mode.d.ts.map +1 -1
  219. package/dist/core/assembly/update-mode.js +17 -9
  220. package/dist/core/assembly/update-mode.js.map +1 -1
  221. package/dist/core/dependency/eligibility.d.ts +10 -1
  222. package/dist/core/dependency/eligibility.d.ts.map +1 -1
  223. package/dist/core/dependency/eligibility.js +19 -1
  224. package/dist/core/dependency/eligibility.js.map +1 -1
  225. package/dist/core/dependency/eligibility.test.js +82 -0
  226. package/dist/core/dependency/eligibility.test.js.map +1 -1
  227. package/dist/core/dependency/graph.d.ts +4 -1
  228. package/dist/core/dependency/graph.d.ts.map +1 -1
  229. package/dist/core/dependency/graph.js +7 -1
  230. package/dist/core/dependency/graph.js.map +1 -1
  231. package/dist/core/dependency/graph.test.js +29 -0
  232. package/dist/core/dependency/graph.test.js.map +1 -1
  233. package/dist/core/pipeline/global-steps.d.ts +7 -0
  234. package/dist/core/pipeline/global-steps.d.ts.map +1 -0
  235. package/dist/core/pipeline/global-steps.js +18 -0
  236. package/dist/core/pipeline/global-steps.js.map +1 -0
  237. package/dist/core/pipeline/resolver.d.ts +1 -0
  238. package/dist/core/pipeline/resolver.d.ts.map +1 -1
  239. package/dist/core/pipeline/resolver.js +51 -6
  240. package/dist/core/pipeline/resolver.js.map +1 -1
  241. package/dist/core/pipeline/types.d.ts +5 -1
  242. package/dist/core/pipeline/types.d.ts.map +1 -1
  243. package/dist/e2e/cross-service-references.test.d.ts +22 -0
  244. package/dist/e2e/cross-service-references.test.d.ts.map +1 -0
  245. package/dist/e2e/cross-service-references.test.js +188 -0
  246. package/dist/e2e/cross-service-references.test.js.map +1 -0
  247. package/dist/e2e/multi-service-pipeline.test.d.ts +10 -0
  248. package/dist/e2e/multi-service-pipeline.test.d.ts.map +1 -0
  249. package/dist/e2e/multi-service-pipeline.test.js +185 -0
  250. package/dist/e2e/multi-service-pipeline.test.js.map +1 -0
  251. package/dist/e2e/project-type-overlays.test.js +68 -0
  252. package/dist/e2e/project-type-overlays.test.js.map +1 -1
  253. package/dist/e2e/service-execution.test.d.ts +15 -0
  254. package/dist/e2e/service-execution.test.d.ts.map +1 -0
  255. package/dist/e2e/service-execution.test.js +219 -0
  256. package/dist/e2e/service-execution.test.js.map +1 -0
  257. package/dist/e2e/service-manifest.test.d.ts +19 -0
  258. package/dist/e2e/service-manifest.test.d.ts.map +1 -0
  259. package/dist/e2e/service-manifest.test.js +166 -0
  260. package/dist/e2e/service-manifest.test.js.map +1 -0
  261. package/dist/project/__frozen-schemas__/schema-v3.9.2.d.ts +224 -224
  262. package/dist/project/frontmatter.d.ts.map +1 -1
  263. package/dist/project/frontmatter.js +11 -0
  264. package/dist/project/frontmatter.js.map +1 -1
  265. package/dist/project/frontmatter.test.js +71 -0
  266. package/dist/project/frontmatter.test.js.map +1 -1
  267. package/dist/state/completion.d.ts +1 -1
  268. package/dist/state/completion.d.ts.map +1 -1
  269. package/dist/state/completion.js +10 -8
  270. package/dist/state/completion.js.map +1 -1
  271. package/dist/state/decision-logger.d.ts +3 -2
  272. package/dist/state/decision-logger.d.ts.map +1 -1
  273. package/dist/state/decision-logger.js +12 -11
  274. package/dist/state/decision-logger.js.map +1 -1
  275. package/dist/state/ensure-v3-migration.d.ts +9 -0
  276. package/dist/state/ensure-v3-migration.d.ts.map +1 -0
  277. package/dist/state/ensure-v3-migration.js +35 -0
  278. package/dist/state/ensure-v3-migration.js.map +1 -0
  279. package/dist/state/lock-manager.d.ts +5 -4
  280. package/dist/state/lock-manager.d.ts.map +1 -1
  281. package/dist/state/lock-manager.js +11 -11
  282. package/dist/state/lock-manager.js.map +1 -1
  283. package/dist/state/rework-manager.d.ts +1 -2
  284. package/dist/state/rework-manager.d.ts.map +1 -1
  285. package/dist/state/rework-manager.js +4 -5
  286. package/dist/state/rework-manager.js.map +1 -1
  287. package/dist/state/state-manager.d.ts +25 -1
  288. package/dist/state/state-manager.d.ts.map +1 -1
  289. package/dist/state/state-manager.js +86 -12
  290. package/dist/state/state-manager.js.map +1 -1
  291. package/dist/state/state-manager.test.js +278 -0
  292. package/dist/state/state-manager.test.js.map +1 -1
  293. package/dist/state/state-migration-v3.d.ts +22 -0
  294. package/dist/state/state-migration-v3.d.ts.map +1 -0
  295. package/dist/state/state-migration-v3.js +82 -0
  296. package/dist/state/state-migration-v3.js.map +1 -0
  297. package/dist/state/state-migration-v3.test.d.ts +2 -0
  298. package/dist/state/state-migration-v3.test.d.ts.map +1 -0
  299. package/dist/state/state-migration-v3.test.js +196 -0
  300. package/dist/state/state-migration-v3.test.js.map +1 -0
  301. package/dist/state/state-migration.d.ts.map +1 -1
  302. package/dist/state/state-migration.js +11 -6
  303. package/dist/state/state-migration.js.map +1 -1
  304. package/dist/state/state-migration.test.js +47 -2
  305. package/dist/state/state-migration.test.js.map +1 -1
  306. package/dist/state/state-path-resolver.d.ts +23 -0
  307. package/dist/state/state-path-resolver.d.ts.map +1 -0
  308. package/dist/state/state-path-resolver.js +36 -0
  309. package/dist/state/state-path-resolver.js.map +1 -0
  310. package/dist/state/state-path-resolver.test.d.ts +2 -0
  311. package/dist/state/state-path-resolver.test.d.ts.map +1 -0
  312. package/dist/state/state-path-resolver.test.js +78 -0
  313. package/dist/state/state-path-resolver.test.js.map +1 -0
  314. package/dist/state/state-version-dispatch.d.ts +17 -0
  315. package/dist/state/state-version-dispatch.d.ts.map +1 -0
  316. package/dist/state/state-version-dispatch.js +27 -0
  317. package/dist/state/state-version-dispatch.js.map +1 -0
  318. package/dist/state/state-version-dispatch.test.d.ts +2 -0
  319. package/dist/state/state-version-dispatch.test.d.ts.map +1 -0
  320. package/dist/state/state-version-dispatch.test.js +40 -0
  321. package/dist/state/state-version-dispatch.test.js.map +1 -0
  322. package/dist/types/config.d.ts +25 -3
  323. package/dist/types/config.d.ts.map +1 -1
  324. package/dist/types/config.test.js +13 -1
  325. package/dist/types/config.test.js.map +1 -1
  326. package/dist/types/dependency.d.ts +5 -0
  327. package/dist/types/dependency.d.ts.map +1 -1
  328. package/dist/types/frontmatter.d.ts +5 -0
  329. package/dist/types/frontmatter.d.ts.map +1 -1
  330. package/dist/types/lock.d.ts +1 -1
  331. package/dist/types/lock.d.ts.map +1 -1
  332. package/dist/types/state.d.ts +1 -1
  333. package/dist/types/state.d.ts.map +1 -1
  334. package/dist/utils/artifact-path.d.ts +19 -0
  335. package/dist/utils/artifact-path.d.ts.map +1 -0
  336. package/dist/utils/artifact-path.js +95 -0
  337. package/dist/utils/artifact-path.js.map +1 -0
  338. package/dist/utils/artifact-path.test.d.ts +2 -0
  339. package/dist/utils/artifact-path.test.d.ts.map +1 -0
  340. package/dist/utils/artifact-path.test.js +138 -0
  341. package/dist/utils/artifact-path.test.js.map +1 -0
  342. package/dist/utils/errors.d.ts +1 -1
  343. package/dist/utils/errors.d.ts.map +1 -1
  344. package/dist/utils/errors.js +5 -2
  345. package/dist/utils/errors.js.map +1 -1
  346. package/dist/utils/user-errors.d.ts +46 -0
  347. package/dist/utils/user-errors.d.ts.map +1 -0
  348. package/dist/utils/user-errors.js +76 -0
  349. package/dist/utils/user-errors.js.map +1 -0
  350. package/dist/utils/user-errors.test.d.ts +2 -0
  351. package/dist/utils/user-errors.test.d.ts.map +1 -0
  352. package/dist/utils/user-errors.test.js +74 -0
  353. package/dist/utils/user-errors.test.js.map +1 -0
  354. package/dist/validation/index.d.ts.map +1 -1
  355. package/dist/validation/index.js +16 -0
  356. package/dist/validation/index.js.map +1 -1
  357. package/dist/validation/index.test.js +48 -0
  358. package/dist/validation/index.test.js.map +1 -1
  359. package/dist/validation/state-validator.d.ts +5 -2
  360. package/dist/validation/state-validator.d.ts.map +1 -1
  361. package/dist/validation/state-validator.js +18 -20
  362. package/dist/validation/state-validator.js.map +1 -1
  363. package/dist/validation/state-validator.test.js +31 -2
  364. package/dist/validation/state-validator.test.js.map +1 -1
  365. package/dist/wizard/copy/backend.d.ts.map +1 -1
  366. package/dist/wizard/copy/backend.js +12 -0
  367. package/dist/wizard/copy/backend.js.map +1 -1
  368. package/dist/wizard/flags.d.ts +1 -0
  369. package/dist/wizard/flags.d.ts.map +1 -1
  370. package/dist/wizard/questions.d.ts.map +1 -1
  371. package/dist/wizard/questions.js +5 -1
  372. package/dist/wizard/questions.js.map +1 -1
  373. package/dist/wizard/questions.test.js +45 -2
  374. package/dist/wizard/questions.test.js.map +1 -1
  375. package/dist/wizard/wizard.d.ts +23 -0
  376. package/dist/wizard/wizard.d.ts.map +1 -1
  377. package/dist/wizard/wizard.js +85 -47
  378. package/dist/wizard/wizard.js.map +1 -1
  379. package/dist/wizard/wizard.test.js +186 -1
  380. package/dist/wizard/wizard.test.js.map +1 -1
  381. package/package.json +1 -1
@@ -0,0 +1,492 @@
1
+ ---
2
+ name: multi-service-architecture
3
+ description: Service boundary design, communication patterns, service discovery, and networking topology
4
+ topics: [service-boundaries, communication-patterns, service-discovery, networking-topology, data-ownership, sync-vs-async]
5
+ ---
6
+
7
+ ## Summary
8
+
9
+ Multi-service architectures distribute system functionality across independently deployable units. The core trade-off is independent deployment and scaling versus operational complexity, distributed failure modes, and data consistency challenges.
10
+
11
+ **Decomposition strategies:**
12
+ - **Domain-driven:** Each bounded context becomes a candidate service — the most defensible approach.
13
+ - **Team-aligned:** Organize services along team boundaries for clear ownership.
14
+ - **Strangler Fig:** Incrementally extract from an existing monolith.
15
+
16
+ **Communication patterns:**
17
+ - **REST:** Default for synchronous request-response; universal support, easy to debug.
18
+ - **gRPC:** High-throughput internal service calls; strongly typed, binary serialization.
19
+ - **Message queues:** Async, single consumer; natural rate limiting, retry via dead-letter queues.
20
+ - **Event streaming (Kafka):** Async, multiple independent consumers; durable, replayable log.
21
+
22
+ **Service discovery:** DNS-based (Kubernetes default), client-side registry (Consul), or service mesh (Istio/Linkerd).
23
+
24
+ **Networking:** API gateway for external traffic; BFF pattern per client type; direct service-to-service for internal calls.
25
+
26
+ **Data ownership:** Each service owns its data exclusively — no cross-service direct database access. Data crosses boundaries via API calls, event subscriptions, or API composition.
27
+
28
+ ## Deep Guidance
29
+
30
+ ## Service Decomposition Strategies
31
+
32
+ ### Domain-Driven Decomposition
33
+
34
+ The most defensible decomposition strategy: each bounded context from your domain model becomes a candidate service. A bounded context is a coherent, self-contained part of the domain with its own ubiquitous language and data model.
35
+
36
+ **Steps to decompose:**
37
+
38
+ 1. Identify bounded contexts by finding the seams where domain language changes. When the word "account" means different things in billing versus support, those are different bounded contexts.
39
+ 2. Map aggregate roots within each context. Each aggregate root (the entity that enforces invariants across a cluster of objects) is a unit of consistency.
40
+ 3. Find domain events crossing context boundaries. These are the integration points — where one service must react to changes in another.
41
+ 4. Apply the "can this context be developed, deployed, and scaled independently?" test to each candidate.
42
+
43
+ **Common bounded context candidates:**
44
+
45
+ - Identity/Authentication (users, credentials, sessions)
46
+ - Billing/Payments (subscriptions, invoices, payment methods)
47
+ - Catalog (products, pricing, availability)
48
+ - Orders (placement, fulfillment, cancellation)
49
+ - Notifications (email, push, SMS delivery)
50
+ - Analytics/Reporting (read-heavy, can lag behind)
51
+
52
+ **Trade-offs:**
53
+ - (+) Natural seams reduce cross-service coupling. Context boundaries map to team boundaries (Conway's Law).
54
+ - (+) Each service has a coherent ubiquitous language — cleaner code, clearer tests.
55
+ - (-) Requires significant upfront domain modeling investment. Wrong context boundaries are expensive to fix.
56
+ - (-) Domain events crossing boundaries require durable messaging infrastructure.
57
+
58
+ ### Team-Aligned Decomposition
59
+
60
+ Organize services along team boundaries rather than domain boundaries. Each team owns one or more services they can deploy independently.
61
+
62
+ **When to prefer team-aligned over domain-driven:**
63
+
64
+ - Domain boundaries are unclear or disputed
65
+ - Organizational structure is stable and well-defined
66
+ - Need to achieve deployment independence quickly
67
+
68
+ **Trade-offs:**
69
+ - (+) Clear ownership. No ambiguity about which team is responsible for a service.
70
+ - (+) Enables parallel development without coordination overhead.
71
+ - (-) Services may not align with domain boundaries, creating awkward integration points.
72
+ - (-) Team reorganization forces service reorganization.
73
+
74
+ ### Strangler Fig Pattern
75
+
76
+ For decomposing an existing monolith: incrementally extract functionality into new services while the monolith continues running. The monolith is the "strangler" being replaced over time.
77
+
78
+ **Steps:**
79
+ 1. Identify a bounded context that is self-contained and has clear external interfaces.
80
+ 2. Build the new service alongside the monolith, not replacing it yet.
81
+ 3. Route traffic to the new service via an API gateway or proxy.
82
+ 4. Migrate data to the new service's database.
83
+ 5. Remove the corresponding code from the monolith.
84
+
85
+ **Trade-offs:**
86
+ - (+) No big-bang rewrite. Incremental risk.
87
+ - (+) The new service can be validated in production before the monolith code is removed.
88
+ - (-) Running both systems simultaneously doubles operational surface during transition.
89
+ - (-) Data migration is the hard part — requires careful cutover strategy.
90
+
91
+ ### Service Granularity Guidelines
92
+
93
+ Services can be too coarse (essentially a distributed monolith) or too fine (nanoservices with network overhead for every operation).
94
+
95
+ **Signs a service is too coarse:**
96
+ - Multiple teams need to change the service for independent features
97
+ - Deployments require coordinating across multiple domain concepts
98
+ - The service has more than ~10 aggregates or ~5 bounded sub-contexts
99
+
100
+ **Signs a service is too fine:**
101
+ - Most operations require calls to 3+ other services to complete
102
+ - The service cannot perform meaningful work independently
103
+ - Deployment of this service almost always pairs with deployment of another service
104
+ - The service has fewer than 3-5 meaningful operations
105
+
106
+ **Rule of thumb:** A service should be independently deployable AND independently meaningful. If you always deploy services A and B together, they should probably be one service.
107
+
108
+ ## Sync vs Async Communication Patterns
109
+
110
+ ### Synchronous: REST
111
+
112
+ REST over HTTP is the default choice for synchronous request-response communication. Use it when the caller needs an immediate response to proceed.
113
+
114
+ ```yaml
115
+ # OpenAPI 3.0 service contract example
116
+ openapi: "3.0.3"
117
+ info:
118
+ title: Order Service API
119
+ version: "1.0.0"
120
+ paths:
121
+ /orders:
122
+ post:
123
+ summary: Place a new order
124
+ requestBody:
125
+ required: true
126
+ content:
127
+ application/json:
128
+ schema:
129
+ type: object
130
+ required: [customerId, items]
131
+ properties:
132
+ customerId:
133
+ type: string
134
+ format: uuid
135
+ items:
136
+ type: array
137
+ items:
138
+ type: object
139
+ required: [productId, quantity]
140
+ properties:
141
+ productId:
142
+ type: string
143
+ quantity:
144
+ type: integer
145
+ minimum: 1
146
+ responses:
147
+ "201":
148
+ description: Order placed
149
+ content:
150
+ application/json:
151
+ schema:
152
+ type: object
153
+ properties:
154
+ orderId:
155
+ type: string
156
+ format: uuid
157
+ status:
158
+ type: string
159
+ enum: [pending, confirmed, failed]
160
+ "422":
161
+ description: Validation error or business rule violation
162
+ "503":
163
+ description: Downstream service unavailable
164
+ ```
165
+
166
+ **Use REST when:**
167
+ - The caller needs the result immediately to continue (user-facing request, transactional operation)
168
+ - Simple CRUD operations
169
+ - External clients (mobile apps, browsers, third-party integrations)
170
+
171
+ **Trade-offs:**
172
+ - (+) Universal support. Easy to debug with standard tools (curl, browser dev tools).
173
+ - (+) Stateless — any instance can handle any request.
174
+ - (-) Temporal coupling: caller blocks until the callee responds.
175
+ - (-) Cascade failures: if the downstream service is slow, the upstream service's threads/connections pile up.
176
+ - (-) Chatty interfaces under load: many small requests are expensive.
177
+
178
+ ### Synchronous: gRPC
179
+
180
+ Protocol Buffers over HTTP/2. Strongly typed, efficient binary serialization, bidirectional streaming support.
181
+
182
+ **Use gRPC when:**
183
+ - Internal service-to-service communication where you control both sides
184
+ - High-throughput, low-latency requirements (gRPC is ~5-10x faster than REST for equivalent payloads)
185
+ - Strongly typed contracts are more important than universal client support
186
+ - Streaming (server-sent events, client streaming, bidirectional)
187
+
188
+ **Trade-offs:**
189
+ - (+) Strongly typed contracts enforced at compile time. Breaking changes are caught early.
190
+ - (+) Binary serialization is compact and fast. Streaming support is native.
191
+ - (-) Not browser-native. Requires grpc-web proxy for browser clients.
192
+ - (-) Harder to debug (binary format). Need tooling like grpcurl or grpc-ui.
193
+ - (-) .proto files add a build step. Requires code generation for every language.
194
+
195
+ ### Asynchronous: Message Queues
196
+
197
+ Producer sends a message to a queue; consumer processes it independently. The producer does not wait for the consumer to finish.
198
+
199
+ **Use message queues when:**
200
+ - The work can be done asynchronously (sending emails, processing uploads, generating reports)
201
+ - Rate limiting: smooth bursts of work across time
202
+ - Retry logic: failed messages stay in the queue and can be reprocessed
203
+ - Competing consumers: multiple workers process from the same queue
204
+
205
+ **Queue implementation options:**
206
+ - **Redis Streams / BullMQ** (Node.js): Simple, low operational overhead. Good for single-datacenter deployments.
207
+ - **RabbitMQ**: Traditional message broker. Good routing, dead-letter exchanges, per-message TTL.
208
+ - **Amazon SQS**: Fully managed. Good for AWS-centric architectures.
209
+
210
+ **Trade-offs:**
211
+ - (+) Temporal decoupling: producer and consumer don't need to be running simultaneously.
212
+ - (+) Natural rate limiting and backpressure.
213
+ - (+) Dead-letter queues catch failures for inspection and retry.
214
+ - (-) Eventual processing: you can't return the result to the original caller.
215
+ - (-) Ordering: standard queues don't guarantee FIFO. If order matters, use FIFO queues (SQS FIFO, Kafka partitions).
216
+ - (-) Duplicate delivery: at-least-once delivery means consumers must be idempotent.
217
+
218
+ ### Asynchronous: Event Streaming (Kafka)
219
+
220
+ A durable, ordered, partitioned log of events. Unlike queues (messages are deleted after consumption), events in a stream are retained and multiple consumers can read the same events independently.
221
+
222
+ **Use event streaming when:**
223
+ - Multiple services need to react to the same business event
224
+ - Events need to be replayed (reprocessing, new consumers bootstrapping, audit)
225
+ - Event ordering within a partition matters
226
+ - High throughput (Kafka handles millions of events/second)
227
+
228
+ **Trade-offs:**
229
+ - (+) Multiple independent consumer groups — adding a new consumer doesn't affect existing ones.
230
+ - (+) Event replay enables new consumers to catch up on historical data.
231
+ - (+) High throughput and durability.
232
+ - (-) Operational complexity: Kafka clusters, topic partitioning, consumer group management.
233
+ - (-) Not suitable for low-latency RPC (Kafka adds latency compared to REST/gRPC).
234
+ - (-) Schema evolution requires care — Avro with Schema Registry or protobuf for schema enforcement.
235
+
236
+ ### Choosing a Communication Pattern
237
+
238
+ ```
239
+ Decision matrix:
240
+ Caller needs result immediately AND operation is fast? → REST or gRPC
241
+ Caller needs result immediately AND it's internal service? → gRPC (performance)
242
+ Result not needed immediately AND single consumer? → Message queue
243
+ Result not needed immediately AND multiple consumers? → Event streaming
244
+ External clients (browser/mobile)? → REST only
245
+ Streaming data (real-time, large payloads)? → gRPC streaming or WebSockets
246
+ ```
247
+
248
+ ## Service Discovery Patterns
249
+
250
+ ### DNS-Based Discovery
251
+
252
+ The simplest approach: services register DNS names, and clients resolve the address via DNS lookup. In Kubernetes, every Service gets a DNS name automatically.
253
+
254
+ ```yaml
255
+ # Kubernetes Service — automatic DNS: order-service.production.svc.cluster.local
256
+ apiVersion: v1
257
+ kind: Service
258
+ metadata:
259
+ name: order-service
260
+ namespace: production
261
+ spec:
262
+ selector:
263
+ app: order-service
264
+ ports:
265
+ - name: http
266
+ port: 80
267
+ targetPort: 8080
268
+ - name: grpc
269
+ port: 9090
270
+ targetPort: 9090
271
+ type: ClusterIP
272
+ ```
273
+
274
+ **Use DNS-based discovery when:**
275
+ - Running on Kubernetes (it's free, already works)
276
+ - Simple client-server topology without complex routing rules
277
+ - No need for advanced traffic management (weighted routing, circuit breaking)
278
+
279
+ **Trade-offs:**
280
+ - (+) Zero infrastructure overhead on Kubernetes. DNS is already there.
281
+ - (+) Familiar — developers understand DNS.
282
+ - (-) DNS TTL caching means changes propagate slowly. A crashed pod's IP may still resolve for 30s.
283
+ - (-) No built-in circuit breaking, retries, or load balancing beyond round-robin.
284
+ - (-) Service mesh features (mTLS, observability) require additional tooling.
285
+
286
+ ### Client-Side Service Registry (Consul)
287
+
288
+ Services register themselves with a central registry (Consul). Clients query the registry to discover available instances and perform client-side load balancing.
289
+
290
+ ```hcl
291
+ # Consul service registration
292
+ service {
293
+ name = "order-service"
294
+ id = "order-service-1"
295
+ port = 8080
296
+ tags = ["v2", "production"]
297
+
298
+ check {
299
+ http = "http://localhost:8080/health"
300
+ interval = "10s"
301
+ timeout = "2s"
302
+ }
303
+
304
+ meta {
305
+ version = "2.1.4"
306
+ region = "us-east-1"
307
+ }
308
+ }
309
+ ```
310
+
311
+ **Trade-offs:**
312
+ - (+) Rich health checking — services are removed from the registry when health checks fail.
313
+ - (+) Service metadata (version, region) enables advanced routing.
314
+ - (+) Works outside Kubernetes (VMs, bare metal, multi-cloud).
315
+ - (-) Every client needs a Consul client library.
316
+ - (-) Consul is a distributed system with its own operational complexity.
317
+
318
+ ### Service Mesh (Istio / Linkerd)
319
+
320
+ A sidecar proxy (Envoy) is injected alongside each service container. All traffic flows through the proxy, which handles service discovery, load balancing, circuit breaking, mTLS, and observability — without changing application code.
321
+
322
+ ```yaml
323
+ # Istio VirtualService — traffic routing rules
324
+ apiVersion: networking.istio.io/v1alpha3
325
+ kind: VirtualService
326
+ metadata:
327
+ name: order-service
328
+ spec:
329
+ hosts:
330
+ - order-service
331
+ http:
332
+ - match:
333
+ - headers:
334
+ x-canary:
335
+ exact: "true"
336
+ route:
337
+ - destination:
338
+ host: order-service
339
+ subset: v2
340
+ - route:
341
+ - destination:
342
+ host: order-service
343
+ subset: v1
344
+ weight: 90
345
+ - destination:
346
+ host: order-service
347
+ subset: v2
348
+ weight: 10
349
+ ---
350
+ apiVersion: networking.istio.io/v1alpha3
351
+ kind: DestinationRule
352
+ metadata:
353
+ name: order-service
354
+ spec:
355
+ host: order-service
356
+ trafficPolicy:
357
+ connectionPool:
358
+ http:
359
+ http1MaxPendingRequests: 100
360
+ http2MaxRequests: 1000
361
+ outlierDetection:
362
+ consecutiveErrors: 5
363
+ interval: 30s
364
+ baseEjectionTime: 30s
365
+ subsets:
366
+ - name: v1
367
+ labels:
368
+ version: v1
369
+ - name: v2
370
+ labels:
371
+ version: v2
372
+ ```
373
+
374
+ **Trade-offs:**
375
+ - (+) Circuit breaking, retries, and mTLS with no code changes.
376
+ - (+) Automatic distributed tracing and metrics for all service-to-service traffic.
377
+ - (+) Fine-grained traffic control (canary, A/B testing, fault injection).
378
+ - (-) Significant operational complexity. Istio has a steep learning curve.
379
+ - (-) Sidecar proxy adds latency (~1ms per hop) and memory overhead (~50MB per pod).
380
+ - (-) Debugging mesh configuration issues requires mesh expertise.
381
+
382
+ **Choose service mesh when:** You have 10+ services, a dedicated platform team, and need mTLS, fine-grained traffic control, or comprehensive observability. For most projects with <10 services, DNS-based discovery plus well-designed retry logic in the application is sufficient.
383
+
384
+ ## Networking Topology
385
+
386
+ ### API Gateway Pattern
387
+
388
+ A single entry point for all external traffic. The gateway handles routing, authentication, rate limiting, and protocol translation.
389
+
390
+ ```
391
+ External Client
392
+
393
+ API Gateway ←── Auth middleware (JWT validation, API keys)
394
+ /api/v1/* ←── Rate limiting (per-client quotas)
395
+ /api/v2/* ←── TLS termination
396
+
397
+ Route table:
398
+ /api/v1/orders/* → order-service:8080
399
+ /api/v1/users/* → user-service:8080
400
+ /api/v1/products/* → catalog-service:8080
401
+ /api/v2/orders/* → order-service-v2:8080
402
+ ```
403
+
404
+ **Trade-offs:**
405
+ - (+) Centralized cross-cutting concerns (auth, rate limiting, logging) applied consistently.
406
+ - (+) API versioning without changing internal service URLs.
407
+ - (+) External clients have a stable, versioned API surface while internal services evolve freely.
408
+ - (-) Gateway is a single point of failure — must be highly available.
409
+ - (-) All external traffic flows through one chokepoint — performance and scaling of the gateway matters.
410
+ - (-) Risk of the "fat gateway" anti-pattern: business logic creeping into the gateway.
411
+
412
+ **Gateway options:** Kong, AWS API Gateway, nginx, Traefik, Envoy.
413
+
414
+ ### Direct Service-to-Service (Internal Mesh)
415
+
416
+ Services call each other directly using DNS or service discovery, without routing through a central gateway for internal traffic.
417
+
418
+ **Use for:** Internal service-to-service calls (not externally-facing traffic). The API gateway handles external-to-internal; internal calls use direct addressing.
419
+
420
+ **Trade-offs:**
421
+ - (+) Lower latency (no additional network hop).
422
+ - (+) Simpler topology to reason about for individual service interactions.
423
+ - (-) No centralized enforcement of mTLS or auth between internal services without a service mesh.
424
+ - (-) Service A must know the address of service B — tighter coupling.
425
+
426
+ ### Backend for Frontend (BFF)
427
+
428
+ A dedicated API gateway per client type (mobile, web, partner API). Each BFF aggregates and transforms data from multiple internal services for its specific client.
429
+
430
+ ```
431
+ Mobile App → Mobile BFF ──┬──→ order-service
432
+ Web App → Web BFF ──┤──→ user-service
433
+ Partner → Partner API──┘──→ catalog-service
434
+ ```
435
+
436
+ **Use BFF when:**
437
+ - Mobile and web clients need different data shapes (mobile needs less data, fewer fields)
438
+ - Clients have significantly different performance requirements
439
+ - Different security/auth requirements per client type
440
+
441
+ **Trade-offs:**
442
+ - (+) Each BFF is optimized for its client's needs.
443
+ - (+) Changes to the mobile app don't require changing the web API and vice versa.
444
+ - (-) More services to maintain. Each BFF adds operational overhead.
445
+ - (-) Shared logic between BFFs needs to live somewhere (shared library or common downstream service).
446
+
447
+ ## Data Ownership at the Architecture Level
448
+
449
+ ### The Core Rule: Services Own Their Data
450
+
451
+ Each service owns its data store exclusively. No other service queries that database directly. Data is accessed only through the service's API.
452
+
453
+ **Enforcement:**
454
+ - Each service runs its own database instance (separate RDS instance, separate schema, or separate database within a shared cluster — in order of isolation strength).
455
+ - Database credentials are only distributed to the owning service.
456
+ - CI/CD validates no cross-service imports of database models or query builders.
457
+
458
+ **Why this matters:**
459
+ - Schema changes in one service cannot break another service's direct queries.
460
+ - Each service can choose its storage technology independently (PostgreSQL, MongoDB, Redis, S3).
461
+ - Database scaling decisions are local to the service.
462
+
463
+ ### Data at the Boundary
464
+
465
+ When service A needs data owned by service B:
466
+
467
+ 1. **API call (synchronous):** A calls B's API. Simple but adds latency and creates temporal coupling.
468
+ 2. **Event subscription (asynchronous):** B publishes events when its data changes; A subscribes and maintains a local read-optimized projection of the data it needs.
469
+ 3. **API composition at read time:** A gateway or BFF calls multiple services and assembles the response. Useful for read-heavy pages that aggregate from many services.
470
+
471
+ ### Identifying Data Ownership in Design
472
+
473
+ For each table or collection in your system, answer:
474
+ - Which service is the authority for this data?
475
+ - Which service creates, updates, and deletes records in this store?
476
+ - Which other services need to read this data, and how?
477
+
478
+ If multiple services are updating the same data, that is a design problem. Either the boundary is drawn wrong (the two services should be one service), or there is a missing coordination mechanism (saga, distributed transaction).
479
+
480
+ ## Common Pitfalls
481
+
482
+ **Distributed monolith.** Services that must be deployed together, call each other synchronously for every operation, or share a database. The operational complexity of microservices without the benefits. Root cause: service boundaries drawn along technical layers instead of domain boundaries.
483
+
484
+ **Chatty service interfaces.** Service A makes 10 REST calls to service B to assemble a single response. Each call adds latency and failure surface. Fix: design coarser-grained API operations that return everything the caller needs in one request, or use event-driven replication so A has a local copy of B's data.
485
+
486
+ **Synchronous chains.** Request enters service A, which synchronously calls B, which synchronously calls C. If C is slow, the entire chain backs up. Depth-3+ synchronous chains are a reliability hazard. Fix: async messaging for non-critical paths; circuit breakers and timeouts on all synchronous calls.
487
+
488
+ **Missing idempotency.** Retry logic (required for reliability) causes duplicate processing when the callee doesn't implement idempotent operations. Fix: every mutation operation must accept an idempotency key and deduplicate retried requests.
489
+
490
+ **Service discovery via environment variables.** Hard-coding `SERVICE_B_URL=http://b-service:8080` in environment variables is better than nothing, but fragile — it doesn't handle multiple instances, health checking, or failover. Use DNS-based discovery (Kubernetes Services) or a service registry instead.
491
+
492
+ **No circuit breakers.** Calling a downstream service without a circuit breaker means a slow downstream service will cascade failures upstream as threads/connections pile up. Every synchronous cross-service call must have a timeout and circuit breaker.