@mytechtoday/augment-extensions 2.5.0 → 3.1.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 (915) hide show
  1. package/AGENTS.md +2 -1
  2. package/README.md +27 -1357
  3. package/augment-extensions/coding-standards/bash/CHANGELOG.md +50 -50
  4. package/augment-extensions/coding-standards/css/CHANGELOG.md +50 -50
  5. package/augment-extensions/coding-standards/go/CHANGELOG.md +50 -50
  6. package/augment-extensions/coding-standards/html/CHANGELOG.md +50 -50
  7. package/augment-extensions/coding-standards/html-css-js/CHANGELOG.md +50 -50
  8. package/augment-extensions/coding-standards/js/CHANGELOG.md +50 -50
  9. package/augment-extensions/coding-standards/php/CHANGELOG.md +50 -50
  10. package/augment-extensions/coding-standards/powershell/CHANGELOG.md +50 -50
  11. package/augment-extensions/coding-standards/python/CHANGELOG.md +50 -50
  12. package/augment-extensions/coding-standards/react/CHANGELOG.md +50 -50
  13. package/augment-extensions/coding-standards/typescript/CHANGELOG.md +39 -39
  14. package/augment-extensions/coding-standards/typescript/VERSION +2 -2
  15. package/augment-extensions/coding-standards/typescript/examples/biome.json +199 -199
  16. package/augment-extensions/coding-standards/typescript/examples/eslint-flat-config.js +166 -166
  17. package/augment-extensions/coding-standards/typescript/examples/monorepo-config/README.md +47 -47
  18. package/augment-extensions/coding-standards/typescript/examples/monorepo-config/package.json +37 -37
  19. package/augment-extensions/coding-standards/typescript/examples/monorepo-config/pnpm-workspace.yaml +5 -5
  20. package/augment-extensions/coding-standards/typescript/examples/monorepo-config/tsconfig.base.json +50 -50
  21. package/augment-extensions/coding-standards/typescript/examples/monorepo-config/turbo.json +47 -47
  22. package/augment-extensions/coding-standards/typescript/examples/vitest-setup.ts +198 -198
  23. package/augment-extensions/coding-standards/typescript/metadata.json +46 -46
  24. package/augment-extensions/coding-standards/typescript/rules/architecture.md +1096 -1096
  25. package/augment-extensions/coding-standards/typescript/rules/error-handling.md +1174 -1174
  26. package/augment-extensions/coding-standards/typescript/rules/modern-features.md +625 -625
  27. package/augment-extensions/coding-standards/typescript/rules/monorepo.md +745 -745
  28. package/augment-extensions/coding-standards/typescript/rules/security-performance.md +850 -850
  29. package/augment-extensions/coding-standards/typescript/rules/testing.md +918 -918
  30. package/augment-extensions/coding-standards/typescript/rules/tooling.md +1071 -1071
  31. package/augment-extensions/coding-standards/typescript/rules/type-patterns.md +750 -750
  32. package/augment-extensions/domain-rules/api-design/CHANGELOG.md +50 -50
  33. package/augment-extensions/domain-rules/database/CHANGELOG.md +50 -50
  34. package/augment-extensions/domain-rules/design/color/themes/catppuccin-latte/CHANGELOG.md +50 -50
  35. package/augment-extensions/domain-rules/design/color/themes/catppuccin-mocha/CHANGELOG.md +50 -50
  36. package/augment-extensions/domain-rules/design/color/themes/dracula/CHANGELOG.md +50 -50
  37. package/augment-extensions/domain-rules/design/color/themes/gruvbox-dark/CHANGELOG.md +50 -50
  38. package/augment-extensions/domain-rules/design/color/themes/gruvbox-light/CHANGELOG.md +50 -50
  39. package/augment-extensions/domain-rules/design/color/themes/high-contrast/CHANGELOG.md +50 -50
  40. package/augment-extensions/domain-rules/design/color/themes/monokai/CHANGELOG.md +50 -50
  41. package/augment-extensions/domain-rules/design/color/themes/nord/CHANGELOG.md +50 -50
  42. package/augment-extensions/domain-rules/design/color/themes/one-dark/CHANGELOG.md +50 -50
  43. package/augment-extensions/domain-rules/design/color/themes/one-light/CHANGELOG.md +50 -50
  44. package/augment-extensions/domain-rules/design/color/themes/solarized-dark/CHANGELOG.md +50 -50
  45. package/augment-extensions/domain-rules/design/color/themes/solarized-light/CHANGELOG.md +50 -50
  46. package/augment-extensions/domain-rules/design/color/themes/tokyo-night/CHANGELOG.md +50 -50
  47. package/augment-extensions/domain-rules/mcp/CHANGELOG.md +50 -50
  48. package/augment-extensions/domain-rules/security/CHANGELOG.md +50 -50
  49. package/augment-extensions/domain-rules/seo-sales-marketing/CHANGELOG.md +50 -50
  50. package/augment-extensions/domain-rules/software-architecture/CHANGELOG.md +50 -50
  51. package/augment-extensions/domain-rules/wordpress/CHANGELOG.md +50 -50
  52. package/augment-extensions/domain-rules/wordpress-plugin/CHANGELOG.md +50 -50
  53. package/augment-extensions/examples/design-patterns/CHANGELOG.md +50 -50
  54. package/augment-extensions/examples/gutenberg-block-plugin/CHANGELOG.md +50 -50
  55. package/augment-extensions/examples/rest-api-plugin/CHANGELOG.md +50 -50
  56. package/augment-extensions/examples/woocommerce-extension/CHANGELOG.md +50 -50
  57. package/augment-extensions/workflows/adr-support/CHANGELOG.md +50 -50
  58. package/augment-extensions/workflows/database/CHANGELOG.md +50 -50
  59. package/augment-extensions/workflows/wordpress-plugin/CHANGELOG.md +50 -50
  60. package/cli/AGENTS.md +21 -21
  61. package/cli/dist/analysis/ast-parser.d.ts +11 -31
  62. package/cli/dist/analysis/ast-parser.d.ts.map +1 -1
  63. package/cli/dist/analysis/ast-parser.js +28 -77
  64. package/cli/dist/analysis/ast-parser.js.map +1 -1
  65. package/cli/dist/analysis/complexity-analyzer.d.ts +4 -22
  66. package/cli/dist/analysis/complexity-analyzer.d.ts.map +1 -1
  67. package/cli/dist/analysis/complexity-analyzer.js +68 -96
  68. package/cli/dist/analysis/complexity-analyzer.js.map +1 -1
  69. package/cli/dist/analysis/dependency-analyzer.d.ts +1 -15
  70. package/cli/dist/analysis/dependency-analyzer.d.ts.map +1 -1
  71. package/cli/dist/analysis/dependency-analyzer.js +163 -116
  72. package/cli/dist/analysis/dependency-analyzer.js.map +1 -1
  73. package/cli/dist/analysis/security-scanner.d.ts +0 -5
  74. package/cli/dist/analysis/security-scanner.d.ts.map +1 -1
  75. package/cli/dist/analysis/security-scanner.js +88 -180
  76. package/cli/dist/analysis/security-scanner.js.map +1 -1
  77. package/cli/dist/analysis/types.d.ts +1 -40
  78. package/cli/dist/analysis/types.d.ts.map +1 -1
  79. package/cli/dist/cli.js +18 -39
  80. package/cli/dist/cli.js.map +1 -1
  81. package/cli/dist/commands/code-analysis.d.ts +0 -5
  82. package/cli/dist/commands/code-analysis.d.ts.map +1 -1
  83. package/cli/dist/commands/code-analysis.js +114 -133
  84. package/cli/dist/commands/code-analysis.js.map +1 -1
  85. package/cli/dist/commands/gui.d.ts +4 -0
  86. package/cli/dist/commands/gui.d.ts.map +1 -1
  87. package/cli/dist/commands/gui.js +45 -6
  88. package/cli/dist/commands/gui.js.map +1 -1
  89. package/cli/dist/commands/link.d.ts.map +1 -1
  90. package/cli/dist/commands/link.js +2 -2
  91. package/cli/dist/commands/link.js.map +1 -1
  92. package/cli/dist/commands/search.d.ts.map +1 -1
  93. package/cli/dist/commands/search.js +20 -79
  94. package/cli/dist/commands/search.js.map +1 -1
  95. package/cli/dist/commands/show.js +8 -32
  96. package/cli/dist/commands/show.js.map +1 -1
  97. package/cli/dist/commands/unlink.d.ts.map +1 -1
  98. package/cli/dist/commands/unlink.js +5 -4
  99. package/cli/dist/commands/unlink.js.map +1 -1
  100. package/cli/dist/commands/update.d.ts.map +1 -1
  101. package/cli/dist/commands/update.js +6 -2
  102. package/cli/dist/commands/update.js.map +1 -1
  103. package/cli/dist/commands/upgrade.d.ts +0 -8
  104. package/cli/dist/commands/upgrade.d.ts.map +1 -1
  105. package/cli/dist/commands/upgrade.js +16 -34
  106. package/cli/dist/commands/upgrade.js.map +1 -1
  107. package/cli/dist/commands/use.d.ts +0 -8
  108. package/cli/dist/commands/use.d.ts.map +1 -1
  109. package/cli/dist/commands/use.js +22 -46
  110. package/cli/dist/commands/use.js.map +1 -1
  111. package/cli/dist/commands/version-info.d.ts +0 -8
  112. package/cli/dist/commands/version-info.d.ts.map +1 -1
  113. package/cli/dist/commands/version-info.js +13 -37
  114. package/cli/dist/commands/version-info.js.map +1 -1
  115. package/cli/dist/core/module-loader.d.ts +3 -43
  116. package/cli/dist/core/module-loader.d.ts.map +1 -1
  117. package/cli/dist/core/module-loader.js +8 -55
  118. package/cli/dist/core/module-loader.js.map +1 -1
  119. package/cli/dist/index.d.ts +0 -4
  120. package/cli/dist/index.d.ts.map +1 -1
  121. package/cli/dist/index.js +0 -5
  122. package/cli/dist/index.js.map +1 -1
  123. package/cli/dist/utils/ai-prompts.js +124 -124
  124. package/cli/dist/utils/config-loader.d.ts +3 -39
  125. package/cli/dist/utils/config-loader.d.ts.map +1 -1
  126. package/cli/dist/utils/config-loader.js +20 -64
  127. package/cli/dist/utils/config-loader.js.map +1 -1
  128. package/cli/dist/utils/extractCommandHelp.d.ts +10 -1
  129. package/cli/dist/utils/extractCommandHelp.d.ts.map +1 -1
  130. package/cli/dist/utils/extractCommandHelp.js +83 -15
  131. package/cli/dist/utils/extractCommandHelp.js.map +1 -1
  132. package/cli/dist/utils/module-system.d.ts.map +1 -1
  133. package/cli/dist/utils/module-system.js +10 -4
  134. package/cli/dist/utils/module-system.js.map +1 -1
  135. package/package.json +137 -136
  136. package/augment-extensions/workflows/beads/CHANGELOG.md +0 -51
  137. package/augment-extensions/workflows/beads/README.md +0 -135
  138. package/augment-extensions/workflows/beads/examples/complete-workflow-example.md +0 -278
  139. package/augment-extensions/workflows/beads/metadata.json +0 -23
  140. package/augment-extensions/workflows/beads/module.json +0 -55
  141. package/augment-extensions/workflows/beads/rules/best-practices.md +0 -398
  142. package/augment-extensions/workflows/beads/rules/file-format.md +0 -327
  143. package/augment-extensions/workflows/beads/rules/manual-setup.md +0 -315
  144. package/augment-extensions/workflows/beads/rules/workflow.md +0 -326
  145. package/augment-extensions/workflows/beads-integration/CHANGELOG.md +0 -51
  146. package/augment-extensions/workflows/beads-integration/IMPLEMENTATION-STATUS.md +0 -145
  147. package/augment-extensions/workflows/beads-integration/README.md +0 -143
  148. package/augment-extensions/workflows/beads-integration/config/defaults.json +0 -32
  149. package/augment-extensions/workflows/beads-integration/config/schema.json +0 -140
  150. package/augment-extensions/workflows/beads-integration/examples/basic-task-generation.md +0 -293
  151. package/augment-extensions/workflows/beads-integration/metadata.json +0 -30
  152. package/augment-extensions/workflows/beads-integration/module.json +0 -75
  153. package/augment-extensions/workflows/beads-integration/rules/core-rules.md +0 -219
  154. package/augment-extensions/workflows/beads-integration/rules/effectiveness-standards.md +0 -256
  155. package/augment-extensions/workflows/beads-integration/rules/task-generation.md +0 -607
  156. package/augment-extensions/writing-standards/literature/shakespeare/ANNOUNCEMENT.md +0 -176
  157. package/augment-extensions/writing-standards/literature/shakespeare/CHANGELOG.md +0 -51
  158. package/augment-extensions/writing-standards/literature/shakespeare/CHARACTER-THEME-VALIDATION-REPORT.md +0 -465
  159. package/augment-extensions/writing-standards/literature/shakespeare/DRAMA-VALIDATION-REPORT.md +0 -217
  160. package/augment-extensions/writing-standards/literature/shakespeare/LANGUAGE-VALIDATION-REPORT.md +0 -195
  161. package/augment-extensions/writing-standards/literature/shakespeare/PHASE6-VALIDATION-REPORT.md +0 -359
  162. package/augment-extensions/writing-standards/literature/shakespeare/README.md +0 -126
  163. package/augment-extensions/writing-standards/literature/shakespeare/examples/annotated-sonnets/sonnet-130.md +0 -225
  164. package/augment-extensions/writing-standards/literature/shakespeare/examples/annotated-sonnets/sonnet-18.md +0 -188
  165. package/augment-extensions/writing-standards/literature/shakespeare/examples/annotated-sonnets/sonnet-73.md +0 -215
  166. package/augment-extensions/writing-standards/literature/shakespeare/examples/exercises/character-worksheet.md +0 -407
  167. package/augment-extensions/writing-standards/literature/shakespeare/examples/exercises/iambic-pentameter-practice.md +0 -470
  168. package/augment-extensions/writing-standards/literature/shakespeare/examples/exercises/sonnet-writing-exercise.md +0 -360
  169. package/augment-extensions/writing-standards/literature/shakespeare/examples/exercises/theme-analysis-template.md +0 -527
  170. package/augment-extensions/writing-standards/literature/shakespeare/examples/exercises/verse-analysis-exercise.md +0 -426
  171. package/augment-extensions/writing-standards/literature/shakespeare/examples/scene-examples/hamlet-to-be-or-not-to-be.md +0 -316
  172. package/augment-extensions/writing-standards/literature/shakespeare/examples/scene-examples/king-lear-storm-scene.md +0 -576
  173. package/augment-extensions/writing-standards/literature/shakespeare/examples/scene-examples/macbeth-tomorrow-and-tomorrow.md +0 -448
  174. package/augment-extensions/writing-standards/literature/shakespeare/examples/scene-examples/much-ado-benedick-eavesdropping.md +0 -496
  175. package/augment-extensions/writing-standards/literature/shakespeare/examples/scene-examples/romeo-juliet-balcony.md +0 -287
  176. package/augment-extensions/writing-standards/literature/shakespeare/examples/scene-examples/twelfth-night-malvolio-letter.md +0 -653
  177. package/augment-extensions/writing-standards/literature/shakespeare/metadata.json +0 -60
  178. package/augment-extensions/writing-standards/literature/shakespeare/module.json +0 -72
  179. package/augment-extensions/writing-standards/literature/shakespeare/rules/character-themes/character-development.md +0 -608
  180. package/augment-extensions/writing-standards/literature/shakespeare/rules/character-themes/thematic-elements.md +0 -471
  181. package/augment-extensions/writing-standards/literature/shakespeare/rules/drama/comedy.md +0 -763
  182. package/augment-extensions/writing-standards/literature/shakespeare/rules/drama/history-plays.md +0 -507
  183. package/augment-extensions/writing-standards/literature/shakespeare/rules/drama/scene-construction.md +0 -870
  184. package/augment-extensions/writing-standards/literature/shakespeare/rules/drama/tragedy.md +0 -743
  185. package/augment-extensions/writing-standards/literature/shakespeare/rules/language/elizabethan-english.md +0 -400
  186. package/augment-extensions/writing-standards/literature/shakespeare/rules/language/rhetoric-wordplay.md +0 -602
  187. package/augment-extensions/writing-standards/literature/shakespeare/rules/language/vocabulary-guide.md +0 -662
  188. package/augment-extensions/writing-standards/literature/shakespeare/rules/poetry/iambic-pentameter.md +0 -447
  189. package/augment-extensions/writing-standards/literature/shakespeare/rules/poetry/narrative-poetry.md +0 -453
  190. package/augment-extensions/writing-standards/literature/shakespeare/rules/poetry/sonnets.md +0 -435
  191. package/augment-extensions/writing-standards/literature/shakespeare/rules/poetry/verse-forms.md +0 -565
  192. package/augment-extensions/writing-standards/screenplay/CHANGELOG.md +0 -51
  193. package/augment-extensions/writing-standards/screenplay/README.md +0 -392
  194. package/augment-extensions/writing-standards/screenplay/_templates/README.md +0 -121
  195. package/augment-extensions/writing-standards/screenplay/_templates/genre-template.md +0 -153
  196. package/augment-extensions/writing-standards/screenplay/_templates/style-template.md +0 -243
  197. package/augment-extensions/writing-standards/screenplay/_templates/theme-template.md +0 -213
  198. package/augment-extensions/writing-standards/screenplay/cinematic-styles/CHANGELOG.md +0 -51
  199. package/augment-extensions/writing-standards/screenplay/cinematic-styles/MIGRATION.md +0 -213
  200. package/augment-extensions/writing-standards/screenplay/cinematic-styles/README.md +0 -309
  201. package/augment-extensions/writing-standards/screenplay/cinematic-styles/REFACTORING-SUMMARY.md +0 -99
  202. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/CHANGELOG.md +0 -51
  203. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/metadata.json +0 -24
  204. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/module.json +0 -33
  205. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/monty-python/CHANGELOG.md +0 -51
  206. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/monty-python/metadata.json +0 -24
  207. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/monty-python/module.json +0 -50
  208. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/monty-python/rules/monty-python.md +0 -243
  209. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/saturday-night-live/CHANGELOG.md +0 -51
  210. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/saturday-night-live/metadata.json +0 -24
  211. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/saturday-night-live/module.json +0 -50
  212. package/augment-extensions/writing-standards/screenplay/cinematic-styles/comedy-formats/saturday-night-live/rules/saturday-night-live.md +0 -153
  213. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/CHANGELOG.md +0 -51
  214. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/README.md +0 -127
  215. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/alfred-hitchcock/CHANGELOG.md +0 -51
  216. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/alfred-hitchcock/metadata.json +0 -24
  217. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/alfred-hitchcock/module.json +0 -50
  218. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/alfred-hitchcock/rules/alfred-hitchcock.md +0 -168
  219. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/ari-aster/CHANGELOG.md +0 -51
  220. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/ari-aster/metadata.json +0 -24
  221. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/ari-aster/module.json +0 -50
  222. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/ari-aster/rules/ari-aster.md +0 -414
  223. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brad-bird/CHANGELOG.md +0 -51
  224. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brad-bird/metadata.json +0 -24
  225. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brad-bird/module.json +0 -50
  226. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brad-bird/rules/brad-bird.md +0 -362
  227. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brian-de-palma/CHANGELOG.md +0 -51
  228. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brian-de-palma/metadata.json +0 -24
  229. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brian-de-palma/module.json +0 -50
  230. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/brian-de-palma/rules/brian-de-palma.md +0 -445
  231. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/buster-keaton/CHANGELOG.md +0 -51
  232. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/buster-keaton/metadata.json +0 -24
  233. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/buster-keaton/module.json +0 -50
  234. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/buster-keaton/rules/buster-keaton.md +0 -508
  235. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/christopher-nolan/CHANGELOG.md +0 -51
  236. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/christopher-nolan/metadata.json +0 -24
  237. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/christopher-nolan/module.json +0 -50
  238. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/christopher-nolan/rules/christopher-nolan.md +0 -147
  239. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/clint-eastwood/CHANGELOG.md +0 -51
  240. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/clint-eastwood/metadata.json +0 -24
  241. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/clint-eastwood/module.json +0 -50
  242. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/clint-eastwood/rules/clint-eastwood.md +0 -639
  243. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/coen-brothers/CHANGELOG.md +0 -51
  244. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/coen-brothers/metadata.json +0 -24
  245. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/coen-brothers/module.json +0 -50
  246. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/coen-brothers/rules/coen-brothers.md +0 -167
  247. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/darren-aronofsky/CHANGELOG.md +0 -51
  248. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/darren-aronofsky/metadata.json +0 -24
  249. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/darren-aronofsky/module.json +0 -50
  250. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/darren-aronofsky/rules/darren-aronofsky.md +0 -474
  251. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-fincher/CHANGELOG.md +0 -51
  252. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-fincher/metadata.json +0 -24
  253. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-fincher/module.json +0 -50
  254. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-fincher/rules/david-fincher.md +0 -203
  255. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-lynch/CHANGELOG.md +0 -51
  256. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-lynch/metadata.json +0 -24
  257. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-lynch/module.json +0 -50
  258. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/david-lynch/rules/david-lynch.md +0 -136
  259. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/denis-villeneuve/CHANGELOG.md +0 -51
  260. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/denis-villeneuve/metadata.json +0 -24
  261. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/denis-villeneuve/module.json +0 -50
  262. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/denis-villeneuve/rules/denis-villeneuve.md +0 -131
  263. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/francis-ford-coppola/CHANGELOG.md +0 -51
  264. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/francis-ford-coppola/metadata.json +0 -24
  265. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/francis-ford-coppola/module.json +0 -50
  266. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/francis-ford-coppola/rules/francis-ford-coppola.md +0 -190
  267. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gary-marshall/CHANGELOG.md +0 -51
  268. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gary-marshall/metadata.json +0 -24
  269. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gary-marshall/module.json +0 -50
  270. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gary-marshall/rules/gary-marshall.md +0 -181
  271. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-a-romero/CHANGELOG.md +0 -51
  272. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-a-romero/metadata.json +0 -24
  273. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-a-romero/module.json +0 -50
  274. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-a-romero/rules/george-a-romero.md +0 -391
  275. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-lucas/CHANGELOG.md +0 -51
  276. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-lucas/metadata.json +0 -24
  277. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-lucas/module.json +0 -50
  278. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/george-lucas/rules/george-lucas.md +0 -129
  279. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/guillermo-del-toro/CHANGELOG.md +0 -51
  280. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/guillermo-del-toro/metadata.json +0 -24
  281. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/guillermo-del-toro/module.json +0 -50
  282. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/guillermo-del-toro/rules/guillermo-del-toro.md +0 -350
  283. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gus-van-sant/CHANGELOG.md +0 -51
  284. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gus-van-sant/metadata.json +0 -24
  285. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gus-van-sant/module.json +0 -50
  286. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/gus-van-sant/rules/gus-van-sant.md +0 -353
  287. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/james-ivory-ismail-merchant/CHANGELOG.md +0 -51
  288. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/james-ivory-ismail-merchant/metadata.json +0 -24
  289. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/james-ivory-ismail-merchant/module.json +0 -50
  290. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/james-ivory-ismail-merchant/rules/james-ivory-ismail-merchant.md +0 -164
  291. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jim-jarmusch/CHANGELOG.md +0 -51
  292. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jim-jarmusch/metadata.json +0 -24
  293. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jim-jarmusch/module.json +0 -50
  294. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jim-jarmusch/rules/jim-jarmusch.md +0 -426
  295. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-carpenter/CHANGELOG.md +0 -51
  296. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-carpenter/metadata.json +0 -24
  297. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-carpenter/module.json +0 -50
  298. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-carpenter/rules/john-carpenter.md +0 -450
  299. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-ford/CHANGELOG.md +0 -51
  300. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-ford/metadata.json +0 -24
  301. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-ford/module.json +0 -50
  302. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-ford/rules/john-ford.md +0 -429
  303. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-huston/CHANGELOG.md +0 -51
  304. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-huston/metadata.json +0 -24
  305. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-huston/module.json +0 -50
  306. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-huston/rules/john-huston.md +0 -357
  307. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-landis/CHANGELOG.md +0 -51
  308. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-landis/metadata.json +0 -24
  309. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-landis/module.json +0 -50
  310. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/john-landis/rules/john-landis.md +0 -483
  311. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jonathan-demme/CHANGELOG.md +0 -51
  312. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jonathan-demme/metadata.json +0 -24
  313. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jonathan-demme/module.json +0 -50
  314. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/jonathan-demme/rules/jonathan-demme.md +0 -394
  315. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/joseph-l-mankiewicz/CHANGELOG.md +0 -51
  316. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/joseph-l-mankiewicz/metadata.json +0 -24
  317. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/joseph-l-mankiewicz/module.json +0 -50
  318. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/joseph-l-mankiewicz/rules/joseph-l-mankiewicz.md +0 -406
  319. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kathryn-bigelow/CHANGELOG.md +0 -51
  320. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kathryn-bigelow/metadata.json +0 -24
  321. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kathryn-bigelow/module.json +0 -50
  322. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kathryn-bigelow/rules/kathryn-bigelow.md +0 -443
  323. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kelly-reichardt/CHANGELOG.md +0 -51
  324. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kelly-reichardt/metadata.json +0 -24
  325. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kelly-reichardt/module.json +0 -50
  326. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kelly-reichardt/rules/kelly-reichardt.md +0 -365
  327. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kevin-smith/CHANGELOG.md +0 -51
  328. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kevin-smith/metadata.json +0 -24
  329. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kevin-smith/module.json +0 -50
  330. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/kevin-smith/rules/kevin-smith.md +0 -546
  331. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/linda-shayne/CHANGELOG.md +0 -51
  332. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/linda-shayne/metadata.json +0 -24
  333. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/linda-shayne/module.json +0 -50
  334. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/linda-shayne/rules/linda-shayne.md +0 -341
  335. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/martin-scorsese/CHANGELOG.md +0 -51
  336. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/martin-scorsese/metadata.json +0 -24
  337. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/martin-scorsese/module.json +0 -50
  338. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/martin-scorsese/rules/martin-scorsese.md +0 -188
  339. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mel-brooks/CHANGELOG.md +0 -51
  340. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mel-brooks/metadata.json +0 -24
  341. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mel-brooks/module.json +0 -50
  342. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mel-brooks/rules/mel-brooks.md +0 -215
  343. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/metadata.json +0 -25
  344. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-curtiz/CHANGELOG.md +0 -51
  345. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-curtiz/metadata.json +0 -24
  346. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-curtiz/module.json +0 -50
  347. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-curtiz/rules/michael-curtiz.md +0 -429
  348. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-mann/CHANGELOG.md +0 -51
  349. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-mann/metadata.json +0 -24
  350. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-mann/module.json +0 -50
  351. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/michael-mann/rules/michael-mann.md +0 -416
  352. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mike-nichols/CHANGELOG.md +0 -51
  353. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mike-nichols/metadata.json +0 -24
  354. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mike-nichols/module.json +0 -50
  355. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/mike-nichols/rules/mike-nichols.md +0 -383
  356. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/module.json +0 -410
  357. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/orson-welles/CHANGELOG.md +0 -51
  358. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/orson-welles/metadata.json +0 -24
  359. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/orson-welles/module.json +0 -50
  360. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/orson-welles/rules/orson-welles.md +0 -400
  361. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/park-chan-wook/CHANGELOG.md +0 -51
  362. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/park-chan-wook/metadata.json +0 -24
  363. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/park-chan-wook/module.json +0 -50
  364. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/park-chan-wook/rules/park-chan-wook.md +0 -357
  365. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/paul-thomas-anderson/CHANGELOG.md +0 -51
  366. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/paul-thomas-anderson/metadata.json +0 -24
  367. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/paul-thomas-anderson/module.json +0 -50
  368. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/paul-thomas-anderson/rules/paul-thomas-anderson.md +0 -143
  369. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/penny-marshall/CHANGELOG.md +0 -51
  370. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/penny-marshall/metadata.json +0 -24
  371. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/penny-marshall/module.json +0 -50
  372. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/penny-marshall/rules/penny-marshall.md +0 -139
  373. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/peter-bogdanovich/CHANGELOG.md +0 -51
  374. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/peter-bogdanovich/metadata.json +0 -24
  375. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/peter-bogdanovich/module.json +0 -50
  376. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/peter-bogdanovich/rules/peter-bogdanovich.md +0 -411
  377. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/quentin-tarantino/CHANGELOG.md +0 -51
  378. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/quentin-tarantino/metadata.json +0 -24
  379. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/quentin-tarantino/module.json +0 -50
  380. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/quentin-tarantino/rules/quentin-tarantino.md +0 -178
  381. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/richard-linklater/CHANGELOG.md +0 -51
  382. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/richard-linklater/metadata.json +0 -24
  383. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/richard-linklater/module.json +0 -50
  384. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/richard-linklater/rules/richard-linklater.md +0 -463
  385. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/rob-reiner/CHANGELOG.md +0 -51
  386. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/rob-reiner/metadata.json +0 -24
  387. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/rob-reiner/module.json +0 -50
  388. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/rob-reiner/rules/rob-reiner.md +0 -470
  389. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-altman/CHANGELOG.md +0 -51
  390. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-altman/metadata.json +0 -24
  391. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-altman/module.json +0 -50
  392. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-altman/rules/robert-altman.md +0 -447
  393. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-eggers/CHANGELOG.md +0 -51
  394. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-eggers/metadata.json +0 -24
  395. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-eggers/module.json +0 -50
  396. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-eggers/rules/robert-eggers.md +0 -361
  397. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-zemeckis/CHANGELOG.md +0 -51
  398. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-zemeckis/metadata.json +0 -24
  399. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-zemeckis/module.json +0 -50
  400. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/robert-zemeckis/rules/robert-zemeckis.md +0 -489
  401. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sam-peckinpah/CHANGELOG.md +0 -51
  402. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sam-peckinpah/metadata.json +0 -24
  403. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sam-peckinpah/module.json +0 -50
  404. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sam-peckinpah/rules/sam-peckinpah.md +0 -475
  405. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sidney-lumet/CHANGELOG.md +0 -51
  406. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sidney-lumet/metadata.json +0 -24
  407. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sidney-lumet/module.json +0 -50
  408. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sidney-lumet/rules/sidney-lumet.md +0 -387
  409. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/spike-lee/CHANGELOG.md +0 -51
  410. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/spike-lee/metadata.json +0 -24
  411. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/spike-lee/module.json +0 -50
  412. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/spike-lee/rules/spike-lee.md +0 -500
  413. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-donen-gene-kelly/CHANGELOG.md +0 -51
  414. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-donen-gene-kelly/metadata.json +0 -24
  415. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-donen-gene-kelly/module.json +0 -50
  416. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-donen-gene-kelly/rules/stanley-donen-gene-kelly.md +0 -406
  417. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-kubrick/CHANGELOG.md +0 -51
  418. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-kubrick/metadata.json +0 -24
  419. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-kubrick/module.json +0 -50
  420. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/stanley-kubrick/rules/stanley-kubrick.md +0 -183
  421. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steve-martin/CHANGELOG.md +0 -51
  422. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steve-martin/metadata.json +0 -24
  423. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steve-martin/module.json +0 -50
  424. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steve-martin/rules/steve-martin.md +0 -138
  425. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steven-spielberg/CHANGELOG.md +0 -51
  426. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steven-spielberg/metadata.json +0 -24
  427. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steven-spielberg/module.json +0 -50
  428. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/steven-spielberg/rules/steven-spielberg.md +0 -179
  429. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sydney-pollack/CHANGELOG.md +0 -51
  430. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sydney-pollack/metadata.json +0 -24
  431. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sydney-pollack/module.json +0 -50
  432. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/sydney-pollack/rules/sydney-pollack.md +0 -356
  433. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/terry-gilliam/CHANGELOG.md +0 -51
  434. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/terry-gilliam/metadata.json +0 -24
  435. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/terry-gilliam/module.json +0 -50
  436. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/terry-gilliam/rules/terry-gilliam.md +0 -546
  437. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tim-burton/CHANGELOG.md +0 -51
  438. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tim-burton/metadata.json +0 -24
  439. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tim-burton/module.json +0 -50
  440. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tim-burton/rules/tim-burton.md +0 -356
  441. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tobe-hooper/CHANGELOG.md +0 -51
  442. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tobe-hooper/metadata.json +0 -24
  443. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tobe-hooper/module.json +0 -50
  444. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/tobe-hooper/rules/tobe-hooper.md +0 -596
  445. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/wes-anderson/CHANGELOG.md +0 -51
  446. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/wes-anderson/metadata.json +0 -24
  447. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/wes-anderson/module.json +0 -50
  448. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/wes-anderson/rules/wes-anderson.md +0 -146
  449. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/william-friedkin/CHANGELOG.md +0 -51
  450. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/william-friedkin/metadata.json +0 -24
  451. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/william-friedkin/module.json +0 -50
  452. package/augment-extensions/writing-standards/screenplay/cinematic-styles/directors/william-friedkin/rules/william-friedkin.md +0 -378
  453. package/augment-extensions/writing-standards/screenplay/cinematic-styles/examples/style-applications.md +0 -740
  454. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/CHANGELOG.md +0 -51
  455. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/blue-ruin/CHANGELOG.md +0 -51
  456. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/blue-ruin/metadata.json +0 -24
  457. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/blue-ruin/module.json +0 -50
  458. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/blue-ruin/rules/blue-ruin.md +0 -721
  459. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/metadata.json +0 -24
  460. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/module.json +0 -27
  461. package/augment-extensions/writing-standards/screenplay/cinematic-styles/films/rules/blue-ruin.md.bak +0 -667
  462. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/CHANGELOG.md +0 -51
  463. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/fast-and-furious/CHANGELOG.md +0 -51
  464. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/fast-and-furious/metadata.json +0 -24
  465. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/fast-and-furious/module.json +0 -17
  466. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/fast-and-furious/rules/the-fast-and-furious-saga.md +0 -427
  467. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/harry-potter/CHANGELOG.md +0 -51
  468. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/harry-potter/metadata.json +0 -24
  469. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/harry-potter/module.json +0 -17
  470. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/harry-potter/rules/harry-potter.md +0 -170
  471. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/james-bond/CHANGELOG.md +0 -51
  472. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/james-bond/metadata.json +0 -24
  473. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/james-bond/module.json +0 -17
  474. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/james-bond/rules/james-bond.md +0 -440
  475. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/john-wick/CHANGELOG.md +0 -51
  476. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/john-wick/metadata.json +0 -24
  477. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/john-wick/module.json +0 -17
  478. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/john-wick/rules/john-wick.md +0 -375
  479. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/lord-of-the-rings/CHANGELOG.md +0 -51
  480. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/lord-of-the-rings/metadata.json +0 -24
  481. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/lord-of-the-rings/module.json +0 -17
  482. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/lord-of-the-rings/rules/lord-of-the-rings.md +0 -437
  483. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/mcu/CHANGELOG.md +0 -51
  484. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/mcu/metadata.json +0 -25
  485. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/mcu/module.json +0 -29
  486. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/mcu/rules/mcu-avengers.md +0 -985
  487. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/mcu/rules/mcu-avengers.md.bak +0 -933
  488. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/metadata.json +0 -25
  489. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/module.json +0 -93
  490. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/CHANGELOG.md +0 -51
  491. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/metadata.json +0 -33
  492. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/module.json +0 -46
  493. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek-deep-space-nine.md +0 -146
  494. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek-enterprise.md +0 -149
  495. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek-strange-new-world.md +0 -156
  496. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek-the-next-generation.md +0 -163
  497. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek-tos.md +0 -148
  498. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek-voyager.md +0 -148
  499. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-trek/rules/star-trek.md +0 -163
  500. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-wars/CHANGELOG.md +0 -51
  501. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-wars/metadata.json +0 -24
  502. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-wars/module.json +0 -17
  503. package/augment-extensions/writing-standards/screenplay/cinematic-styles/franchises/star-wars/rules/star-wars.md +0 -213
  504. package/augment-extensions/writing-standards/screenplay/cinematic-styles/metadata.json +0 -50
  505. package/augment-extensions/writing-standards/screenplay/cinematic-styles/module.json +0 -128
  506. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/CHANGELOG.md +0 -51
  507. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/joseph-campbell/CHANGELOG.md +0 -51
  508. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/joseph-campbell/metadata.json +0 -24
  509. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/joseph-campbell/module.json +0 -50
  510. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/joseph-campbell/rules/joseph-campbell.md +0 -178
  511. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/metadata.json +0 -24
  512. package/augment-extensions/writing-standards/screenplay/cinematic-styles/narrative-theory/module.json +0 -27
  513. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/CHANGELOG.md +0 -51
  514. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/bruckheimer-and-simpson/CHANGELOG.md +0 -51
  515. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/bruckheimer-and-simpson/metadata.json +0 -24
  516. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/bruckheimer-and-simpson/module.json +0 -50
  517. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/bruckheimer-and-simpson/rules/bruckheimer-and-simpson.md +0 -376
  518. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/metadata.json +0 -23
  519. package/augment-extensions/writing-standards/screenplay/cinematic-styles/producers/module.json +0 -26
  520. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/blue-ruin.md +0 -667
  521. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/christopher-nolan.md +0 -126
  522. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/coen-brothers.md +0 -154
  523. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/david-lynch.md +0 -124
  524. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/denis-villeneuve.md +0 -119
  525. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/francis-ford-coppola.md +0 -176
  526. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/george-lucas.md +0 -116
  527. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/joseph-campbell.md +0 -167
  528. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/martin-scorsese.md +0 -174
  529. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/mcu-avengers.md +0 -933
  530. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/monty-python.md +0 -231
  531. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/quentin-tarantino.md +0 -167
  532. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/saturday-night-live.md +0 -141
  533. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/stanley-kubrick.md +0 -169
  534. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/star-wars.md +0 -200
  535. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/steven-spielberg.md +0 -165
  536. package/augment-extensions/writing-standards/screenplay/cinematic-styles/rules/wes-anderson.md +0 -134
  537. package/augment-extensions/writing-standards/screenplay/commercials/CHARACTER-COUNT-TRACKING.md +0 -226
  538. package/augment-extensions/writing-standards/screenplay/commercials/CONFIGURATION.md +0 -327
  539. package/augment-extensions/writing-standards/screenplay/commercials/README.md +0 -223
  540. package/augment-extensions/writing-standards/screenplay/commercials/REFACTORING-SUMMARY.md +0 -193
  541. package/augment-extensions/writing-standards/screenplay/commercials/REFERENCES.md +0 -157
  542. package/augment-extensions/writing-standards/screenplay/commercials/VALIDATION-REPORT.md +0 -109
  543. package/augment-extensions/writing-standards/screenplay/commercials/examples/.gitkeep +0 -0
  544. package/augment-extensions/writing-standards/screenplay/commercials/module.json +0 -111
  545. package/augment-extensions/writing-standards/screenplay/commercials/rules/.gitkeep +0 -0
  546. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercial-audience.md +0 -343
  547. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercial-formats.md +0 -396
  548. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercial-persuasion.md +0 -387
  549. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercial-scripts.md +0 -531
  550. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercial-techniques.md +0 -912
  551. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercial-types.md +0 -700
  552. package/augment-extensions/writing-standards/screenplay/commercials/rules/commercials.md +0 -285
  553. package/augment-extensions/writing-standards/screenplay/commercials/scripts/validate-character-count.ts +0 -284
  554. package/augment-extensions/writing-standards/screenplay/examples/aaa-hollywood-scene.fountain +0 -164
  555. package/augment-extensions/writing-standards/screenplay/examples/beat-sheet-example.yaml +0 -95
  556. package/augment-extensions/writing-standards/screenplay/examples/character-profile-example.yaml +0 -116
  557. package/augment-extensions/writing-standards/screenplay/examples/commercial-30sec.fountain +0 -151
  558. package/augment-extensions/writing-standards/screenplay/examples/independent-monologue.fountain +0 -67
  559. package/augment-extensions/writing-standards/screenplay/examples/news-segment.fountain +0 -142
  560. package/augment-extensions/writing-standards/screenplay/examples/plot-outline-example.yaml +0 -184
  561. package/augment-extensions/writing-standards/screenplay/examples/tv-episode-teaser.fountain +0 -204
  562. package/augment-extensions/writing-standards/screenplay/genres/CHANGELOG.md +0 -51
  563. package/augment-extensions/writing-standards/screenplay/genres/README.md +0 -181
  564. package/augment-extensions/writing-standards/screenplay/genres/examples/.gitkeep +0 -2
  565. package/augment-extensions/writing-standards/screenplay/genres/metadata.json +0 -43
  566. package/augment-extensions/writing-standards/screenplay/genres/module.json +0 -70
  567. package/augment-extensions/writing-standards/screenplay/genres/rules/.gitkeep +0 -2
  568. package/augment-extensions/writing-standards/screenplay/genres/rules/action.md +0 -399
  569. package/augment-extensions/writing-standards/screenplay/genres/rules/adventure.md +0 -407
  570. package/augment-extensions/writing-standards/screenplay/genres/rules/animation.md +0 -293
  571. package/augment-extensions/writing-standards/screenplay/genres/rules/biographical.md +0 -293
  572. package/augment-extensions/writing-standards/screenplay/genres/rules/comedy.md +0 -401
  573. package/augment-extensions/writing-standards/screenplay/genres/rules/documentary.md +0 -293
  574. package/augment-extensions/writing-standards/screenplay/genres/rules/drama.md +0 -409
  575. package/augment-extensions/writing-standards/screenplay/genres/rules/fantasy.md +0 -293
  576. package/augment-extensions/writing-standards/screenplay/genres/rules/historical.md +0 -293
  577. package/augment-extensions/writing-standards/screenplay/genres/rules/horror.md +0 -268
  578. package/augment-extensions/writing-standards/screenplay/genres/rules/musical.md +0 -294
  579. package/augment-extensions/writing-standards/screenplay/genres/rules/mystery.md +0 -293
  580. package/augment-extensions/writing-standards/screenplay/genres/rules/noir.md +0 -294
  581. package/augment-extensions/writing-standards/screenplay/genres/rules/romance.md +0 -293
  582. package/augment-extensions/writing-standards/screenplay/genres/rules/sci-fi.md +0 -289
  583. package/augment-extensions/writing-standards/screenplay/genres/rules/superhero.md +0 -293
  584. package/augment-extensions/writing-standards/screenplay/genres/rules/thriller.md +0 -294
  585. package/augment-extensions/writing-standards/screenplay/genres/rules/western.md +0 -293
  586. package/augment-extensions/writing-standards/screenplay/metadata.json +0 -65
  587. package/augment-extensions/writing-standards/screenplay/module.json +0 -171
  588. package/augment-extensions/writing-standards/screenplay/rules/aaa-hollywood-films.md +0 -339
  589. package/augment-extensions/writing-standards/screenplay/rules/ai-integration-testing.md +0 -329
  590. package/augment-extensions/writing-standards/screenplay/rules/character-development.md +0 -169
  591. package/augment-extensions/writing-standards/screenplay/rules/commercials.md +0 -437
  592. package/augment-extensions/writing-standards/screenplay/rules/dialogue-writing.md +0 -263
  593. package/augment-extensions/writing-standards/screenplay/rules/diversity-inclusion.md +0 -261
  594. package/augment-extensions/writing-standards/screenplay/rules/examples-guide.md +0 -315
  595. package/augment-extensions/writing-standards/screenplay/rules/file-organization.md +0 -213
  596. package/augment-extensions/writing-standards/screenplay/rules/formatting-validation.md +0 -413
  597. package/augment-extensions/writing-standards/screenplay/rules/fountain-format.md +0 -372
  598. package/augment-extensions/writing-standards/screenplay/rules/independent-films.md +0 -374
  599. package/augment-extensions/writing-standards/screenplay/rules/live-tv-productions.md +0 -443
  600. package/augment-extensions/writing-standards/screenplay/rules/narrative-structures.md +0 -207
  601. package/augment-extensions/writing-standards/screenplay/rules/news-broadcasts.md +0 -444
  602. package/augment-extensions/writing-standards/screenplay/rules/pacing-timing.md +0 -331
  603. package/augment-extensions/writing-standards/screenplay/rules/quality-review-checklist.md +0 -334
  604. package/augment-extensions/writing-standards/screenplay/rules/quick-reference.md +0 -299
  605. package/augment-extensions/writing-standards/screenplay/rules/screen-continuity.md +0 -263
  606. package/augment-extensions/writing-standards/screenplay/rules/streaming-content.md +0 -412
  607. package/augment-extensions/writing-standards/screenplay/rules/trope-management.md +0 -370
  608. package/augment-extensions/writing-standards/screenplay/rules/tv-series.md +0 -374
  609. package/augment-extensions/writing-standards/screenplay/rules/universal-formatting.md +0 -339
  610. package/augment-extensions/writing-standards/screenplay/rules/vscode-integration.md +0 -277
  611. package/augment-extensions/writing-standards/screenplay/rules/web-content.md +0 -393
  612. package/augment-extensions/writing-standards/screenplay/schemas/beat-sheet.json +0 -332
  613. package/augment-extensions/writing-standards/screenplay/schemas/character-profile.json +0 -247
  614. package/augment-extensions/writing-standards/screenplay/schemas/feature-selection.json +0 -200
  615. package/augment-extensions/writing-standards/screenplay/schemas/plot-outline.json +0 -233
  616. package/augment-extensions/writing-standards/screenplay/schemas/screenplay-config.json +0 -245
  617. package/augment-extensions/writing-standards/screenplay/schemas/trope-inventory.json +0 -221
  618. package/augment-extensions/writing-standards/screenplay/styles/CHANGELOG.md +0 -51
  619. package/augment-extensions/writing-standards/screenplay/styles/README.md +0 -159
  620. package/augment-extensions/writing-standards/screenplay/styles/examples/.gitkeep +0 -2
  621. package/augment-extensions/writing-standards/screenplay/styles/examples/style-applications.md +0 -1449
  622. package/augment-extensions/writing-standards/screenplay/styles/metadata.json +0 -38
  623. package/augment-extensions/writing-standards/screenplay/styles/module.json +0 -64
  624. package/augment-extensions/writing-standards/screenplay/styles/rules/.gitkeep +0 -2
  625. package/augment-extensions/writing-standards/screenplay/styles/rules/dialogue-centric.md +0 -520
  626. package/augment-extensions/writing-standards/screenplay/styles/rules/ensemble.md +0 -499
  627. package/augment-extensions/writing-standards/screenplay/styles/rules/epic.md +0 -497
  628. package/augment-extensions/writing-standards/screenplay/styles/rules/experimental.md +0 -492
  629. package/augment-extensions/writing-standards/screenplay/styles/rules/flashback.md +0 -509
  630. package/augment-extensions/writing-standards/screenplay/styles/rules/linear.md +0 -490
  631. package/augment-extensions/writing-standards/screenplay/styles/rules/minimalist.md +0 -499
  632. package/augment-extensions/writing-standards/screenplay/styles/rules/non-linear.md +0 -501
  633. package/augment-extensions/writing-standards/screenplay/styles/rules/poetic.md +0 -499
  634. package/augment-extensions/writing-standards/screenplay/styles/rules/realistic.md +0 -498
  635. package/augment-extensions/writing-standards/screenplay/styles/rules/satirical.md +0 -499
  636. package/augment-extensions/writing-standards/screenplay/styles/rules/surreal.md +0 -508
  637. package/augment-extensions/writing-standards/screenplay/styles/rules/voice-over.md +0 -500
  638. package/augment-extensions/writing-standards/screenplay/themes/CHANGELOG.md +0 -51
  639. package/augment-extensions/writing-standards/screenplay/themes/README.md +0 -158
  640. package/augment-extensions/writing-standards/screenplay/themes/examples/.gitkeep +0 -2
  641. package/augment-extensions/writing-standards/screenplay/themes/examples/common-mistakes-and-fixes.md +0 -643
  642. package/augment-extensions/writing-standards/screenplay/themes/examples/complete-scene-example.md +0 -311
  643. package/augment-extensions/writing-standards/screenplay/themes/examples/individual-theme-examples.md +0 -562
  644. package/augment-extensions/writing-standards/screenplay/themes/examples/multi-theme-weaving.md +0 -538
  645. package/augment-extensions/writing-standards/screenplay/themes/examples/theme-application-guide.md +0 -432
  646. package/augment-extensions/writing-standards/screenplay/themes/examples/theme-integration-across-acts.md +0 -637
  647. package/augment-extensions/writing-standards/screenplay/themes/metadata.json +0 -47
  648. package/augment-extensions/writing-standards/screenplay/themes/module.json +0 -66
  649. package/augment-extensions/writing-standards/screenplay/themes/rules/.gitkeep +0 -2
  650. package/augment-extensions/writing-standards/screenplay/themes/rules/ambition.md +0 -458
  651. package/augment-extensions/writing-standards/screenplay/themes/rules/betrayal.md +0 -490
  652. package/augment-extensions/writing-standards/screenplay/themes/rules/environment.md +0 -458
  653. package/augment-extensions/writing-standards/screenplay/themes/rules/fate.md +0 -459
  654. package/augment-extensions/writing-standards/screenplay/themes/rules/friendship.md +0 -491
  655. package/augment-extensions/writing-standards/screenplay/themes/rules/growth.md +0 -491
  656. package/augment-extensions/writing-standards/screenplay/themes/rules/identity.md +0 -490
  657. package/augment-extensions/writing-standards/screenplay/themes/rules/isolation.md +0 -464
  658. package/augment-extensions/writing-standards/screenplay/themes/rules/justice.md +0 -461
  659. package/augment-extensions/writing-standards/screenplay/themes/rules/love.md +0 -489
  660. package/augment-extensions/writing-standards/screenplay/themes/rules/power.md +0 -494
  661. package/augment-extensions/writing-standards/screenplay/themes/rules/redemption.md +0 -483
  662. package/augment-extensions/writing-standards/screenplay/themes/rules/revenge.md +0 -489
  663. package/augment-extensions/writing-standards/screenplay/themes/rules/survival.md +0 -496
  664. package/augment-extensions/writing-standards/screenplay/themes/rules/technology.md +0 -463
  665. package/augment-extensions/writing-standards/screenplay/utils/__tests__/file-organization.test.ts +0 -169
  666. package/augment-extensions/writing-standards/screenplay/utils/file-organization.ts +0 -165
  667. package/cli/dist/__test_health-checker.d.ts +0 -2
  668. package/cli/dist/__test_health-checker.d.ts.map +0 -1
  669. package/cli/dist/__test_health-checker.js +0 -4
  670. package/cli/dist/__test_health-checker.js.map +0 -1
  671. package/cli/dist/__test_hook-system.d.ts +0 -2
  672. package/cli/dist/__test_hook-system.d.ts.map +0 -1
  673. package/cli/dist/__test_hook-system.js +0 -4
  674. package/cli/dist/__test_hook-system.js.map +0 -1
  675. package/cli/dist/__test_rule-install-hooks.d.ts +0 -2
  676. package/cli/dist/__test_rule-install-hooks.d.ts.map +0 -1
  677. package/cli/dist/__test_rule-install-hooks.js +0 -4
  678. package/cli/dist/__test_rule-install-hooks.js.map +0 -1
  679. package/cli/dist/__test_template-engine.d.ts +0 -2
  680. package/cli/dist/__test_template-engine.d.ts.map +0 -1
  681. package/cli/dist/__test_template-engine.js +0 -4
  682. package/cli/dist/__test_template-engine.js.map +0 -1
  683. package/cli/dist/commands/generate-shot-list/error-detector.d.ts +0 -92
  684. package/cli/dist/commands/generate-shot-list/error-detector.d.ts.map +0 -1
  685. package/cli/dist/commands/generate-shot-list/error-detector.js +0 -131
  686. package/cli/dist/commands/generate-shot-list/error-detector.js.map +0 -1
  687. package/cli/dist/commands/generate-shot-list/error-recovery.d.ts +0 -85
  688. package/cli/dist/commands/generate-shot-list/error-recovery.d.ts.map +0 -1
  689. package/cli/dist/commands/generate-shot-list/error-recovery.js +0 -208
  690. package/cli/dist/commands/generate-shot-list/error-recovery.js.map +0 -1
  691. package/cli/dist/commands/generate-shot-list/errors.d.ts +0 -52
  692. package/cli/dist/commands/generate-shot-list/errors.d.ts.map +0 -1
  693. package/cli/dist/commands/generate-shot-list/errors.js +0 -287
  694. package/cli/dist/commands/generate-shot-list/errors.js.map +0 -1
  695. package/cli/dist/commands/generate-shot-list/exit-codes.d.ts +0 -42
  696. package/cli/dist/commands/generate-shot-list/exit-codes.d.ts.map +0 -1
  697. package/cli/dist/commands/generate-shot-list/exit-codes.js +0 -83
  698. package/cli/dist/commands/generate-shot-list/exit-codes.js.map +0 -1
  699. package/cli/dist/commands/generate-shot-list/formatter/base-formatter.d.ts +0 -48
  700. package/cli/dist/commands/generate-shot-list/formatter/base-formatter.d.ts.map +0 -1
  701. package/cli/dist/commands/generate-shot-list/formatter/base-formatter.js +0 -115
  702. package/cli/dist/commands/generate-shot-list/formatter/base-formatter.js.map +0 -1
  703. package/cli/dist/commands/generate-shot-list/formatter/csv-formatter.d.ts +0 -45
  704. package/cli/dist/commands/generate-shot-list/formatter/csv-formatter.d.ts.map +0 -1
  705. package/cli/dist/commands/generate-shot-list/formatter/csv-formatter.js +0 -110
  706. package/cli/dist/commands/generate-shot-list/formatter/csv-formatter.js.map +0 -1
  707. package/cli/dist/commands/generate-shot-list/formatter/html-formatter.d.ts +0 -38
  708. package/cli/dist/commands/generate-shot-list/formatter/html-formatter.d.ts.map +0 -1
  709. package/cli/dist/commands/generate-shot-list/formatter/html-formatter.js +0 -82
  710. package/cli/dist/commands/generate-shot-list/formatter/html-formatter.js.map +0 -1
  711. package/cli/dist/commands/generate-shot-list/formatter/html-template.d.ts +0 -11
  712. package/cli/dist/commands/generate-shot-list/formatter/html-template.d.ts.map +0 -1
  713. package/cli/dist/commands/generate-shot-list/formatter/html-template.js +0 -628
  714. package/cli/dist/commands/generate-shot-list/formatter/html-template.js.map +0 -1
  715. package/cli/dist/commands/generate-shot-list/formatter/index.d.ts +0 -13
  716. package/cli/dist/commands/generate-shot-list/formatter/index.d.ts.map +0 -1
  717. package/cli/dist/commands/generate-shot-list/formatter/index.js +0 -41
  718. package/cli/dist/commands/generate-shot-list/formatter/index.js.map +0 -1
  719. package/cli/dist/commands/generate-shot-list/formatter/json-formatter.d.ts +0 -35
  720. package/cli/dist/commands/generate-shot-list/formatter/json-formatter.d.ts.map +0 -1
  721. package/cli/dist/commands/generate-shot-list/formatter/json-formatter.js +0 -134
  722. package/cli/dist/commands/generate-shot-list/formatter/json-formatter.js.map +0 -1
  723. package/cli/dist/commands/generate-shot-list/formatter/jsonl-formatter.d.ts +0 -38
  724. package/cli/dist/commands/generate-shot-list/formatter/jsonl-formatter.d.ts.map +0 -1
  725. package/cli/dist/commands/generate-shot-list/formatter/jsonl-formatter.js +0 -111
  726. package/cli/dist/commands/generate-shot-list/formatter/jsonl-formatter.js.map +0 -1
  727. package/cli/dist/commands/generate-shot-list/formatter/markdown-formatter.d.ts +0 -53
  728. package/cli/dist/commands/generate-shot-list/formatter/markdown-formatter.d.ts.map +0 -1
  729. package/cli/dist/commands/generate-shot-list/formatter/markdown-formatter.js +0 -302
  730. package/cli/dist/commands/generate-shot-list/formatter/markdown-formatter.js.map +0 -1
  731. package/cli/dist/commands/generate-shot-list/formatter/txt-formatter.d.ts +0 -37
  732. package/cli/dist/commands/generate-shot-list/formatter/txt-formatter.d.ts.map +0 -1
  733. package/cli/dist/commands/generate-shot-list/formatter/txt-formatter.js +0 -125
  734. package/cli/dist/commands/generate-shot-list/formatter/txt-formatter.js.map +0 -1
  735. package/cli/dist/commands/generate-shot-list/formatter/types.d.ts +0 -75
  736. package/cli/dist/commands/generate-shot-list/formatter/types.d.ts.map +0 -1
  737. package/cli/dist/commands/generate-shot-list/formatter/types.js +0 -8
  738. package/cli/dist/commands/generate-shot-list/formatter/types.js.map +0 -1
  739. package/cli/dist/commands/generate-shot-list/generator/ai-blocking-extractor.d.ts +0 -58
  740. package/cli/dist/commands/generate-shot-list/generator/ai-blocking-extractor.d.ts.map +0 -1
  741. package/cli/dist/commands/generate-shot-list/generator/ai-blocking-extractor.js +0 -275
  742. package/cli/dist/commands/generate-shot-list/generator/ai-blocking-extractor.js.map +0 -1
  743. package/cli/dist/commands/generate-shot-list/generator/ai-entity-extractor.d.ts +0 -41
  744. package/cli/dist/commands/generate-shot-list/generator/ai-entity-extractor.d.ts.map +0 -1
  745. package/cli/dist/commands/generate-shot-list/generator/ai-entity-extractor.js +0 -155
  746. package/cli/dist/commands/generate-shot-list/generator/ai-entity-extractor.js.map +0 -1
  747. package/cli/dist/commands/generate-shot-list/generator/context-builder.d.ts +0 -166
  748. package/cli/dist/commands/generate-shot-list/generator/context-builder.d.ts.map +0 -1
  749. package/cli/dist/commands/generate-shot-list/generator/context-builder.js +0 -965
  750. package/cli/dist/commands/generate-shot-list/generator/context-builder.js.map +0 -1
  751. package/cli/dist/commands/generate-shot-list/generator/index.d.ts +0 -163
  752. package/cli/dist/commands/generate-shot-list/generator/index.d.ts.map +0 -1
  753. package/cli/dist/commands/generate-shot-list/generator/index.js +0 -909
  754. package/cli/dist/commands/generate-shot-list/generator/index.js.map +0 -1
  755. package/cli/dist/commands/generate-shot-list/generator/metadata-extractor.d.ts +0 -46
  756. package/cli/dist/commands/generate-shot-list/generator/metadata-extractor.d.ts.map +0 -1
  757. package/cli/dist/commands/generate-shot-list/generator/metadata-extractor.js +0 -171
  758. package/cli/dist/commands/generate-shot-list/generator/metadata-extractor.js.map +0 -1
  759. package/cli/dist/commands/generate-shot-list/generator/scene-segmenter.d.ts +0 -49
  760. package/cli/dist/commands/generate-shot-list/generator/scene-segmenter.d.ts.map +0 -1
  761. package/cli/dist/commands/generate-shot-list/generator/scene-segmenter.js +0 -130
  762. package/cli/dist/commands/generate-shot-list/generator/scene-segmenter.js.map +0 -1
  763. package/cli/dist/commands/generate-shot-list/generator/types.d.ts +0 -135
  764. package/cli/dist/commands/generate-shot-list/generator/types.d.ts.map +0 -1
  765. package/cli/dist/commands/generate-shot-list/generator/types.js +0 -8
  766. package/cli/dist/commands/generate-shot-list/generator/types.js.map +0 -1
  767. package/cli/dist/commands/generate-shot-list/generator/validator.d.ts +0 -73
  768. package/cli/dist/commands/generate-shot-list/generator/validator.d.ts.map +0 -1
  769. package/cli/dist/commands/generate-shot-list/generator/validator.js +0 -284
  770. package/cli/dist/commands/generate-shot-list/generator/validator.js.map +0 -1
  771. package/cli/dist/commands/generate-shot-list/help-text.d.ts +0 -11
  772. package/cli/dist/commands/generate-shot-list/help-text.d.ts.map +0 -1
  773. package/cli/dist/commands/generate-shot-list/help-text.js +0 -214
  774. package/cli/dist/commands/generate-shot-list/help-text.js.map +0 -1
  775. package/cli/dist/commands/generate-shot-list/logger/index.d.ts +0 -25
  776. package/cli/dist/commands/generate-shot-list/logger/index.d.ts.map +0 -1
  777. package/cli/dist/commands/generate-shot-list/logger/index.js +0 -98
  778. package/cli/dist/commands/generate-shot-list/logger/index.js.map +0 -1
  779. package/cli/dist/commands/generate-shot-list/logger/jsonl-writer.d.ts +0 -53
  780. package/cli/dist/commands/generate-shot-list/logger/jsonl-writer.d.ts.map +0 -1
  781. package/cli/dist/commands/generate-shot-list/logger/jsonl-writer.js +0 -183
  782. package/cli/dist/commands/generate-shot-list/logger/jsonl-writer.js.map +0 -1
  783. package/cli/dist/commands/generate-shot-list/logger/shot-list-logger.d.ts +0 -43
  784. package/cli/dist/commands/generate-shot-list/logger/shot-list-logger.d.ts.map +0 -1
  785. package/cli/dist/commands/generate-shot-list/logger/shot-list-logger.js +0 -142
  786. package/cli/dist/commands/generate-shot-list/logger/shot-list-logger.js.map +0 -1
  787. package/cli/dist/commands/generate-shot-list/logger/types.d.ts +0 -145
  788. package/cli/dist/commands/generate-shot-list/logger/types.d.ts.map +0 -1
  789. package/cli/dist/commands/generate-shot-list/logger/types.js +0 -8
  790. package/cli/dist/commands/generate-shot-list/logger/types.js.map +0 -1
  791. package/cli/dist/commands/generate-shot-list/parser/docx-parser.d.ts +0 -29
  792. package/cli/dist/commands/generate-shot-list/parser/docx-parser.d.ts.map +0 -1
  793. package/cli/dist/commands/generate-shot-list/parser/docx-parser.js +0 -111
  794. package/cli/dist/commands/generate-shot-list/parser/docx-parser.js.map +0 -1
  795. package/cli/dist/commands/generate-shot-list/parser/finaldraft-parser.d.ts +0 -18
  796. package/cli/dist/commands/generate-shot-list/parser/finaldraft-parser.d.ts.map +0 -1
  797. package/cli/dist/commands/generate-shot-list/parser/finaldraft-parser.js +0 -184
  798. package/cli/dist/commands/generate-shot-list/parser/finaldraft-parser.js.map +0 -1
  799. package/cli/dist/commands/generate-shot-list/parser/fountain-parser.d.ts +0 -33
  800. package/cli/dist/commands/generate-shot-list/parser/fountain-parser.d.ts.map +0 -1
  801. package/cli/dist/commands/generate-shot-list/parser/fountain-parser.js +0 -250
  802. package/cli/dist/commands/generate-shot-list/parser/fountain-parser.js.map +0 -1
  803. package/cli/dist/commands/generate-shot-list/parser/index.d.ts +0 -25
  804. package/cli/dist/commands/generate-shot-list/parser/index.d.ts.map +0 -1
  805. package/cli/dist/commands/generate-shot-list/parser/index.js +0 -168
  806. package/cli/dist/commands/generate-shot-list/parser/index.js.map +0 -1
  807. package/cli/dist/commands/generate-shot-list/parser/markdown-parser.d.ts +0 -21
  808. package/cli/dist/commands/generate-shot-list/parser/markdown-parser.d.ts.map +0 -1
  809. package/cli/dist/commands/generate-shot-list/parser/markdown-parser.js +0 -197
  810. package/cli/dist/commands/generate-shot-list/parser/markdown-parser.js.map +0 -1
  811. package/cli/dist/commands/generate-shot-list/parser/pdf-parser.d.ts +0 -24
  812. package/cli/dist/commands/generate-shot-list/parser/pdf-parser.d.ts.map +0 -1
  813. package/cli/dist/commands/generate-shot-list/parser/pdf-parser.js +0 -84
  814. package/cli/dist/commands/generate-shot-list/parser/pdf-parser.js.map +0 -1
  815. package/cli/dist/commands/generate-shot-list/parser/plaintext-parser.d.ts +0 -29
  816. package/cli/dist/commands/generate-shot-list/parser/plaintext-parser.d.ts.map +0 -1
  817. package/cli/dist/commands/generate-shot-list/parser/plaintext-parser.js +0 -213
  818. package/cli/dist/commands/generate-shot-list/parser/plaintext-parser.js.map +0 -1
  819. package/cli/dist/commands/generate-shot-list/parser/rtf-parser.d.ts +0 -28
  820. package/cli/dist/commands/generate-shot-list/parser/rtf-parser.d.ts.map +0 -1
  821. package/cli/dist/commands/generate-shot-list/parser/rtf-parser.js +0 -143
  822. package/cli/dist/commands/generate-shot-list/parser/rtf-parser.js.map +0 -1
  823. package/cli/dist/commands/generate-shot-list/parser/types.d.ts +0 -136
  824. package/cli/dist/commands/generate-shot-list/parser/types.d.ts.map +0 -1
  825. package/cli/dist/commands/generate-shot-list/parser/types.js +0 -22
  826. package/cli/dist/commands/generate-shot-list/parser/types.js.map +0 -1
  827. package/cli/dist/commands/generate-shot-list/schema/shot-list.schema.json +0 -341
  828. package/cli/dist/commands/generate-shot-list/schema/validator.d.ts +0 -55
  829. package/cli/dist/commands/generate-shot-list/schema/validator.d.ts.map +0 -1
  830. package/cli/dist/commands/generate-shot-list/schema/validator.js +0 -180
  831. package/cli/dist/commands/generate-shot-list/schema/validator.js.map +0 -1
  832. package/cli/dist/commands/generate-shot-list/style/guideline-parser.d.ts +0 -36
  833. package/cli/dist/commands/generate-shot-list/style/guideline-parser.d.ts.map +0 -1
  834. package/cli/dist/commands/generate-shot-list/style/guideline-parser.js +0 -108
  835. package/cli/dist/commands/generate-shot-list/style/guideline-parser.js.map +0 -1
  836. package/cli/dist/commands/generate-shot-list/style/index.d.ts +0 -39
  837. package/cli/dist/commands/generate-shot-list/style/index.d.ts.map +0 -1
  838. package/cli/dist/commands/generate-shot-list/style/index.js +0 -85
  839. package/cli/dist/commands/generate-shot-list/style/index.js.map +0 -1
  840. package/cli/dist/commands/generate-shot-list/style/style-loader.d.ts +0 -35
  841. package/cli/dist/commands/generate-shot-list/style/style-loader.d.ts.map +0 -1
  842. package/cli/dist/commands/generate-shot-list/style/style-loader.js +0 -178
  843. package/cli/dist/commands/generate-shot-list/style/style-loader.js.map +0 -1
  844. package/cli/dist/commands/generate-shot-list/style/style-merger.d.ts +0 -36
  845. package/cli/dist/commands/generate-shot-list/style/style-merger.d.ts.map +0 -1
  846. package/cli/dist/commands/generate-shot-list/style/style-merger.js +0 -123
  847. package/cli/dist/commands/generate-shot-list/style/style-merger.js.map +0 -1
  848. package/cli/dist/commands/generate-shot-list/style/types.d.ts +0 -105
  849. package/cli/dist/commands/generate-shot-list/style/types.d.ts.map +0 -1
  850. package/cli/dist/commands/generate-shot-list/style/types.js +0 -8
  851. package/cli/dist/commands/generate-shot-list/style/types.js.map +0 -1
  852. package/cli/dist/commands/generate-shot-list.d.ts +0 -15
  853. package/cli/dist/commands/generate-shot-list.d.ts.map +0 -1
  854. package/cli/dist/commands/generate-shot-list.js +0 -288
  855. package/cli/dist/commands/generate-shot-list.js.map +0 -1
  856. package/cli/dist/gui/app.d.ts +0 -17
  857. package/cli/dist/gui/app.d.ts.map +0 -1
  858. package/cli/dist/gui/app.js +0 -79
  859. package/cli/dist/gui/app.js.map +0 -1
  860. package/cli/dist/gui/components/preview-pane.d.ts +0 -40
  861. package/cli/dist/gui/components/preview-pane.d.ts.map +0 -1
  862. package/cli/dist/gui/components/preview-pane.js +0 -90
  863. package/cli/dist/gui/components/preview-pane.js.map +0 -1
  864. package/cli/dist/gui/components/search-filter.d.ts +0 -26
  865. package/cli/dist/gui/components/search-filter.d.ts.map +0 -1
  866. package/cli/dist/gui/components/search-filter.js +0 -168
  867. package/cli/dist/gui/components/search-filter.js.map +0 -1
  868. package/cli/dist/gui/components/status-bar.d.ts +0 -22
  869. package/cli/dist/gui/components/status-bar.d.ts.map +0 -1
  870. package/cli/dist/gui/components/status-bar.js +0 -58
  871. package/cli/dist/gui/components/status-bar.js.map +0 -1
  872. package/cli/dist/gui/components/tree-navigator.d.ts +0 -30
  873. package/cli/dist/gui/components/tree-navigator.d.ts.map +0 -1
  874. package/cli/dist/gui/components/tree-navigator.js +0 -133
  875. package/cli/dist/gui/components/tree-navigator.js.map +0 -1
  876. package/cli/dist/gui/components/version-selector.d.ts +0 -27
  877. package/cli/dist/gui/components/version-selector.d.ts.map +0 -1
  878. package/cli/dist/gui/components/version-selector.js +0 -110
  879. package/cli/dist/gui/components/version-selector.js.map +0 -1
  880. package/cli/dist/gui/hooks/use-version-loader.d.ts +0 -25
  881. package/cli/dist/gui/hooks/use-version-loader.d.ts.map +0 -1
  882. package/cli/dist/gui/hooks/use-version-loader.js +0 -116
  883. package/cli/dist/gui/hooks/use-version-loader.js.map +0 -1
  884. package/cli/dist/gui/index.d.ts +0 -15
  885. package/cli/dist/gui/index.d.ts.map +0 -1
  886. package/cli/dist/gui/index.js +0 -39
  887. package/cli/dist/gui/index.js.map +0 -1
  888. package/cli/dist/gui/layouts/main-layout.d.ts +0 -14
  889. package/cli/dist/gui/layouts/main-layout.d.ts.map +0 -1
  890. package/cli/dist/gui/layouts/main-layout.js +0 -205
  891. package/cli/dist/gui/layouts/main-layout.js.map +0 -1
  892. package/cli/dist/gui/state/navigation-state.d.ts +0 -39
  893. package/cli/dist/gui/state/navigation-state.d.ts.map +0 -1
  894. package/cli/dist/gui/state/navigation-state.js +0 -151
  895. package/cli/dist/gui/state/navigation-state.js.map +0 -1
  896. package/cli/dist/gui/state/selection-state.d.ts +0 -36
  897. package/cli/dist/gui/state/selection-state.d.ts.map +0 -1
  898. package/cli/dist/gui/state/selection-state.js +0 -132
  899. package/cli/dist/gui/state/selection-state.js.map +0 -1
  900. package/cli/dist/gui/theme.d.ts +0 -50
  901. package/cli/dist/gui/theme.d.ts.map +0 -1
  902. package/cli/dist/gui/theme.js +0 -73
  903. package/cli/dist/gui/theme.js.map +0 -1
  904. package/cli/dist/parsers/php-parser.d.ts +0 -127
  905. package/cli/dist/parsers/php-parser.d.ts.map +0 -1
  906. package/cli/dist/parsers/php-parser.js +0 -290
  907. package/cli/dist/parsers/php-parser.js.map +0 -1
  908. package/cli/dist/utils/help.d.ts +0 -13
  909. package/cli/dist/utils/help.d.ts.map +0 -1
  910. package/cli/dist/utils/help.js +0 -137
  911. package/cli/dist/utils/help.js.map +0 -1
  912. package/cli/dist/webview/inspection-webview-provider.d.ts +0 -49
  913. package/cli/dist/webview/inspection-webview-provider.d.ts.map +0 -1
  914. package/cli/dist/webview/inspection-webview-provider.js +0 -386
  915. package/cli/dist/webview/inspection-webview-provider.js.map +0 -1
