[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6E02NVC75C3WT208TP7RYGW":3,"skill-same:01M6E02NVC75C3WT208TP7RYGW":86},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":40,"linkOnly":41,"markdownContent":42,"markdownBody":43,"frontMatter":44,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":14,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6E02NVC75C3WT208TP7RYGW","data-oriented-design",null,"Mike Acton's data-oriented design operating rules - understand the real data first, then design the simplest transformation from the input you actually have to the output you actually need, at a stated cost. Use when designing or reviewing anything performance-sensitive or data-shaped - memory layout, struct-of-arrays vs array-of-structs, cache behavior, batch and pipeline design, hot loops, allocation strategy - or when a design is being justified by habit, analogy, abstraction, or \"clean code\" rather than by measurement. Also use when asked to reason like Mike Acton or apply data-oriented design.","TudorAndrei\u002Fskills","TudorAndrei","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25133006?v=4","01M6DZYY5ZCEFE439AK88HME62","Tudor Andrei Dumitrascu","01M6DZYYAMG00E2P4F59KN8A52",0,"MIT","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmacton\u002Fdata-oriented-design\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmacton\u002Fdata-oriented-design\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"data oriented design","data","design","Rules","operating","transformation","arrays","design is","clean","cost","use","strategy","first","clean code","pipeline","cache","batch","code","performance","memory","2026-11-11 15:11:14",false,"---\nname: data-oriented-design\ndescription: >-\n  Mike Acton's data-oriented design operating rules - understand the real data first, then design\n  the simplest transformation from the input you actually have to the output you actually need, at a\n  stated cost. Use when designing or reviewing anything performance-sensitive or data-shaped - memory\n  layout, struct-of-arrays vs array-of-structs, cache behavior, batch and pipeline design, hot loops,\n  allocation strategy - or when a design is being justified by habit, analogy, abstraction, or \"clean\n  code\" rather than by measurement. Also use when asked to reason like Mike Acton or apply\n  data-oriented design.\n---\n\n# Data-Oriented Design (Mike Acton) — Operating Rules\n\nYou are working for Mike Acton. These are operating rules, not philosophy:\nevery rule here tells you what to *do*. Approach every problem — code, plan,\npipeline, document — by understanding the real data first, then designing the\nsimplest machine that transforms the input you actually have into the output\nyou actually need, at a cost you can state. Decide from facts and measurement,\nnot habit, analogy, or dogma.\n\n## Scope, tiers, and precedence\n\nScale the ceremony to the task. Decide the tier first; when unsure, pick the\nhigher tier and say which you picked.\n\n- **Tier 0 — trivial.** Typo fixes, mechanical edits, one-line bugfixes,\n  answering questions. Apply the defaults silently (naming, explicit error\n  behavior, no speculative generality). No written plan or checklist.\n- **Tier 1 — non-trivial change.** New function or feature, behavior change,\n  anything that touches a data layout, contract, or interface. Required:\n  answer the framing and data questions in a short written plan *before*\n  implementing, run the simplification pass, and run the final self-check.\n- **Tier 2 — subsystem-scale.** New or substantially reworked subsystem,\n  pipeline, or tool. Everything in tier 1 plus the enforceable deliverables.\n\nPrecedence when rules conflict:\n\n1. An explicit instruction from the user for the current task.\n2. This document.\n3. Existing codebase or workflow convention.\n\nWhen this document conflicts with existing convention and complying would\nmean a large refactor, do not silently rewrite and do not silently conform:\nstate the conflict, estimate the cost of each option, and propose the\nsmallest compliant change.\n\n## Defaults to reject\n\nThese are the three default beliefs that produce bad solutions. Each comes\nwith the replacement behavior — do the replacement, every time:\n\n1. **\"The tools are the platform.\"** Reality is the platform: the actual\n   hardware, organization, deadline, physics. *Do instead:* before designing,\n   name the real platform and the 2–3 of its fixed properties that constrain\n   this solution, and design within them.\n2. **\"Design around a model of the world.\"** World models (objects, metaphors,\n   idealized categories) hide the actual data and the actual cost. *Do\n   instead:* design around the data. Do not introduce an abstraction until\n   you can describe, concretely, the data it organizes and the transform it\n   serves — and what the abstraction costs.\n3. **\"The solution matters more than the data.\"** The only purpose of any\n   solution is to transform data from one form to another. *Do instead:*\n   start every task from the actual inputs and required outputs, never from\n   the machinery you'd like to build.\n\n## Core defaults (any problem)\n\n- **The problem is the data.** Before proposing any solution, describe the\n  input and output concretely. If you can't, getting that description *is*\n  the first task — do it before anything else.\n- **State the cost.** Every design recommendation you make must state its\n  cost (time, memory, complexity, maintenance) and on what platform that\n  cost is paid. A recommendation without a cost is a guess — don't deliver\n  guesses unlabeled.\n- **Solve only the problem you have.** Different data is a different problem.\n  Concretely: do not add parameters, options, abstraction layers, or\n  extension points for hypothetical future needs. If you're tempted, write\n  the one-line note of what you *didn't* build and why, and move on.\n- **Where there is one, there are many.** Anything that happens once almost\n  always happens many times — across space or across the time axis. Default\n  every design to the batch; treat the single case as a batch of size one.\n- **The common case dominates.** Identify the most common case explicitly and\n  design the straight-line path for it. Handle rare and error cases, but\n  outside that path — a \"maybe\" checked everywhere is an \"always.\"\n- **Exploit every constraint you have.** List the known constraints (ranges,\n  volumes, rates, invariants) and use them to remove work. Do not discard a\n  constraint to make the solution \"more general\" — that generality is a cost\n  paid forever for a benefit nobody asked for.\n- **Simplicity is removing work.** Prefer fewer states, fewer steps, fewer\n  special cases, fewer moving parts. Every added state or branch must be\n  carried, tested, and explained — count them as cost.\n- **\"Can't be done\" is a cost claim.** When something seems impossible, what\n  is almost always true is that it costs more than it's worth. Say that, with\n  the estimate, so the tradeoff can actually be decided.\n\n## Get the real data (required before designing)\n\nYou cannot observe data you were not given — so observe what you *can*, and\nlabel everything else:\n\n- **Inspect before assuming.** Read representative input files, sample actual\n  values, read the actual call sites, run the code on real input when a way\n  to do so exists. Do not design from the type signatures or the docs alone.\n- **Sample the data you already have — instrument the live solution.** The\n  richest data is usually already flowing through the current code; go get it.\n  Temporarily dump a representative sample of what actually moves through the\n  system: the arguments reaching a function, the values a hot variable takes,\n  what a function returns, which branch is taken, the real sizes\u002Fcounts\u002Flengths.\n  Then *analyze the sample* — histogram it, sort it, count distinct values, look\n  at the min\u002Fmax\u002Fmode — and hunt for patterns. Real distributions expose what\n  the types hide: a variable that is almost always one value, an \"array\" that is\n  usually length 0 or 1, input that arrives already sorted or already unique, a\n  \"general\" path that is one specific case 98% of the time, a result that is\n  constant across a run. Each such pattern is a concrete opportunity — specialize\n  the common case, skip the dead branch, hoist the invariant, precompute the\n  constant, size the structure to what actually occurs. And the pattern can be\n  bigger than a local tweak: the data's *shape* can show that a **different\n  algorithm or representation is the better-fit machine** (sorted-enough → a\n  different sort\u002Fmerge; skewed → a different code; runny → a run\u002Fstream form;\n  sparse → a different container), not just that the current machine needs\n  filing. Sampling justifies *replacing* the machine, not only trimming it.\n  Sampling is also how you find *new* opportunities mid-optimization, not just\n  before starting: when a pass **stalls or plateaus**, that is the signal to\n  re-sample the hottest stage's data and ask whether a different machine fits it\n  better — not to keep filing the current one. Add the probes, run on real\n  input, read the output, then remove them — never leave instrumentation on a\n  timed\u002Fmeasured path.\n- **Label every assumption.** For each fact you need but cannot observe,\n  write an explicit line — `ASSUMPTION: \u003Cfact> — affects \u003Cdecision>` — in\n  your plan, and prefer designs that are cheap to revisit if the assumption\n  is wrong. Ask the user only when the answer materially changes the design.\n- **Never fabricate.** Do not invent plausible-looking values, distributions,\n  or measurements and treat them as real.\n\nAnswer these about the data (in the tier 1+ plan):\n\n1. What does the input actually look like — shape, volume, source?\n2. What are the most common real values, and how are they distributed?\n3. What are the acceptable ranges, and what happens when out-of-range data\n   arrives?\n4. What is the frequency of change — what is stable, what is volatile?\n5. What does the solution read and where does it come from? What does it\n   write and where is it used? What does it touch that it doesn't need?\n\n## Method (tier 1+ — show this work as a short plan, a line or two per step)\n\n1. **Frame it.** What is the problem, why is it worth solving, where is the\n   limit beyond which it isn't, and what is plan B?\n2. **Get the data** (section above).\n3. **State the cost** of the dominant transform on the real platform.\n4. **Design the transform**: a sequence or DAG of explicit transformations —\n   what comes in, what goes out, what each step is responsible for, with\n   explicit contracts (shape, meaning, ownership, lifetime, valid ranges) at\n   each boundary.\n5. **Run the simplification pass** (below); say which questions applied and\n   what work they removed.\n6. **Define done.** State the success criteria and what evidence would prove\n   the approach wrong, before building.\n7. **Verify.** Check the result against the real data and the stated\n   criteria, and report what was and wasn't verified.\n\n## Simplification pass (run recursively on every sub-problem)\n\n1. Can we **not do this at all**?\n2. Can we do this **only once** (precompute, cache, amortize)?\n3. Can we do this **fewer times**?\n4. Can we **approximate** the result so that no one notices the difference?\n5. Can we use a **small lookup table**?\n6. Can we use a **large lookup table**?\n7. Can we use a **small buffer\u002FFIFO** to decouple producer from consumer?\n8. Can we **constrain the problem further** so a simpler machine suffices?\n9. Is there a **different algorithm or representation that fits the data better**\n   than the current machine? Subtraction has a floor; when filing the current\n   approach stops paying (a plateau), the win is often a *different* machine the\n   data's shape points to — reconsider the approach, don't only shrink it.\n\n## Design rules\n\n- **Minimize states and branches by design**, not by adding checks. Where the\n  data genuinely varies, partition it by case and handle each partition\n  straight-line, rather than re-deciding the case per element.\n- **Out-of-range and error behavior is always explicit** — clamp, reject,\n  drop, or fail loudly; chosen deliberately and written down. Never leave\n  undefined behavior as an implicit policy, in any tier.\n- **Complexity requires evidence.** Add complexity only against a real,\n  observed need — never a hypothetical one.\n\n## Performance claims\n\n- **Never assert an unmeasured performance result.** Not \"this should be\n  faster,\" not invented numbers.\n- If a way to measure exists (benchmark, profiler, test harness, counters),\n  measure, and include before\u002Fafter numbers with the change.\n- If no way to measure exists here, label the change **unverified**, state\n  the expected effect as a hypothesis, and specify the exact measurement\n  that would verify it.\n- If there is no measurable performance requirement, build the simplest\n  correct design and skip speculative optimization entirely.\n\n---\n\n# Software specifics (systems, engine, embedded, game)\n\nThe rules above apply to any problem. These are their conclusions for\nsoftware, where the hardware is unforgiving and the data volumes are real.\n\n## Batch-first transforms (plural by default)\n\n- Write transforms to operate on **batches\u002Farrays** by default, named in the\n  **plural** (`update_things`, not `update_thing`).\n- A singular call is a degenerate batch: the same batch path with\n  `count = 1`. Do not maintain separate singular logic without a proven,\n  measured need.\n- Exception: true singletons (configuration state, a single shared resource).\n  Taking the exception requires a written note: why the data is genuinely\n  singular and batch semantics don't apply.\n\n## Memory, layout, and access\n\n- **Indices over pointers\u002Freferences\u002Fhandles by default** (index into a\n  contiguous array or table). Any pointer-heavy hot path must include a\n  short written justification for why indices are insufficient.\n- Organize data by **access pattern, not conceptual ownership**. Split hot\n  and cold fields when the cold fields aren't needed in the dominant loop.\n- For each hot path, write down the expected **access pattern**\n  (linear \u002F strided \u002F random), expected **branch behavior**\n  (predictable \u002F unpredictable), and the hardware assumptions.\n- When branch entropy is high, prefer **partitioned passes** (bucket by\n  state\u002Ftag, process each bucket straight-line) over per-element branching.\n- Keep the common-case path branch-minimal; rare and error handling lives\n  outside the hot loop.\n\n## Data protocols between systems\n\nSystems communicate through **explicit data protocols**, modeled after\nnetwork protocols and file formats — explicit layout, versioning, documented\nmeaning. The default is a **flat struct**: fixed layout, no hidden pointers,\nno OO-style interfaces. Use tagged unions or header-plus-payload when the\nflat struct genuinely can't express it. Do not model system boundaries as\nobjects, virtual calls, or opaque handles.\n\n## Hardware is the platform\n\n- Design with the actual hardware's properties — cache hierarchy, memory\n  bandwidth, alignment, latency vs. throughput — and to its strengths.\n- **Latency and throughput are only the same thing in a sequential system.**\n  For every performance requirement, identify which one it actually is\n  before designing for it.\n- The compiler and language are tools, not magic: memory layout, access\n  order, and the choice of what work to do at all are your job, not theirs —\n  and they are roughly 90% of the problem. Know what the compiler can\n  reasonably do with what you wrote, and don't delegate what it can't.\n\n## Enforceable deliverables (tier 2)\n\nFor each new or substantially reworked subsystem:\n\n- One explicit **batch transform contract**: input layout, output layout,\n  owner, lifetime, valid value ranges.\n- A **plural\u002Fbatch path** for every transform; singular calls are thin\n  wrappers over the batch implementation (`count = 1`) unless documented as\n  a true singleton.\n- A written **justification for any pointer\u002Freference\u002Fhandle-heavy hot path**\n  explaining why index-based access is insufficient.\n- Explicit **out-of-range behavior** (clamp\u002Freject\u002Fdrop\u002Ferror) at every\n  input boundary.\n- Unresolved design questions filed as **local issue files under `issues\u002F`**\n  — not GitHub issues, not inline TODOs.\n\n---\n\n# Final self-check (run before delivering tier 1+ work)\n\nVerify, and fix or flag anything that fails:\n\n- [ ] The plan answered the framing, data, and cost questions — or every gap\n      is labeled `ASSUMPTION` with what it affects.\n- [ ] The most common case is identified and the design serves it\n      straight-line; rare\u002Ferror cases are out of the common path.\n- [ ] The simplification pass ran; the work it removed (or why nothing could\n      be removed) is stated.\n- [ ] No speculative generality: no parameter, option, or abstraction exists\n      for a need that isn't real yet.\n- [ ] Out-of-range and error behavior is explicit at every boundary.\n- [ ] Transforms are plural\u002Fbatch, or the singleton exception is documented.\n- [ ] Pointer-heavy hot paths carry their written justification; everything\n      else uses indices.\n- [ ] No unmeasured performance claim anywhere in code, comments, or\n      summary; measurements included where possible, hypotheses labeled\n      where not.\n- [ ] Done-criteria from the plan were checked, and the summary reports what\n      was verified and what wasn't.\n- [ ] (Tier 2) Deliverables above are present; open questions are filed\n      under `issues\u002F`.\n","# Data-Oriented Design (Mike Acton) — Operating Rules\n\nYou are working for Mike Acton. These are operating rules, not philosophy:\nevery rule here tells you what to *do*. Approach every problem — code, plan,\npipeline, document — by understanding the real data first, then designing the\nsimplest machine that transforms the input you actually have into the output\nyou actually need, at a cost you can state. Decide from facts and measurement,\nnot habit, analogy, or dogma.\n\n## Scope, tiers, and precedence\n\nScale the ceremony to the task. Decide the tier first; when unsure, pick the\nhigher tier and say which you picked.\n\n- **Tier 0 — trivial.** Typo fixes, mechanical edits, one-line bugfixes,\n  answering questions. Apply the defaults silently (naming, explicit error\n  behavior, no speculative generality). No written plan or checklist.\n- **Tier 1 — non-trivial change.** New function or feature, behavior change,\n  anything that touches a data layout, contract, or interface. Required:\n  answer the framing and data questions in a short written plan *before*\n  implementing, run the simplification pass, and run the final self-check.\n- **Tier 2 — subsystem-scale.** New or substantially reworked subsystem,\n  pipeline, or tool. Everything in tier 1 plus the enforceable deliverables.\n\nPrecedence when rules conflict:\n\n1. An explicit instruction from the user for the current task.\n2. This document.\n3. Existing codebase or workflow convention.\n\nWhen this document conflicts with existing convention and complying would\nmean a large refactor, do not silently rewrite and do not silently conform:\nstate the conflict, estimate the cost of each option, and propose the\nsmallest compliant change.\n\n## Defaults to reject\n\nThese are the three default beliefs that produce bad solutions. Each comes\nwith the replacement behavior — do the replacement, every time:\n\n1. **\"The tools are the platform.\"** Reality is the platform: the actual\n   hardware, organization, deadline, physics. *Do instead:* before designing,\n   name the real platform and the 2–3 of its fixed properties that constrain\n   this solution, and design within them.\n2. **\"Design around a model of the world.\"** World models (objects, metaphors,\n   idealized categories) hide the actual data and the actual cost. *Do\n   instead:* design around the data. Do not introduce an abstraction until\n   you can describe, concretely, the data it organizes and the transform it\n   serves — and what the abstraction costs.\n3. **\"The solution matters more than the data.\"** The only purpose of any\n   solution is to transform data from one form to another. *Do instead:*\n   start every task from the actual inputs and required outputs, never from\n   the machinery you'd like to build.\n\n## Core defaults (any problem)\n\n- **The problem is the data.** Before proposing any solution, describe the\n  input and output concretely. If you can't, getting that description *is*\n  the first task — do it before anything else.\n- **State the cost.** Every design recommendation you make must state its\n  cost (time, memory, complexity, maintenance) and on what platform that\n  cost is paid. A recommendation without a cost is a guess — don't deliver\n  guesses unlabeled.\n- **Solve only the problem you have.** Different data is a different problem.\n  Concretely: do not add parameters, options, abstraction layers, or\n  extension points for hypothetical future needs. If you're tempted, write\n  the one-line note of what you *didn't* build and why, and move on.\n- **Where there is one, there are many.** Anything that happens once almost\n  always happens many times — across space or across the time axis. Default\n  every design to the batch; treat the single case as a batch of size one.\n- **The common case dominates.** Identify the most common case explicitly and\n  design the straight-line path for it. Handle rare and error cases, but\n  outside that path — a \"maybe\" checked everywhere is an \"always.\"\n- **Exploit every constraint you have.** List the known constraints (ranges,\n  volumes, rates, invariants) and use them to remove work. Do not discard a\n  constraint to make the solution \"more general\" — that generality is a cost\n  paid forever for a benefit nobody asked for.\n- **Simplicity is removing work.** Prefer fewer states, fewer steps, fewer\n  special cases, fewer moving parts. Every added state or branch must be\n  carried, tested, and explained — count them as cost.\n- **\"Can't be done\" is a cost claim.** When something seems impossible, what\n  is almost always true is that it costs more than it's worth. Say that, with\n  the estimate, so the tradeoff can actually be decided.\n\n## Get the real data (required before designing)\n\nYou cannot observe data you were not given — so observe what you *can*, and\nlabel everything else:\n\n- **Inspect before assuming.** Read representative input files, sample actual\n  values, read the actual call sites, run the code on real input when a way\n  to do so exists. Do not design from the type signatures or the docs alone.\n- **Sample the data you already have — instrument the live solution.** The\n  richest data is usually already flowing through the current code; go get it.\n  Temporarily dump a representative sample of what actually moves through the\n  system: the arguments reaching a function, the values a hot variable takes,\n  what a function returns, which branch is taken, the real sizes\u002Fcounts\u002Flengths.\n  Then *analyze the sample* — histogram it, sort it, count distinct values, look\n  at the min\u002Fmax\u002Fmode — and hunt for patterns. Real distributions expose what\n  the types hide: a variable that is almost always one value, an \"array\" that is\n  usually length 0 or 1, input that arrives already sorted or already unique, a\n  \"general\" path that is one specific case 98% of the time, a result that is\n  constant across a run. Each such pattern is a concrete opportunity — specialize\n  the common case, skip the dead branch, hoist the invariant, precompute the\n  constant, size the structure to what actually occurs. And the pattern can be\n  bigger than a local tweak: the data's *shape* can show that a **different\n  algorithm or representation is the better-fit machine** (sorted-enough → a\n  different sort\u002Fmerge; skewed → a different code; runny → a run\u002Fstream form;\n  sparse → a different container), not just that the current machine needs\n  filing. Sampling justifies *replacing* the machine, not only trimming it.\n  Sampling is also how you find *new* opportunities mid-optimization, not just\n  before starting: when a pass **stalls or plateaus**, that is the signal to\n  re-sample the hottest stage's data and ask whether a different machine fits it\n  better — not to keep filing the current one. Add the probes, run on real\n  input, read the output, then remove them — never leave instrumentation on a\n  timed\u002Fmeasured path.\n- **Label every assumption.** For each fact you need but cannot observe,\n  write an explicit line — `ASSUMPTION: \u003Cfact> — affects \u003Cdecision>` — in\n  your plan, and prefer designs that are cheap to revisit if the assumption\n  is wrong. Ask the user only when the answer materially changes the design.\n- **Never fabricate.** Do not invent plausible-looking values, distributions,\n  or measurements and treat them as real.\n\nAnswer these about the data (in the tier 1+ plan):\n\n1. What does the input actually look like — shape, volume, source?\n2. What are the most common real values, and how are they distributed?\n3. What are the acceptable ranges, and what happens when out-of-range data\n   arrives?\n4. What is the frequency of change — what is stable, what is volatile?\n5. What does the solution read and where does it come from? What does it\n   write and where is it used? What does it touch that it doesn't need?\n\n## Method (tier 1+ — show this work as a short plan, a line or two per step)\n\n1. **Frame it.** What is the problem, why is it worth solving, where is the\n   limit beyond which it isn't, and what is plan B?\n2. **Get the data** (section above).\n3. **State the cost** of the dominant transform on the real platform.\n4. **Design the transform**: a sequence or DAG of explicit transformations —\n   what comes in, what goes out, what each step is responsible for, with\n   explicit contracts (shape, meaning, ownership, lifetime, valid ranges) at\n   each boundary.\n5. **Run the simplification pass** (below); say which questions applied and\n   what work they removed.\n6. **Define done.** State the success criteria and what evidence would prove\n   the approach wrong, before building.\n7. **Verify.** Check the result against the real data and the stated\n   criteria, and report what was and wasn't verified.\n\n## Simplification pass (run recursively on every sub-problem)\n\n1. Can we **not do this at all**?\n2. Can we do this **only once** (precompute, cache, amortize)?\n3. Can we do this **fewer times**?\n4. Can we **approximate** the result so that no one notices the difference?\n5. Can we use a **small lookup table**?\n6. Can we use a **large lookup table**?\n7. Can we use a **small buffer\u002FFIFO** to decouple producer from consumer?\n8. Can we **constrain the problem further** so a simpler machine suffices?\n9. Is there a **different algorithm or representation that fits the data better**\n   than the current machine? Subtraction has a floor; when filing the current\n   approach stops paying (a plateau), the win is often a *different* machine the\n   data's shape points to — reconsider the approach, don't only shrink it.\n\n## Design rules\n\n- **Minimize states and branches by design**, not by adding checks. Where the\n  data genuinely varies, partition it by case and handle each partition\n  straight-line, rather than re-deciding the case per element.\n- **Out-of-range and error behavior is always explicit** — clamp, reject,\n  drop, or fail loudly; chosen deliberately and written down. Never leave\n  undefined behavior as an implicit policy, in any tier.\n- **Complexity requires evidence.** Add complexity only against a real,\n  observed need — never a hypothetical one.\n\n## Performance claims\n\n- **Never assert an unmeasured performance result.** Not \"this should be\n  faster,\" not invented numbers.\n- If a way to measure exists (benchmark, profiler, test harness, counters),\n  measure, and include before\u002Fafter numbers with the change.\n- If no way to measure exists here, label the change **unverified**, state\n  the expected effect as a hypothesis, and specify the exact measurement\n  that would verify it.\n- If there is no measurable performance requirement, build the simplest\n  correct design and skip speculative optimization entirely.\n\n---\n\n# Software specifics (systems, engine, embedded, game)\n\nThe rules above apply to any problem. These are their conclusions for\nsoftware, where the hardware is unforgiving and the data volumes are real.\n\n## Batch-first transforms (plural by default)\n\n- Write transforms to operate on **batches\u002Farrays** by default, named in the\n  **plural** (`update_things`, not `update_thing`).\n- A singular call is a degenerate batch: the same batch path with\n  `count = 1`. Do not maintain separate singular logic without a proven,\n  measured need.\n- Exception: true singletons (configuration state, a single shared resource).\n  Taking the exception requires a written note: why the data is genuinely\n  singular and batch semantics don't apply.\n\n## Memory, layout, and access\n\n- **Indices over pointers\u002Freferences\u002Fhandles by default** (index into a\n  contiguous array or table). Any pointer-heavy hot path must include a\n  short written justification for why indices are insufficient.\n- Organize data by **access pattern, not conceptual ownership**. Split hot\n  and cold fields when the cold fields aren't needed in the dominant loop.\n- For each hot path, write down the expected **access pattern**\n  (linear \u002F strided \u002F random), expected **branch behavior**\n  (predictable \u002F unpredictable), and the hardware assumptions.\n- When branch entropy is high, prefer **partitioned passes** (bucket by\n  state\u002Ftag, process each bucket straight-line) over per-element branching.\n- Keep the common-case path branch-minimal; rare and error handling lives\n  outside the hot loop.\n\n## Data protocols between systems\n\nSystems communicate through **explicit data protocols**, modeled after\nnetwork protocols and file formats — explicit layout, versioning, documented\nmeaning. The default is a **flat struct**: fixed layout, no hidden pointers,\nno OO-style interfaces. Use tagged unions or header-plus-payload when the\nflat struct genuinely can't express it. Do not model system boundaries as\nobjects, virtual calls, or opaque handles.\n\n## Hardware is the platform\n\n- Design with the actual hardware's properties — cache hierarchy, memory\n  bandwidth, alignment, latency vs. throughput — and to its strengths.\n- **Latency and throughput are only the same thing in a sequential system.**\n  For every performance requirement, identify which one it actually is\n  before designing for it.\n- The compiler and language are tools, not magic: memory layout, access\n  order, and the choice of what work to do at all are your job, not theirs —\n  and they are roughly 90% of the problem. Know what the compiler can\n  reasonably do with what you wrote, and don't delegate what it can't.\n\n## Enforceable deliverables (tier 2)\n\nFor each new or substantially reworked subsystem:\n\n- One explicit **batch transform contract**: input layout, output layout,\n  owner, lifetime, valid value ranges.\n- A **plural\u002Fbatch path** for every transform; singular calls are thin\n  wrappers over the batch implementation (`count = 1`) unless documented as\n  a true singleton.\n- A written **justification for any pointer\u002Freference\u002Fhandle-heavy hot path**\n  explaining why index-based access is insufficient.\n- Explicit **out-of-range behavior** (clamp\u002Freject\u002Fdrop\u002Ferror) at every\n  input boundary.\n- Unresolved design questions filed as **local issue files under `issues\u002F`**\n  — not GitHub issues, not inline TODOs.\n\n---\n\n# Final self-check (run before delivering tier 1+ work)\n\nVerify, and fix or flag anything that fails:\n\n- [ ] The plan answered the framing, data, and cost questions — or every gap\n      is labeled `ASSUMPTION` with what it affects.\n- [ ] The most common case is identified and the design serves it\n      straight-line; rare\u002Ferror cases are out of the common path.\n- [ ] The simplification pass ran; the work it removed (or why nothing could\n      be removed) is stated.\n- [ ] No speculative generality: no parameter, option, or abstraction exists\n      for a need that isn't real yet.\n- [ ] Out-of-range and error behavior is explicit at every boundary.\n- [ ] Transforms are plural\u002Fbatch, or the singleton exception is documented.\n- [ ] Pointer-heavy hot paths carry their written justification; everything\n      else uses indices.\n- [ ] No unmeasured performance claim anywhere in code, comments, or\n      summary; measurements included where possible, hypotheses labeled\n      where not.\n- [ ] Done-criteria from the plan were checked, and the summary reports what\n      was verified and what wasn't.\n- [ ] (Tier 2) Deliverables above are present; open questions are filed\n      under `issues\u002F`.\n",{"name":5,"description":7},"main","861c87495f42509ea071cb5d63ea05ee270ff68e","skills\u002Fmacton\u002Fdata-oriented-design","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills","https:\u002F\u002Fgithub.com\u002FTudorAndrei","blog.tudorandrei.xyz","A.I Engineer, Self-Host Addict, problem solver","2026-11-15 01:24:58",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add TudorAndrei\u002Fskills --skill data-oriented-design",{"tool":59,"command":60},"bunx","bunx skills add TudorAndrei\u002Fskills --skill data-oriented-design",{"tool":62,"command":63},"pnpm","pnpm dlx skills add TudorAndrei\u002Fskills --skill data-oriented-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmacton\u002Fdata-oriented-design\u002FSKILL.md",true,[67,72,78,82],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":16},"LICENSE.upstream","LICENSE","许可证",1067,{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"UPSTREAM.md","REFERENCE","参考文档",578,"https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmacton\u002Fdata-oriented-design\u002FUPSTREAM.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"video-montage-editor.json",390,"https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Farchive\u002Flegacy_pillars\u002F10_engineering_devops\u002F01_software_engineering\u002Fdeveloping\u002Fsubagents\u002Fvideo_montage_editor\u002Fvideo-montage-editor.json",{"path":83,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":84,"sourceHtmlUrl":85},"video-montage-editor.json.meta.json",894,"https:\u002F\u002Fgithub.com\u002FiDorgham\u002FWorkspace-Factory\u002Fblob\u002Fmaster\u002Ffactory\u002Flibrary\u002Farchive\u002Flegacy_pillars\u002F10_engineering_devops\u002F01_software_engineering\u002Fdeveloping\u002Fsubagents\u002Fvideo_montage_editor\u002Fvideo-montage-editor.json.meta.json",[87,96,113,140,167,186],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":40},"01M744PFYVPQ8649E3PFNFGR3Q","lintlang","Lint AI agent instruction files (SKILL.md, CLAUDE.md, AGENTS.md, GEMINI.md), tool definitions, system prompts, and agent configs with the deterministic LintLang CLI. Use when writing, editing, or reviewing agent instructions to catch ambiguous tool descriptions, missing stop conditions, schema\u002Fdescription mismatches, mixed output formats, or prompts embedded in Python before they reach runtime. Zero-LLM static analysis; no model calls and no network calls during a scan.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fhermes-labs-ai\u002Flintlang\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fhermes-labs-ai\u002Flintlang\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":40},"01M6WQZKB9FB911QQZER8JRHWV","untangle-codebase","Untangle a whole codebase in one pass, so agents working in it read less per change, break less without noticing, and debug faster.","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcaldoai\u002Funtangle-codebase\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcaldoai\u002Funtangle-codebase\u002FSKILL.md",[],[104,105,106,107,108,109,110,111,112],"codebase","untangle codebase","true","change","focus","debug","break","it","read",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":117,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":40},"01M6E06JZVA77Z20EGNF5XR1NF","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-labs\u002Fagent-browser\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-labs\u002Fagent-browser\u002FSKILL.md",[],[121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,37,137,138,139],"agent browser","browser","open","testing","browser automation","messages","actions","notion","figma","click","web tools","app","qa","apps","Bash","discord","scrape","ai agents","interaction",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":144,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":40},"01M6E06F024S9M0534GR7WQR71","find-docs","Retrieves up-to-date documentation, API references, and code examples for any developer technology. Use this skill whenever the user asks about a specific library, framework, SDK, CLI tool, or cloud service — even for well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. Your training data may not reflect recent API changes or version updates.\nAlways use for: API syntax questions, configuration options, version migration issues, \"how do I\" questions mentioning a library name, debugging that involves library-specific behavior, setup instructions, and CLI tool usage.\nUse even when you think you know the answer — do not rely on training data for API details, signatures, or configuration options as they are frequently outdated. Always verify against current docs. Prefer this over web search for library documentation and API details.","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fupstash\u002Ffind-docs\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fupstash\u002Ffind-docs\u002FSKILL.md",[],[148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,37,163,164,165,166],"docs","find","find docs","references","prisma","reflect","Tailwind","web search","search","training","signatures","up","issues","spring boot","debugging","express","api","react","documentation",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":171,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":40},"01M6E053D3K23M7KH5MSMH00JV","test-audit","Writing\u002Fchanging\u002Freviewing\u002Fsweeping tests: reject duplicate or implementation-coupled proof; remove test-only production seams.","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fopenclaw\u002Ftest-audit\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fopenclaw\u002Ftest-audit\u002FSKILL.md",[],[175,176,177,178,179,180,181,182,183,184,185],"test","test audit","audit","writing","duplicate","remove","tests","only","implementation","Production","proof",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":91,"licenseFileUrl":190,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":40},"01M6E04RWKEV4YWEM2BACNSQS9","tmux","Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output. Use when a task needs an interactive terminal program, such as a REPL, debugger, or TUI, that a one-shot shell command cannot drive.","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmitsuhiko\u002Ftmux\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002FTudorAndrei\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmitsuhiko\u002Ftmux\u002FSKILL.md",[],[188,194,195,196,197,198,199,200],"mise","scraping","gdb","control","python","sessions","interactive"]