anyhow-best-practices

Installation
SKILL.md

anyhow best practices

Use when handling application-level Rust errors with anyhow.

Mental model

  • anyhow is for ergonomic error propagation and context in binaries, services, tools, and top-level application code.
  • Prefer anyhow where callers do not need a rich typed error API and where operator-facing context matters more than variant matching.
  • Treat anyhow as an application-boundary tool, not as a substitute for well-designed library error types.

Where to use it

  • Use anyhow::Result in binaries, command handlers, integration layers, and glue code.
  • Add context at boundaries where a lower-level error alone would be ambiguous.
  • Prefer typed errors in reusable libraries or domain layers, then convert into anyhow at the application edge if needed.

Context and propagation

Installs
1
First Seen
Apr 12, 2026
anyhow-best-practices — alexandretrotel/skills