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/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/kensaurus/cursor-kenji/backend-error-handling"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/backend-error-handling.svg" alt="Reviewed on agentmods" width="80" 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.00057 | $0.02842 |
| Opus 5.5 | $0.00023 | $0.01137 |
| Sonnet 5.5 | $0.00011 | $0.00568 |
| 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 1mo 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 — 490 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
Layered error handling for full-stack apps: one action-result shape, boundaries, and toasts.
When to Use
- Adding error handling to new features
- Improving error user experience
- Standardizing error responses
- Debugging error propagation
- Adding error monitoring
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.
- 1mo ago Changed · -2 lines · -3 tokens per session 07617b885799
- 1mo ago Changed 8d5b4e46b069
- 1mo 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 26d ago), licensed MIT. It adds 57 tokens to every session and 2,842 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
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".
python-dev
Python backend conventions for this project. Use when implementing or modifying API endpoints, database models/migrations, services, schemas, or backend tests.
systematic-debugging
Use when encountering bugs, test failures, unexpected behavior, or any technical issue before proposing fixes.
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…
developing-genkit-dart
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.