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,114 @@
1
+ ---
2
+ name: tanstack-query-best-practices
3
+ description: TanStack Query (React Query) best practices for data fetching, caching, mutations, and server state management. Activate when building data-driven React applications with server state.
4
+ ---
5
+
6
+ # TanStack Query Best Practices
7
+
8
+ Comprehensive guidelines for implementing TanStack Query (React Query) patterns in React applications. These rules optimize data fetching, caching, mutations, and server state synchronization.
9
+
10
+ ## When to Apply
11
+
12
+ - Creating new data fetching logic
13
+ - Setting up query configurations
14
+ - Implementing mutations and optimistic updates
15
+ - Configuring caching strategies
16
+ - Integrating with SSR/SSG
17
+ - Refactoring existing data fetching code
18
+
19
+ ## Rule Categories by Priority
20
+
21
+ | Priority | Category | Rules | Impact |
22
+ |----------|----------|-------|--------|
23
+ | CRITICAL | Query Keys | 5 rules | Prevents cache bugs and data inconsistencies |
24
+ | CRITICAL | Caching | 5 rules | Optimizes performance and data freshness |
25
+ | HIGH | Mutations | 6 rules | Ensures data integrity and UI consistency |
26
+ | HIGH | Error Handling | 3 rules | Prevents poor user experiences |
27
+ | MEDIUM | Prefetching | 4 rules | Improves perceived performance |
28
+ | MEDIUM | Parallel Queries | 2 rules | Enables dynamic parallel fetching |
29
+ | MEDIUM | Infinite Queries | 3 rules | Prevents pagination bugs |
30
+ | MEDIUM | SSR Integration | 4 rules | Enables proper hydration |
31
+ | LOW | Performance | 4 rules | Reduces unnecessary re-renders |
32
+ | LOW | Offline Support | 2 rules | Enables offline-first patterns |
33
+
34
+ ## Quick Reference
35
+
36
+ ### Query Keys (Prefix: `qk-`)
37
+
38
+ - `qk-array-structure` — Always use arrays for query keys
39
+ - `qk-include-dependencies` — Include all variables the query depends on
40
+ - `qk-hierarchical-organization` — Organize keys hierarchically (entity → id → filters)
41
+ - `qk-factory-pattern` — Use query key factories for complex applications
42
+ - `qk-serializable` — Ensure all key parts are JSON-serializable
43
+
44
+ ### Caching (Prefix: `cache-`)
45
+
46
+ - `cache-stale-time` — Set appropriate staleTime based on data volatility
47
+ - `cache-gc-time` — Configure gcTime for inactive query retention
48
+ - `cache-defaults` — Set sensible defaults at QueryClient level
49
+ - `cache-invalidation` — Use targeted invalidation over broad patterns
50
+ - `cache-placeholder-vs-initial` — Understand placeholder vs initial data differences
51
+
52
+ ### Mutations (Prefix: `mut-`)
53
+
54
+ - `mut-invalidate-queries` — Always invalidate related queries after mutations
55
+ - `mut-optimistic-updates` — Implement optimistic updates for responsive UI
56
+ - `mut-rollback-context` — Provide rollback context from onMutate
57
+ - `mut-error-handling` — Handle mutation errors gracefully
58
+ - `mut-loading-states` — Use isPending for mutation loading states
59
+ - `mut-mutation-state` — Use useMutationState for cross-component tracking
60
+
61
+ ### Error Handling (Prefix: `err-`)
62
+
63
+ - `err-error-boundaries` — Use error boundaries with useQueryErrorResetBoundary
64
+ - `err-retry-config` — Configure retry logic appropriately
65
+ - `err-fallback-data` — Provide fallback data when appropriate
66
+
67
+ ### Prefetching (Prefix: `pf-`)
68
+
69
+ - `pf-intent-prefetch` — Prefetch on user intent (hover, focus)
70
+ - `pf-route-prefetch` — Prefetch data during route transitions
71
+ - `pf-stale-time-config` — Set staleTime when prefetching
72
+ - `pf-ensure-query-data` — Use ensureQueryData for conditional prefetching
73
+
74
+ ### Infinite Queries (Prefix: `inf-`)
75
+
76
+ - `inf-page-params` — Always provide getNextPageParam
77
+ - `inf-loading-guards` — Check isFetchingNextPage before fetching more
78
+ - `inf-max-pages` — Consider maxPages for large datasets
79
+
80
+ ### SSR Integration (Prefix: `ssr-`)
81
+
82
+ - `ssr-dehydration` — Use dehydrate/hydrate pattern for SSR
83
+ - `ssr-client-per-request` — Create QueryClient per request
84
+ - `ssr-stale-time-server` — Set higher staleTime on server
85
+ - `ssr-hydration-boundary` — Wrap with HydrationBoundary
86
+
87
+ ### Parallel Queries (Prefix: `parallel-`)
88
+
89
+ - `parallel-use-queries` — Use useQueries for dynamic parallel queries
90
+ - `query-cancellation` — Implement query cancellation properly
91
+
92
+ ### Performance (Prefix: `perf-`)
93
+
94
+ - `perf-select-transform` — Use select to transform/filter data
95
+ - `perf-structural-sharing` — Leverage structural sharing
96
+ - `perf-notify-change-props` — Limit re-renders with notifyOnChangeProps
97
+ - `perf-placeholder-data` — Use placeholderData for instant UI
98
+
99
+ ### Offline Support (Prefix: `offline-`)
100
+
101
+ - `network-mode` — Configure network mode for offline support
102
+ - `persist-queries` — Configure query persistence for offline support
103
+
104
+ ## How to Use
105
+
106
+ Each rule file in the `rules/` directory contains:
107
+ 1. **Explanation** — Why this pattern matters
108
+ 2. **Bad Example** — Anti-pattern to avoid
109
+ 3. **Good Example** — Recommended implementation
110
+ 4. **Context** — When to apply or skip this rule
111
+
112
+ ## Full Reference
113
+
114
+ See individual rule files in `rules/` directory for detailed guidance and code examples.
@@ -0,0 +1,93 @@
1
+ # cache-gc-time: Configure gcTime for Inactive Query Retention
2
+
3
+ ## Priority: CRITICAL
4
+
5
+ ## Explanation
6
+
7
+ `gcTime` (garbage collection time, formerly `cacheTime`) controls how long inactive queries remain in the cache before being garbage collected. Default is 5 minutes. Configure based on your navigation patterns and memory constraints.
8
+
9
+ ## Bad Example
10
+
11
+ ```tsx
12
+ // Not considering gcTime for frequently revisited pages
13
+ const { data } = useQuery({
14
+ queryKey: ['dashboard-stats'],
15
+ queryFn: fetchDashboardStats,
16
+ // Default gcTime of 5 minutes - might be too short for frequently revisited data
17
+ })
18
+
19
+ // Setting gcTime too high without consideration
20
+ const queryClient = new QueryClient({
21
+ defaultOptions: {
22
+ queries: {
23
+ gcTime: Infinity, // Never garbage collect - potential memory leak
24
+ },
25
+ },
26
+ })
27
+
28
+ // Setting gcTime to 0 - cache is immediately removed
29
+ const { data } = useQuery({
30
+ queryKey: ['user-data'],
31
+ queryFn: fetchUserData,
32
+ gcTime: 0, // Loses cache benefits entirely
33
+ })
34
+ ```
35
+
36
+ ## Good Example
37
+
38
+ ```tsx
39
+ // Longer gcTime for frequently revisited data
40
+ const { data } = useQuery({
41
+ queryKey: ['dashboard-stats'],
42
+ queryFn: fetchDashboardStats,
43
+ gcTime: 30 * 60 * 1000, // 30 minutes - user returns to dashboard often
44
+ })
45
+
46
+ // Shorter gcTime for rarely revisited large data
47
+ const { data: report } = useQuery({
48
+ queryKey: ['detailed-report', reportId],
49
+ queryFn: () => fetchReport(reportId),
50
+ gcTime: 2 * 60 * 1000, // 2 minutes - large payload, viewed once
51
+ })
52
+
53
+ // Sensible default with query-specific overrides
54
+ const queryClient = new QueryClient({
55
+ defaultOptions: {
56
+ queries: {
57
+ gcTime: 10 * 60 * 1000, // 10 minutes default
58
+ },
59
+ },
60
+ })
61
+ ```
62
+
63
+ ## Understanding gcTime vs staleTime
64
+
65
+ ```
66
+ Query Mount → Data Fresh (staleTime) → Data Stale → Query Unmount → gcTime countdown → Garbage Collected
67
+
68
+ Timeline example (staleTime: 1min, gcTime: 5min):
69
+ 0:00 - Query mounts, fetches data
70
+ 0:00-1:00 - Data is fresh (no background refetch)
71
+ 1:00+ - Data is stale (background refetch on new mount)
72
+ 5:00 - User navigates away, query unmounts
73
+ 5:00-10:00 - Data in cache but inactive (gcTime countdown)
74
+ 10:00 - Data garbage collected (next mount = full loading state)
75
+ ```
76
+
77
+ ## Recommended gcTime Values
78
+
79
+ | Scenario | gcTime | Rationale |
80
+ |----------|--------|-----------|
81
+ | Frequently revisited routes | 15 - 30min | Instant navigation |
82
+ | Detail pages (viewed once) | 2 - 5min | Memory efficient |
83
+ | Large payloads | 1 - 2min | Prevent memory bloat |
84
+ | Critical user data | 30min+ | Offline-like experience |
85
+ | SSR hydration | >= 2s | Prevent hydration issues |
86
+
87
+ ## Context
88
+
89
+ - gcTime countdown starts when ALL query observers unmount
90
+ - Remounting before gcTime expires returns cached data instantly
91
+ - Setting gcTime < staleTime is rarely useful
92
+ - For SSR, avoid gcTime: 0 (use minimum 2000ms to allow hydration)
93
+ - Monitor memory usage in long-running applications
@@ -0,0 +1,116 @@
1
+ # cache-invalidation: Use Targeted Invalidation Over Broad Patterns
2
+
3
+ ## Priority: CRITICAL
4
+
5
+ ## Explanation
6
+
7
+ Query invalidation marks cached data as stale, triggering background refetches. Use targeted invalidation to refresh only affected data. Overly broad invalidation causes unnecessary network requests; too narrow invalidation leaves stale data.
8
+
9
+ ## Bad Example
10
+
11
+ ```tsx
12
+ // Invalidating everything after a single todo update
13
+ const mutation = useMutation({
14
+ mutationFn: updateTodo,
15
+ onSuccess: () => {
16
+ queryClient.invalidateQueries() // Invalidates ENTIRE cache
17
+ },
18
+ })
19
+
20
+ // Invalidating too broadly
21
+ const mutation = useMutation({
22
+ mutationFn: updateTodoStatus,
23
+ onSuccess: () => {
24
+ // Invalidates all todos including unrelated lists
25
+ queryClient.invalidateQueries({ queryKey: ['todos'] })
26
+ },
27
+ })
28
+
29
+ // Missing invalidation of related queries
30
+ const mutation = useMutation({
31
+ mutationFn: addComment,
32
+ onSuccess: () => {
33
+ // Only invalidates comment list, misses comment count
34
+ queryClient.invalidateQueries({ queryKey: ['comments', postId] })
35
+ },
36
+ })
37
+ ```
38
+
39
+ ## Good Example
40
+
41
+ ```tsx
42
+ // Targeted invalidation with exact matching
43
+ const mutation = useMutation({
44
+ mutationFn: updateTodo,
45
+ onSuccess: (data, variables) => {
46
+ // Invalidate specific todo and related queries
47
+ queryClient.invalidateQueries({ queryKey: ['todos', variables.id] })
48
+ // Also invalidate lists that might contain this todo
49
+ queryClient.invalidateQueries({ queryKey: ['todos', 'list'] })
50
+ },
51
+ })
52
+
53
+ // Use exact: true when you only want one specific query
54
+ const mutation = useMutation({
55
+ mutationFn: updateUserProfile,
56
+ onSuccess: () => {
57
+ queryClient.invalidateQueries({
58
+ queryKey: ['user', 'profile'],
59
+ exact: true, // Only this exact key, not ['user', 'profile', 'settings']
60
+ })
61
+ },
62
+ })
63
+
64
+ // Invalidate multiple related queries
65
+ const mutation = useMutation({
66
+ mutationFn: addComment,
67
+ onSuccess: (data, { postId }) => {
68
+ // Invalidate all comment-related queries for this post
69
+ queryClient.invalidateQueries({ queryKey: ['posts', postId, 'comments'] })
70
+ queryClient.invalidateQueries({ queryKey: ['posts', postId, 'comment-count'] })
71
+ // Optionally invalidate the post itself if it shows comment count
72
+ queryClient.invalidateQueries({ queryKey: ['posts', postId] })
73
+ },
74
+ })
75
+
76
+ // Predicate-based invalidation for complex scenarios
77
+ queryClient.invalidateQueries({
78
+ predicate: (query) =>
79
+ query.queryKey[0] === 'todos' &&
80
+ query.state.data?.userId === currentUserId,
81
+ })
82
+ ```
83
+
84
+ ## Invalidation Patterns
85
+
86
+ ```tsx
87
+ // Prefix matching (default) - invalidates all matching prefixes
88
+ queryClient.invalidateQueries({ queryKey: ['todos'] })
89
+ // Matches: ['todos'], ['todos', 1], ['todos', { status: 'done' }]
90
+
91
+ // Exact matching - only the exact key
92
+ queryClient.invalidateQueries({ queryKey: ['todos'], exact: true })
93
+ // Matches: ['todos'] only
94
+
95
+ // Predicate matching - custom logic
96
+ queryClient.invalidateQueries({
97
+ predicate: (query) => query.queryKey.includes('user-generated'),
98
+ })
99
+
100
+ // Refetch type control
101
+ queryClient.invalidateQueries({
102
+ queryKey: ['todos'],
103
+ refetchType: 'active', // Only refetch active queries (default)
104
+ // refetchType: 'inactive' - Only inactive
105
+ // refetchType: 'all' - Both
106
+ // refetchType: 'none' - Mark stale but don't refetch
107
+ })
108
+ ```
109
+
110
+ ## Context
111
+
112
+ - Invalidation only marks queries as stale; refetch happens when query is used
113
+ - `refetchType: 'active'` (default) only refetches queries with active observers
114
+ - Use hierarchical query keys to enable precise invalidation
115
+ - Consider `setQueryData` for optimistic updates instead of invalidation
116
+ - Always test invalidation patterns to ensure all affected queries are refreshed
@@ -0,0 +1,156 @@
1
+ # cache-placeholder-vs-initial: Understand Placeholder vs Initial Data
2
+
3
+ ## Priority: MEDIUM
4
+
5
+ ## Explanation
6
+
7
+ `placeholderData` and `initialData` both provide data before the fetch completes, but behave differently. `initialData` is treated as real cached data, while `placeholderData` is temporary and doesn't persist to cache. Choose based on whether your fallback data should be cached.
8
+
9
+ ## Bad Example
10
+
11
+ ```tsx
12
+ // Using initialData when you don't want it cached
13
+ function PostPreview({ postId, previewData }: Props) {
14
+ const { data } = useQuery({
15
+ queryKey: ['posts', postId],
16
+ queryFn: () => fetchPost(postId),
17
+ initialData: previewData, // Wrong: this becomes cached "truth"
18
+ // If previewData is incomplete, it pollutes the cache
19
+ // staleTime applies to this data as if it were fetched
20
+ })
21
+ }
22
+
23
+ // Using placeholderData when you want persistence
24
+ function UserProfile({ userId }: Props) {
25
+ const { data } = useQuery({
26
+ queryKey: ['users', userId],
27
+ queryFn: () => fetchUser(userId),
28
+ placeholderData: cachedUserFromList, // Wrong: won't persist
29
+ // User navigates away and back - placeholder shown again
30
+ // No cache entry created until fetch completes
31
+ })
32
+ }
33
+ ```
34
+
35
+ ## Good Example: placeholderData for Temporary Display
36
+
37
+ ```tsx
38
+ // Show list data while fetching detail
39
+ function PostDetail({ postId }: { postId: string }) {
40
+ const queryClient = useQueryClient()
41
+
42
+ const { data, isPlaceholderData } = useQuery({
43
+ queryKey: ['posts', postId],
44
+ queryFn: () => fetchPost(postId),
45
+ placeholderData: () => {
46
+ // Use partial data from list cache as placeholder
47
+ const posts = queryClient.getQueryData<Post[]>(['posts'])
48
+ return posts?.find(p => p.id === postId)
49
+ },
50
+ })
51
+
52
+ return (
53
+ <article className={isPlaceholderData ? 'opacity-50' : ''}>
54
+ <h1>{data?.title}</h1>
55
+ {isPlaceholderData ? (
56
+ <p>Loading full content...</p>
57
+ ) : (
58
+ <div>{data?.content}</div>
59
+ )}
60
+ </article>
61
+ )
62
+ }
63
+ ```
64
+
65
+ ## Good Example: initialData for Known Good Data
66
+
67
+ ```tsx
68
+ // SSR: Data fetched on server should be initial
69
+ function PostPage({ serverData }: { serverData: Post }) {
70
+ const { data } = useQuery({
71
+ queryKey: ['posts', serverData.id],
72
+ queryFn: () => fetchPost(serverData.id),
73
+ initialData: serverData,
74
+ // Specify when this data was fetched for proper stale calculation
75
+ initialDataUpdatedAt: serverData.fetchedAt,
76
+ })
77
+
78
+ return <PostContent post={data} />
79
+ }
80
+
81
+ // Pre-seeding cache with complete data
82
+ function App() {
83
+ const queryClient = useQueryClient()
84
+
85
+ // If you have complete, authoritative data
86
+ useEffect(() => {
87
+ queryClient.setQueryData(['config'], completeConfigData)
88
+ }, [])
89
+ }
90
+ ```
91
+
92
+ ## Good Example: keepPreviousData Pattern
93
+
94
+ ```tsx
95
+ // Keep showing old data while fetching new (pagination, filters)
96
+ function ProductList({ page }: { page: number }) {
97
+ const { data, isPlaceholderData } = useQuery({
98
+ queryKey: ['products', page],
99
+ queryFn: () => fetchProducts(page),
100
+ placeholderData: keepPreviousData, // Built-in helper
101
+ })
102
+
103
+ return (
104
+ <div className={isPlaceholderData ? 'opacity-70' : ''}>
105
+ {data?.map(product => (
106
+ <ProductCard key={product.id} product={product} />
107
+ ))}
108
+ {isPlaceholderData && <LoadingOverlay />}
109
+ </div>
110
+ )
111
+ }
112
+ ```
113
+
114
+ ## Comparison Table
115
+
116
+ | Behavior | `initialData` | `placeholderData` |
117
+ |----------|---------------|-------------------|
118
+ | Persisted to cache | Yes | No |
119
+ | `staleTime` applies | Yes | No (always fetches) |
120
+ | `isPlaceholderData` | `false` | `true` |
121
+ | Shown to other components | Yes (cached) | No |
122
+ | Use case | SSR, complete known data | Preview, previous page |
123
+ | Affects `dataUpdatedAt` | Yes (use `initialDataUpdatedAt`) | No |
124
+
125
+ ## Good Example: Combining Both
126
+
127
+ ```tsx
128
+ function PostDetail({ postId, ssrData }: Props) {
129
+ const queryClient = useQueryClient()
130
+
131
+ const { data } = useQuery({
132
+ queryKey: ['posts', postId],
133
+ queryFn: () => fetchPost(postId),
134
+
135
+ // If we have SSR data, use as initial (cached)
136
+ initialData: ssrData,
137
+ initialDataUpdatedAt: ssrData?.fetchedAt,
138
+
139
+ // If no SSR data, try to use list preview as placeholder
140
+ placeholderData: () => {
141
+ if (ssrData) return undefined // Already have initial
142
+ const posts = queryClient.getQueryData<Post[]>(['posts'])
143
+ return posts?.find(p => p.id === postId)
144
+ },
145
+ })
146
+ }
147
+ ```
148
+
149
+ ## Context
150
+
151
+ - `placeholderData` can be a value or function (lazy evaluation)
152
+ - `initialData` affects cache immediately on query creation
153
+ - Use `initialDataUpdatedAt` with `initialData` for proper stale calculations
154
+ - `keepPreviousData` is a built-in placeholder strategy
155
+ - Check `isPlaceholderData` to show loading indicators
156
+ - `placeholderData` is ideal for "instant" UI while fetching
@@ -0,0 +1,80 @@
1
+ # cache-stale-time: Set Appropriate staleTime Based on Data Volatility
2
+
3
+ ## Priority: CRITICAL
4
+
5
+ ## Explanation
6
+
7
+ `staleTime` determines how long data is considered fresh. The default is 0ms, meaning data is immediately stale and will refetch on every new query mount. Set appropriate staleTime based on how often your data actually changes to reduce unnecessary network requests.
8
+
9
+ ## Bad Example
10
+
11
+ ```tsx
12
+ // Default staleTime of 0 - refetches on every component mount
13
+ const { data } = useQuery({
14
+ queryKey: ['user-profile', userId],
15
+ queryFn: () => fetchUserProfile(userId),
16
+ // No staleTime set - always considered stale
17
+ })
18
+
19
+ // User profile probably doesn't change every second
20
+ // This causes unnecessary API calls on navigation
21
+
22
+ // Setting same staleTime everywhere regardless of data type
23
+ const queryClient = new QueryClient({
24
+ defaultOptions: {
25
+ queries: {
26
+ staleTime: 60 * 1000, // 1 minute for everything - too simple
27
+ },
28
+ },
29
+ })
30
+ ```
31
+
32
+ ## Good Example
33
+
34
+ ```tsx
35
+ // Match staleTime to data volatility
36
+ const { data: profile } = useQuery({
37
+ queryKey: ['user-profile', userId],
38
+ queryFn: () => fetchUserProfile(userId),
39
+ staleTime: 5 * 60 * 1000, // 5 minutes - profile rarely changes
40
+ })
41
+
42
+ const { data: notifications } = useQuery({
43
+ queryKey: ['notifications'],
44
+ queryFn: fetchNotifications,
45
+ staleTime: 30 * 1000, // 30 seconds - changes more frequently
46
+ })
47
+
48
+ const { data: stockPrice } = useQuery({
49
+ queryKey: ['stock', symbol],
50
+ queryFn: () => fetchStockPrice(symbol),
51
+ staleTime: 0, // Real-time data - always refetch
52
+ })
53
+
54
+ // Set sensible defaults, override per-query
55
+ const queryClient = new QueryClient({
56
+ defaultOptions: {
57
+ queries: {
58
+ staleTime: 60 * 1000, // 1 minute default
59
+ },
60
+ },
61
+ })
62
+ ```
63
+
64
+ ## Recommended staleTime Values
65
+
66
+ | Data Type | staleTime | Rationale |
67
+ |-----------|-----------|-----------|
68
+ | Real-time (stocks, live feeds) | 0 | Must always be current |
69
+ | Frequently changing (notifications) | 30s - 1min | Balance freshness and requests |
70
+ | User-generated content | 1 - 5min | Changes on user action |
71
+ | Reference data (categories, config) | 10 - 30min | Rarely changes |
72
+ | Static content | Infinity | Never changes |
73
+
74
+ ## Context
75
+
76
+ - `staleTime: 0` (default) triggers background refetch on every mount
77
+ - `staleTime: Infinity` never considers data stale (manual invalidation only)
78
+ - Stale data is still returned instantly - refetch happens in background
79
+ - For SSR, set higher staleTime to avoid immediate client refetch
80
+ - Consider using `queryOptions` factory to centralize staleTime per data type