specialist-agent 2.13.0 → 3.3.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 (329) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -206
  3. package/dist/catalog.json +16677 -0
  4. package/dist/hw-worker.mjs +288 -0
  5. package/dist/icones/icone.ico +0 -0
  6. package/dist/icones/icone.png +0 -0
  7. package/dist/interface/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
  8. package/dist/interface/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
  9. package/dist/interface/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
  10. package/dist/interface/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
  11. package/dist/interface/assets/figtree-latin-ext-400-normal-CXAzuTZb.woff2 +0 -0
  12. package/dist/interface/assets/figtree-latin-ext-500-normal-Du0rIuHj.woff2 +0 -0
  13. package/dist/interface/assets/figtree-latin-ext-600-normal-DJlfifZj.woff2 +0 -0
  14. package/dist/interface/assets/figtree-latin-ext-700-normal-CS4sQkGV.woff2 +0 -0
  15. package/dist/interface/assets/index-BltVv7tb.js +24 -0
  16. package/dist/interface/assets/index-Cpa6kApK.css +1 -0
  17. package/dist/interface/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  18. package/dist/interface/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
  19. package/dist/interface/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
  20. package/dist/interface/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  21. package/dist/interface/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
  22. package/dist/interface/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
  23. package/dist/interface/assets/unbounded-latin-500-normal-4slEIF53.woff2 +0 -0
  24. package/dist/interface/assets/unbounded-latin-700-normal-CaoNriVp.woff2 +0 -0
  25. package/dist/interface/assets/unbounded-latin-ext-500-normal-BTIpesyw.woff2 +0 -0
  26. package/dist/interface/assets/unbounded-latin-ext-700-normal-BLzWLLjG.woff2 +0 -0
  27. package/dist/interface/icones/apple-touch-icon.png +0 -0
  28. package/dist/interface/icones/favicon-32.png +0 -0
  29. package/dist/interface/icones/icone-192.png +0 -0
  30. package/dist/interface/icones/icone-512.png +0 -0
  31. package/dist/interface/icones/icone-mascara-512.png +0 -0
  32. package/dist/interface/index.html +19 -0
  33. package/dist/interface/manifest.webmanifest +19 -0
  34. package/dist/interface/sw.js +64 -0
  35. package/dist/licencas/BRAND.md +22 -0
  36. package/dist/licencas/LICENSE-CONTENT.md +44 -0
  37. package/dist/licencas/OFL-Figtree.txt +93 -0
  38. package/dist/licencas/OFL-JetBrainsMono.txt +93 -0
  39. package/dist/licencas/OFL-Unbounded.txt +93 -0
  40. package/dist/licencas/TERCEIROS.txt +104 -0
  41. package/dist/specialist-agent.mjs +14515 -0
  42. package/dist/usage-worker.mjs +1077 -0
  43. package/package.json +34 -58
  44. package/.claude-plugin/marketplace.json +0 -52
  45. package/.claude-plugin/plugin.json +0 -37
  46. package/.codex/INSTALL.md +0 -145
  47. package/.cursor-plugin/marketplace.json +0 -52
  48. package/.cursor-plugin/plugin.json +0 -37
  49. package/.opencode/INSTALL.md +0 -127
  50. package/.opencode/opencode.json +0 -186
  51. package/agents/analyst-lite.md +0 -48
  52. package/agents/analyst.md +0 -396
  53. package/agents/api-lite.md +0 -43
  54. package/agents/api.md +0 -427
  55. package/agents/architect-lite.md +0 -104
  56. package/agents/architect.md +0 -571
  57. package/agents/autopilot-lite.md +0 -46
  58. package/agents/autopilot.md +0 -196
  59. package/agents/cloud-lite.md +0 -75
  60. package/agents/cloud.md +0 -213
  61. package/agents/data-lite.md +0 -67
  62. package/agents/data.md +0 -306
  63. package/agents/debugger-lite.md +0 -46
  64. package/agents/debugger.md +0 -410
  65. package/agents/deps-lite.md +0 -41
  66. package/agents/deps.md +0 -363
  67. package/agents/designer-lite.md +0 -67
  68. package/agents/designer.md +0 -195
  69. package/agents/devops-lite.md +0 -67
  70. package/agents/devops.md +0 -205
  71. package/agents/docs-lite.md +0 -42
  72. package/agents/docs.md +0 -454
  73. package/agents/executor-lite.md +0 -61
  74. package/agents/executor.md +0 -695
  75. package/agents/explorer-lite.md +0 -55
  76. package/agents/explorer.md +0 -152
  77. package/agents/finance-lite.md +0 -66
  78. package/agents/finance.md +0 -255
  79. package/agents/i18n-lite.md +0 -44
  80. package/agents/i18n.md +0 -594
  81. package/agents/legal-lite.md +0 -113
  82. package/agents/legal.md +0 -302
  83. package/agents/marketing-lite.md +0 -25
  84. package/agents/marketing.md +0 -188
  85. package/agents/memory.md +0 -166
  86. package/agents/orchestrator-lite.md +0 -40
  87. package/agents/orchestrator.md +0 -512
  88. package/agents/pair-lite.md +0 -38
  89. package/agents/pair.md +0 -310
  90. package/agents/perf-lite.md +0 -42
  91. package/agents/perf.md +0 -320
  92. package/agents/planner-lite.md +0 -59
  93. package/agents/planner.md +0 -272
  94. package/agents/product-lite.md +0 -25
  95. package/agents/product.md +0 -195
  96. package/agents/refactor-lite.md +0 -42
  97. package/agents/refactor.md +0 -467
  98. package/agents/ripple-lite.md +0 -106
  99. package/agents/ripple.md +0 -166
  100. package/agents/scout-lite.md +0 -37
  101. package/agents/scout.md +0 -224
  102. package/agents/security-lite.md +0 -66
  103. package/agents/security.md +0 -252
  104. package/agents/sentry-triage-lite.md +0 -54
  105. package/agents/sentry-triage.md +0 -217
  106. package/agents/starter-lite.md +0 -80
  107. package/agents/starter.md +0 -300
  108. package/agents/support-lite.md +0 -24
  109. package/agents/support.md +0 -191
  110. package/agents/tdd-lite.md +0 -43
  111. package/agents/tdd.md +0 -329
  112. package/agents/tester-lite.md +0 -71
  113. package/agents/tester.md +0 -237
  114. package/cli/architectures.mjs +0 -713
  115. package/cli/detect-architecture.mjs +0 -752
  116. package/cli/generate-architecture.mjs +0 -1096
  117. package/cli/index.mjs +0 -1217
  118. package/cli/recommend-architecture.mjs +0 -870
  119. package/hooks/after-review.mjs +0 -130
  120. package/hooks/after-task.mjs +0 -117
  121. package/hooks/before-plan.mjs +0 -155
  122. package/hooks/before-review.mjs +0 -139
  123. package/hooks/hooks.json +0 -66
  124. package/hooks/lifecycle.json +0 -91
  125. package/hooks/native/auto-dispatch.mjs +0 -207
  126. package/hooks/native/auto-format.mjs +0 -176
  127. package/hooks/native/mcp-discovery.mjs +0 -168
  128. package/hooks/native/security-config.json +0 -38
  129. package/hooks/native/security-guard.mjs +0 -323
  130. package/hooks/native/session-context.mjs +0 -179
  131. package/hooks/native/session-end.mjs +0 -42
  132. package/hooks/native/utils.mjs +0 -62
  133. package/hooks/on-error.mjs +0 -129
  134. package/hooks/session-end.mjs +0 -185
  135. package/hooks/session-start.mjs +0 -154
  136. package/packs/angular/ARCHITECTURE.md +0 -814
  137. package/packs/angular/CLAUDE.md +0 -105
  138. package/packs/angular/agents/builder.md +0 -113
  139. package/packs/angular/agents/doctor.md +0 -187
  140. package/packs/angular/agents/migrator.md +0 -101
  141. package/packs/angular/agents/reviewer.md +0 -252
  142. package/packs/angular/agents-lite/builder.md +0 -65
  143. package/packs/angular/agents-lite/doctor.md +0 -64
  144. package/packs/angular/agents-lite/migrator.md +0 -75
  145. package/packs/angular/agents-lite/reviewer.md +0 -69
  146. package/packs/angular/skills/dev-create-component/SKILL.md +0 -56
  147. package/packs/angular/skills/dev-create-injectable/SKILL.md +0 -60
  148. package/packs/angular/skills/dev-create-module/SKILL.md +0 -49
  149. package/packs/angular/skills/dev-create-service/SKILL.md +0 -34
  150. package/packs/angular/skills/dev-create-test/SKILL.md +0 -78
  151. package/packs/angular/skills/dev-generate-types/SKILL.md +0 -37
  152. package/packs/angular/skills/docs-onboard/SKILL.md +0 -42
  153. package/packs/angular/skills/migration-migrate-component/SKILL.md +0 -42
  154. package/packs/angular/skills/migration-migrate-module/SKILL.md +0 -25
  155. package/packs/angular/skills/review-check-architecture/SKILL.md +0 -67
  156. package/packs/angular/skills/review-fix-violations/SKILL.md +0 -43
  157. package/packs/angular/skills/review-review/SKILL.md +0 -43
  158. package/packs/astro/ARCHITECTURE.md +0 -718
  159. package/packs/astro/CLAUDE.md +0 -106
  160. package/packs/astro/agents/builder.md +0 -123
  161. package/packs/astro/agents/doctor.md +0 -200
  162. package/packs/astro/agents/migrator.md +0 -105
  163. package/packs/astro/agents/reviewer.md +0 -253
  164. package/packs/astro/agents-lite/builder.md +0 -71
  165. package/packs/astro/agents-lite/doctor.md +0 -66
  166. package/packs/astro/agents-lite/migrator.md +0 -71
  167. package/packs/astro/agents-lite/reviewer.md +0 -70
  168. package/packs/astro/skills/dev-create-component/SKILL.md +0 -50
  169. package/packs/astro/skills/dev-create-island/SKILL.md +0 -63
  170. package/packs/astro/skills/dev-create-module/SKILL.md +0 -49
  171. package/packs/astro/skills/dev-create-service/SKILL.md +0 -34
  172. package/packs/astro/skills/dev-create-test/SKILL.md +0 -76
  173. package/packs/astro/skills/dev-generate-types/SKILL.md +0 -37
  174. package/packs/astro/skills/docs-onboard/SKILL.md +0 -51
  175. package/packs/astro/skills/migration-migrate-component/SKILL.md +0 -48
  176. package/packs/astro/skills/migration-migrate-module/SKILL.md +0 -25
  177. package/packs/astro/skills/review-check-architecture/SKILL.md +0 -72
  178. package/packs/astro/skills/review-fix-violations/SKILL.md +0 -43
  179. package/packs/astro/skills/review-review/SKILL.md +0 -45
  180. package/packs/nextjs/ARCHITECTURE.md +0 -1033
  181. package/packs/nextjs/CLAUDE.md +0 -106
  182. package/packs/nextjs/agents/builder.md +0 -132
  183. package/packs/nextjs/agents/doctor.md +0 -226
  184. package/packs/nextjs/agents/migrator.md +0 -101
  185. package/packs/nextjs/agents/reviewer.md +0 -243
  186. package/packs/nextjs/agents-lite/builder.md +0 -74
  187. package/packs/nextjs/agents-lite/doctor.md +0 -74
  188. package/packs/nextjs/agents-lite/migrator.md +0 -75
  189. package/packs/nextjs/agents-lite/reviewer.md +0 -73
  190. package/packs/nextjs/skills/dev-create-component/SKILL.md +0 -82
  191. package/packs/nextjs/skills/dev-create-hook/SKILL.md +0 -90
  192. package/packs/nextjs/skills/dev-create-module/SKILL.md +0 -63
  193. package/packs/nextjs/skills/dev-create-service/SKILL.md +0 -35
  194. package/packs/nextjs/skills/dev-create-test/SKILL.md +0 -106
  195. package/packs/nextjs/skills/dev-generate-types/SKILL.md +0 -37
  196. package/packs/nextjs/skills/docs-onboard/SKILL.md +0 -55
  197. package/packs/nextjs/skills/migration-migrate-component/SKILL.md +0 -58
  198. package/packs/nextjs/skills/migration-migrate-module/SKILL.md +0 -25
  199. package/packs/nextjs/skills/review-check-architecture/SKILL.md +0 -101
  200. package/packs/nextjs/skills/review-fix-violations/SKILL.md +0 -48
  201. package/packs/nextjs/skills/review-review/SKILL.md +0 -47
  202. package/packs/nuxt/ARCHITECTURE.md +0 -831
  203. package/packs/nuxt/CLAUDE.md +0 -111
  204. package/packs/nuxt/agents/builder.md +0 -120
  205. package/packs/nuxt/agents/doctor.md +0 -198
  206. package/packs/nuxt/agents/migrator.md +0 -101
  207. package/packs/nuxt/agents/reviewer.md +0 -255
  208. package/packs/nuxt/agents-lite/builder.md +0 -67
  209. package/packs/nuxt/agents-lite/doctor.md +0 -67
  210. package/packs/nuxt/agents-lite/migrator.md +0 -80
  211. package/packs/nuxt/agents-lite/reviewer.md +0 -71
  212. package/packs/nuxt/skills/dev-create-component/SKILL.md +0 -60
  213. package/packs/nuxt/skills/dev-create-composable/SKILL.md +0 -33
  214. package/packs/nuxt/skills/dev-create-module/SKILL.md +0 -49
  215. package/packs/nuxt/skills/dev-create-service/SKILL.md +0 -34
  216. package/packs/nuxt/skills/dev-create-test/SKILL.md +0 -61
  217. package/packs/nuxt/skills/dev-generate-types/SKILL.md +0 -37
  218. package/packs/nuxt/skills/docs-onboard/SKILL.md +0 -49
  219. package/packs/nuxt/skills/migration-migrate-component/SKILL.md +0 -48
  220. package/packs/nuxt/skills/migration-migrate-module/SKILL.md +0 -25
  221. package/packs/nuxt/skills/review-check-architecture/SKILL.md +0 -71
  222. package/packs/nuxt/skills/review-fix-violations/SKILL.md +0 -43
  223. package/packs/nuxt/skills/review-review/SKILL.md +0 -45
  224. package/packs/react/ARCHITECTURE.md +0 -991
  225. package/packs/react/CLAUDE.md +0 -102
  226. package/packs/react/agents/builder.md +0 -113
  227. package/packs/react/agents/doctor.md +0 -203
  228. package/packs/react/agents/migrator.md +0 -101
  229. package/packs/react/agents/reviewer.md +0 -252
  230. package/packs/react/agents-lite/builder.md +0 -65
  231. package/packs/react/agents-lite/doctor.md +0 -64
  232. package/packs/react/agents-lite/migrator.md +0 -74
  233. package/packs/react/agents-lite/reviewer.md +0 -69
  234. package/packs/react/skills/dev-create-component/SKILL.md +0 -53
  235. package/packs/react/skills/dev-create-hook/SKILL.md +0 -78
  236. package/packs/react/skills/dev-create-module/SKILL.md +0 -51
  237. package/packs/react/skills/dev-create-service/SKILL.md +0 -34
  238. package/packs/react/skills/dev-create-test/SKILL.md +0 -92
  239. package/packs/react/skills/dev-generate-types/SKILL.md +0 -37
  240. package/packs/react/skills/docs-onboard/SKILL.md +0 -42
  241. package/packs/react/skills/migration-migrate-component/SKILL.md +0 -44
  242. package/packs/react/skills/migration-migrate-module/SKILL.md +0 -25
  243. package/packs/react/skills/review-check-architecture/SKILL.md +0 -73
  244. package/packs/react/skills/review-fix-violations/SKILL.md +0 -45
  245. package/packs/react/skills/review-review/SKILL.md +0 -44
  246. package/packs/svelte/ARCHITECTURE.md +0 -975
  247. package/packs/svelte/CLAUDE.md +0 -102
  248. package/packs/svelte/agents/builder.md +0 -114
  249. package/packs/svelte/agents/doctor.md +0 -174
  250. package/packs/svelte/agents/migrator.md +0 -101
  251. package/packs/svelte/agents/reviewer.md +0 -238
  252. package/packs/svelte/agents-lite/builder.md +0 -66
  253. package/packs/svelte/agents-lite/doctor.md +0 -67
  254. package/packs/svelte/agents-lite/migrator.md +0 -82
  255. package/packs/svelte/agents-lite/reviewer.md +0 -70
  256. package/packs/svelte/skills/dev-create-component/SKILL.md +0 -77
  257. package/packs/svelte/skills/dev-create-module/SKILL.md +0 -59
  258. package/packs/svelte/skills/dev-create-service/SKILL.md +0 -35
  259. package/packs/svelte/skills/dev-create-store/SKILL.md +0 -94
  260. package/packs/svelte/skills/dev-create-test/SKILL.md +0 -98
  261. package/packs/svelte/skills/dev-generate-types/SKILL.md +0 -37
  262. package/packs/svelte/skills/docs-onboard/SKILL.md +0 -47
  263. package/packs/svelte/skills/migration-migrate-component/SKILL.md +0 -51
  264. package/packs/svelte/skills/migration-migrate-module/SKILL.md +0 -25
  265. package/packs/svelte/skills/review-check-architecture/SKILL.md +0 -79
  266. package/packs/svelte/skills/review-fix-violations/SKILL.md +0 -47
  267. package/packs/svelte/skills/review-review/SKILL.md +0 -45
  268. package/packs/vue/ARCHITECTURE.md +0 -798
  269. package/packs/vue/CLAUDE.md +0 -102
  270. package/packs/vue/agents/builder.md +0 -112
  271. package/packs/vue/agents/doctor.md +0 -185
  272. package/packs/vue/agents/migrator.md +0 -101
  273. package/packs/vue/agents/reviewer.md +0 -249
  274. package/packs/vue/agents-lite/builder.md +0 -65
  275. package/packs/vue/agents-lite/doctor.md +0 -63
  276. package/packs/vue/agents-lite/migrator.md +0 -73
  277. package/packs/vue/agents-lite/reviewer.md +0 -68
  278. package/packs/vue/skills/dev-create-component/SKILL.md +0 -58
  279. package/packs/vue/skills/dev-create-composable/SKILL.md +0 -31
  280. package/packs/vue/skills/dev-create-module/SKILL.md +0 -50
  281. package/packs/vue/skills/dev-create-service/SKILL.md +0 -34
  282. package/packs/vue/skills/dev-create-test/SKILL.md +0 -62
  283. package/packs/vue/skills/dev-generate-types/SKILL.md +0 -37
  284. package/packs/vue/skills/docs-onboard/SKILL.md +0 -42
  285. package/packs/vue/skills/migration-migrate-component/SKILL.md +0 -41
  286. package/packs/vue/skills/migration-migrate-module/SKILL.md +0 -25
  287. package/packs/vue/skills/review-check-architecture/SKILL.md +0 -73
  288. package/packs/vue/skills/review-fix-violations/SKILL.md +0 -42
  289. package/packs/vue/skills/review-review/SKILL.md +0 -43
  290. package/skills/audit/SKILL.md +0 -231
  291. package/skills/autofix/SKILL.md +0 -166
  292. package/skills/autopilot/SKILL.md +0 -286
  293. package/skills/brainstorm/SKILL.md +0 -298
  294. package/skills/checkpoint/SKILL.md +0 -217
  295. package/skills/codereview/SKILL.md +0 -268
  296. package/skills/commit/SKILL.md +0 -150
  297. package/skills/copywriting/SKILL.md +0 -218
  298. package/skills/cro/SKILL.md +0 -234
  299. package/skills/debug/SKILL.md +0 -210
  300. package/skills/design-review/SKILL.md +0 -217
  301. package/skills/discovery/SKILL.md +0 -218
  302. package/skills/estimate/SKILL.md +0 -154
  303. package/skills/finish/SKILL.md +0 -220
  304. package/skills/grill/SKILL.md +0 -270
  305. package/skills/health/SKILL.md +0 -251
  306. package/skills/improve-architecture/SKILL.md +0 -205
  307. package/skills/learn/SKILL.md +0 -260
  308. package/skills/lint/SKILL.md +0 -126
  309. package/skills/migrate-architecture/SKILL.md +0 -242
  310. package/skills/migrate-framework/SKILL.md +0 -172
  311. package/skills/onboard/SKILL.md +0 -168
  312. package/skills/plan/SKILL.md +0 -141
  313. package/skills/prd/SKILL.md +0 -241
  314. package/skills/recall/SKILL.md +0 -112
  315. package/skills/remember/SKILL.md +0 -108
  316. package/skills/seo-audit/SKILL.md +0 -240
  317. package/skills/tdd/SKILL.md +0 -201
  318. package/skills/tutorial/SKILL.md +0 -346
  319. package/skills/verify/SKILL.md +0 -168
  320. package/skills/worktree/SKILL.md +0 -168
  321. package/skills/write-skill/SKILL.md +0 -225
  322. package/templates/autopilot/PROMPT.md +0 -39
  323. package/templates/autopilot/README.md +0 -122
  324. package/templates/autopilot/devcontainer.json +0 -21
  325. package/templates/industry/ecommerce.md +0 -127
  326. package/templates/industry/fintech.md +0 -161
  327. package/templates/industry/saas.md +0 -134
  328. package/templates/session-memory.json +0 -48
  329. package/templates/skill-template/SKILL.md +0 -90
