create-tigra 3.0.5 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +4 -2
  2. package/bin/create-tigra.js +5 -19
  3. package/modules/email-verification/client/hooks/useVerification.ts +3 -3
  4. package/package.json +1 -1
  5. package/template/.agents/skills/security-audit/AI-AND-LLM.md +83 -0
  6. package/template/.agents/skills/security-audit/ATTACK-CLASSES.md +130 -0
  7. package/template/.agents/skills/security-audit/CLIENT-SIDE.md +83 -0
  8. package/template/.agents/skills/security-audit/CLOUD-AND-DEPLOYMENT.md +86 -0
  9. package/template/.agents/skills/security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
  10. package/template/.agents/skills/security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
  11. package/template/.agents/skills/security-audit/HUNTING.md +251 -0
  12. package/template/.agents/skills/security-audit/LICENSE +21 -0
  13. package/template/.agents/skills/security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -0
  14. package/template/.agents/skills/security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
  15. package/template/.agents/skills/security-audit/RECONNAISSANCE.md +156 -0
  16. package/template/.agents/skills/security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
  17. package/template/.agents/skills/security-audit/SKILL.md +192 -0
  18. package/template/.agents/skills/security-audit/SOURCE.md +5 -0
  19. package/template/.agents/skills/security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
  20. package/template/.agents/skills/security-audit/VALIDATION-AND-REPORTING.md +186 -0
  21. package/template/.agents/skills/security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -0
  22. package/template/.agents/skills/security-audit/report-schema.json +461 -0
  23. package/template/.agents/skills/security-audit/validate-coverage-ledger.cjs +872 -0
  24. package/template/.agents/skills/security-audit/validate-coverage-ledger.test.cjs +740 -0
  25. package/template/.agents/skills/security-audit/validate-findings.cjs +773 -0
  26. package/template/.agents/skills/security-audit/validate-findings.test.cjs +652 -0
  27. package/template/AGENTS.md +46 -0
  28. package/template/client/AGENTS.md +23 -0
  29. package/template/client/package-lock.json +410 -324
  30. package/template/client/package.json +3 -3
  31. package/template/client/src/app/(auth)/layout.tsx +9 -0
  32. package/template/client/src/app/(auth)/loading.tsx +7 -0
  33. package/template/client/src/app/(main)/layout.tsx +11 -0
  34. package/template/client/src/app/(main)/loading.tsx +7 -0
  35. package/template/client/src/app/globals.css +4 -0
  36. package/template/client/src/app/layout.tsx +9 -2
  37. package/template/client/src/app/loading.tsx +2 -6
  38. package/template/client/src/app/not-found.tsx +2 -3
  39. package/template/client/src/app/providers.tsx +6 -3
  40. package/template/client/src/components/common/AppLink.tsx +84 -0
  41. package/template/client/src/components/common/EmptyState.tsx +2 -2
  42. package/template/client/src/components/common/Pagination.tsx +3 -2
  43. package/template/client/src/components/common/RouteLoadingShell.tsx +21 -0
  44. package/template/client/src/components/common/SmoothNavigationProvider.tsx +151 -0
  45. package/template/client/src/components/layout/Header.tsx +12 -12
  46. package/template/client/src/features/admin/hooks/useAdminSessions.ts +2 -2
  47. package/template/client/src/features/admin/hooks/useAdminUsers.ts +3 -3
  48. package/template/client/src/features/auth/components/AuthInitializer.tsx +3 -2
  49. package/template/client/src/features/auth/components/LoginForm.tsx +3 -3
  50. package/template/client/src/features/auth/components/RegisterForm.tsx +3 -3
  51. package/template/client/src/features/auth/hooks/useAuth.ts +2 -2
  52. package/template/client/src/features/auth/hooks/usePasswordReset.ts +2 -2
  53. package/template/client/src/hooks/useAppRouter.ts +40 -0
  54. package/template/client/src/styles/fonts/inter-jetbrains.css +4 -2
  55. package/template/client/src/styles/themes/default.css +1 -1
  56. package/template/gitignore +0 -6
  57. package/template/server/AGENTS.md +28 -0
  58. package/template/server/package-lock.json +671 -522
  59. package/template/server/package.json +8 -8
  60. package/template/_claude/QUICK_REFERENCE.md +0 -193
  61. package/template/_claude/README.md +0 -53
  62. package/template/_claude/commands/create-client.md +0 -878
  63. package/template/_claude/commands/create-server.md +0 -388
  64. package/template/_claude/hooks/restrict-paths.sh +0 -51
  65. package/template/_claude/rules/client/01-project-structure.md +0 -147
  66. package/template/_claude/rules/client/02-components-and-types.md +0 -146
  67. package/template/_claude/rules/client/03-data-and-state.md +0 -195
  68. package/template/_claude/rules/client/04-design-system.md +0 -408
  69. package/template/_claude/rules/client/05-security.md +0 -55
  70. package/template/_claude/rules/client/06-ux-checklist.md +0 -111
  71. package/template/_claude/rules/client/07-deployment.md +0 -99
  72. package/template/_claude/rules/client/08-lockfile-cross-platform.md +0 -79
  73. package/template/_claude/rules/client/core.md +0 -46
  74. package/template/_claude/rules/global/completion-reports.md +0 -178
  75. package/template/_claude/rules/global/core.md +0 -104
  76. package/template/_claude/rules/global/investigation-before-conclusions.md +0 -57
  77. package/template/_claude/rules/server/core.md +0 -52
  78. package/template/_claude/rules/server/database.md +0 -124
  79. package/template/_claude/rules/server/deployment.md +0 -78
  80. package/template/_claude/rules/server/project-conventions.md +0 -254
  81. package/template/_claude/rules/server/response-handling.md +0 -144
  82. package/template/_claude/settings.json +0 -15
  83. package/template/_claude/skills/clean-ui/SKILL.md +0 -63
  84. package/template/_claude/skills/role/SKILL.md +0 -39
  85. package/template/_claude/skills/theme/SKILL.md +0 -109
