create-huenei-template 0.2.13 → 0.2.15

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 (432) hide show
  1. package/dist/config/templates.js +7 -0
  2. package/dist/templates/cursor/.cursor/agents/config-drift-analyzer.md +152 -0
  3. package/dist/templates/cursor/.cursor/commands/actualizar-reglas.md +580 -0
  4. package/dist/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
  5. package/dist/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
  6. package/dist/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
  7. package/dist/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
  8. package/dist/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
  9. package/dist/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
  10. package/dist/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
  11. package/dist/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
  12. package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
  13. package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
  14. package/dist/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
  15. package/dist/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
  16. package/dist/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
  17. package/dist/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
  18. package/dist/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
  19. package/dist/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
  20. package/dist/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
  21. package/dist/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
  22. package/dist/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
  23. package/dist/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
  24. package/dist/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
  25. package/dist/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
  26. package/dist/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
  27. package/dist/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
  28. package/dist/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
  29. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
  30. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
  31. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
  32. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
  33. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
  34. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
  35. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
  36. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
  37. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
  38. package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
  39. package/dist/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
  40. package/dist/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
  41. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
  42. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
  43. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
  44. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
  45. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
  46. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
  47. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
  48. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
  49. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
  50. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
  51. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
  52. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
  53. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
  54. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
  55. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
  56. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
  57. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
  58. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
  59. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
  60. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
  61. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
  62. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
  63. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
  64. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
  65. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
  66. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
  67. package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
  68. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
  69. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
  70. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
  71. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
  72. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
  73. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
  74. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
  75. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
  76. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
  77. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
  78. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
  79. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
  80. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
  81. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
  82. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
  83. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
  84. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
  85. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
  86. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
  87. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
  88. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
  89. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
  90. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
  91. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
  92. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
  93. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
  94. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
  95. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
  96. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
  97. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
  98. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
  99. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
  100. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
  101. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
  102. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
  103. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
  104. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
  105. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
  106. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
  107. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
  108. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
  109. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
  110. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
  111. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
  112. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
  113. package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
  114. package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
  115. package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
  116. package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
  117. package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
  118. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
  119. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
  120. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
  121. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
  122. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
  123. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
  124. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
  125. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
  126. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
  127. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
  128. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
  129. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
  130. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
  131. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
  132. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
  133. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
  134. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
  135. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
  136. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
  137. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
  138. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
  139. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
  140. package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
  141. package/dist/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
  142. package/dist/templates/frontend/react-ssr/.dockerignore +14 -0
  143. package/dist/templates/frontend/react-ssr/.env.example +9 -0
  144. package/dist/templates/frontend/react-ssr/.husky/pre-commit +1 -0
  145. package/dist/templates/frontend/react-ssr/Dockerfile +41 -0
  146. package/dist/templates/frontend/react-ssr/README.md +121 -0
  147. package/dist/templates/frontend/react-ssr/components.json +22 -0
  148. package/dist/templates/frontend/react-ssr/docker-compose.yml +21 -0
  149. package/dist/templates/frontend/react-ssr/eslint.config.mjs +26 -0
  150. package/dist/templates/frontend/react-ssr/next.config.ts +7 -0
  151. package/dist/templates/frontend/react-ssr/package.json +86 -0
  152. package/dist/templates/frontend/react-ssr/postcss.config.mjs +5 -0
  153. package/dist/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
  154. package/dist/templates/frontend/react-ssr/prisma/seed.ts +109 -0
  155. package/dist/templates/frontend/react-ssr/prisma.config.ts +17 -0
  156. package/dist/templates/frontend/react-ssr/skills-lock.json +65 -0
  157. package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
  158. package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
  159. package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
  160. package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
  161. package/dist/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
  162. package/dist/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
  163. package/dist/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
  164. package/dist/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
  165. package/dist/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
  166. package/dist/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
  167. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
  168. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
  169. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
  170. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
  171. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
  172. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
  173. package/dist/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
  174. package/dist/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
  175. package/dist/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
  176. package/dist/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
  177. package/dist/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
  178. package/dist/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
  179. package/dist/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
  180. package/dist/templates/frontend/react-ssr/src/app/globals.css +99 -0
  181. package/dist/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
  182. package/dist/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
  183. package/dist/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
  184. package/dist/templates/frontend/react-ssr/src/app/page.tsx +331 -0
  185. package/dist/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
  186. package/dist/templates/frontend/react-ssr/src/auth.ts +64 -0
  187. package/dist/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
  188. package/dist/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
  189. package/dist/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
  190. package/dist/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
  191. package/dist/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
  192. package/dist/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
  193. package/dist/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
  194. package/dist/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
  195. package/dist/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
  196. package/dist/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
  197. package/dist/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
  198. package/dist/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
  199. package/dist/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
  200. package/dist/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
  201. package/dist/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
  202. package/dist/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
  203. package/dist/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
  204. package/dist/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
  205. package/dist/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
  206. package/dist/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
  207. package/dist/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
  208. package/dist/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
  209. package/dist/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
  210. package/dist/templates/frontend/react-ssr/src/proxy.ts +31 -0
  211. package/dist/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
  212. package/dist/templates/frontend/react-ssr/src/test/setup.ts +1 -0
  213. package/dist/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
  214. package/dist/templates/frontend/react-ssr/src/types/index.ts +36 -0
  215. package/dist/templates/frontend/react-ssr/tsconfig.json +41 -0
  216. package/dist/templates/frontend/react-ssr/vitest.config.ts +41 -0
  217. package/package.json +1 -1
  218. package/templates/cursor/.cursor/agents/config-drift-analyzer.md +152 -0
  219. package/templates/cursor/.cursor/commands/actualizar-reglas.md +580 -0
  220. package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
  221. package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
  222. package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
  223. package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
  224. package/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
  225. package/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
  226. package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
  227. package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
  228. package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
  229. package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
  230. package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
  231. package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
  232. package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
  233. package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
  234. package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
  235. package/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
  236. package/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
  237. package/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
  238. package/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
  239. package/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
  240. package/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
  241. package/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
  242. package/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
  243. package/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
  244. package/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
  245. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
  246. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
  247. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
  248. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
  249. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
  250. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
  251. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
  252. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
  253. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
  254. package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
  255. package/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
  256. package/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
  257. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
  258. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
  259. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
  260. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
  261. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
  262. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
  263. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
  264. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
  265. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
  266. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
  267. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
  268. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
  269. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
  270. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
  271. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
  272. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
  273. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
  274. package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
  275. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
  276. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
  277. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
  278. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
  279. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
  280. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
  281. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
  282. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
  283. package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
  284. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
  285. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
  286. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
  287. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
  288. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
  289. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
  290. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
  291. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
  292. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
  293. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
  294. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
  295. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
  296. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
  297. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
  298. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
  299. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
  300. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
  301. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
  302. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
  303. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
  304. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
  305. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
  306. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
  307. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
  308. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
  309. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
  310. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
  311. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
  312. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
  313. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
  314. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
  315. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
  316. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
  317. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
  318. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
  319. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
  320. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
  321. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
  322. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
  323. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
  324. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
  325. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
  326. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
  327. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
  328. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
  329. package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
  330. package/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
  331. package/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
  332. package/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
  333. package/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
  334. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
  335. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
  336. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
  337. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
  338. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
  339. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
  340. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
  341. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
  342. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
  343. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
  344. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
  345. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
  346. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
  347. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
  348. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
  349. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
  350. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
  351. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
  352. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
  353. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
  354. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
  355. package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
  356. package/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
  357. package/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
  358. package/templates/frontend/react-ssr/.dockerignore +14 -0
  359. package/templates/frontend/react-ssr/.env.example +9 -0
  360. package/templates/frontend/react-ssr/.husky/pre-commit +1 -0
  361. package/templates/frontend/react-ssr/Dockerfile +41 -0
  362. package/templates/frontend/react-ssr/README.md +121 -0
  363. package/templates/frontend/react-ssr/components.json +22 -0
  364. package/templates/frontend/react-ssr/docker-compose.yml +21 -0
  365. package/templates/frontend/react-ssr/eslint.config.mjs +26 -0
  366. package/templates/frontend/react-ssr/next.config.ts +7 -0
  367. package/templates/frontend/react-ssr/package.json +86 -0
  368. package/templates/frontend/react-ssr/postcss.config.mjs +5 -0
  369. package/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
  370. package/templates/frontend/react-ssr/prisma/seed.ts +109 -0
  371. package/templates/frontend/react-ssr/prisma.config.ts +17 -0
  372. package/templates/frontend/react-ssr/skills-lock.json +65 -0
  373. package/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
  374. package/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
  375. package/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
  376. package/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
  377. package/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
  378. package/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
  379. package/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
  380. package/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
  381. package/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
  382. package/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
  383. package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
  384. package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
  385. package/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
  386. package/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
  387. package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
  388. package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
  389. package/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
  390. package/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
  391. package/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
  392. package/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
  393. package/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
  394. package/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
  395. package/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
  396. package/templates/frontend/react-ssr/src/app/globals.css +99 -0
  397. package/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
  398. package/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
  399. package/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
  400. package/templates/frontend/react-ssr/src/app/page.tsx +331 -0
  401. package/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
  402. package/templates/frontend/react-ssr/src/auth.ts +64 -0
  403. package/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
  404. package/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
  405. package/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
  406. package/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
  407. package/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
  408. package/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
  409. package/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
  410. package/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
  411. package/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
  412. package/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
  413. package/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
  414. package/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
  415. package/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
  416. package/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
  417. package/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
  418. package/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
  419. package/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
  420. package/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
  421. package/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
  422. package/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
  423. package/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
  424. package/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
  425. package/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
  426. package/templates/frontend/react-ssr/src/proxy.ts +31 -0
  427. package/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
  428. package/templates/frontend/react-ssr/src/test/setup.ts +1 -0
  429. package/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
  430. package/templates/frontend/react-ssr/src/types/index.ts +36 -0
  431. package/templates/frontend/react-ssr/tsconfig.json +41 -0
  432. package/templates/frontend/react-ssr/vitest.config.ts +41 -0
