create-tigra 2.1.1 → 2.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tigra",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "type": "module",
5
5
  "description": "Create a production-ready full-stack app with Next.js 16 + Fastify 5 + Prisma + Redis",
6
6
  "bin": {
@@ -3,6 +3,9 @@
3
3
  # Claude can always READ any file for full project context.
4
4
  # Only Edit/Write operations are blocked on the other side's directory.
5
5
  #
6
+ # NOTE: settings.json matcher already filters for Edit|Write only,
7
+ # so this script does NOT need to check the tool name.
8
+ #
6
9
  # To switch roles, either:
7
10
  # 1. Edit .developer-role and type: frontend, backend, or fullstack
8
11
  # 2. Use /role command in Claude
@@ -23,32 +26,9 @@ if [ -z "$ROLE" ] || [ "$ROLE" = "fullstack" ]; then
23
26
  exit 0
24
27
  fi
25
28
 
26
- # Read stdin (JSON from Claude Code)
29
+ # Read the full JSON input from Claude Code
27
30
  INPUT=$(cat)
28
31
 
29
- # Extract tool_name from JSON
30
- TOOL_NAME=$(echo "$INPUT" | grep -oP '"tool_name"\s*:\s*"[^"]*"' | head -1 | sed 's/.*:.*"\(.*\)"/\1/')
31
-
32
- # Only block write operations (Edit, Write). Allow Read, Glob, Grep.
33
- if [ "$TOOL_NAME" != "Edit" ] && [ "$TOOL_NAME" != "Write" ]; then
34
- exit 0
35
- fi
36
-
37
- # Extract file_path or path from JSON
38
- FILE_PATH=""
39
- for field in file_path path; do
40
- value=$(echo "$INPUT" | grep -oP "\"${field}\"\s*:\s*\"[^\"]*\"" | head -1 | sed 's/.*:.*"\(.*\)"/\1/')
41
- if [ -n "$value" ]; then
42
- FILE_PATH="$value"
43
- break
44
- fi
45
- done
46
-
47
- # No file path found = allow
48
- if [ -z "$FILE_PATH" ]; then
49
- exit 0
50
- fi
51
-
52
32
  deny_with_reason() {
53
33
  cat <<DENY_EOF
54
34
  {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"$1"}}
@@ -56,12 +36,14 @@ DENY_EOF
56
36
  exit 0
57
37
  }
58
38
 
39
+ # Simple path check against the raw JSON input.
40
+ # No JSON parsing needed — just check if the input contains server/ or client/ paths.
59
41
  if [ "$ROLE" = "frontend" ]; then
60
- if echo "$FILE_PATH" | grep -qiE "(^|/|\\\\)server(/|\\\\|$)"; then
42
+ if echo "$INPUT" | grep -qiE "server[/\\\\]"; then
61
43
  deny_with_reason "BLOCKED: Role is set to frontend. You can read server/ files but cannot modify them. Only the backend developer can edit server/ code."
62
44
  fi
63
45
  elif [ "$ROLE" = "backend" ]; then
64
- if echo "$FILE_PATH" | grep -qiE "(^|/|\\\\)client(/|\\\\|$)"; then
46
+ if echo "$INPUT" | grep -qiE "client[/\\\\]"; then
65
47
  deny_with_reason "BLOCKED: Role is set to backend. You can read client/ files but cannot modify them. Only the frontend developer can edit client/ code."
66
48
  fi
67
49
  fi
@@ -2,9 +2,11 @@
2
2
 
3
3
  # Design System
4
4
 
5
- ## Philosophy: "Neuro-Minimalism"
5
+ ## Philosophy: "Mobile-First Neuro-Minimalism"
6
6
 
7
- Clean, airy, "expensive" look inspired by Linear, Vercel, Stripe, Arc. Every visual decision reduces cognitive load.
7
+ **Mobile is the default. Desktop is the enhancement.** 80%+ of traffic is mobile design for thumbs first, cursors second.
8
+
9
+ Clean, airy, "expensive" look inspired by Linear, Vercel, Stripe, Arc. Every visual decision reduces cognitive load. Every screen must feel like a native app on mobile.
8
10
 
