agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-nextjs/SKILL.md

senior-nextjs

Skill2 starsChanged 6 days agoMITView on GitHub

Use when designing, implementing, debugging, reviewing, or optimizing Next.js applications, App Router or Pages Router, React Server Components, Server Actions, route handlers, caching, rendering, SEO, authentication, or deployment.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

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

    Default to Server Components and server-side data access.

    line 20
  2. Very specific:

    Use loading, error, not-found, suspense boundaries, and meaningful empty states to maintain a stable user experience.

    line 24
  3. Distinctive:

    Keep metadata, canonical URLs, structured data, robots rules, image optimization, and accessibility aligned with the route's product …

    line 25
  4. Distinctive:

    Avoid serial data fetching when parallelism is possible, oversized client bundles, unnecessary client state, and uncached duplicate queries.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Senior Next.js

Role

Build Next.js changes that choose server and client boundaries deliberately, protect data and secrets, preserve predictable caching and rendering behavior, and deliver accessible, performant experiences.

Before Editing

  1. Inspect the Next.js and React versions, router type, project configuration, deployment target, authentication model, API layer, data fetching, caching, middleware, styles, tests, and existing route conventions.
  2. Identify the route's rendering mode, data ownership, cache/revalidation behavior, server-client boundary, authorization boundary, metadata/SEO impact, and error/loading states.
  3. State a short plan. Do not mix App Router and Pages Router patterns or promote components to client components without a demonstrated browser-only need.

Implementation Rules

  • Default to Server Components and server-side data access. Add 'use client' only at the smallest interactive leaf; pass serializable data across the boundary.
  • Authenticate and authorize on the server for data access and mutations. Treat middleware as a routing optimization, not the sole enforcement point. Keep secrets, privileged queries, and internal errors server-side.
  • Choose caching intentionally. Specify fetch cache behavior, route segment revalidation, tag invalidation, or dynamic rendering based on freshness and personalization requirements. Do not rely on defaults for sensitive or mutable data.
  • Validate all mutation input on the server. Make Server Actions and route handlers handle authorization, idempotency where relevant, expected errors, and safe redirects.
  • Use loading, error, not-found, suspense boundaries, and meaningful empty states to maintain a stable user experience. Avoid hydration mismatches and client-side waterfalls.
  • Keep metadata, canonical URLs, structured data, robots rules, image optimization, and accessibility aligned with the route's product purpose.

Performance and Verification

Avoid serial data fetching when parallelism is possible, oversized client bundles, unnecessary client state, and uncached duplicate queries. Run existing lint, type, test, and production build commands; inspect route behavior, permissions, cache invalidation, metadata, and loading/error paths affected by the change.

Review Checklist

  • Is server/client placement minimal and justified?
  • Are cache, revalidation, personalization, and mutation semantics explicit?
  • Are authorization and validation enforced where data or side effects occur?
  • Does the route handle loading, error, not found, empty, and responsive accessibly?
  • Did the change preserve the repository's router, deployment, and observability conventions?

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.