specialist-agent 2.12.0 → 3.2.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 (323) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +33 -207
  3. package/dist/catalog.json +15529 -0
  4. package/dist/hw-worker.mjs +254 -0
  5. package/dist/icones/icone.ico +0 -0
  6. package/dist/icones/icone.png +0 -0
  7. package/dist/interface/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
  8. package/dist/interface/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
  9. package/dist/interface/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
  10. package/dist/interface/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
  11. package/dist/interface/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
  12. package/dist/interface/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
  13. package/dist/interface/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
  14. package/dist/interface/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
  15. package/dist/interface/assets/index-BIyqZkro.css +1 -0
  16. package/dist/interface/assets/index-zAegy908.js +13 -0
  17. package/dist/interface/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  18. package/dist/interface/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  19. package/dist/interface/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  20. package/dist/interface/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  21. package/dist/interface/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  22. package/dist/interface/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  23. package/dist/interface/assets/unbounded-latin-500-normal-4slEIF53.woff2 +0 -0
  24. package/dist/interface/assets/unbounded-latin-700-normal-CaoNriVp.woff2 +0 -0
  25. package/dist/interface/assets/unbounded-latin-ext-500-normal-BTIpesyw.woff2 +0 -0
  26. package/dist/interface/assets/unbounded-latin-ext-700-normal-BLzWLLjG.woff2 +0 -0
  27. package/dist/interface/icones/apple-touch-icon.png +0 -0
  28. package/dist/interface/icones/favicon-32.png +0 -0
  29. package/dist/interface/icones/icone-192.png +0 -0
  30. package/dist/interface/icones/icone-512.png +0 -0
  31. package/dist/interface/icones/icone-mascara-512.png +0 -0
  32. package/dist/interface/index.html +19 -0
  33. package/dist/interface/manifest.webmanifest +19 -0
  34. package/dist/interface/sw.js +63 -0
  35. package/dist/specialist-agent.mjs +6919 -0
  36. package/dist/usage-worker.mjs +174 -0
  37. package/package.json +32 -57
  38. package/.claude-plugin/marketplace.json +0 -52
  39. package/.claude-plugin/plugin.json +0 -37
  40. package/.codex/INSTALL.md +0 -145
  41. package/.cursor-plugin/marketplace.json +0 -52
  42. package/.cursor-plugin/plugin.json +0 -37
  43. package/.opencode/INSTALL.md +0 -127
  44. package/.opencode/opencode.json +0 -186
  45. package/agents/analyst-lite.md +0 -48
  46. package/agents/analyst.md +0 -396
  47. package/agents/api-lite.md +0 -43
  48. package/agents/api.md +0 -427
  49. package/agents/architect-lite.md +0 -104
  50. package/agents/architect.md +0 -571
  51. package/agents/autopilot-lite.md +0 -46
  52. package/agents/autopilot.md +0 -196
  53. package/agents/cloud-lite.md +0 -75
  54. package/agents/cloud.md +0 -213
  55. package/agents/data-lite.md +0 -67
  56. package/agents/data.md +0 -306
  57. package/agents/debugger-lite.md +0 -46
  58. package/agents/debugger.md +0 -410
  59. package/agents/deps-lite.md +0 -41
  60. package/agents/deps.md +0 -363
  61. package/agents/designer-lite.md +0 -67
  62. package/agents/designer.md +0 -195
  63. package/agents/devops-lite.md +0 -67
  64. package/agents/devops.md +0 -205
  65. package/agents/docs-lite.md +0 -42
  66. package/agents/docs.md +0 -454
  67. package/agents/executor-lite.md +0 -61
  68. package/agents/executor.md +0 -695
  69. package/agents/explorer-lite.md +0 -55
  70. package/agents/explorer.md +0 -152
  71. package/agents/finance-lite.md +0 -66
  72. package/agents/finance.md +0 -255
  73. package/agents/i18n-lite.md +0 -44
  74. package/agents/i18n.md +0 -594
  75. package/agents/legal-lite.md +0 -113
  76. package/agents/legal.md +0 -302
  77. package/agents/marketing-lite.md +0 -25
  78. package/agents/marketing.md +0 -188
  79. package/agents/memory.md +0 -166
  80. package/agents/orchestrator-lite.md +0 -40
  81. package/agents/orchestrator.md +0 -512
  82. package/agents/pair-lite.md +0 -38
  83. package/agents/pair.md +0 -310
  84. package/agents/perf-lite.md +0 -42
  85. package/agents/perf.md +0 -320
  86. package/agents/planner-lite.md +0 -59
  87. package/agents/planner.md +0 -272
  88. package/agents/product-lite.md +0 -25
  89. package/agents/product.md +0 -195
  90. package/agents/refactor-lite.md +0 -42
  91. package/agents/refactor.md +0 -467
  92. package/agents/ripple-lite.md +0 -106
  93. package/agents/ripple.md +0 -166
  94. package/agents/scout-lite.md +0 -37
  95. package/agents/scout.md +0 -224
  96. package/agents/security-lite.md +0 -66
  97. package/agents/security.md +0 -252
  98. package/agents/sentry-triage-lite.md +0 -54
  99. package/agents/sentry-triage.md +0 -217
  100. package/agents/starter-lite.md +0 -80
  101. package/agents/starter.md +0 -300
  102. package/agents/support-lite.md +0 -24
  103. package/agents/support.md +0 -191
  104. package/agents/tdd-lite.md +0 -43
  105. package/agents/tdd.md +0 -329
  106. package/agents/tester-lite.md +0 -71
  107. package/agents/tester.md +0 -237
  108. package/cli/architectures.mjs +0 -713
  109. package/cli/detect-architecture.mjs +0 -752
  110. package/cli/generate-architecture.mjs +0 -1096
  111. package/cli/index.mjs +0 -1217
  112. package/cli/recommend-architecture.mjs +0 -870
  113. package/hooks/after-review.mjs +0 -130
  114. package/hooks/after-task.mjs +0 -117
  115. package/hooks/before-plan.mjs +0 -155
  116. package/hooks/before-review.mjs +0 -139
  117. package/hooks/hooks.json +0 -66
  118. package/hooks/lifecycle.json +0 -91
  119. package/hooks/native/auto-dispatch.mjs +0 -207
  120. package/hooks/native/auto-format.mjs +0 -176
  121. package/hooks/native/mcp-discovery.mjs +0 -168
  122. package/hooks/native/security-config.json +0 -38
  123. package/hooks/native/security-guard.mjs +0 -323
  124. package/hooks/native/session-context.mjs +0 -179
  125. package/hooks/native/session-end.mjs +0 -42
  126. package/hooks/native/utils.mjs +0 -62
  127. package/hooks/on-error.mjs +0 -129
  128. package/hooks/session-end.mjs +0 -185
  129. package/hooks/session-start.mjs +0 -154
  130. package/packs/angular/ARCHITECTURE.md +0 -814
  131. package/packs/angular/CLAUDE.md +0 -105
  132. package/packs/angular/agents/builder.md +0 -113
  133. package/packs/angular/agents/doctor.md +0 -187
  134. package/packs/angular/agents/migrator.md +0 -101
  135. package/packs/angular/agents/reviewer.md +0 -252
  136. package/packs/angular/agents-lite/builder.md +0 -65
  137. package/packs/angular/agents-lite/doctor.md +0 -64
  138. package/packs/angular/agents-lite/migrator.md +0 -75
  139. package/packs/angular/agents-lite/reviewer.md +0 -69
  140. package/packs/angular/skills/dev-create-component/SKILL.md +0 -56
  141. package/packs/angular/skills/dev-create-injectable/SKILL.md +0 -60
  142. package/packs/angular/skills/dev-create-module/SKILL.md +0 -49
  143. package/packs/angular/skills/dev-create-service/SKILL.md +0 -34
  144. package/packs/angular/skills/dev-create-test/SKILL.md +0 -78
  145. package/packs/angular/skills/dev-generate-types/SKILL.md +0 -37
  146. package/packs/angular/skills/docs-onboard/SKILL.md +0 -42
  147. package/packs/angular/skills/migration-migrate-component/SKILL.md +0 -42
  148. package/packs/angular/skills/migration-migrate-module/SKILL.md +0 -25
  149. package/packs/angular/skills/review-check-architecture/SKILL.md +0 -67
  150. package/packs/angular/skills/review-fix-violations/SKILL.md +0 -43
  151. package/packs/angular/skills/review-review/SKILL.md +0 -43
  152. package/packs/astro/ARCHITECTURE.md +0 -718
  153. package/packs/astro/CLAUDE.md +0 -106
  154. package/packs/astro/agents/builder.md +0 -123
  155. package/packs/astro/agents/doctor.md +0 -200
  156. package/packs/astro/agents/migrator.md +0 -105
  157. package/packs/astro/agents/reviewer.md +0 -253
  158. package/packs/astro/agents-lite/builder.md +0 -71
  159. package/packs/astro/agents-lite/doctor.md +0 -66
  160. package/packs/astro/agents-lite/migrator.md +0 -71
  161. package/packs/astro/agents-lite/reviewer.md +0 -70
  162. package/packs/astro/skills/dev-create-component/SKILL.md +0 -50
  163. package/packs/astro/skills/dev-create-island/SKILL.md +0 -63
  164. package/packs/astro/skills/dev-create-module/SKILL.md +0 -49
  165. package/packs/astro/skills/dev-create-service/SKILL.md +0 -34
  166. package/packs/astro/skills/dev-create-test/SKILL.md +0 -76
  167. package/packs/astro/skills/dev-generate-types/SKILL.md +0 -37
  168. package/packs/astro/skills/docs-onboard/SKILL.md +0 -51
  169. package/packs/astro/skills/migration-migrate-component/SKILL.md +0 -48
  170. package/packs/astro/skills/migration-migrate-module/SKILL.md +0 -25
  171. package/packs/astro/skills/review-check-architecture/SKILL.md +0 -72
  172. package/packs/astro/skills/review-fix-violations/SKILL.md +0 -43
  173. package/packs/astro/skills/review-review/SKILL.md +0 -45
  174. package/packs/nextjs/ARCHITECTURE.md +0 -1033
  175. package/packs/nextjs/CLAUDE.md +0 -106
  176. package/packs/nextjs/agents/builder.md +0 -132
  177. package/packs/nextjs/agents/doctor.md +0 -226
  178. package/packs/nextjs/agents/migrator.md +0 -101
  179. package/packs/nextjs/agents/reviewer.md +0 -243
  180. package/packs/nextjs/agents-lite/builder.md +0 -74
  181. package/packs/nextjs/agents-lite/doctor.md +0 -74
  182. package/packs/nextjs/agents-lite/migrator.md +0 -75
  183. package/packs/nextjs/agents-lite/reviewer.md +0 -73
  184. package/packs/nextjs/skills/dev-create-component/SKILL.md +0 -82
  185. package/packs/nextjs/skills/dev-create-hook/SKILL.md +0 -90
  186. package/packs/nextjs/skills/dev-create-module/SKILL.md +0 -63
  187. package/packs/nextjs/skills/dev-create-service/SKILL.md +0 -35
  188. package/packs/nextjs/skills/dev-create-test/SKILL.md +0 -106
  189. package/packs/nextjs/skills/dev-generate-types/SKILL.md +0 -37
  190. package/packs/nextjs/skills/docs-onboard/SKILL.md +0 -55
  191. package/packs/nextjs/skills/migration-migrate-component/SKILL.md +0 -58
  192. package/packs/nextjs/skills/migration-migrate-module/SKILL.md +0 -25
  193. package/packs/nextjs/skills/review-check-architecture/SKILL.md +0 -101
  194. package/packs/nextjs/skills/review-fix-violations/SKILL.md +0 -48
  195. package/packs/nextjs/skills/review-review/SKILL.md +0 -47
  196. package/packs/nuxt/ARCHITECTURE.md +0 -831
  197. package/packs/nuxt/CLAUDE.md +0 -111
  198. package/packs/nuxt/agents/builder.md +0 -120
  199. package/packs/nuxt/agents/doctor.md +0 -198
  200. package/packs/nuxt/agents/migrator.md +0 -101
  201. package/packs/nuxt/agents/reviewer.md +0 -255
  202. package/packs/nuxt/agents-lite/builder.md +0 -67
  203. package/packs/nuxt/agents-lite/doctor.md +0 -67
  204. package/packs/nuxt/agents-lite/migrator.md +0 -80
  205. package/packs/nuxt/agents-lite/reviewer.md +0 -71
  206. package/packs/nuxt/skills/dev-create-component/SKILL.md +0 -60
  207. package/packs/nuxt/skills/dev-create-composable/SKILL.md +0 -33
  208. package/packs/nuxt/skills/dev-create-module/SKILL.md +0 -49
  209. package/packs/nuxt/skills/dev-create-service/SKILL.md +0 -34
  210. package/packs/nuxt/skills/dev-create-test/SKILL.md +0 -61
  211. package/packs/nuxt/skills/dev-generate-types/SKILL.md +0 -37
  212. package/packs/nuxt/skills/docs-onboard/SKILL.md +0 -49
  213. package/packs/nuxt/skills/migration-migrate-component/SKILL.md +0 -48
  214. package/packs/nuxt/skills/migration-migrate-module/SKILL.md +0 -25
  215. package/packs/nuxt/skills/review-check-architecture/SKILL.md +0 -71
  216. package/packs/nuxt/skills/review-fix-violations/SKILL.md +0 -43
  217. package/packs/nuxt/skills/review-review/SKILL.md +0 -45
  218. package/packs/react/ARCHITECTURE.md +0 -991
  219. package/packs/react/CLAUDE.md +0 -102
  220. package/packs/react/agents/builder.md +0 -113
  221. package/packs/react/agents/doctor.md +0 -203
  222. package/packs/react/agents/migrator.md +0 -101
  223. package/packs/react/agents/reviewer.md +0 -252
  224. package/packs/react/agents-lite/builder.md +0 -65
  225. package/packs/react/agents-lite/doctor.md +0 -64
  226. package/packs/react/agents-lite/migrator.md +0 -74
  227. package/packs/react/agents-lite/reviewer.md +0 -69
  228. package/packs/react/skills/dev-create-component/SKILL.md +0 -53
  229. package/packs/react/skills/dev-create-hook/SKILL.md +0 -78
  230. package/packs/react/skills/dev-create-module/SKILL.md +0 -51
  231. package/packs/react/skills/dev-create-service/SKILL.md +0 -34
  232. package/packs/react/skills/dev-create-test/SKILL.md +0 -92
  233. package/packs/react/skills/dev-generate-types/SKILL.md +0 -37
  234. package/packs/react/skills/docs-onboard/SKILL.md +0 -42
  235. package/packs/react/skills/migration-migrate-component/SKILL.md +0 -44
  236. package/packs/react/skills/migration-migrate-module/SKILL.md +0 -25
  237. package/packs/react/skills/review-check-architecture/SKILL.md +0 -73
  238. package/packs/react/skills/review-fix-violations/SKILL.md +0 -45
  239. package/packs/react/skills/review-review/SKILL.md +0 -44
  240. package/packs/svelte/ARCHITECTURE.md +0 -975
  241. package/packs/svelte/CLAUDE.md +0 -102
  242. package/packs/svelte/agents/builder.md +0 -114
  243. package/packs/svelte/agents/doctor.md +0 -174
  244. package/packs/svelte/agents/migrator.md +0 -101
  245. package/packs/svelte/agents/reviewer.md +0 -238
  246. package/packs/svelte/agents-lite/builder.md +0 -66
  247. package/packs/svelte/agents-lite/doctor.md +0 -67
  248. package/packs/svelte/agents-lite/migrator.md +0 -82
  249. package/packs/svelte/agents-lite/reviewer.md +0 -70
  250. package/packs/svelte/skills/dev-create-component/SKILL.md +0 -77
  251. package/packs/svelte/skills/dev-create-module/SKILL.md +0 -59
  252. package/packs/svelte/skills/dev-create-service/SKILL.md +0 -35
  253. package/packs/svelte/skills/dev-create-store/SKILL.md +0 -94
  254. package/packs/svelte/skills/dev-create-test/SKILL.md +0 -98
  255. package/packs/svelte/skills/dev-generate-types/SKILL.md +0 -37
  256. package/packs/svelte/skills/docs-onboard/SKILL.md +0 -47
  257. package/packs/svelte/skills/migration-migrate-component/SKILL.md +0 -51
  258. package/packs/svelte/skills/migration-migrate-module/SKILL.md +0 -25
  259. package/packs/svelte/skills/review-check-architecture/SKILL.md +0 -79
  260. package/packs/svelte/skills/review-fix-violations/SKILL.md +0 -47
  261. package/packs/svelte/skills/review-review/SKILL.md +0 -45
  262. package/packs/vue/ARCHITECTURE.md +0 -798
  263. package/packs/vue/CLAUDE.md +0 -102
  264. package/packs/vue/agents/builder.md +0 -112
  265. package/packs/vue/agents/doctor.md +0 -185
  266. package/packs/vue/agents/migrator.md +0 -101
  267. package/packs/vue/agents/reviewer.md +0 -249
  268. package/packs/vue/agents-lite/builder.md +0 -65
  269. package/packs/vue/agents-lite/doctor.md +0 -63
  270. package/packs/vue/agents-lite/migrator.md +0 -73
  271. package/packs/vue/agents-lite/reviewer.md +0 -68
  272. package/packs/vue/skills/dev-create-component/SKILL.md +0 -58
  273. package/packs/vue/skills/dev-create-composable/SKILL.md +0 -31
  274. package/packs/vue/skills/dev-create-module/SKILL.md +0 -50
  275. package/packs/vue/skills/dev-create-service/SKILL.md +0 -34
  276. package/packs/vue/skills/dev-create-test/SKILL.md +0 -62
  277. package/packs/vue/skills/dev-generate-types/SKILL.md +0 -37
  278. package/packs/vue/skills/docs-onboard/SKILL.md +0 -42
  279. package/packs/vue/skills/migration-migrate-component/SKILL.md +0 -41
  280. package/packs/vue/skills/migration-migrate-module/SKILL.md +0 -25
  281. package/packs/vue/skills/review-check-architecture/SKILL.md +0 -73
  282. package/packs/vue/skills/review-fix-violations/SKILL.md +0 -42
  283. package/packs/vue/skills/review-review/SKILL.md +0 -43
  284. package/skills/audit/SKILL.md +0 -231
  285. package/skills/autofix/SKILL.md +0 -166
  286. package/skills/autopilot/SKILL.md +0 -286
  287. package/skills/brainstorm/SKILL.md +0 -298
  288. package/skills/checkpoint/SKILL.md +0 -217
  289. package/skills/codereview/SKILL.md +0 -268
  290. package/skills/commit/SKILL.md +0 -150
  291. package/skills/copywriting/SKILL.md +0 -218
  292. package/skills/cro/SKILL.md +0 -234
  293. package/skills/debug/SKILL.md +0 -210
  294. package/skills/design-review/SKILL.md +0 -217
  295. package/skills/discovery/SKILL.md +0 -218
  296. package/skills/estimate/SKILL.md +0 -154
  297. package/skills/finish/SKILL.md +0 -220
  298. package/skills/grill/SKILL.md +0 -270
  299. package/skills/health/SKILL.md +0 -251
  300. package/skills/improve-architecture/SKILL.md +0 -205
  301. package/skills/learn/SKILL.md +0 -260
  302. package/skills/lint/SKILL.md +0 -126
  303. package/skills/migrate-architecture/SKILL.md +0 -242
  304. package/skills/migrate-framework/SKILL.md +0 -172
  305. package/skills/onboard/SKILL.md +0 -168
  306. package/skills/plan/SKILL.md +0 -141
  307. package/skills/prd/SKILL.md +0 -241
  308. package/skills/recall/SKILL.md +0 -112
  309. package/skills/remember/SKILL.md +0 -108
  310. package/skills/seo-audit/SKILL.md +0 -240
  311. package/skills/tdd/SKILL.md +0 -201
  312. package/skills/tutorial/SKILL.md +0 -346
  313. package/skills/verify/SKILL.md +0 -168
  314. package/skills/worktree/SKILL.md +0 -168
  315. package/skills/write-skill/SKILL.md +0 -225
  316. package/templates/autopilot/PROMPT.md +0 -39
  317. package/templates/autopilot/README.md +0 -122
  318. package/templates/autopilot/devcontainer.json +0 -21
  319. package/templates/industry/ecommerce.md +0 -127
  320. package/templates/industry/fintech.md +0 -161
  321. package/templates/industry/saas.md +0 -134
  322. package/templates/session-memory.json +0 -48
  323. package/templates/skill-template/SKILL.md +0 -90
