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/codybrom/clairvoyance/error-designnpx skills add codybrom/clairvoyance --skill error-designgit clone --depth 1 https://github.com/codybrom/clairvoyanceWrote 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/codybrom/clairvoyance/error-design)<a href="https://agentmods.dev/skills/codybrom/clairvoyance/error-design"><img src="https://agentmods.dev/badge/skills/codybrom/clairvoyance/error-design.svg" alt="Measured on agentmods" 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 | $0.00075 | $0.01268 |
| Opus 5 | $0.00037 | $0.00634 |
| Sonnet 5 | $0.00015 | $0.00254 |
| Haiku 4.5 | $0.00007 | $0.00127 |
Grade A, and why
error-design 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 3d 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 — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Design Review Lens
When invoked with $ARGUMENTS, focus the analysis on the specified file or module. Read the target code first, then apply the checks below.
Each exception a module throws is an interface element. The best way to deal with exceptions is to not have them.
The "Too Many Exceptions" Anti-Pattern
Programmers are often taught that "the more errors detected, the better," but this produces an over-defensive style that throws exceptions for anything suspicious. Throwing is easy. Handling is hard. Each exception type in a module's interface is one more thing callers must understand and prepare for, making the class shallower than it needs to be. Exception handlers are rarely exercised in practice, which means bugs in them accumulate silently. When a handler is finally needed, it may not work.
When to Apply
- Reviewing error handling code or exception hierarchies
- When a function has many error cases or throws many exception types
- When callers are burdened with handling errors that rarely occur
- When error handling code is longer than the happy path
Core Principles
The Decision Tree
The four techniques below have no canonical ordering. This tree sequences them by preference for practical use.
For every error condition:
1. Can the error be defined out of existence?
Change the interface so the condition isn't an error. If yes: do this. Always the best option.
2. Can the error be masked?
Handle internally without propagating. If yes: mask if handling is safe and complete.
3. Can the error be aggregated?
Replace many specific exceptions with one general mechanism. If yes: aggregate to reduce interface surface.
4. Must the caller handle it?
Propagate only if the caller genuinely must decide. If the caller can't do anything meaningful: crash.
Define Errors Out of Existence
Error conditions follow from how an operation is specified. Change the specification, and the error disappears.
The general move: instead of "do X" (fails if preconditions aren't met), write "ensure state S" (trivially satisfied if state already holds).
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.
- 3d ago First seen · 105 lines · 75 tokens per session scan A 6a78f8fc8f4e
error-design is a skill published in the GitHub repository codybrom/clairvoyance (12 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 1,268 once invoked, about $0.0004 per session on Opus 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-08-30.
Other skills, from other repositories
agent-architecture-planner
Use when designing an autonomous agent, planning agent architecture, building a scheduled automation, or creating a Claude Code agent workflow. Triggers: 'design an agent', 'build an automation', 'agent architecture', 'automate this workflow', 'create a scheduled agent', 'shell script agent'.
81-pipecat
Create your Pipecat skill from official documentation, then learn to improve it throughout the chapter.
2026-legal-research-agent
Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape. Activate on "find expungement data", "scrape state laws", "legal research", "court URLs", "statute sources", "Clean Slate laws", "automatic…
80-livekit-agents-majiayu000-claude-skill-registr
Create your LiveKit Agents skill from official documentation, then learn to improve it throughout the chapter.
ac-lock
Phase 4.0 — Acceptance Criteria lock checkpoint before implementation. Consolidates all ACs from PRD, TechSpec, and Tasks, presents to user for confirmation, and saves the locked AC list to accepted-criteria.md. Implementation only starts after explicit user confirmation.
advisor-triggers
Detects when user requests warrant critical analysis via /advise command.