aidd-error-causes

aidd-error-causes is a skill for Claude Code, Codex from paralleldrive/aidd. It costs 40 tokens per session (1,010 once invoked), scanned A, original, MIT.

A JavaScript and TypeScript error-handling approach based on the error-causes library. Errors carry named causes and other details such as messages and optional codes.

In plain words
What is it for?
Use it when throwing or catching errors, defining error types, attaching error metadata, or routing different failures to different handlers.
Why use it?
It makes errors easier to identify and route without relying on instanceof, which can fail when code runs across separate JavaScript environments such as browser frames. It also makes the intended handling clearer in the code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when throwing or catching errors, defining error types, attaching error metadata, or routing different failures to different handlers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/paralleldrive/aidd/aidd-error-causes
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add paralleldrive/aidd --skill aidd-error-causes
Clone the repo
git clone --depth 1 https://github.com/paralleldrive/aidd

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aidd-error-causes

README.md
[![agentmods](https://agentmods.dev/badge/skills/paralleldrive/aidd/aidd-error-causes/github.svg)](https://agentmods.dev/skills/paralleldrive/aidd/aidd-error-causes)
Your own site
<a href="https://agentmods.dev/skills/paralleldrive/aidd/aidd-error-causes"><img src="https://agentmods.dev/badge/skills/paralleldrive/aidd/aidd-error-causes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aidd-error-causes

Your own site · 80×15
<a href="https://agentmods.dev/skills/paralleldrive/aidd/aidd-error-causes"><img src="https://agentmods.dev/badge/skills/paralleldrive/aidd/aidd-error-causes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,010 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01010
Opus 5.5 $0.00016 $0.00404
Sonnet 5.5 $0.00008 $0.00202
Haiku 4.5 $0.00004 $0.00101

Measured 1mo ago against content hash 96be986381de, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

aidd-error-causes scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ai/skills/aidd-error-causes/SKILL.md · 171 lines

How it starts

The opening of the file, as written. The whole thing — 171 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Error Causes Rule

Use the error-causes library for all error handling in JavaScript/TypeScript code to enable structured error handling with named causes.

Why Error Causes?

  • Enables structured error handling with named causes instead of relying on instanceof checks
  • Works across memory realms (e.g., iframes) unlike instanceof
  • Provides consistent error metadata (name, code, message, cause)
  • Makes error handling explicit and self-documenting
  • Allows for automatic error routing based on error names

Import Statement

import { createError } from "error-causes";

Basic Usage

Instead of throwing plain errors:

// ❌ DON'T
throw new Error('Config key "API_KEY" is required');

Use createError with structured metadata:

// ✅ DO
throw createError({
  name: 'ConfigurationError',
  message: 'Required configuration key "API_KEY" is not defined',
  code: 'MISSING_CONFIG_KEY',
  requestedKey: 'API_KEY'
});

Error Properties

Always include these properties in createError:

  • name - Error name for matching (e.g., 'ValidationError', 'AuthenticationError')
  • message - Human-readable error message
  • code (optional) - Error code for programmatic handling
  • Custom properties (optional) - Any additional context relevant to the error

Wrapping Caught Errors

When catching and re-throwing errors, preserve the original error as cause:

try {
  await someOperation();
} catch (originalError) {
  throw createError({
    name: 'OperationError',
    message: 'Failed to perform operation',
    code: 'OPERATION_FAILED',
    cause: originalError  // Preserve original error
  });
}

Factory Validation Errors

For factory functions that validate parameters at creation time:

const createMiddleware = ({ requiredParam } = {}) => {
  if (!requiredParam) {
    throw createError({
      name: 'ValidationError',
      message: 'requiredParam is required',
      code: 'MISSING_REQUIRED_PARAM'
    });
  }

  return async ({ request, response }) => {
    // middleware implementation
  };
};

Read the full file on GitHub · 171 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 171 lines · 40 tokens per session scan A 96be986381de

Subscribe to this mod's changes

aidd-error-causes is a skill published in the GitHub repository paralleldrive/aidd (385 stars, last pushed 4mo ago), licensed MIT. It adds 40 tokens to every session and 1,010 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agents-sdk-typescript-debugging

Use when troubleshooting an agent built with the Microsoft Agents SDK (@microsoft/agents-hosting and related packages). Trigger on any of these symptoms: build or TypeScript errors, crashes on startup, 401 or auth errors on incoming requests, the bot not responding to messages, .env configuration problems, Azure AD…

microsoft/Agents · 125 tokens

chat-sdk

Build multi-platform chat bots with Chat SDK (chat npm package). Use when developers want to (1) Build a Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, or WhatsApp bot, (2) Use Chat SDK to handle mentions, direct messages, subscribed threads, reactions, slash commands, cards, modals, files, or AI…

vercel-labs/open-agents · 191 tokens

capacitor-plugin-development

Guides the agent through creating and maintaining Capacitor plugins from scratch. Covers scaffolding a new plugin project, designing the TypeScript API, implementing native iOS (Swift) and Android (Java/Kotlin) bridges, implementing the web layer, defining TypeScript type definitions, plugin configuration values…

capawesome-team/skills · 117 tokens

python-debugpy

Debug Python: pdb REPL + debugpy remote (DAP).

HezaoHezao/poirot · 17 tokens

error-handling

Apply error handling and recovery patterns in JavaScript/TypeScript or Node.js. Use when implementing error handling, retry logic, or when the user mentions domain errors, error recovery, error escalation.

metarhia/metaskills · 43 tokens

error-handling

Implement Go error handling patterns including error wrapping, sentinel errors, custom error types, and error handling conventions. Use when handling errors, creating error types, or implementing error propagation. Trigger words include "error", "panic", "recover", "error handling", "error wrapping".

armanzeroeight/fastagent-plugins · 59 tokens