@@ -1,1096 +1,1096 @@
1
- # TypeScript Architecture Patterns
2
-
3
- Comprehensive guide to architectural patterns for organizing TypeScript applications.
4
-
5
- ## Table of Contents
6
- - [Folder Organization](#folder-organization)
7
- - [Dependency Inversion](#dependency-inversion)
8
- - [Domain-Driven Design Basics](#domain-driven-design-basics)
9
- - [Layered Architecture](#layered-architecture)
10
- - [Clean Architecture](#clean-architecture)
11
- - [Hexagonal Architecture](#hexagonal-architecture)
12
- - [Best Practices](#best-practices)
13
-
14
- ---
15
-
16
- ## Folder Organization
17
-
18
- ### Folder-by-Convention (Traditional)
19
-
20
- Organize by technical role (controllers, services, models).
21
-
22
- ```
23
- src/
24
- ├── controllers/
25
- │ ├── user-controller.ts
26
- │ ├── product-controller.ts
27
- │ └── order-controller.ts
28
- ├── services/
29
- │ ├── user-service.ts
30
- │ ├── product-service.ts
31
- │ └── order-service.ts
32
- ├── models/
33
- │ ├── user.ts
34
- │ ├── product.ts
35
- │ └── order.ts
36
- ├── repositories/
37
- │ ├── user-repository.ts
38
- │ ├── product-repository.ts
39
- │ └── order-repository.ts
40
- └── utils/
41
- └── helpers.ts
42
- ```
43
-
44
- **Pros:**
45
- - Familiar structure
46
- - Easy to understand for small projects
47
- - Clear separation of technical concerns
48
-
49
- **Cons:**
50
- - Related code is scattered
51
- - Hard to find all code for a feature
52
- - Difficult to scale
53
- - Tight coupling between layers
54
-
55
- ### Folder-by-Feature (Recommended)
56
-
57
- Organize by business domain/feature.
58
-
59
- ```
60
- src/
61
- ├── users/
62
- │ ├── user.entity.ts
63
- │ ├── user.repository.ts
64
- │ ├── user.service.ts
65
- │ ├── user.controller.ts
66
- │ ├── dto/
67
- │ │ ├── create-user.dto.ts
68
- │ │ └── update-user.dto.ts
69
- │ ├── __tests__/
70
- │ │ ├── user.service.test.ts
71
- │ │ └── user.controller.test.ts
72
- │ └── index.ts
73
- ├── products/
74
- │ ├── product.entity.ts
75
- │ ├── product.repository.ts
76
- │ ├── product.service.ts
77
- │ ├── product.controller.ts
78
- │ └── index.ts
79
- ├── orders/
80
- │ ├── order.entity.ts
81
- │ ├── order.repository.ts
82
- │ ├── order.service.ts
83
- │ ├── order.controller.ts
84
- │ └── index.ts
85
- └── shared/
86
- ├── database/
87
- ├── utils/
88
- └── types/
89
- ```
90
-
91
- **Pros:**
92
- - All related code in one place
93
- - Easy to find feature code
94
- - Better encapsulation
95
- - Easier to scale
96
- - Can delete entire feature folder
97
-
98
- **Cons:**
99
- - Less familiar initially
100
- - Shared code needs careful management
101
-
102
- ### Hybrid Approach
103
-
104
- Combine both approaches for best results.
105
-
106
- ```
107
- src/
108
- ├── features/ # Feature modules
109
- │ ├── users/
110
- │ │ ├── domain/ # Business logic
111
- │ │ │ ├── user.entity.ts
112
- │ │ │ └── user.service.ts
113
- │ │ ├── infrastructure/ # External concerns
114
- │ │ │ └── user.repository.ts
115
- │ │ ├── presentation/ # API/UI layer
116
- │ │ │ └── user.controller.ts
117
- │ │ └── index.ts
118
- │ ├── products/
119
- │ └── orders/
120
- ├── shared/ # Shared across features
121
- │ ├── domain/
122
- │ │ ├── base-entity.ts
123
- │ │ └── value-objects/
124
- │ ├── infrastructure/
125
- │ │ ├── database/
126
- │ │ └── cache/
127
- │ └── utils/
128
- └── core/ # Core application
129
- ├── config/
130
- ├── middleware/
131
- └── types/
132
- ```
133
-
134
- ---
135
-
136
- ## Dependency Inversion
137
-
138
- The Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules. Both should depend on abstractions.
139
-
140
- ### Without Dependency Inversion (Bad)
141
-
142
- ```typescript
143
- // ❌ Bad - Direct dependency on concrete implementation
144
- class UserService {
145
- private repository = new MySQLUserRepository(); // Tight coupling
146
-
147
- async getUser(id: string): Promise<User> {
148
- return this.repository.findById(id);
149
- }
150
- }
151
- ```
152
-
153
- ### With Dependency Inversion (Good)
154
-
155
- ```typescript
156
- // ✅ Good - Depend on abstraction
157
- interface UserRepository {
158
- findById(id: string): Promise<User | null>;
159
- save(user: User): Promise<User>;
160
- delete(id: string): Promise<void>;
161
- }
162
-
163
- class UserService {
164
- constructor(private repository: UserRepository) {} // Inject dependency
165
-
166
- async getUser(id: string): Promise<User> {
167
- const user = await this.repository.findById(id);
168
- if (!user) throw new Error('User not found');
169
- return user;
170
- }
171
- }
172
-
173
- // Implementations
174
- class MySQLUserRepository implements UserRepository {
175
- async findById(id: string): Promise<User | null> {
176
- // MySQL implementation
177
- }
178
- // ... other methods
179
- }
180
-
181
- class MongoUserRepository implements UserRepository {
182
- async findById(id: string): Promise<User | null> {
183
- // MongoDB implementation
184
- }
185
- // ... other methods
186
- }
187
-
188
- // Usage - Easy to swap implementations
189
- const service = new UserService(new MySQLUserRepository());
190
- // or
191
- const service = new UserService(new MongoUserRepository());
192
- ```
193
-
194
- ### Dependency Injection Container
195
-
196
- ```typescript
197
- // container.ts
198
- import { Container } from 'inversify';
199
- import 'reflect-metadata';
200
-
201
- const container = new Container();
202
-
203
- // Bind interfaces to implementations
204
- container.bind<UserRepository>('UserRepository').to(MySQLUserRepository);
205
- container.bind<UserService>('UserService').to(UserService);
206
-
207
- export { container };
208
-
209
- // user.service.ts
210
- import { injectable, inject } from 'inversify';
211
-
212
- @injectable()
213
- class UserService {
214
- constructor(
215
- @inject('UserRepository') private repository: UserRepository
216
- ) {}
217
- }
218
- ```
219
-
220
- ---
221
-
222
- ## Domain-Driven Design Basics
223
-
224
- DDD focuses on modeling the business domain.
225
-
226
- ### Entities
227
-
228
- Objects with identity that persist over time.
229
-
230
- ```typescript
231
- // user.entity.ts
232
- export class User {
233
- constructor(
234
- public readonly id: string,
235
- private _email: string,
236
- private _name: string,
237
- private _createdAt: Date = new Date()
238
- ) {}
239
-
240
- get email(): string {
241
- return this._email;
242
- }
243
-
244
- get name(): string {
245
- return this._name;
246
- }
247
-
248
- updateEmail(newEmail: string): void {
249
- if (!this.isValidEmail(newEmail)) {
250
- throw new Error('Invalid email format');
251
- }
252
- this._email = newEmail;
253
- }
254
-
255
- private isValidEmail(email: string): boolean {
256
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
257
- }
258
- }
259
- ```
260
-
261
- ### Value Objects
262
-
263
- Objects without identity, defined by their attributes.
264
-
265
- ```typescript
266
- // email.value-object.ts
267
- export class Email {
268
- private constructor(private readonly value: string) {}
269
-
270
- static create(email: string): Email {
271
- if (!this.isValid(email)) {
272
- throw new Error('Invalid email format');
273
- }
274
- return new Email(email.toLowerCase());
275
- }
276
-
277
- private static isValid(email: string): boolean {
278
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
279
- }
280
-
281
- toString(): string {
282
- return this.value;
283
- }
284
-
285
- equals(other: Email): boolean {
286
- return this.value === other.value;
287
- }
288
- }
289
-
290
- // money.value-object.ts
291
- export class Money {
292
- private constructor(
293
- private readonly amount: number,
294
- private readonly currency: string
295
- ) {}
296
-
297
- static create(amount: number, currency: string): Money {
298
- if (amount < 0) throw new Error('Amount cannot be negative');
299
- if (!['USD', 'EUR', 'GBP'].includes(currency)) {
300
- throw new Error('Invalid currency');
301
- }
302
- return new Money(amount, currency);
303
- }
304
-
305
- add(other: Money): Money {
306
- if (this.currency !== other.currency) {
307
- throw new Error('Cannot add different currencies');
308
- }
309
- return Money.create(this.amount + other.amount, this.currency);
310
- }
311
-
312
- toString(): string {
313
- return `${this.amount} ${this.currency}`;
314
- }
315
- }
316
- ```
317
-
318
- ### Aggregates
319
-
320
- Cluster of entities and value objects with a root entity.
321
-
322
- ```typescript
323
- // order.aggregate.ts
324
- export class Order {
325
- private _items: OrderItem[] = [];
326
- private _status: OrderStatus = 'pending';
327
-
328
- constructor(
329
- public readonly id: string,
330
- private _customerId: string
331
- ) {}
332
-
333
- addItem(product: Product, quantity: number): void {
334
- if (this._status !== 'pending') {
335
- throw new Error('Cannot modify confirmed order');
336
- }
337
-
338
- const item = new OrderItem(product, quantity);
339
- this._items.push(item);
340
- }
341
-
342
- removeItem(productId: string): void {
343
- if (this._status !== 'pending') {
344
- throw new Error('Cannot modify confirmed order');
345
- }
346
-
347
- this._items = this._items.filter(item => item.productId !== productId);
348
- }
349
-
350
- confirm(): void {
351
- if (this._items.length === 0) {
352
- throw new Error('Cannot confirm empty order');
353
- }
354
- this._status = 'confirmed';
355
- }
356
-
357
- get total(): Money {
358
- return this._items.reduce(
359
- (sum, item) => sum.add(item.total),
360
- Money.create(0, 'USD')
361
- );
362
- }
363
-
364
- get items(): readonly OrderItem[] {
365
- return [...this._items]; // Return copy to prevent external modification
366
- }
367
- }
368
-
369
- class OrderItem {
370
- constructor(
371
- private _product: Product,
372
- private _quantity: number
373
- ) {}
374
-
375
- get productId(): string {
376
- return this._product.id;
377
- }
378
-
379
- get total(): Money {
380
- return this._product.price.multiply(this._quantity);
381
- }
382
- }
383
- ```
384
-
385
- ### Repositories (DDD Pattern)
386
-
387
- ```typescript
388
- // user.repository.interface.ts
389
- export interface UserRepository {
390
- findById(id: string): Promise<User | null>;
391
- findByEmail(email: Email): Promise<User | null>;
392
- save(user: User): Promise<void>;
393
- delete(id: string): Promise<void>;
394
- }
395
-
396
- // user.repository.impl.ts
397
- export class PrismaUserRepository implements UserRepository {
398
- constructor(private prisma: PrismaClient) {}
399
-
400
- async findById(id: string): Promise<User | null> {
401
- const data = await this.prisma.user.findUnique({ where: { id } });
402
- return data ? this.toDomain(data) : null;
403
- }
404
-
405
- async save(user: User): Promise<void> {
406
- await this.prisma.user.upsert({
407
- where: { id: user.id },
408
- create: this.toPersistence(user),
409
- update: this.toPersistence(user)
410
- });
411
- }
412
-
413
- private toDomain(data: any): User {
414
- return new User(data.id, data.email, data.name, data.createdAt);
415
- }
416
-
417
- private toPersistence(user: User): any {
418
- return {
419
- id: user.id,
420
- email: user.email,
421
- name: user.name
422
- };
423
- }
424
- }
425
- ```
426
-
427
- ### Domain Services
428
-
429
- Business logic that doesn't belong to a single entity.
430
-
431
- ```typescript
432
- // transfer-money.service.ts
433
- export class TransferMoneyService {
434
- constructor(
435
- private accountRepository: AccountRepository,
436
- private transactionRepository: TransactionRepository
437
- ) {}
438
-
439
- async transfer(
440
- fromAccountId: string,
441
- toAccountId: string,
442
- amount: Money
443
- ): Promise<void> {
444
- const fromAccount = await this.accountRepository.findById(fromAccountId);
445
- const toAccount = await this.accountRepository.findById(toAccountId);
446
-
447
- if (!fromAccount || !toAccount) {
448
- throw new Error('Account not found');
449
- }
450
-
451
- // Business logic
452
- fromAccount.withdraw(amount);
453
- toAccount.deposit(amount);
454
-
455
- // Persist changes
456
- await this.accountRepository.save(fromAccount);
457
- await this.accountRepository.save(toAccount);
458
-
459
- // Record transaction
460
- const transaction = new Transaction(fromAccountId, toAccountId, amount);
461
- await this.transactionRepository.save(transaction);
462
- }
463
- }
464
- ```
465
-
466
- ---
467
-
468
- ## Layered Architecture
469
-
470
- Organize code into horizontal layers.
471
-
472
- ```
473
- ┌─────────────────────────────────┐
474
- │ Presentation Layer │ ← Controllers, Views, DTOs
475
- ├─────────────────────────────────┤
476
- │ Application Layer │ ← Use Cases, Application Services
477
- ├─────────────────────────────────┤
478
- │ Domain Layer │ ← Entities, Value Objects, Domain Services
479
- ├─────────────────────────────────┤
480
- │ Infrastructure Layer │ ← Repositories, External Services, DB
481
- └─────────────────────────────────┘
482
- ```
483
-
484
- ### Implementation
485
-
486
- ```typescript
487
- // Presentation Layer
488
- // user.controller.ts
489
- export class UserController {
490
- constructor(private createUserUseCase: CreateUserUseCase) {}
491
-
492
- async create(req: Request, res: Response): Promise<void> {
493
- const dto = CreateUserDto.from(req.body);
494
- const user = await this.createUserUseCase.execute(dto);
495
- res.status(201).json(user);
496
- }
497
- }
498
-
499
- // Application Layer
500
- // create-user.use-case.ts
501
- export class CreateUserUseCase {
502
- constructor(
503
- private userRepository: UserRepository,
504
- private emailService: EmailService
505
- ) {}
506
-
507
- async execute(dto: CreateUserDto): Promise<User> {
508
- const email = Email.create(dto.email);
509
- const user = User.create(dto.name, email);
510
-
511
- await this.userRepository.save(user);
512
- await this.emailService.sendWelcomeEmail(user);
513
-
514
- return user;
515
- }
516
- }
517
-
518
- // Domain Layer
519
- // user.entity.ts
520
- export class User {
521
- private constructor(
522
- public readonly id: string,
523
- private _name: string,
524
- private _email: Email
525
- ) {}
526
-
527
- static create(name: string, email: Email): User {
528
- return new User(generateId(), name, email);
529
- }
530
-
531
- updateName(newName: string): void {
532
- if (newName.length < 2) {
533
- throw new Error('Name too short');
534
- }
535
- this._name = newName;
536
- }
537
- }
538
-
539
- // Infrastructure Layer
540
- // prisma-user.repository.ts
541
- export class PrismaUserRepository implements UserRepository {
542
- constructor(private prisma: PrismaClient) {}
543
-
544
- async save(user: User): Promise<void> {
545
- await this.prisma.user.create({
546
- data: {
547
- id: user.id,
548
- name: user.name,
549
- email: user.email.toString()
550
- }
551
- });
552
- }
553
- }
554
- ```
555
-
556
- ---
557
-
558
- ## Clean Architecture
559
-
560
- Uncle Bob's Clean Architecture emphasizes independence from frameworks, UI, and databases.
561
-
562
- ```
563
- ┌───────────────────────────────────────┐
564
- │ Frameworks & Drivers │ ← Web, DB, External APIs
565
- │ ┌─────────────────────────────────┐ │
566
- │ │ Interface Adapters │ │ ← Controllers, Presenters, Gateways
567
- │ │ ┌───────────────────────────┐ │ │
568
- │ │ │ Application Business │ │ │ ← Use Cases
569
- │ │ │ ┌─────────────────┐ │ │ │
570
- │ │ │ │ Enterprise │ │ │ │ ← Entities
571
- │ │ │ │ Business │ │ │ │
572
- │ │ │ │ Rules │ │ │ │
573
- │ │ │ └─────────────────┘ │ │ │
574
- │ │ └───────────────────────────┘ │ │
575
- │ └─────────────────────────────────┘ │
576
- └───────────────────────────────────────┘
577
-
578
- Dependencies point inward →
579
- ```
580
-
581
- ### Implementation
582
-
583
- ```typescript
584
- // Entities (Core)
585
- // entities/user.ts
586
- export class User {
587
- constructor(
588
- public readonly id: string,
589
- public readonly email: string,
590
- public readonly name: string
591
- ) {}
592
- }
593
-
594
- // Use Cases (Application Business Rules)
595
- // use-cases/create-user.ts
596
- export interface CreateUserInput {
597
- email: string;
598
- name: string;
599
- }
600
-
601
- export interface CreateUserOutput {
602
- id: string;
603
- email: string;
604
- name: string;
605
- }
606
-
607
- export interface UserGateway {
608
- save(user: User): Promise<void>;
609
- findByEmail(email: string): Promise<User | null>;
610
- }
611
-
612
- export class CreateUserUseCase {
613
- constructor(private userGateway: UserGateway) {}
614
-
615
- async execute(input: CreateUserInput): Promise<CreateUserOutput> {
616
- const existing = await this.userGateway.findByEmail(input.email);
617
- if (existing) {
618
- throw new Error('Email already exists');
619
- }
620
-
621
- const user = new User(generateId(), input.email, input.name);
622
- await this.userGateway.save(user);
623
-
624
- return {
625
- id: user.id,
626
- email: user.email,
627
- name: user.name
628
- };
629
- }
630
- }
631
-
632
- // Interface Adapters
633
- // adapters/user-controller.ts
634
- export class UserController {
635
- constructor(private createUserUseCase: CreateUserUseCase) {}
636
-
637
- async create(req: Request, res: Response): Promise<void> {
638
- const input: CreateUserInput = {
639
- email: req.body.email,
640
- name: req.body.name
641
- };
642
-
643
- const output = await this.createUserUseCase.execute(input);
644
- res.status(201).json(output);
645
- }
646
- }
647
-
648
- // Frameworks & Drivers
649
- // infrastructure/prisma-user-gateway.ts
650
- export class PrismaUserGateway implements UserGateway {
651
- constructor(private prisma: PrismaClient) {}
652
-
653
- async save(user: User): Promise<void> {
654
- await this.prisma.user.create({
655
- data: { id: user.id, email: user.email, name: user.name }
656
- });
657
- }
658
-
659
- async findByEmail(email: string): Promise<User | null> {
660
- const data = await this.prisma.user.findUnique({ where: { email } });
661
- return data ? new User(data.id, data.email, data.name) : null;
662
- }
663
- }
664
- ```
665
-
666
- ---
667
-
668
- ## Hexagonal Architecture
669
-
670
- Also known as Ports and Adapters. The domain is at the center, isolated from external concerns.
671
-
672
- ```
673
- ┌─────────────────────┐
674
- │ HTTP Adapter │
675
- │ (Controller) │
676
- └──────────┬──────────┘
677
- │
678
- ┌──────────▼──────────┐
679
- │ Port │
680
- │ (Interface) │
681
- └──────────┬──────────┘
682
- │
683
- ┌───────────────▼───────────────┐
684
- │ │
685
- │ Domain (Core) │
686
- │ Business Logic │
687
- │ │
688
- └───────────────┬───────────────┘
689
- │
690
- ┌──────────▼──────────┐
691
- │ Port │
692
- │ (Interface) │
693
- └──────────┬──────────┘
694
- │
695
- ┌──────────▼──────────┐
696
- │ Database Adapter │
697
- │ (Repository) │
698
- └─────────────────────┘
699
- ```
700
-
701
- ### Implementation
702
-
703
- ```typescript
704
- // Domain (Core)
705
- // domain/user.ts
706
- export class User {
707
- constructor(
708
- public readonly id: string,
709
- private _email: string,
710
- private _name: string
711
- ) {}
712
-
713
- updateEmail(newEmail: string): void {
714
- if (!this.isValidEmail(newEmail)) {
715
- throw new Error('Invalid email');
716
- }
717
- this._email = newEmail;
718
- }
719
-
720
- private isValidEmail(email: string): boolean {
721
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
722
- }
723
-
724
- get email(): string {
725
- return this._email;
726
- }
727
-
728
- get name(): string {
729
- return this._name;
730
- }
731
- }
732
-
733
- // domain/user.service.ts
734
- export class UserService {
735
- constructor(
736
- private userRepository: UserRepositoryPort,
737
- private emailService: EmailServicePort
738
- ) {}
739
-
740
- async createUser(email: string, name: string): Promise<User> {
741
- const existing = await this.userRepository.findByEmail(email);
742
- if (existing) {
743
- throw new Error('Email already exists');
744
- }
745
-
746
- const user = new User(generateId(), email, name);
747
- await this.userRepository.save(user);
748
- await this.emailService.sendWelcomeEmail(user.email);
749
-
750
- return user;
751
- }
752
- }
753
-
754
- // Ports (Interfaces)
755
- // ports/user-repository.port.ts
756
- export interface UserRepositoryPort {
757
- findById(id: string): Promise<User | null>;
758
- findByEmail(email: string): Promise<User | null>;
759
- save(user: User): Promise<void>;
760
- delete(id: string): Promise<void>;
761
- }
762
-
763
- // ports/email-service.port.ts
764
- export interface EmailServicePort {
765
- sendWelcomeEmail(email: string): Promise<void>;
766
- sendPasswordReset(email: string, token: string): Promise<void>;
767
- }
768
-
769
- // Adapters (Implementations)
770
- // adapters/prisma-user.repository.ts
771
- export class PrismaUserRepository implements UserRepositoryPort {
772
- constructor(private prisma: PrismaClient) {}
773
-
774
- async findById(id: string): Promise<User | null> {
775
- const data = await this.prisma.user.findUnique({ where: { id } });
776
- return data ? new User(data.id, data.email, data.name) : null;
777
- }
778
-
779
- async findByEmail(email: string): Promise<User | null> {
780
- const data = await this.prisma.user.findUnique({ where: { email } });
781
- return data ? new User(data.id, data.email, data.name) : null;
782
- }
783
-
784
- async save(user: User): Promise<void> {
785
- await this.prisma.user.upsert({
786
- where: { id: user.id },
787
- create: { id: user.id, email: user.email, name: user.name },
788
- update: { email: user.email, name: user.name }
789
- });
790
- }
791
-
792
- async delete(id: string): Promise<void> {
793
- await this.prisma.user.delete({ where: { id } });
794
- }
795
- }
796
-
797
- // adapters/sendgrid-email.service.ts
798
- export class SendGridEmailService implements EmailServicePort {
799
- constructor(private apiKey: string) {}
800
-
801
- async sendWelcomeEmail(email: string): Promise<void> {
802
- // SendGrid implementation
803
- await sendEmail({
804
- to: email,
805
- subject: 'Welcome!',
806
- body: 'Welcome to our platform'
807
- });
808
- }
809
-
810
- async sendPasswordReset(email: string, token: string): Promise<void> {
811
- // SendGrid implementation
812
- }
813
- }
814
-
815
- // adapters/http/user.controller.ts
816
- export class UserController {
817
- constructor(private userService: UserService) {}
818
-
819
- async create(req: Request, res: Response): Promise<void> {
820
- const { email, name } = req.body;
821
- const user = await this.userService.createUser(email, name);
822
- res.status(201).json({
823
- id: user.id,
824
- email: user.email,
825
- name: user.name
826
- });
827
- }
828
- }
829
-
830
- // Dependency Injection Setup
831
- // di-container.ts
832
- const prisma = new PrismaClient();
833
- const userRepository = new PrismaUserRepository(prisma);
834
- const emailService = new SendGridEmailService(process.env.SENDGRID_API_KEY);
835
- const userService = new UserService(userRepository, emailService);
836
- const userController = new UserController(userService);
837
-
838
- export { userController };
839
- ```
840
-
841
- ### Benefits of Hexagonal Architecture
842
-
843
- 1. **Testability**: Easy to test domain logic in isolation
844
- 2. **Flexibility**: Swap adapters without changing domain
845
- 3. **Independence**: Domain doesn't depend on frameworks
846
- 4. **Maintainability**: Clear separation of concerns
847
-
848
- ```typescript
849
- // Easy to test with mocks
850
- describe('UserService', () => {
851
- it('should create user', async () => {
852
- const mockRepository: UserRepositoryPort = {
853
- findByEmail: vi.fn().mockResolvedValue(null),
854
- save: vi.fn().mockResolvedValue(undefined),
855
- findById: vi.fn(),
856
- delete: vi.fn()
857
- };
858
-
859
- const mockEmailService: EmailServicePort = {
860
- sendWelcomeEmail: vi.fn().mockResolvedValue(undefined),
861
- sendPasswordReset: vi.fn()
862
- };
863
-
864
- const service = new UserService(mockRepository, mockEmailService);
865
- const user = await service.createUser('test@example.com', 'Test User');
866
-
867
- expect(user.email).toBe('test@example.com');
868
- expect(mockRepository.save).toHaveBeenCalled();
869
- expect(mockEmailService.sendWelcomeEmail).toHaveBeenCalled();
870
- });
871
- });
872
- ```
873
-
874
- ---
875
-
876
- ## Best Practices
877
-
878
- ### DO ✅
879
-
880
- **Use folder-by-feature for scalability**
881
- ```typescript
882
- // ✅ Good - Related code together
883
- src/
884
- ├── users/
885
- │ ├── user.entity.ts
886
- │ ├── user.service.ts
887
- │ ├── user.controller.ts
888
- │ └── user.repository.ts
889
- └── products/
890
- ├── product.entity.ts
891
- ├── product.service.ts
892
- └── product.controller.ts
893
- ```
894
-
895
- **Apply dependency inversion**
896
- ```typescript
897
- // ✅ Good - Depend on abstractions
898
- class UserService {
899
- constructor(private repository: UserRepository) {} // Interface
900
- }
901
-
902
- // ❌ Bad - Depend on concrete implementation
903
- class UserService {
904
- private repository = new MySQLUserRepository(); // Concrete class
905
- }
906
- ```
907
-
908
- **Keep domain logic pure**
909
- ```typescript
910
- // ✅ Good - Pure domain logic
911
- class Order {
912
- calculateTotal(): Money {
913
- return this.items.reduce(
914
- (sum, item) => sum.add(item.price),
915
- Money.zero()
916
- );
917
- }
918
- }
919
-
920
- // ❌ Bad - Domain depends on infrastructure
921
- class Order {
922
- async calculateTotal(): Promise<Money> {
923
- const prices = await database.query('SELECT price FROM items'); // DB dependency
924
- return prices.reduce((sum, p) => sum + p, 0);
925
- }
926
- }
927
- ```
928
-
929
- **Use value objects for domain concepts**
930
- ```typescript
931
- // ✅ Good - Value object
932
- class Email {
933
- private constructor(private value: string) {}
934
-
935
- static create(email: string): Email {
936
- if (!this.isValid(email)) throw new Error('Invalid email');
937
- return new Email(email);
938
- }
939
- }
940
-
941
- // ❌ Bad - Primitive obsession
942
- function createUser(email: string) { // Just a string
943
- // No validation, no encapsulation
944
- }
945
- ```
946
-
947
- **Separate use cases from domain logic**
948
- ```typescript
949
- // ✅ Good - Use case orchestrates
950
- class CreateUserUseCase {
951
- async execute(dto: CreateUserDto): Promise<User> {
952
- const user = User.create(dto.name, dto.email);
953
- await this.repository.save(user);
954
- await this.emailService.sendWelcome(user.email);
955
- return user;
956
- }
957
- }
958
-
959
- // ❌ Bad - Domain entity does too much
960
- class User {
961
- async create(name: string, email: string) {
962
- // Validation
963
- // Database save
964
- // Send email
965
- // Too many responsibilities
966
- }
967
- }
968
- ```
969
-
970
- ### DON'T ❌
971
-
972
- **Don't let domain depend on infrastructure**
973
- ```typescript
974
- // ❌ Bad
975
- class User {
976
- async save() {
977
- await prisma.user.create({ data: this }); // Domain depends on Prisma
978
- }
979
- }
980
-
981
- // ✅ Good
982
- class User {
983
- // Pure domain logic only
984
- }
985
-
986
- class UserRepository {
987
- async save(user: User) {
988
- await prisma.user.create({ data: this.toPersistence(user) });
989
- }
990
- }
991
- ```
992
-
993
- **Don't mix layers**
994
- ```typescript
995
- // ❌ Bad - Controller has business logic
996
- class UserController {
997
- async create(req: Request, res: Response) {
998
- const user = new User(req.body.name, req.body.email);
999
- if (await this.repository.findByEmail(user.email)) {
1000
- throw new Error('Email exists'); // Business logic in controller
1001
- }
1002
- await this.repository.save(user);
1003
- res.json(user);
1004
- }
1005
- }
1006
-
1007
- // ✅ Good - Business logic in service
1008
- class UserService {
1009
- async createUser(name: string, email: string): Promise<User> {
1010
- if (await this.repository.findByEmail(email)) {
1011
- throw new Error('Email exists'); // Business logic in service
1012
- }
1013
- const user = new User(name, email);
1014
- await this.repository.save(user);
1015
- return user;
1016
- }
1017
- }
1018
- ```
1019
-
1020
- **Don't create anemic domain models**
1021
- ```typescript
1022
- // ❌ Bad - Anemic model (just data, no behavior)
1023
- class User {
1024
- id: string;
1025
- email: string;
1026
- name: string;
1027
- }
1028
-
1029
- class UserService {
1030
- updateEmail(user: User, newEmail: string) {
1031
- // All logic in service
1032
- if (!this.isValidEmail(newEmail)) throw new Error('Invalid');
1033
- user.email = newEmail;
1034
- }
1035
- }
1036
-
1037
- // ✅ Good - Rich domain model
1038
- class User {
1039
- constructor(
1040
- public readonly id: string,
1041
- private _email: string,
1042
- private _name: string
1043
- ) {}
1044
-
1045
- updateEmail(newEmail: string): void {
1046
- if (!this.isValidEmail(newEmail)) throw new Error('Invalid');
1047
- this._email = newEmail;
1048
- }
1049
-
1050
- private isValidEmail(email: string): boolean {
1051
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
1052
- }
1053
- }
1054
- ```
1055
-
1056
- ---
1057
-
1058
- ## Summary
1059
-
1060
- **Key Takeaways:**
1061
-
1062
- 1. **Folder-by-feature** - Organize code by business domain, not technical role
1063
- 2. **Dependency inversion** - Depend on abstractions, not concrete implementations
1064
- 3. **Domain-driven design** - Model the business domain with entities, value objects, and aggregates
1065
- 4. **Layered architecture** - Separate presentation, application, domain, and infrastructure
1066
- 5. **Clean architecture** - Keep business rules independent of frameworks and UI
1067
- 6. **Hexagonal architecture** - Isolate domain with ports and adapters
1068
- 7. **Rich domain models** - Put business logic in domain entities, not services
1069
- 8. **Use cases** - Orchestrate domain logic and infrastructure
1070
- 9. **Testability** - Architecture should make testing easy
1071
- 10. **Flexibility** - Easy to swap implementations and adapt to change
1072
-
1073
- **Architecture Checklist:**
1074
-
1075
- - [ ] Code organized by feature/domain
1076
- - [ ] Dependencies point inward (toward domain)
1077
- - [ ] Domain logic is pure (no infrastructure dependencies)
1078
- - [ ] Interfaces define contracts between layers
1079
- - [ ] Use cases orchestrate application logic
1080
- - [ ] Value objects encapsulate domain concepts
1081
- - [ ] Repositories abstract data access
1082
- - [ ] Easy to test in isolation
1083
- - [ ] Easy to swap implementations
1084
- - [ ] Clear separation of concerns
1085
-
1086
- ---
1087
-
1088
- ## References
1089
-
1090
- - [Clean Architecture - Robert C. Martin](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
1091
- - [Hexagonal Architecture - Alistair Cockburn](https://alistair.cockburn.us/hexagonal-architecture/)
1092
- - [Domain-Driven Design - Eric Evans](https://www.domainlanguage.com/ddd/)
1093
- - [SOLID Principles](https://en.wikipedia.org/wiki/SOLID)
1094
- - [Dependency Inversion Principle](https://en.wikipedia.org/wiki/Dependency_inversion_principle)
1095
-
1096
-
1
+ # TypeScript Architecture Patterns
2
+
3
+ Comprehensive guide to architectural patterns for organizing TypeScript applications.
4
+
5
+ ## Table of Contents
6
+ - [Folder Organization](#folder-organization)
7
+ - [Dependency Inversion](#dependency-inversion)
8
+ - [Domain-Driven Design Basics](#domain-driven-design-basics)
9
+ - [Layered Architecture](#layered-architecture)
10
+ - [Clean Architecture](#clean-architecture)
11
+ - [Hexagonal Architecture](#hexagonal-architecture)
12
+ - [Best Practices](#best-practices)
13
+
14
+ ---
15
+
16
+ ## Folder Organization
17
+
18
+ ### Folder-by-Convention (Traditional)
19
+
20
+ Organize by technical role (controllers, services, models).
21
+
22
+ ```
23
+ src/
24
+ ├── controllers/
25
+ │ ├── user-controller.ts
26
+ │ ├── product-controller.ts
27
+ │ └── order-controller.ts
28
+ ├── services/
29
+ │ ├── user-service.ts
30
+ │ ├── product-service.ts
31
+ │ └── order-service.ts
32
+ ├── models/
33
+ │ ├── user.ts
34
+ │ ├── product.ts
35
+ │ └── order.ts
36
+ ├── repositories/
37
+ │ ├── user-repository.ts
38
+ │ ├── product-repository.ts
39
+ │ └── order-repository.ts
40
+ └── utils/
41
+ └── helpers.ts
42
+ ```
43
+
44
+ **Pros:**
45
+ - Familiar structure
46
+ - Easy to understand for small projects
47
+ - Clear separation of technical concerns
48
+
49
+ **Cons:**
50
+ - Related code is scattered
51
+ - Hard to find all code for a feature
52
+ - Difficult to scale
53
+ - Tight coupling between layers
54
+
55
+ ### Folder-by-Feature (Recommended)
56
+
57
+ Organize by business domain/feature.
58
+
59
+ ```
60
+ src/
61
+ ├── users/
62
+ │ ├── user.entity.ts
63
+ │ ├── user.repository.ts
64
+ │ ├── user.service.ts
65
+ │ ├── user.controller.ts
66
+ │ ├── dto/
67
+ │ │ ├── create-user.dto.ts
68
+ │ │ └── update-user.dto.ts
69
+ │ ├── __tests__/
70
+ │ │ ├── user.service.test.ts
71
+ │ │ └── user.controller.test.ts
72
+ │ └── index.ts
73
+ ├── products/
74
+ │ ├── product.entity.ts
75
+ │ ├── product.repository.ts
76
+ │ ├── product.service.ts
77
+ │ ├── product.controller.ts
78
+ │ └── index.ts
79
+ ├── orders/
80
+ │ ├── order.entity.ts
81
+ │ ├── order.repository.ts
82
+ │ ├── order.service.ts
83
+ │ ├── order.controller.ts
84
+ │ └── index.ts
85
+ └── shared/
86
+ ├── database/
87
+ ├── utils/
88
+ └── types/
89
+ ```
90
+
91
+ **Pros:**
92
+ - All related code in one place
93
+ - Easy to find feature code
94
+ - Better encapsulation
95
+ - Easier to scale
96
+ - Can delete entire feature folder
97
+
98
+ **Cons:**
99
+ - Less familiar initially
100
+ - Shared code needs careful management
101
+
102
+ ### Hybrid Approach
103
+
104
+ Combine both approaches for best results.
105
+
106
+ ```
107
+ src/
108
+ ├── features/ # Feature modules
109
+ │ ├── users/
110
+ │ │ ├── domain/ # Business logic
111
+ │ │ │ ├── user.entity.ts
112
+ │ │ │ └── user.service.ts
113
+ │ │ ├── infrastructure/ # External concerns
114
+ │ │ │ └── user.repository.ts
115
+ │ │ ├── presentation/ # API/UI layer
116
+ │ │ │ └── user.controller.ts
117
+ │ │ └── index.ts
118
+ │ ├── products/
119
+ │ └── orders/
120
+ ├── shared/ # Shared across features
121
+ │ ├── domain/
122
+ │ │ ├── base-entity.ts
123
+ │ │ └── value-objects/
124
+ │ ├── infrastructure/
125
+ │ │ ├── database/
126
+ │ │ └── cache/
127
+ │ └── utils/
128
+ └── core/ # Core application
129
+ ├── config/
130
+ ├── middleware/
131
+ └── types/
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Dependency Inversion
137
+
138
+ The Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules. Both should depend on abstractions.
139
+
140
+ ### Without Dependency Inversion (Bad)
141
+
142
+ ```typescript
143
+ // ❌ Bad - Direct dependency on concrete implementation
144
+ class UserService {
145
+ private repository = new MySQLUserRepository(); // Tight coupling
146
+
147
+ async getUser(id: string): Promise<User> {
148
+ return this.repository.findById(id);
149
+ }
150
+ }
151
+ ```
152
+
153
+ ### With Dependency Inversion (Good)
154
+
155
+ ```typescript
156
+ // ✅ Good - Depend on abstraction
157
+ interface UserRepository {
158
+ findById(id: string): Promise<User | null>;
159
+ save(user: User): Promise<User>;
160
+ delete(id: string): Promise<void>;
161
+ }
162
+
163
+ class UserService {
164
+ constructor(private repository: UserRepository) {} // Inject dependency
165
+
166
+ async getUser(id: string): Promise<User> {
167
+ const user = await this.repository.findById(id);
168
+ if (!user) throw new Error('User not found');
169
+ return user;
170
+ }
171
+ }
172
+
173
+ // Implementations
174
+ class MySQLUserRepository implements UserRepository {
175
+ async findById(id: string): Promise<User | null> {
176
+ // MySQL implementation
177
+ }
178
+ // ... other methods
179
+ }
180
+
181
+ class MongoUserRepository implements UserRepository {
182
+ async findById(id: string): Promise<User | null> {
183
+ // MongoDB implementation
184
+ }
185
+ // ... other methods
186
+ }
187
+
188
+ // Usage - Easy to swap implementations
189
+ const service = new UserService(new MySQLUserRepository());
190
+ // or
191
+ const service = new UserService(new MongoUserRepository());
192
+ ```
193
+
194
+ ### Dependency Injection Container
195
+
196
+ ```typescript
197
+ // container.ts
198
+ import { Container } from 'inversify';
199
+ import 'reflect-metadata';
200
+
201
+ const container = new Container();
202
+
203
+ // Bind interfaces to implementations
204
+ container.bind<UserRepository>('UserRepository').to(MySQLUserRepository);
205
+ container.bind<UserService>('UserService').to(UserService);
206
+
207
+ export { container };
208
+
209
+ // user.service.ts
210
+ import { injectable, inject } from 'inversify';
211
+
212
+ @injectable()
213
+ class UserService {
214
+ constructor(
215
+ @inject('UserRepository') private repository: UserRepository
216
+ ) {}
217
+ }
218
+ ```
219
+
220
+ ---
221
+
222
+ ## Domain-Driven Design Basics
223
+
224
+ DDD focuses on modeling the business domain.
225
+
226
+ ### Entities
227
+
228
+ Objects with identity that persist over time.
229
+
230
+ ```typescript
231
+ // user.entity.ts
232
+ export class User {
233
+ constructor(
234
+ public readonly id: string,
235
+ private _email: string,
236
+ private _name: string,
237
+ private _createdAt: Date = new Date()
238
+ ) {}
239
+
240
+ get email(): string {
241
+ return this._email;
242
+ }
243
+
244
+ get name(): string {
245
+ return this._name;
246
+ }
247
+
248
+ updateEmail(newEmail: string): void {
249
+ if (!this.isValidEmail(newEmail)) {
250
+ throw new Error('Invalid email format');
251
+ }
252
+ this._email = newEmail;
253
+ }
254
+
255
+ private isValidEmail(email: string): boolean {
256
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
257
+ }
258
+ }
259
+ ```
260
+
261
+ ### Value Objects
262
+
263
+ Objects without identity, defined by their attributes.
264
+
265
+ ```typescript
266
+ // email.value-object.ts
267
+ export class Email {
268
+ private constructor(private readonly value: string) {}
269
+
270
+ static create(email: string): Email {
271
+ if (!this.isValid(email)) {
272
+ throw new Error('Invalid email format');
273
+ }
274
+ return new Email(email.toLowerCase());
275
+ }
276
+
277
+ private static isValid(email: string): boolean {
278
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
279
+ }
280
+
281
+ toString(): string {
282
+ return this.value;
283
+ }
284
+
285
+ equals(other: Email): boolean {
286
+ return this.value === other.value;
287
+ }
288
+ }
289
+
290
+ // money.value-object.ts
291
+ export class Money {
292
+ private constructor(
293
+ private readonly amount: number,
294
+ private readonly currency: string
295
+ ) {}
296
+
297
+ static create(amount: number, currency: string): Money {
298
+ if (amount < 0) throw new Error('Amount cannot be negative');
299
+ if (!['USD', 'EUR', 'GBP'].includes(currency)) {
300
+ throw new Error('Invalid currency');
301
+ }
302
+ return new Money(amount, currency);
303
+ }
304
+
305
+ add(other: Money): Money {
306
+ if (this.currency !== other.currency) {
307
+ throw new Error('Cannot add different currencies');
308
+ }
309
+ return Money.create(this.amount + other.amount, this.currency);
310
+ }
311
+
312
+ toString(): string {
313
+ return `${this.amount} ${this.currency}`;
314
+ }
315
+ }
316
+ ```
317
+
318
+ ### Aggregates
319
+
320
+ Cluster of entities and value objects with a root entity.
321
+
322
+ ```typescript
323
+ // order.aggregate.ts
324
+ export class Order {
325
+ private _items: OrderItem[] = [];
326
+ private _status: OrderStatus = 'pending';
327
+
328
+ constructor(
329
+ public readonly id: string,
330
+ private _customerId: string
331
+ ) {}
332
+
333
+ addItem(product: Product, quantity: number): void {
334
+ if (this._status !== 'pending') {
335
+ throw new Error('Cannot modify confirmed order');
336
+ }
337
+
338
+ const item = new OrderItem(product, quantity);
339
+ this._items.push(item);
340
+ }
341
+
342
+ removeItem(productId: string): void {
343
+ if (this._status !== 'pending') {
344
+ throw new Error('Cannot modify confirmed order');
345
+ }
346
+
347
+ this._items = this._items.filter(item => item.productId !== productId);
348
+ }
349
+
350
+ confirm(): void {
351
+ if (this._items.length === 0) {
352
+ throw new Error('Cannot confirm empty order');
353
+ }
354
+ this._status = 'confirmed';
355
+ }
356
+
357
+ get total(): Money {
358
+ return this._items.reduce(
359
+ (sum, item) => sum.add(item.total),
360
+ Money.create(0, 'USD')
361
+ );
362
+ }
363
+
364
+ get items(): readonly OrderItem[] {
365
+ return [...this._items]; // Return copy to prevent external modification
366
+ }
367
+ }
368
+
369
+ class OrderItem {
370
+ constructor(
371
+ private _product: Product,
372
+ private _quantity: number
373
+ ) {}
374
+
375
+ get productId(): string {
376
+ return this._product.id;
377
+ }
378
+
379
+ get total(): Money {
380
+ return this._product.price.multiply(this._quantity);
381
+ }
382
+ }
383
+ ```
384
+
385
+ ### Repositories (DDD Pattern)
386
+
387
+ ```typescript
388
+ // user.repository.interface.ts
389
+ export interface UserRepository {
390
+ findById(id: string): Promise<User | null>;
391
+ findByEmail(email: Email): Promise<User | null>;
392
+ save(user: User): Promise<void>;
393
+ delete(id: string): Promise<void>;
394
+ }
395
+
396
+ // user.repository.impl.ts
397
+ export class PrismaUserRepository implements UserRepository {
398
+ constructor(private prisma: PrismaClient) {}
399
+
400
+ async findById(id: string): Promise<User | null> {
401
+ const data = await this.prisma.user.findUnique({ where: { id } });
402
+ return data ? this.toDomain(data) : null;
403
+ }
404
+
405
+ async save(user: User): Promise<void> {
406
+ await this.prisma.user.upsert({
407
+ where: { id: user.id },
408
+ create: this.toPersistence(user),
409
+ update: this.toPersistence(user)
410
+ });
411
+ }
412
+
413
+ private toDomain(data: any): User {
414
+ return new User(data.id, data.email, data.name, data.createdAt);
415
+ }
416
+
417
+ private toPersistence(user: User): any {
418
+ return {
419
+ id: user.id,
420
+ email: user.email,
421
+ name: user.name
422
+ };
423
+ }
424
+ }
425
+ ```
426
+
427
+ ### Domain Services
428
+
429
+ Business logic that doesn't belong to a single entity.
430
+
431
+ ```typescript
432
+ // transfer-money.service.ts
433
+ export class TransferMoneyService {
434
+ constructor(
435
+ private accountRepository: AccountRepository,
436
+ private transactionRepository: TransactionRepository
437
+ ) {}
438
+
439
+ async transfer(
440
+ fromAccountId: string,
441
+ toAccountId: string,
442
+ amount: Money
443
+ ): Promise<void> {
444
+ const fromAccount = await this.accountRepository.findById(fromAccountId);
445
+ const toAccount = await this.accountRepository.findById(toAccountId);
446
+
447
+ if (!fromAccount || !toAccount) {
448
+ throw new Error('Account not found');
449
+ }
450
+
451
+ // Business logic
452
+ fromAccount.withdraw(amount);
453
+ toAccount.deposit(amount);
454
+
455
+ // Persist changes
456
+ await this.accountRepository.save(fromAccount);
457
+ await this.accountRepository.save(toAccount);
458
+
459
+ // Record transaction
460
+ const transaction = new Transaction(fromAccountId, toAccountId, amount);
461
+ await this.transactionRepository.save(transaction);
462
+ }
463
+ }
464
+ ```
465
+
466
+ ---
467
+
468
+ ## Layered Architecture
469
+
470
+ Organize code into horizontal layers.
471
+
472
+ ```
473
+ ┌─────────────────────────────────┐
474
+ │ Presentation Layer │ ← Controllers, Views, DTOs
475
+ ├─────────────────────────────────┤
476
+ │ Application Layer │ ← Use Cases, Application Services
477
+ ├─────────────────────────────────┤
478
+ │ Domain Layer │ ← Entities, Value Objects, Domain Services
479
+ ├─────────────────────────────────┤
480
+ │ Infrastructure Layer │ ← Repositories, External Services, DB
481
+ └─────────────────────────────────┘
482
+ ```
483
+
484
+ ### Implementation
485
+
486
+ ```typescript
487
+ // Presentation Layer
488
+ // user.controller.ts
489
+ export class UserController {
490
+ constructor(private createUserUseCase: CreateUserUseCase) {}
491
+
492
+ async create(req: Request, res: Response): Promise<void> {
493
+ const dto = CreateUserDto.from(req.body);
494
+ const user = await this.createUserUseCase.execute(dto);
495
+ res.status(201).json(user);
496
+ }
497
+ }
498
+
499
+ // Application Layer
500
+ // create-user.use-case.ts
501
+ export class CreateUserUseCase {
502
+ constructor(
503
+ private userRepository: UserRepository,
504
+ private emailService: EmailService
505
+ ) {}
506
+
507
+ async execute(dto: CreateUserDto): Promise<User> {
508
+ const email = Email.create(dto.email);
509
+ const user = User.create(dto.name, email);
510
+
511
+ await this.userRepository.save(user);
512
+ await this.emailService.sendWelcomeEmail(user);
513
+
514
+ return user;
515
+ }
516
+ }
517
+
518
+ // Domain Layer
519
+ // user.entity.ts
520
+ export class User {
521
+ private constructor(
522
+ public readonly id: string,
523
+ private _name: string,
524
+ private _email: Email
525
+ ) {}
526
+
527
+ static create(name: string, email: Email): User {
528
+ return new User(generateId(), name, email);
529
+ }
530
+
531
+ updateName(newName: string): void {
532
+ if (newName.length < 2) {
533
+ throw new Error('Name too short');
534
+ }
535
+ this._name = newName;
536
+ }
537
+ }
538
+
539
+ // Infrastructure Layer
540
+ // prisma-user.repository.ts
541
+ export class PrismaUserRepository implements UserRepository {
542
+ constructor(private prisma: PrismaClient) {}
543
+
544
+ async save(user: User): Promise<void> {
545
+ await this.prisma.user.create({
546
+ data: {
547
+ id: user.id,
548
+ name: user.name,
549
+ email: user.email.toString()
550
+ }
551
+ });
552
+ }
553
+ }
554
+ ```
555
+
556
+ ---
557
+
558
+ ## Clean Architecture
559
+
560
+ Uncle Bob's Clean Architecture emphasizes independence from frameworks, UI, and databases.
561
+
562
+ ```
563
+ ┌───────────────────────────────────────┐
564
+ │ Frameworks & Drivers │ ← Web, DB, External APIs
565
+ │ ┌─────────────────────────────────┐ │
566
+ │ │ Interface Adapters │ │ ← Controllers, Presenters, Gateways
567
+ │ │ ┌───────────────────────────┐ │ │
568
+ │ │ │ Application Business │ │ │ ← Use Cases
569
+ │ │ │ ┌─────────────────┐ │ │ │
570
+ │ │ │ │ Enterprise │ │ │ │ ← Entities
571
+ │ │ │ │ Business │ │ │ │
572
+ │ │ │ │ Rules │ │ │ │
573
+ │ │ │ └─────────────────┘ │ │ │
574
+ │ │ └───────────────────────────┘ │ │
575
+ │ └─────────────────────────────────┘ │
576
+ └───────────────────────────────────────┘
577
+
578
+ Dependencies point inward →
579
+ ```
580
+
581
+ ### Implementation
582
+
583
+ ```typescript
584
+ // Entities (Core)
585
+ // entities/user.ts
586
+ export class User {
587
+ constructor(
588
+ public readonly id: string,
589
+ public readonly email: string,
590
+ public readonly name: string
591
+ ) {}
592
+ }
593
+
594
+ // Use Cases (Application Business Rules)
595
+ // use-cases/create-user.ts
596
+ export interface CreateUserInput {
597
+ email: string;
598
+ name: string;
599
+ }
600
+
601
+ export interface CreateUserOutput {
602
+ id: string;
603
+ email: string;
604
+ name: string;
605
+ }
606
+
607
+ export interface UserGateway {
608
+ save(user: User): Promise<void>;
609
+ findByEmail(email: string): Promise<User | null>;
610
+ }
611
+
612
+ export class CreateUserUseCase {
613
+ constructor(private userGateway: UserGateway) {}
614
+
615
+ async execute(input: CreateUserInput): Promise<CreateUserOutput> {
616
+ const existing = await this.userGateway.findByEmail(input.email);
617
+ if (existing) {
618
+ throw new Error('Email already exists');
619
+ }
620
+
621
+ const user = new User(generateId(), input.email, input.name);
622
+ await this.userGateway.save(user);
623
+
624
+ return {
625
+ id: user.id,
626
+ email: user.email,
627
+ name: user.name
628
+ };
629
+ }
630
+ }
631
+
632
+ // Interface Adapters
633
+ // adapters/user-controller.ts
634
+ export class UserController {
635
+ constructor(private createUserUseCase: CreateUserUseCase) {}
636
+
637
+ async create(req: Request, res: Response): Promise<void> {
638
+ const input: CreateUserInput = {
639
+ email: req.body.email,
640
+ name: req.body.name
641
+ };
642
+
643
+ const output = await this.createUserUseCase.execute(input);
644
+ res.status(201).json(output);
645
+ }
646
+ }
647
+
648
+ // Frameworks & Drivers
649
+ // infrastructure/prisma-user-gateway.ts
650
+ export class PrismaUserGateway implements UserGateway {
651
+ constructor(private prisma: PrismaClient) {}
652
+
653
+ async save(user: User): Promise<void> {
654
+ await this.prisma.user.create({
655
+ data: { id: user.id, email: user.email, name: user.name }
656
+ });
657
+ }
658
+
659
+ async findByEmail(email: string): Promise<User | null> {
660
+ const data = await this.prisma.user.findUnique({ where: { email } });
661
+ return data ? new User(data.id, data.email, data.name) : null;
662
+ }
663
+ }
664
+ ```
665
+
666
+ ---
667
+
668
+ ## Hexagonal Architecture
669
+
670
+ Also known as Ports and Adapters. The domain is at the center, isolated from external concerns.
671
+
672
+ ```
673
+ ┌─────────────────────┐
674
+ │ HTTP Adapter │
675
+ │ (Controller) │
676
+ └──────────┬──────────┘
677
+ │
678
+ ┌──────────▼──────────┐
679
+ │ Port │
680
+ │ (Interface) │
681
+ └──────────┬──────────┘
682
+ │
683
+ ┌───────────────▼───────────────┐
684
+ │ │
685
+ │ Domain (Core) │
686
+ │ Business Logic │
687
+ │ │
688
+ └───────────────┬───────────────┘
689
+ │
690
+ ┌──────────▼──────────┐
691
+ │ Port │
692
+ │ (Interface) │
693
+ └──────────┬──────────┘
694
+ │
695
+ ┌──────────▼──────────┐
696
+ │ Database Adapter │
697
+ │ (Repository) │
698
+ └─────────────────────┘
699
+ ```
700
+
701
+ ### Implementation
702
+
703
+ ```typescript
704
+ // Domain (Core)
705
+ // domain/user.ts
706
+ export class User {
707
+ constructor(
708
+ public readonly id: string,
709
+ private _email: string,
710
+ private _name: string
711
+ ) {}
712
+
713
+ updateEmail(newEmail: string): void {
714
+ if (!this.isValidEmail(newEmail)) {
715
+ throw new Error('Invalid email');
716
+ }
717
+ this._email = newEmail;
718
+ }
719
+
720
+ private isValidEmail(email: string): boolean {
721
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
722
+ }
723
+
724
+ get email(): string {
725
+ return this._email;
726
+ }
727
+
728
+ get name(): string {
729
+ return this._name;
730
+ }
731
+ }
732
+
733
+ // domain/user.service.ts
734
+ export class UserService {
735
+ constructor(
736
+ private userRepository: UserRepositoryPort,
737
+ private emailService: EmailServicePort
738
+ ) {}
739
+
740
+ async createUser(email: string, name: string): Promise<User> {
741
+ const existing = await this.userRepository.findByEmail(email);
742
+ if (existing) {
743
+ throw new Error('Email already exists');
744
+ }
745
+
746
+ const user = new User(generateId(), email, name);
747
+ await this.userRepository.save(user);
748
+ await this.emailService.sendWelcomeEmail(user.email);
749
+
750
+ return user;
751
+ }
752
+ }
753
+
754
+ // Ports (Interfaces)
755
+ // ports/user-repository.port.ts
756
+ export interface UserRepositoryPort {
757
+ findById(id: string): Promise<User | null>;
758
+ findByEmail(email: string): Promise<User | null>;
759
+ save(user: User): Promise<void>;
760
+ delete(id: string): Promise<void>;
761
+ }
762
+
763
+ // ports/email-service.port.ts
764
+ export interface EmailServicePort {
765
+ sendWelcomeEmail(email: string): Promise<void>;
766
+ sendPasswordReset(email: string, token: string): Promise<void>;
767
+ }
768
+
769
+ // Adapters (Implementations)
770
+ // adapters/prisma-user.repository.ts
771
+ export class PrismaUserRepository implements UserRepositoryPort {
772
+ constructor(private prisma: PrismaClient) {}
773
+
774
+ async findById(id: string): Promise<User | null> {
775
+ const data = await this.prisma.user.findUnique({ where: { id } });
776
+ return data ? new User(data.id, data.email, data.name) : null;
777
+ }
778
+
779
+ async findByEmail(email: string): Promise<User | null> {
780
+ const data = await this.prisma.user.findUnique({ where: { email } });
781
+ return data ? new User(data.id, data.email, data.name) : null;
782
+ }
783
+
784
+ async save(user: User): Promise<void> {
785
+ await this.prisma.user.upsert({
786
+ where: { id: user.id },
787
+ create: { id: user.id, email: user.email, name: user.name },
788
+ update: { email: user.email, name: user.name }
789
+ });
790
+ }
791
+
792
+ async delete(id: string): Promise<void> {
793
+ await this.prisma.user.delete({ where: { id } });
794
+ }
795
+ }
796
+
797
+ // adapters/sendgrid-email.service.ts
798
+ export class SendGridEmailService implements EmailServicePort {
799
+ constructor(private apiKey: string) {}
800
+
801
+ async sendWelcomeEmail(email: string): Promise<void> {
802
+ // SendGrid implementation
803
+ await sendEmail({
804
+ to: email,
805
+ subject: 'Welcome!',
806
+ body: 'Welcome to our platform'
807
+ });
808
+ }
809
+
810
+ async sendPasswordReset(email: string, token: string): Promise<void> {
811
+ // SendGrid implementation
812
+ }
813
+ }
814
+
815
+ // adapters/http/user.controller.ts
816
+ export class UserController {
817
+ constructor(private userService: UserService) {}
818
+
819
+ async create(req: Request, res: Response): Promise<void> {
820
+ const { email, name } = req.body;
821
+ const user = await this.userService.createUser(email, name);
822
+ res.status(201).json({
823
+ id: user.id,
824
+ email: user.email,
825
+ name: user.name
826
+ });
827
+ }
828
+ }
829
+
830
+ // Dependency Injection Setup
831
+ // di-container.ts
832
+ const prisma = new PrismaClient();
833
+ const userRepository = new PrismaUserRepository(prisma);
834
+ const emailService = new SendGridEmailService(process.env.SENDGRID_API_KEY);
835
+ const userService = new UserService(userRepository, emailService);
836
+ const userController = new UserController(userService);
837
+
838
+ export { userController };
839
+ ```
840
+
841
+ ### Benefits of Hexagonal Architecture
842
+
843
+ 1. **Testability**: Easy to test domain logic in isolation
844
+ 2. **Flexibility**: Swap adapters without changing domain
845
+ 3. **Independence**: Domain doesn't depend on frameworks
846
+ 4. **Maintainability**: Clear separation of concerns
847
+
848
+ ```typescript
849
+ // Easy to test with mocks
850
+ describe('UserService', () => {
851
+ it('should create user', async () => {
852
+ const mockRepository: UserRepositoryPort = {
853
+ findByEmail: vi.fn().mockResolvedValue(null),
854
+ save: vi.fn().mockResolvedValue(undefined),
855
+ findById: vi.fn(),
856
+ delete: vi.fn()
857
+ };
858
+
859
+ const mockEmailService: EmailServicePort = {
860
+ sendWelcomeEmail: vi.fn().mockResolvedValue(undefined),
861
+ sendPasswordReset: vi.fn()
862
+ };
863
+
864
+ const service = new UserService(mockRepository, mockEmailService);
865
+ const user = await service.createUser('test@example.com', 'Test User');
866
+
867
+ expect(user.email).toBe('test@example.com');
868
+ expect(mockRepository.save).toHaveBeenCalled();
869
+ expect(mockEmailService.sendWelcomeEmail).toHaveBeenCalled();
870
+ });
871
+ });
872
+ ```
873
+
874
+ ---
875
+
876
+ ## Best Practices
877
+
878
+ ### DO ✅
879
+
880
+ **Use folder-by-feature for scalability**
881
+ ```typescript
882
+ // ✅ Good - Related code together
883
+ src/
884
+ ├── users/
885
+ │ ├── user.entity.ts
886
+ │ ├── user.service.ts
887
+ │ ├── user.controller.ts
888
+ │ └── user.repository.ts
889
+ └── products/
890
+ ├── product.entity.ts
891
+ ├── product.service.ts
892
+ └── product.controller.ts
893
+ ```
894
+
895
+ **Apply dependency inversion**
896
+ ```typescript
897
+ // ✅ Good - Depend on abstractions
898
+ class UserService {
899
+ constructor(private repository: UserRepository) {} // Interface
900
+ }
901
+
902
+ // ❌ Bad - Depend on concrete implementation
903
+ class UserService {
904
+ private repository = new MySQLUserRepository(); // Concrete class
905
+ }
906
+ ```
907
+
908
+ **Keep domain logic pure**
909
+ ```typescript
910
+ // ✅ Good - Pure domain logic
911
+ class Order {
912
+ calculateTotal(): Money {
913
+ return this.items.reduce(
914
+ (sum, item) => sum.add(item.price),
915
+ Money.zero()
916
+ );
917
+ }
918
+ }
919
+
920
+ // ❌ Bad - Domain depends on infrastructure
921
+ class Order {
922
+ async calculateTotal(): Promise<Money> {
923
+ const prices = await database.query('SELECT price FROM items'); // DB dependency
924
+ return prices.reduce((sum, p) => sum + p, 0);
925
+ }
926
+ }
927
+ ```
928
+
929
+ **Use value objects for domain concepts**
930
+ ```typescript
931
+ // ✅ Good - Value object
932
+ class Email {
933
+ private constructor(private value: string) {}
934
+
935
+ static create(email: string): Email {
936
+ if (!this.isValid(email)) throw new Error('Invalid email');
937
+ return new Email(email);
938
+ }
939
+ }
940
+
941
+ // ❌ Bad - Primitive obsession
942
+ function createUser(email: string) { // Just a string
943
+ // No validation, no encapsulation
944
+ }
945
+ ```
946
+
947
+ **Separate use cases from domain logic**
948
+ ```typescript
949
+ // ✅ Good - Use case orchestrates
950
+ class CreateUserUseCase {
951
+ async execute(dto: CreateUserDto): Promise<User> {
952
+ const user = User.create(dto.name, dto.email);
953
+ await this.repository.save(user);
954
+ await this.emailService.sendWelcome(user.email);
955
+ return user;
956
+ }
957
+ }
958
+
959
+ // ❌ Bad - Domain entity does too much
960
+ class User {
961
+ async create(name: string, email: string) {
962
+ // Validation
963
+ // Database save
964
+ // Send email
965
+ // Too many responsibilities
966
+ }
967
+ }
968
+ ```
969
+
970
+ ### DON'T ❌
971
+
972
+ **Don't let domain depend on infrastructure**
973
+ ```typescript
974
+ // ❌ Bad
975
+ class User {
976
+ async save() {
977
+ await prisma.user.create({ data: this }); // Domain depends on Prisma
978
+ }
979
+ }
980
+
981
+ // ✅ Good
982
+ class User {
983
+ // Pure domain logic only
984
+ }
985
+
986
+ class UserRepository {
987
+ async save(user: User) {
988
+ await prisma.user.create({ data: this.toPersistence(user) });
989
+ }
990
+ }
991
+ ```
992
+
993
+ **Don't mix layers**
994
+ ```typescript
995
+ // ❌ Bad - Controller has business logic
996
+ class UserController {
997
+ async create(req: Request, res: Response) {
998
+ const user = new User(req.body.name, req.body.email);
999
+ if (await this.repository.findByEmail(user.email)) {
1000
+ throw new Error('Email exists'); // Business logic in controller
1001
+ }
1002
+ await this.repository.save(user);
1003
+ res.json(user);
1004
+ }
1005
+ }
1006
+
1007
+ // ✅ Good - Business logic in service
1008
+ class UserService {
1009
+ async createUser(name: string, email: string): Promise<User> {
1010
+ if (await this.repository.findByEmail(email)) {
1011
+ throw new Error('Email exists'); // Business logic in service
1012
+ }
1013
+ const user = new User(name, email);
1014
+ await this.repository.save(user);
1015
+ return user;
1016
+ }
1017
+ }
1018
+ ```
1019
+
1020
+ **Don't create anemic domain models**
1021
+ ```typescript
1022
+ // ❌ Bad - Anemic model (just data, no behavior)
1023
+ class User {
1024
+ id: string;
1025
+ email: string;
1026
+ name: string;
1027
+ }
1028
+
1029
+ class UserService {
1030
+ updateEmail(user: User, newEmail: string) {
1031
+ // All logic in service
1032
+ if (!this.isValidEmail(newEmail)) throw new Error('Invalid');
1033
+ user.email = newEmail;
1034
+ }
1035
+ }
1036
+
1037
+ // ✅ Good - Rich domain model
1038
+ class User {
1039
+ constructor(
1040
+ public readonly id: string,
1041
+ private _email: string,
1042
+ private _name: string
1043
+ ) {}
1044
+
1045
+ updateEmail(newEmail: string): void {
1046
+ if (!this.isValidEmail(newEmail)) throw new Error('Invalid');
1047
+ this._email = newEmail;
1048
+ }
1049
+
1050
+ private isValidEmail(email: string): boolean {
1051
+ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
1052
+ }
1053
+ }
1054
+ ```
1055
+
1056
+ ---
1057
+
1058
+ ## Summary
1059
+
1060
+ **Key Takeaways:**
1061
+
1062
+ 1. **Folder-by-feature** - Organize code by business domain, not technical role
1063
+ 2. **Dependency inversion** - Depend on abstractions, not concrete implementations
1064
+ 3. **Domain-driven design** - Model the business domain with entities, value objects, and aggregates
1065
+ 4. **Layered architecture** - Separate presentation, application, domain, and infrastructure
1066
+ 5. **Clean architecture** - Keep business rules independent of frameworks and UI
1067
+ 6. **Hexagonal architecture** - Isolate domain with ports and adapters
1068
+ 7. **Rich domain models** - Put business logic in domain entities, not services
1069
+ 8. **Use cases** - Orchestrate domain logic and infrastructure
1070
+ 9. **Testability** - Architecture should make testing easy
1071
+ 10. **Flexibility** - Easy to swap implementations and adapt to change
1072
+
1073
+ **Architecture Checklist:**
1074
+
1075
+ - [ ] Code organized by feature/domain
1076
+ - [ ] Dependencies point inward (toward domain)
1077
+ - [ ] Domain logic is pure (no infrastructure dependencies)
1078
+ - [ ] Interfaces define contracts between layers
1079
+ - [ ] Use cases orchestrate application logic
1080
+ - [ ] Value objects encapsulate domain concepts
1081
+ - [ ] Repositories abstract data access
1082
+ - [ ] Easy to test in isolation
1083
+ - [ ] Easy to swap implementations
1084
+ - [ ] Clear separation of concerns
1085
+
1086
+ ---
1087
+
1088
+ ## References
1089
+
1090
+ - [Clean Architecture - Robert C. Martin](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html)
1091
+ - [Hexagonal Architecture - Alistair Cockburn](https://alistair.cockburn.us/hexagonal-architecture/)
1092
+ - [Domain-Driven Design - Eric Evans](https://www.domainlanguage.com/ddd/)
1093
+ - [SOLID Principles](https://en.wikipedia.org/wiki/SOLID)
1094
+ - [Dependency Inversion Principle](https://en.wikipedia.org/wiki/Dependency_inversion_principle)
1095
+
1096
+