9
11
  ---
10
12
 
@@ -67,6 +69,34 @@ This project uses **Tailwind CSS v4** with **OKLCH color space** and the `@theme
67
69
  - `@custom-variant dark` replaces `darkMode: 'class'`
68
70
  - No `@layer base { :root { } }` — variables defined directly on `:root`
69
71
 
72
+ ---
73
+
74
+ ## Mobile-First Responsive Strategy
75
+
76
+ **All Tailwind utilities are written for mobile first.** `md:` and `lg:` are progressive enhancements, not the other way around.
77
+
78
+ ### Rules
79
+
80
+ 1. **Write mobile styles as the base.** Add `md:` / `lg:` to override for larger screens. Never use `max-*:` breakpoints.
81
+ 2. **Breakpoints**: `sm:` (640px) → `md:` (768px) → `lg:` (1024px) → `xl:` (1280px). Scale UP, never down.
82
+ 3. **Test mobile first** during development. Open DevTools at 375px before checking desktop.
83
+ 4. **Every screen must be fully usable at 375px width.** No horizontal scroll, no truncated actions, no hidden critical UI.
84
+
85
+ ### Viewport & Safe Areas
86
+
87
+ - **Use `dvh` instead of `vh`** for full-height layouts — accounts for mobile browser chrome (URL bar, bottom bar).
88
+ - **Viewport meta**: `<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`.
89
+ - **Respect safe areas** on notched/dynamic island devices:
90
+ - Bottom-fixed elements: add `pb-[env(safe-area-inset-bottom)]`
91
+ - Top-fixed elements: add `pt-[env(safe-area-inset-top)]`
92
+ - **No `100vh` anywhere.** Always `100dvh` or `min-h-dvh`.
93
+
94
+ ### Anti-patterns
95
+
96
+ - Do NOT write desktop-first classes like `w-1/3 max-md:w-full`. Write `w-full md:w-1/3`.
97
+ - Do NOT hide mobile-critical content behind `hidden md:block`. Content strategy must work on mobile first.
98
+ - Do NOT use fixed pixel widths. Use `w-full`, percentage-based, or `max-w-*` utilities.
99
+
70
100
  ## Color Usage
71
101
 
72
102
  | Token | Purpose | Example use |
@@ -109,34 +139,41 @@ This project uses **Tailwind CSS v4** with **OKLCH color space** and the `@theme
109
139
  ## Typography
110
140
 
111
141
  - **Font**: Inter v4 (variable) or Geist Sans via `next/font`.
112
- - **Headings**: `text-wrap: balance`, `leading-tight`. H1: `text-3xl`–`text-4xl`, H2: `text-2xl`.
142
+ - **Headings**: `text-wrap: balance`, `leading-tight`. Mobile-first responsive sizes:
143
+ - H1: `text-2xl md:text-3xl lg:text-4xl`
144
+ - H2: `text-xl md:text-2xl`
145
+ - H3: `text-lg md:text-xl`
113
146
  - **Body**: `text-base`, `leading-relaxed`. Max reading width: `max-w-prose` (~65ch).
114
147
  - **Data/numbers**: Always `tabular-nums` for alignment.
115
148
  - **Captions/meta**: `text-sm text-muted-foreground`.
149
+ - **Mobile readability**: Minimum `text-sm` (14px) for any readable text. Never go below 12px.
116
150
 
117
151
  ---
118
152
 
119
153
  ## Spacing
120
154
 
121
155
  - **Whitespace IS the divider.** Prefer spacing over visible borders/lines.
122
- - **Section gap = 2x internal gap**: `space-y-16` between sections, `space-y-6` within.
156
+ - **Section gap = 2x internal gap**: Mobile: `space-y-10` between sections, `space-y-4` within. Desktop: `space-y-16` between sections, `space-y-6` within.
123
157
  - **Stick to scale**: `4, 6, 8, 12, 16, 20, 24` from Tailwind. Avoid arbitrary values.
