asiaostrich/universal-dev-standards/error-code-guide
Claude Code and agent skill by asiaostrich/universal-dev-standards
- community
Checking that the SKILL.md file is still in the repository.
Design consistent error codes following the PREFIX_CATEGORY_NUMBER format. Use when: defining error codes, creating error handling, designing APIs. Not for: log format and levels — use /logging-guide; handling errors that already reached production — use /incident. Keywords: error code, error handling, error format, API errors.
Install
npx vskill@latest install asiaostrich/universal-dev-standards/error-code-guideSKILL.md
The same SKILL.md was published earlier as asiaostrich/universal-dev-standards/error-code-guide.
Error Code Guide
Language: English | 繁體中文
Version: 1.0.0 Last Updated: 2025-12-30 Applicability: Claude Code Skills
Core Standard: This skill implements Error Code Standards. For comprehensive methodology documentation, refer to the core standard.
Purpose
This skill helps design consistent error codes following the standard format, enabling better debugging, monitoring, and user experience.
Quick Reference
Error Code Format
| Component | Description | Example | |
|---|---|---|---|
| PREFIX | Application/service identifier | AUTH, PAY, USR | |
| CATEGORY | Error category | VAL, SYS, BIZ | |
| NUMBER | Unique numeric identifier | 001, 100, 404 |
Examples
Error Categories
| Category | Full Name | Description | HTTP Status | |
|---|---|---|---|---|
| VAL | Validation | Client input validation failures | 400 | |
| BIZ | Business | Business rule violations | 422 | |
| SYS | System | Internal system failures | 500 | |
| NET | Network | Communication failures | 502/503/504 | |
| AUTH | Auth | Security-related errors | 401/403 |
Category Code Ranges
| Range | Description | Example | |
|---|---|---|---|
| *_VAL_001-099 | Field validation | Missing required field | |
| *_VAL_100-199 | Format validation | Invalid email format | |
| *_VAL_200-299 | Constraint validation | Password too short | |
| *_BIZ_001-099 | State violations | Order already cancelled | |
| *_BIZ_100-199 | Rule violations | Cannot return after 30 days | |
| *_BIZ_200-299 | Limit violations | Daily limit exceeded | |
| *_AUTH_001-099 | Authentication | Invalid credentials | |
| *_AUTH_100-199 | Authorization | Insufficient permissions | |
| *_AUTH_200-299 | Token/session | Token expired |
HTTP Status Code Mapping
| Category | HTTP Status | Description | |
|---|---|---|---|
| VAL | 400 | Bad Request | |
| BIZ | 422 | Unprocessable Entity | |
| AUTH (001-099) | 401 | Unauthorized | |
| AUTH (100-199) | 403 | Forbidden | |
| SYS | 500 | Internal Server Error | |
| NET | 502/503/504 | Gateway errors |
Detailed Guidelines
For complete standards, see:
AI-Optimized Format (Token-Efficient)
For AI assistants, use the YAML format files for reduced token usage:
- Base standard:
ai/standards/error-codes.ai.yaml
Error Response Format
Single Error
Multiple Errors
Internal Error Object
Internationalization (i18n)
Message Key Format
Example Translation Files
Examples
✅ Good Error Codes
❌ Bad Error Codes
Checklist
- [ ] Unique code for each error
- [ ] Category matches error type
- [ ] User message is localized
- [ ] HTTP status is correct
- [ ] Error is documented
- [ ] Code is in registry
Configuration Detection
This skill supports project-specific configuration.
Detection Order
- Check for existing error code patterns in codebase
- Check
CONTRIBUTING.mdfor error code guidelines - If not found, default to PREFIX_CATEGORY_NUMBER format
First-Time Setup
If no error code standard found:
- Suggest: "This project hasn't configured error code standards. Would you like to set up an error code registry?"
- Suggest creating
errors/registry.ts:
Next Steps Guidance | 下一步引導
After /errors completes, the AI assistant should suggest:
錯誤碼設計已完成。建議下一步 / Error code design completed. Suggested next steps:- 執行/sdd將錯誤碼設計納入正式規格 ⭐ Recommended / 推薦 — 確保錯誤碼在規格中有完整定義 / Ensure error codes are fully defined in specs- 執行/logging設定結構化日誌以配合錯誤碼 — 讓錯誤碼與日誌系統整合 / Integrate error codes with logging system- 執行/tdd為錯誤處理邏輯撰寫測試 — 確保每個錯誤碼都有對應的測試 / Ensure each error code has corresponding tests
Related Standards
Version History
| Version | Date | Changes | |
|---|---|---|---|
| 1.0.0 | 2025-12-30 | Initial release |
License
This skill is released under CC BY 4.0.
Source: universal-dev-standards
Security
- Security scanPassed, 90 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 repositoryCheckingskills/error-code-guide/SKILL.md
Popularity
- Repository stars
- 75
- Repository forks
- 13
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 2 Apr 2026, 7 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/asiaostrich/universal-dev-standards/error-code-guide)