api-error-handling/SKILL.md
Comprehensive, standardized error response system for PHP REST APIs with SweetAlert2 integration. Use when building REST APIs that need consistent error formatting, specific error message extraction from database exceptions, validation error...
npx skillsauth add peterbamuhigire/skills-web-dev api-error-handlingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
api-error-handling or would be better handled by a more specific companion skill.references, examples only as needed.SKILL.md first, then load only the referenced deep-dive files that are necessary for the task.references/ directory for deep detail after reading the core workflow below.examples/ directory for concrete patterns when implementation shape matters.Implement comprehensive, standardized error response system for PHP REST APIs with consistent JSON envelopes, specific error message extraction, and SweetAlert2 integration.
Core Principles:
Security Baseline (Required): Always load and apply the Vibe Security Skill for PHP API work. Do not leak sensitive data in responses or logs.
Cross-Platform: APIs deploy to Windows (dev), Ubuntu (staging), Debian (production), all running MySQL 8.x. Use utf8mb4_unicode_ci collation. Match file/directory case exactly in require paths (Linux is case-sensitive). Use forward slashes in paths.
See subdirectories for:
references/ - Complete PHP classes (ApiResponse, ExceptionHandler, Exceptions)examples/ - Full endpoint implementation, frontend clientExtended guidance for api-error-handling was moved to references/skill-deep-dive.md to keep this entrypoint compact and fast to load.
Use that deep dive for:
Response Envelope StandardHTTP Status CodesApiResponse Helper (Quick Reference)Exception Handler (Quick Reference)Custom Exception ClassesAPI Bootstrap PatternEndpoint Implementation PatternFrontend IntegrationCritical Error Display PatternDebugging Data Shape MismatchesAPI Contract Validation (Frontend-Backend Alignment)Error Message Extractiondata-ai
Use when adding AI-powered analytics to a SaaS platform — semantic search over business data, natural language queries, trend detection, anomaly alerts, and AI-generated insights for dashboards. Covers embeddings, NL2SQL, and per-tenant analytics...
data-ai
Design AI-powered analytics dashboards — what metrics to show, how to display AI predictions and confidence, drill-down patterns, KPI cards, trend visualisation, AI Insights panels, export design, and role-based dashboard variants. Invoke when...
development
Use when designing, building, reviewing, or upgrading production software systems that must be secure, performant, maintainable, scalable, and user-centered. Apply before writing specs, code, architecture, APIs, databases, mobile apps, SaaS platforms, or ERP systems.
development
Professional web app UI using commercial templates (Tabler/Bootstrap 5) with strong frontend design direction when needed. Use for CRUD interfaces, dashboards, admin panels with SweetAlert2, DataTables, Flatpickr. Clone seeder-page.php, use...