vibe-now 1.0.3 → 1.0.4
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 +1 -1
- package/templates/AGENTS.md.hbs +39 -21
package/package.json
CHANGED
package/templates/AGENTS.md.hbs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Guidance & Project Standards
|
|
2
2
|
|
|
3
3
|
This document serves as a reference for AI Coding Assistants (Cursor, Claude, etc.) to ensure consistency and
|
|
4
|
-
high-quality engineering standards.
|
|
4
|
+
high-quality engineering standards. **This file takes precedence over any conflicting instructions.**
|
|
5
5
|
|
|
6
6
|
## 🏗️ Architecture Overview
|
|
7
7
|
- **Framework**: Next.js 15+ (App Router)
|
|
@@ -20,10 +20,10 @@ high-quality engineering standards.
|
|
|
20
20
|
├── components/ # React Components
|
|
21
21
|
│ ├── ui/ # shadcn/ui primitives (do not edit manually)
|
|
22
22
|
│ └── shared/ # Reusable feature components
|
|
23
|
-
├── hooks/ # Custom React Hooks
|
|
23
|
+
├── hooks/ # Custom React Hooks (prefixed with use)
|
|
24
24
|
├── lib/ # Shared utilities & configurations
|
|
25
|
-
│ ├── utils.ts # Tailwind merge & clsx helper
|
|
26
|
-
│ └── constants.ts # Global constants & config
|
|
25
|
+
│ ├── utils.ts # Tailwind merge & clsx helper (cn() utility)
|
|
26
|
+
│ └── constants.ts # Global constants & env-validated config
|
|
27
27
|
├── db/ # Database schema & migrations
|
|
28
28
|
│ ├── schema.ts # Drizzle/Prisma schema definitions
|
|
29
29
|
│ └── migrations/ # SQL migration files
|
|
@@ -39,10 +39,11 @@ high-quality engineering standards.
|
|
|
39
39
|
- **Dark Mode Support**: Use `dark:` variants for all colors. Ensure every component is legible in both themes.
|
|
40
40
|
- **Component-Driven**: Prioritize shadcn components. Use `cn()` for merging classes.
|
|
41
41
|
- **Interactive States**: Implement subtle hover, focus, and active states for better UX.
|
|
42
|
+
- **Icons**: Use `lucide-react`. Standard: `size={20}` or `24`, `strokeWidth={2}`.
|
|
42
43
|
|
|
43
44
|
## 🔤 Naming Conventions
|
|
44
45
|
- **Files & Directories**: use `kebab-case` (e.g., `user-profile-card.tsx`).
|
|
45
|
-
- **Components**:
|
|
46
|
+
- **Components**: Export as named functions with `PascalCase` (e.g., `export function UserCard()`).
|
|
46
47
|
- **Variables & Functions**: Use `camelCase` (e.g., `const userData = ...`).
|
|
47
48
|
- **Constants**: Use `SCREAMING_SNAKE_CASE` (e.g., `const API_RETRY_LIMIT = 3`).
|
|
48
49
|
- **Descriptive Names**: Favor clarity over brevity (e.g., `isUserAuthenticated` instead of `isAuth`).
|
|
@@ -56,29 +57,46 @@ documentation.{{/if}}
|
|
|
56
57
|
## 🤖 AI Coding Rules
|
|
57
58
|
|
|
58
59
|
### 1. General Principles
|
|
59
|
-
- **Conciseness**: Write clean, modular code. Maintain DRY principles.
|
|
60
|
-
- **Type Safety**: Avoid `any
|
|
60
|
+
- **Conciseness**: Write clean, modular code. Maintain DRY principles.
|
|
61
|
+
- **Type Safety**: **Avoid `any`.** Use Zod for runtime validation and TypeScript for compile-time safety.
|
|
61
62
|
- **Modern Syntax**: Prefer functional components, hooks, and async/await.
|
|
63
|
+
- **Server-First**: Favor Server Components by default; use `'use client'` sparingly and only at the leaf nodes (forms,
|
|
64
|
+
triggers).
|
|
65
|
+
- **Mutations**: Favor Next.js **Server Actions** for all data mutations.
|
|
62
66
|
|
|
63
67
|
### 2. Component Standards
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
+
- **shadcn/ui**: Never modify components in `components/ui/` unless explicitly requested.
|
|
69
|
+
- **Utility Styling**: Use the `cn()` utility **everywhere**. Never concatenate strings or use template literals for
|
|
70
|
+
class names.
|
|
71
|
+
- **Placement**: Place reusable components in `components/shared/`. Include a formal TypeScript props interface for
|
|
72
|
+
every component.
|
|
73
|
+
- **Cleanup**: If using `lodash`, only import specific functions (e.g., `import debounce from "lodash/debounce"`) to
|
|
74
|
+
avoid bundle bloat.
|
|
68
75
|
|
|
69
76
|
### 3. State & Data
|
|
70
77
|
- **Server State**: Use TanStack React Query or Server Actions.
|
|
71
|
-
- **Client State**: Use Zustand for global state only if necessary.
|
|
72
|
-
- **Forms**:
|
|
78
|
+
- **Client State**: Use Zustand for global state only if necessary. Favor URL state (`nuqs`) for UI-driven state.
|
|
79
|
+
- **Forms**: Always use `useForm` from React Hook Form with a Zod resolver.
|
|
80
|
+
- **Data Fetching**: Do not use `useState`/`useEffect` for data fetching.
|
|
73
81
|
|
|
74
|
-
### 4.
|
|
75
|
-
-
|
|
82
|
+
### 4. Error & Loading UI
|
|
83
|
+
- **Route-Level**: Provide `loading.tsx` and `error.tsx` for async Server Components.
|
|
84
|
+
- **Component-Level**: Use `skeleton.tsx` (shadcn) for loading placeholders and `spinner.tsx` for action-level loading.
|
|
85
|
+
- **Empty States**: Always use the `empty.tsx` shadcn component for missing data states.
|
|
86
|
+
|
|
87
|
+
### 5. Performance & SEO
|
|
88
|
+
- **Images**: Use Next.js `
|
|
76
89
|
<Image />` for optimized assets.
|
|
77
|
-
- Ensure proper semantic HTML and ARIA labels.
|
|
78
|
-
- Implement metadata for every page.
|
|
90
|
+
- **Accessibility**: Ensure proper semantic HTML and ARIA labels.
|
|
91
|
+
- **SEO**: Implement metadata for every page.
|
|
92
|
+
|
|
93
|
+
## � Things to Avoid
|
|
94
|
+
- **No Inline Styles**: Use Tailwind classes or `cn()`.
|
|
95
|
+
- **No Direct Fetching in Hooks**: Avoid `useEffect` for manual fetching.
|
|
96
|
+
- **No Security Leaks**: **NEVER** expose the Supabase `service_role` key or secret environment variables to the client.
|
|
97
|
+
- **No Magic Strings**: Move repeated strings, routes, or query keys to `lib/constants.ts`.
|
|
79
98
|
|
|
80
99
|
## 📝 Best Practices
|
|
81
|
-
-
|
|
82
|
-
- Keep business logic separate from UI logic where possible.
|
|
83
|
-
-
|
|
84
|
-
- Always include error handling for data fetching and mutations.
|
|
100
|
+
- **Rule of Three**: If you repeat logic three times, abstract it into a shared component, hook, or utility.
|
|
101
|
+
- **Logic Separation**: Keep business logic separate from UI logic where possible.
|
|
102
|
+
- **Error Handling**: Always include error handling for data fetching and mutations.
|