Backend Design logo

Backend Design

Community
xenitV1
backend-design

Elite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.

Overview

PublisherxenitV1
Repositoryclaude-code-maestro
Skill namebackend-design
Stars
231
Forks
34
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by xenitV1 on GitHub. Read the source before you install it.

Installation

Install the Backend Design AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git /tmp/claude-code-maestro
mkdir -p .claude/skills
cp -r /tmp/claude-code-maestro/skills/backend-design .claude/skills/backend-design
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Backend Design in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Backend Design on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Backend Design is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

<domain_overview>

Backend Design System

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. </domain_overview>

<architectural_protocols>

🚀 ELITE TIER KNOWLEDGE (ARCHITECTURAL PROTOCOLS)

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.

  1. 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)
  2. The Benefit: Changing a feature requires touching only ONE folder. No "Shotgun Surgery" across 5 layers.
  3. 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 outbox table in the SAME transaction as the data change.
      • Relay: A background worker pushes outbox entries 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:

  1. Strict Serialization: NEVER return raw DB entities → Use ResponseDTO
  2. Validation at Gate: Schema validation (Zod/Pydantic) BEFORE logic
  3. Token Sovereignty: PASETO v4 > JWT (Ed25519 if JWT forced) </architectural_protocols>

<reliability_contracts>

🏗️ Reliability & Performance Contracts

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.
  • N+1 Assassin:
    • Check: Always inspect ORM queries. Loops triggering DB calls are a "Level 0" error.
    • Fix: Use DataLoader pattern or explicit JOIN loading.

4. API Reliability Contracts

  • RFC 7807 (Problem Details):
    • Ban: returning { "error": "Something went wrong" }.
    • Mandate: Return standard Problem JSON:
      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"
      }
  • Idempotency Keys:
    • Rule: All critical POST/PATCH (Money, State Change) must accept an Idempotency-Key header.
    • Logic: If key exists in Cache (24h TTL), return stored response without re-executing logic. </reliability_contracts>

<database_integrity>

🗄️ Database Integrity & Design

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 / LIMIT on large tables (O(N) performance degradation).
    • Mandate: Cursor-based pagination (WHERE created_at < cursor LIMIT 20).
  • 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 AND version = Y. If 0 rows affected, throw StaleObjectException.

6. AI & Vector Readiness

  • Semantic Storage: Backend must be ready to store embeddings (Vector Types).
  • Guardrails: Output from LLMs must be sanitized and structure-checked on the server side before returning to frontend. </database_integrity>

7. Structured Logging Only

  • Ban: console.log("User updated"). String logs are useless for machines.
  • *Mandate: JSON Logs with correlation IDs. { "level": "info", "event": "user_updated", "user_id": "u7-...", "trace_id": "..." }.

8. Distributed Tracing (OpenTelemetry)

  • Every request MUST carry a traceparent header.
  • Spans must cover: DB Queries, External API Calls, and Redis operations.

9. Health Checks

  • Liveness (/health/live): "Am I running?" (Instant, no checks).
  • Readiness (/health/ready): "Can I take traffic?" (Check DB/Redis connection).

10. Circuit Breakers

  • Wrap ALL external calls (Payment Gateways, 3rd Party APIs) in a Circuit Breaker.
  • Logic: After 5 failures, fail fast for 30s. Don't drown the downstream service.

11. Rate Limiting

  • Protect every public endpoint with a Token Bucket rate limiter (Redis-backed).
  • Differentiate limits by User Role (Anon: 60/min, Pro: 1000/min).

<workflow_rules>

🔧 Workflow Rules

1. The Pre-Flight Checklist

  1. Environment Hardening:
    • Verify all process.env variables at startup using a schema (e.g., t3-env or envalid). If a key is missing, crash immediately. Do not start the server in an undefined state. Before writing a single handler:
  2. Define the DTOs: Request Schema (Zod) and Response Schema.
  3. Define the Error States: What can go wrong? (404, 409, 429).
  4. Define the Data Access: What is the most efficient SQL query?

2. The "No Magic" Rule

  • Avoid "Magical" ORM features (Lazy Loading, Auto-Saving context).
  • Prefer Explicit over Implicit. "Write the SQL (or Query Builder) if the ORM hides expensive logic."

3. Testing Pyramid

  1. Unit: Test Domain Logic in isolation (mock DB).
  2. Integration: Test Feature Slice with a REAL containerized DB (Testcontainers).
  3. E2E: Test critical flows from the "Outside". </workflow_rules>

<audit_and_reference>

📂 Cognitive Audit Cycle

Before committing code:

  1. Is the endpoint under a feature slice? (Not in a generic controller folder).
  2. Is Input Validated with a Schema? (Zero Trust).
  3. Are DB Indexes used? (Run EXPLAIN ANALYZE).
  4. Is the Primary Key UUIDv7? (Index Perf).
  5. Are secrets managed properly? (No hardcoded strings).

🔗 CROSS-SKILL INTEGRATION

SkillBackend Adds...
@frontend-designAPI contracts, CORS config, error responses
@clean-codeInput validation, no raw SQL, dependency security
@tdd-masteryIntegration tests with Testcontainers
@planning-masteryAPI endpoint task breakdown
@debug-masteryStructured logging, distributed tracing

Command: Use these skills to architect "Fortress-Level" backend systems. </audit_and_reference>

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Backend Design AI skill do?

Elite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.

Why use Backend Design on TypingMind?

Because you install it once and use it with any model. Backend Design is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Backend Design in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/xenitV1/claude-code-maestro/tree/main/skills/backend-design. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Backend Design?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Backend Design?

As many as you like. As long as a model supports skills, you can use Backend Design with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Backend Design AI skill free?

Yes. It is published on GitHub by xenitV1 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