124
- - **Container**: `container mx-auto px-4 md:px-6 lg:px-8`.
158
+ - **Container**: `container mx-auto px-4 sm:px-6 lg:px-8` (mobile gets comfortable 16px padding).
125
159
 
126
160
  ---
127
161
 
128
162
  ## Motion & Interactions
129
163
 
130
- Every interactive element MUST have visible `:hover`, `:active`, and `:focus-visible` states.
164
+ Every interactive element MUST have visible `:active` and `:focus-visible` states. `:hover` is a desktop enhancement — never the only feedback.
131
165
 
132
- ### Standard Patterns
166
+ ### Standard Patterns (Mobile-First)
133
167
  ```
134
- Button: transition-all duration-200 ease-out hover:brightness-110 active:scale-[0.98]
135
- Card: transition-all duration-300 ease-out hover:shadow-lg hover:-translate-y-0.5
136
- Link: transition-colors duration-150 hover:text-primary
168
+ Button: transition-all duration-200 ease-out active:scale-[0.97] md:hover:brightness-110
169
+ Card: transition-all duration-300 ease-out active:scale-[0.98] md:hover:shadow-lg md:hover:-translate-y-0.5
170
+ Link: transition-colors duration-150 active:opacity-70 md:hover:text-primary
137
171
  ```
138
172
 
139
173
  ### Rules
174
+ - **`active:` is the primary feedback** on mobile. Tap must feel instant and responsive.
175
+ - **`hover:` is desktop-only** — always prefix with `md:hover:` to avoid sticky hover on touch devices.
176
+ - **No hover-gated functionality**: Anything revealed on hover (tooltips, menus) MUST have a tap/click alternative.
140
177
  - **Transform + opacity only** — never animate layout properties (`width`, `height`, `top`).
141
178
  - **Respect `prefers-reduced-motion`**: Use `motion-safe:` / `motion-reduce:` variants.
142
179
  - **Motion budget**: Max 2-3 animated elements in viewport at once.
@@ -144,6 +181,45 @@ Link: transition-colors duration-150 hover:text-primary
144
181
 
145
182
  ---
146
183
 
184
+ ## Touch & Interaction Design
185
+
186
+ ### Touch Targets
187
+
188
+ - **Minimum size**: 44x44px (`min-h-11 min-w-11`). Recommended: 48x48px (`min-h-12 min-w-12`).
189
+ - **Spacing between targets**: Minimum 8px gap to prevent mis-taps.
190
+ - **Icon-only buttons**: Use `p-2.5` or `p-3` to ensure the tap area is large enough even if the icon is small.
191
+ - **Inline links in text**: Add `py-1` for vertical tap padding without affecting line height visually.
192
+
193
+ ### Thumb Zone Design
194
+
195
+ - **Primary actions in the bottom third** of the screen — thumbs naturally rest there.
196
+ - **Avoid top corners** for critical interactive elements (hardest to reach one-handed).
197
+ - **Sticky bottom CTAs**: Primary action buttons stick to bottom of viewport on mobile: `sticky bottom-0 pb-[env(safe-area-inset-bottom)]`.
198
+ - **FABs (Floating Action Buttons)**: Position `bottom-6 right-4` for primary creation actions.
199
+
200
+ ### Gesture Support
201
+
202
+ - **Swipe-to-dismiss** on bottom sheets and drawers (use Vaul / shadcn Drawer).
203
+ - **Pull-to-refresh** where contextually appropriate (feed pages, lists).
204
+ - **Swipe actions on list items** for quick actions (archive, delete) — use sparingly, always with undo.
205
+ - **Pinch-to-zoom** on images and maps — never disable native zoom.
206
+
207
+ ### Mobile Navigation Patterns
208
+
209
+ | Nav items | Mobile pattern | Desktop pattern |
210
+ |---|---|---|
211
+ | 2-5 core routes | **Bottom tab bar** (sticky, always visible) | Top horizontal nav |
212
+ | 6+ routes | Bottom tab bar (4 items + "More") | Sidebar or top nav with dropdowns |
213
+ | Contextual actions | **Bottom sheet** (Drawer component) | Dropdown menu or popover |
214
+ | Filters/settings | Full-screen sheet or slide-over panel | Side panel or modal |
215
+
216
+ - **Bottom nav is the default** on mobile. Top nav on `md:` and above.
217
+ - **Bottom sheets over modals** for contextual actions on mobile — they're within thumb reach and feel native.
218
+ - **Sticky action bars**: Form submit buttons, checkout CTAs — `sticky bottom-0` on mobile.
219
+ - **No hamburger menus** for ≤5 items. Use bottom tab bar instead.
220
+
221
+ ---
222
+
147
223
  ## Images
