error-response-system

Generate TypeScript error types from JSON configuration for standardized API responses.

1|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/vuthuonghai-steve/KLTN-By_Thuong_Hai-Steve --skill error-response-system
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: error-response-system
Source: https://github.com/vuthuonghai-steve/KLTN-By_Thuong_Hai-Steve/tree/main/.agent/skills/error-response-system
Command: npx skills add https://github.com/vuthuonghai-steve/KLTN-By_Thuong_Hai-Steve --skill error-response-system

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a standardized error response system for APIs, ensuring consistency, improving debugging, and enhancing user experience through clear, actionable error messages.

Core Features & Use Cases

  • Type-Safe Error Codes: Uses generated TypeScript types for robust error handling.
  • Standardized Format: Enforces a consistent JSON structure for all API errors.
  • Developer & User Clarity: Provides specific error codes, Vietnamese messages, and helpful suggestions.
  • Use Case: When an API endpoint fails due to an invalid user input, this Skill ensures a standardized VALIDATION_ERROR response is returned, detailing the specific fields that are incorrect and how to fix them, rather than a generic server error.

Quick Start

Use the error-response-system skill to return an unauthorized error from an API endpoint.

Frequently Asked Questions about error-response-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize API error handling in TypeScript?β–Ό

To standardize API error handling in TypeScript, use a system that generates type-safe definitions from a JSON configuration, enforcing a consistent JSON structure for HTTP and business-specific errors across your endpoints.

What is the best way to return consistent validation errors from an API?β–Ό

The best way to return consistent validation errors is to use a standardized error response system that outputs a specific VALIDATION_ERROR code, detailing incorrect fields and how to fix them rather than returning a generic server error.

How does TypeScript type generation work for API error codes?β–Ό

TypeScript type generation for API error codes works by reading a JSON configuration file and producing type-safe definitions, which enables robust validation and prevents undefined error structures during development and debugging.

Can I use a JSON configuration to define custom business-specific API errors?β–Ό

Yes, you can use a JSON configuration to define custom business-specific API errors. This configuration drives the generation of TypeScript definitions and enforces a standardized format for both HTTP and custom application errors.

Why do my API endpoints return inconsistent error messages?β–Ό

API endpoints return inconsistent error messages when lacking a centralized error response system. Implementing a structured standardization approach enforces a uniform JSON structure, specific error codes, and clear suggestions for user feedback.

Does this API error standardization approach support AI agents?β–Ό

Yes, this API error standardization approach supports AI agents by utilizing auto-activation rules and pattern recognition to automatically select the correct error codes during response generation and debugging workflows.