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 Adit-Jain-srm/skill-forge --skill error-resiliencegit clone --depth 1 https://github.com/Adit-Jain-srm/skill-forgeWrote 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/adit-jain-srm/skill-forge/error-resilience)<a href="https://agentmods.dev/skills/adit-jain-srm/skill-forge/error-resilience"><img src="https://agentmods.dev/badge/skills/adit-jain-srm/skill-forge/error-resilience.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.1 | $0.00082 | $0.02412 |
| Opus 5 | $0.00041 | $0.01206 |
| Sonnet 5 | $0.00016 | $0.00482 |
| Haiku 4.5 | $0.00008 | $0.00241 |
Grade A, and why
error-resilience 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 8d 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 — 326 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Resilience Patterns
Overview
Production code fails. Networks drop, services crash, databases timeout. This skill teaches patterns that keep your system running when dependencies don't.
When to Use
- Any HTTP/API call to an external service
- Database operations that can timeout
- Background job processing
- Event/message consumers
- Any I/O operation in production code
- User asked "how do I handle errors properly"
- User asked "how do I retry failed operations"
Quick Start: The Minimum Viable Resilience
Every external call needs AT MINIMUM:
async function resilientCall<T>(
fn: () => Promise<T>,
options: { retries?: number; timeout?: number; fallback?: T } = {}
): Promise<T> {
const { retries = 3, timeout = 5000, fallback } = options;
for (let attempt = 1; attempt <= retries; attempt++) {
try {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeout);
const result = await fn();
clearTimeout(timer);
return result;
} catch (error) {
if (attempt === retries) {
if (fallback !== undefined) return fallback;
throw error;
}
await sleep(exponentialBackoff(attempt));
}
}
throw new Error('Unreachable');
}
function exponentialBackoff(attempt: number): number {
const base = 1000;
const jitter = Math.random() * 500;
return Math.min(base * Math.pow(2, attempt - 1) + jitter, 30000);
}
function sleep(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
}
Pattern 1: Retry with Exponential Backoff
When: Transient failures (network blips, rate limits, temporary unavailability)
// Configuration
const RETRY_CONFIG = {
maxAttempts: 3,
baseDelay: 1000, // 1s, 2s, 4s, 8s...
maxDelay: 30000, // Never wait > 30s
retryableErrors: [
'ECONNRESET', 'ETIMEDOUT', 'ECONNREFUSED',
'EPIPE', 'EAI_AGAIN', 'EHOSTUNREACH'
],
retryableStatuses: [408, 429, 500, 502, 503, 504]
};
async function withRetry<T>(
fn: () => Promise<T>,
config = RETRY_CONFIG
): Promise<T> {
let lastError: Error;
for (let attempt = 1; attempt <= config.maxAttempts; attempt++) {
try {
return await fn();
} catch (error: any) {
lastError = error;
if (!isRetryable(error, config)) throw error;
if (attempt === config.maxAttempts) throw error;
const delay = Math.min(
config.baseDelay * Math.pow(2, attempt - 1) + Math.random() * 500,
config.maxDelay
);
console.warn(`Attempt ${attempt} failed, retrying in ${delay}ms:`, error.message);
await sleep(delay);
}
}
throw lastError!;
}
function isRetryable(error: any, config: typeof RETRY_CONFIG): boolean {
if (error.code && config.retryableErrors.includes(error.code)) return true;
if (error.status && config.retryableStatuses.includes(error.status)) return true;
if (error.message?.includes('rate limit')) return true;
return false;
}
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.
- 8d ago First seen · 326 lines · 82 tokens per session scan A f4c2fa40fa2f
error-resilience is a skill published in the GitHub repository Adit-Jain-srm/skill-forge (2 stars, last pushed 2mo ago), licensed MIT. It adds 82 tokens to every session and 2,412 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-31.
Other skills, from other repositories
error-handling-patterns
Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
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…
kafka-consumer-lag
Analyse Kafka consumer group lag using the Lenses MCP server. Diagnoses lag causes (throughput bottlenecks, rebalancing, partition skew, stalled consumers) and suggests remediation. Use when user says "check consumer lag", "why are consumers slow", "lag report" or asks about consumer group health or offset progress.…
troubleshooting
Systematic backend debugging — reproduce, isolate root cause, implement fix with regression test.
error-handling-patterns
Use when picking a failure-reporting strategy — exceptions vs Result types, recoverable vs not, retry / circuit-breaker / graceful degradation — decision framework only, catalogues externalized.
awesome-performance-audit
Read-only audit of performance and reliability — event-loop discipline, streaming and backpressure, memory and CPU diagnostics, shutdown/timeout/job habits, resilience topology (circuit breakers, retry budgets, queue bounds), and frontend delivery (Core Web Vitals, bundle size, hydration) — with evidence per finding…