@@ -39,20 +39,20 @@
39
39
  "@fastify/jwt": "^10.1.0",
40
40
  "@fastify/multipart": "^9.0.2",
41
41
  "@fastify/rate-limit": "^10.3.0",
42
- "@fastify/static": "^9.1.3",
42
+ "@fastify/static": "^10.1.4",
43
43
  "@prisma/client": "^6.19.3",
44
44
  "@sentry/node": "^10.62.0",
45
45
  "argon2": "^0.44.0",
46
- "axios": "^1.17.0",
46
+ "axios": "^1.20.0",
47
47
  "dotenv": "^16.4.7",
48
- "fastify": "^5.8.5",
48
+ "fastify": "^5.12.5",
49
49
  "fastify-type-provider-zod": "^6.1.0",
50
50
  "ioredis": "^5.9.2",
51
51
  "pino": "^10.3.1",
52
52
  "pino-pretty": "^13.1.3",
53
53
  "resend": "^6.9.4",
54
- "sharp": "^0.33.5",
55
- "uuid": "^10.0.0",
54
+ "sharp": "^0.35.4",
55
+ "uuid": "^14.0.2",
56
56
  "zod": "^4.3.6"
57
57
  },
58
58
  "overrides": {
@@ -68,8 +68,8 @@
68
68
  "@testcontainers/redis": "^12.0.3",
69
69
  "@types/node": "^20.17.10",
70
70
  "@types/uuid": "^10.0.0",
71
- "@vitest/coverage-v8": "^4.0.18",
72
- "@vitest/ui": "^4.0.18",
71
+ "@vitest/coverage-v8": "^4.1.11",
72
+ "@vitest/ui": "^4.1.11",
73
73
  "eslint": "^10.0.1",
74
74
  "prisma": "^6.19.3",
75
75
  "testcontainers": "^12.0.3",
@@ -77,6 +77,6 @@
77
77
  "tsx": "^4.21.0",
78
78
  "typescript": "^5.9.3",
79
79
  "typescript-eslint": "^8.55.0",
80
- "vitest": "^4.0.18"
80
+ "vitest": "^4.1.11"
81
81
  }
82
82
  }
