agentleFS
nisarthnisarth/claude-skills-store/skills/engineering/system-design/SKILL.md

system-design

Skill1 starsChanged 7 months agoMITView on GitHub

Design systems, services, and architectures. Trigger with "design a system for", "how should we architect", "system design for", "what's the right architecture for", or when the user needs help with API design, data modeling, or service boundaries.

64 other projects use a version of this, 5 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use data-pipelines, data-engineering and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • YepAPISkill

    data-pipelines

    ETL patterns, cron scheduling, queue-based processing, and batch jobs with Inngest/BullMQ.

    Also in 3 projects that use this

  • travisjneumanSkill

    data-engineering

    ETL/ELT pipelines, data warehousing (BigQuery, Snowflake, Redshift), stream processing (Kafka, Spark Streaming), orchestration (Airflow, Dagster, Prefect), dbt transformations, and data lake architecture. Use when building data pipelines, designing warehouse schemas, or implementing real-time data processing.

    Also in 4 projects that use this

  • wpankSkill

    caching

    Caching strategies, invalidation, eviction policies, HTTP caching, distributed caching, and anti-patterns. Use when designing cache layers, choosing eviction policies, debugging stale data, or optimizing read-heavy workloads.

    Also in 3 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 12 projects that use this

  • mmondoraSkill

    infrastructure-as-code

    Infrastructure as Code with Terraform and Pulumi. State management, modularity, drift detection, secrets handling. Use when provisioning cloud resources, writing Terraform/Pulumi modules, or managing infrastructure configuration.

    Also in 3 projects that use this

  • ayudaySkill

    autoplan

    Auto-review pipeline — reads the full CEO, design, and eng review skills from disk and runs them sequentially with auto-decisions using 6 decision principles. Surfaces taste decisions (close approaches, borderline scope, codex disagreements) at a final approval gate. One command, fully reviewed plan out. Use when asked to "auto review", "autoplan", "run all reviews", "review this plan automatically", or "make the decisions for me". Proactively suggest when the user has a plan file and wants to run the full review gauntlet without answering 15-30 intermediate questions.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 50 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before designing anything, establish what the system needs to do.

    line 34
  2. Distinctive:

    If the user hasn't specified these, ask the most critical questions before proceeding.

    line 56
  3. Distinctive:

    Use consistent naming conventions (snake_case or camelCase, pick one).

    line 149
  4. Distinctive:

    Use standard HTTP status codes correctly.

    line 151
  5. Distinctive:

    Document error responses as carefully as success responses.

    line 154
  6. Distinctive:

    Start with requirements, not technology.

    line 242
  7. Distinctive:

    Every component should justify its existence.

    line 244
  8. Distinctive:

    Document your assumptions.

    line 248
  9. Distinctive:

    Start with a monolith, extract services when you have clear boundaries.

    line 249

“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

System Design

Design systems, APIs, data models, and service architectures. Start from requirements and constraints, work through trade-offs, and produce a concrete design with diagrams, schemas, and interface definitions.

Workflow

Step 1: Clarify Requirements

Before designing anything, establish what the system needs to do.

Functional Requirements

  • What are the core use cases? List them explicitly.
  • What are the inputs and outputs for each use case?
  • What are the user-facing operations (reads vs. writes)?
  • What are the non-obvious requirements (search, analytics, notifications)?

Non-Functional Requirements

  • Scale: How many users? Requests per second? Data volume?
  • Latency: What response times are acceptable? (p50, p99)
  • Availability: What uptime is required? (99.9% = 8.7 hours downtime/year)
  • Consistency: Can we tolerate eventual consistency, or do we need strong?
  • Durability: What data loss is acceptable? (zero for financial, some for analytics)
  • Compliance: GDPR, HIPAA, SOC 2, PCI-DSS constraints?

Constraints

  • Team size and expertise.
  • Budget (infrastructure, third-party services).
  • Timeline (MVP vs. production-grade).
  • Existing infrastructure to integrate with.

If the user hasn't specified these, ask the most critical questions before proceeding. Don't design in a vacuum.

Step 2: High-Level Architecture

Sketch the major components and how they interact:

  • Client layer: What clients exist (web, mobile, API consumers)?
  • API layer: How do clients communicate with the backend?
  • Service layer: What are the core services and their responsibilities?
  • Data layer: What data stores are needed and why?
  • Infrastructure: CDN, load balancer, message queue, cache, search.

Represent this as a text-based diagram:

[Client] --> [API Gateway / Load Balancer]
                    |
         +----------+----------+
         |          |          |
    [Auth Svc]  [Core Svc]  [Notification Svc]
         |          |          |
    [User DB]  [Main DB]   [Queue]
                [Cache]

Step 3: Data Model

Design the core data entities and their relationships:

