nextjs-ui-foundation
Skill0 starsChanged 3 months agoMITView on GitHub
Sets up Next.js App Router UI foundations: fonts, favicons, metadata, root layout providers, Tailwind theme tokens, and production polish. Use when bootstrapping a new Next.js webapp, configuring branding, or adding fonts, icons, SEO metadata, and global layout structure.
- Reads credentials
In this repository23 other files it gives its agents.
- client-document-exportSkill
- cloudflare-turnstile-nextjsSkill
- ga4-analytics-nextjsSkill
- git-repo-privacy-auditSkill
- hardened-contact-form-nextjsSkill
- html-semantic-markupSkill
- multi-step-wizard-flowSkill
- nextjs-api-routesSkill
- nextjs-app-routerSkill
- nextjs-seo-metadataSkill
- next-themes-dark-modeSkill
- playwright-e2e-testingSkill
- react-components-patternsSkill
- react-hooks-patternsSkill
- recharts-dashboardSkill
- resend-email-nextjsSkill
- server-pdf-playwrightSkill
- shadcn-ui-setupSkill
- specialized-form-inputsSkill
- tailwind-css-v4Skill
- vitest-unit-testingSkill
- web-accessibility-wcagSkill
- zustand-persist-stateSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Use at project start or when adding branding/SEO.
- Very specific: line 59
Remove legacy favicon.ico if adding SVG icons to avoid conflicts.
- Very specific: line 95
Use semantic names (brand, accent, muted) not raw hex in components.
- Very specific: line 105
Keep marketing and app layouts separate ((marketing)/layout.tsx, (app)/layout.tsx) when styles diverge.
- Very specific: line 114
Use loading.tsx / error.tsx per route group when UX matters
- Very specific: line 115
Prefer next/image for photos.
- Very specific: line 117
Add skip link + <main id="main"> — see web-accessibility-wcag
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Next.js UI Foundation
When to apply
Use at project start or when adding branding/SEO. Pair with shadcn-ui-setup for component library wiring.
Bootstrap checklist
- [ ] Root layout: html lang, font variables, body classes, global providers
- [ ] SkipToMain link as first focusable element in body
- [ ] Metadata export in layout.tsx (title, description, metadataBase in prod)
- [ ] Favicon: app/icon.svg (+ apple-icon.svg for iOS)
- [ ] Tailwind theme tokens in globals.css (@theme)
- [ ] next.config.ts: devIndicators false for clean dev UI
- [ ] .env.example documents NEXT_PUBLIC_* vars (incl. NEXT_PUBLIC_SITE_URL)Fonts (next/font/google)
Pick one sans + optional display/serif. Load in layout, expose CSS variables:
import { Inter, Playfair_Display } from "next/font/google";
const sans = Inter({ variable: "--font-sans", subsets: ["latin"] });
const display = Playfair_Display({ variable: "--font-display", subsets: ["latin"], weight: ["700"] });
// <html className={`${sans.variable} ${display.variable}`}>
// body: font-sans; headings: font-display (via Tailwind)Wire in globals.css:
@theme {
--font-sans: var(--font-sans), system-ui, sans-serif;
--font-display: var(--font-display), Georgia, serif;
}Favicons (App Router file convention)
| File | Purpose |
src/app/icon.svg | Browser tab favicon (SVG preferred) |
src/app/apple-icon.svg | iOS home screen |
src/app/opengraph-image.tsx | Optional OG image (dynamic) |
Remove legacy favicon.ico if adding SVG icons to avoid conflicts.
Design tips: simple mark, 2–3 colors, readable at 16×16.
Root layout pattern
export const metadata: Metadata = {
title: { default: "App Name", template: "%s | App Name" },
description: "One-line value prop.",
};
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className={`${sans.variable} h-full`}>
<body className="min-h-full flex flex-col font-sans antialiased">
{/* TooltipProvider, ThemeProvider, AnalyticsProvider, etc. */}
{children}
</body>
</html>
);
}Theme tokens (Tailwind v4)
Define brand palette once in @theme:
@theme {
--color-brand-50: #f0f4ff;
--color-brand-900: #0f172a;
--color-accent-400: #fbbf24;
}Use semantic names (brand, accent, muted) not raw hex in components.
Route structure defaults
| Route | Typical use |
/ | Marketing homepage |
/app or /dashboard | Authenticated app shell |
/onboarding or /wizard | Multi-step setup flow |
Keep marketing and app layouts separate ((marketing)/layout.tsx, (app)/layout.tsx) when styles diverge.
Production polish
// next.config.ts
const nextConfig = { devIndicators: false };- Use
loading.tsx/error.tsxper route group when UX matters - Prefer
next/imagefor photos; SVG icons vialucide-react - Set
metadataBase+NEXT_PUBLIC_SITE_URLwhen deploying (OG/sitemap) — seenextjs-seo-metadata - Add skip link +
<main id="main">— seeweb-accessibility-wcag
Related skills
nextjs-app-router— layouts, route handlers, env helpersnextjs-seo-metadata— robots, sitemap, JSON-LD, Open Graphtailwind-css-v4— @theme tokens and dark mode variantsnext-themes-dark-mode— ThemeProvider wiring
Anti-patterns
- Loading fonts via
<link>CDN whennext/fontis available - Hardcoding page titles in client components instead of
metadata - Mixing multiple icon systems (pick lucide + app SVG mark)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

