agentleFS
BappozBappoz/My-Claude-Skills/skills/engineering/system-design/SKILL.md

system-design

Skill1 starsChanged 4 months agoMITView on GitHub

Design de sistemas em escala: estimativas de capacidade, sharding, replicação, cache, filas, consistência, idempotência e trade-offs de disponibilidade. Use quando o usuário mencionar: "design de sistema", "como escalar", "system design", "projetar API", "modelar dados em escala", "cache", "fila", "consistência", "sharding", "milhões de usuários", "entrevista de system design".

64 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use data-pipelines, data-engineering and 6 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

  • 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

  • mjunaidcaSkill

    kubernetes

    Production-grade Kubernetes manifests and debugging for containerized applications. This skill should be used when users ask to deploy to Kubernetes, create K8s manifests, containerize for K8s, set up Deployments/Services/Jobs/StatefulSets/CronJobs, create namespaces with resource quotas, set up multi-team isolation, configure ResourceQuota/ LimitRange, secure with RBAC (ServiceAccount, Role, RoleBinding), configure init containers (model download, db wait, migrations), set up sidecars (logging, metrics), or debug pods (CrashLoopBackOff, logs, exec, describe, events). Auto-detects from Dockerfile/code, generates hardened manifests with educational comments. CKAD-aligned.

    Also in 3 projects that use this

The file

Files
SKILL.md

System Design

Você atua como engenheiro de sistemas distribuídos. Objetivo: projetar sistemas que escalam e não perdem dados, começando por números (capacidade) e escolhendo mecanismos por trade-off, não por moda.

Método (sempre nesta ordem)

  1. Requisitos — funcionais (o que faz) + não-funcionais (QPS, latência p99, disponibilidade, tamanho de dados, consistência).
  2. Estimativa de capacidade — back-of-envelope: QPS de leitura/escrita, storage/dia, banda, memória de cache. Números guiam tudo.
  3. API + modelo de dados — contratos e entidades primeiro.
  4. Diagrama de alto nível — cliente → LB → serviços → dados.
  5. Escalar cada gargalo — cache, réplicas, sharding, fila — justificando.
  6. Tratar falhas — o que quebra e como o sistema degrada.

Back-of-envelope (decore as ordens de grandeza)

1 dia ≈ 86.400 s ≈ 10^5 s
1M req/dia ≈ ~12 req/s   |   1B req/dia ≈ ~12.000 req/s
Leitura:escrita típico ≈ 100:1 (rede social) — dimensiona cache/réplica
Latências (Jeff Dean): mem 100ns · SSD 16µs · rede DC 500µs · disco 10ms · rede EUA↔EU 150ms

Blocos de construção

BlocoResolveCuidado
Cache (Redis/CDN)Leitura repetida, latênciaInvalidação, stampede, staleness
Read replicaEscala de leituraLag de replicação (consistência eventual)
ShardingEscala de escrita/storageHot shard, rebalanceamento, joins cross-shard
Fila (Kafka/SQS)Desacoplar, picos, asyncOrdem, entrega ≥1 → idempotência obrigatória
Load balancerDistribuir, HAHealth checks, sticky sessions
Índice/Busca (ES)Query full-text/ad-hocSincronizar com fonte de verdade

Consistência — escolha consciente

  • CAP na prática: em partição, escolha C (rejeita) ou A (responde possivelmente stale). Rede vai particionar.
  • Forte onde erro custa dinheiro/segurança (saldo, estoque, pagamento → ver [[payment-systems]]).
  • Eventual onde stale por segundos é aceitável (feed, contadores, cache).
  • Idempotência é o que torna "entrega pelo menos uma vez" seguro. Toda operação de escrita via fila/retry precisa de chave idempotente.

Padrões recorrentes

  • CQRS — separar caminho de escrita (normalizado) do de leitura (desnormalizado/materializado).
  • Outbox — publicar evento e gravar no DB atomicamente (evita perder mensagem).
  • Rate limiting — token bucket na borda.
  • Circuit breaker + backoff — falha de dependência não vira cascata.
  • Bulkhead / timeout — isolar recursos para conter falha.

Fluxo de entrevista/spec (checklist rápido)

Requisitos → capacidade → API → dados → alto nível → gargalos → falhas → trade-offs finais.

Recursos externos

RecursoO que pegar
System Design Primer (GitHub)Referência canônica: caches, sharding, CAP, exemplos completos.
ByteByteGoDiagramas e estudos de caso de sistemas reais.
Designing Data-Intensive ApplicationsA bíblia de consistência, replicação, partição, streams.
Latency Numbers Every Programmer Should KnowTabela de latências para estimativas.
AWS Builders' LibraryPadrões de produção (timeouts, retries, jitter).
High ScalabilityArquiteturas reais de grandes produtos.

Do / Don't

DoDon't
Começar por números de capacidadeIr direto pra caixinhas
Escolher consistência por caso"Forte em tudo" ou "eventual em tudo"
Idempotência em escrita asyncConfiar em entrega exatamente-uma-vez
Justificar cada componenteAdicionar Kafka "porque sim"

Checklist

  • Requisitos funcionais + não-funcionais (QPS, p99, disponibilidade)
  • Estimativa de capacidade feita
  • API + modelo de dados definidos
  • Cada mecanismo (cache/shard/fila) justificado por gargalo real
  • Consistência escolhida por caso, com idempotência onde há retry
  • Modos de falha e degradação descritos

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.