@@ -1,798 +0,0 @@
1
- # 🏛️ ARCHITECTURE.md – Guia de Arquitetura e Padrões
2
-
3
- > Este documento é a **source of truth** para todos os subagentes de migração.
4
- > Qualquer decisão arquitetural deve estar documentada aqui.
5
-
6
- ---
7
-
8
- ## 1. Visão Geral
9
-
10
- Estamos migrando um projeto Vue 3 legado (JavaScript, Options API, arquitetura caótica) para uma arquitetura moderna, tipada e modular:
11
-
12
- | De | Para |
13
- |----|------|
14
- | JavaScript | TypeScript (strict) |
15
- | Options API | `<script setup lang="ts">` |
16
- | Props drilling | Component Composition + provide/inject |
17
- | Fetch manual / Axios direto | Services + Adapters + TanStack Vue Query |
18
- | Estado global desorganizado | Pinia (client state) + Vue Query (server state) |
19
- | try/catch espalhados | Error handling centralizado em composables/queries |
20
- | Estrutura por tipo | Arquitetura modular por feature |
21
- | Naming inconsistente | Convenções rígidas documentadas |
22
-
23
- ---
24
-
25
- ## 2. Estrutura de Diretórios (Arquitetura Modular)
26
-
27
- ```
28
- src/
29
- ├── app/ # Shell da aplicação
30
- │ ├── App.vue
31
- │ ├── main.ts
32
- │ ├── router/
33
- │ │ ├── index.ts
34
- │ │ └── guards/
35
- │ └── plugins/ # Registra Pinia, VueQuery, i18n, etc.
36
- │
37
- ├── modules/ # 🔑 Feature modules (bounded contexts)
38
- │ ├── auth/
39
- │ │ ├── components/
40
- │ │ ├── composables/
41
- │ │ ├── services/
42
- │ │ ├── adapters/
43
- │ │ ├── stores/
44
- │ │ ├── types/
45
- │ │ ├── views/
46
- │ │ ├── __tests__/
47
- │ │ └── index.ts # Barrel export (API pública do módulo)
48
- │ │
49
- │ ├── marketplace/
50
- │ │ ├── components/
51
- │ │ │ ├── MarketplaceList.vue
52
- │ │ │ ├── MarketplaceCard.vue
53
- │ │ │ ├── MarketplaceFilters.vue
54
- │ │ │ └── marketplace-card/ # Sub-components se necessário
55
- │ │ │ ├── MarketplaceCardHeader.vue
56
- │ │ │ └── MarketplaceCardActions.vue
57
- │ │ ├── composables/
58
- │ │ │ ├── useMarketplaceList.ts
59
- │ │ │ └── useMarketplaceFilters.ts
60
- │ │ ├── services/
61
- │ │ │ └── marketplace-service.ts
62
- │ │ ├── adapters/
63
- │ │ │ └── marketplace-adapter.ts
64
- │ │ ├── stores/
65
- │ │ │ └── marketplace-store.ts # Só client state (filtros, UI)
66
- │ │ ├── types/
67
- │ │ │ ├── marketplace.types.ts
68
- │ │ │ └── marketplace.contracts.ts # Schemas Zod
69
- │ │ ├── views/
70
- │ │ │ └── MarketplaceView.vue
71
- │ │ ├── __tests__/
72
- │ │ └── index.ts
73
- │ │
74
- │ └── [outro-modulo]/
75
- │
76
- ├── shared/ # Compartilhado entre módulos
77
- │ ├── components/ # Componentes genéricos (Button, Modal, Table)
78
- │ ├── composables/ # Lógica compartilhada
79
- │ ├── services/ # API client base, interceptors
80
- │ ├── adapters/ # Adapters compartilhados
81
- │ ├── types/ # Types globais
82
- │ ├── utils/ # Funções puras sem side effects
83
- │ ├── helpers/ # Funções com side effects ou DOM
84
- │ ├── constants/ # Valores estáticos
85
- │ └── plugins/ # Vue plugins customizados
86
- │
87
- └── assets/ # Estáticos (imagens, fonts, global CSS)
88
- ```
89
-
90
- ### Regras de Importação entre Camadas
91
- ```
92
- modules/auth ←→ shared/ ✅ Módulo importa de shared
93
- modules/auth → modules/market ❌ Módulo NÃO importa de outro módulo
94
- shared/ → modules/auth ❌ Shared NÃO importa de módulos
95
- app/ → modules/* ✅ App importa módulos (router, registros)
96
- ```
97
-
98
- Se dois módulos precisam compartilhar algo → mover para `shared/`.
99
-
100
- ---
101
-
102
- ## 3. Nomenclatura
103
-
104
- ### Arquivos e Diretórios
105
-
106
- | Tipo | Padrão | Exemplo |
107
- |------|--------|---------|
108
- | Diretórios | `kebab-case` | `user-settings/` |
109
- | Componentes Vue | `PascalCase.vue` | `UserSettingsForm.vue` |
110
- | Views (páginas) | `PascalCase + View.vue` | `MarketplaceView.vue` |
111
- | Composables | `use + PascalCase.ts` | `useMarketplaceList.ts` |
112
- | Services | `kebab-case-service.ts` | `marketplace-service.ts` |
113
- | Adapters | `kebab-case-adapter.ts` | `marketplace-adapter.ts` |
114
- | Stores Pinia | `kebab-case-store.ts` | `marketplace-store.ts` |
115
- | Types | `kebab-case.types.ts` | `marketplace.types.ts` |
116
- | Contracts/Schemas | `kebab-case.contracts.ts` | `marketplace.contracts.ts` |
117
- | Utils | `kebab-case.ts` | `format-date.ts` |
118
- | Helpers | `kebab-case.ts` | `clipboard-helper.ts` |
119
- | Testes | `NomeOriginal.spec.ts` | `MarketplaceList.spec.ts` |
120
- | Constants | `kebab-case.constants.ts` | `api-endpoints.constants.ts` |
121
-
122
- ### Código
123
-
124
- | Tipo | Padrão | Exemplo |
125
- |------|--------|---------|
126
- | Variáveis / funções | `camelCase` | `getUserById`, `isLoading` |
127
- | Types / Interfaces | `PascalCase` | `UserProfile`, `MarketplaceItem` |
128
- | Enums | `PascalCase` | `UserRole.Admin` |
129
- | Constantes | `UPPER_SNAKE_CASE` | `API_BASE_URL`, `MAX_RETRIES` |
130
- | Composables | `use` + `PascalCase` | `useAuth`, `useMarketplaceList` |
131
- | Store IDs | `kebab-case` string | `defineStore('marketplace', ...)` |
132
- | Query Keys | `camelCase` array | `['marketplace', 'list', { page }]` |
133
- | Event handlers | `handle` + ação | `handleSubmit`, `handleDelete` |
134
- | Boolean | `is`/`has`/`can`/`should` | `isLoading`, `hasPermission` |
135
-
136
- ---
137
-
138
- ## 4. Camadas de Responsabilidade
139
-
140
- ### 4.1 Services - Requisições Puras
141
-
142
- Services fazem **apenas** a request HTTP. Sem try/catch, sem transformação, sem lógica de negócio.
143
-
144
- ```typescript
145
- // services/marketplace-service.ts
146
- import { api } from '@/shared/services/api-client'
147
- import type { MarketplaceListResponse, MarketplaceItemResponse } from '../types/marketplace.types'
148
-
149
- export const marketplaceService = {
150
- list(params: { page: number; pageSize: number; search?: string }) {
151
- return api.get<MarketplaceListResponse>('/marketplace', { params })
152
- },
153
-
154
- getById(id: string) {
155
- return api.get<MarketplaceItemResponse>(`/marketplace/${id}`)
156
- },
157
-
158
- create(payload: CreateMarketplacePayload) {
159
- return api.post<MarketplaceItemResponse>('/marketplace', payload)
160
- },
161
-
162
- delete(id: string) {
163
- return api.delete(`/marketplace/${id}`)
164
- },
165
- }
166
- ```
167
-
168
- **Regras de Service:**
169
- - ❌ Sem try/catch (quem chama trata o erro)
170
- - ❌ Sem transformação de dados (adapter faz isso)
171
- - ❌ Sem lógica de negócio
172
- - ❌ Sem acesso a store ou composables
173
- - ✅ Apenas chamadas HTTP com tipagem de request/response
174
- - ✅ Um arquivo por domínio/recurso
175
- - ✅ Exportar como objeto com métodos
176
-
177
- ### 4.2 Adapters - Parsers de Contrato
178
-
179
- Adapters transformam dados da API para o contrato TypeScript da aplicação (e vice-versa). São **funções puras** sem side effects.
180
-
181
- ```typescript
182
- // adapters/marketplace-adapter.ts
183
- import type {
184
- MarketplaceListResponse,
185
- MarketplaceItemResponse,
186
- } from '../types/marketplace.types'
187
- import type {
188
- MarketplaceItem,
189
- MarketplaceList,
190
- } from '../types/marketplace.contracts'
191
-
192
- export const marketplaceAdapter = {
193
- /**
194
- * API response → App contract (inbound)
195
- */
196
- toMarketplaceItem(response: MarketplaceItemResponse): MarketplaceItem {
197
- return {
198
- id: response.uuid,
199
- name: response.name,
200
- vendor: response.vendor_name,
201
- category: response.category_slug,
202
- price: response.price_cents / 100,
203
- isActive: response.status === 'active',
204
- createdAt: new Date(response.created_at),
205
- updatedAt: new Date(response.updated_at),
206
- }
207
- },
208
-
209
- toMarketplaceList(response: MarketplaceListResponse): MarketplaceList {
210
- return {
211
- items: response.results.map(marketplaceAdapter.toMarketplaceItem),
212
- totalItems: response.count,
213
- totalPages: Math.ceil(response.count / response.page_size),
214
- currentPage: response.page,
215
- }
216
- },
217
-
218
- /**
219
- * App contract → API payload (outbound)
220
- */
221
- toCreatePayload(item: CreateMarketplaceInput): CreateMarketplacePayload {
222
- return {
223
- name: item.name,
224
- vendor_name: item.vendor,
225
- category_slug: item.category,
226
- price_cents: Math.round(item.price * 100),
227
- }
228
- },
229
- }
230
- ```
231
-
232
- **Regras de Adapter:**
233
- - ✅ Funções puras (input → output, sem side effects)
234
- - ✅ Dois sentidos: API→App (inbound) e App→API (outbound)
235
- - ✅ Renomear campos (snake_case API → camelCase App)
236
- - ✅ Converter tipos (string→Date, cents→decimal, status→boolean)
237
- - ❌ Sem chamadas HTTP
238
- - ❌ Sem acesso a store/composable
239
- - ❌ Sem try/catch (falha = tipo errado = bug a ser corrigido)
240
-
241
- ### 4.3 Types & Contracts
242
-
243
- ```typescript
244
- // types/marketplace.types.ts
245
- // ← Tipos que refletem a API exatamente como ela retorna (snake_case)
246
-
247
- export interface MarketplaceItemResponse {
248
- uuid: string
249
- name: string
250
- vendor_name: string
251
- category_slug: string
252
- price_cents: number
253
- status: 'active' | 'inactive' | 'pending'
254
- created_at: string
255
- updated_at: string
256
- }
257
-
258
- export interface MarketplaceListResponse {
259
- count: number
260
- page: number
261
- page_size: number
262
- results: MarketplaceItemResponse[]
263
- }
264
-
265
- // types/marketplace.contracts.ts
266
- // ← Contratos da aplicação (camelCase, tipos corretos)
267
-
268
- export interface MarketplaceItem {
269
- id: string
270
- name: string
271
- vendor: string
272
- category: string
273
- price: number // em reais, não centavos
274
- isActive: boolean // derivado de status
275
- createdAt: Date
276
- updatedAt: Date
277
- }
278
-
279
- export interface MarketplaceList {
280
- items: MarketplaceItem[]
281
- totalItems: number
282
- totalPages: number
283
- currentPage: number
284
- }
285
-
286
- export interface CreateMarketplaceInput {
287
- name: string
288
- vendor: string
289
- category: string
290
- price: number
291
- }
292
- ```
293
-
294
- ### 4.4 Composables - Lógica de Negócio + Orquestração
295
-
296
- Composables conectam tudo: chamam service, passam pelo adapter, gerenciam loading/error, e expõem dados reativos.
297
-
298
- ```typescript
299
- // composables/useMarketplaceList.ts
300
- import { computed, type MaybeRef } from 'vue'
301
- import { useQuery, keepPreviousData } from '@tanstack/vue-query'
302
- import { marketplaceService } from '../services/marketplace-service'
303
- import { marketplaceAdapter } from '../adapters/marketplace-adapter'
304
- import type { MarketplaceList } from '../types/marketplace.contracts'
305
-
306
- interface UseMarketplaceListOptions {
307
- page: MaybeRef<number>
308
- pageSize?: MaybeRef<number>
309
- search?: MaybeRef<string>
310
- }
311
-
312
- export function useMarketplaceList(options: UseMarketplaceListOptions) {
313
- const page = computed(() => toValue(options.page))
314
- const pageSize = computed(() => toValue(options.pageSize) ?? 20)
315
- const search = computed(() => toValue(options.search) ?? '')
316
-
317
- const {
318
- data,
319
- isLoading,
320
- isFetching,
321
- error,
322
- refetch,
323
- } = useQuery({
324
- queryKey: computed(() => [
325
- 'marketplace',
326
- 'list',
327
- { page: page.value, pageSize: pageSize.value, search: search.value },
328
- ]),
329
- queryFn: async () => {
330
- const response = await marketplaceService.list({
331
- page: page.value,
332
- pageSize: pageSize.value,
333
- search: search.value,
334
- })
335
- return marketplaceAdapter.toMarketplaceList(response.data)
336
- },
337
- staleTime: 5 * 60 * 1000,
338
- placeholderData: keepPreviousData,
339
- })
340
-
341
- const items = computed(() => data.value?.items ?? [])
342
- const totalPages = computed(() => data.value?.totalPages ?? 0)
343
- const isEmpty = computed(() => !isLoading.value && items.value.length === 0)
344
-
345
- return {
346
- // Data
347
- items,
348
- totalPages,
349
- // State
350
- isLoading,
351
- isFetching,
352
- isEmpty,
353
- error,
354
- // Actions
355
- refetch,
356
- }
357
- }
358
- ```
359
-
360
- **Regras de Composable:**
361
- - ✅ Orquestra: service → adapter → dados reativos
362
- - ✅ Gerencia loading, error, empty states
363
- - ✅ Retorna refs/computed (nunca raw values)
364
- - ✅ Nomear `useXxx`
365
- - ✅ Retorno tipado e documentado
366
- - ❌ Sem template/rendering (isso é do componente)
367
- - ❌ Sem acesso direto à API (service faz isso)
368
-
369
- ### 4.5 Stores Pinia - Apenas Client State
370
-
371
- Pinia é para estado que **não vem do servidor**: UI state, filtros, preferências, auth.
372
-
373
- ```typescript
374
- // stores/marketplace-store.ts
375
- import { defineStore } from 'pinia'
376
- import { ref, computed } from 'vue'
377
-
378
- export const useMarketplaceStore = defineStore('marketplace', () => {
379
- // State
380
- const selectedCategory = ref<string | null>(null)
381
- const viewMode = ref<'grid' | 'list'>('grid')
382
- const searchQuery = ref('')
383
-
384
- // Getters
385
- const hasActiveFilters = computed(() =>
386
- !!selectedCategory.value || !!searchQuery.value
387
- )
388
-
389
- // Actions
390
- function setCategory(category: string | null) {
391
- selectedCategory.value = category
392
- }
393
-
394
- function setViewMode(mode: 'grid' | 'list') {
395
- viewMode.value = mode
396
- }
397
-
398
- function clearFilters() {
399
- selectedCategory.value = null
400
- searchQuery.value = ''
401
- }
402
-
403
- return {
404
- // State (readonly para consumers)
405
- selectedCategory: readonly(selectedCategory),
406
- viewMode: readonly(viewMode),
407
- searchQuery, // writeable se usado com v-model
408
- // Getters
409
- hasActiveFilters,
410
- // Actions
411
- setCategory,
412
- setViewMode,
413
- clearFilters,
414
- }
415
- })
416
- ```
417
-
418
- **Regras de Store:**
419
- - ✅ Apenas client state (UI, filtros, preferências, session)
420
- - ✅ Setup syntax (`defineStore('id', () => { ... })`)
421
- - ✅ State exposto como `readonly()` quando não precisa de v-model
422
- - ✅ `storeToRefs()` obrigatório ao desestruturar em componentes
423
- - ❌ Sem server state (dados da API vão em TanStack Vue Query)
424
- - ❌ Sem chamadas HTTP dentro de stores
425
- - ❌ Sem lógica de negócio complexa (composable faz isso)
426
-
427
- ---
428
-
429
- ## 5. Componentes Vue – Composition Pattern
430
-
431
- ### 5.1 Padrão de SFC
432
-
433
- ```vue
434
- <script setup lang="ts">
435
- // 1. Imports
436
- import { ref, computed } from 'vue'
437
- import { storeToRefs } from 'pinia'
438
- import { useMarketplaceList } from '../composables/useMarketplaceList'
439
- import { useMarketplaceStore } from '../stores/marketplace-store'
440
- import MarketplaceCard from './MarketplaceCard.vue'
441
- import type { MarketplaceItem } from '../types/marketplace.contracts'
442
-
443
- // 2. Props & Emits (type-based)
444
- interface Props {
445
- categoryFilter?: string
446
- }
447
-
448
- interface Emits {
449
- (e: 'select', item: MarketplaceItem): void
450
- }
451
-
452
- const props = withDefaults(defineProps<Props>(), {
453
- categoryFilter: undefined,
454
- })
455
-
456
- const emit = defineEmits<Emits>()
457
-
458
- // 3. Stores (com storeToRefs)
459
- const store = useMarketplaceStore()
460
- const { searchQuery, viewMode } = storeToRefs(store)
461
-
462
- // 4. Composables
463
- const page = ref(1)
464
- const { items, totalPages, isLoading, isEmpty } = useMarketplaceList({
465
- page,
466
- search: searchQuery,
467
- })
468
-
469
- // 5. Local state
470
- const selectedId = ref<string | null>(null)
471
-
472
- // 6. Computed
473
- const isFirstPage = computed(() => page.value === 1)
474
-
475
- // 7. Handlers
476
- function handleSelect(item: MarketplaceItem) {
477
- selectedId.value = item.id
478
- emit('select', item)
479
- }
480
-
481
- function handlePageChange(newPage: number) {
482
- page.value = newPage
483
- }
484
- </script>
485
-
486
- <template>
487
- <!-- ... -->
488
- </template>
489
-
490
- <style scoped>
491
- /* ... */
492
- </style>
493
- ```
494
-
495
- ### 5.2 Stop Prop Drilling – Component Composition
496
-
497
- **❌ ERRADO – Prop Drilling:**
498
- ```vue
499
- <!-- GrandParent passa props por 3 níveis -->
500
- <Parent :user="user" :theme="theme" :permissions="permissions">
501
- <Child :user="user" :theme="theme" :permissions="permissions">
502
- <GrandChild :user="user" :permissions="permissions" />
503
- </Child>
504
- </Parent>
505
- ```
506
-
507
- **✅ CORRETO – Composition com Slots:**
508
- ```vue
509
- <!-- MarketplaceView.vue (View/Page) -->
510
- <template>
511
- <PageLayout>
512
- <template #header>
513
- <MarketplaceFilters />
514
- </template>
515
-
516
- <template #content>
517
- <MarketplaceList @select="handleSelect">
518
- <template #card="{ item }">
519
- <MarketplaceCard :item="item" />
520
- </template>
521
-
522
- <template #empty>
523
- <EmptyState message="Nenhum item encontrado" />
524
- </template>
525
- </MarketplaceList>
526
- </template>
527
-
528
- <template #sidebar>
529
- <MarketplaceDetails v-if="selectedItem" :item="selectedItem" />
530
- </template>
531
- </PageLayout>
532
- </template>
533
- ```
534
-
535
- **✅ CORRETO – Provide/Inject para contexto compartilhado:**
536
- ```typescript
537
- // composables/useMarketplaceContext.ts
538
- import type { InjectionKey, Ref } from 'vue'
539
-
540
- interface MarketplaceContext {
541
- selectedItem: Ref<MarketplaceItem | null>
542
- selectItem: (item: MarketplaceItem) => void
543
- clearSelection: () => void
544
- }
545
-
546
- export const MARKETPLACE_CONTEXT: InjectionKey<MarketplaceContext> = Symbol('marketplace-context')
547
-
548
- export function provideMarketplaceContext() {
549
- const selectedItem = ref<MarketplaceItem | null>(null)
550
-
551
- function selectItem(item: MarketplaceItem) {
552
- selectedItem.value = item
553
- }
554
-
555
- function clearSelection() {
556
- selectedItem.value = null
557
- }
558
-
559
- const context: MarketplaceContext = {
560
- selectedItem: readonly(selectedItem),
561
- selectItem,
562
- clearSelection,
563
- }
564
-
565
- provide(MARKETPLACE_CONTEXT, context)
566
- return context
567
- }
568
-
569
- export function useMarketplaceContext() {
570
- const context = inject(MARKETPLACE_CONTEXT)
571
- if (!context) {
572
- throw new Error('useMarketplaceContext must be used within a MarketplaceView')
573
- }
574
- return context
575
- }
576
- ```
577
-
578
- ### 5.3 Hierarquia de Componentes
579
-
580
- ```
581
- Views (Pages) → Composição, orquestração, provide context
582
- └── Layout → Estrutura visual (slots)
583
- └── Features → Lógica de feature (composables, stores)
584
- └── Shared → Apresentação pura (props in, events out)
585
- ```
586
-
587
- | Tipo | Responsabilidade | Pode ter lógica? | Pode ter estado? |
588
- |------|-----------------|-----------------|-----------------|
589
- | **Views** | Compor componentes, provide context | Via composables | Sim (composables) |
590
- | **Feature Components** | UI + lógica da feature | Via composables | Sim (composables) |
591
- | **Shared Components** | UI genérica, reutilizável | Mínima (UI only) | Mínimo (local) |
592
-
593
- ---
594
-
595
- ## 6. Utils vs Helpers
596
-
597
- ### Utils - Funções Puras
598
- - Sem side effects
599
- - Input → Output determinístico
600
- - Testáveis sem mocks
601
- - Sem dependência de DOM, browser APIs, ou Vue
602
-
603
- ```typescript
604
- // shared/utils/format-date.ts
605
- export function formatDate(date: Date, locale = 'pt-BR'): string {
606
- return new Intl.DateTimeFormat(locale).format(date)
607
- }
608
-
609
- // shared/utils/currency.ts
610
- export function formatCurrency(value: number, currency = 'BRL'): string {
611
- return new Intl.NumberFormat('pt-BR', { style: 'currency', currency }).format(value)
612
- }
613
-
614
- // shared/utils/string.ts
615
- export function slugify(text: string): string {
616
- return text.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '')
617
- }
618
- ```
619
-
620
- ### Helpers - Funções com Side Effects ou DOM
621
- - Interagem com browser APIs (clipboard, localStorage, DOM)
622
- - Podem ter side effects
623
- - Podem precisar de mocks nos testes
624
-
625
- ```typescript
626
- // shared/helpers/clipboard-helper.ts
627
- export async function copyToClipboard(text: string): Promise<boolean> {
628
- try {
629
- await navigator.clipboard.writeText(text)
630
- return true
631
- } catch {
632
- return false
633
- }
634
- }
635
-
636
- // shared/helpers/download-helper.ts
637
- export function downloadAsFile(content: string, filename: string): void {
638
- const blob = new Blob([content], { type: 'text/plain' })
639
- const url = URL.createObjectURL(blob)
640
- const a = document.createElement('a')
641
- a.href = url
642
- a.download = filename
643
- a.click()
644
- URL.revokeObjectURL(url)
645
- }
646
-
647
- // shared/helpers/toast-helper.ts
648
- export function showToast(message: string, type: 'success' | 'error' = 'success') {
649
- // integra com lib de toast (PrimeVue Toast, etc.)
650
- }
651
- ```
652
-
653
- ---
654
-
655
- ## 7. Error Handling - Padrão Centralizado
656
-
657
- ### Na Camada de Query (composable)
658
- ```typescript
659
- // O try/catch fica no queryFn ou no onError da mutation
660
- const { mutate: deleteItem } = useMutation({
661
- mutationFn: (id: string) => marketplaceService.delete(id),
662
- onSuccess: () => {
663
- queryClient.invalidateQueries({ queryKey: ['marketplace'] })
664
- showToast('Item removido com sucesso')
665
- },
666
- onError: (error) => {
667
- showToast(parseApiError(error), 'error')
668
- },
669
- })
670
- ```
671
-
672
- ### Parser de Erros Centralizado
673
- ```typescript
674
- // shared/utils/parse-api-error.ts
675
- import type { AxiosError } from 'axios'
676
-
677
- interface ApiErrorResponse {
678
- message?: string
679
- detail?: string
680
- errors?: Record<string, string[]>
681
- }
682
-
683
- export function parseApiError(error: unknown): string {
684
- if (error instanceof AxiosError) {
685
- const data = error.response?.data as ApiErrorResponse | undefined
686
- if (data?.message) return data.message
687
- if (data?.detail) return data.detail
688
- if (error.response?.status === 403) return 'Sem permissão para esta ação'
689
- if (error.response?.status === 404) return 'Recurso não encontrado'
690
- if (error.response?.status === 500) return 'Erro interno do servidor'
691
- }
692
- return 'Erro inesperado. Tente novamente.'
693
- }
694
- ```
695
-
696
- ### Interceptor Global (API Client)
697
- ```typescript
698
- // shared/services/api-client.ts
699
- import axios from 'axios'
700
-
701
- export const api = axios.create({
702
- baseURL: import.meta.env.VITE_API_BASE_URL,
703
- })
704
-
705
- api.interceptors.response.use(
706
- (response) => response,
707
- (error) => {
708
- // Apenas log e redirect em 401 (session expired)
709
- if (error.response?.status === 401) {
710
- // redirect to login
711
- }
712
- // NÃO tratar outros erros aqui – deixar para quem chamou
713
- return Promise.reject(error)
714
- },
715
- )
716
- ```
717
-
718
- ---
719
-
720
- ## 8. Barrel Exports (index.ts)
721
-
722
- Cada módulo exporta apenas sua **API pública**:
723
-
724
- ```typescript
725
- // modules/marketplace/index.ts
726
-
727
- // Views (para o router)
728
- export { default as MarketplaceView } from './views/MarketplaceView.vue'
729
-
730
- // Componentes reutilizáveis por outros (raro, evitar)
731
- export { default as MarketplaceCard } from './components/MarketplaceCard.vue'
732
-
733
- // Types (para quem precisa tipar)
734
- export type { MarketplaceItem, MarketplaceList } from './types/marketplace.contracts'
735
-
736
- // ❌ NÃO exportar:
737
- // - services (detalhe interno)
738
- // - adapters (detalhe interno)
739
- // - stores (usar via composable)
740
- // - composables internos
741
- ```
742
-
743
- ---
744
-
745
- ## 9. Regras SOLID aplicadas ao Vue
746
-
747
- | Princípio | Aplicação Vue |
748
- |-----------|--------------|
749
- | **S**ingle Responsibility | 1 componente = 1 responsabilidade. 1 composable = 1 domínio. 1 service = 1 recurso. |
750
- | **O**pen/Closed | Componentes extensíveis via slots e props, não por modificação interna. |
751
- | **L**iskov Substitution | Componentes shared devem funcionar em qualquer contexto sem quebrar. |
752
- | **I**nterface Segregation | Props específicas, não objetos genéricos. `<UserAvatar :src :alt>` não `<UserAvatar :user>`. |
753
- | **D**ependency Inversion | Composables dependem de interfaces (types), não de implementações. Services injetados via composable, não importados direto no componente. |
754
-
755
- ---
756
-
757
- ## 10. Checklist de Migração por Arquivo
758
-
759
- ### Componente .vue
760
- - [ ] `<script setup lang="ts">`
761
- - [ ] Props type-based (`defineProps<T>()`)
762
- - [ ] Emits type-based (`defineEmits<T>()`)
763
- - [ ] Sem prop drilling (usar composition/provide-inject)
764
- - [ ] < 200 linhas total
765
- - [ ] Template < 100 linhas
766
- - [ ] Sem lógica de negócio no template
767
- - [ ] Loading / error / empty states
768
- - [ ] Sem `v-html` ou com sanitização
769
-
770
- ### Composable
771
- - [ ] Prefixo `use`
772
- - [ ] Return type explícito com refs/computed
773
- - [ ] Usa service + adapter (nunca API direto)
774
- - [ ] TanStack Vue Query para server state
775
- - [ ] Error handling via onError da query/mutation
776
-
777
- ### Service
778
- - [ ] Apenas chamadas HTTP
779
- - [ ] Sem try/catch
780
- - [ ] Sem transformação de dados
781
- - [ ] Tipagem de request e response
782
-
783
- ### Adapter
784
- - [ ] Funções puras
785
- - [ ] Inbound (API→App) e Outbound (App→API)
786
- - [ ] Conversão de naming (snake_case → camelCase)
787
- - [ ] Conversão de tipos (string→Date, etc.)
788
-
789
- ### Store Pinia
790
- - [ ] Apenas client state
791
- - [ ] Setup syntax
792
- - [ ] `readonly()` no state exposto
793
- - [ ] `storeToRefs()` nos consumers
794
-
795
- ### Types
796
- - [ ] `.types.ts` para tipos da API (raw response)
797
- - [ ] `.contracts.ts` para contratos da aplicação
798
- - [ ] Sem `any`