-- Example: E-commerce order system
CREATE TABLE users (
    id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    email       VARCHAR(255) UNIQUE NOT NULL,
    name        VARCHAR(255) NOT NULL,
    created_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE TABLE orders (
    id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id     UUID NOT NULL REFERENCES users(id),
    status      VARCHAR(50) NOT NULL DEFAULT 'pending',
    total_cents BIGINT NOT NULL,
    created_at  TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE INDEX idx_orders_user_id ON orders(user_id);
CREATE INDEX idx_orders_status ON orders(status) WHERE status != 'completed';

Consider:

  • Primary keys: UUID vs. auto-increment (distributed systems favor UUIDs).
  • Indexes: Design for your query patterns, not just the schema.
  • Denormalization: Where is read performance more important than write simplicity?
  • Partitioning: Will any table grow beyond what a single node can handle?
  • Soft deletes vs. hard deletes: Compliance and audit trail requirements.

Step 4: API Design

Define the interface between components:

## API: Order Service

### Create Order
POST /api/v1/orders
Auth: Bearer token (required)
Rate limit: 10 req/min per user

Request:
{
  "items": [
    { "product_id": "uuid", "quantity": 1 }
  ],
  "shipping_address_id": "uuid"
}

Response: 201 Created
{
  "id": "uuid",
  "status": "pending",
  "total_cents": 4999,
  "created_at": "2024-01-15T10:30:00Z"
}

Errors:
- 400: Invalid input (missing items, invalid product_id)
- 401: Not authenticated
- 409: Insufficient stock
- 429: Rate limit exceeded

Design principles:

  • Use consistent naming conventions (snake_case or camelCase, pick one).
  • Version your API from the start (/v1/).
  • Use standard HTTP status codes correctly.
  • Design for idempotency on write operations.
  • Include pagination for list endpoints.
  • Document error responses as carefully as success responses.

Step 5: Analyze Trade-offs

For each significant design decision, document:

  • What are the alternatives?
  • Why did we choose this option?
  • What are we giving up?
  • Under what conditions would we revisit this decision?

Step 6: Address Cross-Cutting Concerns

  • Authentication and authorization: How are users identified? What access control model?
  • Observability: Logging, metrics, tracing, alerting.
  • Error handling: Retry strategies, circuit breakers, dead letter queues.
  • Security: Encryption at rest and in transit, input validation, rate limiting.
  • Deployment: CI/CD, blue-green, canary, rollback strategy.
  • Disaster recovery: Backup strategy, failover, RTO/RPO targets.

Output Format

# System Design: <System Name>

## Requirements

### Functional
- <requirement 1>
- <requirement 2>

### Non-Functional
- Scale: <numbers>
- Latency: <targets>
- Availability: <target>

### Constraints
- <constraint>

## Architecture

<text-based diagram>

### Components
| Component       | Responsibility           | Technology    | Why            |
|-----------------|--------------------------|---------------|----------------|
| API Gateway     | Routing, rate limiting   | Kong / Nginx  | Team expertise |
| Order Service   | Order lifecycle          | Node.js       | Existing stack |
| PostgreSQL      | Transactional data       | PostgreSQL 16 | ACID needed    |
| Redis           | Session cache, rate limits | Redis 7     | Low latency    |

## Data Model

<schema with key indexes and relationships>

## API Design

<endpoint definitions with request/response examples>

## Key Design Decisions

### Decision 1: <Title>
**Choice**: <what we chose>
**Alternatives**: <what else we considered>
**Rationale**: <why>
**Trade-off**: <what we gave up>

## Scalability Plan

How the system grows from current scale to 10x and 100x.

## Open Questions

- <unresolved question that needs more input>

Examples

User: "Design a URL shortener" Action: Clarify scale (how many URLs/day, read:write ratio), design a simple service with hash-based short codes, a key-value store for lookups, and a redirect service. Address analytics, expiration, and abuse prevention.

User: "How should we architect our notification system?" Action: Clarify notification types (email, push, in-app, SMS), volume, latency requirements. Design a fan-out architecture with a message queue, delivery services per channel, and user preference management.

User: "Design the API for our billing service" Action: Focus on API design: endpoints for subscriptions, invoices, payments, and webhooks. Include idempotency keys, error handling, and webhook retry logic.

Best Practices

  • Start with requirements, not technology. "We need Kafka" is a solution. "We need to process 50k events/sec with at-least-once delivery" is a requirement.
  • Design for the scale you'll have in 12 months, not 5 years. Over-engineering is as costly as under-engineering.
  • Every component should justify its existence. Each new service adds operational overhead, network hops, and failure modes.
  • Favor boring technology. Mature, well-understood tools have fewer surprises than cutting-edge ones.
  • Make the common case fast, the uncommon case possible. Optimize for your actual traffic patterns.
  • Design for failure. Every network call can fail. Every service can go down. Plan for it explicitly.
  • Document your assumptions. When they change, you'll know which parts of the design to revisit.
  • Start with a monolith, extract services when you have clear boundaries. Premature microservices create distributed monoliths.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.