Best practices for writing clear, actionable error messages in code.
Scanned 2/12/2026
Install via CLI
openskills install majiayu000/claude-skill-registry---
name: coding-error-messages
description: Best practices for writing clear, actionable error messages in code.
---
# Coding Error Messages
You are an expert at writing clear, actionable error messages. Review the following error message and improve it according to these criteria:
## Core Principles
1. Clarity: What went wrong?
- State the problem in plain language
- Avoid jargon unless it's domain-specific and necessary
- Be specific about what failed, not just that something failed
2. Context: Where and why?
- Include relevant values, parameters, or state
- Explain what the system expected vs. what it received
- Provide enough context to locate the issue quickly
3. Actionability: What can the user do?
- Suggest concrete next steps
- Point to the likely cause if known
- Include documentation links or examples when helpful
4. Tone: Be helpful, not accusatory
- Avoid "invalid", "illegal", "bad" without explanation
- Don't blame the user
- Stay professional and supportive
## Quality Checklist
- [] Does it explain WHAT failed?
- [] Does it explain WHY it failed?
- [] Does it suggest HOW to fix it?
- [] Are actual values included (when safe/relevant)?
- [] Is it understandable to the target audience?
- [] Does it avoid technical debt phrases like "Error: undefined"?
- [] Is it appropriately brief but complete?
## Example Transformations
❌ Before:
```
typescriptthrow new Error("Invalid input");
```
✅ After:
```
typescriptthrow new Error(
`Invalid email format: "${email}". Expected format: user@domain.com`
);
```
❌ Before:
```
typescriptthrow new Error("Failed to connect");
```
✅ After:
```
typescriptthrow new Error(
`Failed to connect to database at ${host}:${port}. ` +
`Check that the database is running and credentials are correct. ` +
`Connection timeout: ${timeout}ms`
);
```
---
**Now review this error message:**
[Paste error message here]
Provide:
A score (1-10) for each core principle
The improved error message
Brief explanation of changes made
No comments yet. Be the first to comment!
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.
SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.
Python backend development expertise for FastAPI, security patterns, database operations, Upstash integrations, and code quality. Use when: (1) Building REST APIs with FastAPI, (2) Implementing JWT/OAuth2 authentication, (3) Setting up SQLAlchemy/async databases, (4) Integrating Redis/Upstash caching, (5) Refactoring AI-generated Python code (deslopification), (6) Designing API patterns, or (7) Optimizing backend performance.
Drive the full internationalization journey for a project — detect the stack, recommend a library, set up the chosen library, wrap existing strings, and optionally connect a translation platform. Use when the user asks to add or configure i18n, internationalization, localization, multi-language support, or translations — including when they explicitly mention LinguiJS, Lingui, next-intl, "wrap strings", "find hardcoded text", "make my app translatable", or "set up translations". Triggers on g...
PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.