[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AAT92MEKMJ9B9KCDKE9CRA":3,"skill-same:01M7AAT92MEKMJ9B9KCDKE9CRA":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":5,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7AAT92MEKMJ9B9KCDKE9CRA","system-design-audit",null,"Audit a codebase — a single directory, a service, or a whole repo — against system design principles from Designing Data-Intensive Applications, Clean Architecture, and Release It!, and report violations. Checks data modeling, storage and indexing, replication and partitioning, transactions and isolation, failure handling and idempotency, messaging and streams, caching, API and layer boundaries, plus redundancy and inefficiency in the code itself. Use this whenever the user asks to audit, review, or assess a system's design, architecture, scalability, data layer, or \"is this production-ready \u002F will this scale\"; when they point at a directory and ask what's wrong with the design; when they mention race conditions, consistency, sharding, hot partitions, retries, duplicate messages, cache invalidation, N+1 queries, coupling, or layering; and proactively before a service ships or gets scaled up. Read-only — it reports findings and never edits code. DO NOT USE for pure formatting or style nits, test-suite review, dependency upgrades, UI\u002Ffrontend visual design, or writing new features from scratch.","mmedhat1910\u002Fskills","mmedhat1910","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F30694445?v=4","01M7AASTAV5BZMZ8QNF3RCNXJE","Mohamed Medhat","01M7AASTBX9G70F8DJF9MKQN45",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: system-design-audit\ndescription: Audit a codebase — a single directory, a service, or a whole repo — against system design principles from Designing Data-Intensive Applications, Clean Architecture, and Release It!, and report violations. Checks data modeling, storage and indexing, replication and partitioning, transactions and isolation, failure handling and idempotency, messaging and streams, caching, API and layer boundaries, plus redundancy and inefficiency in the code itself. Use this whenever the user asks to audit, review, or assess a system's design, architecture, scalability, data layer, or \"is this production-ready \u002F will this scale\"; when they point at a directory and ask what's wrong with the design; when they mention race conditions, consistency, sharding, hot partitions, retries, duplicate messages, cache invalidation, N+1 queries, coupling, or layering; and proactively before a service ships or gets scaled up. Read-only — it reports findings and never edits code. DO NOT USE for pure formatting or style nits, test-suite review, dependency upgrades, UI\u002Ffrontend visual design, or writing new features from scratch.\nlicense: MIT\nmetadata:\n  version: \"1.0.0\"\n---\n\n# System Design Audit\n\nYou are auditing a codebase the way a staff engineer reviews a system before it\ncarries real load. The goal is not to list style nits — it is to find the places\nwhere the design will produce **wrong data, lost data, an outage, an\nunscalable bottleneck, or a change nobody can safely make**, and to say so with\nenough precision that someone can act on it.\n\nThis skill is **read-only**. You produce a findings report. You do not edit\nsource files, run migrations, or refactor. If the user asks you to fix\nsomething afterward, that is a separate request they can make once they've seen\nthe report.\n\n## Why findings-only, and why severity matters\n\nAn audit that dumps forty observations of equal weight is worse than useless —\nthe reader can't tell the lost-update bug from the naming quibble, so they act\non neither. Every finding you report costs the reader attention. Spend that\nbudget on things that change behaviour under load, under failure, or under\nchange. A finding that survives the question *\"what breaks, concretely, and\nwhen?\"* is worth reporting. One that doesn't is noise.\n\n## Process\n\n### 1. Scope\n\nEstablish exactly what you're auditing before you read deeply.\n\n- If the user named a path, audit that path. If they named a service or module,\n  resolve it to a path first.\n- If they said \"the whole thing,\" start at the repo root but still audit in\n  slices — a whole-repo audit that treats every file equally will run out of\n  attention before it reaches the important code.\n- Ask only if the target is genuinely ambiguous. A reasonable default (the main\n  source directory, excluding vendored deps, build output, and generated code)\n  beats a blocking question.\n\nState the scope in one line at the top of your report so the reader knows what\nyou did and did not look at.\n\n### 2. Map the system\n\nBefore judging anything, build a picture of what this system *is*. Read entry\npoints, config, schema\u002Fmigrations, and dependency manifests. You are looking for:\n\n- **Data stores** — which engines, what schemas, what indexes, what migrations.\n- **Boundaries** — HTTP\u002FRPC handlers, event consumers, scheduled jobs, CLI entry\n  points. These are where the system meets the outside world and where most\n  design assumptions get violated.\n- **State that crosses a process boundary** — queues, caches, shared tables,\n  external APIs. Every one of these can fail independently, and the code either\n  accounts for that or doesn't.\n- **Concurrency** — anything that can run twice at once: multiple replicas, worker\n  pools, retried requests, cron overlapping itself.\n- **Scale signals** — table sizes, fan-out patterns, loops over collections that\n  grow with users or time.\n\nWrite down what the system's *implicit* assumptions are. Most serious findings\nare an assumption the code makes that reality won't honour: \"reads see writes\nimmediately,\" \"this message arrives once,\" \"this loop is over a small list,\"\n\"only one process touches this row.\"\n\n### 3. Route to the relevant checks\n\nLoad only the reference files that match what you actually found in step 2.\nReading all of them for a stateless CLI tool wastes context and dilutes the\nreport.\n\n| If the system has… | Read |\n|---|---|\n| A database, schema, or migrations | [references\u002Fdata-modeling.md](references\u002Fdata-modeling.md) |\n| Queries, indexes, ORMs, reporting | [references\u002Fstorage-and-indexing.md](references\u002Fstorage-and-indexing.md) |\n| Replicas, shards, caches, multi-region | [references\u002Freplication-partitioning.md](references\u002Freplication-partitioning.md) |\n| Transactions, money, counters, concurrent writes | [references\u002Ftransactions-consistency.md](references\u002Ftransactions-consistency.md) |\n| Network calls, retries, timeouts, external APIs | [references\u002Freliability-and-failure.md](references\u002Freliability-and-failure.md) |\n| Queues, events, streams, background jobs, webhooks | [references\u002Fmessaging-and-streams.md](references\u002Fmessaging-and-streams.md) |\n| Layers, modules, services, dependency injection | [references\u002Farchitecture-boundaries.md](references\u002Farchitecture-boundaries.md) |\n| Any code at all | [references\u002Fredundancy-and-efficiency.md](references\u002Fredundancy-and-efficiency.md) |\n\n[references\u002Faudit-checklist.md](references\u002Faudit-checklist.md) is the condensed\npass — the question list to sweep once you've read the relevant domain files.\nRead it last, as the check that you didn't miss a category.\n\n### 4. Verify before reporting\n\nA finding you haven't verified in the code is a guess, and guesses destroy the\nreport's credibility faster than missing findings do. For each candidate:\n\n- **Locate it.** You need a real `file:line`. If you can't point at the code,\n  you don't have a finding.\n- **Trace the failure.** Describe the concrete sequence that produces the bad\n  outcome — two requests interleaving, a retry after a timeout, a partition\n  hitting one shard. If you can't construct the sequence, the finding is\n  speculative; either drop it or mark it explicitly as a question.\n- **Check for an existing mitigation.** The unique index, the advisory lock, the\n  idempotency key, the `SELECT … FOR UPDATE` may be somewhere you haven't\n  looked. Search for it before claiming its absence. Falsely reporting a fixed\n  problem trains the reader to ignore you.\n- **Respect deliberate tradeoffs.** If an ADR, comment, or README explains why\n  something is the way it is, that's a decision, not a defect. You may still\n  flag it if the tradeoff has since become dangerous — but engage with the\n  stated reasoning rather than ignoring it.\n\n### 5. Report\n\nUse the structure below. It exists so the reader can triage in thirty seconds\nand then drill in.\n\n````markdown\n# System Design Audit — \u003Cscope>\n\n**Scope:** \u003Cpaths audited, and what was deliberately excluded>\n**Stack:** \u003Clanguages, datastores, queues, caches observed>\n**Overall:** \u003C2–4 sentences. What kind of system is this, what shape is it in,\nand what is the single most important thing to fix?>\n\n## Findings\n\n### [CRITICAL] \u003COne-line claim>\n- **Where:** `path\u002Fto\u002Ffile.ext:120-134`\n- **Principle:** \u003Cthe design principle violated, named plainly — \"Read-after-write\n  consistency\", \"Lost update\", \"The dependency rule\". No book or chapter here.>\n- **What happens:** \u003Cthe concrete failure sequence — inputs, interleaving, and the wrong outcome>\n- **Trigger:** \u003Cwhat conditions surface it: concurrency, scale, a retry, a replica lag spike>\n- **Direction:** \u003Cwhat a fix looks like, 1–3 sentences. Not a patch — a direction.>\n\n### [HIGH] …\n### [MEDIUM] …\n### [LOW] …\n\n## Observations\n\n\u003CThings worth knowing that aren't defects: risky-but-deliberate tradeoffs,\nmissing signals you'd want (no metrics on the queue depth), places the design\nis good and shouldn't be disturbed.>\n\n## Not assessed\n\n\u003CHonest list of what you couldn't reach: config not in the repo, infra defined\nelsewhere, a subsystem out of scope. This matters — silence here reads as\n\"clean,\" which is a lie.>\n\n## Further reading\n\nIf you want to go deeper on the principles behind the findings above:\n\n\u003CBook Name: Chapter N, Chapter M — one short phrase naming the topics covered>\n````\n\n### Keep citations out of the findings\n\nName the principle in plain language inside each finding. A reader working\nthrough a CRITICAL wants the mechanism and the fix, and a parenthetical chapter\nreference interrupts that without helping them act. Collect the sources once, at\nthe end, in the *Further reading* section — that way they're there for whoever\nwants them and invisible to whoever doesn't.\n\nBuild that list from the references you actually loaded, and only for topics\nthat produced findings. Citing a chapter you didn't draw on is padding. Use this\nmapping:\n\n| Topic in your findings | Cite |\n|---|---|\n| Data models, document vs relational | Designing Data-Intensive Applications: Chapter 2 |\n| Indexes, query cost, OLTP vs OLAP | Designing Data-Intensive Applications: Chapter 3 |\n| Encoding, schema evolution, compatibility | Designing Data-Intensive Applications: Chapter 4 |\n| Replication lag, read-after-write, failover | Designing Data-Intensive Applications: Chapter 5 |\n| Partitioning, skew, rebalancing | Designing Data-Intensive Applications: Chapter 6 |\n| Transactions, isolation, lost updates, write skew | Designing Data-Intensive Applications: Chapter 7 |\n| Timeouts, clocks, partial failure | Designing Data-Intensive Applications: Chapter 8 |\n| Consistency guarantees, consensus, distributed locks | Designing Data-Intensive Applications: Chapter 9 |\n| Batch processing | Designing Data-Intensive Applications: Chapter 10 |\n| Queues, streams, delivery semantics, outbox | Designing Data-Intensive Applications: Chapter 11 |\n| Layer boundaries, the dependency rule | Clean Architecture: Chapters 17–22 |\n| Component coupling and cohesion | Clean Architecture: Chapters 13–14 |\n| Retries, circuit breakers, bulkheads, degradation | Release It!: Chapters 4–5 |\n| Module depth, interface design | A Philosophy of Software Design: Chapters 4–6 |\n| Duplication, naming, function design | Clean Code: Chapters 2–3, 17 |\n| Refactoring mechanics and smells | Refactoring: Chapter 3 |\n\nFormat it as one line per book, chapters comma-separated:\n\n```\n**Further reading**\n\n- Designing Data-Intensive Applications: Chapter 5, Chapter 7, Chapter 11 —\n  replication lag, lost updates, and delivery semantics.\n- Clean Architecture: Chapters 17–22 — the dependency rule.\n- Release It!: Chapters 4–5 — timeouts and cascading failure.\n```\n\n### Severity\n\nRank by **blast radius × likelihood**, not by how interesting the problem is.\n\n- **CRITICAL** — Data is silently lost, corrupted, or wrong; or the system takes\n  a full outage under conditions that will occur normally. Money, auth, and\n  durability bugs live here.\n- **HIGH** — Fails under realistic load, concurrency, or a single dependency's\n  failure. Not happening yet, but it will, and recovery is manual.\n- **MEDIUM** — A design flaw with real cost: a bottleneck that will need\n  rearchitecting, a boundary violation that will make the next change expensive.\n- **LOW** — Genuine improvement, no failure mode. Keep these few; if you have\n  more than a handful, you're padding.\n\nIf nothing critical exists, say so plainly. \"No critical findings\" is a valuable\nresult, and a report that manufactures a CRITICAL to seem thorough is worse than\none that reports honestly.\n\n## What separates a good finding from a bad one\n\n**Bad:** \"The `orders` table lacks an index on `user_id`, which may cause slow\nqueries.\"\n\nWhy it's bad: no location, no failure sequence, hedged with \"may,\" and it might\nalready be covered by a composite index the auditor didn't check.\n\n**Good:** \"`OrderRepository.findByUser` (`src\u002Forders\u002Frepo.go:88`) filters on\n`user_id` with no matching index — the only index on `orders` is the primary key\n(`migrations\u002F003_orders.sql:12`). Every call is a full table scan. At the current\n~2M rows this is already ~400ms; it degrades linearly with order volume and will\nlock up the connection pool once the dashboard, which calls this per page load,\nsees concurrent traffic.\"\n\nWhy it's good: exact location, evidence that the mitigation genuinely isn't\nthere, the mechanism, and the specific conditions that turn it into an outage.\n\nApply the same standard to design-level findings. \"This violates the dependency\nrule\" means nothing on its own; \"`domain\u002Finvoice.py:14` imports the SQLAlchemy\nsession directly, so the invoice calculation rules can't be tested or reused\nwithout a live database, and swapping the store means editing domain logic\" is a\nfinding.\n\n## Things that reliably go wrong, and are easy to miss\n\nThese are the patterns worth actively hunting rather than waiting to stumble on.\nFull treatment is in the reference files; this is the \"look here first\" list.\n\n- **Read-modify-write without protection.** Fetch a row, compute in application\n  code, write it back. Correct with one process, silently wrong with two. Money\n  and counters are where this hurts.\n- **Retries without idempotency.** Any network call that can time out will be\n  retried — by a client, a proxy, a queue, or a human. If the handler isn't\n  idempotent, retries duplicate the effect.\n- **At-least-once treated as exactly-once.** Nearly every queue redelivers.\n  Consumers that assume single delivery corrupt state on every redelivery.\n- **Unbounded anything.** Queries without limits, queues without depth caps,\n  in-memory collections that grow with traffic, `for` loops over \"all users.\"\n  These work in dev and fall over in production.\n- **Reads routed to a replica right after a write.** The write succeeded, the\n  read doesn't see it, the user is told their action failed.\n- **Cache invalidation with no ordering guarantee.** Populate and invalidate\n  racing produces a cache entry that never expires and never matches reality.\n- **A partition key with skew.** Tenant ID, country, `status = 'active'` — any\n  key where one value dominates makes one shard the whole system.\n- **The dependency rule pointing outward.** Business logic importing the\n  framework, the ORM, or the HTTP layer. Everything downstream — testing,\n  reuse, replacement — gets harder.\n- **Schema changes assuming a synchronised deploy.** During any rolling deploy,\n  old and new code run at once against one schema. A change that only works\n  after everything restarts causes errors in the window.\n\n## Self-check before delivering\n\nRead your own report as the engineer who owns this code:\n\n- Does every finding have a real `file:line` you actually opened?\n- Can you state the failure sequence for each one, concretely?\n- Did you search for the mitigation before claiming it's missing?\n- Is the severity ranking honest — would you defend a CRITICAL in review?\n- Did you say what you didn't look at?\n- Is the top finding actually the most important thing? The reader's attention\n  is highest on the first item; put the right thing there.\n- Did you avoid editing anything?\n","# System Design Audit\n\nYou are auditing a codebase the way a staff engineer reviews a system before it\ncarries real load. The goal is not to list style nits — it is to find the places\nwhere the design will produce **wrong data, lost data, an outage, an\nunscalable bottleneck, or a change nobody can safely make**, and to say so with\nenough precision that someone can act on it.\n\nThis skill is **read-only**. You produce a findings report. You do not edit\nsource files, run migrations, or refactor. If the user asks you to fix\nsomething afterward, that is a separate request they can make once they've seen\nthe report.\n\n## Why findings-only, and why severity matters\n\nAn audit that dumps forty observations of equal weight is worse than useless —\nthe reader can't tell the lost-update bug from the naming quibble, so they act\non neither. Every finding you report costs the reader attention. Spend that\nbudget on things that change behaviour under load, under failure, or under\nchange. A finding that survives the question *\"what breaks, concretely, and\nwhen?\"* is worth reporting. One that doesn't is noise.\n\n## Process\n\n### 1. Scope\n\nEstablish exactly what you're auditing before you read deeply.\n\n- If the user named a path, audit that path. If they named a service or module,\n  resolve it to a path first.\n- If they said \"the whole thing,\" start at the repo root but still audit in\n  slices — a whole-repo audit that treats every file equally will run out of\n  attention before it reaches the important code.\n- Ask only if the target is genuinely ambiguous. A reasonable default (the main\n  source directory, excluding vendored deps, build output, and generated code)\n  beats a blocking question.\n\nState the scope in one line at the top of your report so the reader knows what\nyou did and did not look at.\n\n### 2. Map the system\n\nBefore judging anything, build a picture of what this system *is*. Read entry\npoints, config, schema\u002Fmigrations, and dependency manifests. You are looking for:\n\n- **Data stores** — which engines, what schemas, what indexes, what migrations.\n- **Boundaries** — HTTP\u002FRPC handlers, event consumers, scheduled jobs, CLI entry\n  points. These are where the system meets the outside world and where most\n  design assumptions get violated.\n- **State that crosses a process boundary** — queues, caches, shared tables,\n  external APIs. Every one of these can fail independently, and the code either\n  accounts for that or doesn't.\n- **Concurrency** — anything that can run twice at once: multiple replicas, worker\n  pools, retried requests, cron overlapping itself.\n- **Scale signals** — table sizes, fan-out patterns, loops over collections that\n  grow with users or time.\n\nWrite down what the system's *implicit* assumptions are. Most serious findings\nare an assumption the code makes that reality won't honour: \"reads see writes\nimmediately,\" \"this message arrives once,\" \"this loop is over a small list,\"\n\"only one process touches this row.\"\n\n### 3. Route to the relevant checks\n\nLoad only the reference files that match what you actually found in step 2.\nReading all of them for a stateless CLI tool wastes context and dilutes the\nreport.\n\n| If the system has… | Read |\n|---|---|\n| A database, schema, or migrations | [references\u002Fdata-modeling.md](references\u002Fdata-modeling.md) |\n| Queries, indexes, ORMs, reporting | [references\u002Fstorage-and-indexing.md](references\u002Fstorage-and-indexing.md) |\n| Replicas, shards, caches, multi-region | [references\u002Freplication-partitioning.md](references\u002Freplication-partitioning.md) |\n| Transactions, money, counters, concurrent writes | [references\u002Ftransactions-consistency.md](references\u002Ftransactions-consistency.md) |\n| Network calls, retries, timeouts, external APIs | [references\u002Freliability-and-failure.md](references\u002Freliability-and-failure.md) |\n| Queues, events, streams, background jobs, webhooks | [references\u002Fmessaging-and-streams.md](references\u002Fmessaging-and-streams.md) |\n| Layers, modules, services, dependency injection | [references\u002Farchitecture-boundaries.md](references\u002Farchitecture-boundaries.md) |\n| Any code at all | [references\u002Fredundancy-and-efficiency.md](references\u002Fredundancy-and-efficiency.md) |\n\n[references\u002Faudit-checklist.md](references\u002Faudit-checklist.md) is the condensed\npass — the question list to sweep once you've read the relevant domain files.\nRead it last, as the check that you didn't miss a category.\n\n### 4. Verify before reporting\n\nA finding you haven't verified in the code is a guess, and guesses destroy the\nreport's credibility faster than missing findings do. For each candidate:\n\n- **Locate it.** You need a real `file:line`. If you can't point at the code,\n  you don't have a finding.\n- **Trace the failure.** Describe the concrete sequence that produces the bad\n  outcome — two requests interleaving, a retry after a timeout, a partition\n  hitting one shard. If you can't construct the sequence, the finding is\n  speculative; either drop it or mark it explicitly as a question.\n- **Check for an existing mitigation.** The unique index, the advisory lock, the\n  idempotency key, the `SELECT … FOR UPDATE` may be somewhere you haven't\n  looked. Search for it before claiming its absence. Falsely reporting a fixed\n  problem trains the reader to ignore you.\n- **Respect deliberate tradeoffs.** If an ADR, comment, or README explains why\n  something is the way it is, that's a decision, not a defect. You may still\n  flag it if the tradeoff has since become dangerous — but engage with the\n  stated reasoning rather than ignoring it.\n\n### 5. Report\n\nUse the structure below. It exists so the reader can triage in thirty seconds\nand then drill in.\n\n````markdown\n# System Design Audit — \u003Cscope>\n\n**Scope:** \u003Cpaths audited, and what was deliberately excluded>\n**Stack:** \u003Clanguages, datastores, queues, caches observed>\n**Overall:** \u003C2–4 sentences. What kind of system is this, what shape is it in,\nand what is the single most important thing to fix?>\n\n## Findings\n\n### [CRITICAL] \u003COne-line claim>\n- **Where:** `path\u002Fto\u002Ffile.ext:120-134`\n- **Principle:** \u003Cthe design principle violated, named plainly — \"Read-after-write\n  consistency\", \"Lost update\", \"The dependency rule\". No book or chapter here.>\n- **What happens:** \u003Cthe concrete failure sequence — inputs, interleaving, and the wrong outcome>\n- **Trigger:** \u003Cwhat conditions surface it: concurrency, scale, a retry, a replica lag spike>\n- **Direction:** \u003Cwhat a fix looks like, 1–3 sentences. Not a patch — a direction.>\n\n### [HIGH] …\n### [MEDIUM] …\n### [LOW] …\n\n## Observations\n\n\u003CThings worth knowing that aren't defects: risky-but-deliberate tradeoffs,\nmissing signals you'd want (no metrics on the queue depth), places the design\nis good and shouldn't be disturbed.>\n\n## Not assessed\n\n\u003CHonest list of what you couldn't reach: config not in the repo, infra defined\nelsewhere, a subsystem out of scope. This matters — silence here reads as\n\"clean,\" which is a lie.>\n\n## Further reading\n\nIf you want to go deeper on the principles behind the findings above:\n\n\u003CBook Name: Chapter N, Chapter M — one short phrase naming the topics covered>\n````\n\n### Keep citations out of the findings\n\nName the principle in plain language inside each finding. A reader working\nthrough a CRITICAL wants the mechanism and the fix, and a parenthetical chapter\nreference interrupts that without helping them act. Collect the sources once, at\nthe end, in the *Further reading* section — that way they're there for whoever\nwants them and invisible to whoever doesn't.\n\nBuild that list from the references you actually loaded, and only for topics\nthat produced findings. Citing a chapter you didn't draw on is padding. Use this\nmapping:\n\n| Topic in your findings | Cite |\n|---|---|\n| Data models, document vs relational | Designing Data-Intensive Applications: Chapter 2 |\n| Indexes, query cost, OLTP vs OLAP | Designing Data-Intensive Applications: Chapter 3 |\n| Encoding, schema evolution, compatibility | Designing Data-Intensive Applications: Chapter 4 |\n| Replication lag, read-after-write, failover | Designing Data-Intensive Applications: Chapter 5 |\n| Partitioning, skew, rebalancing | Designing Data-Intensive Applications: Chapter 6 |\n| Transactions, isolation, lost updates, write skew | Designing Data-Intensive Applications: Chapter 7 |\n| Timeouts, clocks, partial failure | Designing Data-Intensive Applications: Chapter 8 |\n| Consistency guarantees, consensus, distributed locks | Designing Data-Intensive Applications: Chapter 9 |\n| Batch processing | Designing Data-Intensive Applications: Chapter 10 |\n| Queues, streams, delivery semantics, outbox | Designing Data-Intensive Applications: Chapter 11 |\n| Layer boundaries, the dependency rule | Clean Architecture: Chapters 17–22 |\n| Component coupling and cohesion | Clean Architecture: Chapters 13–14 |\n| Retries, circuit breakers, bulkheads, degradation | Release It!: Chapters 4–5 |\n| Module depth, interface design | A Philosophy of Software Design: Chapters 4–6 |\n| Duplication, naming, function design | Clean Code: Chapters 2–3, 17 |\n| Refactoring mechanics and smells | Refactoring: Chapter 3 |\n\nFormat it as one line per book, chapters comma-separated:\n\n```\n**Further reading**\n\n- Designing Data-Intensive Applications: Chapter 5, Chapter 7, Chapter 11 —\n  replication lag, lost updates, and delivery semantics.\n- Clean Architecture: Chapters 17–22 — the dependency rule.\n- Release It!: Chapters 4–5 — timeouts and cascading failure.\n```\n\n### Severity\n\nRank by **blast radius × likelihood**, not by how interesting the problem is.\n\n- **CRITICAL** — Data is silently lost, corrupted, or wrong; or the system takes\n  a full outage under conditions that will occur normally. Money, auth, and\n  durability bugs live here.\n- **HIGH** — Fails under realistic load, concurrency, or a single dependency's\n  failure. Not happening yet, but it will, and recovery is manual.\n- **MEDIUM** — A design flaw with real cost: a bottleneck that will need\n  rearchitecting, a boundary violation that will make the next change expensive.\n- **LOW** — Genuine improvement, no failure mode. Keep these few; if you have\n  more than a handful, you're padding.\n\nIf nothing critical exists, say so plainly. \"No critical findings\" is a valuable\nresult, and a report that manufactures a CRITICAL to seem thorough is worse than\none that reports honestly.\n\n## What separates a good finding from a bad one\n\n**Bad:** \"The `orders` table lacks an index on `user_id`, which may cause slow\nqueries.\"\n\nWhy it's bad: no location, no failure sequence, hedged with \"may,\" and it might\nalready be covered by a composite index the auditor didn't check.\n\n**Good:** \"`OrderRepository.findByUser` (`src\u002Forders\u002Frepo.go:88`) filters on\n`user_id` with no matching index — the only index on `orders` is the primary key\n(`migrations\u002F003_orders.sql:12`). Every call is a full table scan. At the current\n~2M rows this is already ~400ms; it degrades linearly with order volume and will\nlock up the connection pool once the dashboard, which calls this per page load,\nsees concurrent traffic.\"\n\nWhy it's good: exact location, evidence that the mitigation genuinely isn't\nthere, the mechanism, and the specific conditions that turn it into an outage.\n\nApply the same standard to design-level findings. \"This violates the dependency\nrule\" means nothing on its own; \"`domain\u002Finvoice.py:14` imports the SQLAlchemy\nsession directly, so the invoice calculation rules can't be tested or reused\nwithout a live database, and swapping the store means editing domain logic\" is a\nfinding.\n\n## Things that reliably go wrong, and are easy to miss\n\nThese are the patterns worth actively hunting rather than waiting to stumble on.\nFull treatment is in the reference files; this is the \"look here first\" list.\n\n- **Read-modify-write without protection.** Fetch a row, compute in application\n  code, write it back. Correct with one process, silently wrong with two. Money\n  and counters are where this hurts.\n- **Retries without idempotency.** Any network call that can time out will be\n  retried — by a client, a proxy, a queue, or a human. If the handler isn't\n  idempotent, retries duplicate the effect.\n- **At-least-once treated as exactly-once.** Nearly every queue redelivers.\n  Consumers that assume single delivery corrupt state on every redelivery.\n- **Unbounded anything.** Queries without limits, queues without depth caps,\n  in-memory collections that grow with traffic, `for` loops over \"all users.\"\n  These work in dev and fall over in production.\n- **Reads routed to a replica right after a write.** The write succeeded, the\n  read doesn't see it, the user is told their action failed.\n- **Cache invalidation with no ordering guarantee.** Populate and invalidate\n  racing produces a cache entry that never expires and never matches reality.\n- **A partition key with skew.** Tenant ID, country, `status = 'active'` — any\n  key where one value dominates makes one shard the whole system.\n- **The dependency rule pointing outward.** Business logic importing the\n  framework, the ORM, or the HTTP layer. Everything downstream — testing,\n  reuse, replacement — gets harder.\n- **Schema changes assuming a synchronised deploy.** During any rolling deploy,\n  old and new code run at once against one schema. A change that only works\n  after everything restarts causes errors in the window.\n\n## Self-check before delivering\n\nRead your own report as the engineer who owns this code:\n\n- Does every finding have a real `file:line` you actually opened?\n- Can you state the failure sequence for each one, concretely?\n- Did you search for the mitigation before claiming it's missing?\n- Is the severity ranking honest — would you defend a CRITICAL in review?\n- Did you say what you didn't look at?\n- Is the top finding actually the most important thing? The reader's attention\n  is highest on the first item; put the right thing there.\n- Did you avoid editing anything?\n",{"name":5,"license":15,"metadata":24,"description":7},{"version":25},"1.0.0","main","4d06cb108868685bfb6491559f63a9f90fe342f1",0,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills","https:\u002F\u002Fgithub.com\u002Fmmedhat1910","linkedin.com\u002Fin\u002Fmmedhat1910","Software Engineer | MSc. Computer Science and Engineering | \r\nPhysics and Mathematics Enthusiast","2026-10-10 01:37:47",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add mmedhat1910\u002Fskills --skill system-design-audit",{"tool":40,"command":41},"bunx","bunx skills add mmedhat1910\u002Fskills --skill system-design-audit",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mmedhat1910\u002Fskills --skill system-design-audit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002FSKILL.md",true,[48,54,58,62,66,70,74,78,82,86],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"evals\u002Fevals.json","REFERENCE","参考文档",4813,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Fevals\u002Fevals.json",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Farchitecture-boundaries.md",9728,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Farchitecture-boundaries.md",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Faudit-checklist.md",6903,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Faudit-checklist.md",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fdata-modeling.md",7400,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Fdata-modeling.md",{"path":67,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fmessaging-and-streams.md",8434,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Fmessaging-and-streams.md",{"path":71,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fredundancy-and-efficiency.md",9576,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Fredundancy-and-efficiency.md",{"path":75,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Freliability-and-failure.md",7994,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Freliability-and-failure.md",{"path":79,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Freplication-partitioning.md",7888,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Freplication-partitioning.md",{"path":83,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fstorage-and-indexing.md",6948,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Fstorage-and-indexing.md",{"path":87,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Ftransactions-consistency.md",9274,"https:\u002F\u002Fgithub.com\u002Fmmedhat1910\u002Fskills\u002Fblob\u002Fmain\u002Fsystem-design-audit\u002Freferences\u002Ftransactions-consistency.md",[]]