@@ -1,713 +0,0 @@
1
- /**
2
- * Architecture Pattern Registry
3
- *
4
- * Comprehensive catalog of software architecture patterns with:
5
- * - Detection heuristics (directory structure, file patterns, code patterns)
6
- * - Full and simplified (lite) variants
7
- * - Framework-specific adaptations
8
- * - Migration paths between patterns
9
- * - Team size and project size recommendations
10
- */
11
-
12
- // ── Architecture Pattern Definitions ───────────────────
13
-
14
- export const ARCHITECTURE_PATTERNS = {
15
- // ── Frontend Architectures ──────────────────────────
16
-
17
- 'modular': {
18
- id: 'modular',
19
- name: 'Modular (Feature-Based)',
20
- category: 'frontend',
21
- description: 'Vertical slicing by feature/domain. Each module is a bounded context with its own components, services, types.',
22
- bestFor: {
23
- teamSize: '2-15',
24
- projectSize: 'medium-large',
25
- description: 'Teams that want clear ownership per feature, good module isolation without heavy ceremony.',
26
- },
27
- detection: {
28
- requiredDirs: ['modules', 'shared'],
29
- optionalDirs: ['app', 'assets', 'config'],
30
- moduleSubDirs: ['components', 'services', 'types'],
31
- optionalModuleSubDirs: ['adapters', 'hooks', 'composables', 'stores', 'actions', 'views', 'pages', '__tests__'],
32
- filePatterns: ['**/modules/*/index.ts', '**/modules/*/index.tsx'],
33
- antiPatterns: ['controllers', 'models', 'views', 'atoms', 'molecules', 'organisms'],
34
- codePatterns: [],
35
- minScore: 5,
36
- },
37
- migrationPaths: ['clean', 'hexagonal', 'fsd', 'ddd', 'modular-monolith'],
38
- },
39
-
40
- 'fsd': {
41
- id: 'fsd',
42
- name: 'Feature-Sliced Design (FSD)',
43
- category: 'frontend',
44
- description: 'Layered architecture with strict import rules: app > pages > widgets > features > entities > shared.',
45
- bestFor: {
46
- teamSize: '5-30',
47
- projectSize: 'large',
48
- description: 'Large teams needing strict import discipline and clear layer boundaries.',
49
- },
50
- detection: {
51
- requiredDirs: [],
52
- optionalDirs: ['app', 'processes', 'pages', 'widgets', 'features', 'entities', 'shared'],
53
- moduleSubDirs: [],
54
- optionalModuleSubDirs: ['ui', 'model', 'api', 'lib', 'config'],
55
- filePatterns: [],
56
- antiPatterns: ['controllers', 'models'],
57
- codePatterns: [],
58
- minScore: 6,
59
- // Special: needs at least 3 of the FSD layers
60
- customRule: 'fsd-layers',
61
- },
62
- migrationPaths: ['modular', 'clean', 'hexagonal'],
63
- },
64
-
65
- 'atomic': {
66
- id: 'atomic',
67
- name: 'Atomic Design',
68
- category: 'frontend',
69
- description: 'Components organized by granularity: atoms > molecules > organisms > templates > pages.',
70
- bestFor: {
71
- teamSize: '2-10',
72
- projectSize: 'medium',
73
- description: 'Design-system-heavy projects with strong designer-developer collaboration.',
74
- },
75
- detection: {
76
- requiredDirs: [],
77
- optionalDirs: ['atoms', 'molecules', 'organisms', 'templates', 'pages'],
78
- moduleSubDirs: [],
79
- optionalModuleSubDirs: [],
80
- filePatterns: ['**/atoms/**', '**/molecules/**', '**/organisms/**'],
81
- antiPatterns: ['modules', 'features', 'domain', 'use-cases'],
82
- codePatterns: [],
83
- minScore: 4,
84
- customRule: 'atomic-layers',
85
- },
86
- migrationPaths: ['modular', 'fsd'],
87
- },
88
-
89
- 'mvc': {
90
- id: 'mvc',
91
- name: 'MVC / MVVM / Layered',
92
- category: 'fullstack',
93
- description: 'Horizontal slicing by technical layer: controllers, models, views/components.',
94
- bestFor: {
95
- teamSize: '1-5',
96
- projectSize: 'small-medium',
97
- description: 'Small teams familiar with server-side MVC. Simple CRUD applications.',
98
- },
99
- detection: {
100
- requiredDirs: [],
101
- optionalDirs: ['controllers', 'models', 'views', 'middlewares', 'middleware', 'routes', 'repositories', 'services', 'viewmodels', 'view-models', 'presenters'],
102
- moduleSubDirs: [],
103
- optionalModuleSubDirs: [],
104
- filePatterns: ['**/*-controller.*', '**/*-model.*', '**/*.controller.*', '**/*.model.*', '**/*.service.*'],
105
- antiPatterns: ['modules', 'features', 'domain', 'use-cases', 'ports', 'adapters'],
106
- codePatterns: [],
107
- minScore: 4,
108
- },
109
- migrationPaths: ['modular', 'clean', 'modular-monolith'],
110
- },
111
-
112
- 'clean': {
113
- id: 'clean',
114
- name: 'Clean Architecture',
115
- category: 'fullstack',
116
- description: 'Concentric layers with dependency rule: Entities > Use Cases > Adapters > Frameworks.',
117
- bestFor: {
118
- teamSize: '5-30',
119
- projectSize: 'large',
120
- description: 'Complex business domains needing strict separation of concerns and testability.',
121
- },
122
- detection: {
123
- requiredDirs: [],
124
- optionalDirs: ['domain', 'entities', 'use-cases', 'usecases', 'application', 'infrastructure', 'presentation', 'interfaces', 'frameworks'],
125
- moduleSubDirs: [],
126
- optionalModuleSubDirs: ['value-objects', 'repositories', 'dtos'],
127
- filePatterns: ['**/use-cases/**', '**/usecases/**', '**/domain/entities/**'],
128
- antiPatterns: ['controllers', 'models', 'views'],
129
- codePatterns: [],
130
- minScore: 5,
131
- },
132
- migrationPaths: ['hexagonal', 'ddd', 'microservices'],
133
- },
134
-
135
- 'hexagonal': {
136
- id: 'hexagonal',
137
- name: 'Hexagonal (Ports & Adapters)',
138
- category: 'fullstack',
139
- description: 'Core domain isolated by ports (interfaces) and adapters (implementations). Infrastructure swappable.',
140
- bestFor: {
141
- teamSize: '5-20',
142
- projectSize: 'large',
143
- description: 'Projects needing multiple entry points or infrastructure flexibility.',
144
- },
145
- detection: {
146
- requiredDirs: [],
147
- optionalDirs: ['ports', 'adapters', 'domain', 'core', 'infrastructure'],
148
- moduleSubDirs: [],
149
- optionalModuleSubDirs: ['in', 'out', 'primary', 'secondary', 'driving', 'driven'],
150
- filePatterns: ['**/ports/**/*Port*', '**/ports/**/*port*', '**/adapters/**/*Adapter*', '**/adapters/**/*adapter*'],
151
- antiPatterns: ['controllers', 'models', 'views'],
152
- codePatterns: ['Port', 'Adapter'],
153
- minScore: 5,
154
- },
155
- migrationPaths: ['ddd', 'microservices', 'clean'],
156
- },
157
-
158
- 'flat': {
159
- id: 'flat',
160
- name: 'Flat / Component-Driven',
161
- category: 'frontend',
162
- description: 'Single components directory with minimal structure. Typical starting point for small projects.',
163
- bestFor: {
164
- teamSize: '1-3',
165
- projectSize: 'small',
166
- description: 'Solo developers, prototypes, small projects with < 20 components.',
167
- },
168
- detection: {
169
- requiredDirs: ['components'],
170
- optionalDirs: ['pages', 'api', 'utils', 'lib', 'hooks', 'styles'],
171
- moduleSubDirs: [],
172
- optionalModuleSubDirs: [],
173
- filePatterns: [],
174
- antiPatterns: ['modules', 'features', 'domain', 'entities', 'atoms', 'molecules', 'ports', 'adapters'],
175
- codePatterns: [],
176
- minScore: 2,
177
- customRule: 'flat-components',
178
- },
179
- migrationPaths: ['modular', 'atomic', 'fsd'],
180
- },
181
-
182
- 'screaming': {
183
- id: 'screaming',
184
- name: 'Screaming Architecture',
185
- category: 'frontend',
186
- description: 'Top-level directories named after business domains. The structure "screams" what the app does.',
187
- bestFor: {
188
- teamSize: '3-10',
189
- projectSize: 'medium',
190
- description: 'DDD-influenced teams wanting immediate domain visibility.',
191
- },
192
- detection: {
193
- requiredDirs: [],
194
- optionalDirs: [],
195
- moduleSubDirs: [],
196
- optionalModuleSubDirs: [],
197
- filePatterns: [],
198
- antiPatterns: ['components', 'controllers', 'models', 'views', 'modules', 'features'],
199
- codePatterns: [],
200
- minScore: 3,
201
- customRule: 'screaming-domains',
202
- },
203
- migrationPaths: ['modular', 'ddd', 'clean'],
204
- },
205
-
206
- // ── Backend / Fullstack Architectures ──────────────
207
-
208
- 'ddd': {
209
- id: 'ddd',
210
- name: 'Domain-Driven Design (DDD)',
211
- category: 'backend',
212
- description: 'Bounded contexts with aggregates, value objects, domain events. Business language drives structure.',
213
- bestFor: {
214
- teamSize: '10-50',
215
- projectSize: 'large-enterprise',
216
- description: 'Complex business domains with domain experts. Projects where the model IS the product.',
217
- },
218
- detection: {
219
- requiredDirs: [],
220
- optionalDirs: ['aggregates', 'value-objects', 'domain-events', 'bounded-contexts', 'domain', 'shared-kernel'],
221
- moduleSubDirs: [],
222
- optionalModuleSubDirs: ['aggregates', 'value-objects', 'domain-events', 'repositories', 'services'],
223
- filePatterns: ['**/*Aggregate*', '**/*ValueObject*', '**/*DomainEvent*', '**/aggregates/**', '**/value-objects/**'],
224
- antiPatterns: [],
225
- codePatterns: ['AggregateRoot', 'ValueObject', 'DomainEvent'],
226
- minScore: 5,
227
- },
228
- migrationPaths: ['cqrs', 'microservices', 'event-driven'],
229
- },
230
-
231
- 'cqrs': {
232
- id: 'cqrs',
233
- name: 'CQRS (Command Query Separation)',
234
- category: 'backend',
235
- description: 'Separate command (write) and query (read) paths with dedicated models for each.',
236
- bestFor: {
237
- teamSize: '5-30',
238
- projectSize: 'large',
239
- description: 'Systems with asymmetric read/write loads, audit trail requirements.',
240
- },
241
- detection: {
242
- requiredDirs: [],
243
- optionalDirs: ['commands', 'queries', 'command-handlers', 'query-handlers', 'read-models', 'projections', 'write-models'],
244
- moduleSubDirs: [],
245
- optionalModuleSubDirs: ['commands', 'queries', 'handlers'],
246
- filePatterns: ['**/*Command*', '**/*Query*', '**/*Handler*', '**/commands/**', '**/queries/**'],
247
- antiPatterns: [],
248
- codePatterns: ['CommandHandler', 'QueryHandler', 'Command', 'Query'],
249
- minScore: 5,
250
- },
251
- migrationPaths: ['event-driven', 'microservices'],
252
- },
253
-
254
- 'event-driven': {
255
- id: 'event-driven',
256
- name: 'Event-Driven',
257
- category: 'backend',
258
- description: 'Asynchronous communication via events. Decoupled producers and consumers.',
259
- bestFor: {
260
- teamSize: '5-30',
261
- projectSize: 'large',
262
- description: 'Asynchronous workflows, microservices communication, eventual consistency.',
263
- },
264
- detection: {
265
- requiredDirs: [],
266
- optionalDirs: ['events', 'handlers', 'subscribers', 'listeners', 'publishers', 'sagas', 'domain-events', 'event-handlers'],
267
- moduleSubDirs: [],
268
- optionalModuleSubDirs: [],
269
- filePatterns: ['**/*EventHandler*', '**/*Subscriber*', '**/*Listener*', '**/*Publisher*', '**/*Saga*'],
270
- antiPatterns: [],
271
- codePatterns: ['EventEmitter', 'EventBus', 'publish', 'subscribe', 'EventHandler'],
272
- minScore: 4,
273
- },
274
- migrationPaths: ['cqrs', 'microservices'],
275
- },
276
-
277
- 'microservices': {
278
- id: 'microservices',
279
- name: 'Microservices',
280
- category: 'backend',
281
- description: 'Independent services with own databases, deployed separately. Communication via APIs or events.',
282
- bestFor: {
283
- teamSize: '15-100+',
284
- projectSize: 'enterprise',
285
- description: 'Large teams needing independent deployment, different scaling per domain.',
286
- },
287
- detection: {
288
- requiredDirs: [],
289
- optionalDirs: ['services', 'gateway', 'api-gateway', 'shared', 'proto', 'contracts'],
290
- moduleSubDirs: [],
291
- optionalModuleSubDirs: [],
292
- filePatterns: ['**/services/*/package.json', '**/services/*/Dockerfile', '**/apps/*/package.json'],
293
- antiPatterns: [],
294
- codePatterns: [],
295
- minScore: 4,
296
- customRule: 'microservices-check',
297
- },
298
- migrationPaths: ['serverless'],
299
- },
300
-
301
- 'modular-monolith': {
302
- id: 'modular-monolith',
303
- name: 'Modular Monolith',
304
- category: 'fullstack',
305
- description: 'Single deployment with enforced module boundaries. Best of both: isolation without distributed complexity.',
306
- bestFor: {
307
- teamSize: '3-20',
308
- projectSize: 'medium-large',
309
- description: 'Projects that may become microservices later. Module isolation without distributed overhead.',
310
- },
311
- detection: {
312
- requiredDirs: ['modules'],
313
- optionalDirs: ['shared', 'infrastructure', 'core'],
314
- moduleSubDirs: ['domain', 'application', 'infrastructure'],
315
- optionalModuleSubDirs: ['ports', 'adapters', 'events'],
316
- filePatterns: ['**/modules/*/index.ts', '**/modules/*/module.ts'],
317
- antiPatterns: [],
318
- codePatterns: [],
319
- minScore: 6,
320
- customRule: 'modular-monolith-check',
321
- },
322
- migrationPaths: ['microservices', 'ddd', 'hexagonal'],
323
- },
324
-
325
- 'serverless': {
326
- id: 'serverless',
327
- name: 'Serverless / Functions',
328
- category: 'backend',
329
- description: 'Function-based architecture with event triggers. Stateless execution units.',
330
- bestFor: {
331
- teamSize: '1-10',
332
- projectSize: 'small-medium',
333
- description: 'Event-driven workloads, variable traffic, cost-optimized for low-traffic APIs.',
334
- },
335
- detection: {
336
- requiredDirs: [],
337
- optionalDirs: ['functions', 'lambdas', 'handlers', 'api'],
338
- moduleSubDirs: [],
339
- optionalModuleSubDirs: [],
340
- filePatterns: ['serverless.yml', 'serverless.ts', 'netlify.toml', 'vercel.json', 'firebase.json', 'amplify.yml', 'sam-template.yaml', 'template.yaml'],
341
- antiPatterns: [],
342
- codePatterns: ['exports.handler', 'module.exports.handler'],
343
- minScore: 3,
344
- },
345
- migrationPaths: ['microservices', 'modular'],
346
- },
347
-
348
- 'unstructured': {
349
- id: 'unstructured',
350
- name: 'Unstructured / Ad-hoc',
351
- category: 'any',
352
- description: 'No clear architecture pattern. Files organized loosely or by convenience.',
353
- bestFor: {
354
- teamSize: '1',
355
- projectSize: 'prototype',
356
- description: 'Quick prototypes, experiments. Should evolve into a proper architecture.',
357
- },
358
- detection: {
359
- requiredDirs: [],
360
- optionalDirs: [],
361
- moduleSubDirs: [],
362
- optionalModuleSubDirs: [],
363
- filePatterns: [],
364
- antiPatterns: [],
365
- codePatterns: [],
366
- minScore: 0,
367
- customRule: 'unstructured-fallback',
368
- },
369
- migrationPaths: ['flat', 'modular', 'mvc'],
370
- },
371
- }
372
-
373
- // ── Monorepo Pattern Definitions ──────────────────────
374
-
375
- export const MONOREPO_PATTERNS = {
376
- 'turborepo': {
377
- id: 'turborepo',
378
- name: 'Turborepo',
379
- detectFiles: ['turbo.json'],
380
- detectDirs: ['apps', 'packages'],
381
- workspaceConfig: 'turbo.json',
382
- },
383
- 'nx': {
384
- id: 'nx',
385
- name: 'Nx',
386
- detectFiles: ['nx.json'],
387
- detectDirs: ['apps', 'libs'],
388
- workspaceConfig: 'nx.json',
389
- detectDeps: ['@nx/workspace', '@nrwl/workspace', 'nx'],
390
- },
391
- 'lerna': {
392
- id: 'lerna',
393
- name: 'Lerna',
394
- detectFiles: ['lerna.json'],
395
- detectDirs: ['packages'],
396
- workspaceConfig: 'lerna.json',
397
- },
398
- 'pnpm': {
399
- id: 'pnpm',
400
- name: 'pnpm Workspaces',
401
- detectFiles: ['pnpm-workspace.yaml'],
402
- detectDirs: [],
403
- workspaceConfig: 'pnpm-workspace.yaml',
404
- },
405
- 'workspaces': {
406
- id: 'workspaces',
407
- name: 'npm/yarn Workspaces',
408
- detectFiles: [],
409
- detectDirs: [],
410
- workspaceConfig: 'package.json',
411
- customRule: 'package-json-workspaces',
412
- },
413
- }
414
-
415
- // ── Framework-Specific Architecture Adaptations ───────
416
-
417
- export const FRAMEWORK_ADAPTATIONS = {
418
- // For each framework, maps architecture patterns to their specific adaptations
419
- nextjs: {
420
- routerType: null, // detected dynamically: 'app-router' | 'pages-router'
421
- adaptations: {
422
- modular: {
423
- srcRoot: 'src',
424
- routeDir: 'app',
425
- moduleDir: 'modules',
426
- sharedDir: 'shared',
427
- stateManagement: { client: 'zustand', server: 'tanstack-react-query' },
428
- layers: ['components', 'hooks', 'services', 'adapters', 'stores', 'actions', 'types', '__tests__'],
429
- liteLayers: ['components', 'hooks', 'services', 'types'],
430
- specialDirs: { actions: 'Server Actions', stores: 'Zustand stores' },
431
- },
432
- clean: {
433
- srcRoot: 'src',
434
- layers: { domain: 'domain', application: 'application', infrastructure: 'infrastructure', presentation: 'app' },
435
- liteLayers: { core: 'core', infra: 'infra', presentation: 'app' },
436
- },
437
- hexagonal: {
438
- srcRoot: 'src',
439
- layers: { core: { domain: true, ports: { in: true, out: true }, useCases: true }, adapters: { in: { web: 'app' }, out: { api: true, storage: true } } },
440
- liteLayers: { core: { domain: true, ports: true }, adapters: true },
441
- },
442
- },
443
- },
444
-
445
- react: {
446
- adaptations: {
447
- modular: {
448
- srcRoot: 'src',
449
- routeDir: 'app/router',
450
- moduleDir: 'modules',
451
- sharedDir: 'shared',
452
- stateManagement: { client: 'zustand', server: 'tanstack-react-query' },
453
- layers: ['components', 'hooks', 'services', 'adapters', 'stores', 'types', 'pages', '__tests__'],
454
- liteLayers: ['components', 'hooks', 'services', 'types'],
455
- specialDirs: { stores: 'Zustand stores', pages: 'Route pages' },
456
- },
457
- clean: {
458
- srcRoot: 'src',
459
- layers: { domain: 'domain', application: 'application', infrastructure: 'infrastructure', presentation: 'presentation' },
460
- liteLayers: { core: 'core', infra: 'infra', presentation: 'presentation' },
461
- },
462
- hexagonal: {
463
- srcRoot: 'src',
464
- layers: { core: { domain: true, ports: { in: true, out: true }, useCases: true }, adapters: { in: { web: 'presentation' }, out: { api: true, storage: true } } },
465
- liteLayers: { core: { domain: true, ports: true }, adapters: true },
466
- },
467
- },
468
- },
469
-
470
- vue: {
471
- adaptations: {
472
- modular: {
473
- srcRoot: 'src',
474
- routeDir: 'app/router',
475
- moduleDir: 'modules',
476
- sharedDir: 'shared',
477
- stateManagement: { client: 'pinia', server: 'tanstack-vue-query' },
478
- layers: ['components', 'composables', 'services', 'adapters', 'stores', 'types', 'views', '__tests__'],
479
- liteLayers: ['components', 'composables', 'services', 'types'],
480
- specialDirs: { stores: 'Pinia stores', views: 'Route views', composables: 'Vue composables' },
481
- },
482
- clean: {
483
- srcRoot: 'src',
484
- layers: { domain: 'domain', application: 'application', infrastructure: 'infrastructure', presentation: 'presentation' },
485
- liteLayers: { core: 'core', infra: 'infra', presentation: 'presentation' },
486
- },
487
- hexagonal: {
488
- srcRoot: 'src',
489
- layers: { core: { domain: true, ports: { in: true, out: true }, useCases: true }, adapters: { in: { web: 'presentation' }, out: { api: true, storage: true } } },
490
- liteLayers: { core: { domain: true, ports: true }, adapters: true },
491
- },
492
- },
493
- },
494
-
495
- nuxt: {
496
- adaptations: {
497
- modular: {
498
- srcRoot: '',
499
- routeDir: 'pages',
500
- moduleDir: 'modules',
501
- sharedDir: 'shared',
502
- stateManagement: { client: 'pinia', server: 'tanstack-vue-query' },
503
- layers: ['components', 'composables', 'services', 'adapters', 'stores', 'types', '__tests__'],
504
- liteLayers: ['components', 'composables', 'services', 'types'],
505
- specialDirs: { stores: 'Pinia stores', composables: 'Auto-imported composables' },
506
- nuxtDirs: ['server/api', 'server/utils', 'plugins', 'middleware', 'layouts'],
507
- },
508
- clean: {
509
- srcRoot: '',
510
- layers: { domain: 'domain', application: 'application', infrastructure: 'server', presentation: 'pages' },
511
- liteLayers: { core: 'core', infra: 'server', presentation: 'pages' },
512
- },
513
- },
514
- },
515
-
516
- svelte: {
517
- adaptations: {
518
- modular: {
519
- srcRoot: 'src',
520
- routeDir: 'routes',
521
- moduleDir: 'lib/modules',
522
- sharedDir: 'lib/shared',
523
- stateManagement: { client: 'svelte-stores', server: 'tanstack-svelte-query' },
524
- layers: ['components', 'stores', 'services', 'adapters', 'types', '__tests__'],
525
- liteLayers: ['components', 'stores', 'services', 'types'],
526
- specialDirs: { stores: 'Svelte stores ($lib)' },
527
- },
528
- clean: {
529
- srcRoot: 'src',
530
- layers: { domain: 'lib/domain', application: 'lib/application', infrastructure: 'lib/infrastructure', presentation: 'routes' },
531
- liteLayers: { core: 'lib/core', infra: 'lib/infra', presentation: 'routes' },
532
- },
533
- },
534
- },
535
-
536
- angular: {
537
- adaptations: {
538
- modular: {
539
- srcRoot: 'src',
540
- routeDir: 'app',
541
- moduleDir: 'app/modules',
542
- sharedDir: 'app/shared',
543
- stateManagement: { client: 'ngrx-signals', server: 'tanstack-angular-query' },
544
- layers: ['components', 'services', 'models', 'guards', 'pipes', 'directives', 'types', '__tests__'],
545
- liteLayers: ['components', 'services', 'models', 'types'],
546
- specialDirs: { guards: 'Route guards', pipes: 'Angular pipes' },
547
- },
548
- clean: {
549
- srcRoot: 'src',
550
- layers: { domain: 'app/domain', application: 'app/application', infrastructure: 'app/infrastructure', presentation: 'app/presentation' },
551
- liteLayers: { core: 'app/core', infra: 'app/infra', presentation: 'app/presentation' },
552
- },
553
- },
554
- },
555
-
556
- astro: {
557
- adaptations: {
558
- modular: {
559
- srcRoot: 'src',
560
- routeDir: 'pages',
561
- moduleDir: 'modules',
562
- sharedDir: 'shared',
563
- stateManagement: { client: 'nanostores', server: 'astro-data' },
564
- layers: ['components', 'services', 'types', 'islands', '__tests__'],
565
- liteLayers: ['components', 'services', 'types'],
566
- specialDirs: { islands: 'Interactive framework islands', content: 'Content collections' },
567
- astroDirs: ['content', 'layouts', 'islands'],
568
- },
569
- clean: {
570
- srcRoot: 'src',
571
- layers: { domain: 'domain', application: 'application', infrastructure: 'infrastructure', presentation: 'pages' },
572
- liteLayers: { core: 'core', infra: 'infra', presentation: 'pages' },
573
- },
574
- },
575
- },
576
- }
577
-
578
- // ── Migration Map ─────────────────────────────────────
579
-
580
- export const MIGRATION_MAP = {
581
- // From -> To: effort + description
582
- 'unstructured->flat': { effort: 'low', description: 'Organize files into components/pages/utils folders' },
583
- 'unstructured->modular': { effort: 'medium', description: 'Group files by feature into modules with barrel exports' },
584
- 'unstructured->mvc': { effort: 'low', description: 'Organize by technical layer (controllers, models, services)' },
585
-
586
- 'flat->modular': { effort: 'medium', description: 'Group components by domain into modules, add services/types layers' },
587
- 'flat->atomic': { effort: 'medium', description: 'Reorganize components by granularity (atoms, molecules, organisms)' },
588
- 'flat->fsd': { effort: 'high', description: 'Restructure into FSD layers with strict import rules' },
589
-
590
- 'mvc->modular': { effort: 'medium', description: 'Shift from horizontal to vertical slicing, group by feature' },
591
- 'mvc->clean': { effort: 'high', description: 'Extract domain layer, define use cases, invert dependencies' },
592
- 'mvc->modular-monolith': { effort: 'high', description: 'Extract modules with enforced boundaries, add domain layers' },
593
-
594
- 'modular->clean': { effort: 'medium', description: 'Add domain/application/infrastructure layers inside each module' },
595
- 'modular->hexagonal': { effort: 'medium', description: 'Define ports and adapters, isolate domain from infrastructure' },
596
- 'modular->fsd': { effort: 'medium', description: 'Reorganize modules into FSD layers (features, entities, shared)' },
597
- 'modular->ddd': { effort: 'high', description: 'Add aggregates, value objects, domain events within bounded contexts' },
598
- 'modular->modular-monolith': { effort: 'low', description: 'Enforce strict module boundaries, add internal layering' },
599
-
600
- 'atomic->modular': { effort: 'medium', description: 'Regroup by domain instead of granularity, preserve design system' },
601
- 'atomic->fsd': { effort: 'medium', description: 'Map atoms/molecules to shared, organisms to features/entities' },
602
-
603
- 'clean->hexagonal': { effort: 'low', description: 'Rename layers, formalize ports/adapters, same dependency direction' },
604
- 'clean->ddd': { effort: 'medium', description: 'Add aggregates, bounded contexts, domain events' },
605
- 'clean->microservices': { effort: 'high', description: 'Extract bounded contexts into independent services' },
606
-
607
- 'hexagonal->ddd': { effort: 'medium', description: 'Add DDD tactical patterns (aggregates, value objects) to domain' },
608
- 'hexagonal->microservices': { effort: 'medium', description: 'Extract adapters into standalone services' },
609
-
610
- 'ddd->cqrs': { effort: 'medium', description: 'Separate command and query paths, add read models' },
611
- 'ddd->microservices': { effort: 'high', description: 'Extract bounded contexts into independent deployable services' },
612
- 'ddd->event-driven': { effort: 'medium', description: 'Add event bus, publish domain events between contexts' },
613
-
614
- 'modular-monolith->microservices': { effort: 'high', description: 'Extract modules into independent services (Strangler Fig)' },
615
- 'modular-monolith->ddd': { effort: 'medium', description: 'Add DDD patterns within module boundaries' },
616
- 'modular-monolith->hexagonal': { effort: 'medium', description: 'Add ports/adapters structure within each module' },
617
-
618
- 'fsd->modular': { effort: 'medium', description: 'Merge FSD layers into feature modules, simplify import rules' },
619
- 'fsd->clean': { effort: 'high', description: 'Map FSD layers to Clean Architecture concentric layers' },
620
-
621
- 'screaming->modular': { effort: 'low', description: 'Add internal structure (services, types, index.ts) to domain dirs' },
622
- 'screaming->ddd': { effort: 'medium', description: 'Formalize domain dirs into bounded contexts with DDD patterns' },
623
-
624
- 'event-driven->cqrs': { effort: 'medium', description: 'Separate command/query handlers, add read model projections' },
625
- 'event-driven->microservices': { effort: 'medium', description: 'Each event consumer becomes its own service' },
626
-
627
- 'cqrs->microservices': { effort: 'medium', description: 'Split command/query services, separate deployments' },
628
-
629
- 'serverless->microservices': { effort: 'medium', description: 'Group functions into services, add service boundaries' },
630
- 'serverless->modular': { effort: 'medium', description: 'Organize functions into modules with shared infrastructure' },
631
- }
632
-
633
- // ── Architecture Suggestion Engine ────────────────────
634
-
635
- export function getSuggestedArchitectures(currentArch, framework, projectInfo) {
636
- const suggestions = []
637
- const pattern = ARCHITECTURE_PATTERNS[currentArch]
638
- if (!pattern) return suggestions
639
-
640
- const frameworkAdaptations = FRAMEWORK_ADAPTATIONS[framework] || {}
641
-
642
- for (const targetId of pattern.migrationPaths) {
643
- const target = ARCHITECTURE_PATTERNS[targetId]
644
- if (!target) continue
645
-
646
- const migrationKey = `${currentArch}->${targetId}`
647
- const migration = MIGRATION_MAP[migrationKey]
648
- if (!migration) continue
649
-
650
- // Check if framework has adaptation for this target
651
- const hasFrameworkSupport = frameworkAdaptations.adaptations?.[targetId] || targetId === 'modular'
652
-
653
- const suggestion = {
654
- id: targetId,
655
- name: target.name,
656
- description: target.description,
657
- effort: migration.effort,
658
- migrationDescription: migration.description,
659
- bestFor: target.bestFor,
660
- hasFrameworkSupport: !!hasFrameworkSupport,
661
- variants: [],
662
- }
663
-
664
- // Add Full variant
665
- suggestion.variants.push({
666
- id: 'full',
667
- name: `${target.name} (Full)`,
668
- description: `Complete implementation with all layers and patterns. ${target.bestFor.description}`,
669
- teamSize: target.bestFor.teamSize,
670
- complexity: 'high',
671
- })
672
-
673
- // Add Lite variant
674
- suggestion.variants.push({
675
- id: 'lite',
676
- name: `${target.name} (Simplified)`,
677
- description: `Streamlined version with fewer layers. Same core principles, less ceremony. Good for smaller teams.`,
678
- teamSize: reducedTeamSize(target.bestFor.teamSize),
679
- complexity: 'medium',
680
- })
681
-
682
- // Add monorepo variant if applicable
683
- if (projectInfo?.isMonorepo && ['modular', 'clean', 'hexagonal', 'modular-monolith', 'microservices'].includes(targetId)) {
684
- suggestion.variants.push({
685
- id: 'monorepo',
686
- name: `${target.name} (Monorepo)`,
687
- description: `Adapted for monorepo with shared packages. Each app/service follows the architecture independently.`,
688
- teamSize: target.bestFor.teamSize,
689
- complexity: 'high',
690
- })
691
- }
692
-
693
- suggestions.push(suggestion)
694
- }
695
-
696
- // Sort by effort (low first), then by framework support
697
- suggestions.sort((a, b) => {
698
- const effortOrder = { low: 0, medium: 1, high: 2 }
699
- if (a.hasFrameworkSupport !== b.hasFrameworkSupport) return a.hasFrameworkSupport ? -1 : 1
700
- return (effortOrder[a.effort] || 2) - (effortOrder[b.effort] || 2)
701
- })
702
-
703
- return suggestions
704
- }
705
-
706
- function reducedTeamSize(teamSize) {
707
- const match = teamSize.match(/(\d+)-(\d+)/)
708
- if (!match) return '1-5'
709
- const min = Math.max(1, Math.floor(parseInt(match[1]) / 2))
710
- const max = Math.max(min + 2, Math.floor(parseInt(match[2]) / 2))
711
- return `${min}-${max}`
712
- }
713
-