148
224
 
149
225
  - **Format priority**: AVIF > WebP > JPEG (Next.js `<Image>` handles this).
@@ -170,10 +246,12 @@ Link: transition-colors duration-150 hover:text-primary
170
246
 
171
247
  ## Component Visual Patterns
172
248
 
173
- - **Cards**: `rounded-xl border border-border/50 bg-card shadow-sm transition-all duration-300 hover:shadow-md hover:-translate-y-0.5`
249
+ - **Cards**: `rounded-xl border border-border/50 bg-card shadow-sm transition-all duration-300 active:scale-[0.98] md:hover:shadow-md md:hover:-translate-y-0.5`
174
250
  - **Empty states**: Centered, muted icon, 2-line text max, one clear CTA.
175
251
  - **Loading**: Skeleton loaders matching content shape. Show immediately, no delay.
176
- - **Modals**: Max `max-w-lg`. Dismissible with Escape + backdrop click. Glassmorphism backdrop.
252
+ - **Modals (desktop)**: Max `max-w-lg`. Dismissible with Escape + backdrop click. Glassmorphism backdrop.
253
+ - **Bottom sheets (mobile)**: Prefer over centered modals on mobile. Use shadcn Drawer (Vaul). Swipe-down to dismiss. Max 70% viewport height for partial sheets. Respect `pb-[env(safe-area-inset-bottom)]`.
254
+ - **Lists**: Full-width on mobile (no horizontal padding on list items — let them bleed to edges for native feel). Add dividers with `border-b border-border/50`.
177
255
 
178
256
  ---
179
257
 
@@ -2,6 +2,19 @@
2
2
 
3
3
  # Neuro-UX Checklist
4
4
 
5
+ ## Mobile-First UX
6
+
7
+ **80%+ of traffic is mobile. Design for thumbs, not cursors. Every screen must feel like a native app.**
8
+
9
+ - Every screen must be fully usable on a 375px viewport. No exceptions.
10
+ - **One-handed reachability**: critical actions in the thumb zone (bottom 60% of screen).
11
+ - **App-like feel**: smooth transitions between views, no full-page flash reloads, instant feedback on every tap.
12
+ - **Content above the fold**: the most important action or information visible without scrolling on mobile.
13
+ - **Reduce input friction**: use native input types (`type="tel"`, `type="email"`, `inputMode="numeric"`), autofill, and smart defaults.
14
+ - **Scroll is natural**: long pages are fine on mobile — vertical scroll is free. Horizontal scroll is forbidden.
15
+
16
+ ---
17
+
5
18
  ## Cognitive Load — Miller's Law
6
19
 
7
20
  - **Max 5-7 interactive elements** per viewport section. Use progressive disclosure (tabs, accordions, "Show more") for more.
@@ -17,38 +30,45 @@
17
30
 
18
31
  | User action | Required feedback | Timing |
19
32
  |---|---|---|
20
- | Click button | Press state (`active:scale-[0.98]`) | Instant |
33
+ | Tap interactive | Press state (`active:scale-[0.97]`) | Instant |
34
+ | Tap button | Press state + ripple or scale | Instant |
21
35
  | Submit form | Loading state on button + disable | Instant |
22
36
  | Successful action | Toast notification | <500ms |
23
37
  | Failed action | Inline error OR toast | <500ms |
