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 joaoguirunas/team-os --skill dev-error-handlinggit clone --depth 1 https://github.com/joaoguirunas/team-osWrote 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/joaoguirunas/team-os/dev-error-handling)<a href="https://agentmods.dev/skills/joaoguirunas/team-os/dev-error-handling"><img src="https://agentmods.dev/badge/skills/joaoguirunas/team-os/dev-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/joaoguirunas/team-os/dev-error-handling"><img src="https://agentmods.dev/badge/skills/joaoguirunas/team-os/dev-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.00052 | $0.02333 |
| Opus 5.5 | $0.00021 | $0.00933 |
| Sonnet 5.5 | $0.00010 | $0.00467 |
| Haiku 4.5 | $0.00005 | $0.00233 |
Grade A, and why
dev-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 2d 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 — 267 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling & Resilience — Software Complexo
Princípio fundamental
Falha é inevitável. Design para falha, não apenas para sucesso.
Todo código que interage com: banco de dados, APIs externas, filesystem, serviços de terceiros — deve ter error handling explícito.
Retry com Exponential Backoff
async function withRetry<T>(
fn: () => Promise<T>,
options: { maxAttempts?: number; baseDelay?: number } = {}
): Promise<T> {
const { maxAttempts = 3, baseDelay = 300 } = options
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
return await fn()
} catch (error) {
if (attempt === maxAttempts) throw error
// Não fazer retry em erros 4xx (erro do cliente, não transitório)
if (error.status >= 400 && error.status < 500) throw error
const delay = baseDelay * Math.pow(2, attempt - 1) // 300ms, 600ms, 1200ms
const jitter = Math.random() * 100
await sleep(delay + jitter)
}
}
}
// Uso
const user = await withRetry(() => externalApi.getUser(id), { maxAttempts: 3 })
Timeout Explícito
async function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {
const timeout = new Promise<never>((_, reject) =>
setTimeout(() => reject(new Error(`Timeout after ${ms}ms`)), ms)
)
return Promise.race([promise, timeout])
}
// Uso — nunca deixar chamada externa sem timeout
const result = await withTimeout(
externalApi.processPayment(data),
5000 // 5 segundos máximo
)
Circuit Breaker
Evita cascata de falhas — para de tentar quando serviço está claramente down.
class CircuitBreaker {
private failures = 0
private lastFailure?: Date
private state: 'CLOSED' | 'OPEN' | 'HALF_OPEN' = 'CLOSED'
constructor(
private readonly threshold = 5, // abrir após 5 falhas
private readonly timeout = 60000 // tentar novamente após 60s
) {}
async execute<T>(fn: () => Promise<T>): Promise<T> {
if (this.state === 'OPEN') {
const elapsed = Date.now() - this.lastFailure!.getTime()
if (elapsed < this.timeout) {
throw new Error('Circuit breaker is OPEN — service unavailable')
}
this.state = 'HALF_OPEN'
}
try {
const result = await fn()
this.onSuccess()
return result
} catch (error) {
this.onFailure()
throw error
}
}
private onSuccess() { this.failures = 0; this.state = 'CLOSED' }
private onFailure() {
this.failures++
this.lastFailure = new Date()
if (this.failures >= this.threshold) this.state = 'OPEN'
}
}
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.
- 2d ago Changed · +34 lines · +19 tokens per session 36bfeadc119d
- 27d ago Changed 1483e52a64dc
- 1mo ago First seen · 233 lines · 33 tokens per session scan A b44b8ecb83eb
dev-error-handling is a skill published in the GitHub repository joaoguirunas/team-os (5 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 2,333 once invoked, about $0.0002 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.
Other skills, from other repositories
api-analyzer
Validates whether an API request is correct based on provided inputs (method, URL, headers, body, auth, query params).
api-integration-architect
Design, implement, debug, and optimize API integrations with expert-level patterns for REST, GraphQL, webhooks, and authentication flows.
ast-grep
Searches and rewrites code by AST shape across 25 languages. Use when the target is a syntax pattern (every call/class/import shaped like X, a codemod, a YAML rule) rather than literal text; for plain strings, comments, or filenames, use rg.
lcx-doctor
Diagnose LazyCodex and Codex CLI installation health against the latest sources. Use whenever the user asks for a doctor or health check, says LazyCodex, lazycodex-ai, omo-codex, or Codex behaves oddly after an install, update, or config change, suspects a stale, drifted, or broken setup, or wants the local install…
lcx-report-bug
Create a high-signal bug issue or PR in the repo that owns the defect. Use this whenever the user asks to report, file, open, or triage a LazyCodex, lazycodex-ai, omo-codex, Codex plugin, or upstream Codex CLI bug, especially when they need source-backed root cause, reproduction steps, fix guidance, and GitHub routing.
tidewave-integration
Tidewave MCP runtime tools — debugging, smoke testing, live state inspection, SQL queries, hex docs. Use when evaluating code in a running Phoenix app.