Crea proyectos Next.js con stack configurable (Mantine, Supabase, Zustand)...
Create new Next.js projects with a configurable stack, always using latest stable versions with documentation verification.
Ask user for:
1. Project name (kebab-case)
2. Project description (one line)
3. Target domain (carlosmonti.com / xmontc.xyz / custom / none)
# Check current node version
nvm current
# Search for Next.js recommended Node version
# (use WebSearch to find latest compatibility)
Present options:
Node.js version for this project:
ā Use current (vX.X.X)
ā Use Next.js recommended LTS (vX.X.X)
ā Specify custom version
Generate:
.nvmrc with selected versionpackage.json with "engines": { "node": ">=X.X.X" }Present configurable features:
Core Features (select all that apply):
ā Mantine UI + Tabler Icons
ā Supabase (auth + database)
ā Zustand (state management)
ā Zod (validation)
ā SWR (data fetching)
ā TanStack Query (alternative to SWR)
ā Vercel Analytics + Speed Insights
ā Testing setup (Vitest + Testing Library)
For EACH selected feature, execute this process:
# 1. Get latest version
npm view @mantine/core version
# 2. Search for documentation and breaking changes
# Use WebSearch or Exa to find:
# - Official docs
# - Migration guides
# - Known issues
Present to user:
š¦ @mantine/core
Version: ^7.15.0 (latest stable)
Docs: https://mantine.dev/getting-started
ā ļø Note: v7 requires PostCSS preset (breaking from v6)
Install this version? [Y/n]
IMPORTANT: Do this for EACH dependency before installing. Never batch install without verification.
After features are confirmed, ask about integrations:
Project Integrations (confirm each):
1. GitHub Repository
ā Create private repo on GitHub?
ā Will use: gh repo create {name} --private
2. Vercel Deployment
ā Link to Vercel for auto-deploy?
ā Will use: vercel link
3. Supabase Project (if Supabase selected)
ā Create new Supabase project?
ā Will guide through supabase.com setup
4. CLAUDE.md
ā Generate CLAUDE.md for this project?
ā Will create based on selected stack
Execute in order:
# 1. Create Next.js project
npx create-next-app@latest {project-name} \
--typescript \
--eslint \
--app \
--src-dir \
--import-alias "@/*"
# 2. Navigate to project
cd {project-name}
# 3. Create .nvmrc
echo "{node-version}" > .nvmrc
# 4. Install selected dependencies (with verified versions)
npm install @mantine/core@^{version} @mantine/hooks@^{version} ...
Create preferred folder structure:
src/
āāā app/ # Next.js App Router
ā āāā api/ # API routes
ā āāā (auth)/ # Auth route group
ā āāā (main)/ # Main app routes
āāā components/ # React components
ā āāā ui/ # Base UI components
ā āāā features/ # Feature-specific components
āāā hooks/ # Custom React hooks
āāā lib/ # Core utilities
āāā providers/ # React context providers
āāā stores/ # Zustand stores
āāā types/ # TypeScript types
āāā utils/ # Utility functions
ā āāā supabase/ # Supabase client (if selected)
āāā test/ # Test setup & mocks
āāā mocks/
āāā setup/
Generate based on selections:
// postcss.config.mjs
export default {
plugins: {
'postcss-preset-mantine': {},
'postcss-simple-vars': {
variables: {
'mantine-breakpoint-xs': '36em',
'mantine-breakpoint-sm': '48em',
'mantine-breakpoint-md': '62em',
'mantine-breakpoint-lg': '75em',
'mantine-breakpoint-xl': '88em',
},
},
},
};
// src/utils/supabase/client.ts
// src/utils/supabase/server.ts
// src/utils/supabase/middleware.ts
# .env.example
# Supabase (if selected)
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
# Analytics (if selected)
NEXT_PUBLIC_VERCEL_ANALYTICS_ID=
If user confirmed, generate CLAUDE.md with:
# {Project Name}
{Description}
## Stack
- **Framework**: Next.js {version} (App Router)
- **UI**: Mantine {version}
- **Database**: Supabase
- **State**: Zustand
- **Validation**: Zod
## Commands
```bash
npm run dev # Start development server
npm run build # Production build
npm run test # Run tests
npm run lint # Run ESLint
{Generated structure tree}
### Phase 10: Final Summary
Present summary to user:
ā Project created: {name}
š Location: ~/Projects/github/{name} š§ Node: {version} (via .nvmrc)
š¦ Installed:
š Integrations:
š Next steps:
## Dependencies Reference
When searching for versions, use these as baseline:
| Package | Purpose | Docs URL |
|---------|---------|----------|
| next | Framework | https://nextjs.org/docs |
| @mantine/core | UI Components | https://mantine.dev |
| @mantine/hooks | React Hooks | https://mantine.dev/hooks |
| @tabler/icons-react | Icons | https://tabler.io/icons |
| @supabase/ssr | Supabase SSR | https://supabase.com/docs |
| zustand | State | https://zustand-demo.pmnd.rs |
| zod | Validation | https://zod.dev |
| swr | Data Fetching | https://swr.vercel.app |
| @tanstack/react-query | Data Fetching | https://tanstack.com/query |
| vitest | Testing | https://vitest.dev |
## Error Handling
If any step fails:
1. **npm install fails**: Check Node version, try with `--legacy-peer-deps`
2. **gh repo create fails**: Verify `gh auth status`
3. **vercel link fails**: Run `vercel login` first
4. **Supabase setup fails**: Guide user to manual setup at supabase.com
Always ask user how to proceed on errors, never assume.