nextjs-app-router
Skill0 starsChanged 3 months agoMITView on GitHub
Next.js App Router patterns: layouts, loading/error boundaries, Server and Client Components, route groups, and env helpers. Use when building or refactoring Next.js 13+ App Router applications.
- Reads credentials
13 other projects use a version of this.
Adopted by
Most recently taken up by
- abdullahqureshi27/TaskCortextheir own version, first seen Nov 8, 2026
- geronco/commandvault-librarytheir own version, first seen Oct 13, 2026
- russolutionconsult/claude-skillstheir own version, first seen Oct 11, 2026
- SkillMedev/vercel-platformtheir own version, first seen Oct 5, 2026
- SkillMedev/full-stack-web-devtheir own version, first seen Oct 5, 2026
- sabahattink/antigravity-fullstack-hqtheir own version, first seen Sep 20, 2026
Used with
Projects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- sabahattink/antigravity-fullstack-hq★ 30same name
- jawwad-ali/claude-code-skills★ 4same name
- HamzaSheikh768/Agents-Skills-Lap★ 3same name
- LeahyCC/claude-skills★ 3same name
- amirrezaalasti/codescribe★ 2same name
- desilokesh1/antigravity-fullstack-hq★ 2same name
- dennisrongo/claude-skills★ 1same name
- geronco/commandvault-library★ 1same name
- SkillMedev/full-stack-web-dev★ 1same name
- SkillMedev/vercel-platform★ 1same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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-seo-metadataSkill
- nextjs-ui-foundationSkill
- 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
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
Prefer Link for internal routes.
- Very specific: line 80
Document every var in .env.example.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Next.js App Router
File conventions
| File | Purpose |
layout.tsx | Shared shell; export metadata when page is client |
page.tsx | Route UI — Server Component by default |
loading.tsx | Suspense fallback for segment |
error.tsx | Error boundary ("use client") |
not-found.tsx | 404 for segment |
route.ts | API route handler |
Route groups (optional)
app/
(marketing)/
layout.tsx → light marketing chrome
page.tsx
(app)/
layout.tsx → app shell / auth gate
dashboard/page.tsxGroups don't affect URL path.
Metadata on client pages
Client page.tsx cannot export metadata — use sibling layout.tsx:
// app/dashboard/layout.tsx
import type { Metadata } from "next";
export const metadata: Metadata = { title: "Dashboard", robots: { index: false } };
export default function Layout({ children }: { children: React.ReactNode }) {
return children;
}Server Component data
// Server Component — no "use client"
export default async function Page() {
const data = await fetchData(); // or direct DB
return <ClientView initial={data} />;
}Pass serializable props only to client children.
Navigation
import Link from "next/link";
import { useRouter, usePathname, useSearchParams } from "next/navigation";Prefer Link for internal routes; router.replace for redirects after guard checks.
Env helpers (lib/env.ts)
Centralize reads — never scatter process.env in components:
export function getSiteUrl(): string {
return process.env.NEXT_PUBLIC_SITE_URL ?? "http://localhost:3000";
}Document every var in .env.example; upsert .env when adding new vars.
Root layout checklist
- [ ] lang on <html>
- [ ] fonts via next/font
- [ ] global providers (theme, tooltip, analytics)
- [ ] SkipToMain link
- [ ] metadataBase for production URLsAnti-patterns
- Fetching in client what server could fetch once
- Importing server-only modules into client components
- Multiple nested
"use client"boundaries without reason - Hardcoding URLs instead of env-based
getSiteUrl()
Pair with: nextjs-ui-foundation, nextjs-seo-metadata, nextjs-api-routes.
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.

