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 kensaurus/cursor-kenji --skill backend-error-handlinggit clone --depth 1 https://github.com/kensaurus/cursor-kenjiWrote 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/kensaurus/cursor-kenji/backend-error-handling)<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/backend-error-handling"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/backend-error-handling.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
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.00060 | $0.02843 |
| Opus 5 | $0.00030 | $0.01422 |
| Sonnet 5 | $0.00012 | $0.00569 |
| Haiku 4.5 | $0.00006 | $0.00284 |
Grade A, and why
backend-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 5d 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 — 492 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling Skill
Degree of freedom: MIXED. Which layer and message [HIGH freedom];
existing-type/boundary probes [LOW freedom — run exactly].
How to reason
- Observe — existing error types, boundaries,
ActionResult/ApiError - Interpret — missing layer vs inconsistent shape vs swallowed catch
- Classify — reuse-existing / extend-codes / add-boundary / toast-only
- Severity — unhandled 500 on a mutation outranks a missing toast
Worked example
Observe:
createUserthrows PrismaP2002; UI shows a blank catch;ActionResultalready lives intypes/errors.ts. Interpret: known conflict is unmapped; no field/toast path. Classify: reuseActionResult+CONFLICT; toast the message; do not add a second error type. Verify: duplicate email returns{ success: false, error: { code: 'CONFLICT' } }; form alert shown.
Self-critique before reporting
- Reuse shape — searched
ActionResult/ApiError/error.tsxbefore adding a type - User-safe —
INTERNAL_ERRORis generic; PII is not in the client message - Layered — boundary + action result + toast, not toast-only
- Right owner — plan-only observability audit →
plan-error-handling; live Sentry triage →debug-sentry-monitor
full error handling patterns for full-stack applications.
When to Use
- Adding error handling to new features
- Improving error user experience
- Standardizing error responses
- Debugging error propagation
- Adding error monitoring
CRITICAL: Check Existing First [LOW freedom — run exactly]
Before adding ANY error handling, verify:
- Check for existing error types:
rg "type.*Error|interface.*Error" --type ts
rg "ActionResult|ApiError" --type ts
- Check for existing error boundaries:
ls -la app/error.tsx app/global-error.tsx
rg "ErrorBoundary" --type tsx
- Check for existing error utilities:
rg "formatError|handleError|reportError" --type ts
ls -la src/lib/errors* src/lib/error* 2>/dev/null # @/lib/errors
What ships with it
1 file 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.
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.
- 5d ago First seen · 492 lines · 60 tokens per session scan A e1205c34c491
backend-error-handling is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 10d ago), licensed MIT. It adds 60 tokens to every session and 2,843 once invoked, about $0.0003 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-03.
Other skills, from other repositories
error-handling-standardizer
Creates consistent error handling with custom error classes, HTTP status mapping, structured logging, safe client messages, and error taxonomy. Use when standardizing "error handling", "logging", "error responses", or "exception management".
backend-latency-profiler-helper
Identifies API latency hotspots and bottlenecks with profiling tools, slow endpoint detection, suspected causes, and fix roadmap. Use for "latency profiling", "performance bottlenecks", "slow APIs", or "backend performance".
error-handling
Python error handling patterns for FastAPI, Pydantic, and asyncio. Follows "Let it crash" philosophy - raise exceptions, catch at boundaries. Covers HTTPException, global exception handlers, validation errors, background task failures. Use when: (1) Designing API error responses, (2) Handling RequestValidationError…
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…
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.
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.