24
- | Navigate | Skeleton or page transition | Instant |
25
- | Hover interactive | Color/shadow/scale change | <100ms |
38
+ | Navigate | Skeleton or smooth page transition | Instant |
39
+ | Swipe drawer/sheet | Follow finger + snap or dismiss | Instant |
40
+ | Pull to refresh | Pull indicator + content reload | Instant |
41
+ | Hover interactive (desktop only) | Color/shadow/scale change | <100ms |
26
42
 
27
43
  - **Optimistic UI**: Update UI immediately before server confirms. Revert on error.
28
44
  - **Skeletons over spinners. Always.** Spinners only inside buttons during submission.
45
+ - **Touch feedback is non-negotiable**: Every tappable element must visually respond to touch immediately.
29
46
 
30
- ## Nielsen's 10 Heuristics
47
+ ## Nielsen's 10 Heuristics (Mobile-Adapted)
31
48
 
32
- 1. **System status**: Show loading, toast on completion, inline validation as user types.
33
- 2. **Real-world match**: Human language ("Sign in" not "Authenticate"). Locale-formatted dates/currencies.
34
- 3. **User control**: Every modal dismissible with Escape + backdrop. Undo for destructive actions. Back always works.
35
- 4. **Consistency**: Same action = same button style, position, label everywhere.
36
- 5. **Error prevention**: Real-time validation. Disable submit until valid. Type-appropriate inputs. Confirm destructive actions.
37
- 6. **Recognition > recall**: Visible labels (not placeholder-only). Show recent searches. Visible nav on desktop.
38
- 7. **Flexibility**: Keyboard shortcuts (Cmd+K). Preserve filters in URL. Bulk actions where appropriate.
39
- 8. **Minimalist design**: Every element earns its place. Prefer whitespace over separators.
40
- 9. **Error recovery**: Say what went wrong + how to fix it. Highlight the field. Never clear form on error.
41
- 10. **Help**: Contextual tooltips on complex features. Dismissible onboarding hints.
49
+ 1. **System status**: Show loading, toast on completion, inline validation as user types. On mobile: progress indicators for multi-step flows.
50
+ 2. **Real-world match**: Human language ("Sign in" not "Authenticate"). Locale-formatted dates/currencies. Native input types (`type="email"`, `inputMode="numeric"`).
51
+ 3. **User control**: Swipe gestures for dismiss/back. Bottom sheets dismissible by swipe-down. Every modal dismissible with Escape (desktop) + backdrop + swipe (mobile). Undo for destructive actions. Back always works — preserve scroll position on back navigation.
52
+ 4. **Consistency**: Same action = same button style, position, label everywhere. Bottom nav consistent across all pages on mobile.
53
+ 5. **Error prevention**: Real-time validation. Disable submit until valid. Type-appropriate inputs with correct keyboard (`inputMode`). Confirm destructive actions with bottom sheet confirmation on mobile.
54
+ 6. **Recognition > recall**: Visible labels (not placeholder-only). Show recent searches. Bottom nav on mobile, top nav on desktop.
55
+ 7. **Flexibility**: Keyboard shortcuts (Cmd+K) on desktop. Gesture shortcuts (swipe actions on list items) on mobile. Preserve filters in URL. Bulk actions where appropriate.
56
+ 8. **Minimalist design**: Every element earns its place. Prefer whitespace over separators. On mobile: even more aggressive — reduce to one primary action per screen.
57
+ 9. **Error recovery**: Say what went wrong + how to fix it. Highlight the field. Never clear form on error. On mobile: scroll to the first error field automatically.
58
+ 10. **Help**: Contextual tooltips (tap-to-show on mobile, hover on desktop). Dismissible onboarding hints.
42
59
 
43
60
  ## Performance Targets
44
61
 
45
- | Metric | Target |
46
- |---|---|
47
- | Lighthouse Performance | 98+ |
48
- | Lighthouse Accessibility | 98+ |
49
- | LCP | <2.5s |
50
- | CLS | 0 |
51
- | INP | <200ms |
62
+ | Metric | Mobile Target | Desktop Target |
63
+ |---|---|---|
64
+ | Lighthouse Performance | 90+ | 98+ |
65
+ | Lighthouse Accessibility | 98+ | 98+ |
66
+ | LCP | <2.5s | <2.0s |
67
+ | CLS | 0 | 0 |
68
+ | INP | <150ms | <200ms |
69
+
70
+ - **Test on real mobile devices** or throttled Chrome DevTools (4x CPU slowdown, Fast 3G).
71
+ - **Bundle size matters more on mobile**: lazy-load routes, code-split aggressively, defer non-critical JS.
52
72
 
