Next.js App taste — промпт для ChatGPT: что делает и как установить
Промпт Next.js App taste для ChatGPT и Claude.ai задаёт прагматичные стандарты разработки на Next.js App Router. Правила направляют генерацию архитектуры роутов, серверных компонентов и валидации данных.
CC0-1.0 ★ 178 201 обновлён 2026-10-24
Открыть на GitHubЧто делает Next.js App taste
Промпт задаёт свод правил для построения приложений на базе каталога app/ в Next.js. По умолчанию предписывается использовать Server Components, выносить директиву "use client" только для доступа к состоянию или браузерным API, а также размещать page.tsx, layout.tsx и loading.tsx рядом с соответствующими сегментами маршрута.
Инструкции требуют явного управления кешированием в fetch, валидации параметров запросов через Zod и использования Server Actions вместо разрастания эндпоинтов в app/api. Для структуры проекта промпт требует настроить абсолютные импорты @/ в tsconfig.json, а секретные переменные окружения запрещает выносить в NEXT_PUBLIC_*.
Какие задачи решает
- перевести проект на Next.js App Router без использования Pages Router
- настроить валидацию параметров маршрутов и форм через Zod
- изолировать приватные переменные окружения от префикса
NEXT_PUBLIC_* - разделить макеты страниц через группы маршрутов
(marketing)и(app)
Примеры запросов агенту
- Спроектируй структуру каталога
app/для SaaS с авторизацией и панелью управления. - Напиши Server Action для формы профиля с валидацией входных данных через Zod.
- Покажи пример загрузки данных в Server Component с явной политикой
next.revalidate.
Как установить Next.js App taste
Как использовать
Вставьте текст в начало диалога или в инструкции проекта
Вручную: положить файлы
.claude/commands/prompts.csv.mdВопросы о Next.js App taste
Как установить Next.js App taste в Claude Code?
В Claude Code промпт подключается добавлением файла .claude/commands/prompts.csv.md в проект. В ChatGPT и Claude.ai инструкции вставляются прямо в системный промпт или окно чата.
Что делает Next.js App taste?
Промпт задаёт архитектурные ограничения для Next.js App Router: серверные компоненты по умолчанию, явный кеш в fetch, валидацию через Zod и строгие настройки TypeScript с ESLint.
Какие ограничения налагает промпт на роуты API?
Файлы route.ts в каталоге app/api разрешено использовать только для вебхуков, колбэков авторизации и тонких BFF-эндпоинтов, а мутации предписано переносить в Server Actions.
Исходный текст
prompts.csv · CC0-1.0
# Next.js App taste of an App Router pragmatist - Use the App Router with the `app/` directory; do not start new features in the Pages Router. Confidence: 0.95 - Default every page and layout to a Server Component, and add `"use client"` only where interactivity, browser APIs or React state require it. Confidence: 0.95 - Colocate route files as `page.tsx`, `layout.tsx`, `loading.tsx`, `error.tsx` and `not-found.tsx` next to the segment they own. Confidence: 0.90 - Fetch data in Server Components with `fetch` and set an explicit `cache` or `next.revalidate` policy; never leave caching accidental. Confidence: 0.90 - Put shared UI in `components/` and keep route folders free of unrelated helpers. Confidence: 0.85 - Use Route Handlers under `app/api` only for webhooks, auth callbacks and thin BFF endpoints, not as a second application layer. Confidence: 0.85 - Validate all searchParams, route params and form bodies with Zod before they reach business logic. Confidence: 0.90 - Prefer Server Actions for mutations that stay on your origin, and return typed results the UI can handle without guessing. Confidence: 0.85 - Keep environment secrets out of `NEXT_PUBLIC_*`; expose only values that are safe in the browser. Confidence: 0.95 - Use `next/image` for every raster image and set width, height or `fill` plus sizes so CLS stays near zero. Confidence: 0.90 - Configure absolute imports with `@/` in `tsconfig.json` and ban deep relative paths like `../../../`. Confidence: 0.85 - Split marketing, app and admin into route groups such as `(marketing)` and `(app)` when they need different layouts. Confidence: 0.80 - Stream slow sections with `<Suspense>` boundaries and dedicated `loading.tsx` files instead of blocking the whole page. Confidence: 0.85 - Pin Node and package-manager versions in `package.json` engines and a lockfile, and run the same versions in CI and production. Confidence: 0.85 - Turn on ESLint with `eslint-config-next` and TypeScript `strict`, and fail CI on new errors. Confidence: 0.90 - Prefer the Metadata API (`generateMetadata`, `metadata`) over manual `<head>` tags for titles, Open Graph and robots. Confidence: 0.85 - Use middleware only for rewrites, redirects and light auth gates; keep heavy logic in Server Components or Route Handlers. Confidence: 0.80 - Ship one design-system entry for buttons, inputs and typography, and avoid one-off Tailwind class piles in every page. Confidence: 0.75 - Measure Core Web Vitals in production and treat a regression on LCP or INP as a release blocker. Confidence: 0.80 - Prefer incremental Static and ISR for public pages; reserve fully dynamic rendering for authenticated or highly personalized views. Confidence: 0.85
© f · CC0-1.0 · f/prompts.chat