@@ -1,193 +0,0 @@
1
- # Quick Reference for AI Assistants
2
-
3
- **Read this first, then dive into specific rule files as needed.**
4
-
5
- ---
6
-
7
- If project is empty start server/client commands (`/create-server`, `/create-client`)
8
-
9
- ## How Rules Are Organized
10
-
11
- Rules are scoped by directory:
12
-
13
- | Scope | Path | Applies To |
14
- |-------|------|------------|
15
- | **Global** | `.claude/rules/global/` | Entire workspace (server + client) |
16
- | **Server** | `.claude/rules/server/` | Backend (Fastify API server) only |
17
- | **Client** | `.claude/rules/client/` | Frontend (Next.js App Router) only |
18
-
19
- Always check which scope you're working in before writing code.
20
-
21
- ---
22
-
23
- ## Global Rules (Always Apply)
24
-
25
- ### Safe Editing
26
- - Keep changes **small and focused**
27
- - Preserve existing function signatures and exports unless explicitly asked
28
- - Extend modules, don't rewrite
29
- - Add `// TODO:` comments for ambiguities or follow-ups
30
- - Never leave half-implemented features without explanation
31
- - No noisy debug logs; mark temporary ones with `// TODO: remove debug log`
32
- - Never delete or radically restructure large parts of the codebase
33
- - Preserve existing behavior for critical flows (auth, payments, core business logic)
34
-
35
- See: `global/core.md`
36
-
37
- ---
38
-
39
- ## Server Rules Summary
40
-
41
- ### Architecture
42
- ```
43
- Request -> Routes -> Controller -> Service -> Repository -> Database
44
- ```
45
-
46
- - **Controllers**: Validate input (Zod), call services, return responses, throw typed errors. NO business logic, NO direct DB access.
47
- - **Services**: All business logic. Throw typed `AppError` instances. NO HTTP concepts (request/reply). Return data or throw.
48
- - **Repositories**: Database queries only.
49
-
50
- ### Module Structure
51
- ```
52
- src/modules/<domain>/
53
- <domain>.routes.ts
54
- <domain>.controller.ts
55
- <domain>.service.ts
56
- <domain>.repo.ts
57
- <domain>.schemas.ts
58
- <domain>.types.ts (optional)
59
- ```
60
-
61
- ### API Response Format (Mandatory)
62
- ```json
63
- // Success
64
- { "success": true, "message": "...", "data": { ... } }
65
-
66
- // Error
67
- { "success": false, "error": { "code": "ERROR_CODE", "message": "..." } }
68
- ```
69
- - Use `successResponse()` / `paginatedResponse()` helpers
70
- - Throw typed errors only (`AppError` subclasses)
71
- - Global error handler formats all errors
72
-
73
- ### Auth Architecture
74
- - **httpOnly cookies** for token storage (access_token + refresh_token)
75
- - Account lockout with progressive thresholds
76
- - Session tracking with device info and IP
77
- - Transparent password rehash (bcrypt legacy -> argon2id)
78
-
79
- ### Database
80
- - Schema changes via Prisma migrations only
81
- - Development: `prisma:reset` freely; Production: `prisma:migrate deploy` only
82
- - Prisma models: `PascalCase`; Fields: `camelCase`
83
- - All main tables need: `id`, `createdAt`, `updatedAt`
84
-
85
- ### Code Style
86
- - TypeScript strict mode, type all params and returns
87
- - `async/await` over `.then()`
88
- - Named exports (exception: `app.ts` default-exports `buildApp`)
89
- - Use `logger` from `src/libs/`, never `console.log`
90
- - Detect package manager from lockfile
91
-
92
- See: `server/core.md`, `server/project-conventions.md`, `server/response-handling.md`, `server/database.md`
93
-
94
- ---
95
-
96
- ## Client Rules Summary
97
-
98
- ### Architecture
99
- - Next.js App Router with Server Components by default
100
- - Client Components only when interactivity is needed (`'use client'`)
101
- - Feature modules under `src/features/<domain>/`
102
-
103
- ### Auth Flow
104
- - **httpOnly cookies** — no tokens stored in Redux or localStorage
105
- - `AuthInitializer` component hydrates user state on page load via `getMe()` API call
106
- - Redux auth state: `{ user, isAuthenticated, isInitializing, isLoggingOut }`
107
- - Axios `withCredentials: true` sends cookies automatically
108
-
109
- ### Module Structure
110
- ```
111
- src/features/<domain>/
112
- components/
113
- hooks/
114
- services/
115
- store/ (Redux, if needed)
116
- types/
117
- actions/ (Server Actions, optional)
118
- ```
119
-
120
- ### State Management
121
- | State Type | Tool |
122
- |------------|------|
123
- | Server data (SSR) | Server Components |
124
- | Server data (client) | React Query |
125
- | Global client state | Redux (auth only) |
126
- | Local state | useState / useReducer |
127
- | URL state | useSearchParams |
128
-
129
- ### Component Rules
130
- - Max 250 lines per component
131
- - Max 5 props (use object if more)
132
- - Max 3 levels of JSX nesting
133
- - Use `cn()` for conditional classes
134
- - Use Next.js `Image` and `Link` components
135
- - Follow import order: React/Next -> third-party -> UI -> local -> hooks -> services -> types -> utils
136
-
137
- ### Styling
138
- - Tailwind CSS v4 only, no inline styles
139
- - OKLCH color space via CSS custom properties
140
- - Use semantic color tokens (e.g., `bg-primary`, `text-foreground`)
141
- - Never hardcode hex/rgb values
142
- - Pair backgrounds with foregrounds for contrast
143
-
144
- ### Forms
145
- - React Hook Form + Zod for complex forms
146
- - Server Actions for simple forms
147
- - Always validate client-side AND server-side
148
-
149
- ### Security
150
- - Never inject raw HTML without sanitization (use DOMPurify)
151
- - Never prefix secrets with `NEXT_PUBLIC_`
152
- - Validate all inputs, sanitize all outputs
153
- - Secure external links with `rel="noopener noreferrer"`
154
-
155
- See: `client/core.md`, `client/01-project-structure.md` through `client/06-ux-checklist.md`
156
-
157
- ---
158
-
159
- ## When Implementing Features
160
-
161
- 1. **Identify scope** - Are you working in server, client, or both?
162
- 2. **Read relevant rules** - Check the scoped rule files for that directory
163
- 3. **Summarize** what needs to be done
164
- 4. **List** files to create/modify
165
- 5. **Provide** complete code for each file
166
- 6. **Mention** migrations, env variables, or dependencies needed
167
- 7. **State assumptions** if unsure
168
-
169
- ---
170
-
171
- ## Full Documentation Index
172
-
173
- ### Global
174
- - `global/core.md` - Safe editing, TypeScript, git, env, testing rules
175
-
176
- ### Server
177
- - `server/core.md` - Index and non-negotiables
178
- - `server/project-conventions.md` - Stack, folder structure, coding style, Postman
179
- - `server/response-handling.md` - Response contract, error classes
180
- - `server/database.md` - Database standards, migrations, indexing
181
-
182
- ### Client
183
- - `client/core.md` - Architecture and non-negotiables
184
- - `client/01-project-structure.md` - Folder structure, naming, imports, constants
185
- - `client/02-components-and-types.md` - Component rules, TypeScript, API types
186
- - `client/03-data-and-state.md` - State management, React Query, Redux, Axios, forms
187
- - `client/04-design-system.md` - Colors, typography, spacing, motion, dark mode
188
- - `client/05-security.md` - Token storage, env vars, CSP, validation
189
- - `client/06-ux-checklist.md` - Cognitive load, accessibility, performance
190
-
191
- ---
192
-
193
- **Last Updated**: 2026-02-20
@@ -1,53 +0,0 @@
1
- # Claude Assistant Rules
2
-
3
- This directory contains project-specific rules and guidelines for Claude.
4
-
5
- ## Directory Structure
6
-
7
- ```
8
- .claude/
9
- ├── README.md # This file
10
- └── rules/
11
- ├── global/ # Cross-cutting rules (always active)
12
- │ └── core.md # Safe editing, TypeScript, git, env, testing
13
- ├── client/ # Next.js App Router rules
14
- │ ├── core.md # Index — which file to read for what
15
- │ ├── 01-project-structure.md
16
- │ ├── 02-components-and-types.md
17
- │ ├── 03-data-and-state.md
18
- │ ├── 04-design-system.md
19
- │ ├── 05-security.md
20
- │ └── 06-ux-checklist.md
21
- └── server/ # Fastify backend rules
22
- ├── core.md # Index — which file to read for what
23
- ├── project-conventions.md
24
- ├── response-handling.md
25
- └── database.md
26
- ```
27
-
28
- ## For Claude
29
-
30
- - This directory is the source of truth for project rules.
31
- - **Don't read every file upfront.** Start with the relevant `core.md` index and follow it to the file you need.
32
- - `global/core.md` always applies. `client/` and `server/` rules apply based on which directory you're working in.
33
-
34
- ## Key Principles (TL;DR)
35
-
36
- ### Global
37
- - TypeScript strict, no `any`, Zod validation, explicit return types
38
- - Small focused changes, extend don't rewrite, protect critical flows
39
- - Conventional commits, `.env` never committed, tests for non-trivial changes
40
-
41
- ### Server
42
- - **Stack**: Node.js, Fastify, TypeScript, MySQL, Prisma, Redis
43
- - **Architecture**: Routes → Controllers → Services → Repositories → DB
44
- - **API**: All routes prefixed with `/api/v1`
45
- - **Responses**: `successResponse()` / `paginatedResponse()` — no custom shapes
46
- - **Errors**: Only `AppError` subclasses, global error handler formats everything
47
-
48
- ### Client
49
- - **Stack**: Next.js App Router, React Query, Redux (auth only), shadcn/ui, Tailwind
50
- - **Architecture**: Server Components by default, `'use client'` only when needed
51
- - **State**: Server data → Server Components or React Query. Redux → auth only. URL → filters/pagination
52
- - **Design**: Semantic color tokens only, no hardcoded colors, neuro-minimalist aesthetic
53
- - **Components**: Max 250 lines, max 5 props, max 3 JSX nesting levels