vibe-now 1.0.2 → 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/README.md +18 -0
- package/lib/packages.js +23 -7
- package/package.json +1 -1
- package/templates/AGENTS.md.hbs +76 -19
package/README.md
CHANGED
|
@@ -95,6 +95,24 @@ fs.writeFileSync(path.join(projectPath, 'CONFIG.md'), renderedMy);
|
|
|
95
95
|
|
|
96
96
|
---
|
|
97
97
|
|
|
98
|
+
## 🤖 Prompting Examples for AI
|
|
99
|
+
|
|
100
|
+
Since most development on this CLI is done using AI assistants (Cursor, Claude, etc.), here are some proven prompts to extend the tool:
|
|
101
|
+
|
|
102
|
+
### To add a new library:
|
|
103
|
+
> "I want to add `lucide-react` to the UI Helpers category. It should be enabled by default. Add it to the configuration in `lib/packages.js` and suggest a good engineering guidance string for the AGENTS.md file."
|
|
104
|
+
|
|
105
|
+
### To add a new Mutual Exclusive option:
|
|
106
|
+
> "Add a new 'Database Driver' category under Database. It should be a single-choice list between 'Postgres (pg)' and 'SQLite (libsql)'. Map this correctly in the `providerConfig` so it installs the right packages."
|
|
107
|
+
|
|
108
|
+
### To add a new documentation template:
|
|
109
|
+
> "Create a new template `templates/ENVIRONMENT.hbs` that lists required .env variables for the selected packages. Then, update `plopfile.js` to render this as `.env.example` in the project root."
|
|
110
|
+
|
|
111
|
+
### To modify project validation:
|
|
112
|
+
> "Update the project name validation in `plopfile.js` to also check if the name is too long (over 100 characters) and return a custom error message."
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
98
116
|
## 📦 Publishing
|
|
99
117
|
|
|
100
118
|
When you're ready to release a new version:
|
package/lib/packages.js
CHANGED
|
@@ -11,6 +11,7 @@ export const PACKAGE_GROUPS = [
|
|
|
11
11
|
name: 'Zustand',
|
|
12
12
|
install: ['zustand'],
|
|
13
13
|
default: true,
|
|
14
|
+
guidance: 'Use a single store per feature. Prefer selective state extraction (e.g., `useStore(state => state.value)`) to minimize re-renders.',
|
|
14
15
|
},
|
|
15
16
|
],
|
|
16
17
|
},
|
|
@@ -22,6 +23,7 @@ export const PACKAGE_GROUPS = [
|
|
|
22
23
|
name: 'Zod',
|
|
23
24
|
install: ['zod'],
|
|
24
25
|
default: true,
|
|
26
|
+
guidance: 'Use for all schema definitions and runtime validation (especially for Environment Variables and API responses). Keep schemas and types co-located.',
|
|
25
27
|
},
|
|
26
28
|
],
|
|
27
29
|
},
|
|
@@ -33,6 +35,7 @@ export const PACKAGE_GROUPS = [
|
|
|
33
35
|
name: 'TanStack React Query',
|
|
34
36
|
install: ['@tanstack/react-query'],
|
|
35
37
|
default: true,
|
|
38
|
+
guidance: 'Centralize query keys in a `keys.ts` file. Prefer Server Actions for mutations and use `queryClient.invalidateQueries()` for cache invalidation.',
|
|
36
39
|
},
|
|
37
40
|
],
|
|
38
41
|
},
|
|
@@ -41,13 +44,14 @@ export const PACKAGE_GROUPS = [
|
|
|
41
44
|
items: [
|
|
42
45
|
{
|
|
43
46
|
id: 'shadcn',
|
|
44
|
-
name: 'shadcn/ui
|
|
47
|
+
name: 'shadcn/ui',
|
|
45
48
|
install: [],
|
|
46
49
|
commands: [
|
|
47
50
|
['npx', '--yes', 'shadcn@latest', 'init', '-d'],
|
|
48
51
|
['npx', '--yes', 'shadcn@latest', 'add', '--all', '-y'],
|
|
49
52
|
],
|
|
50
53
|
default: true,
|
|
54
|
+
guidance: 'Base components live in `components/ui/`. DO NOT modify them unless absolutely necessary for global design changes. Compose them in `components/` for feature-specific needs.',
|
|
51
55
|
},
|
|
52
56
|
],
|
|
53
57
|
},
|
|
@@ -59,6 +63,7 @@ export const PACKAGE_GROUPS = [
|
|
|
59
63
|
name: 'Better Auth',
|
|
60
64
|
install: ['better-auth'],
|
|
61
65
|
default: false,
|
|
66
|
+
guidance: 'Follow the Next.js App Router patterns. Keep the auth logic secure in Server Actions and use the provided middleware for route protection.',
|
|
62
67
|
},
|
|
63
68
|
],
|
|
64
69
|
},
|
|
@@ -70,13 +75,15 @@ export const PACKAGE_GROUPS = [
|
|
|
70
75
|
name: 'Supabase JS client',
|
|
71
76
|
install: ['@supabase/supabase-js'],
|
|
72
77
|
default: true,
|
|
78
|
+
guidance: 'Use the official Supabase SSR package for Next.js. Keep database queries inside Server Components or Server Actions to avoid exposing the Service Role key.',
|
|
73
79
|
},
|
|
74
80
|
{
|
|
75
81
|
id: 'drizzle',
|
|
76
|
-
name: 'Drizzle ORM
|
|
82
|
+
name: 'Drizzle ORM',
|
|
77
83
|
install: ['drizzle-orm', 'pg'],
|
|
78
84
|
devInstall: ['drizzle-kit'],
|
|
79
85
|
default: true,
|
|
86
|
+
guidance: 'Define schemas in `db/schema.ts`. Use `drizzle-kit` for migrations. Prefer the `db.query.xyz.findMany()` syntax for better type-safety and relations handling.',
|
|
80
87
|
},
|
|
81
88
|
],
|
|
82
89
|
},
|
|
@@ -88,6 +95,7 @@ export const PACKAGE_GROUPS = [
|
|
|
88
95
|
name: 'Resend',
|
|
89
96
|
install: ['resend'],
|
|
90
97
|
default: false,
|
|
98
|
+
guidance: 'Use React Email templates for rich emails. Centralize email logic in a `lib/email.ts` utility.',
|
|
91
99
|
},
|
|
92
100
|
],
|
|
93
101
|
},
|
|
@@ -101,15 +109,16 @@ export const PACKAGE_GROUPS = [
|
|
|
101
109
|
{ name: 'Polar.sh (SDK + Next.js integration)', value: 'polar' },
|
|
102
110
|
],
|
|
103
111
|
default: 'none',
|
|
104
|
-
// Mapping provider value to actual package config
|
|
105
112
|
providerConfig: {
|
|
106
113
|
stripe: {
|
|
107
114
|
name: 'Stripe',
|
|
108
115
|
install: ['stripe', '@stripe/stripe-js', '@stripe/react-stripe-js'],
|
|
116
|
+
guidance: 'Use Stripe webhooks to handle subscription lifecycle. Centralize price IDs in constants.',
|
|
109
117
|
},
|
|
110
118
|
polar: {
|
|
111
119
|
name: 'Polar.sh',
|
|
112
120
|
install: ['@polar-sh/sdk', '@polar-sh/nextjs'],
|
|
121
|
+
guidance: 'Integrate using Polar webhooks. Use the Next.js SDK for seamless integration with App Router.',
|
|
113
122
|
},
|
|
114
123
|
},
|
|
115
124
|
},
|
|
@@ -121,12 +130,14 @@ export const PACKAGE_GROUPS = [
|
|
|
121
130
|
name: 'Vercel AI SDK',
|
|
122
131
|
install: ['ai'],
|
|
123
132
|
default: false,
|
|
133
|
+
guidance: 'Use `streamText` for real-time chat interfaces. Keep LLM configurations in `lib/ai/` and use the UI hooks like `useChat`.',
|
|
124
134
|
},
|
|
125
135
|
{
|
|
126
136
|
id: 'openRouter',
|
|
127
137
|
name: 'OpenRouter AI SDK Provider',
|
|
128
138
|
install: ['@openrouter/ai-sdk-provider'],
|
|
129
139
|
default: false,
|
|
140
|
+
guidance: 'Use OpenRouter as a gateway for multiple models. Configure keys in `.env.local` and use the AI SDK provider pattern.',
|
|
130
141
|
},
|
|
131
142
|
],
|
|
132
143
|
},
|
|
@@ -150,6 +161,7 @@ export const PACKAGE_GROUPS = [
|
|
|
150
161
|
'eslint-config-prettier',
|
|
151
162
|
'eslint-plugin-prettier'
|
|
152
163
|
],
|
|
164
|
+
guidance: 'Standard Next.js linting combined with Prettier. Ensure `eslint-config-prettier` is the last item in the extends array.',
|
|
153
165
|
},
|
|
154
166
|
biome: {
|
|
155
167
|
name: 'Biome',
|
|
@@ -157,6 +169,7 @@ export const PACKAGE_GROUPS = [
|
|
|
157
169
|
commands: [
|
|
158
170
|
['npx', '--yes', '@biomejs/biome', 'init']
|
|
159
171
|
],
|
|
172
|
+
guidance: 'Consolidated linting and formatting. Run `npx @biomejs/biome check --apply .` before commits.',
|
|
160
173
|
},
|
|
161
174
|
},
|
|
162
175
|
},
|
|
@@ -165,31 +178,34 @@ export const PACKAGE_GROUPS = [
|
|
|
165
178
|
items: [
|
|
166
179
|
{
|
|
167
180
|
id: 'nuqs',
|
|
168
|
-
name: 'nuqs
|
|
181
|
+
name: 'nuqs',
|
|
169
182
|
install: ['nuqs'],
|
|
170
183
|
default: false,
|
|
184
|
+
guidance: 'Manage URL search parameters as state. Use the `parseAs...` helpers for strict type-casting.',
|
|
171
185
|
},
|
|
172
186
|
{
|
|
173
187
|
id: 'hookForm',
|
|
174
188
|
name: 'React Hook Form',
|
|
175
189
|
install: ['react-hook-form'],
|
|
176
190
|
default: true,
|
|
191
|
+
guidance: 'Always pair with `@hookform/resolvers/zod` for validation. Keep form components uncontrolled for maximum performance.',
|
|
177
192
|
},
|
|
178
193
|
{
|
|
179
194
|
id: 'dayjs',
|
|
180
|
-
name: 'Day.js
|
|
195
|
+
name: 'Day.js',
|
|
181
196
|
install: ['dayjs'],
|
|
182
197
|
default: false,
|
|
198
|
+
guidance: 'Lightweight date library. Use plugins (e.g., `relativeTime`) only when needed to keep the bundle small.',
|
|
183
199
|
},
|
|
184
200
|
{
|
|
185
201
|
id: 'lodash',
|
|
186
|
-
name: 'Lodash
|
|
202
|
+
name: 'Lodash',
|
|
187
203
|
install: ['lodash'],
|
|
188
204
|
default: false,
|
|
205
|
+
guidance: 'Import only the specific functions you need (e.g., `import debounce from "lodash/debounce"`) to avoid bundle bloat.',
|
|
189
206
|
},
|
|
190
207
|
],
|
|
191
208
|
},
|
|
192
209
|
];
|
|
193
210
|
|
|
194
|
-
// Helper to get a flat list of all potential packages for the prompt validation or internal logic if needed
|
|
195
211
|
export const ALL_ITEMS = PACKAGE_GROUPS.flatMap(group => group.items || []);
|
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)
|
|
@@ -9,37 +9,94 @@ high-quality engineering standards.
|
|
|
9
9
|
- **Styling**: Tailwind CSS (Utility-first)
|
|
10
10
|
- **Components**: shadcn/ui (Radix UI primitives)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## 📁 Directory Structure
|
|
13
|
+
```text
|
|
14
|
+
.
|
|
15
|
+
├── app/ # Next.js App Router (Pages, Layouts, API)
|
|
16
|
+
│ ├── api/ # Route Handlers
|
|
17
|
+
│ ├── (auth)/ # Grouped Auth routes
|
|
18
|
+
│ ├── globals.css # Global styles & Tailwind directives
|
|
19
|
+
│ └── layout.tsx # Root layout
|
|
20
|
+
├── components/ # React Components
|
|
21
|
+
│ ├── ui/ # shadcn/ui primitives (do not edit manually)
|
|
22
|
+
│ └── shared/ # Reusable feature components
|
|
23
|
+
├── hooks/ # Custom React Hooks (prefixed with use)
|
|
24
|
+
├── lib/ # Shared utilities & configurations
|
|
25
|
+
│ ├── utils.ts # Tailwind merge & clsx helper (cn() utility)
|
|
26
|
+
│ └── constants.ts # Global constants & env-validated config
|
|
27
|
+
├── db/ # Database schema & migrations
|
|
28
|
+
│ ├── schema.ts # Drizzle/Prisma schema definitions
|
|
29
|
+
│ └── migrations/ # SQL migration files
|
|
30
|
+
├── public/ # Static assets (images, fonts, etc.)
|
|
31
|
+
├── scripts/ # Helper scripts (DB seeds, etc.)
|
|
32
|
+
├── types/ # Global TypeScript interfaces
|
|
33
|
+
└── AGENTS.md # This reference file
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 🎨 Design Principles
|
|
37
|
+
- **Responsive Design**: Mobile-first approach using Tailwind's responsive prefixes (`sm:`, `md:`, `lg:`).
|
|
38
|
+
- **Minimal Aesthetic**: Clean, spacious layouts with high contrast and premium typography (Inter/Geist).
|
|
39
|
+
- **Dark Mode Support**: Use `dark:` variants for all colors. Ensure every component is legible in both themes.
|
|
40
|
+
- **Component-Driven**: Prioritize shadcn components. Use `cn()` for merging classes.
|
|
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}`.
|
|
43
|
+
|
|
44
|
+
## 🔤 Naming Conventions
|
|
45
|
+
- **Files & Directories**: use `kebab-case` (e.g., `user-profile-card.tsx`).
|
|
46
|
+
- **Components**: Export as named functions with `PascalCase` (e.g., `export function UserCard()`).
|
|
47
|
+
- **Variables & Functions**: Use `camelCase` (e.g., `const userData = ...`).
|
|
48
|
+
- **Constants**: Use `SCREAMING_SNAKE_CASE` (e.g., `const API_RETRY_LIMIT = 3`).
|
|
49
|
+
- **Descriptive Names**: Favor clarity over brevity (e.g., `isUserAuthenticated` instead of `isAuth`).
|
|
50
|
+
|
|
51
|
+
## 🛠️ Tech Stack Consistency & Guidance
|
|
13
52
|
{{#each selectedPackages}}
|
|
14
|
-
- **{{this.name}}**: Use standard patterns as defined in official
|
|
53
|
+
- **{{this.name}}**: {{#if this.guidance}}{{this.guidance}}{{else}}Use standard patterns as defined in official
|
|
54
|
+
documentation.{{/if}}
|
|
15
55
|
{{/each}}
|
|
16
56
|
|
|
17
57
|
## 🤖 AI Coding Rules
|
|
18
58
|
|
|
19
59
|
### 1. General Principles
|
|
20
|
-
- **Conciseness**: Write clean, modular code.
|
|
21
|
-
- **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.
|
|
22
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.
|
|
23
66
|
|
|
24
67
|
### 2. Component Standards
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
-
|
|
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.
|
|
29
75
|
|
|
30
76
|
### 3. State & Data
|
|
31
77
|
- **Server State**: Use TanStack React Query or Server Actions.
|
|
32
|
-
- **Client State**: Use Zustand for global state only if necessary.
|
|
33
|
-
- **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.
|
|
34
81
|
|
|
35
|
-
### 4.
|
|
36
|
-
-
|
|
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 `
|
|
37
89
|
<Image />` for optimized assets.
|
|
38
|
-
- Ensure proper semantic HTML and ARIA labels.
|
|
39
|
-
- 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`.
|
|
40
98
|
|
|
41
99
|
## 📝 Best Practices
|
|
42
|
-
-
|
|
43
|
-
- Keep business logic separate from UI logic where possible.
|
|
44
|
-
-
|
|
45
|
-
- 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.
|