view --main backend-coding-standards-skill-dlya-standartizatsii-koda.md
backend-coding-standards: Скилл для стандартизации кода
SKILL.md
examples
entity.spec.ts
2.2 KB
entity.ts
3.3 KB
handler.ts
2.7 KB
readonly
--- lines
---
name: backend-coding-standards
description: Index for NestJS backend skills. Use when working in backend/. Load the specific sub-skill for your task.
---
# Backend — Custom Fields (Index)
**⚠️ MANDATORY:** Before writing any backend code, read the **specific sub-skill** for your task (see table below). Do not improvise — follow the skill's patterns and creation order.
This is the **index** for backend skills. For detailed standards, use the **specific sub-skill** for your task.
---
## Sub-Skills — Use the One That Fits Your Task
| Skill | When to Use | Path |
| ---------------------------- | ---------------------------------------------- | -------------------------------------------------- |
| **backend-overview** | Starting work, structure, decision tree | `.agents/skills/backend-overview/SKILL.md` |
| **backend-domain** | Entities, value objects, repository interfaces | `.agents/skills/backend-domain/SKILL.md` |
| **backend-application** | Command/Query handlers (CQRS) | `.agents/skills/backend-application/SKILL.md` |
| **backend-infra** | Prisma repositories, mappers, injection | `.agents/skills/backend-infra/SKILL.md` |
| **backend-presentation** | HTTP controllers, Swagger | `.agents/skills/backend-presentation/SKILL.md` |
| **backend-errors-and-tests** | Exceptions, Guard, unit tests | `.agents/skills/backend-errors-and-tests/SKILL.md` |
| **backend-conventions** | Module exports, naming, checklist | `.agents/skills/backend-conventions/SKILL.md` |
---
## Quick Decision
- **Entity or value object?** → `backend-domain`
- **Command/Query handler?** → `backend-application`
- **Prisma repository or mapper?** → `backend-infra`
- **Controller?** → `backend-presentation`
- **Exception or test?** → `backend-errors-and-tests`
- **Module/naming/checklist?** → `backend-conventions`
- **Overview/structure?** → `backend-overview`
---
## Creation Order (CRUD Feature)
1. Entity → `backend-domain`
2. Repository interface → `backend-domain`
3. Mapper → `backend-infra`
4. PrismaRepository → `backend-infra`
5. Command + Handler → `backend-application`
6. Controller → `backend-presentation`
7. Tests → `backend-errors-and-tests`
---
## General Rules (All Backend)
- **Controllers:** NEVER put logic in controllers — only receive, build command/query (simple mapping), dispatch, return; create Command/Query + Handler for any logic
- **Commands:** Never pass `RepositoryTransaction` between commands — each command manages its own transaction via `repositoryTransactionService.execute()`
- **Language:** English for all code, comments, docs
- **Never modify:** `**/prisma-generated-types/`
- **Prisma enums:** Every enum must have a ValueObject + re-export as `XxxEnum`; never import from prisma-generated-types in domain/application/presentation — see `backend-conventions`
- **Package manager:** Yarn (never npm/pnpm)
- **Framework:** NestJS 11, DDD, CQRS, Prisma, Swagger, Jest
---
## Shared Configuration
- **ESLint:** `backend/eslint.config.mjs`
- **Prettier:** `backend/.prettierrc`
- **Build:** From `backend/` root: `yarn build`
---
## Deploy Workflows
- **Template:** `.github/workflows/deploy-backend-template.yml`
- **Workflows:** `deploy-api.yml`
- **Docker:** `infra/dockerfiles/backend/RuntimeWithPrisma.Dockerfile` (context: `./backend`)
---
## References
- Frontend: `.agents/skills/frontend/SKILL.md`
- Project overview: `AGENTS.md`
Инициализация мануала...
//
$ ls -R related_skills/
2026-04-11
⭐ 2
tanstack-db: Скилл для реактивных данных и интеграций
2026-04-11
⭐ 1
redis-best-practices: Скилл оптимизации производительности Redis
2026-04-11
⭐ 1
skill-database-elasticsearch: Скилл для работы с Elasticsearch
2026-04-11
⭐ 0
mongodb-conventions: Скилл для проектирования схем MongoDB
package.json
$ install --global
skills.sh
npx skills add https://github.com/stokei/garden/tree/main/.agents/skills/backend
$ download --local
man
[HINT] Скачивает всю директорию скилла с GitHub: SKILL.md и все связанные файлы