nextjs-app-architecture
БесплатноБез исполняемых скриптовНе проверенBuild or audit Next.js 16 App Router apps using a next-beats-style React Server Components architecture. Use when scaffolding a new app, adding a feature…
от Asymmetric-al★ 354 звезды на GitHubОб этом скилле
Next.js App Architecture
This repository (Asymmetric-al/core)
Subordinate to installed Next.js docs (apps/<app>/node_modules/next/dist/docs/ or .next-docs/), docs/ai/rules/frontend.md, docs/ai/skills/nextjs-app-router/SKILL.md, docs/ai/skills/cache-components/SKILL.md, and docs/guides/architecture/data-access-boundary.md.
Apply only to the requested scope. An audit does not authorize a repository-wide async-page refactor. Core's Stream / Cache / explicit Block decisions remain controlling; synchronous composition is this skill's default, not a ban on deliberately qualified async routes.
This skill is for page composition, Suspense placement, leaf client boundaries, and feature-owned UI. It is not a license to invent a new app folder scheme or move business database logic.
Repo mapping:
- Privileged reads, writes, payments, webhooks, and vendor calls stay in
packages/api. - Browser-visible table data uses
@asym/database/hooksonly in'use client'leaves when a collection exists. Async Server Components call published server-read subpaths instead. - Shared UI stays in
@asym/ui/ exactbase-maia. Existingapps/*/features/directories are UI composition, not a new query layer. - All apps already run
cacheComponents: trueandpartialPrefetching: true. Do not "enable Cache Components." Follow Instant Navigation (Stream / Cache / explicit Block) indocs/ai/rules/frontend.md. - Get API mechanics from the installed Next.js docs, not
preview.nextjs.orgor remembered APIs. - Do not add Zustand. Use the installed TanStack Query / TanStack DB patterns from
docs/ai/rules/frontend.md. - Do not regenerate or expand the managed root
AGENTS.md.
Core remaps — apply these at every numbered step. Upstream file-placement lines are vendor text, not permission to add a query layer.
- Feature-owned means UI composition only. Server feature components select a published
@asym/api/*read; client leaves use approved browser hooks or API routes. A plain server helper is not a callable Server Action. Do not createfeatures/<domain>/<domain>-queries.tsorfeatures/<domain>/<domain>-actions.tsat all. - Mutation boundary: A client leaf calls an existing approved hook/API route, or an authenticated
'use server'adapter in an established app boundary that validates input and delegates business work topackages/api. It never directly imports an ordinary API server command. - Cache ownership: Server tags and invalidators stay in
packages/api/src/shared/cache-tags.tsor their API-owned domain module. Feature-local files own browser query keys/options only; coordinate the two explicitly without an API-to-app import. - Prerequisite: Prefer the project's installed Next.js docs (
apps/<app>/node_modules/next/dist/docs/or.next-docs/). Do not create or refresh rootAGENTS.mdfrompreview.nextjs.org.
Refresh: references/upstream.md.
A workflow for building and auditing Next.js 16+ App Router apps so they follow one consistent, feature-sliced RSC architecture like next-beats.
Follow the workflow below step by step — apply the Core remaps at each step. Upstream *-queries.ts / *-actions.ts lines are vendor text: CORE: skip file creation. Load the reference a step names for the decision it depends on. Get framework mechanics (API signatures, config options, hook contracts) from the linked docs — don't restate or improvise them.
Prerequisite
Before changing a Next.js app, read version-matched docs from apps/<app>/node_modules/next/dist/docs/ or .next-docs/. Do not create or refresh root AGENTS.md from preview.nextjs.org. Then use this skill for architecture decisions.
Architecture target
Build pages that describe the loading experience, not pages that act like route loaders:
app/**/page.tsxandlayout.tsxare synchronous composition surfaces: static chrome, section headings,<Suspense>boundaries, error boundaries, and transition wrappers.- Feature components own their reads on the server. They receive minimal stable inputs (
id,slug,handle, parsed filter values) or already-fetched records, never rawparams/searchParams. - Queries and actions live in the feature folder. Components import queries; client leaves import actions directly. (CORE: skip file creation. Server components call published API read subpaths; client leaves use approved browser hooks/API routes or authenticated Server Action adapters.)
- When server tags and client query keys describe the same feature data, a pure feature-local cache contract owns those identities. (CORE: server tags remain API-owned; feature-local contracts own browser keys only, with explicit coordination.)
- Stable chrome, wrappers, and skeletons preserve layout: cards/panels stay outside Suspense, and fallbacks swap only the data-dependent body.
Invariants (what every change must satisfy)
The non-negotiables. The workflow prod
Установить nextjs-app-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nextjs-app-architecture?
Build or audit Next.js 16 App Router apps using a next-beats-style React Server Components architecture. Use when scaffolding a new app, adding a feature, reviewing an existing app, refactoring route-loader-shaped pages into feature-owned async server components, deciding where queries/actions/components live, keeping pages synchronous with `params.then()`, placing Suspense boundaries, choosing the client/server boundary, designing skeletons, preventing CLS, or following Cache Components Instant Navigation. Also use when the user asks about RSC composition, components receiving IDs instead of route params, `'use cache'`, `cacheTag`, `updateTag`, static-shell prerendering, or making an app easier for AI agents to modify.
Как установить скилл nextjs-app-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nextjs-app-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic