Next.js Concept to Project
Generates a complete Next.js (App Router) project from a concept text: pages, reusable components, design tokens, admin panel UI and .env config. Use when the user gives a concept, idea or brief and wants a Next.js website, dashboard or admin panel built from it.
What it does
Generates a complete Next.js (App Router) project from a concept text: pages, reusable components, design tokens, admin panel UI and .env config. Use when the user gives a concept, idea or brief and wants a Next.js website, dashboard or admin panel built from it.
- Category
- nextjswebfrontendadmin-panelui
- Platforms
- any
Permissions summary
Files
Reads files only
Shell
No shell commands
Network
No network
Permissions are declared in the component manifest and compiled into each client's tool list. Components are built for least privilege.
Supported environments
| Client | Support | Installed as |
|---|---|---|
| Claude Code | Native | .claude/skills/<id>/SKILL.md |
| OpenAI Codex | Adapter | .codex/skills/<id>/SKILL.md |
| Cursor | Adapter | .cursor/rules/<id>.mdc |
| VS Code (Copilot) | Adapter | .github/instructions/<id>.instructions.md |
| Generic markdown | Adapter | docs/forgekit/skills/<id>.md |
Claude Code is the native reference. Other clients use adapters, so behaviour is close but not identical. See the compatibility matrix.
Full skill (free preview)
This is a free component, so its complete content is public. It is exactly what gets installed (before client-specific formatting).
name: nextjs-concept-structure description: Takes only a concept (text file, .md, or pasted idea) and automatically generates a complete Next.js (App Router) project with a concept-accurate UI, reusable components, design tokens and clean folder structure. Use this skill whenever the user gives a concept, idea, brief or text file and wants a Next.js website, landing page, portfolio, e-commerce, SaaS, blog or dashboard built from it, or mentions this skill by name, or asks for Next.js structure, reusable components or "concept ke hisaab se UI", even if they never say "skill".
Next.js Concept-to-Project Skill
Input: a concept only (file in /mnt/user-data/uploads/ or pasted text).
Output: a ready Next.js project (real files, zipped) whose pages, components, colors, fonts and tone come from that concept.
The user should not have to specify stack, folders or design. Decide them from the concept using the files in this skill folder:
references/catalog.yaml: component catalog, presets per project type, mood-to-design-token map. Read it before Step 3.tests/scenarios.yaml: example concepts and what a correct result looks like. Use it to self-check.README.md: human documentation (do not load unless asked).
Behaviour rules
- Do not interrogate. If the user gave a concept, start building. Make reasonable assumptions and list them at the end under "Assumptions". Ask a question only if the concept is empty or unreadable.
- If a file is mentioned but nothing is attached, ask them to upload or paste it (one short message).
- Reply in the user's language (Hinglish stays Hinglish). Code, file names and identifiers stay English.
- Every page, component and color must trace back to something in the concept.
Pipeline
Step 1: Read the concept and write the Brief
Extract: project type, audience, goal, mood, required features, content (names, sections, products, copy, data), language of the site (use the language of the concept's copy).
Map project type to a preset in references/catalog.yaml (presets:). If none fits, use default.
Step 2: Pages
Build the route list from the preset plus concept-specific features. Use route groups (marketing), (auth), (dashboard) only when layouts differ.
Step 3: Design tokens
From the concept's mood keywords pick a profile in references/catalog.yaml (moods:). Output:
- CSS variables in
globals.css(background, foreground, primary, secondary, accent, muted, border, radius) - 1-2 fonts via
next/font/google(heading + body) - dark mode only if the concept implies it or the preset enables it
Step 4: Components
Take the preset's component list from references/catalog.yaml, drop what the concept does not need, add what it does. Three levels: ui/, layout/, sections/. Anything used twice becomes a component. Text, links and items live in src/data/, never hardcoded in JSX.
Step 5: Generate the project
Create real files under /home/claude/<project-slug>/, then copy to /mnt/user-data/outputs/<project-slug>/ and also zip it as <project-slug>.zip.
Minimum files to generate:
package.json(next, react, react-dom, typescript, tailwindcss, postcss, autoprefixer, lucide-react, clsx, tailwind-merge; add framer-motion, react-hook-form, zod, recharts, next-themes only when used)tsconfig.json(with@/*alias tosrc/*),next.config.js,tailwind.config.ts,postcss.config.js,.gitignore,.env.example,.env.local(see Environment variables section)src/app/layout.tsx(fonts, metadata, providers),src/app/globals.css(tokens),src/app/page.tsxand every page from Step 2src/app/not-found.tsx,loading.tsx- All components from Step 4, typed props
src/lib/utils.ts(cnhelper),src/lib/env.ts(validated env),src/lib/api.ts(API helper using env URLs),src/data/*.ts(concept content),src/constants/site.tsREADME.mdfor the generated project (install, run, structure)
If the concept needs a database or auth, scaffold only the structure and placeholders (e.g. src/lib/db.ts, .env.example keys) and say what remains to be wired.
Step 6: Verify
Run in the container when possible:
cd /home/claude/<project-slug> && npm install && npm run build
If network blocks install, say so, skip the build, and still deliver the files. Fix TypeScript or build errors before delivering. Then run the checklist below.
Step 7: Deliver
Call present_files on the zip (and optionally the project README). In the chat reply, give only:
- Concept Brief (3-5 lines)
- Pages list
- Design choices (palette, fonts, mood)
- Folder tree (trimmed)
- How to run (
npm install,npm run dev) - Assumptions and what is not built yet
Keep it short; the files carry the detail.
Admin UI rules (mandatory when the preset is admin or dashboard)
Trigger words: admin, admin panel, dashboard, back office, management system, CRM, CMS, inventory, "panel", any concept whose users are staff managing data. Use preset admin (full panel) unless the concept is only a read-only analytics page (then dashboard). Read admin_layout and moods.admin_clean in references/catalog.yaml.
1. Shell and navigation
- One
AdminShellinapp/(admin)/layout.tsx: fixedAdminSidebar+Topbar+ scrollable content area. Login pages sit outside this group, without the shell. - Sidebar: logo/brand at top, grouped items with labels (e.g. Overview, Manage, System), lucide icon + label, active item highlighted, optional count badge, user/role at bottom. Collapsible to icons on tablet; on mobile it becomes a
Sheetdrawer. - Topbar: menu button (mobile), global search (
CommandSearch, Cmd/Ctrl+K),NotificationBell,ThemeToggle,UserMenu(profile, settings, logout). - Every page starts with
PageHeader: breadcrumbs, title, short description, primary action on the right (e.g. "Add member"). - Sidebar items come from
src/constants/navigation.ts, withrolesper item so the menu can be filtered by role.
2. Dashboard page layout (this order)
- Row of 4
KpiCard(value, delta vs previous period with up/down color, optional sparkline) - Main chart (
LineChartCard, with date range switch) spanning 2/3 + side chart (DonutChartCardorBarChartCard) 1/3 - Row with
DataTablePro(recent records) andRecentActivity
- Grid:
grid-cols-1 md:grid-cols-2 xl:grid-cols-4for KPIs,xl:grid-cols-3for chart row. Consistentgap-4. - Charts use
chart_palette, show tooltips, axis labels, and a legend only when there are 2+ series.
3. List (table) pages
FilterBarabove the table: search input, 1-3 filters (status, date range, category), reset button.DataTableProwith: sortable headers, pagination (10/25/50), row selection with bulk actions bar, per-rowDropdownMenu(View, Edit, Delete), sticky header, horizontal scroll on small screens, numeric columns right-aligned, dates formatted withdate-fns, status shown viaStatusBadge, first column as the identifying link (avatar + name + secondary text).- States, all required: loading (Skeleton rows), empty (
EmptyStatewith icon, text, action button), no results for filters (offer "Clear filters"), error (ErrorStatewith retry).
4. CRUD flows
- Create and edit use
EntityForm(react-hook-form + zod). Short forms (up to 6 fields) can open in aSheetfrom the list page; long forms get their own page/{entity}/newand/{entity}/[id]/edit. - Forms: labels above inputs, helper text, inline error messages under fields, required marker, two-column grid on desktop, sticky footer with Cancel and primary Save (disabled with
Spinnerwhile submitting). - Delete always goes through
ConfirmDialog(danger style, names the item being deleted). - Success and failure feedback through
Toast(sonner), neveralert(). - Detail page:
EntityDetailwith header (avatar/title,StatusBadge, actions),Tabs(Overview, related records,ActivityTimeline). - Generate pages for every entity in the concept (minimum 2), driven by a schema object in
src/data/entities/<entity>.ts(fields, labels, column config, zod schema, sample rows) so list, form and detail stay in sync.
5. Visual standards
- Page background =
background, cards/tables/forms =surfacewith 1pxborderand a very soft shadow. Radius from tokens. - Compact density: base text 14px, table row
table_row_height, 8px spacing scale. Never huge hero-style headings inside the panel. - Color is for meaning: primary for main actions and active nav; success/warning/danger/info only for status and deltas. Everything else is neutral.
- Status mapping lives in one helper (
src/lib/status.ts), e.g. active/paid -> success, pending -> warning, overdue/failed -> danger, draft -> neutral. Use it everywhere. - Icons: lucide-react, 16-18px in tables/menus, 20px in nav. Text and icon color contrast at least WCAG AA in both themes.
- Dark mode is required: all tokens defined for light and dark in
globals.css, tables, charts and inputs verified in both.
6. Responsiveness and accessibility
- Mobile: sidebar drawer, tables scroll horizontally inside their card, KPIs stack, forms single column, actions collapse into a
DropdownMenu. - Keyboard: focus-visible rings, Esc closes dialogs/sheets, Tab order logical, Cmd/Ctrl+K opens search.
- Icon-only buttons need
aria-label; tables use<th scope>; form fields use real<label>;StatusBadgehas text, not color alone.
7. Data and scaffolding
- Use realistic sample data in
src/data/that matches the concept's domain (names, amounts in the concept's currency, believable dates), and label it as sample data in the README. - Wrap data access in
src/lib/api.tsfunctions (getMembers,createMember, ...) returning the sample data, so a real API/database can replace them without touching components. - Auth: login page,
middleware.tsthat redirects unauthenticated users (reads a placeholder cookie), role-filtered navigation. Real auth stays scaffold only.
Admin checklist
- AdminShell with sidebar, topbar, breadcrumbs, PageHeader on every admin page
- Dashboard has KPIs, 2 charts, recent table/activity
- Each entity has list, create, edit, detail
- Table has search, filter, sort, pagination, bulk select, row actions
- Loading, empty, no-results and error states exist
- Delete uses ConfirmDialog; feedback uses Toast
- Light and dark themes both checked; mobile drawer works
- Status colors come from one helper; no raw hex in components
Environment variables (.env) — mandatory for every project
All URLs and configuration live in .env, never hardcoded in components, pages or helpers. Read the env: section of references/catalog.yaml for the variable list per preset.
Files to generate
.env.example: committed, every variable with a comment and a safe placeholder (no real secrets)..env.local: copy of.env.examplewith working local development defaults (e.g.http://localhost:3000), sonpm run devruns immediately. It must be in.gitignore.src/lib/env.ts: readsprocess.env, validates withzod, exports a typedenvobject. Missing required variables throw a clear error at startup. All code imports from here, neverprocess.envdirectly (exceptnext.config.jsandmiddleware.ts).src/constants/site.ts: buildssiteConfig(name, url, description, social links, contact email) fromenv.
What goes into .env
- URLs: app URL, API base URL, auth callback URL, CDN/storage/image host, payment return URLs, social profile links, support email/phone.
- Secrets (server only, no
NEXT_PUBLIC_prefix):DATABASE_URL,AUTH_SECRET, SMTP credentials, payment secret keys, third-party API keys. - Feature flags / settings: app name, default currency, default locale, page size, session cookie name.
Rules
- Prefix with
NEXT_PUBLIC_only for values that are safe to expose in the browser (URLs, public keys, app name). Secrets never get the prefix and are never imported into client components. - One API helper (
src/lib/api.ts) builds every request fromenv.API_BASE_URL/env.NEXT_PUBLIC_API_URL. Nofetch("http://...")literals anywhere. - Internal links use
next/linkwith relative paths; absolute URLs (sitemap, Open Graph, canonical, emails) are built fromenv.NEXT_PUBLIC_APP_URL. next.config.jsreads the image host from env (images.remotePatterns) when remote images are used.- Sample/placeholder values only; if a variable needs a real value the user must supply (DB, payment keys), say so under Assumptions.
- The generated project README has an "Environment variables" table: name, required?, example, purpose.
- Do not log or print secrets. Do not commit
.env.local.
Example .env.example
# --- App ---
NEXT_PUBLIC_APP_NAME="Gym Admin"
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000/api
# --- Server-only API (used by server components / route handlers) ---
API_BASE_URL=http://localhost:4000
# --- Auth (placeholder, wire up later) ---
AUTH_SECRET=change-me-with-a-long-random-string
AUTH_URL=http://localhost:3000
SESSION_COOKIE_NAME=admin_session
# --- Database ---
DATABASE_URL=postgresql://user:password@localhost:5432/appdb
# --- Contact / social ---
[email protected]
NEXT_PUBLIC_SUPPORT_PHONE=+91-00000-00000
NEXT_PUBLIC_INSTAGRAM_URL=https://instagram.com/yourbrand
# --- Settings ---
NEXT_PUBLIC_DEFAULT_CURRENCY=INR
NEXT_PUBLIC_DEFAULT_PAGE_SIZE=10
Example src/lib/env.ts
import { z } from "zod";
const schema = z.object({
NEXT_PUBLIC_APP_NAME: z.string().min(1),
NEXT_PUBLIC_APP_URL: z.string().url(),
NEXT_PUBLIC_API_URL: z.string().url(),
API_BASE_URL: z.string().url().optional(),
AUTH_SECRET: z.string().min(1).optional(),
DATABASE_URL: z.string().optional(),
NEXT_PUBLIC_SUPPORT_EMAIL: z.string().email().optional(),
NEXT_PUBLIC_DEFAULT_CURRENCY: z.string().default("INR"),
NEXT_PUBLIC_DEFAULT_PAGE_SIZE: z.coerce.number().default(10),
});
export const env = schema.parse({
NEXT_PUBLIC_APP_NAME: process.env.NEXT_PUBLIC_APP_NAME,
NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
API_BASE_URL: process.env.API_BASE_URL,
AUTH_SECRET: process.env.AUTH_SECRET,
DATABASE_URL: process.env.DATABASE_URL,
NEXT_PUBLIC_SUPPORT_EMAIL: process.env.NEXT_PUBLIC_SUPPORT_EMAIL,
NEXT_PUBLIC_DEFAULT_CURRENCY: process.env.NEXT_PUBLIC_DEFAULT_CURRENCY,
NEXT_PUBLIC_DEFAULT_PAGE_SIZE: process.env.NEXT_PUBLIC_DEFAULT_PAGE_SIZE,
});
(Note: NEXT_PUBLIC_* variables must be referenced as literal process.env.NAME so Next.js can inline them; keep each one listed explicitly like above.)
Env checklist
-
.env.exampleand.env.localexist;.env.localis gitignored -
src/lib/env.tsvalidates and exports typedenv - No hardcoded URLs, emails, phone numbers or keys in components/pages
- Secrets have no
NEXT_PUBLIC_prefix - README lists every variable
Coding rules
- App Router, TypeScript, Tailwind. Server Components by default;
"use client"only for state, effects, handlers, browser APIs, kept at the leaves. - Use
next/image,next/link,next/font; alwaysalttext. - Mobile-first responsive classes (
sm:,md:,lg:). No hardcoded colors or magic numbers; use tokens. - One responsibility per component, typed props,
@/imports. metadataexport on each page (title, description, Open Graph).- Accessibility: semantic HTML, labelled inputs, visible focus, keyboard navigation, sufficient contrast.
- No placeholder lorem ipsum if the concept provides copy; if it does not, write short, believable copy in the concept's tone.
- No remote image URLs that may break; use gradients, SVG or
public/placeholders.
Quality checklist
- Every page and component maps to the concept
- Palette, fonts, tone match the concept's mood and audience
- Nothing duplicated that should be a component, hook or helper
- Content separated from UI (
data/,constants/) - URLs and config come from
.envviasrc/lib/env.ts(no hardcoded URLs) -
npm run buildpassed (or skipped with a stated reason) - Responsive, accessible, metadata present
- Zip created and presented
Version and changelog
Latest version 1.0.0. Requires DevBuildKit CLI 1.0.0 or newer.
1.0.0: initial release.