errors

errors is a skill for Claude Code from MadAppGang/magus. It costs 39 tokens per session (2,142 once invoked), scanned A, original, MIT.

An error-handling and resilience guide for Bun and TypeScript services. It separates expected operating problems, such as rate limits, from unexpected programming errors, and covers validation, timeouts, retries, and circuit breakers.

In plain words
What is it for?
Use it to structure service errors, validate inputs, handle upstream failures, and add timeout, retry, or circuit-breaker behavior.
Why use it?
It gives different kinds of failures consistent responses and preserves useful error information for diagnosis.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the bunjs plugin — 9 skills, 9 commands shipped together

Good fit Use it to structure service errors, validate inputs, handle upstream failures, and add timeout, retry, or circuit-breaker behavior.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add MadAppGang/magus
Claude Code
/plugin install bunjs

Made for: Claude Code.

Or install bunjs, the plugin that ships this one along with the rest of its 9 skills, 9 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for errors

README.md
[![agentmods](https://agentmods.dev/badge/skills/madappgang/magus/errors/github.svg)](https://agentmods.dev/skills/madappgang/magus/errors)
Your own site
<a href="https://agentmods.dev/skills/madappgang/magus/errors"><img src="https://agentmods.dev/badge/skills/madappgang/magus/errors/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for errors

Your own site · 80×15
<a href="https://agentmods.dev/skills/madappgang/magus/errors"><img src="https://agentmods.dev/badge/skills/madappgang/magus/errors.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,142 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.02142
Opus 5.5 $0.00016 $0.00857
Sonnet 5.5 $0.00008 $0.00428
Haiku 4.5 $0.00004 $0.00214

Measured 1mo ago against content hash 5470300fa001, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo ago.

The scan reads SKILL.md. This mod also ships 7 executable files (assets/errors/app-error.test.ts, assets/errors/app-error.ts, assets/errors/catalog.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 });
plugins/bunjs/skills/errors/SKILL.md · 154 lines

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

Read the full file on GitHub · 154 lines

Changes

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.

  1. 1mo ago First seen · 154 lines · 39 tokens per session scan A 5470300fa001

Subscribe to this mod's changes

errors is a skill published in the GitHub repository MadAppGang/magus (13 stars, last pushed today), licensed MIT. It adds 39 tokens to every session and 2,142 once invoked, about $0.0002 per session on Opus 5.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.

Related

Other skills, from other repositories

api-integration-architect

Design, implement, debug, and optimize API integrations with expert-level patterns for REST, GraphQL, webhooks, and authentication flows.

sickn33/agentic-awesome-skills · 33 tokens

printing-press-amend

Amend a published CLI from one of two input sources: (1) dogfood mode mines the active Claude Code session transcript for friction (missing flags, hand- rolled API payloads, silent-null returns); (2) direct-input mode accepts user-supplied asks (rename a command, add commands or feeds, fix a named bug, optionally…

mvanhorn/cli-printing-press · 222 tokens

convex-performance-audit

Audits Convex performance for reads, subscriptions, write contention, and function limits. Use for slow features, insights findings, OCC conflicts, or read amplification.

openclaw/clawhub · 38 tokens

convex-insights

Query a running Convex app's logs + health in natural language (official MCP): failures, slow/expensive functions, deploy causality — scoped, evidence-backed, with a dashboard deep link.

openclaw/clawhub · 45 tokens

diagnose-backend-bug

Diagnose a bounded backend or multi-service failure from GitHub Issues, Jira, Aone, user-provided exports, logs, traces, responses, stack traces, or job records. Use when a service, API, RPC, worker, queue, CLI, or scheduled job bug needs correlation through the project's existing observability route before repair; do…

QoderAI/better-harness · 87 tokens

axiom-networking

Use when implementing or debugging ANY network connection, API call, or socket in an Apple app. Covers URLSession, Network.framework, NetworkConnection, connection diagnostics.

CharlesWiltgen/Axiom · 37 tokens