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 skills add lugassawan/swe-workbench --skill principle-error-handlinggit clone --depth 1 https://github.com/lugassawan/swe-workbenchWrote 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.
[](https://agentmods.dev/skills/lugassawan/swe-workbench/principle-error-handling)<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-error-handling"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-error-handling/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.
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/principle-error-handling"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/principle-error-handling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.01515 |
| Opus 5.5 | $0.00030 | $0.00606 |
| Sonnet 5.5 | $0.00015 | $0.00303 |
| Haiku 4.5 | $0.00007 | $0.00152 |
Grade A, and why
principle-error-handling scanned grade A with 0 findings 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 3mo 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling
Errors are part of the contract. Handling them is not defensive programming — it is the design.
Errors as Values vs Exceptions
Use the language's native error style; don't fight it.
- Go
errorvalues, RustResult<T, E>, TypeScript typed unions: errors are explicit return paths, visible in signatures, handled by callers. - Exceptions (Java, Python, C#) work best for truly unexpected conditions — programmer errors, not business failures.
- Reserve
panic/throw/ unchecked exceptions for unrecoverable programmer errors. Expected failures (network timeout, not found) must be value-level errors.
Classify Before Handling
Not all errors deserve the same response.
- Transient — network blip, timeout, lock contention: retry with backoff (fail soft — degrade gracefully while recovering).
- Permanent — bad input, not found, permission denied: fail fast — surface immediately to the caller, never retry.
- Programmer — nil deref, index out of bounds, invariant violated: panic/crash, fix the code.
- Misclassifying a permanent error as transient wastes retry budget and delays the caller.
Wrap, Don't Swallow
At each layer boundary, add context to the error and preserve the original cause for downstream inspection.
- Go:
fmt.Errorf("loading user config: %w", err)—%wpreserveserrors.Is/errors.Astraversal. - Rust:
anyhow::Context/.with_context(|| ...)— attach human-readable context without losing the source. - TypeScript: native
Errorsupports acauseoption —new Error("fetch failed", { cause: err }). - Never discard the original error (
return errors.New("failed")with no wrapping). The original context is lost forever.
Sentinel vs Typed vs Coded Errors
Three models; choose based on callsite needs.
Sentinel errors (Go io.EOF, Rust ErrorKind::NotFound)
- Use when: callers need to branch on a single known condition without importing a type.
- Costs: error set is open; callers do string-equal or
errors.Isidentity checks; hard to carry payload. - Don't use when: the error needs structured data (retry-after, field name, status code).
What ships with it
28 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.
- examples/config.cs.md 3.6 KB
- examples/config.go.md 2.7 KB
- examples/config.java.md 4.3 KB
- examples/config.kt.md 3.2 KB
- examples/config.py.md 2.9 KB
- examples/config.rb.md 2.5 KB
- examples/config.rs.md 3.3 KB
- examples/config.swift.md 3.0 KB
- examples/config.ts.md 3.0 KB
- examples/fetch.cs.md 3.4 KB
- examples/fetch.go.md 3.3 KB
- examples/fetch.java.md 3.6 KB
- examples/fetch.kt.md 3.4 KB
- examples/fetch.py.md 3.4 KB
- examples/fetch.rb.md 2.8 KB
- examples/fetch.rs.md 3.7 KB
- examples/fetch.swift.md 3.1 KB
- examples/fetch.ts.md 3.5 KB
- examples/withdraw.cs.md 2.8 KB
- examples/withdraw.go.md 2.7 KB
- examples/withdraw.java.md 3.3 KB
- examples/withdraw.kt.md 2.7 KB
- examples/withdraw.py.md 2.8 KB
- examples/withdraw.rb.md 2.5 KB
- examples/withdraw.rs.md 3.3 KB
- examples/withdraw.swift.md 2.9 KB
- examples/withdraw.ts.md 2.7 KB
- triggers.txt 538 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.
- 3mo ago First seen · 104 lines · 74 tokens per session scan A efcc8b3262e2
principle-error-handling is a skill published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed 2d ago), licensed MIT. It adds 74 tokens to every session and 1,515 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
principle-error-handling compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| principle-error-handlinglugassawan/swe-workbench | Skill | 3 | 2d ago | MIT | A | 74 | Claude Code |
| functions-developmentCrowdStrike/foundry-skills | Skill | 40 | yesterday | MIT | A | 124 | Claude Code |
| printing-press-amendmvanhorn/cli-printing-press | Skill | 5.1k | today | MIT | A | 222 | Claude Code |
| tidewave-integrationoliver-kriska/claude-elixir-phoenix | Skill | 580 | yesterday | MIT | A | 38 | Claude Code |
| perfoliver-kriska/claude-elixir-phoenix | Skill | 580 | yesterday | MIT | A | 50 | Claude Code |
| brooks-verifyhyhmrright/brooks-lint | Skill | 1.6k | yesterday | MIT | A | 145 | Claude Code |
| api-error-handlingsecondsky/claude-skills | Skill | 257 | 6d ago | MIT | A | 40 | Claude Code |