53
73
  ## Accessibility
54
74
 
@@ -59,6 +79,9 @@
59
79
  - Dynamic content updates: `aria-live="polite"`.
60
80
  - All animations in `motion-safe:` variant.
61
81
  - WCAG AA contrast: 4.5:1 for text, 3:1 for large text/UI.
82
+ - **Touch targets**: min 44x44px, recommended 48x48px. No exceptions.
83
+ - **Spacing between touch targets**: min 8px gap to prevent mis-taps.
84
+ - **No hover-only functionality**: everything accessible via tap on mobile.
62
85
 
63
86
  ## Microcopy
64
87
 
@@ -71,11 +94,18 @@
71
94
 
72
95
  1. Interactive elements per section ≤ 7?
73
96
  2. All elements on grid?
74
- 3. Every button/link has hover + active + focus-visible?
97
+ 3. Every button/link has active + focus-visible? (hover is `md:` only)
75
98
  4. Skeletons for all async content?
76
99
  5. Inline field-level errors on forms?
77
- 6. Every modal dismissible with Escape?
100
+ 6. Every modal/sheet dismissible with Escape (desktop) + swipe (mobile)?
78
101
  7. Tab through all elements in logical order?
79
102
  8. Text passes WCAG AA contrast?
80
103
  9. All animation in `motion-safe:`?
81
104
  10. LCP image has `priority`?
105
+ 11. All touch targets ≥ 44x44px?
106
+ 12. Primary actions in thumb zone (bottom of screen)?
107
+ 13. Bottom sheet used instead of centered modal on mobile?
108
+ 14. Tested on 375px viewport width?
109
+ 15. No hover-only functionality?
110
+ 16. Safe areas respected on fixed/sticky elements?
111
+ 17. Native input types used (`type="email"`, `inputMode="numeric"`, etc.)?
@@ -33,10 +33,11 @@ State: Server data (SSR) → Server Components
33
33
 
34
34
  ## Non-negotiable rules
35
35
 
36
- 1. **Server Components by default.** Only add `'use client'` when you need hooks, state, or event handlers.
37
- 2. **Component limits**: Max 250 lines, max 5 props, max 3 JSX nesting levels.
38
- 3. **No hardcoded colors**: Use Tailwind semantic tokens (`bg-primary`, `text-foreground`). Never hex/rgb.
39
- 4. **No inline styles**: Tailwind only. Use `cn()` for conditional classes.
40
- 5. **Import order**: React/Next third-party UI local → hooks → services → types → utils.
41
- 6. **Forms**: Validate with Zod. Always validate client-side AND server-side.
42
- 7. **Security**: Never inject raw HTML without sanitization. Never prefix secrets with `NEXT_PUBLIC_`.
36
+ 1. **Mobile-first**: All Tailwind classes start at mobile. Desktop is the enhancement (`md:`, `lg:`). Touch targets min 44x44px. No functionality behind hover-only states.
37
+ 2. **Server Components by default.** Only add `'use client'` when you need hooks, state, or event handlers.
38
+ 3. **Component limits**: Max 250 lines, max 5 props, max 3 JSX nesting levels.
39
+ 4. **No hardcoded colors**: Use Tailwind semantic tokens (`bg-primary`, `text-foreground`). Never hex/rgb.
40
+ 5. **No inline styles**: Tailwind only. Use `cn()` for conditional classes.
41
+ 6. **Import order**: React/Next third-party UI local → hooks → services → types → utils.
42
+ 7. **Forms**: Validate with Zod. Always validate client-side AND server-side.
43
+ 8. **Security**: Never inject raw HTML without sanitization. Never prefix secrets with `NEXT_PUBLIC_`.