agentleFS
aprameyakaprameyak/coding-skills/error-handling/SKILL.md

error-handling

Skill1 starsChanged 58 days agoMITView on GitHub

Implement consistent, safe error handling. Use when adding failure paths, refactoring try/catch, designing error types, or improving observability.

44 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use logging, state-management and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • diego-tobalinaSkill

    logging

    Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.

    Also in 5 projects that use this

  • conorluddySkill

    state-management

    Cache management, configuration best practices, and progressive disclosure patterns for efficient context window usage. Use when working with large responses, optimizing token costs, or managing plugin state across operations.

    Also in 5 projects that use this

  • DatabricksSkill

    load-testing

    Load test a Databricks App to find its maximum QPS. Use when: (1) User says 'load test', 'benchmark', 'QPS', 'throughput', or 'performance test', (2) User wants to find how many queries per second their app can handle, (3) User wants to set up load testing scripts for their agent, (4) User wants to view load test results/dashboard, (5) User wants to validate results or observe latency/error rate with MLflow tracing.

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 5 projects that use this

  • ffsshhttiikkSkill

    i18n

    Internationalization and localization

    Also in 5 projects that use this

  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 6 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 37 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use typed/domain errors for expected failures.

    line 11
  2. Distinctive:

    Do not swallow errors without logging or propagating.

    line 12
  3. Distinctive:

    Never leak secrets, stack traces, or internal paths to untrusted clients.

    line 14
  4. Distinctive:

    Prefer central mapping (domain → HTTP/RPC) over ad-hoc status codes.

    line 21

“Common” is measured: kept by at least 6 in 10 of the 37 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Error Handling

Rules

  • Fail at trust boundaries with clear, actionable errors.
  • Use typed/domain errors for expected failures; reserve generic 500s for unexpected ones.
  • Do not swallow errors without logging or propagating.
  • Include stable error codes for clients when an API exists.
  • Never leak secrets, stack traces, or internal paths to untrusted clients.
  • Make retries safe: only retry transient failures with backoff.

Patterns

  • Validate early; return before side effects when possible.
  • Wrap low-level errors with context once; avoid giant wrap chains.
  • Prefer central mapping (domain → HTTP/RPC) over ad-hoc status codes.
  • Log with correlation IDs at the boundary where the request is known.

Checklist

  • Expected failures are handled
  • Unexpected failures are logged
  • User/client messages are safe
  • Partial failure semantics are defined for multi-step ops

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.