paralleldrive/aidd/aidd-error-causes
Claude Code and agent skill by paralleldrive/aidd
- community
Checking that the SKILL.md file is still in the repository.
Use the error-causes library for structured error handling in JavaScript/TypeScript. Use when throwing errors, catching errors, defining error types, or implementing error routing.
Install
npx vskill@latest install paralleldrive/aidd/aidd-error-causesSKILL.md
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
instanceofchecks - 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
Basic Usage
Instead of throwing plain errors:
Use createError with structured metadata:
Error Properties
Always include these properties in createError:
name- Error name for matching (e.g., 'ValidationError', 'AuthenticationError')message- Human-readable error messagecode(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:
Factory Validation Errors
For factory functions that validate parameters at creation time:
Testing Error Causes
In tests, verify the error's cause property:
Error Handler Pattern
For APIs that define multiple error types, use the errorCauses pattern:
Rules
- Always use `createError` instead of
new Error()for thrown errors - Always include `name` and `message` in error metadata
- Include `code` when the error needs programmatic handling
- Preserve original errors using the
causeproperty when re-throwing - Add context with custom properties relevant to the error
- Test the `cause` property in error tests, not just the error message
- Define error types using
errorCauses()for APIs with multiple error types
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingai/skills/aidd-error-causes/SKILL.md
Popularity
- Repository stars
- 383
- Repository forks
- 33
- Repository npm downloads, 7 days
- 945
- 7-day trend score
- 46
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 29 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/paralleldrive/aidd/aidd-error-causes)