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 alivirgo/Major-AI-Skills --skill compact-error-handlinggit clone --depth 1 https://github.com/alivirgo/Major-AI-SkillsWrote 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/alivirgo/major-ai-skills/compact-error-handling)<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/compact-error-handling"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/compact-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/alivirgo/major-ai-skills/compact-error-handling"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/compact-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.00023 | $0.01148 |
| Opus 5 | $0.00012 | $0.00574 |
| Sonnet 5 | $0.00005 | $0.00230 |
| Haiku 4.5 | $0.00002 | $0.00115 |
Grade A, and why
compact-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 today.
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 — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Compact Error Handling (Multi-Exception Tuples & Result Wrappers)
Overview
When generating backend handlers or API callers, default LLM outputs create repetitive, bloated exception cascades (30 lines of sequential catch or except blocks that each perform the identical logging or fallback action).
This repetitive error boilerplate wastes output tokens, clutters the codebase, and increases maintenance overhead.
The Compact Error Handling Protocol enforces dense, idiomatic exception consolidation: using Multi-Exception Tuples, contextlib.suppress, and Functional Result Wrappers to reduce error handling code size by 60% with zero loss of fault tolerance.
Repetitive Cascades vs. Consolidated Exception Handling
┌─────────────────────────────────────────────────────────────┐
│ Error Handling Code Density │
│ │
│ Repetitive Exception Cascade (35 Lines / 280 Tokens): │
│ try: │
│ response = fetch_data(url) │
│ except ConnectionError as e: │
│ logger.error(f"Network failure: {e}") │
│ return None │
│ except TimeoutError as e: │
│ logger.error(f"Network failure: {e}") │
│ return None │
│ except HTTPError as e: │
│ logger.error(f"Network failure: {e}") │
│ return None │
│ │
│ Consolidated Multi-Exception Tuple (5 Lines / 45 Tokens): │
│ try: │
│ return fetch_data(url) │
│ except (ConnectionError, TimeoutError, HTTPError) as err: │
│ logger.error(f"Network failure: {err}") │
│ return None │
└─────────────────────────────────────────────────────────────┘
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.
- today Changed · -20 tokens per session cc625b1a989b
- 6d ago First seen · 135 lines · 43 tokens per session scan A 654164f7c907
compact-error-handling is a skill published in the GitHub repository alivirgo/Major-AI-Skills (1 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 1,148 once invoked, about $0.0001 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-09-05.
Other skills, from other repositories
build-teaql-app
Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…
error-handling
Use when designing the reaction to a class of failures — typed error taxonomies, retry/backoff/timeout policy, circuit breakers, React/Next error boundaries, and the user-message vs operator-log split. NOT diagnosing one specific crash (that is debug), NOT logs/metrics/traces (that is observability), NOT the wire…
nodejs
Use when building or operating a plain Node.js / Express 5 backend service: project layout, async correctness, central error middleware, fail-fast config, graceful shutdown on SIGTERM. NOT DI modules/providers/guards (that is nestjs), NOT the type system or tsconfig (that is typescript), NOT REST contract design (that…
azure-communication-services
Expert knowledge for Azure Communication Services development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when building ACS calling/chat apps, SMS/email senders, Teams interop…
algolia-search-v2
Algolia Search Integration workflow skill. Use this skill when the user needs Expert patterns for Algolia search implementation, indexing and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
amazon-alexa-v2
AMAZON ALEXA — Voz Inteligente com Claude workflow skill. Use this skill when the user needs Integracao completa com Amazon Alexa para criar skills de voz inteligentes, transformar Alexa em assistente com Claude como cerebro (projeto Auri) e integrar com AWS ecosystem (Lambda, DynamoDB, Polly, Transcribe, Lex, Smart…