create-huenei-template 0.2.14 → 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.
- package/dist/config/templates.js +7 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.dockerignore +14 -0
- package/dist/templates/frontend/react-ssr/.env.example +9 -0
- package/dist/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/dist/templates/frontend/react-ssr/Dockerfile +41 -0
- package/dist/templates/frontend/react-ssr/README.md +121 -0
- package/dist/templates/frontend/react-ssr/components.json +22 -0
- package/dist/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/dist/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/dist/templates/frontend/react-ssr/next.config.ts +7 -0
- package/dist/templates/frontend/react-ssr/package.json +86 -0
- package/dist/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/dist/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/dist/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/dist/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/dist/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/dist/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/dist/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/dist/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/dist/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/dist/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/dist/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/dist/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/dist/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/dist/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/dist/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/dist/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/dist/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/dist/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/dist/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/dist/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/dist/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/dist/templates/frontend/react-ssr/vitest.config.ts +41 -0
- package/package.json +1 -1
- package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.dockerignore +14 -0
- package/templates/frontend/react-ssr/.env.example +9 -0
- package/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/templates/frontend/react-ssr/Dockerfile +41 -0
- package/templates/frontend/react-ssr/README.md +121 -0
- package/templates/frontend/react-ssr/components.json +22 -0
- package/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/templates/frontend/react-ssr/next.config.ts +7 -0
- package/templates/frontend/react-ssr/package.json +86 -0
- package/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/templates/frontend/react-ssr/vitest.config.ts +41 -0
package/dist/config/templates.js
CHANGED
|
@@ -13,6 +13,13 @@ export const TEMPLATE_CATALOG = [
|
|
|
13
13
|
category: "frontend",
|
|
14
14
|
path: "frontend/react-vite-help",
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
id: "react-ssr",
|
|
18
|
+
name: "React SSR (Next.js)",
|
|
19
|
+
description: "Next.js 16 con Auth.js, Prisma, MySQL y Docker. SSR, Server Actions y App Router.",
|
|
20
|
+
category: "frontend",
|
|
21
|
+
path: "frontend/react-ssr",
|
|
22
|
+
},
|
|
16
23
|
{
|
|
17
24
|
id: "expo-base",
|
|
18
25
|
name: "Expo",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: accessibility-reviewer
|
|
3
|
+
description: "Reviews WCAG 2.2 compliance for React components using shadcn/ui and DaisyUI. Use when building or reviewing UI components, forms, navigation, or interactive elements."
|
|
4
|
+
model: fast
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an accessibility expert reviewing React 19 components built with shadcn/ui, DaisyUI, and Tailwind CSS v4.
|
|
9
|
+
|
|
10
|
+
When invoked, audit the specified files or components for:
|
|
11
|
+
|
|
12
|
+
1. **ARIA attributes**: Verify interactive elements have proper roles, labels, and states. shadcn/ui uses Radix primitives (generally accessible), but custom wrappers may lose attributes.
|
|
13
|
+
2. **Keyboard navigation**: All interactive elements must be focusable and operable via keyboard. Check `tabIndex`, `onKeyDown` handlers.
|
|
14
|
+
3. **Form labels**: Every input must have an associated `<label>` or `aria-label`. Check `src/app/auth/` forms and `src/components/ui/input.tsx`.
|
|
15
|
+
4. **Color contrast**: DaisyUI theme "huenei" uses custom colors — verify primary (#ff8300 on white) meets 4.5:1 ratio for normal text.
|
|
16
|
+
5. **Focus indicators**: Verify focus rings are visible. Tailwind `focus-visible:` utilities should be present.
|
|
17
|
+
6. **Error messages**: Form errors must be linked via `aria-describedby` or `aria-errormessage`.
|
|
18
|
+
7. **Page structure**: Proper heading hierarchy (h1 → h2 → h3). One `<main>` per page. Landmarks used correctly.
|
|
19
|
+
8. **Images and icons**: Lucide icons in interactive context need `aria-label`. Decorative icons need `aria-hidden="true"`.
|
|
20
|
+
|
|
21
|
+
Report:
|
|
22
|
+
- Issue, WCAG criterion, severity, and fix recommendation for each finding.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nextjs-code-reviewer
|
|
3
|
+
description: "Reviews Next.js 16 code for correct Server/Client Component usage, data fetching patterns, proxy.ts conventions, and cache revalidation. Use when reviewing React components, pages, layouts, or server actions in this project."
|
|
4
|
+
model: fast
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an expert Next.js 16 code reviewer specializing in App Router, Server Components, and React 19 patterns.
|
|
9
|
+
|
|
10
|
+
When invoked, analyze the code and check for:
|
|
11
|
+
|
|
12
|
+
1. **Server vs Client Components**: Verify `"use client"` is only where needed. Pages should be Server Components by default. Client Components use `-client.tsx` suffix.
|
|
13
|
+
2. **Data fetching**: Server Components should fetch data directly with Prisma. No `fetch()` to own API routes from Server Components.
|
|
14
|
+
3. **Server Actions**: Must be in `src/actions/` with `"use server"`. Must validate with Zod and check `auth()` session before mutations.
|
|
15
|
+
4. **Revalidation**: After mutations, ensure `revalidatePath()` is called for affected routes.
|
|
16
|
+
5. **proxy.ts**: Next.js 16 uses `proxy.ts` (NOT `middleware.ts`). Export must be named `proxy`.
|
|
17
|
+
6. **Imports**: Use `@/*` path alias. No relative imports climbing out of `src/`.
|
|
18
|
+
7. **Naming**: Files kebab-case, components PascalCase, actions camelCase with Spanish verbs.
|
|
19
|
+
8. **Providers**: Only `src/components/providers.tsx` should wrap with SessionProvider/QueryClientProvider.
|
|
20
|
+
|
|
21
|
+
Report format:
|
|
22
|
+
- List of issues found with file paths and line references
|
|
23
|
+
- Severity (error / warning / suggestion)
|
|
24
|
+
- Recommended fix for each issue
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-test-expert
|
|
3
|
+
description: "Generates and runs tests with Vitest 4 + Testing Library for React components, hooks, utils, and server actions. Use proactively when creating new components or when test coverage is needed."
|
|
4
|
+
model: inherit
|
|
5
|
+
readonly: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a testing expert for React 19 + Next.js 16 projects using Vitest 4 and Testing Library.
|
|
9
|
+
|
|
10
|
+
When invoked:
|
|
11
|
+
|
|
12
|
+
1. **Identify what needs testing**: Check which files in `src/components/`, `src/hooks/`, `src/lib/`, `src/actions/` lack corresponding test files in `src/__tests__/`.
|
|
13
|
+
2. **Generate test files** following project conventions:
|
|
14
|
+
- Location: `src/__tests__/<category>/<filename>.test.{ts,tsx}`
|
|
15
|
+
- Import from `vitest` (`describe`, `it`, `expect`)
|
|
16
|
+
- Use `@testing-library/react` for component tests (`render`, `screen`, `userEvent`)
|
|
17
|
+
- Use `@testing-library/jest-dom` matchers
|
|
18
|
+
- Mock server-side dependencies (Prisma, auth) with `vi.mock()`
|
|
19
|
+
3. **Run tests**: Execute `pnpm test -- --run` to verify tests pass.
|
|
20
|
+
4. **Fix failures**: If tests fail, analyze output and fix the test (not the source code unless there's a real bug).
|
|
21
|
+
|
|
22
|
+
Test structure:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { describe, it, expect } from "vitest";
|
|
26
|
+
// For components:
|
|
27
|
+
import { render, screen } from "@testing-library/react";
|
|
28
|
+
import userEvent from "@testing-library/user-event";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Coverage targets: `src/components/`, `src/hooks/`, `src/lib/`, `src/actions/`.
|
|
32
|
+
Config: `vitest.config.ts`, setup: `src/test/setup.ts`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-auditor
|
|
3
|
+
description: "Audits security vulnerabilities in Next.js SSR apps: XSS, auth bypass, data exposure in Client Components, SQL injection, secret leaks. Use when reviewing auth flows, server actions, or API routes."
|
|
4
|
+
model: fast
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a security auditor specializing in Next.js full-stack applications with Auth.js and Prisma.
|
|
9
|
+
|
|
10
|
+
When invoked, perform a security audit checking:
|
|
11
|
+
|
|
12
|
+
1. **Auth bypass**: Server Actions must call `auth()` and verify `session.user.id` before mutations. Check `src/actions/*.ts`.
|
|
13
|
+
2. **Data exposure**: Client Components must NOT receive sensitive data (passwords, tokens). Verify serialized props.
|
|
14
|
+
3. **XSS in Server Components**: Verify no raw HTML injection. Check `dangerouslySetInnerHTML` usage.
|
|
15
|
+
4. **Prisma queries**: Verify parameterized queries only (Prisma handles this, but check for raw queries).
|
|
16
|
+
5. **Environment secrets**: `.env` must NOT be committed. Verify `NEXTAUTH_SECRET`, `DATABASE_URL` are in `.env.example` without values.
|
|
17
|
+
6. **proxy.ts coverage**: Verify all sensitive routes are in `protectedRoutes` array.
|
|
18
|
+
7. **CSRF protection**: Server Actions have built-in CSRF via Next.js, but verify no custom fetch bypasses.
|
|
19
|
+
8. **Password handling**: bcryptjs with salt rounds >= 12. Never log or return passwords.
|
|
20
|
+
9. **Session strategy**: JWT is used — verify token callbacks don't expose sensitive fields.
|
|
21
|
+
|
|
22
|
+
Report format:
|
|
23
|
+
- **CRITICAL**: Issues requiring immediate fix
|
|
24
|
+
- **WARNING**: Potential vulnerabilities
|
|
25
|
+
- **INFO**: Best practice recommendations
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# new-component
|
|
2
|
+
|
|
3
|
+
**Objetivo:** Crear un componente React reutilizable en `src/components/` con Tailwind + shadcn/ui y scaffold de test.
|
|
4
|
+
|
|
5
|
+
## Instrucciones para Cursor
|
|
6
|
+
|
|
7
|
+
1. Solicitar al usuario:
|
|
8
|
+
- **Nombre del componente** (PascalCase): ej. `UserCard`, `ProjectTable`
|
|
9
|
+
- **Tipo**: Server Component o Client Component
|
|
10
|
+
- **Ubicación**: `src/components/` (general) o `src/components/ui/` (primitivo UI)
|
|
11
|
+
- **¿Necesita variantes?** (sí → usar cva de class-variance-authority)
|
|
12
|
+
|
|
13
|
+
2. Determinar nombre de archivo: kebab-case del nombre del componente
|
|
14
|
+
- `UserCard` → `user-card.tsx`
|
|
15
|
+
- `ProjectTable` → `project-table.tsx`
|
|
16
|
+
|
|
17
|
+
3. Crear el componente:
|
|
18
|
+
|
|
19
|
+
**Client Component (con interactividad):**
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
"use client";
|
|
23
|
+
|
|
24
|
+
import { cn } from "@/lib/utils";
|
|
25
|
+
|
|
26
|
+
interface <Nombre>Props {
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function <Nombre>({ className }: <Nombre>Props) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn("", className)}>
|
|
33
|
+
{/* Contenido */}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Server Component (solo presentación):**
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { cn } from "@/lib/utils";
|
|
43
|
+
|
|
44
|
+
interface <Nombre>Props {
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function <Nombre>({ className }: <Nombre>Props) {
|
|
49
|
+
return (
|
|
50
|
+
<div className={cn("", className)}>
|
|
51
|
+
{/* Contenido */}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Con variantes (cva):**
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
61
|
+
import { cn } from "@/lib/utils";
|
|
62
|
+
|
|
63
|
+
const <nombre>Variants = cva("base-classes", {
|
|
64
|
+
variants: {
|
|
65
|
+
variant: { default: "...", outline: "..." },
|
|
66
|
+
size: { sm: "...", md: "...", lg: "..." },
|
|
67
|
+
},
|
|
68
|
+
defaultVariants: { variant: "default", size: "md" },
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
interface <Nombre>Props extends VariantProps<typeof <nombre>Variants> {
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
4. Crear scaffold de test en `src/__tests__/components/<nombre>.test.tsx`:
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { describe, it, expect } from "vitest";
|
|
80
|
+
import { render, screen } from "@testing-library/react";
|
|
81
|
+
import { <Nombre> } from "@/components/<archivo>";
|
|
82
|
+
|
|
83
|
+
describe("<Nombre>", () => {
|
|
84
|
+
it("renders correctly", () => {
|
|
85
|
+
render(<<Nombre> />);
|
|
86
|
+
// Verificar renderizado
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Reglas a respetar
|
|
92
|
+
|
|
93
|
+
- Client Components: `"use client"` + sufijo `-client.tsx` si son compañeros de un Server Component
|
|
94
|
+
- Componentes standalone no necesitan sufijo `-client`
|
|
95
|
+
- Usar `cn()` de `@/lib/utils` para merge de clases
|
|
96
|
+
- shadcn/ui components van en `src/components/ui/`
|
|
97
|
+
- Sin barrel exports — importar directamente desde el archivo
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# new-page
|
|
2
|
+
|
|
3
|
+
**Objetivo:** Crear una nueva página Next.js 16 App Router con Server Component, Client Component opcional, y archivos auxiliares.
|
|
4
|
+
|
|
5
|
+
## Instrucciones para Cursor
|
|
6
|
+
|
|
7
|
+
1. Solicitar al usuario:
|
|
8
|
+
- **Nombre de la ruta** (en español, kebab-case): ej. `gestion-usuarios`
|
|
9
|
+
- **¿Requiere autenticación?** (sí → colocar dentro de `(authenticated)/`, no → en `src/app/`)
|
|
10
|
+
- **¿Necesita Client Component?** (sí → generar archivo `-client.tsx`)
|
|
11
|
+
|
|
12
|
+
2. Crear la estructura de archivos:
|
|
13
|
+
|
|
14
|
+
**Si requiere autenticación:**
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
src/app/(authenticated)/<nombre-ruta>/
|
|
18
|
+
├── page.tsx # Server Component
|
|
19
|
+
├── <nombre>-client.tsx # Client Component (si aplica)
|
|
20
|
+
├── loading.tsx # Loading UI
|
|
21
|
+
└── error.tsx # Error boundary
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Si NO requiere autenticación:**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
src/app/<nombre-ruta>/
|
|
28
|
+
├── page.tsx
|
|
29
|
+
├── <nombre>-client.tsx (si aplica)
|
|
30
|
+
├── loading.tsx
|
|
31
|
+
└── error.tsx
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
3. `page.tsx` (Server Component):
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { auth } from "@/auth"; // Solo si requiere auth
|
|
38
|
+
import { prisma } from "@/lib/prisma"; // Si necesita datos
|
|
39
|
+
import { NombreClient } from "./<nombre>-client";
|
|
40
|
+
|
|
41
|
+
export default async function NombrePage() {
|
|
42
|
+
// Obtener datos con Prisma directamente
|
|
43
|
+
return <NombreClient />;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
4. `-client.tsx` (Client Component):
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
"use client";
|
|
51
|
+
export function NombreClient() {
|
|
52
|
+
return <div>...</div>;
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
5. `loading.tsx`:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
export default function Loading() {
|
|
60
|
+
return (
|
|
61
|
+
<div className="flex items-center justify-center min-h-screen">
|
|
62
|
+
<span className="loading loading-spinner loading-lg" />
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
6. `error.tsx`:
|
|
69
|
+
```tsx
|
|
70
|
+
"use client";
|
|
71
|
+
export default function Error({
|
|
72
|
+
error,
|
|
73
|
+
reset,
|
|
74
|
+
}: {
|
|
75
|
+
error: Error;
|
|
76
|
+
reset: () => void;
|
|
77
|
+
}) {
|
|
78
|
+
return (
|
|
79
|
+
<div className="text-center p-8">
|
|
80
|
+
<h2 className="text-2xl font-bold mb-4">Algo salió mal</h2>
|
|
81
|
+
<button className="btn btn-primary" onClick={reset}>
|
|
82
|
+
Intentar de nuevo
|
|
83
|
+
</button>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Reglas a respetar
|
|
90
|
+
|
|
91
|
+
- Nombres de carpeta en español kebab-case
|
|
92
|
+
- Componentes en PascalCase
|
|
93
|
+
- Usar path alias `@/*`
|
|
94
|
+
- DaisyUI para clases de UI (btn, loading, card)
|
|
95
|
+
- Si la ruta requiere auth, el proxy.ts ya la protege si está en `(authenticated)`
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# new-prisma-model
|
|
2
|
+
|
|
3
|
+
**Objetivo:** Agregar un nuevo modelo al schema de Prisma con convenciones del proyecto, generar migración y actualizar el client.
|
|
4
|
+
|
|
5
|
+
## Instrucciones para Cursor
|
|
6
|
+
|
|
7
|
+
1. Solicitar al usuario:
|
|
8
|
+
- **Nombre del modelo** (PascalCase singular): ej. `Tarea`, `Reporte`, `Comentario`
|
|
9
|
+
- **Campos** con tipos: ej. `titulo String, contenido String @db.Text, prioridad Int @default(0)`
|
|
10
|
+
- **¿Pertenece a un User?** (sí → agregar relación `userId` con cascade delete)
|
|
11
|
+
- **¿Relaciones adicionales?** (ej. pertenece a Proyecto)
|
|
12
|
+
|
|
13
|
+
2. Agregar el modelo en `prisma/schema.prisma`:
|
|
14
|
+
|
|
15
|
+
```prisma
|
|
16
|
+
model <Nombre> {
|
|
17
|
+
id String @id @default(cuid())
|
|
18
|
+
<campos solicitados>
|
|
19
|
+
userId String // Si pertenece a User
|
|
20
|
+
createdAt DateTime @default(now())
|
|
21
|
+
updatedAt DateTime @updatedAt
|
|
22
|
+
|
|
23
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
24
|
+
|
|
25
|
+
@@index([userId]) // Índice para FK
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. Agregar la relación inversa en el modelo padre (`User` u otro):
|
|
30
|
+
|
|
31
|
+
```prisma
|
|
32
|
+
model User {
|
|
33
|
+
// ... campos existentes
|
|
34
|
+
<nombre_plural> <Nombre>[] // ej. tareas Tarea[]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
4. Ejecutar los comandos de Prisma:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm db:generate # Regenerar Prisma Client con nuevo modelo
|
|
42
|
+
pnpm db:migrate # Crear y aplicar migración
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
5. Verificar que no haya errores en la migración.
|
|
46
|
+
|
|
47
|
+
## Convenciones del modelo
|
|
48
|
+
|
|
49
|
+
| Aspecto | Convención | Ejemplo |
|
|
50
|
+
| --------------- | ----------------------------- | -------------------------------- |
|
|
51
|
+
| Nombre | PascalCase singular | `Tarea`, `Comentario` |
|
|
52
|
+
| Campos | camelCase | `fechaLimite`, `descripcion` |
|
|
53
|
+
| ID | `String @id @default(cuid())` | Siempre CUID |
|
|
54
|
+
| Timestamps | `createdAt` + `updatedAt` | Siempre incluir ambos |
|
|
55
|
+
| FK a User | `userId String` + relación | Con `onDelete: Cascade` |
|
|
56
|
+
| Índices | `@@index([campo])` | Para FKs y campos de búsqueda |
|
|
57
|
+
| Textos largos | `@db.Text` | Para descripciones, contenido |
|
|
58
|
+
| Valores default | `@default(valor)` | `@default(0)`, `@default(now())` |
|
|
59
|
+
|
|
60
|
+
## Reglas a respetar
|
|
61
|
+
|
|
62
|
+
- Provider: `mysql` en datasource
|
|
63
|
+
- Relaciones SIEMPRE con `onDelete: Cascade` hacia User
|
|
64
|
+
- Nombres de relaciones inversa en plural camelCase (`tareas`, `comentarios`)
|
|
65
|
+
- NO usar autoincrement — usar `cuid()` para IDs
|
|
66
|
+
- Seed: Si corresponde, agregar datos de ejemplo en `prisma/seed.ts`
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# new-server-action
|
|
2
|
+
|
|
3
|
+
**Objetivo:** Crear un Server Action en `src/actions/` con validación Zod, autenticación y revalidación.
|
|
4
|
+
|
|
5
|
+
## Instrucciones para Cursor
|
|
6
|
+
|
|
7
|
+
1. Solicitar al usuario:
|
|
8
|
+
- **Dominio** (nombre del archivo): ej. `tareas`, `usuarios`, `reportes`
|
|
9
|
+
- **Acciones necesarias**: ej. `crear`, `editar`, `eliminar`, `obtener`
|
|
10
|
+
- **¿Requiere autenticación?** (casi siempre sí)
|
|
11
|
+
- **Modelo Prisma relacionado**: ej. `Tarea`, `Reporte`
|
|
12
|
+
- **Rutas a revalidar**: ej. `/tareas`, `/dashboard`
|
|
13
|
+
|
|
14
|
+
2. Crear `src/actions/<dominio>.ts`:
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
"use server";
|
|
18
|
+
|
|
19
|
+
import { z } from "zod/v4";
|
|
20
|
+
import { auth } from "@/auth";
|
|
21
|
+
import { prisma } from "@/lib/prisma";
|
|
22
|
+
import { revalidatePath } from "next/cache";
|
|
23
|
+
|
|
24
|
+
// --- Schemas de validación ---
|
|
25
|
+
|
|
26
|
+
const <dominio>Schema = z.object({
|
|
27
|
+
// Definir campos con validación
|
|
28
|
+
titulo: z.string().min(1, "El título es requerido"),
|
|
29
|
+
descripcion: z.string().min(1, "La descripción es requerida"),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// --- Tipo de estado para formularios ---
|
|
33
|
+
|
|
34
|
+
interface <Dominio>FormState {
|
|
35
|
+
error?: string;
|
|
36
|
+
success?: boolean;
|
|
37
|
+
data?: unknown;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// --- Acciones ---
|
|
41
|
+
|
|
42
|
+
export async function crear<Dominio>(
|
|
43
|
+
_prevState: <Dominio>FormState,
|
|
44
|
+
formData: FormData,
|
|
45
|
+
): Promise<<Dominio>FormState> {
|
|
46
|
+
const session = await auth();
|
|
47
|
+
if (!session?.user?.id) {
|
|
48
|
+
return { error: "No autenticado" };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const rawData = Object.fromEntries(formData);
|
|
52
|
+
const parsed = <dominio>Schema.safeParse(rawData);
|
|
53
|
+
|
|
54
|
+
if (!parsed.success) {
|
|
55
|
+
return { error: parsed.error.issues[0]?.message || "Datos inválidos" };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
try {
|
|
59
|
+
await prisma.<modelo>.create({
|
|
60
|
+
data: {
|
|
61
|
+
...parsed.data,
|
|
62
|
+
userId: session.user.id,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
revalidatePath("/<ruta>");
|
|
67
|
+
revalidatePath("/dashboard");
|
|
68
|
+
return { success: true };
|
|
69
|
+
} catch {
|
|
70
|
+
return { error: "Error al crear" };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
3. Repetir el patrón para `editar`, `eliminar`, `obtener` según lo solicitado.
|
|
76
|
+
|
|
77
|
+
4. Cada acción DEBE:
|
|
78
|
+
- Llamar a `auth()` y verificar `session.user.id`
|
|
79
|
+
- Validar input con Zod `safeParse()`
|
|
80
|
+
- Retornar objeto con `{ error?: string, success?: boolean, data?: T }`
|
|
81
|
+
- Llamar `revalidatePath()` después de mutaciones
|
|
82
|
+
|
|
83
|
+
## Reglas a respetar
|
|
84
|
+
|
|
85
|
+
- Nombres de funciones: camelCase con verbo en español (`crearTarea`, `editarReporte`)
|
|
86
|
+
- Schemas Zod: camelCase (`tareaSchema`, `reporteSchema`)
|
|
87
|
+
- Siempre verificar ownership cuando aplique (`where: { id, userId: session.user.id }`)
|
|
88
|
+
- Import de Zod: `import { z } from "zod/v4"` (Zod 4)
|
|
89
|
+
- Revalidar todas las rutas afectadas tras mutaciones
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
|
|
4
|
+
interface AfterFileEditInput {
|
|
5
|
+
file_path: string;
|
|
6
|
+
edits: Array<{ old_string: string; new_string: 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 FORMATTABLE_EXTENSIONS = [
|
|
23
|
+
".ts",
|
|
24
|
+
".tsx",
|
|
25
|
+
".js",
|
|
26
|
+
".jsx",
|
|
27
|
+
".css",
|
|
28
|
+
".json",
|
|
29
|
+
".md",
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
async function main(): Promise<void> {
|
|
33
|
+
try {
|
|
34
|
+
const raw = await readStdin();
|
|
35
|
+
if (!raw?.trim()) return;
|
|
36
|
+
|
|
37
|
+
const payload = JSON.parse(
|
|
38
|
+
raw.replace(/^\uFEFF/, "").trim(),
|
|
39
|
+
) as AfterFileEditInput;
|
|
40
|
+
const filePath = payload.file_path;
|
|
41
|
+
|
|
42
|
+
if (!filePath || !existsSync(filePath)) return;
|
|
43
|
+
|
|
44
|
+
const ext = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
|
|
45
|
+
if (!FORMATTABLE_EXTENSIONS.includes(ext)) return;
|
|
46
|
+
|
|
47
|
+
if (filePath.includes("node_modules") || filePath.includes(".next")) return;
|
|
48
|
+
|
|
49
|
+
execSync(`npx prettier --write "${filePath}"`, {
|
|
50
|
+
encoding: "utf8",
|
|
51
|
+
timeout: 10000,
|
|
52
|
+
stdio: "pipe",
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
console.error(`[auto-format] Formatted: ${filePath}`);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.error(
|
|
58
|
+
"[auto-format] Error:",
|
|
59
|
+
err instanceof Error ? err.message : String(err),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
main();
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { existsSync, readFileSync, unlinkSync } from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
interface StopInput {
|
|
5
|
+
status: string;
|
|
6
|
+
loop_count: number;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface PendingTest {
|
|
11
|
+
source: string;
|
|
12
|
+
testPath: string;
|
|
13
|
+
type: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function readStdin(): Promise<string> {
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
let data = "";
|
|
19
|
+
process.stdin.setEncoding("utf8");
|
|
20
|
+
process.stdin.on("data", (chunk: string) => {
|
|
21
|
+
data += chunk;
|
|
22
|
+
});
|
|
23
|
+
process.stdin.on("end", () => resolve(data));
|
|
24
|
+
process.stdin.on("error", () => resolve(""));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function respond(output: Record<string, unknown>): void {
|
|
29
|
+
process.stdout.write(JSON.stringify(output) + "\n");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function main(): Promise<void> {
|
|
33
|
+
try {
|
|
34
|
+
const raw = await readStdin();
|
|
35
|
+
if (!raw?.trim()) {
|
|
36
|
+
respond({});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const payload = JSON.parse(raw.replace(/^\uFEFF/, "").trim()) as StopInput;
|
|
41
|
+
const workspaceRoot = process.env.CURSOR_PROJECT_DIR || process.cwd();
|
|
42
|
+
const pendingPath = path.join(workspaceRoot, ".pending-tests.json");
|
|
43
|
+
|
|
44
|
+
if (!existsSync(pendingPath)) {
|
|
45
|
+
respond({});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let pending: PendingTest[] = [];
|
|
50
|
+
try {
|
|
51
|
+
pending = JSON.parse(readFileSync(pendingPath, "utf8"));
|
|
52
|
+
} catch {
|
|
53
|
+
respond({});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (pending.length === 0) {
|
|
58
|
+
unlinkSync(pendingPath);
|
|
59
|
+
respond({});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (payload.loop_count >= 1) {
|
|
64
|
+
unlinkSync(pendingPath);
|
|
65
|
+
respond({});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const testList = pending
|
|
70
|
+
.map((t) => ` - ${t.testPath} (${t.type} for ${t.source})`)
|
|
71
|
+
.join("\n");
|
|
72
|
+
|
|
73
|
+
unlinkSync(pendingPath);
|
|
74
|
+
|
|
75
|
+
respond({
|
|
76
|
+
followup_message: [
|
|
77
|
+
`There are ${pending.length} test scaffolds that need implementation:`,
|
|
78
|
+
testList,
|
|
79
|
+
"",
|
|
80
|
+
"Please complete the test implementations using Vitest + Testing Library.",
|
|
81
|
+
"Use the react-test-expert agent if available, or implement them directly.",
|
|
82
|
+
"Run `pnpm test -- --run` to verify they pass.",
|
|
83
|
+
].join("\n"),
|
|
84
|
+
});
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.error(
|
|
87
|
+
"[auto-test-on-stop] Error:",
|
|
88
|
+
err instanceof Error ? err.message : String(err),
|
|
89
|
+
);
|
|
90
|
+
respond({});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
main();
|