Skip to content
Back to skills

Check Error Handling

ASecurity

Validates error handling follows RunnerError pattern, detects anyhow regression, ensures ErrorKind usage

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 25, 2026
ai-agentsrustbash

Security analysis

A100/100

Scanned September 25, 2026

npx -y skills add dravr-ai/dravr-embacle --skill check-error-handling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Check Error Handling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Check Error Handling
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/dravr-ai-check-error-handling/badge)](https://www.skillsdirectory.com/skills/dravr-ai-check-error-handling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: check-error-handling
description: Validates error handling follows RunnerError pattern, detects anyhow regression, ensures ErrorKind usage
user-invocable: true
---

# Check Error Handling Skill

## Purpose
Validates that error handling follows the RunnerError/ErrorKind pattern. Detects anyhow regression.

## Usage
Run this skill before committing error handling changes.

## Prerequisites
- ripgrep (`rg`)

## Commands

### Quick Check
```bash
echo "πŸ” Checking for anyhow usage..."

# 1. Check imports (FORBIDDEN)
if rg "use anyhow::|use anyhow;" src/ --type rust --quiet; then
    echo "❌ FAIL: anyhow imports detected!"
    rg "use anyhow" src/ --type rust -n | head -10
    exit 1
else
    echo "βœ“ PASS: No anyhow imports"
fi

# 2. Check macro usage (FORBIDDEN)
if rg "anyhow!\(" src/ --type rust --quiet; then
    echo "❌ FAIL: anyhow! macro detected!"
    rg "anyhow!\(" src/ --type rust -n | head -10
    exit 1
else
    echo "βœ“ PASS: No anyhow! macro"
fi

# 3. Check RunnerError usage
RUNNER_ERROR_COUNT=$(rg "RunnerError::" src/ --type rust | wc -l)
echo "βœ“ RunnerError usage: $RUNNER_ERROR_COUNT occurrences"

# 4. Check ErrorKind usage
ERRORKIND_COUNT=$(rg "ErrorKind::" src/ --type rust | wc -l)
echo "βœ“ ErrorKind usage: $ERRORKIND_COUNT occurrences"

echo ""
echo "βœ… Error handling check PASSED"
```

## Success Criteria
- βœ… Zero `use anyhow` imports in src/
- βœ… Zero `anyhow!()` macro usage
- βœ… RunnerError used throughout
- βœ… ErrorKind variants used for error classification

## Fixing Violations

### Replace anyhow
```rust
// ❌ Before
return Err(anyhow!("Binary not found"));

// βœ… After
return Err(RunnerError::binary_not_found("claude"));
return Err(RunnerError::internal("description"));
return Err(RunnerError::external_service("service", "description"));
```

## Related Files
- `src/types.rs` - RunnerError and ErrorKind definitions
- `src/lib.rs` - Type exports

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.