@@ -0,0 +1,209 @@
1
+ import { existsSync, mkdirSync, writeFileSync, readFileSync } from "fs";
2
+ import path from "path";
3
+
4
+ interface AfterFileEditInput {
5
+ file_path: string;
6
+ workspace_roots: string[];
7
+ [key: string]: unknown;
8
+ }
9
+
10
+ function readStdin(): Promise<string> {
11
+ return new Promise((resolve) => {
12
+ let data = "";
13
+ process.stdin.setEncoding("utf8");
14
+ process.stdin.on("data", (chunk: string) => {
15
+ data += chunk;
16
+ });
17
+ process.stdin.on("end", () => resolve(data));
18
+ process.stdin.on("error", () => resolve(""));
19
+ });
20
+ }
21
+
22
+ const SKIP_PATTERNS = [
23
+ "__tests__",
24
+ ".test.",
25
+ ".spec.",
26
+ "test/",
27
+ "node_modules",
28
+ ".next",
29
+ ".cursor",
30
+ "globals.css",
31
+ "layout.tsx",
32
+ "providers.tsx",
33
+ "setup.ts",
34
+ ];
35
+
36
+ type FileType = "component" | "hook" | "util" | "action" | null;
37
+
38
+ function detectFileType(relativePath: string): FileType {
39
+ if (relativePath.startsWith("src/components/")) return "component";
40
+ if (relativePath.startsWith("src/hooks/")) return "hook";
41
+ if (relativePath.startsWith("src/lib/")) return "util";
42
+ if (relativePath.startsWith("src/actions/")) return "action";
43
+ return null;
44
+ }
45
+
46
+ function generateScaffold(
47
+ fileType: FileType,
48
+ relativePath: string,
49
+ fileName: string,
50
+ ): string {
51
+ const moduleName = fileName.replace(/\.(tsx?|jsx?)$/, "");
52
+ const importPath = `@/${relativePath.replace(/^src\//, "").replace(/\.(tsx?|jsx?)$/, "")}`;
53
+
54
+ switch (fileType) {
55
+ case "component":
56
+ return [
57
+ `import { describe, it, expect } from "vitest";`,
58
+ `import { render, screen } from "@testing-library/react";`,
59
+ `// import { ${toPascalCase(moduleName)} } from "${importPath}";`,
60
+ "",
61
+ `describe("${toPascalCase(moduleName)}", () => {`,
62
+ ` it.todo("renders correctly");`,
63
+ "});",
64
+ "",
65
+ ].join("\n");
66
+
67
+ case "hook":
68
+ return [
69
+ `import { describe, it, expect } from "vitest";`,
70
+ `import { renderHook } from "@testing-library/react";`,
71
+ `// import { ${toCamelCase(moduleName)} } from "${importPath}";`,
72
+ "",
73
+ `describe("${toCamelCase(moduleName)}", () => {`,
74
+ ` it.todo("returns expected value");`,
75
+ "});",
76
+ "",
77
+ ].join("\n");
78
+
79
+ case "action":
80
+ return [
81
+ `import { describe, it, expect, vi } from "vitest";`,
82
+ `// import { ... } from "${importPath}";`,
83
+ "",
84
+ `vi.mock("@/lib/prisma", () => ({`,
85
+ ` prisma: { /* mock Prisma methods */ },`,
86
+ `}));`,
87
+ `vi.mock("@/auth", () => ({`,
88
+ ` auth: vi.fn(() => ({ user: { id: "test-user-id" } })),`,
89
+ `}));`,
90
+ "",
91
+ `describe("${moduleName} actions", () => {`,
92
+ ` it.todo("performs action correctly");`,
93
+ "});",
94
+ "",
95
+ ].join("\n");
96
+
97
+ case "util":
98
+ default:
99
+ return [
100
+ `import { describe, it, expect } from "vitest";`,
101
+ `// import { ... } from "${importPath}";`,
102
+ "",
103
+ `describe("${moduleName}", () => {`,
104
+ ` it.todo("works as expected");`,
105
+ "});",
106
+ "",
107
+ ].join("\n");
108
+ }
109
+ }
110
+
111
+ function toPascalCase(str: string): string {
112
+ return str
113
+ .split(/[-_]/)
114
+ .map((s) => s.charAt(0).toUpperCase() + s.slice(1))
115
+ .join("");
116
+ }
117
+
118
+ function toCamelCase(str: string): string {
119
+ const pascal = toPascalCase(str);
120
+ return pascal.charAt(0).toLowerCase() + pascal.slice(1);
121
+ }
122
+
123
+ interface PendingTest {
124
+ source: string;
125
+ testPath: string;
126
+ type: FileType;
127
+ }
128
+
129
+ async function main(): Promise<void> {
130
+ try {
131
+ const raw = await readStdin();
132
+ if (!raw?.trim()) return;
133
+
134
+ const payload = JSON.parse(
135
+ raw.replace(/^\uFEFF/, "").trim(),
136
+ ) as AfterFileEditInput;
137
+ const filePath = payload.file_path;
138
+ const workspaceRoot =
139
+ payload.workspace_roots?.[0] ||
140
+ process.env.CURSOR_PROJECT_DIR ||
141
+ process.cwd();
142
+
143
+ if (!filePath) return;
144
+
145
+ const normalizedPath = filePath.replace(/\\/g, "/");
146
+ const normalizedRoot = workspaceRoot.replace(/\\/g, "/");
147
+
148
+ if (SKIP_PATTERNS.some((p) => normalizedPath.includes(p))) return;
149
+ if (!/\.(tsx?|jsx?)$/.test(normalizedPath)) return;
150
+
151
+ const relativePath = normalizedPath.startsWith(normalizedRoot)
152
+ ? normalizedPath.slice(normalizedRoot.length + 1)
153
+ : normalizedPath;
154
+
155
+ if (!relativePath.startsWith("src/")) return;
156
+
157
+ const fileType = detectFileType(relativePath);
158
+ if (!fileType) return;
159
+
160
+ const fileName = path.basename(relativePath);
161
+ if (fileName.startsWith("index.")) return;
162
+
163
+ const category =
164
+ fileType === "component"
165
+ ? "components"
166
+ : fileType === "hook"
167
+ ? "hooks"
168
+ : fileType === "action"
169
+ ? "actions"
170
+ : "lib";
171
+ const testExt = fileType === "component" ? ".test.tsx" : ".test.ts";
172
+ const testFileName = fileName.replace(/\.(tsx?|jsx?)$/, testExt);
173
+ const testRelativePath = `src/__tests__/${category}/${testFileName}`;
174
+ const testAbsolutePath = path.join(workspaceRoot, testRelativePath);
175
+
176
+ if (existsSync(testAbsolutePath)) return;
177
+
178
+ const testDir = path.dirname(testAbsolutePath);
179
+ mkdirSync(testDir, { recursive: true });
180
+
181
+ const scaffold = generateScaffold(fileType, relativePath, fileName);
182
+ writeFileSync(testAbsolutePath, scaffold, "utf8");
183
+
184
+ console.error(`[ensure-tests-exist] Created scaffold: ${testRelativePath}`);
185
+
186
+ const pendingPath = path.join(workspaceRoot, ".pending-tests.json");
187
+ let pending: PendingTest[] = [];
188
+ if (existsSync(pendingPath)) {
189
+ try {
190
+ pending = JSON.parse(readFileSync(pendingPath, "utf8"));
191
+ } catch {
192
+ pending = [];
193
+ }
194
+ }
195
+ pending.push({
196
+ source: relativePath,
197
+ testPath: testRelativePath,
198
+ type: fileType,
199
+ });
200
+ writeFileSync(pendingPath, JSON.stringify(pending, null, 2), "utf8");
201
+ } catch (err) {
202
+ console.error(
203
+ "[ensure-tests-exist] Error:",
204
+ err instanceof Error ? err.message : String(err),
205
+ );
206
+ }
207
+ }
208
+
209
+ main();
@@ -0,0 +1,101 @@
1
+ import path from "path";
2
+
3
+ interface BeforeReadFileInput {
4
+ file_path: string;
5
+ content: string;
6
+ [key: string]: unknown;
7
+ }
8
+
9
+ function readStdin(): Promise<string> {
10
+ return new Promise((resolve) => {
11
+ let data = "";
12
+ process.stdin.setEncoding("utf8");
13
+ process.stdin.on("data", (chunk: string) => {
14
+ data += chunk;
15
+ });
16
+ process.stdin.on("end", () => resolve(data));
17
+ process.stdin.on("error", () => resolve(""));
18
+ });
19
+ }
20
+
21
+ function respond(output: Record<string, unknown>): void {
22
+ process.stdout.write(JSON.stringify(output) + "\n");
23
+ }
24
+
25
+ const PROTECTED_FILES = [
26
+ ".env",
27
+ ".env.local",
28
+ ".env.production",
29
+ ".env.development",
30
+ ".env.staging",
31
+ ];
32
+
33
+ const PROTECTED_EXTENSIONS = [".pem", ".key", ".pfx", ".p12"];
34
+
35
+ const ALLOWED_FILES = [".env.example", ".env.template"];
36
+
37
+ async function main(): Promise<void> {
38
+ try {
39
+ const raw = await readStdin();
40
+ if (!raw?.trim()) {
41
+ respond({ permission: "allow" });
42
+ return;
43
+ }
44
+
45
+ const payload = JSON.parse(
46
+ raw.replace(/^\uFEFF/, "").trim(),
47
+ ) as BeforeReadFileInput;
48
+ const filePath = payload.file_path;
49
+
50
+ if (!filePath) {
51
+ respond({ permission: "allow" });
52
+ return;
53
+ }
54
+
55
+ const basename = path.basename(filePath);
56
+ const ext = path.extname(filePath).toLowerCase();
57
+
58
+ if (ALLOWED_FILES.includes(basename)) {
59
+ respond({ permission: "allow" });
60
+ return;
61
+ }
62
+
63
+ if (PROTECTED_FILES.includes(basename)) {
64
+ respond({
65
+ permission: "deny",
66
+ user_message: `Access to ${basename} blocked. This file may contain secrets. Use .env.example as reference.`,
67
+ });
68
+ return;
69
+ }
70
+
71
+ if (PROTECTED_EXTENSIONS.includes(ext)) {
72
+ respond({
73
+ permission: "deny",
74
+ user_message: `Access to ${basename} blocked. Certificate/key files should not be read by the agent.`,
75
+ });
76
+ return;
77
+ }
78
+
79
+ if (
80
+ basename === "credentials.json" ||
81
+ basename === "secrets.yaml" ||
82
+ basename === "secrets.json"
83
+ ) {
84
+ respond({
85
+ permission: "deny",
86
+ user_message: `Access to ${basename} blocked. This file may contain credentials.`,
87
+ });
88
+ return;
89
+ }
90
+
91
+ respond({ permission: "allow" });
92
+ } catch (err) {
93
+ console.error(
94
+ "[protect-sensitive-files] Error:",
95
+ err instanceof Error ? err.message : String(err),
96
+ );
97
+ respond({ permission: "allow" });
98
+ }
99
+ }
100
+
101
+ main();
@@ -0,0 +1,93 @@
1
+ import { execSync } from "child_process";
2
+
3
+ interface SessionStartInput {
4
+ session_id: string;
5
+ is_background_agent: boolean;
6
+ composer_mode: string;
7
+ [key: string]: unknown;
8
+ }
9
+
10
+ function readStdin(): Promise<string> {
11
+ return new Promise((resolve) => {
12
+ let data = "";
13
+ process.stdin.setEncoding("utf8");
14
+ process.stdin.on("data", (chunk: string) => {
15
+ data += chunk;
16
+ });
17
+ process.stdin.on("end", () => resolve(data));
18
+ process.stdin.on("error", () => resolve(""));
19
+ });
20
+ }
21
+
22
+ function respond(output: Record<string, unknown>): void {
23
+ process.stdout.write(JSON.stringify(output) + "\n");
24
+ }
25
+
26
+ function run(cmd: string): string {
27
+ try {
28
+ return execSync(cmd, { encoding: "utf8", timeout: 5000 }).trim();
29
+ } catch {
30
+ return "unknown";
31
+ }
32
+ }
33
+
34
+ async function main(): Promise<void> {
35
+ try {
36
+ const raw = await readStdin();
37
+ if (!raw?.trim()) {
38
+ respond({});
39
+ return;
40
+ }
41
+ JSON.parse(raw.replace(/^\uFEFF/, "").trim()) as SessionStartInput;
42
+
43
+ const gitBranch = run("git rev-parse --abbrev-ref HEAD");
44
+ const nodeVersion = run("node --version");
45
+ const pnpmVersion = run("pnpm --version");
46
+ const lastCommit = run('git log -1 --format="%h %s"');
47
+
48
+ const context = [
49
+ "## Project Context — react-ssr (Next.js 16 Template)",
50
+ "",
51
+ `- Branch: ${gitBranch}`,
52
+ `- Node: ${nodeVersion} | pnpm: ${pnpmVersion}`,
53
+ `- Last commit: ${lastCommit}`,
54
+ "",
55
+ "### Stack",
56
+ "Next.js 16 (App Router, standalone), React 19, TypeScript 5.9, Prisma 7 (MariaDB adapter → MySQL 8.4),",
57
+ "Auth.js v5 (Credentials + JWT), Tailwind v4 + DaisyUI v5 + shadcn/ui (new-york), TanStack Query v5,",
58
+ "Vitest 4 + Testing Library, ESLint 9 + Prettier, Husky + lint-staged, Docker multi-stage.",
59
+ "",
60
+ "### Key Commands",
61
+ "- `pnpm dev` — Start dev server (Turbopack)",
62
+ "- `pnpm build` — Production build",
63
+ "- `pnpm test` — Run Vitest in watch mode",
64
+ "- `pnpm test:coverage` — Coverage report",
65
+ "- `pnpm db:migrate` — Prisma migrations",
66
+ "- `pnpm db:seed` — Seed database",
67
+ "- `pnpm db:studio` — Open Prisma Studio",
68
+ "",
69
+ "### Conventions",
70
+ "- Server Components by default, Client Components use `*-client.tsx` suffix",
71
+ "- Server Actions in `src/actions/` with Zod validation",
72
+ "- `proxy.ts` (NOT middleware.ts) for route protection — Next.js 16 convention",
73
+ "- Path alias: `@/*` → `./src/*`",
74
+ "- UI text in Spanish (Argentine voseo), code identifiers in English/Spanish mix",
75
+ ].join("\n");
76
+
77
+ respond({
78
+ env: {
79
+ GIT_BRANCH: gitBranch,
80
+ NODE_VERSION: nodeVersion,
81
+ },
82
+ additional_context: context,
83
+ continue: true,
84
+ });
85
+ } catch (err) {
86
+ console.error(
87
+ "[session-context] Error:",
88
+ err instanceof Error ? err.message : String(err),
89
+ );
90
+ }
91
+ }
92
+
93
+ main();
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "strict": true,
6
+ "esModuleInterop": true,
7
+ "skipLibCheck": true,
8
+ "resolveJsonModule": true
9
+ }
10
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "sessionStart": [
5
+ {
6
+ "command": "npx tsx .cursor/hooks/session-context.ts",
7
+ "timeout": 15
8
+ }
9
+ ],
10
+ "afterFileEdit": [
11
+ {
12
+ "command": "npx tsx .cursor/hooks/auto-format.ts",
13
+ "timeout": 15
14
+ },
15
+ {
16
+ "command": "npx tsx .cursor/hooks/ensure-tests-exist.ts",
17
+ "timeout": 15
18
+ }
19
+ ],
20
+ "beforeReadFile": [
21
+ {
22
+ "command": "npx tsx .cursor/hooks/protect-sensitive-files.ts",
23
+ "timeout": 10
24
+ }
25
+ ],
26
+ "beforeShellExecution": [
27
+ {
28
+ "command": "npx tsx .cursor/hooks/block-dangerous-commands.ts",
29
+ "matcher": "rm|del|rmdir|drop|truncate|format|mkfs|Remove-Item|git|prisma",
30
+ "timeout": 10
31
+ }
32
+ ],
33
+ "stop": [
34
+ {
35
+ "command": "npx tsx .cursor/hooks/auto-test-on-stop.ts",
36
+ "timeout": 10,
37
+ "loop_limit": 2
38
+ }
39
+ ]
40
+ }
41
+ }
@@ -0,0 +1,48 @@
1
+ ---
2
+ description: Patrones de autenticación con Auth.js v5, proxy.ts y protección de rutas en Next.js 16
3
+ globs: src/auth.ts,src/proxy.ts,src/actions/auth.ts
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Autenticación — Auth.js v5
8
+
9
+ ## Configuración (`src/auth.ts`)
10
+
11
+ - **Auth.js v5** (next-auth beta.25) con Credentials provider
12
+ - **Estrategia de sesión**: JWT (no database sessions)
13
+ - **Adapter**: PrismaAdapter para sincronizar modelos User/Account/Session
14
+ - **Hashing**: bcryptjs con `bcrypt.hash(password, 12)` para registro
15
+ - **Página login custom**: `/auth/iniciar-sesion`
16
+
17
+ ## Proxy de rutas (`src/proxy.ts`)
18
+
19
+ En Next.js 16, `middleware.ts` fue renombrado a `proxy.ts`. Exportar función `proxy`:
20
+
21
+ ```typescript
22
+ import { auth } from "@/auth";
23
+ export const proxy = auth((req) => {
24
+ // Lógica de protección de rutas
25
+ });
26
+ ```
27
+
28
+ - **Rutas protegidas**: `/dashboard`, `/perfil`, `/proyectos-crud`, `/ui-components`
29
+ - **Redirect no autenticado** → `/auth/iniciar-sesion?callbackUrl=<ruta>`
30
+ - **Redirect autenticado** en `/auth/*` → `/dashboard`
31
+
32
+ ## Patrones en Server Actions
33
+
34
+ Siempre verificar autenticación antes de operar:
35
+
36
+ ```typescript
37
+ const session = await auth();
38
+ if (!session?.user?.id) {
39
+ return { error: "No autenticado" };
40
+ }
41
+ ```
42
+
43
+ ## Exports de `src/auth.ts`
44
+
45
+ - `handlers` — Route handlers para `/api/auth/*`
46
+ - `auth` — Función para obtener sesión (server-side)
47
+ - `signIn` — Programatic sign in
48
+ - `signOut` — Programatic sign out
@@ -0,0 +1,39 @@
1
+ ---
2
+ description: ESLint 9 flat config, Prettier, Husky pre-commit y estándares de calidad de código
3
+ globs: "eslint.config.mjs,**/*.ts,**/*.tsx"
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Calidad de código
8
+
9
+ ## ESLint 9 (Flat Config)
10
+
11
+ Configurado en `eslint.config.mjs`:
12
+ - `@eslint/js` recommended
13
+ - `typescript-eslint` recommended
14
+ - `eslint-config-next`
15
+ - `eslint-config-prettier` (desactiva reglas que conflictúan con Prettier)
16
+
17
+ Reglas clave:
18
+ - `@typescript-eslint/no-unused-vars`: warn (ignora args con `_` prefix)
19
+ - `@typescript-eslint/no-explicit-any`: error — **NO usar `any`**
20
+
21
+ ## Prettier
22
+
23
+ - Prettier 3.5 como formatter
24
+ - Sin archivo `.prettierrc` — usa defaults de Prettier
25
+ - Se ejecuta automáticamente via lint-staged en pre-commit
26
+
27
+ ## Husky + lint-staged
28
+
29
+ Pre-commit (`husky`):
30
+ - `*.{ts,tsx}` → `eslint --fix` + `prettier --write`
31
+ - `*.{json,css,md}` → `prettier --write`
32
+
33
+ ## TypeScript
34
+
35
+ - **Strict mode** habilitado
36
+ - **Path alias**: `@/*` → `./src/*`
37
+ - **Module resolution**: `bundler`
38
+ - **JSX**: `react-jsx` (no necesita import React)
39
+ - **No explicit any**: Siempre tipar correctamente
@@ -0,0 +1,32 @@
1
+ ---
2
+ description: Convenciones de nombrado del template — idioma, casing y patrones
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Convenciones de nombrado
7
+
8
+ ## Idioma
9
+
10
+ - **Rutas URL**: Español kebab-case (`/auth/iniciar-sesion`, `/proyectos-crud`, `/recuperar-password`)
11
+ - **Labels UI / textos**: Español argentino con voseo ("Ingresá", "Registrate", "Completá tu perfil")
12
+ - **Código TypeScript**: Inglés para infraestructura, español para dominio de negocio
13
+
14
+ ## Casing por tipo
15
+
16
+ | Elemento | Convención | Ejemplo |
17
+ |----------|-----------|---------|
18
+ | Archivos `.tsx` / `.ts` | kebab-case | `sign-out-button.tsx`, `proyectos-crud-client.tsx` |
19
+ | Componentes React | PascalCase | `SignOutButton`, `DashboardClient` |
20
+ | Server Actions | camelCase + verbo español | `crearProyecto`, `editarProyecto`, `enviarContacto` |
21
+ | Schemas Zod | camelCase | `loginSchema`, `proyectoSchema`, `contactoSchema` |
22
+ | Modelos Prisma | PascalCase singular | `User`, `Proyecto`, `Account` |
23
+ | Campos DB | camelCase | `userId`, `createdAt`, `emailVerified` |
24
+ | Custom hooks | camelCase con `use` | `useLocalStorage` |
25
+ | Constantes | camelCase o UPPER_SNAKE_CASE | `protectedRoutes`, `SALT_ROUNDS` |
26
+ | Tipos/Interfaces | PascalCase | `ProyectoFormState`, `LoginFormState` |
27
+
28
+ ## Carpetas
29
+
30
+ - `src/app/`: Rutas en español kebab-case (ej: `auth/iniciar-sesion/`)
31
+ - `src/components/ui/`: Componentes shadcn en inglés kebab-case (ej: `button.tsx`)
32
+ - `src/actions/`: Archivos en español kebab-case por dominio (ej: `proyectos.ts`, `contacto.ts`)
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: Arquitectura Next.js 16 App Router con Server Components, Server Actions, proxy.ts y standalone output
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Arquitectura Next.js 16
7
+
8
+ ## Stack
9
+
10
+ - **Next.js 16** con App Router (`src/app/`)
11
+ - **React 19** con Server Components por defecto
12
+ - **TypeScript 5.9** en strict mode
13
+ - **Turbopack** en desarrollo (`next dev --turbopack`)
14
+ - **Output standalone** para Docker (`next.config.ts`)
15
+
16
+ ## Estructura de carpetas
17
+
18
+ ```
19
+ src/
20
+ ├── app/ # Pages, layouts, route groups (App Router)
21
+ │ ├── (authenticated)/ # Route group — rutas que requieren auth
22
+ │ ├── auth/ # Rutas públicas de autenticación
23
+ │ ├── layout.tsx # Root layout (Server Component)
24
+ │ ├── page.tsx # Home page
25
+ │ └── globals.css # Estilos globales + Tailwind + DaisyUI theme
26
+ ├── actions/ # Server Actions (mutaciones con "use server")
27
+ ├── components/ # Componentes React reutilizables
28
+ │ ├── ui/ # Componentes shadcn/ui
29
+ │ └── layout/ # Componentes de layout (sidebar, navbar)
30
+ ├── lib/ # Utilidades y configuración (prisma, queryClient, utils)
31
+ ├── hooks/ # Custom hooks
32
+ ├── types/ # Definiciones de tipos compartidos
33
+ ├── data/ # Datos estáticos / constantes
34
+ ├── auth.ts # Configuración Auth.js (NextAuth v5)
35
+ └── proxy.ts # Proxy de rutas (reemplazo de middleware.ts en Next.js 16)
36
+ ```
37
+
38
+ ## Server Components vs Client Components
39
+
40
+ - Los archivos en `src/app/**/page.tsx` son **Server Components** por defecto
41
+ - Los Client Components llevan `"use client"` y se nombran `*-client.tsx`
42
+ - Los Server Actions llevan `"use server"` y viven en `src/actions/`
43
+ - **NO usar** `middleware.ts` — en Next.js 16 se usa `proxy.ts` con export `proxy`
44
+
45
+ ## Patrones clave
46
+
47
+ - **Data fetching**: Los Server Components obtienen datos directamente con Prisma (no API routes)
48
+ - **Mutaciones**: Via Server Actions en `src/actions/` con validación Zod
49
+ - **Revalidación**: Usar `revalidatePath()` después de mutaciones
50
+ - **Providers**: `src/components/providers.tsx` envuelve con SessionProvider + QueryClientProvider + ToastContainer
51
+ - **Path alias**: `@/*` → `./src/*` (configurado en tsconfig.json)
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: Convenciones de Prisma 7 con adapter MariaDB, modelos, migraciones y acceso a datos
3
+ globs: prisma/**,src/lib/prisma.ts
4
+ alwaysApply: false
5
+ ---
6
+
7
+ # Prisma 7 — Convenciones
8
+
9
+ ## Configuración
10
+
11
+ - **Provider**: `mysql` en `prisma/schema.prisma`
12
+ - **Adapter**: `@prisma/adapter-mariadb` (protocolo MariaDB sobre MySQL 8.4)
13
+ - **Singleton**: `src/lib/prisma.ts` implementa patrón singleton con global cache en dev
14
+ - **DB**: MySQL 8.4 vía Docker Compose (`docker-compose.yml`)
15
+
16
+ ## Modelos
17
+
18
+ - **Nombres**: PascalCase singular (`User`, `Proyecto`, `Account`)
19
+ - **Campos**: camelCase (`userId`, `createdAt`, `emailVerified`)
20
+ - **IDs**: `String @id @default(cuid())`
21
+ - **Timestamps**: `createdAt DateTime @default(now())` + `updatedAt DateTime @updatedAt`
22
+ - **Relaciones**: Siempre con `onDelete: Cascade` cuando corresponda
23
+ - **Índices**: `@@index([campo])` para campos de búsqueda frecuente (ej: `userId`)
24
+
25
+ ```prisma
26
+ model NuevoModelo {
27
+ id String @id @default(cuid())
28
+ nombre String
29
+ userId String
30
+ createdAt DateTime @default(now())
31
+ updatedAt DateTime @updatedAt
32
+
33
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
34
+
35
+ @@index([userId])
36
+ }
37
+ ```
38
+
39
+ ## Comandos
40
+
41
+ | Comando | Uso |
42
+ |---------|-----|
43
+ | `pnpm db:generate` | Regenerar Prisma Client |
44
+ | `pnpm db:migrate` | Crear y aplicar migraciones |
45
+ | `pnpm db:push` | Push schema sin migración (dev rápido) |
46
+ | `pnpm db:seed` | Ejecutar seed (`prisma/seed.ts`) |
47
+ | `pnpm db:studio` | Abrir Prisma Studio (GUI) |
48
+
49
+ ## Acceso a datos
50
+
51
+ - En **Server Components**: Usar `prisma` directamente (import desde `@/lib/prisma`)
52
+ - En **Server Actions**: Usar `prisma` con validación de sesión (`auth()`)
53
+ - **NUNCA** exponer Prisma Client al cliente