Agent skill

Handling Rust Errors

by hashintel in hashintel/hash

HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash.

AGPL-3.0Auto-check passedDevelopment

Install Handling Rust Errors

skills CLI
$ npx skills add hashintel/hash --skill handling-rust-errors -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashintel/hash handling-rust-errors --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashintel/hash.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/handling-rust-errors .claude/skills/handling-rust-errors && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
handling-rust-errors
GitHub stars
1.7k
Token cost
~1k tokens
SKILL.md length
293 words
Files
4 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
AGPL-3.0

At a glance

HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash.

  • Working with Result types
  • SKILL.md covers Core Principles, HashQL Compiler Exception, Quick Start Guide and Common Quick Patterns, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Defining custom errors

What it does

Handling Rust Errors is an agent skill from hashintel/hash. HASH error handling patterns using error-stack crate. Use when working with Result types, Report types, defining custom errors, propagating errors with changecontext, adding context with attach, implementing Error trait, or documenting error conditions in Rust code.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/defining-errors.md`, `references/documenting-errors.md` and `references/propagating-errors.md`).

It sits in Development, covering Error handling. It works with Rust. The repository describes itself as: 🚀 The open-source, multi-tenant platform for self-building knowledge graphs and simulation. The licence is AGPL-3.0.

When your agent uses it

  • Working with Result types
  • Defining custom errors
  • Propagating errors with changecontext
  • Adding context with attach

Example prompts

  • “/handling-rust-errors”

What it can do on your machine

Read from SKILL.md and the folder at commit e189ab2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Handling Rust Errors loads about 1k tokens when it runs, and up to ~6.5k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 293 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~72
When it runs · the whole SKILL.md, loaded when a task matches
~1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashintel/hash at commit e189ab2, republished under its AGPL-3.0 licence (© hashintel). 293 words, ~1,031 tokens.

Download SKILL.mdSave it as .claude/skills/handling-rust-errors/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
handling-rust-errors
description
HASH error handling patterns using error-stack crate. Use when working with Result types, Report types, defining custom errors, propagating errors with change_context, adding context with attach, implementing Error trait, or documenting error conditions in Rust code.
license
AGPL-3.0

Rust Error-Stack Patterns

HASH-specific error handling patterns using the error-stack crate for consistent, debuggable error handling across the Rust codebase.

Core Principles

HASH uses error-stack exclusively for error handling:

✅ DO:

  • Use Report<MyError> for all error types
  • Use concrete error types: Report<MyError>
  • Import Error from core::error:: (not std::error::)
  • Import ResultExt as _ for trait methods

❌ DON'T:

  • Use anyhow or eyre crates
  • Use Box<dyn Error> (except in tests/prototyping)
  • Use Report<Box<dyn Error>>
  • Use thiserror (use derive_more instead)

HashQL Compiler Exception

HashQL compiler code uses a different error handling approach.

Code in libs/@local/hashql/* uses the hashql-diagnostics crate instead of error-stack. This is because compiler errors require rich formatting capabilities:

  • Source spans pointing to exact code locations
  • Multiple labeled regions within the same diagnostic
  • Fix suggestions with replacement text
  • Severity levels (error, warning, hint)

Which approach to use:

LocationError Handling
libs/@local/hashql/* (compiler code)Use hashql-diagnostics → See writing-hashql-diagnostics skill
Everywhere elseUse error-stack patterns from this skill

Traditional error-stack patterns still apply for HashQL infrastructure code (CLI, file I/O, configuration) that doesn't involve compiler diagnostics.

Quick Start Guide

Choose the reference that matches your current task:

Defining Errors

Use when: Creating new error types or error enums

  • Define error types with derive_more
  • Error enum patterns and variants
  • Implement the Error trait
  • Error type hierarchies
Propagating Errors

Use when: Handling Result types, using ? operator

  • Convert errors with .change_context() and .change_context_with()
  • Add context with .attach() and .attach_with()
  • Error conversion patterns
Documenting Errors

Use when: Writing doc comments for fallible functions

  • # Errors section format
  • Link error variants
  • Document runtime errors
  • Test error conditions

Common Quick Patterns

Creating an Error
rust
use error_stack::Report;

return Err(Report::new(MyError::NotFound))
    .attach(format!("ID: {}", id));
Propagating with Context
rust
use error_stack::ResultExt as _;

some_result
    .change_context(MyError::OperationFailed)
    .attach("Additional context")?;
Lazy Context (for expensive operations)
rust
use error_stack::ResultExt as _;

expensive_operation()
    .change_context(MyError::OperationFailed)
    .attach_with(|| format!("Debug info: {:?}", expensive_computation()))?;

References

© hashintel, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in .agents/skills/handling-rust-errors of hashintel/hash.

  • SKILL.md
  • references/defining-errors.md
  • references/documenting-errors.md
  • references/propagating-errors.md

Open the folder on GitHubat commit e189ab2

Compare with similar skills

Handling Rust Errors next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Handling Rust Errors compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Handling Rust Errors this skillhashintel/hash1.7k—~1kAutomated safety check: PassAGPL-3.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
SeekDB Code Reviewoceanbase/seekdb3.1k—~2.1kAutomated safety check: PassApache-2.0
Rust Async Patternsdiodeme/Gold-Band1439 repos~3.1kAutomated safety check: PassAGPL-3.0
Rust Engineerfarm-fe/farm5.6k1 repos~1.5kAutomated safety check: PassMIT
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • SeekDB Code Review

    oceanbase/seekdb

    Reviews seekdb pull requests and diffs for real defects in correctness, resources, concurrency, security and tests, reporting only Blocker or Major findings.

    3.1k GitHub stars~2.1k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Rust Async Patterns

    diodeme/Gold-Band

    Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns.

    143 GitHub starsUsed in 9 repos~3.1k tokens
    DevelopmentAuto-check passed
  • Rust Engineer

    farm-fe/farm

    Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions.

    5.6k GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed
  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Windmill Rust Backend Patterns

    windmill-labs/windmill

    Sets Rust conventions for the Windmill backend: error types, SQLx queries, JSON handling, async rules, module layout and rust-analyzer navigation.

    18k GitHub stars~869 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from hashintel/hash

All 17 skills in this repo
  • Documenting Rust Code

    hashintel/hash

    Rust documentation practices for HASH codebase. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Cargo.toml dependency management patterns for HASH workspace.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Testing Hashql

    hashintel/hash

    HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

    1.7k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • HashQL diagnostic writing patterns using hashql-diagnostics crate.

    1.7k GitHub stars~724 tokensUpdated today
    Auto-check passed
  • Writing Hashql Jexpr

    hashintel/hash

    HashQL J-Expr syntax for writing queries. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when creating, moving, splitting, or organizing TypeScript files and folders.

    1.7k GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Handling Rust Errors

What does Handling Rust Errors do?

HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash. Handling Rust Errors is an agent skill from hashintel/hash. HASH error handling patterns using error-stack crate.

When should I use Handling Rust Errors?

Handling Rust Errors fits situations like: working with Result types; defining custom errors; propagating errors with changecontext; adding context with attach.

How do I install Handling Rust Errors in Claude Code?

Run `npx skills add hashintel/hash --skill handling-rust-errors -a claude-code`. Or copy the skill folder (.agents/skills/handling-rust-errors in hashintel/hash) into .claude/skills/handling-rust-errors in your project. Claude Code loads it when a task matches its description.

How do I install Handling Rust Errors in Codex?

Run `npx skills add hashintel/hash --skill handling-rust-errors -a codex`. Or copy the skill folder (.agents/skills/handling-rust-errors in hashintel/hash) into .agents/skills/handling-rust-errors in your project. Codex loads it when a task matches its description.

Can I use Handling Rust Errors in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashintel/hash --skill handling-rust-errors -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/handling-rust-errors, .gemini/skills/handling-rust-errors, .github/skills/handling-rust-errors and .opencode/skills/handling-rust-errors in your project.

What does Handling Rust Errors need to run?

SKILL.md names no scripts, command-line tools or credentials: Handling Rust Errors is instructions for the agent only.

Does Handling Rust Errors access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Handling Rust Errors safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Handling Rust Errors use?

Handling Rust Errors is published under the AGPL-3.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Handling Rust Errors use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.5k tokens, read only when the agent opens those files.

What are the alternatives to Handling Rust Errors?

Skills that share tags, products or a category with Handling Rust Errors: Rust Best Practices (farm-fe/farm, 5.6k stars), SeekDB Code Review (oceanbase/seekdb, 3.1k stars), Rust Async Patterns (diodeme/Gold-Band, 143 stars) and Rust Engineer (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Handling Rust Errors?

hashintel (a GitHub organization) maintains it in hashintel/hash, which has 1,668 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: hashintel/hash on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.