create-huenei-template 0.2.7 → 0.2.9
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 +14 -0
- package/dist/core/file-operations.js +15 -0
- package/dist/core/prompts.js +77 -135
- package/dist/index.js +55 -11
- package/dist/templates/README.md +7 -1
- package/dist/templates/backend/README.md +19 -9
- package/dist/templates/backend/nestjs-api-mysql/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/agents/prisma-guardian.md +67 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/agents/test-runner.md +57 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/blockDangerous.ts +98 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/formatOnEdit.ts +70 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/protectSecrets.ts +101 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/sessionInit.ts +104 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/validatePrisma.ts +121 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks.json +46 -0
- package/dist/templates/backend/nestjs-api-mysql/README.md +26 -0
- package/dist/templates/backend/nestjs-api-mysql/eslint.config.mjs +1 -1
- package/dist/templates/backend/nestjs-api-mysql/package.json +7 -7
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/prisma-guardian.md +62 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/security-auditor.md +71 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/test-runner.md +58 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/auto-retry.ts +62 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/block-dangerous.ts +202 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/format-and-validate.ts +124 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/protect-secrets.ts +105 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/session-context.ts +130 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks.json +36 -0
- package/dist/templates/backend/nestjs-api-postgres/eslint.config.mjs +1 -1
- package/dist/templates/backend/nestjs-api-postgres/package.json +6 -6
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/code-reviewer.md +153 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/nestjs-architect.md +138 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/prisma-analyst.md +164 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/security-auditor.md +150 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/test-engineer.md +290 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/auto-format.ts +80 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/block-dangerous-commands.ts +144 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/prisma-schema-watcher.ts +64 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/protect-sensitive-files.ts +122 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/session-context.ts +105 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks.json +18 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/conventional-commits/SKILL.md +318 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/docker/SKILL.md +82 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/jest/SKILL.md +72 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/logging-best-practices/SKILL.md +127 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/prisma-database-setup/SKILL.md +186 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/quality-gates-enforcer/SKILL.md +301 -0
- package/dist/templates/backend/nestjs-api-sqlite/README.md +34 -1
- package/dist/templates/backend/nestjs-api-sqlite/eslint.config.mjs +1 -1
- package/dist/templates/backend/nestjs-api-sqlite/package.json +6 -6
- package/dist/templates/backend/nestjs-api-sqlite/prisma/schema.prisma +1 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/seed.ts +2 -2
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/dto/post-response.dto.ts +5 -1
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/profile-response.dto.ts +1 -1
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/update-profile.dto.ts +1 -1
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/user-response.dto.ts +4 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/profile.service.ts +24 -8
- package/dist/templates/backend/nestjs-api-sqlite/src/users/users.service.ts +1 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/agents/prisma-guardian.md +67 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/agents/test-runner.md +57 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-endpoint.md +209 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-model.md +201 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/blockDangerous.ts +98 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/formatOnEdit.ts +70 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/protectSecrets.ts +101 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/sessionInit.ts +104 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/validatePrisma.ts +121 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks.json +46 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/api-rest.mdc +126 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/authentication-security.mdc +86 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/dto-validation.mdc +93 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/general-rules.mdc +126 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/prisma-standards.mdc +111 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/swagger-documentation.mdc +90 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/docker-expert/SKILL.md +409 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/sqlserver-table-design/SKILL.md +125 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.dockerignore +50 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.env.example +17 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.env.test +17 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.prettierrc +4 -0
- package/dist/templates/backend/nestjs-api-sqlserver/README.md +587 -0
- package/dist/templates/backend/nestjs-api-sqlserver/docker-compose.yml +24 -0
- package/dist/templates/backend/nestjs-api-sqlserver/eslint.config.mjs +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/nest-cli.json +8 -0
- package/dist/templates/backend/nestjs-api-sqlserver/package.json +107 -0
- package/dist/templates/backend/nestjs-api-sqlserver/prisma/schema.prisma +70 -0
- package/dist/templates/backend/nestjs-api-sqlserver/prisma/seed.ts +215 -0
- package/dist/templates/backend/nestjs-api-sqlserver/prisma.config.ts +12 -0
- package/dist/templates/backend/nestjs-api-sqlserver/scripts/check-docker.js +64 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/app.module.ts +39 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/app.service.ts +8 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/auth.controller.ts +36 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/auth.module.ts +22 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/auth.service.ts +64 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/decorators/roles.decorator.ts +5 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/dto/login-response.dto.ts +23 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/dto/login.dto.ts +27 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/enums/role.enum.ts +5 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/guards/roles.guard.ts +23 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/strategies/jwt.strategy.ts +32 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/types.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/common/dto/paginated-response.dto.ts +16 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/common/dto/pagination.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/common/filters/http-exception.filter.ts +53 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/config/env.validation.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/health/health.controller.ts +35 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/health/health.module.ts +7 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/main.ts +87 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/dto/create-post.dto.ts +32 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/dto/post-response.dto.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/dto/update-post.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/posts.controller.ts +161 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/posts.module.ts +12 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/posts.service.ts +171 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.module.ts +9 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.service.ts +62 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/constants/settings.constants.ts +9 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/profile-response.dto.ts +39 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/settings-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/update-profile.dto.ts +48 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/update-settings.dto.ts +40 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/user-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/profile.service.ts +67 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/settings.service.ts +77 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/users.controller.ts +102 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/users.module.ts +14 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/users.service.ts +27 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/README.md +412 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/auth.e2e-spec.ts +147 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/health.e2e-spec.ts +62 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/posts.e2e-spec.ts +407 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/users.e2e-spec.ts +287 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/fixtures/test-data.ts +109 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/helpers/auth.helper.ts +54 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/helpers/db.helper.ts +68 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/jest-e2e.json +12 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/setup-e2e.ts +8 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/app.service.spec.ts +24 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/auth.controller.spec.ts +91 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/auth.service.spec.ts +161 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/health.controller.spec.ts +78 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/http-exception.filter.spec.ts +150 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/jwt.strategy.spec.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/posts.controller.spec.ts +249 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/posts.service.spec.ts +328 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/profile.service.spec.ts +146 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/settings.service.spec.ts +242 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/users.controller.spec.ts +178 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/users.service.spec.ts +96 -0
- package/dist/templates/backend/nestjs-api-sqlserver/tsconfig.build.json +4 -0
- package/dist/templates/backend/nestjs-api-sqlserver/tsconfig.json +28 -0
- package/dist/templates/cursor/.cursor/commands/configurar-cursor.md +763 -0
- package/dist/templates/cursor/.cursor/skills/create-huenei-subagent/SKILL.md +223 -0
- package/dist/templates/cursor/.cursor/skills/create-huenei-subagent/examples.md +236 -0
- package/dist/templates/cursor/.cursor/skills/cursor-hooks/SKILL.md +1100 -0
- package/dist/templates/cursor/.cursor/skills/find-skills/SKILL.md +133 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/accessibility-reviewer.md +67 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/angular-code-reviewer.md +60 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/qa-test-expert.md +70 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/security-auditor.md +58 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/auto-format.ts +70 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/auto-test-on-stop.ts +113 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/block-dangerous-commands.ts +160 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/ensure-tests-exist.ts +363 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/protect-sensitive-files.ts +118 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/session-context.ts +110 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/angular-code-reviewer.md +64 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/nx-architecture-guardian.md +69 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/qa-test-expert.md +75 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/security-auditor.md +61 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/auto-format.ts +70 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/auto-test-on-stop.ts +115 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/block-dangerous-commands.ts +188 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/ensure-tests-exist.ts +399 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/protect-sensitive-files.ts +128 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/session-context.ts +121 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-vite/.cursor/agents/frontend-senior.agent.md +49 -49
- package/dist/templates/frontend/react-vite/.cursor/agents/qa-test-expert.agent.md +126 -49
- package/dist/templates/frontend/react-vite/.cursor/agents/security-expert.agent.md +39 -39
- package/dist/templates/frontend/react-vite/.cursor/agents/ux-ui-expert.agent.md +45 -45
- package/dist/templates/frontend/react-vite/.cursor/hooks/autoTestOnStop.ts +117 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/blockDangerous.ts +75 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/ensureTestsExist.ts +306 -220
- package/dist/templates/frontend/react-vite/.cursor/hooks/formatOnEdit.ts +49 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/protectSecrets.ts +88 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/sessionInit.ts +77 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks.json +41 -10
- package/dist/templates/frontend/react-vite/.cursor/settings.json +13 -13
- package/dist/templates/frontend/react-vite/.vscode/settings.json +31 -31
- package/dist/templates/frontend/react-vite/README.md +34 -34
- package/dist/templates/frontend/react-vite/package.json +82 -82
- package/dist/templates/frontend/react-vite/pnpm-lock.yaml +6575 -6575
- package/dist/templates/frontend/react-vite/src/__tests__/components/layout/navbar.test.tsx +63 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/avatar.test.tsx +74 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/badge.test.tsx +55 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/breadcrumb.test.tsx +140 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/button.test.tsx +121 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/card.test.tsx +144 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/dialog.test.tsx +121 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/form.test.tsx +165 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/input.test.tsx +52 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/label.test.tsx +40 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/password-input.test.tsx +59 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/separator.test.tsx +40 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/table.test.tsx +254 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/tabs.test.tsx +82 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/textarea.test.tsx +47 -0
- package/dist/templates/frontend/react-vite/src/__tests__/helpers/render.tsx +114 -0
- package/dist/templates/frontend/react-vite/src/__tests__/hooks/useLocalStorage.test.ts +95 -0
- package/dist/templates/frontend/react-vite/src/__tests__/lib/queryClient.test.ts +24 -0
- package/dist/templates/frontend/react-vite/src/__tests__/lib/utils.test.ts +43 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/index.test.tsx +111 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/otra-ruta.test.tsx +126 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/root.test.tsx +78 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/ui-components.test.tsx +286 -0
- package/dist/templates/frontend/react-vite/src/components/layout/navbar.tsx +38 -38
- package/dist/templates/frontend/react-vite/src/components/ui/avatar.tsx +42 -42
- package/dist/templates/frontend/react-vite/src/components/ui/dialog.tsx +122 -122
- package/dist/templates/frontend/react-vite/src/components/ui/table.tsx +229 -244
- package/dist/templates/frontend/react-vite/src/hooks/useLocalStorage.ts +32 -32
- package/dist/templates/frontend/react-vite/src/routes/__root.tsx +48 -48
- package/dist/templates/frontend/react-vite/src/routes/ui-components.tsx +359 -85
- package/dist/templates/frontend/react-vite/src/test/setup.ts +24 -24
- package/dist/templates/frontend/react-vite/vite.config.ts +2 -2
- package/dist/templates/frontend/react-vite/vitest.config.ts +13 -2
- package/dist/templates/frontend/react-vite-help/.cursor/RECONSTRUCTION-PROMPT.md +738 -0
- package/package.json +1 -1
- package/templates/README.md +7 -1
- package/templates/backend/README.md +19 -9
- package/templates/backend/nestjs-api-mysql/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/templates/backend/nestjs-api-mysql/.cursor/agents/prisma-guardian.md +67 -0
- package/templates/backend/nestjs-api-mysql/.cursor/agents/test-runner.md +57 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/blockDangerous.ts +98 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/formatOnEdit.ts +70 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/protectSecrets.ts +101 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/sessionInit.ts +104 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/validatePrisma.ts +121 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks.json +46 -0
- package/templates/backend/nestjs-api-mysql/README.md +26 -0
- package/templates/backend/nestjs-api-mysql/dist/tsconfig.build.tsbuildinfo +1 -1
- package/templates/backend/nestjs-api-mysql/eslint.config.mjs +1 -1
- package/templates/backend/nestjs-api-mysql/package.json +7 -7
- package/templates/backend/nestjs-api-postgres/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/templates/backend/nestjs-api-postgres/.cursor/agents/prisma-guardian.md +62 -0
- package/templates/backend/nestjs-api-postgres/.cursor/agents/security-auditor.md +71 -0
- package/templates/backend/nestjs-api-postgres/.cursor/agents/test-runner.md +58 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/auto-retry.ts +62 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/block-dangerous.ts +202 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/format-and-validate.ts +124 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/protect-secrets.ts +105 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/session-context.ts +130 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks.json +36 -0
- package/templates/backend/nestjs-api-postgres/eslint.config.mjs +1 -1
- package/templates/backend/nestjs-api-postgres/package.json +6 -6
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/code-reviewer.md +153 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/nestjs-architect.md +138 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/prisma-analyst.md +164 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/security-auditor.md +150 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/test-engineer.md +290 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/auto-format.ts +80 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/block-dangerous-commands.ts +144 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/prisma-schema-watcher.ts +64 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/protect-sensitive-files.ts +122 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/session-context.ts +105 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks.json +18 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/conventional-commits/SKILL.md +318 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/docker/SKILL.md +82 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/jest/SKILL.md +72 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/logging-best-practices/SKILL.md +127 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/prisma-database-setup/SKILL.md +186 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/quality-gates-enforcer/SKILL.md +301 -0
- package/templates/backend/nestjs-api-sqlite/README.md +34 -1
- package/templates/backend/nestjs-api-sqlite/eslint.config.mjs +1 -1
- package/templates/backend/nestjs-api-sqlite/package.json +6 -6
- package/templates/backend/nestjs-api-sqlite/prisma/schema.prisma +1 -0
- package/templates/backend/nestjs-api-sqlite/prisma/seed.ts +2 -2
- package/templates/backend/nestjs-api-sqlite/src/posts/dto/post-response.dto.ts +5 -1
- package/templates/backend/nestjs-api-sqlite/src/users/dto/profile-response.dto.ts +1 -1
- package/templates/backend/nestjs-api-sqlite/src/users/dto/update-profile.dto.ts +1 -1
- package/templates/backend/nestjs-api-sqlite/src/users/dto/user-response.dto.ts +4 -0
- package/templates/backend/nestjs-api-sqlite/src/users/profile.service.ts +24 -8
- package/templates/backend/nestjs-api-sqlite/src/users/users.service.ts +1 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/prisma-guardian.md +67 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/test-runner.md +57 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-endpoint.md +209 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-model.md +201 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/blockDangerous.ts +98 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/formatOnEdit.ts +70 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/protectSecrets.ts +101 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/sessionInit.ts +104 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/validatePrisma.ts +121 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks.json +46 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/api-rest.mdc +126 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/authentication-security.mdc +86 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/dto-validation.mdc +93 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/general-rules.mdc +126 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/prisma-standards.mdc +111 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/swagger-documentation.mdc +90 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/docker-expert/SKILL.md +409 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/sqlserver-table-design/SKILL.md +125 -0
- package/templates/backend/nestjs-api-sqlserver/.dockerignore +50 -0
- package/templates/backend/nestjs-api-sqlserver/.env.example +17 -0
- package/templates/backend/nestjs-api-sqlserver/.env.test +17 -0
- package/templates/backend/nestjs-api-sqlserver/.prettierrc +4 -0
- package/templates/backend/nestjs-api-sqlserver/README.md +587 -0
- package/templates/backend/nestjs-api-sqlserver/docker-compose.yml +24 -0
- package/templates/backend/nestjs-api-sqlserver/eslint.config.mjs +41 -0
- package/templates/backend/nestjs-api-sqlserver/nest-cli.json +8 -0
- package/templates/backend/nestjs-api-sqlserver/package.json +107 -0
- package/templates/backend/nestjs-api-sqlserver/prisma/schema.prisma +70 -0
- package/templates/backend/nestjs-api-sqlserver/prisma/seed.ts +215 -0
- package/templates/backend/nestjs-api-sqlserver/prisma.config.ts +12 -0
- package/templates/backend/nestjs-api-sqlserver/scripts/check-docker.js +64 -0
- package/templates/backend/nestjs-api-sqlserver/src/app.module.ts +39 -0
- package/templates/backend/nestjs-api-sqlserver/src/app.service.ts +8 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/auth.controller.ts +36 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/auth.module.ts +22 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/auth.service.ts +64 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/decorators/roles.decorator.ts +5 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/dto/login-response.dto.ts +23 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/dto/login.dto.ts +27 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/enums/role.enum.ts +5 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/guards/roles.guard.ts +23 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/strategies/jwt.strategy.ts +32 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/types.ts +18 -0
- package/templates/backend/nestjs-api-sqlserver/src/common/dto/paginated-response.dto.ts +16 -0
- package/templates/backend/nestjs-api-sqlserver/src/common/dto/pagination.dto.ts +31 -0
- package/templates/backend/nestjs-api-sqlserver/src/common/filters/http-exception.filter.ts +53 -0
- package/templates/backend/nestjs-api-sqlserver/src/config/env.validation.ts +41 -0
- package/templates/backend/nestjs-api-sqlserver/src/health/health.controller.ts +35 -0
- package/templates/backend/nestjs-api-sqlserver/src/health/health.module.ts +7 -0
- package/templates/backend/nestjs-api-sqlserver/src/main.ts +87 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/dto/create-post.dto.ts +32 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/dto/post-response.dto.ts +41 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/dto/update-post.dto.ts +31 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/posts.controller.ts +161 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/posts.module.ts +12 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/posts.service.ts +171 -0
- package/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.module.ts +9 -0
- package/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.service.ts +62 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/constants/settings.constants.ts +9 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/profile-response.dto.ts +39 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/settings-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/update-profile.dto.ts +48 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/update-settings.dto.ts +40 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/user-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/profile.service.ts +67 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/settings.service.ts +77 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/users.controller.ts +102 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/users.module.ts +14 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/users.service.ts +27 -0
- package/templates/backend/nestjs-api-sqlserver/test/README.md +412 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/auth.e2e-spec.ts +147 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/health.e2e-spec.ts +62 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/posts.e2e-spec.ts +407 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/users.e2e-spec.ts +287 -0
- package/templates/backend/nestjs-api-sqlserver/test/fixtures/test-data.ts +109 -0
- package/templates/backend/nestjs-api-sqlserver/test/helpers/auth.helper.ts +54 -0
- package/templates/backend/nestjs-api-sqlserver/test/helpers/db.helper.ts +68 -0
- package/templates/backend/nestjs-api-sqlserver/test/jest-e2e.json +12 -0
- package/templates/backend/nestjs-api-sqlserver/test/setup-e2e.ts +8 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/app.service.spec.ts +24 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/auth.controller.spec.ts +91 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/auth.service.spec.ts +161 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/health.controller.spec.ts +78 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/http-exception.filter.spec.ts +150 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/jwt.strategy.spec.ts +41 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/posts.controller.spec.ts +249 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/posts.service.spec.ts +328 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/profile.service.spec.ts +146 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/settings.service.spec.ts +242 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/users.controller.spec.ts +178 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/users.service.spec.ts +96 -0
- package/templates/backend/nestjs-api-sqlserver/tsconfig.build.json +4 -0
- package/templates/backend/nestjs-api-sqlserver/tsconfig.json +28 -0
- package/templates/cursor/.cursor/commands/configurar-cursor.md +763 -0
- package/templates/cursor/.cursor/skills/create-huenei-subagent/SKILL.md +223 -0
- package/templates/cursor/.cursor/skills/create-huenei-subagent/examples.md +236 -0
- package/templates/cursor/.cursor/skills/cursor-hooks/SKILL.md +1100 -0
- package/templates/cursor/.cursor/skills/find-skills/SKILL.md +133 -0
- package/templates/frontend/angular-base/.cursor/agents/accessibility-reviewer.md +67 -0
- package/templates/frontend/angular-base/.cursor/agents/angular-code-reviewer.md +60 -0
- package/templates/frontend/angular-base/.cursor/agents/qa-test-expert.md +70 -0
- package/templates/frontend/angular-base/.cursor/agents/security-auditor.md +58 -0
- package/templates/frontend/angular-base/.cursor/hooks/auto-format.ts +70 -0
- package/templates/frontend/angular-base/.cursor/hooks/auto-test-on-stop.ts +113 -0
- package/templates/frontend/angular-base/.cursor/hooks/block-dangerous-commands.ts +160 -0
- package/templates/frontend/angular-base/.cursor/hooks/ensure-tests-exist.ts +363 -0
- package/templates/frontend/angular-base/.cursor/hooks/protect-sensitive-files.ts +118 -0
- package/templates/frontend/angular-base/.cursor/hooks/session-context.ts +110 -0
- package/templates/frontend/angular-base/.cursor/hooks.json +41 -0
- package/templates/frontend/angular-nx/.cursor/agents/angular-code-reviewer.md +64 -0
- package/templates/frontend/angular-nx/.cursor/agents/nx-architecture-guardian.md +69 -0
- package/templates/frontend/angular-nx/.cursor/agents/qa-test-expert.md +75 -0
- package/templates/frontend/angular-nx/.cursor/agents/security-auditor.md +61 -0
- package/templates/frontend/angular-nx/.cursor/hooks/auto-format.ts +70 -0
- package/templates/frontend/angular-nx/.cursor/hooks/auto-test-on-stop.ts +115 -0
- package/templates/frontend/angular-nx/.cursor/hooks/block-dangerous-commands.ts +188 -0
- package/templates/frontend/angular-nx/.cursor/hooks/ensure-tests-exist.ts +399 -0
- package/templates/frontend/angular-nx/.cursor/hooks/protect-sensitive-files.ts +128 -0
- package/templates/frontend/angular-nx/.cursor/hooks/session-context.ts +121 -0
- package/templates/frontend/angular-nx/.cursor/hooks.json +41 -0
- package/templates/frontend/react-vite/.cursor/agents/frontend-senior.agent.md +49 -49
- package/templates/frontend/react-vite/.cursor/agents/qa-test-expert.agent.md +126 -49
- package/templates/frontend/react-vite/.cursor/agents/security-expert.agent.md +39 -39
- package/templates/frontend/react-vite/.cursor/agents/ux-ui-expert.agent.md +45 -45
- package/templates/frontend/react-vite/.cursor/hooks/autoTestOnStop.ts +117 -0
- package/templates/frontend/react-vite/.cursor/hooks/blockDangerous.ts +75 -0
- package/templates/frontend/react-vite/.cursor/hooks/ensureTestsExist.ts +306 -220
- package/templates/frontend/react-vite/.cursor/hooks/formatOnEdit.ts +49 -0
- package/templates/frontend/react-vite/.cursor/hooks/protectSecrets.ts +88 -0
- package/templates/frontend/react-vite/.cursor/hooks/sessionInit.ts +77 -0
- package/templates/frontend/react-vite/.cursor/hooks.json +41 -10
- package/templates/frontend/react-vite/.cursor/settings.json +13 -13
- package/templates/frontend/react-vite/.vscode/settings.json +31 -31
- package/templates/frontend/react-vite/README.md +34 -34
- package/templates/frontend/react-vite/package.json +82 -82
- package/templates/frontend/react-vite/pnpm-lock.yaml +6575 -6575
- package/templates/frontend/react-vite/src/__tests__/components/layout/navbar.test.tsx +63 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/avatar.test.tsx +74 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/badge.test.tsx +55 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/breadcrumb.test.tsx +140 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/button.test.tsx +121 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/card.test.tsx +144 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/dialog.test.tsx +121 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/form.test.tsx +165 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/input.test.tsx +52 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/label.test.tsx +40 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/password-input.test.tsx +59 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/separator.test.tsx +40 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/table.test.tsx +254 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/tabs.test.tsx +82 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/textarea.test.tsx +47 -0
- package/templates/frontend/react-vite/src/__tests__/helpers/render.tsx +114 -0
- package/templates/frontend/react-vite/src/__tests__/hooks/useLocalStorage.test.ts +95 -0
- package/templates/frontend/react-vite/src/__tests__/lib/queryClient.test.ts +24 -0
- package/templates/frontend/react-vite/src/__tests__/lib/utils.test.ts +43 -0
- package/templates/frontend/react-vite/src/__tests__/routes/index.test.tsx +111 -0
- package/templates/frontend/react-vite/src/__tests__/routes/otra-ruta.test.tsx +126 -0
- package/templates/frontend/react-vite/src/__tests__/routes/root.test.tsx +78 -0
- package/templates/frontend/react-vite/src/__tests__/routes/ui-components.test.tsx +286 -0
- package/templates/frontend/react-vite/src/components/layout/navbar.tsx +38 -38
- package/templates/frontend/react-vite/src/components/ui/avatar.tsx +42 -42
- package/templates/frontend/react-vite/src/components/ui/dialog.tsx +122 -122
- package/templates/frontend/react-vite/src/components/ui/table.tsx +229 -244
- package/templates/frontend/react-vite/src/hooks/useLocalStorage.ts +32 -32
- package/templates/frontend/react-vite/src/routes/__root.tsx +48 -48
- package/templates/frontend/react-vite/src/routes/ui-components.tsx +359 -85
- package/templates/frontend/react-vite/src/test/setup.ts +24 -24
- package/templates/frontend/react-vite/vite.config.ts +2 -2
- package/templates/frontend/react-vite/vitest.config.ts +13 -2
- package/templates/frontend/react-vite-help/.cursor/RECONSTRUCTION-PROMPT.md +738 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
interface HookInput {
|
|
2
|
+
command: string;
|
|
3
|
+
cwd?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface HookOutput {
|
|
9
|
+
permission: 'allow' | 'deny' | 'ask';
|
|
10
|
+
user_message?: string;
|
|
11
|
+
agent_message?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface DangerRule {
|
|
15
|
+
pattern: RegExp;
|
|
16
|
+
permission: 'deny' | 'ask';
|
|
17
|
+
userMessage: string;
|
|
18
|
+
agentMessage: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const DANGER_RULES: DangerRule[] = [
|
|
22
|
+
{
|
|
23
|
+
pattern: /rm\s+(-\w*r\w*f\w*|-\w*f\w*r\w*)\s+[/~.]/,
|
|
24
|
+
permission: 'deny',
|
|
25
|
+
userMessage: 'Comando rm -rf destructivo bloqueado.',
|
|
26
|
+
agentMessage:
|
|
27
|
+
'El comando fue bloqueado porque rm -rf apuntando a /, ~ o . puede borrar archivos criticos. Usa rutas especificas y seguras.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
pattern: /prisma\s+migrate\s+reset/i,
|
|
31
|
+
permission: 'deny',
|
|
32
|
+
userMessage: 'prisma migrate reset bloqueado (borra toda la BD).',
|
|
33
|
+
agentMessage:
|
|
34
|
+
'prisma migrate reset fue bloqueado porque elimina todos los datos de la base de datos. Si necesitas resetear, pide confirmacion al usuario primero.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
pattern: /prisma\s+db\s+push\s+--force-reset/i,
|
|
38
|
+
permission: 'deny',
|
|
39
|
+
userMessage: 'prisma db push --force-reset bloqueado (reset forzado de BD).',
|
|
40
|
+
agentMessage:
|
|
41
|
+
'prisma db push --force-reset fue bloqueado porque fuerza un reset completo de la base de datos. Usa prisma migrate dev para cambios seguros.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
pattern: /DROP\s+(DATABASE|TABLE|SCHEMA)/i,
|
|
45
|
+
permission: 'deny',
|
|
46
|
+
userMessage: 'Comando SQL destructivo (DROP) bloqueado.',
|
|
47
|
+
agentMessage:
|
|
48
|
+
'Comandos DROP DATABASE/TABLE/SCHEMA fueron bloqueados por seguridad. Usa Prisma migrations para cambios de esquema.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
pattern: /TRUNCATE\s+TABLE/i,
|
|
52
|
+
permission: 'deny',
|
|
53
|
+
userMessage: 'TRUNCATE TABLE bloqueado.',
|
|
54
|
+
agentMessage:
|
|
55
|
+
'TRUNCATE TABLE fue bloqueado. Si necesitas limpiar datos, usa el seed (pnpm prisma:seed) o pedi confirmacion al usuario.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
pattern: /git\s+push\s+.*--force(?!-with-lease)\b.*(?:main|master)/i,
|
|
59
|
+
permission: 'deny',
|
|
60
|
+
userMessage: 'git push --force a main/master bloqueado.',
|
|
61
|
+
agentMessage:
|
|
62
|
+
'git push --force a main/master fue bloqueado. Usa --force-with-lease o trabaja en una branch separada.',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
pattern: /git\s+push\s+--force(?!-with-lease)/i,
|
|
66
|
+
permission: 'ask',
|
|
67
|
+
userMessage: 'git push --force requiere aprobacion manual.',
|
|
68
|
+
agentMessage:
|
|
69
|
+
'git push --force necesita aprobacion del usuario. Considera usar --force-with-lease que es mas seguro.',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
pattern: /prisma\s+db\s+push(?!\s+--force-reset)/i,
|
|
73
|
+
permission: 'ask',
|
|
74
|
+
userMessage: 'prisma db push puede causar perdida de datos. Aprobar?',
|
|
75
|
+
agentMessage:
|
|
76
|
+
'prisma db push requiere aprobacion porque puede causar perdida de datos si hay cambios destructivos en el schema. Considera usar prisma migrate dev.',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
function readStdin(): Promise<string> {
|
|
81
|
+
return new Promise((resolve) => {
|
|
82
|
+
let data = '';
|
|
83
|
+
process.stdin.setEncoding('utf8');
|
|
84
|
+
process.stdin.on('data', (chunk: string) => {
|
|
85
|
+
data += chunk;
|
|
86
|
+
});
|
|
87
|
+
process.stdin.on('end', () => resolve(data));
|
|
88
|
+
process.stdin.on('error', () => resolve(''));
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function respond(output: HookOutput): void {
|
|
93
|
+
process.stdout.write(JSON.stringify(output) + '\n');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function evaluateCommand(command: string): HookOutput {
|
|
97
|
+
for (const rule of DANGER_RULES) {
|
|
98
|
+
if (rule.pattern.test(command)) {
|
|
99
|
+
return {
|
|
100
|
+
permission: rule.permission,
|
|
101
|
+
user_message: rule.userMessage,
|
|
102
|
+
agent_message: rule.agentMessage,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return { permission: 'allow' };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async function main(): Promise<void> {
|
|
111
|
+
try {
|
|
112
|
+
const raw = await readStdin();
|
|
113
|
+
if (!raw?.trim()) {
|
|
114
|
+
respond({ permission: 'allow' });
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const payload = JSON.parse(raw.replace(/^\uFEFF/, '').trim()) as HookInput;
|
|
119
|
+
const command = payload.command;
|
|
120
|
+
|
|
121
|
+
if (!command) {
|
|
122
|
+
respond({ permission: 'allow' });
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const result = evaluateCommand(command);
|
|
127
|
+
|
|
128
|
+
if (result.permission !== 'allow') {
|
|
129
|
+
console.error(
|
|
130
|
+
`[block-dangerous] ${result.permission.toUpperCase()}: ${command}`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
respond(result);
|
|
135
|
+
} catch (err) {
|
|
136
|
+
console.error(
|
|
137
|
+
'[block-dangerous] Error:',
|
|
138
|
+
err instanceof Error ? err.message : String(err),
|
|
139
|
+
);
|
|
140
|
+
respond({ permission: 'allow' });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
main();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
interface HookInput {
|
|
4
|
+
file_path: string;
|
|
5
|
+
workspace_roots?: string[];
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function readStdin(): Promise<string> {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
let data = '';
|
|
12
|
+
process.stdin.setEncoding('utf8');
|
|
13
|
+
process.stdin.on('data', (chunk: string) => {
|
|
14
|
+
data += chunk;
|
|
15
|
+
});
|
|
16
|
+
process.stdin.on('end', () => resolve(data));
|
|
17
|
+
process.stdin.on('error', () => resolve(''));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isSchemaFile(filePath: string): boolean {
|
|
22
|
+
const normalized = filePath.replace(/\\/g, '/');
|
|
23
|
+
return normalized.endsWith('prisma/schema.prisma') || normalized.endsWith('.prisma');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function main(): Promise<void> {
|
|
27
|
+
try {
|
|
28
|
+
const raw = await readStdin();
|
|
29
|
+
if (!raw?.trim()) return;
|
|
30
|
+
|
|
31
|
+
const payload = JSON.parse(raw.replace(/^\uFEFF/, '').trim()) as HookInput;
|
|
32
|
+
const filePath = payload.file_path;
|
|
33
|
+
|
|
34
|
+
if (!filePath) {
|
|
35
|
+
console.error('[prisma-watcher] No file_path in payload');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!isSchemaFile(filePath)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const cwd = process.env['CURSOR_PROJECT_DIR'] || process.cwd();
|
|
44
|
+
|
|
45
|
+
console.error(`[prisma-watcher] Schema changed: ${filePath}`);
|
|
46
|
+
console.error('[prisma-watcher] Running prisma generate...');
|
|
47
|
+
|
|
48
|
+
const output = execSync('npx prisma generate', {
|
|
49
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
50
|
+
timeout: 30_000,
|
|
51
|
+
cwd,
|
|
52
|
+
encoding: 'utf8',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
console.error(`[prisma-watcher] prisma generate completed: ${output.trim()}`);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.error(
|
|
58
|
+
'[prisma-watcher] Error running prisma generate:',
|
|
59
|
+
err instanceof Error ? err.message : String(err),
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
main();
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
|
|
3
|
+
interface HookInput {
|
|
4
|
+
file_path: string;
|
|
5
|
+
content?: string;
|
|
6
|
+
attachments?: { type: string; filePath: string }[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface HookOutput {
|
|
11
|
+
permission: 'allow' | 'deny';
|
|
12
|
+
user_message?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const BLOCKED_BASENAMES = new Set([
|
|
16
|
+
'.env',
|
|
17
|
+
'.env.local',
|
|
18
|
+
'.env.test',
|
|
19
|
+
'.env.production',
|
|
20
|
+
'.env.development',
|
|
21
|
+
'.env.staging',
|
|
22
|
+
'id_rsa',
|
|
23
|
+
'id_ed25519',
|
|
24
|
+
'credentials.json',
|
|
25
|
+
'secrets.yaml',
|
|
26
|
+
'secrets.yml',
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
const BLOCKED_EXTENSIONS = new Set(['.db', '.db-journal', '.pem', '.key', '.pfx', '.p12']);
|
|
30
|
+
|
|
31
|
+
const BLOCKED_PATTERNS = [/\.env\.\w+\.local$/];
|
|
32
|
+
|
|
33
|
+
const ALLOWED_BASENAMES = new Set(['.env.example', '.env.template', '.env.sample']);
|
|
34
|
+
|
|
35
|
+
function readStdin(): Promise<string> {
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
let data = '';
|
|
38
|
+
process.stdin.setEncoding('utf8');
|
|
39
|
+
process.stdin.on('data', (chunk: string) => {
|
|
40
|
+
data += chunk;
|
|
41
|
+
});
|
|
42
|
+
process.stdin.on('end', () => resolve(data));
|
|
43
|
+
process.stdin.on('error', () => resolve(''));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function respond(output: HookOutput): void {
|
|
48
|
+
process.stdout.write(JSON.stringify(output) + '\n');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function shouldBlock(filePath: string): string | null {
|
|
52
|
+
const basename = path.basename(filePath);
|
|
53
|
+
|
|
54
|
+
if (ALLOWED_BASENAMES.has(basename)) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (BLOCKED_BASENAMES.has(basename)) {
|
|
59
|
+
return `"${basename}" puede contener secrets (JWT_SECRET, credenciales). Usa ".env.example" como referencia.`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
63
|
+
|
|
64
|
+
if (ext === '.db' || ext === '.db-journal') {
|
|
65
|
+
return `"${basename}" es un archivo binario SQLite. Usa Prisma Studio (pnpm prisma:studio) o el MCP sqlite para inspeccionar datos.`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (BLOCKED_EXTENSIONS.has(ext)) {
|
|
69
|
+
return `"${basename}" es un archivo de certificado/clave privada y no debe ser leido por el agente.`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
for (const pattern of BLOCKED_PATTERNS) {
|
|
73
|
+
if (pattern.test(basename)) {
|
|
74
|
+
return `"${basename}" es un archivo de entorno local que puede contener secrets.`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function main(): Promise<void> {
|
|
82
|
+
try {
|
|
83
|
+
const raw = await readStdin();
|
|
84
|
+
if (!raw?.trim()) {
|
|
85
|
+
respond({ permission: 'allow' });
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const payload = JSON.parse(raw.replace(/^\uFEFF/, '').trim()) as HookInput;
|
|
90
|
+
const filePath = payload.file_path;
|
|
91
|
+
|
|
92
|
+
if (!filePath) {
|
|
93
|
+
respond({ permission: 'allow' });
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const blockReason = shouldBlock(filePath);
|
|
98
|
+
|
|
99
|
+
if (blockReason) {
|
|
100
|
+
console.error(`[protect-sensitive] BLOCKED: ${filePath}`);
|
|
101
|
+
respond({
|
|
102
|
+
permission: 'deny',
|
|
103
|
+
user_message: `Acceso bloqueado por hook de seguridad: ${blockReason}`,
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
respond({ permission: 'allow' });
|
|
109
|
+
} catch (err) {
|
|
110
|
+
console.error(
|
|
111
|
+
'[protect-sensitive] Error:',
|
|
112
|
+
err instanceof Error ? err.message : String(err),
|
|
113
|
+
);
|
|
114
|
+
respond({
|
|
115
|
+
permission: 'deny',
|
|
116
|
+
user_message:
|
|
117
|
+
'Hook de proteccion de archivos sensibles fallo. Acceso denegado por seguridad (fail-closed).',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
main();
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
interface HookInput {
|
|
4
|
+
session_id?: string;
|
|
5
|
+
is_background_agent?: boolean;
|
|
6
|
+
composer_mode?: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface HookOutput {
|
|
11
|
+
env?: Record<string, string>;
|
|
12
|
+
additional_context?: string;
|
|
13
|
+
continue: boolean;
|
|
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: HookOutput): void {
|
|
29
|
+
process.stdout.write(JSON.stringify(output) + '\n');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function safeExec(command: string): string {
|
|
33
|
+
try {
|
|
34
|
+
return execSync(command, {
|
|
35
|
+
encoding: 'utf8',
|
|
36
|
+
timeout: 5_000,
|
|
37
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
38
|
+
}).trim();
|
|
39
|
+
} catch {
|
|
40
|
+
return 'unknown';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function main(): Promise<void> {
|
|
45
|
+
try {
|
|
46
|
+
const raw = await readStdin();
|
|
47
|
+
if (!raw?.trim()) {
|
|
48
|
+
respond({ continue: true });
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
JSON.parse(raw.replace(/^\uFEFF/, '').trim()) as HookInput;
|
|
53
|
+
|
|
54
|
+
const gitBranch = safeExec('git rev-parse --abbrev-ref HEAD');
|
|
55
|
+
const nodeVersion = safeExec('node --version');
|
|
56
|
+
const pnpmVersion = safeExec('pnpm --version');
|
|
57
|
+
const lastCommit = safeExec('git log -1 --format="%h %s"');
|
|
58
|
+
|
|
59
|
+
const context = [
|
|
60
|
+
'== Contexto del proyecto (inyectado por sessionStart hook) ==',
|
|
61
|
+
'',
|
|
62
|
+
`Stack: NestJS 11 + Fastify 5 + Prisma 7 + SQLite (LibSQL) + JWT`,
|
|
63
|
+
`Branch: ${gitBranch} | Node: ${nodeVersion} | pnpm: ${pnpmVersion}`,
|
|
64
|
+
`Ultimo commit: ${lastCommit}`,
|
|
65
|
+
'',
|
|
66
|
+
'Comandos utiles:',
|
|
67
|
+
' pnpm start:dev - Servidor de desarrollo con hot-reload',
|
|
68
|
+
' pnpm test - Ejecutar tests unitarios (Jest)',
|
|
69
|
+
' pnpm test:e2e - Ejecutar tests E2E',
|
|
70
|
+
' pnpm lint - ESLint con autofix',
|
|
71
|
+
' pnpm format - Prettier en todo el proyecto',
|
|
72
|
+
' pnpm prisma:migrate - Crear y aplicar migracion Prisma',
|
|
73
|
+
' pnpm prisma:generate - Regenerar Prisma Client',
|
|
74
|
+
' pnpm prisma:studio - Abrir Prisma Studio (GUI de BD)',
|
|
75
|
+
' pnpm prisma:seed - Ejecutar seed de datos',
|
|
76
|
+
'',
|
|
77
|
+
'Convenciones:',
|
|
78
|
+
' - Los archivos .env NO deben leerse (hook de seguridad activo)',
|
|
79
|
+
' - Usar .env.example como referencia de variables de entorno',
|
|
80
|
+
' - Prisma Client se regenera automaticamente al editar schema.prisma',
|
|
81
|
+
' - Prettier formatea automaticamente despues de cada edicion',
|
|
82
|
+
' - Archivos de test en test/unit/ y test/e2e/ (no en src/)',
|
|
83
|
+
].join('\n');
|
|
84
|
+
|
|
85
|
+
console.error(`[session-context] Branch: ${gitBranch}, Node: ${nodeVersion}`);
|
|
86
|
+
|
|
87
|
+
respond({
|
|
88
|
+
env: {
|
|
89
|
+
GIT_BRANCH: gitBranch,
|
|
90
|
+
NODE_VERSION: nodeVersion,
|
|
91
|
+
PNPM_VERSION: pnpmVersion,
|
|
92
|
+
},
|
|
93
|
+
additional_context: context,
|
|
94
|
+
continue: true,
|
|
95
|
+
});
|
|
96
|
+
} catch (err) {
|
|
97
|
+
console.error(
|
|
98
|
+
'[session-context] Error:',
|
|
99
|
+
err instanceof Error ? err.message : String(err),
|
|
100
|
+
);
|
|
101
|
+
respond({ continue: true });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
main();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"afterFileEdit": [
|
|
5
|
+
{ "command": "npx tsx .cursor/hooks/auto-format.ts", "timeout": 15 },
|
|
6
|
+
{ "command": "npx tsx .cursor/hooks/prisma-schema-watcher.ts", "timeout": 15 }
|
|
7
|
+
],
|
|
8
|
+
"beforeReadFile": [
|
|
9
|
+
{ "command": "npx tsx .cursor/hooks/protect-sensitive-files.ts", "timeout": 10 }
|
|
10
|
+
],
|
|
11
|
+
"beforeShellExecution": [
|
|
12
|
+
{ "command": "npx tsx .cursor/hooks/block-dangerous-commands.ts", "timeout": 10 }
|
|
13
|
+
],
|
|
14
|
+
"sessionStart": [
|
|
15
|
+
{ "command": "npx tsx .cursor/hooks/session-context.ts", "timeout": 15 }
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|