backend-design
БесплатноБез исполняемых скриптовНе проверенElite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.
от xenitV1★ 227 звёзд на GitHubОб этом скилле
Philosophy: The Backend is the Fortress. Logic is Law. Latency is the Enemy. Core Principle: ISOLATE features. TRUST no one. SCALE linearly.
ANTI-HAPPY PATH MANDATE (CRITICAL): Never assume the ideal scenario. AI-generated code often fails by ignoring edge cases and failure modes. For every business logic slice, you MUST document and test at least three failure scenarios: Race Conditions, Data Integrity violations (e.g., unique constraint overlaps), and Boundary failures. Reject any implementation that only covers the 'Happy Path'. Engineering is the art of handling what shouldn't happen.
0. The "Vertical Slice" Law (The Anti-Layer Mandate)
CRITICAL: You are FORBIDDEN from creating "Horizontal Layers" (Controllers, Services, Repositories) as primary folders.
The "Feature-First" Protocol: Code must be organized by BUSINESS CAPABILITY, not technical role.
- The Slice: A single directory (e.g.,
features/create-order/) contains EVERYTHING needed for that feature:handler.ts(Controller)logic.ts(Domain/Service)schema.ts(DTO/Validation)db.ts(Data Access)
- The Benefit: Changing a feature requires touching only ONE folder. No "Shotgun Surgery" across 5 layers.
- Shared Kernel: Only truly generic code (Logging, Auth Middleware, Database Connection) goes into
shared/.
1. The "Modular Monolith" Mandate
- Microservices Ban: Do NOT start with microservices. Start with a Modular Monolith.
- Modulith Rules:
- Modules must be isolated (like internal microservices).
- Modules communicate via Events (Sub-Process or Message Bus), NEVER by importing another module's code directly.
- The Outbox Pattern (Guaranteed Delivery):
- Problem: If DB commit succeeds but Event Bus fails, the system is inconsistent.
- Mandate: Write events to an
outboxtable in the SAME transaction as the data change. - Relay: A background worker pushes
outboxentries to the Message Bus (RabbitMQ/Kafka).
- Data Sovereignty: Module A cannot query Module B's tables. It must ask Module B via API/Event.
2. The "Zero Trust" Security Protocol
Detailed protocols: See security-protocols.md
Quick Rules:
- Strict Serialization: NEVER return raw DB entities → Use ResponseDTO
- Validation at Gate: Schema validation (Zod/Pydantic) BEFORE logic
- Token Sovereignty: PASETO v4 > JWT (Ed25519 if JWT forced)
3. The "Sub-100ms" Performance Mandate
- The Latency Budget: P50 < 100ms. P99 < 500ms.
- UUIDv7 (The Time-Lord Rule):
- Ban: Never use
UUIDv4(Random) for Primary Keys. It fragments B-Tree indexes. - Mandate: Use UUIDv7 (Time-ordered). It enables clustered index locality (fast inserts) like integers, with the uniqueness of UUIDs.
- Ban: Never use
- N+1 Assassin:
- Check: Always inspect ORM queries. Loops triggering DB calls are a "Level 0" error.
- Fix: Use
DataLoaderpattern or explicitJOINloading.
4. API Reliability Contracts
- RFC 7807 (Problem Details):
- Ban: returning
{ "error": "Something went wrong" }. - Mandate: Return standard Problem JSON:
{ "type": "https://api.myapp.com/errors/insufficient-funds", "title": "Insufficient Funds", "status": 403, "detail": "Current balance is 10.00, required is 15.00", "instance": "/transactions/12345" }
- Ban: returning
- Idempotency Keys:
- Rule: All critical
POST/PATCH(Money, State Change) must accept anIdempotency-Keyheader. - Logic: If key exists in Cache (24h TTL), return stored response without re-executing logic.
- Rule: All critical
5. Database Integrity & Design
- Hard Constraints: Application-level checks are "Suggestions". Database Constraints (Foreign Keys, Unique Indexes, Check Constraints) are "Laws".
- Cursor Pagination:
- Ban:
OFFSET / LIMITon large tables (O(N) performance degradation). - Mandate: Cursor-based pagination (
WHERE created_at < cursor LIMIT 20).
- Ban:
- Migration Discipline:
- Never alter a column in a way that locks the table for >1s.
- Use "Expand and Contract" pattern for breaking changes.
- Concurrency Control:
- Problem: Two users update the same record. The last one wipes the first.
- Mandate: Use Optimistic Locking. Add a
version(int) column. - Logic: Update WHERE
id= X ANDversion= Y. If 0 rows affected, throwStaleObjectException.
6. AI & Vector Readiness
- **Semantic
Установить backend-design в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditGlobGrepBashВложенные файлы
FAQ
Что делает скилл backend-design?
Elite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.
Как установить скилл backend-design?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл backend-design запускает скрипты?
Нет, скилл состоит только из инструкций (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