{"id":"6f1e7e90-6ee6-46e1-9e0c-fcc620af0f8e","shortId":"ufFZVh","kind":"skill","title":"error-and-correctness-traps","tagline":"Use when adding error handling to a call that can fail, comparing or calculating with floating-point numbers, writing concurrent or parallel code, calling a remote process or another service, adding a singleton or globally-shared mutable state, choosing a data structure for a hot","description":"# Error and Correctness Traps\n\n## Overview\n\nCommon bugs grouped by domain: floats that won't compare equal, retries that hammer a downed service, singletons that wreck testability, and others. **When you write code in one of these domains, stop and run the matching checks before you commit.** Draws on nine contributors to *97 Things Every Programmer Should Know* (CC-BY-3.0; see `principles.md` for citations and links).\n\nThis is a **rigid** skill. Jump to the sub-section that matches what you're writing and run that sub-section's checks.\n\nThese checks matter most when code will reach real users in production. In MVPs, prototypes, internal dev tools, and one-off scripts where the architecture is still in flux, prefer the simplest thing that works.\n\n## When to invoke\n\nInvoke when you're about to:\n\n- Add or change error-handling around a call that can fail\n- Compare, sum, or accumulate floating-point numbers\n- Write concurrent, parallel, or threaded code, or share mutable state between threads\n- Call a remote process, web service, database, or another machine\n- Introduce a singleton or any globally-shared mutable state\n- Choose a data structure or algorithm on a path that runs often or on large inputs\n- Add or change log statements that may fire at high volume\n\n### Non-triggers — do NOT invoke for\n\n- Renaming a local variable inside one function\n- Adding a docstring to an existing function\n- Fixing a typo in a comment\n- Formatting-only changes handled by a formatter\n- Adjusting a config value in a config file with no logic change\n- Reading code without modifying it\n- An early-stage MVP or prototype where the architecture is still in flux\n- An internal dev tool, debugging endpoint, or one-off script\n- Throwaway code expected to be replaced before reaching users\n\nIf the change touches one of these domains even slightly, **invoke anyway** — the per-domain check is short and the bugs are not.\n\n## Checks by domain\n\n### Errors (97/21, 97/26, 97/29)\n\n1. **Distinguish business exceptions from technical ones.** A *technical* exception means the system can't proceed — bad arguments, broken DB connection, programming error. Let it bubble to a top-level handler that puts the system in a safe state (rollback, log, alert, friendly user message); the caller can't fix it. A *business* exception is part of the contract — withdrawing from an empty account, booking an unavailable slot — and is an alternative return path the caller is expected to handle. Give them separate types or hierarchies; mixing them blurs the contract. *(Bergh Johnsson, 97/21.)*\n2. **Never write the empty `catch`.** `try { ... } catch (...) {}` silently swallows everything. Same for ignoring return codes (`printf`'s return value, `write()`'s short-write count) and pretending `errno` doesn't exist. Example: a service-call wrapper swallows every exception and returns `null`, so every downstream caller has to invent their own theory of what `null` means. Expose erroneous conditions in your interfaces; if handling errors feels onerous, the interface is wrong. *(Goodliffe, 97/26.)*\n3. **Don't rely on unexplained magic.** If your change depends on behavior nobody can explain (build picks a DLL by load order, deployment reads an undocumented env var, a job runs because of a side effect in a config file), surface it in your summary to the user before shipping — don't bury the dependency. *(Griffiths, 97/29.)*\n\n### Numerics (97/33)\n\n4. **Never compare floats with `==`.** `0.1 + 0.2 != 0.3` in IEEE 754 — the canonical demonstration. Compare with a tolerance appropriate to the magnitude of the values involved (≈ ε|x|, where ε is machine epsilon — ~1e-7 for `float`, ~1e-16 for `double`).\n5. **Watch for catastrophic cancellation.** Subtracting nearly-equal floats promotes roundoff to the most significant digits. Example: solving `x² - 100000x + 1 = 0` directly via the quadratic formula gives a wildly wrong small root because `-b + sqrt(b² - 4)` cancels; compute one root and derive the other from `r1 * r2 = c/a`. Same shape of error appears in any series with alternating signs of similar magnitude.\n6. **Don't use float for money.** Use a fixed-point or decimal type. Floats are for scientific calculation where you accept ε-level error; financial code does not accept it. *(Allison, 97/33.)*\n\n### Concurrency & IPC (97/41, 97/57)\n\n7. **Default to message passing over shared mutable state.** When you reach for a lock around shared data, ask first whether the data could be owned by one process/actor that others message. CSP-style designs (Erlang, Go channels, actor frameworks in mainstream languages) sidestep most race / deadlock / livelock bugs by construction. Reserve shared-memory + locks for cases you have measured and understood. *(Winder, 97/57.)*\n8. **Count IPCs per user stimulus, not lines of code.** Each remote call is non-trivial latency; sequential calls add. Example: ORM lazy-loading produces 1,000 sequential 10ms DB calls for one page render — minimum 10s response time before any rendering work. Ratios in the thousands appear routinely in slow apps. Apply parsimony (one round-trip carrying the right data), parallelism (overall latency = longest call, not sum), or caching. *(Stafford, 97/41.)*\n9. **Retry with backoff and a cap, never in a tight loop.** Example: `while (!call()) call();` against a downed service hammers it the moment it comes back. Exponential backoff, jitter, and a max-retries ceiling are the minimum; idempotency on the server side is what makes retry safe at all.\n\n### Limits & Performance (97/46, 97/89)\n\n10. **Know the complexity of the data structure you picked.** Linked list vs. hash vs. balanced tree on a million items is the difference between snappy and unusable. Pick by access pattern (lookup-heavy → hash; ordered iteration → tree; tiny + cache-friendly → array), not by what's familiar. *(van Winkel, 97/89.)*\n11. **Don't recompute invariants inside loops.** Example: `for (i = 0; i < strlen(s); ++i)` — `strlen` runs every iteration, scanning the whole string each time, turning O(n) work into O(n²). Hoist the length out. The same shape applies to repeated DB lookups, repeated config parses, and repeated regex compilations inside hot loops. *(van Winkel, 97/89.)*\n12. **Respect the cache hierarchy when it dominates.** Register and L1 are nanoseconds; RAM is ~20ns; disk is ~10ms; network is ~20–100ms — orders of magnitude apart. A \"worse\" big-O algorithm with a predictable access pattern can beat a \"better\" one that thrashes cache. When perf matters, **measure** rather than reason from complexity alone. *(Colvin, 97/46.)*\n\n### Globals & Singletons (97/73)\n\n13. **Resist the singleton.** Most singletons encode a single-instance assumption that turns out to be premature, broadcast across the design as hidden coupling. They wreck unit-test independence (you can't substitute a mock), introduce subtle multi-threading bugs (naive locking slow, double-checked locking famously broken in several languages), and have no defined cleanup order at shutdown. Example: a `Logger.getInstance()` called from every layer means tests can't intercept output, can't run in parallel, and inherit log state from previous tests.\n14. **If you genuinely need one instance, hide it behind an interface.** Restrict the global access to a few well-defined construction sites; everywhere else, accept the dependency through a parameter typed by interface. Callers don't know whether a singleton or a fresh object satisfies the interface — and tests can substitute either. *(Saariste, 97/73.)*\n\n### Production resilience (`RI/*`)\n\nWhen the call will run under load against a downstream that can fail, the per-call hardening *is* the first write. These checks matter most in production code.\n\n15. **Set an explicit timeout on every remote call.** Library defaults are wrong (`None`, \"infinity\", \"many minutes\"). Pick a per-call budget based on the downstream's realistic latency plus margin, and cap retries inside that budget. *(`RI/Timeout`.)*\n16. **Wrap critical downstreams in a circuit breaker.** Tracked per-downstream failures; once threshold crossed, fail fast locally for a window; probe; close on success. Distinct from retry/backoff: this is \"should we attempt at all right now.\" *(`RI/CircuitBreaker`.)*\n17. **Bulkhead resource pools per downstream.** Separate thread pools, connection pools, or queues per external dependency so one stalled downstream cannot exhaust capacity for healthy ones. *(`RI/Bulkhead`.)*\n18. **Bounded queues only.** An unbounded queue eventually exhausts memory under load. Pick a cap and an explicit reject policy (drop oldest, drop newest, backpressure to caller). *(`RI/Backpressure`.)*\n19. **Fail fast when the request cannot succeed.** Validate at the entry point; check circuit-breaker state and feature flags before expensive setup; return a clear error before holding DB connections, locks, or downstream quota. *(`RI/FailFast`.)*\n\n## Red Flags\n\nThese thoughts mean STOP — apply the domain check before committing:\n\n| Thought | Reality |\n|---|---|\n| \"I'll throw the same exception type for both — caller handles either way.\" | Technical and business exceptions are different contracts. Mixing them means callers can't tell what to guard against beforehand vs. handle after. (97/21) |\n| \"Empty catch is fine, the error can't happen here.\" | \"Can't happen\" is how silent corruption ships. Log, rethrow, or surface the error — never swallow. (97/26) |\n| \"Nobody on the team knows how this build step works, but it works.\" | Magic that no one owns is a fault waiting for the day the magic stops. Find the person who knows or document it now. (97/29) |\n| \"`if (a == b)` for floats is fine, the values are computed the same way.\" | `0.1 + 0.2 != 0.3`. Use a tolerance scaled to magnitude, or use a decimal type. (97/33) |\n| \"I'll use `double` for the price column — it's faster than `Decimal`.\" | Floats accumulate roundoff; money does not forgive roundoff. Use fixed-point or decimal for currency. (97/33) |\n| \"I'll wrap a lock around the shared map — that fixes the race.\" | Locks around shared mutable state are where deadlocks and lost updates hide. Prefer message passing; lock only when measured and understood. (97/57) |\n| \"Failed call → just retry in a loop until it works.\" | A retry loop without backoff and a cap will hammer the service the moment it recovers. Backoff + jitter + ceiling, and require idempotency on the server. (97/41) |\n| \"I'll lazy-load each related row — it's cleaner.\" | One page = thousands of sequential round-trips = visibly broken latency. Count IPCs per stimulus; batch, parallelize, or cache. (97/41) |\n| \"It's just `for (i = 0; i < strlen(s); ++i)` — looks normal.\" | `strlen` runs every iteration; an O(n) loop becomes O(n²). Hoist invariants out of hot loops. (97/89) |\n| \"Linked list is fine, n won't get that big.\" | \"Won't get that big\" is how production timeouts are born. Pick the structure by access pattern and confirm with measurement. (97/89, 97/46) |\n| \"Singleton — there'll only ever be one.\" | Single-instance is an assumption that ages badly, and the global access point destroys testability. Hide behind an interface, inject the dependency. (97/73) |\n| \"I'll let the HTTP client default the timeout — it's fine.\" | Defaults are `None` or hours. Held connections, threads, and queue slots add up under load. Set an explicit per-call timeout. (`RI/Timeout`) |\n| \"The downstream's flaky — I'll just retry.\" | Retry without a circuit breaker piles load on a service that's already failing. Wrap critical downstreams in a breaker; fail fast locally when open. (`RI/CircuitBreaker`) |\n| \"One pool for all downstreams keeps the code simpler.\" | One slow third party fills the pool and the whole service stops. Bulkhead per downstream; isolate failure domains. (`RI/Bulkhead`) |\n| \"I'll buffer events in an in-memory queue — it'll catch up.\" | Unbounded queues exhaust memory under sustained load. Pick a cap and a reject policy; let backpressure inform callers. (`RI/Backpressure`) |\n| \"I'll validate after the DB lookup — saves a branch.\" | Late failure holds DB connections, locks, and quota for a request that can't succeed. Validate at the entry; fail fast. (`RI/FailFast`) |\n\n## What \"done\" looks like\n\nYou are done when **all** of the following are true for every domain below your change touches:\n\n- [ ] **Errors:** technical and business exceptions have distinct types; no empty catches; any \"magic\" the change relies on has a named owner or a documented restart path.\n- [ ] **Numerics:** no `==` between floats; tolerances scaled to magnitude; money uses a decimal type; subtractions of near-equal magnitudes have been audited for cancellation.\n- [ ] **Concurrency & IPC:** shared mutable state is justified or replaced by message passing; remote calls per user stimulus are counted and bounded; retries have backoff, jitter, and a ceiling.\n- [ ] **Limits & Performance:** the data structure matches the access pattern; no invariants recomputed inside hot loops; perf claims are measured, not reasoned.\n- [ ] **Globals & Singletons:** any new singleton is justified, narrowly scoped, and accessed through an interface that can be substituted in tests.\n- [ ] **Production resilience:** every remote call has an explicit timeout; critical downstreams have a circuit breaker; resource pools are bulkheaded per downstream; queues are bounded with an explicit reject policy; the request fails fast when it cannot succeed.\n\nIf any box that applies to your change is unchecked, you are not done. Either finish, or revert and re-plan.\n\n## Principles in this skill\n\n| # | Principle | Author |\n|---|---|---|\n| 97/21 | Distinguish Business Exceptions from Technical | Dan Bergh Johnsson |\n| 97/26 | Don't Ignore That Error! | Pete Goodliffe |\n| 97/29 | Don't Rely on \"Magic Happens Here\" | Alan Griffiths |\n| 97/33 | Floating-Point Numbers Aren't Real | Chuck Allison |\n| 97/41 | Inter-Process Communication Affects Application Response Time | Randy Stafford |\n| 97/46 | Know Your Limits | Greg Colvin |\n| 97/57 | Message Passing Leads to Better Scalability in Parallel Systems | Russel Winder |\n| 97/73 | Resist the Temptation of the Singleton | Sam Saariste |\n| 97/89 | Use the Right Algorithm and Data Structure | Jan Christiaan \"JC\" van Winkel |\n| `RI/Timeout` | Always Set a Timeout | Michael Nygard |\n| `RI/CircuitBreaker` | Circuit Breaker | Michael Nygard |\n| `RI/Bulkhead` | Bulkhead | Michael Nygard |\n| `RI/Backpressure` | Backpressure / Bounded Queues | Michael Nygard |\n| `RI/FailFast` | Fail Fast | Michael Nygard |\n\nSee `principles.md` for the long-form distillations, citations, and source links.","tags":["error","and","correctness","traps","oribarilan","agent-skills","ai-agents","best-practices","claude-code","claude-code-plugin","claude-code-skills","coding-agents"],"capabilities":["skill","source-oribarilan","skill-error-and-correctness-traps","topic-agent-skills","topic-ai-agents","topic-best-practices","topic-claude-code","topic-claude-code-plugin","topic-claude-code-skills","topic-coding-agents","topic-copilot-cli","topic-copilot-cli-plugin","topic-opencode","topic-opencode-plugin","topic-programming-principles"],"categories":["97"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/oribarilan/97/error-and-correctness-traps","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add oribarilan/97","source_repo":"https://github.com/oribarilan/97","install_from":"skills.sh"}},"qualityScore":"0.458","qualityRationale":"deterministic score 0.46 from registry signals: · indexed on github topic:agent-skills · 17 github stars · SKILL.md body (14,660 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-10T13:04:27.138Z","embedding":null,"createdAt":"2026-05-08T13:06:23.791Z","updatedAt":"2026-05-10T13:04:27.138Z","lastSeenAt":"2026-05-10T13:04:27.138Z","tsv":"'0':677,1017,1752 '0.1':621,1600 '0.2':622,1601 '0.3':623,1602 '000':853 '1':386,676,852 '10':955 '100000x':675 '100ms':1086 '10ms':855,1082 '10s':863 '11':1007 '12':1064 '13':1125 '14':1213 '15':1301 '16':1340 '17':1379 '18':1406 '19':1434 '1e-16':652 '1e-7':649 '2':481 '20':1085 '20ns':1079 '3':556 '3.0':113 '4':616,693 '5':655 '6':720 '7':759 '754':626 '8':825 '9':900 '97':104 '97/21':383,480,1520,2208 '97/26':384,555,1547,2217 '97/29':385,613,1585,2225 '97/33':615,754,1614,1644,2235 '97/41':757,899,1715,1746,2245 '97/46':953,1121,1809,2256 '97/57':758,824,1679,2262 '97/73':1124,1268,1840,2274 '97/89':954,1006,1063,1776,1808,2283 'accept':742,751,1239 'access':985,1100,1228,1802,1829,2109,2133 'account':450 'accumul':205,1629 'across':1144 'actor':798 'ad':8,37,283 'add':190,258,845,1864 'adjust':304 'affect':2250 'age':1824 'alan':2233 'alert':428 'algorithm':247,1096,2287 'allison':753,2244 'alon':1119 'alreadi':1896 'altern':458,715 'alway':2297 'anoth':35,230 'anyway':366 'apart':1090 'app':878 'appear':710,874 'appli':879,1046,1477,2184 'applic':2251 'appropri':634 'architectur':170,330 'aren':2240 'argument':403 'around':196,774,1650,1659 'array':998 'ask':777 'assumpt':1136,1822 'attempt':1373 'audit':2071 'author':2207 'b':690,692,1588 'back':926 'backoff':903,928,1694,1706,2097 'backpressur':1430,1967,2313 'bad':402,1825 'balanc':970 'base':1324 'batch':1742 'beat':1103 'becom':1767 'beforehand':1516 'behavior':568 'behind':1222,1834 'bergh':478,2215 'better':1105,2267 'big':1094,1786,1791 'big-o':1093 'blur':475 'book':451 'born':1797 'bound':1407,2094,2166,2314 'box':2182 'branch':1980 'breaker':1347,1450,1888,1903,2157,2305 'broadcast':1143 'broken':404,1176,1736 'bubbl':411 'budget':1323,1338 'buffer':1940 'bug':59,376,808,1167 'build':572,1555 'bulkhead':1380,1931,2161,2309 'buri':609 'busi':388,439,1500,2027,2210 'c/a':705 'cach':897,996,1067,1109,1745 'cache-friend':995 'calcul':19,739 'call':13,30,198,222,517,837,844,857,893,914,915,1191,1274,1288,1309,1322,1681,1873,2087,2147 'caller':433,462,528,1248,1432,1494,1508,1969 'cancel':659,694,2073 'cannot':1399,1440,2178 'canon':628 'cap':906,1334,1420,1697,1961 'capac':1401 'carri':885 'case':817 'catastroph':658 'catch':486,488,1522,1950,2034 'cc':111 'cc-bi':110 'ceil':935,1708,2101 'chang':192,260,299,315,357,565,2022,2038,2187 'channel':797 'check':95,144,146,371,379,1173,1295,1447,1480 'choos':46,242 'christiaan':2292 'chuck':2243 'circuit':1346,1449,1887,2156,2304 'circuit-break':1448 'citat':117,2331 'claim':2118 'cleaner':1726 'cleanup':1184 'clear':1460 'client':1846 'close':1363 'code':29,84,150,215,317,347,496,748,834,1300,1917 'column':1622 'colvin':1120,2261 'come':925 'comment':295 'commit':98,1482 'common':58 'communic':2249 'compar':17,67,202,618,630 'compil':1057 'complex':958,1118 'comput':695,1596 'concurr':26,211,755,2074 'condit':541 'config':306,310,595,1052 'confirm':1805 'connect':406,1388,1465,1859,1985 'construct':810,1235 'contract':445,477,1504 'contributor':102 'correct':4,55 'corrupt':1537 'could':782 'count':506,826,1738,2092 'coupl':1149 'critic':1342,1899,2152 'cross':1355 'csp':792 'csp-style':791 'currenc':1643 'dan':2214 'data':48,244,776,781,888,961,2105,2289 'databas':228 'day':1572 'db':405,856,1049,1464,1976,1984 'deadlock':806,1665 'debug':339 'decim':733,1612,1627,1641,2061 'default':760,1311,1847,1853 'defin':1183,1234 'demonstr':629 'depend':566,611,1241,1394,1839 'deploy':579 'deriv':699 'design':794,1146 'destroy':1831 'dev':161,337 'differ':978,1503 'digit':671 'direct':678 'disk':1080 'distil':2330 'distinct':1366,2030 'distinguish':387,2209 'dll':575 'docstr':285 'document':1582,2047 'doesn':510 'domain':62,89,362,370,381,1479,1936,2019 'domin':1071 'done':2004,2009,2193 'doubl':654,1172,1618 'double-check':1171 'down':73,918 'downstream':527,1281,1327,1343,1351,1384,1398,1468,1877,1900,1914,1933,2153,2163 'draw':99 'drop':1426,1428 'earli':323 'early-stag':322 'effect':592 'either':1266,1496,2194 'els':1238 'empti':449,485,1521,2033 'encod':1131 'endpoint':340 'entri':1445,1999 'env':583 'epsilon':648 'equal':68,663,2067 'erlang':795 'errno':509 'erron':540 'error':2,9,53,194,382,408,547,709,746,1461,1526,1544,2024,2222 'error-and-correctness-trap':1 'error-handl':193 'even':363 'event':1941 'eventu':1413 'ever':1814 'everi':106,520,526,1024,1193,1307,1761,2018,2145 'everyth':491 'everywher':1237 'exampl':513,672,846,912,1014,1188 'except':389,395,440,521,1490,1501,2028,2211 'exhaust':1400,1414,1954 'exist':288,512 'expect':348,464 'expens':1456 'explain':571 'explicit':1304,1423,1870,2150,2169 'exponenti':927 'expos':539 'extern':1393 'fail':16,201,1284,1356,1435,1680,1897,1904,2000,2174,2319 'failur':1352,1935,1982 'familiar':1003 'famous':1175 'fast':1357,1436,1905,2001,2175,2320 'faster':1625 'fault':1568 'featur':1453 'feel':548 'file':311,596 'fill':1923 'financi':747 'find':1576 'fine':1524,1592,1780,1852 'finish':2195 'fire':265 'first':778,1292 'fix':290,436,730,1638,1655 'fixed-point':729,1637 'flag':1454,1472 'flaki':1879 'float':22,63,207,619,651,664,724,735,1590,1628,2053,2237 'floating-point':21,206,2236 'flux':174,334 'follow':2014 'forgiv':1634 'form':2329 'format':297 'formatt':303 'formatting-on':296 'formula':682 'framework':799 'fresh':1257 'friend':429,997 'function':282,289 'genuin':1216 'get':1784,1789 'give':467,683 'global':42,238,1122,1227,1828,2123 'globally-shar':41,237 'go':796 'goodliff':554,2224 'greg':2260 'griffith':612,2234 'group':60 'guard':1514 'hammer':71,920,1699 'handl':10,195,300,466,546,1495,1518 'handler':417 'happen':1529,1533,2231 'harden':1289 'hash':968,990 'healthi':1403 'heavi':989 'held':1858 'hidden':1148 'hide':1220,1669,1833 'hierarchi':472,1068 'high':267 'hoist':1039,1770 'hold':1463,1983 'hot':52,1059,1774,2115 'hour':1857 'http':1845 'idempot':939,1711 'ieee':625 'ignor':494,2220 'in-memori':1944 'independ':1155 'infin':1315 'inform':1968 'inherit':1207 'inject':1837 'input':257 'insid':280,1012,1058,1336,2114 'instanc':1135,1219,1819 'inter':2247 'inter-process':2246 'intercept':1199 'interfac':544,551,1224,1247,1261,1836,2136 'intern':160,336 'introduc':232,1162 'invari':1011,1771,2112 'invent':531 'invok':183,184,274,365 'involv':641 'ipc':756,827,1739,2075 'isol':1934 'item':975 'iter':992,1025,1762 'jan':2291 'jc':2293 'jitter':929,1707,2098 'job':586 'johnsson':479,2216 'jump':125 'justifi':2080,2129 'keep':1915 'know':109,956,1251,1552,1580,2257 'l1':1074 'languag':802,1179 'larg':256 'late':1981 'latenc':842,891,1330,1737 'layer':1194 'lazi':849,1719 'lazy-load':848,1718 'lead':2265 'length':1041 'let':409,1843,1966 'level':416,745 'librari':1310 'like':2006 'limit':951,2102,2259 'line':832 'link':119,965,1777,2334 'list':966,1778 'livelock':807 'll':1486,1616,1646,1717,1812,1842,1881,1939,1949,1972 'load':577,850,1278,1417,1720,1867,1890,1958 'local':278,1358,1906 'lock':773,815,1169,1174,1466,1649,1658,1673,1986 'log':261,427,1208,1539 'logger.getinstance':1190 'logic':314 'long':2328 'long-form':2327 'longest':892 'look':1757,2005 'lookup':988,1050,1977 'lookup-heavi':987 'loop':911,1013,1060,1686,1692,1766,1775,2116 'lost':1667 'machin':231,647 'magic':562,1561,1574,2036,2230 'magnitud':637,719,1089,1608,2057,2068 'mainstream':801 'make':946 'mani':1316 'map':1653 'margin':1332 'match':94,132,2107 'matter':147,1112,1296 'max':933 'max-retri':932 'may':264 'mean':396,538,1195,1475,1507 'measur':820,1113,1676,1807,2120 'memori':814,1415,1946,1955 'messag':431,762,790,1671,2084,2263 'michael':2301,2306,2310,2316,2321 'million':974 'minimum':862,938 'minut':1317 'mix':473,1505 'mock':1161 'modifi':319 'moment':923,1703 'money':726,1631,2058 'multi':1165 'multi-thread':1164 'mutabl':44,218,240,766,1661,2077 'mvp':325 'mvps':158 'n':1034,1038,1765,1769,1781 'naiv':1168 'name':2043 'nanosecond':1076 'narrowli':2130 'near':662,2066 'near-equ':2065 'nearly-equ':661 'need':1217 'network':1083 'never':482,617,907,1545 'new':2126 'newest':1429 'nine':101 'nobodi':569,1548 'non':270,840 'non-trigg':269 'non-trivi':839 'none':1314,1855 'normal':1758 'null':524,537 'number':24,209,2239 'numer':614,2050 'nygard':2302,2307,2311,2317,2322 'o':1033,1037,1095,1764,1768 'object':1258 'often':253 'oldest':1427 'one':86,165,281,343,359,392,696,786,859,881,1106,1218,1396,1404,1564,1727,1816,1910,1919 'one-off':164,342 'oner':549 'open':1908 'order':578,991,1087,1185 'orm':847 'other':80,789 'output':1200 'overal':890 'overview':57 'own':784,1565 'owner':2044 'page':860,1728 'parallel':28,212,889,1205,1743,2270 'paramet':1244 'pars':1053 'parsimoni':880 'part':442 'parti':1922 'pass':763,1672,2085,2264 'path':250,460,2049 'pattern':986,1101,1803,2110 'per':369,828,1287,1321,1350,1383,1392,1740,1872,1932,2088,2162 'per-cal':1286,1320,1871 'per-domain':368 'per-downstream':1349 'perf':1111,2117 'perform':952,2103 'person':1578 'pete':2223 'pick':573,964,983,1318,1418,1798,1959 'pile':1889 'plan':2201 'plus':1331 'point':23,208,731,1446,1639,1830,2238 'polici':1425,1965,2171 'pool':1382,1387,1389,1911,1925,2159 'predict':1099 'prefer':175,1670 'prematur':1142 'pretend':508 'previous':1211 'price':1621 'principl':2202,2206 'principles.md':115,2324 'printf':497 'probe':1362 'proceed':401 'process':33,225,2248 'process/actor':787 'produc':851 'product':156,1269,1299,1794,2143 'program':407 'programm':107 'promot':665 'prototyp':159,327 'put':419 'quadrat':681 'queue':1391,1408,1412,1862,1947,1953,2164,2315 'quota':1469,1988 'r1':703 'r2':704 'race':805,1657 'ram':1077 'randi':2254 'rather':1114 'ratio':870 're':135,187,2200 're-plan':2199 'reach':152,353,770 'read':316,580 'real':153,2242 'realist':1329 'realiti':1484 'reason':1116,2122 'recomput':1010,2113 'recov':1705 'red':1471 'regex':1056 'regist':1072 'reject':1424,1964,2170 'relat':1722 'reli':559,2039,2228 'remot':32,224,836,1308,2086,2146 'renam':276 'render':861,868 'repeat':1048,1051,1055 'replac':351,2082 'request':1439,1991,2173 'requir':1710 'reserv':811 'resili':1270,2144 'resist':1126,2275 'resourc':1381,2158 'respect':1065 'respons':864,2252 'restart':2048 'restrict':1225 'rethrow':1540 'retri':69,901,934,947,1335,1683,1691,1883,1884,2095 'retry/backoff':1368 'return':459,495,499,523,1458 'revert':2197 'ri':1271 'ri/backpressure':1433,1970,2312 'ri/bulkhead':1405,1937,2308 'ri/circuitbreaker':1378,1909,2303 'ri/failfast':1470,2002,2318 'ri/timeout':1339,1875,2296 'right':887,1376,2286 'rigid':123 'rollback':426 'root':688,697 'round':883,1733 'round-trip':882,1732 'roundoff':666,1630,1635 'routin':875 'row':1723 'run':92,138,252,587,1023,1203,1276,1760 'russel':2272 'saarist':1267,2282 'safe':424,948 'sam':2281 'satisfi':1259 'save':1978 'scalabl':2268 'scale':1606,2055 'scan':1026 'scientif':738 'scope':2131 'script':167,345 'section':130,142 'see':114,2323 'separ':469,1385 'sequenti':843,854,1731 'seri':713 'server':942,1714 'servic':36,74,227,516,919,1701,1893,1929 'service-cal':515 'set':1302,1868,2298 'setup':1457 'sever':1178 'shape':707,1045 'share':43,217,239,765,775,813,1652,1660,2076 'shared-memori':812 'ship':606,1538 'short':373,504 'short-writ':503 'shutdown':1187 'side':591,943 'sidestep':803 'sign':716 'signific':670 'silent':489,1536 'similar':718 'simpler':1918 'simplest':177 'singl':1134,1818 'single-inst':1133,1817 'singleton':39,75,234,1123,1128,1130,1254,1810,2124,2127,2280 'site':1236 'skill':124,2205 'skill-error-and-correctness-traps' 'slight':364 'slot':454,1863 'slow':877,1170,1920 'small':687 'snappi':980 'solv':673 'sourc':2333 'source-oribarilan' 'sqrt':691 'stafford':898,2255 'stage':324 'stall':1397 'state':45,219,241,425,767,1209,1451,1662,2078 'statement':262 'step':1556 'still':172,332 'stimulus':830,1741,2090 'stop':90,1476,1575,1930 'string':1029 'strlen':1019,1022,1754,1759 'structur':49,245,962,1800,2106,2290 'style':793 'sub':129,141 'sub-sect':128,140 'substitut':1159,1265,2140 'subtl':1163 'subtract':660,2063 'succeed':1441,1995,2179 'success':1365 'sum':203,895 'summari':601 'surfac':597,1542 'sustain':1957 'swallow':490,519,1546 'system':398,421,2271 'team':1551 'technic':391,394,1498,2025,2213 'tell':1511 'temptat':2277 'test':1154,1196,1212,1263,2142 'testabl':78,1832 'theori':534 'thing':105,178 'third':1921 'thought':1474,1483 'thousand':873,1729 'thrash':1108 'thread':214,221,1166,1386,1860 'threshold':1354 'throw':1487 'throwaway':346 'tight':910 'time':865,1031,2253 'timeout':1305,1795,1849,1874,2151,2300 'tini':994 'toler':633,1605,2054 'tool':162,338 'top':415 'top-level':414 'topic-agent-skills' 'topic-ai-agents' 'topic-best-practices' 'topic-claude-code' 'topic-claude-code-plugin' 'topic-claude-code-skills' 'topic-coding-agents' 'topic-copilot-cli' 'topic-copilot-cli-plugin' 'topic-opencode' 'topic-opencode-plugin' 'topic-programming-principles' 'touch':358,2023 'track':1348 'trap':5,56 'tree':971,993 'tri':487 'trigger':271 'trip':884,1734 'trivial':841 'true':2016 'turn':1032,1138 'type':470,734,1245,1491,1613,2031,2062 'typo':292 'unavail':453 'unbound':1411,1952 'uncheck':2189 'understood':822,1678 'undocu':582 'unexplain':561 'unit':1153 'unit-test':1152 'unus':982 'updat':1668 'use':6,723,727,1603,1610,1617,1636,2059,2284 'user':154,354,430,604,829,2089 'valid':1442,1973,1996 'valu':307,500,640,1594 'van':1004,1061,2294 'var':584 'variabl':279 'via':679 'visibl':1735 'volum':268 'vs':967,969,1517 'wait':1569 'watch':656 'way':1497,1599 'web':226 'well':1233 'well-defin':1232 'whether':779,1252 'whole':1028,1928 'wild':685 'winder':823,2273 'window':1361 'winkel':1005,1062,2295 'withdraw':446 'without':318,1693,1885 'won':65,1782,1787 'work':180,869,1035,1557,1560,1689 'wors':1092 'wrap':1341,1647,1898 'wrapper':518 'wreck':77,1151 'write':25,83,136,210,483,501,505,1293 'wrong':553,686,1313 'x':643,674 'ε':642,645,744 'ε-level':743","prices":[{"id":"04b0ec59-e547-4601-aa47-6f9907a2a3e4","listingId":"6f1e7e90-6ee6-46e1-9e0c-fcc620af0f8e","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"oribarilan","category":"97","install_from":"skills.sh"},"createdAt":"2026-05-08T13:06:23.791Z"}],"sources":[{"listingId":"6f1e7e90-6ee6-46e1-9e0c-fcc620af0f8e","source":"github","sourceId":"oribarilan/97/error-and-correctness-traps","sourceUrl":"https://github.com/oribarilan/97/tree/main/skills/error-and-correctness-traps","isPrimary":false,"firstSeenAt":"2026-05-08T13:06:23.791Z","lastSeenAt":"2026-05-10T13:04:27.138Z"}],"details":{"listingId":"6f1e7e90-6ee6-46e1-9e0c-fcc620af0f8e","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"oribarilan","slug":"error-and-correctness-traps","github":{"repo":"oribarilan/97","stars":17,"topics":["agent-skills","ai-agents","best-practices","claude-code","claude-code-plugin","claude-code-skills","coding-agents","copilot-cli","copilot-cli-plugin","opencode","opencode-plugin","programming-principles"],"license":"other","html_url":"https://github.com/oribarilan/97","pushed_at":"2026-05-09T04:27:37Z","description":"Agent skills distilled from the hard-won lessons of world-renowned programmers, in the spirit of \"97 Things Every Programmer Should Know\"","skill_md_sha":"fe331f2ed1e02c3f49aa4fcece410861e75c24c4","skill_md_path":"skills/error-and-correctness-traps/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/oribarilan/97/tree/main/skills/error-and-correctness-traps"},"layout":"multi","source":"github","category":"97","frontmatter":{"name":"error-and-correctness-traps","description":"Use when adding error handling to a call that can fail, comparing or calculating with floating-point numbers, writing concurrent or parallel code, calling a remote process or another service, adding a singleton or globally-shared mutable state, choosing a data structure for a hot path, or adding/changing log statements"},"skills_sh_url":"https://skills.sh/oribarilan/97/error-and-correctness-traps"},"updatedAt":"2026-05-10T13:04:27.138Z"}}