Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/madappgang/magus/errorsnpx skills add MadAppGang/magus --skill errorsgit clone --depth 1 https://github.com/MadAppGang/magusWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00039 | $0.02142 |
| Opus 5 | $0.00019 | $0.01071 |
| Sonnet 5 | $0.00008 | $0.00428 |
| Haiku 4.5 | $0.00004 | $0.00214 |
Grade A, and why
errors scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
await retry(() => withTimeout("charge", 2000, (signal) => fetch(url, { signal })), { attempts: 3 }); How it starts
The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Errors and resilience
Error handling is where most Node/Bun services rot, and it rots in a specific way: every catch block
makes its own decision. One returns null, one logs and continues, one re-throws a new Error(String(e))
that destroys the stack, one 500s on a validation failure. The result is a service that cannot tell you
whether it is healthy, because nothing knows what an error means.
This skill installs one distinction and builds everything on it.
The one distinction: operational vs programmer
| Operational | Programmer | |
|---|---|---|
| Examples | bad email, payment declined, upstream 503, rate limit, 404 | undefined is not a function, violated invariant, bad migration |
| Who was wrong | the caller, the network, the world | you |
| Did you anticipate it | yes — you wrote the throw | no |
| Correct response | answer the caller, log at warn, keep serving |
log at error with stack, let the process die and restart |
| Process state after | healthy | unknown |
The last row is the reason this matters. After a programmer error the process holds state nobody reasoned about — a half-applied transaction, a module that threw during init, a connection pool with a poisoned entry. Continuing is not resilience, it is serving unknown-correctness responses. The famous advice "never swallow errors" is really this: never let a programmer error be swallowed into the operational path.
Everything else in this skill follows mechanically. AppError.isOperational() is the classifier; it
returns false for anything that is not an AppError, because an unrecognised error is a bug until
proven otherwise.
Copy the module in; never retype it
The subtle parts — the cause chain walk that is cycle-safe, the 5xx message replacement, the
re-entrancy guard on shutdown, full-jitter backoff — degrade silently when retyped from memory.
53 tests ship with this code and pass (bun test, tsc --noEmit clean, Bun 1.3.10).
SKILL="${CLAUDE_PLUGIN_ROOT:+$CLAUDE_PLUGIN_ROOT/skills/errors}"; SKILL="${SKILL:-PASTE_THE_DIR_THIS_SKILL_MD_WAS_READ_FROM}" # that var is UNSET in a Bash tool (MEASURED) — so paste it. `:?` would ABORT the block and copy nothing
mkdir -p src; if [ -d "$SKILL/assets" ]; then cp -r "$SKILL/assets/errors" src/errors # app-error, catalog, handler, resilience + 3 test files
else echo "SKILL is still the placeholder — paste the real dir above and re-run"; fi
What ships with it
14 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/errors/app-error.test.ts 4.7 KB runs code
- assets/errors/app-error.ts 4.9 KB runs code
- assets/errors/catalog.ts 4.5 KB runs code
- assets/errors/handler.test.ts 7.2 KB runs code
- assets/errors/handler.ts 6.2 KB runs code
- assets/errors/resilience.test.ts 8.5 KB runs code
- assets/errors/resilience.ts 5.4 KB runs code
- bun.lock 1.1 KB
- package.json 347 B
- references/async-pitfalls.md 6.2 KB
- references/resilience-patterns.md 5.3 KB
- references/testing-error-paths.md 5.4 KB
- references/validation-boundaries.md 5.4 KB
- tsconfig.json 324 B
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 154 lines · 39 tokens per session scan A 5470300fa001
errors is a skill published in the GitHub repository MadAppGang/magus (9 stars, last pushed 3d ago), licensed MIT. It adds 39 tokens to every session and 2,142 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…