/kenji:plan-error-handlingfrom kenji skills
Audits silent failures and observability gaps across Sentry and Langfuse. Plans remediation phases for empty catch blocks, missing guards, and unhandled promise rejections.
Ships in kenji skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Degree of freedom: HIGH — map silent paths, score, plan. Stay plan-only. No code or SDK edits until each phase is approved.
| Skill | Owns |
|---|---|
| plan-error-handling (this) | Silent-failure + Sentry/Langfuse plan |
debug-sentry-monitor | Live Sentry triage |
audit-langfuse-llm | LLM eval / trace quality |
Propose: report + rethrow the empty catch on
api/pay.tscharge; init Sentry on the edge surface. Risk: payment failures produce no event — you only hear from the user. Keep-working: web client already captures unhandled exceptions. Phase: Phase 1 — stop silent failures.
Role: Senior reliability engineer + observability specialist.
Task: Map every silent-failure path across Sentry and Langfuse planes, score by
blast radius × invisibility, phase remediations, emit plan-error-handling.md.
Audit & plan only — no code or SDK edits until each phase is approved.
Find what fails in silence. Make it observable. Change nothing until approved.
AI coding agents optimize for making the error message go away, not for making
failure visible. Error-handling gaps are nearly twice as common in AI-generated
pull requests as in human ones — empty catch blocks, missing guards, unhandled
promise rejections, and handlers that leak stack traces into capture systems. The
dangerous part isn't the crash you see; it's the failure you don't.
This skill is the audit-and-plan half. Execution goes to backend-observability /
audit-langfuse-llm after you approve each phase.
Trigger phrases: "errors don't reach Sentry", "it fails silently", "empty catch blocks", "add error handling", "why can't I debug prod", "check my Langfuse traces", "my LLM costs are a mystery", "pre-launch observability".
Do not fire for: a specific firing incident (debug-error,
debug-sentry-monitor), or security gaps (plan-rls-audit,
plan-security-audit). This is the coverage audit, not incident response.
plan-stub-checker finds fake functionality (dead buttons). This finds real
functionality that fails invisibly. Different failure mode: "if this breaks in
production tonight, would you ever know?"
Walk every error path:
catch (e) {}, catch { return null },
catch (e) { console.log(e) } with no rethrow and no Sentry capture.Sentry.captureException. Local console ≠ production visibility.await without try/catch on
fallible calls, floating promises, missing .catch() on fire-and-forget.beforeSend scrubbing.For any AI/LLM feature:
@observe /
Langfuse generation wrapping them.If the user self-hosts Langfuse, add a note to re-check hosting and licensing terms against current upstream ownership before launch — a note, not a code finding.
console.log soup?path:line. For each: "If this fails in prod,
what's the signal?" — None / Console-only / Sentry / Langfuse.plan-error-handling.md, then end the turn with a standalone recap in chat: the two or three highest-impact findings and the first phase to approve. The file is the deliverable — write it before the recap. Do not edit code.plan-test-coverage.path:line and today's signaldebug-sentry-monitor; LLM quality → audit-langfuse-llmconsole.log ≠ Sentry; do not spam validation missesplan-error-handling.md# Error-Handling & Observability Audit — <repo>
_Audit-only. Nothing changes until each phase is approved._
## Scope
- Planes: [ ] Sentry [ ] Langfuse | Surfaces: web / edge / RN / server actions
- Assumptions / not inspected: …
## Verdict
| Plane | Silent failures | PII leaks | Coverage holes |
|-------|-----------------|-----------|----------------|
| Sentry | n | n | n |
| Langfuse | n | n | n |
## Findings — application errors (Sentry)
| # | path:line | Pattern | Signal today | Sev | Direction |
|---|-----------|---------|--------------|-----|-----------|
| E1 | api/pay.ts:88 | empty catch on charge | none | Crit | report + rethrow, surface to user |
## Findings — LLM observability (Langfuse)
| # | path:line | Gap | Sev | Direction |
|---|-----------|-----|-----|-----------|
| L1 | lib/ai.ts:40 | model call untraced | High | wrap with observe, capture usage |
## Phased burndown
- **Phase 1 — Stop silent failures** → `backend-observability` — E-tier swallows
- **Phase 2 — Close coverage holes** → `backend-observability` — init gaps, maps
- **Phase 3 — Redact PII** → `backend-observability` — beforeSend / SDK redaction
- **Phase 4 — LLM tracing & evals** → `audit-langfuse-llm` — L-tier items
## Execution handoff
Approve a phase to run it. Re-run after to confirm failures are now observable.
plan-error-handling); complements
plan-test-coverage (tests prevent; observability reveals).backend-observability, audit-langfuse-llm,
debug-sentry-monitor.Plan at high effort. Execute after approval at the default effort under
approved-plan-execution.mdc(no reward hacking, no feature deletion). The plan says what is invisible; the rule constrains how it's wired.
What SKILL.md sets; muted values are Claude Code's defaults
highThree short reads, in order
162 skills in this plugin
/audit-accessibilityWCAG 2.2 AA audit via playwright-cli: axe-core, keyboard, contrast, target size, focus, ARIA. Use when "audit accessibility", "check a11y", "WCAG audit", "check keyboard nav", or "test screen reader".
/audit-agent-speedMeasure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans. Use when "Claude is slow" or "CPU is pinned". App speed → audit-performance.
/audit-analyticsRead-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events. Use when "audit our analytics", "are we tracking the right events", or "funnel instrumentation".
npx claudepluginhub kensaurus/skills --plugin kenjiOther plugins' skills for the same job