agentleFS
bkjain655bkjain655/agent-skills/skills/nextjs-ui-foundation/SKILL.md

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

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
  1. Very specific:

    Use at project start or when adding branding/SEO.

    line 14
  2. Very specific:

    Remove legacy favicon.ico if adding SVG icons to avoid conflicts.

    line 59
  3. Very specific:

    Use semantic names (brand, accent, muted) not raw hex in components.

    line 95
  4. Very specific:

    Keep marketing and app layouts separate ((marketing)/layout.tsx, (app)/layout.tsx) when styles diverge.

    line 105
  5. Very specific:

    Use loading.tsx / error.tsx per route group when UX matters

    line 114
  6. Very specific:

    Prefer next/image for photos.

    line 115
  7. Very specific:

    Add skip link + <main id="main"> — see web-accessibility-wcag

    line 117

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

FilePurpose
src/app/icon.svgBrowser tab favicon (SVG preferred)
src/app/apple-icon.svgiOS home screen
src/app/opengraph-image.tsxOptional 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

RouteTypical use
/Marketing homepage
/app or /dashboardAuthenticated app shell
/onboarding or /wizardMulti-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.tsx per route group when UX matters
  • Prefer next/image for photos; SVG icons via lucide-react
  • Set metadataBase + NEXT_PUBLIC_SITE_URL when deploying (OG/sitemap) — see nextjs-seo-metadata
  • Add skip link + <main id="main"> — see web-accessibility-wcag

Related skills

  • nextjs-app-router — layouts, route handlers, env helpers
  • nextjs-seo-metadata — robots, sitemap, JSON-LD, Open Graph
  • tailwind-css-v4 — @theme tokens and dark mode variants
  • next-themes-dark-mode — ThemeProvider wiring

Anti-patterns

  • Loading fonts via <link> CDN when next/font is available
  • Hardcoding page titles in client components instead of metadata
  • Mixing multiple icon systems (pick lucide + app SVG mark)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.