agentleFS
ulpi-ioulpi-io/browse/.agents/skills/nextjs/SKILL.md

nextjs

Skill15 starsChanged 8 months agoApache-2.0View on GitHub

Next.js 16 App Router reference — Cache Components, proxy.ts, API-backed data layer, multilingual-first with next-intl, atomic components, structured logging, analytics tracking. Use when working on any Next.js page, component, route, layout, data fetching, caching, i18n, testing, or metadata task.

39 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use nuqs, msw and 8 more.

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.
  • thongdn-itSkill

    nuqs

    nuqs (type-safe URL query state) best practices for Next.js applications. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, or Next.js routing with state.

    Also in 3 projects that use this

  • thongdn-itSkill

    msw

    MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.

    Also in 3 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 10 projects that use this

  • hfzarslanSkill

    fastapi

    FastAPI web framework skill for building REST APIs and web applications. Use when building FastAPI projects, creating APIs, adding features like database integration or authentication, structuring FastAPI applications, or when users ask to build/modify FastAPI code. Triggers include requests to create APIs, add endpoints, implement CRUD operations, set up authentication, integrate databases, add testing, or deploy FastAPI applications.

    Also in 4 projects that use this

  • MicrosoftSkill

    typescript

    TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

    Also in 5 projects that use this

  • klauswgSkill

    shadcn-ui

    Expert guidance for integrating and building applications with shadcn/ui components, including component discovery, installation, customization, and best practices.

    Also in 4 projects that use this

  • +3 more from thongdn-it

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 35 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No raw strings in JSX: Every user-visible string must use t() from next-intl.

    line 17
  2. Very specific:

    No page without generateMetadata + OG: Every page exports generateMetadata with title, description, OG image, hreflang alternates.

    line 19
  3. Very specific:

    No inline fetch: All data fetching goes through src/lib/api/ client.

    line 20
  4. Very specific:

    No 'use client' on pages or layouts: Only leaf components in components/ui/, components/features/, or _components/ may be client …

    line 21
  5. Very specific:

    All params/searchParams/cookies/headers are async: Always await params, await searchParams, await cookies(), await headers().

    line 22
  6. Distinctive:

    Before writing ANY code, you MUST complete this checklist:

    line 29
  7. Very specific:

    Read references/stack.md to understand locked decisions (runtime, bundler, config)

    line 31
  8. Distinctive:

    Read the matching reference file(s) — they contain the patterns, code examples, and anti-patterns

    line 33
  9. Distinctive:

    Only then begin implementation

    line 34
  10. Distinctive:

    All data fetching goes through the API client — never inline fetch, never ORM.

    line 69
  11. Very specific:

    All visible strings use t() — no hardcoded text.

    line 70
  12. Very specific:

    All Tailwind uses logical properties — ps-, pe-, ms-, me-, text-start, text-end.

    line 71

“Common” is measured: kept by at least 6 in 10 of the 35 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<EXTREMELY-IMPORTANT> These rules apply to ALL Next.js code you write. Violating any of them produces broken, unmaintainable, or inaccessible output.
  1. No raw strings in JSX. Every user-visible string must use t() from next-intl. No hardcoded text.
  2. No oversized files. Components: 150 lines max. Pages: 300 lines max. Extract to _components/ or features/ if larger.
  3. No page without generateMetadata + OG. Every page exports generateMetadata with title, description, OG image, hreflang alternates.
  4. No inline fetch. All data fetching goes through src/lib/api/ client. Never call fetch() directly. Never use an ORM.
  5. No 'use client' on pages or layouts. Only leaf components in components/ui/, components/features/, or _components/ may be client components.
  6. All params/searchParams/cookies/headers are async. Always await params, await searchParams, await cookies(), await headers(). Sync access is removed in v16.</EXTREMELY-IMPORTANT>

Next.js 16 App Router

MANDATORY FIRST RESPONSE PROTOCOL

Before writing ANY code, you MUST complete this checklist:

  1. Read references/stack.md to understand locked decisions (runtime, bundler, config)
  2. Identify the task type from the routing table below
  3. Read the matching reference file(s) — they contain the patterns, code examples, and anti-patterns
  4. Only then begin implementation

Writing code without reading the reference = wrong patterns, wasted time, rework.

Routing Table

TaskRead
Starting a session / understanding the stackreferences/stack.md
Creating or modifying files, folder conventionsreferences/folder-structure.md
Navigation, dynamic routes, proxy.ts, parallel routesreferences/routing.md
Creating a new page or layoutreferences/page-checklist.md
Creating or editing a componentreferences/component-anatomy.md
Adding data fetching (reads)references/api-client-pattern.md
Adding mutations (writes), formsreferences/server-actions.md
Making caching decisionsreferences/caching-strategy.md
Adding/editing user-facing text, translations, or RTLreferences/i18n-conventions.md
Error boundaries, recovery, not-foundreferences/error-handling.md
Structured logging, log levels, PII rulesreferences/logging.md
Analytics events, provider adaptersreferences/tracking.md
Unit tests (Vitest)references/testing-unit.md
End-to-end tests (Playwright)references/testing-e2e.md
Authentication, sessions, protected routesreferences/auth.md
Security hardening, CSP, headers, XSS preventionreferences/security.md
SEO, OG tags, structured data, sitemapsreferences/seo.md
Accessibility (ARIA, keyboard, focus, reduced motion)references/accessibility.md
Markdown mirrors, llms.txt, machine-readable contentreferences/machine-readable.md

Multiple tasks? Read multiple files. The references are self-contained — no need to consult external docs.

Quick Rules

These repeat the critical guardrails for context-window resilience:

  1. All params, searchParams, cookies(), headers() are async — always await.
  2. All data fetching goes through the API client — never inline fetch, never ORM.
  3. All visible strings use t() — no hardcoded text.
  4. All Tailwind uses logical properties — ps-, pe-, ms-, me-, text-start, text-end.
  5. cacheComponents: true required in next.config.ts for 'use cache' to work.

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.