nextjs-app-router
Skill1 starsChanged 38 days agoMITView on GitHub
Builds and reviews Next.js App Router code - server/client component boundaries, data fetching, caching and revalidation choices, streaming with Suspense, and Server Action mutations - and delivers routes where every dynamic-vs-cached decision is explicit. Use when someone asks "should this be a client component", "why is my data stale", "where do I put use client", "how do I stream this page", or "how do server actions work". Do NOT use for Vercel-specific runtime and cost tuning of an already-built app - use next-on-vercel-perf instead; for edge middleware and ISR deployment topology - use vercel-edge-and-isr instead; for framework-agnostic Core Web Vitals work - use web-performance instead; for designing an application-wide cache layer beyond the framework - use caching-strategy instead.
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/full-stack-web-devword for word, first seen Oct 5, 2026
- sabahattink/antigravity-fullstack-hqtheir own version, first seen Sep 20, 2026
- jawwad-ali/claude-code-skillstheir own version, first seen Sep 5, 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 · 1
- SkillMedev/full-stack-web-dev★ 1100% same
Edited · 0
None found.
Wrote their own version · 12
- 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
- abdullahqureshi27/TaskCortex★ 0same name
- bkjain655/agent-skills★ 0same name
2 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 repository7 other files it gives its agents.
- next-on-vercel-perfSkill
- vercel-ai-gatewaySkill
- vercel-deploy-pipelineSkill
- vercel-edge-and-isrSkill
- vercel-env-managementSkill
- vercel-firewall-and-botidSkill
- web-performanceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 6 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
If a client component needs server-rendered content inside it, pass it as children - composition keeps the inner tree on the server.
- Very specific: line 55
Must be fresh or per-user: { cache: 'no-store' }, or export const dynamic = 'force-dynamic' when the whole route is per-request.
- Very specific: line 62
Add loading.tsx for every route with async work - the shell should render immediately while data streams in.
- Distinctive: line 68
Use Server Actions for mutations.
- Distinctive: line 69
Check authorization inside the action, not only in the page that renders the form.
- Very specific: line 70
After a successful mutation, call revalidatePath or revalidateTag for exactly the data that changed - tags from Step 3 make this precise …
- Very specific: line 79
Do not put 'use client' on a page or layout to fix one interactive widget - extract the widget instead.
- Very specific: line 80
Do not fetch in useEffect what a server component could fetch - it adds a client-server waterfall and a loading spinner where streamed HTML …
- Very specific: line 81
Do not "fix" stale data with force-dynamic route-wide when one fetch needed no-store - you lose caching for everything else on the page.
- Distinctive: line 82
Do not skip validation or auth checks in Server Actions because "only my form calls it" - actions are callable endpoints.
- Distinctive: line 83
Do not store server data in client state and manually sync it.
- Very specific: line 87
Every 'use client' directive is at a leaf and justified by interactivity, state, or a browser API.
- Very specific: line 88
Every fetch has an explicit caching decision.
- Distinctive: line 89
Every async boundary has a loading state.
- Distinctive: line 90
Every mutation revalidates the specific paths/tags it affects, and validates + authorizes on the server.
“Common” is measured: kept by at least 6 in 10 of the 10 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
Default to Server Components; reach for Client Components only for interactivity, state, or browser APIs. The two costly mistakes this skill prevents are the accidental client tree - one 'use client' placed high that drags the whole page into the browser bundle - and accidental caching, where fetch's default caching silently serves stale data and the team "fixes" it by sprinkling force-dynamic everywhere, losing all caching.
Operating procedure
Step 1: gather inputs
Collect before writing a route (label guesses as guesses):
- Per piece of data on the page: is it per-request/per-user, or shared and cacheable? If cacheable, what staleness is acceptable (seconds, minutes, hours)?
- Which UI elements genuinely need interactivity, state, effects, or browser APIs.
- Mutations on the page and what data they invalidate.
- Auth model: does rendering depend on cookies/headers (forces dynamic rendering)?
Step 2: draw the client boundary at the leaves
- Mark
'use client'only at the smallest component that needs it. Everything imported by a client component becomes client code, so a high boundary silently ships the subtree to the browser. - If a client component needs server-rendered content inside it, pass it as
children- composition keeps the inner tree on the server. - Pass data down as props; do not lift server data into client state just to share it.
Bad:
'use client' // whole page is now client code
export default function Page() {
const [open, setOpen] = useState(false)
// 40 KB of product listing logic dragged into the bundle for one toggle
}Good:
// page.tsx - server component, fetches and renders
export default async function Page() {
const products = await getProducts()
return <ProductList products={products} action={<FilterToggle />} />
}
// FilterToggle.tsx - 'use client', only the toggle ships to the browserStep 3: fetch on the server, choose caching explicitly
- Fetch in server components with
async/await. NouseEffectdata fetching unless the data is genuinely client-driven (e.g. depends on live client state). fetchis cached by default - every fetch call must make a deliberate choice:- Shared, tolerates staleness:
{ next: { revalidate: N } }. Pick N from acceptable staleness in Step 1 - 60 s for dashboards-ish freshness, 3600 s for marketing/content. - Must be fresh or per-user:
{ cache: 'no-store' }, orexport const dynamic = 'force-dynamic'when the whole route is per-request. - Tag cacheable data (
next: { tags: ['products'] }) when a mutation will need to invalidate it precisely.
- Shared, tolerates staleness:
- Reading
cookies()orheaders()makes the route dynamic - expect it, don't fight it. - Deduplicate: a
fetchwith identical args is memoized per request, so fetch where the data is used rather than prop-drilling from the top.
Step 4: stream instead of blocking
- Add
loading.tsxfor every route with async work - the shell should render immediately while data streams in. - Wrap independently-slow sections in
<Suspense>with their own fallbacks so one slow query does not hold the whole page. If any single data dependency takes over ~300 ms, it is a streaming candidate; never let one slow fetch block first paint past 1 s when the rest of the page is ready. error.tsxfor route-level error boundaries;not-found.tsxplusnotFound()for 404s.
Step 5: mutate with Server Actions and revalidate
- Use Server Actions for mutations. Validate input on the server with a schema - never trust the client; the action is a public endpoint regardless of which form calls it.
- Check authorization inside the action, not only in the page that renders the form.
- After a successful mutation, call
revalidatePathorrevalidateTagfor exactly the data that changed - tags from Step 3 make this precise instead of nuking whole routes. - Return typed error state from actions for the form to render; do not throw for expected validation failures.
Deliverable
Produce the route implementation plus a one-table caching manifest: for each data source on the page - cached or dynamic, revalidate interval or no-store, tags, and which mutation invalidates it. Every choice explicit, none accidental.
Do NOT
- Do not put
'use client'on a page or layout to fix one interactive widget - extract the widget instead; the directive is transitive to every import. - Do not fetch in
useEffectwhat a server component could fetch - it adds a client-server waterfall and a loading spinner where streamed HTML would do. - Do not "fix" stale data with
force-dynamicroute-wide when one fetch neededno-store- you lose caching for everything else on the page. - Do not skip validation or auth checks in Server Actions because "only my form calls it" - actions are callable endpoints.
- Do not store server data in client state and manually sync it; revalidation after mutation is the sync mechanism.
Quality bar
- Every
'use client'directive is at a leaf and justified by interactivity, state, or a browser API. - Every
fetchhas an explicit caching decision; grep for bare fetches with none. - Every async boundary has a loading state; no route blanks while awaiting data.
- Every mutation revalidates the specific paths/tags it affects, and validates + authorizes on the server.
- The caching manifest exists and matches the code.
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.

