- блок поднят над «Структура документации» — это первое что видит
читатель после описания
- разделён на две аудитории:
* «Для AI-агентов»: llms.txt (карта) и llms-full.txt (полный текст)
* «Для проекта»: ZIP-архив с распаковкой в ./ai/nextjs-style-guide/
- прямые URL на nextjs-style-guide.gromlab.ru
- README.md и README_RU.md (генерируются из docs/{ru,en}/index.md)
обновлены автоматически
67 lines
2.7 KiB
Markdown
67 lines
2.7 KiB
Markdown
# NextJS Style Guide
|
|
|
|
Conventions for Next.js project development: application architecture and layers, code structure, module organization, styling, typing, and infrastructure.
|
|
|
|
## Usage
|
|
|
|
**For AI agents:**
|
|
|
|
- [Sections map](https://nextjs-style-guide.gromlab.ru/en/llms.txt) — `llms.txt`, table of contents with links to sections.
|
|
- [Full text](https://nextjs-style-guide.gromlab.ru/en/llms-full.txt) — `llms-full.txt`, the entire documentation in a single file.
|
|
|
|
**For projects:**
|
|
|
|
- [Rules archive](https://nextjs-style-guide.gromlab.ru/nextjs-style-guide-en.zip) — `nextjs-style-guide-en.zip`, a set of Markdown files to unpack into `./ai/nextjs-style-guide/` or another project folder.
|
|
|
|
## Documentation Structure
|
|
|
|
### Processes
|
|
|
|
**What to do** in a specific situation — step-by-step instructions.
|
|
|
|
| Section | Answers the question |
|
|
|---------|---------------------|
|
|
| Getting Started | What tools to install before starting development? |
|
|
| Creating an App | How to create a new project, where to get a template? |
|
|
| Creating Pages | How to add a page: routing and screen? |
|
|
| Creating Components | How to generate components using templates? |
|
|
| Styling | What to use: Mantine, tokens, or PostCSS? |
|
|
| Data Fetching | How to fetch data: SWR, codegen, sockets? |
|
|
| State Management | When and how to create a store (Zustand)? |
|
|
| Localization | How to add translations and work with i18next? |
|
|
|
|
### Basic Rules
|
|
|
|
**What the code should look like** — standards not tied to a specific technology.
|
|
|
|
| Section | Answers the question |
|
|
|---------|---------------------|
|
|
| Tech Stack | What stack do we use? |
|
|
| Architecture | How are SLM layers, dependencies, and public API structured? |
|
|
| Code Style | How to format code: indentation, quotes, imports, early return? |
|
|
| Naming | How to name files, variables, components, hooks? |
|
|
| Documentation | How to write JSDoc: what to document and what not? |
|
|
| Typing | How to type: type vs interface, any/unknown? |
|
|
|
|
### Applied Sections
|
|
|
|
**How a specific area works** — rules, structure, and code examples for specific technologies and tools.
|
|
|
|
| Section | Answers the question |
|
|
|---------|---------------------|
|
|
| Project Structure | How are folders and files organized by FSD? |
|
|
| Components | How is a component structured: files, props, clsx? |
|
|
| Page-level Components | How to define layout, page, loading, error, not-found? |
|
|
| Templates & Code Generation | How do templates work: syntax, variables, modifiers? |
|
|
| Styles | How to write CSS: PostCSS Modules, nesting, media, tokens? |
|
|
| Images | _(not filled)_ |
|
|
| SVG Sprites | _(not filled)_ |
|
|
| Video | _(not filled)_ |
|
|
| API | _(not filled)_ |
|
|
| Stores | _(not filled)_ |
|
|
| Hooks | _(not filled)_ |
|
|
| Fonts | _(not filled)_ |
|
|
| Localization | _(not filled)_ |
|
|
|
|
|