Skip to content
cccskills
FreePublished on GitHub

error-handler-gen

Generate framework-specific API error handling code, including middleware, custom error classes, HTTP status codes, and wrappers for catching rejected promises. Examples cover Express, Fastify, Next.js API routes, and Koa; Node.js 18+ and an OpenAI API key are listed requirements.

OriginalShow the original description

Generate error handling middleware for any framework. Use when setting up API error handling.

sundial-org/awesome-openclaw-skills671 stars(GitHub 671 + cccskills 0)
Works withX (Twitter)

Run score Not tested

See how to install

Good for

  • Adding consistent error responses to a new API
  • Standardizing error handling across routes
  • Generating middleware for an Express or Koa app
  • Handling rejected promises in API code

Files included (11)

  • SKILL.md2.0 KB
  • dist/cli.d.ts31 B
  • dist/cli.js2.8 KB
  • dist/index.d.ts97 B
  • dist/index.js1.3 KB
  • package-lock.json30.2 KB
  • package.json673 B
  • README.md642 B
  • src/cli.ts1.2 KB
  • src/index.ts1021 B
  • tsconfig.json251 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Error Handler Generator

Good error handling means custom error classes, proper status codes, and consistent response shapes. This tool generates all of it for your framework.

One command. Zero config. Just works.

Quick Start

npx ai-error-handler express

What It Does

  • Generates error middleware for your framework
  • Creates custom error classes (NotFoundError, ValidationError, etc.)
  • Includes async wrapper to catch promise rejections
  • Sets up proper HTTP status codes

Usage Examples

# Express middleware
npx ai-error-handler express

# Fastify in JavaScript
npx ai-error-handler fastify -l javascript

# Next.js API routes
npx ai-error-handler nextjs -o lib/errors.ts

# Koa
npx ai-error-handler koa

Best Practices

  • Don't leak stack traces - only show them in development
  • Log errors server-side - you need them for debugging
  • Use error codes - clients can handle specific codes
  • Be consistent - same error shape everywhere

When to Use This

  • Starting a new API project
  • Standardizing error handling across routes
  • Adding proper error responses to a messy codebase
  • Setting up error monitoring

Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

Find more:

Requirements

No install needed. Just run with npx. Node.js 18+ recommended. Needs OPENAI_API_KEY environment variable.

npx ai-error-handler --help

How It Works

Generates framework-specific error handling code including custom error classes, middleware, and async wrappers. The output follows best practices for each framework.

License

MIT. Free forever. Use it however you want.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

1password

FreeSummary

Set up and use the 1Password command-line tool `op` to sign in, verify account access, and work with vault data. The skill covers single or multiple accounts and shows how to run commands or fill templates with secrets while limiting exposure in logs and files.

  • Set up the `op` command-line tool
  • Sign in and verify access to an account
  • Run a command with vault secrets
sundial-org/awesome-openclaw-skills671Updated Mar 7, 2026

a-stock-analysis

FreeSummary

Check live prices, price changes, and trading volume for Shanghai, Shenzhen, and Beijing stocks. Review intraday volume patterns and possible large-investor activity, and manage holdings with cost, quantity, and profit or loss summaries.

  • Checking current prices for A-share stocks
  • Reviewing intraday volume and large-investor signals
  • Managing a stock portfolio and checking profit or loss
sundial-org/awesome-openclaw-skills671Updated Mar 7, 2026

a11y-checker

FreeSummary

Scan HTML or JSX files and directories for accessibility issues such as missing image descriptions, form labels, and keyboard access problems. The skill identifies WCAG guideline failures and provides suggested code fixes alongside its findings.

  • Checking a new component before release
  • Auditing an inherited codebase
  • Preparing for an accessibility compliance review
sundial-org/awesome-openclaw-skills671Updated Mar 7, 2026

ab-test-setup

FreeSummary

Plan A/B tests that compare page or product changes, with clear hypotheses, sample sizes, success metrics, and traffic allocation. Get a structured test plan and guidance for interpreting results and deciding what to try next.

  • Comparing signup button copy
  • Planning a pricing page experiment
  • Estimating sample size and test duration
sundial-org/awesome-openclaw-skills671Updated Mar 7, 2026

abm-outbound

FreeSummary

Turn LinkedIn profile URLs into coordinated account-based outreach. The workflow gathers profile details, enriches contacts with email and phone data, looks up mailing addresses, and prepares email, LinkedIn, and handwritten-letter touches with the specified services.

  • Building a multichannel campaign from LinkedIn prospect URLs
  • Enriching prospect records with work contact details
  • Coordinating email, LinkedIn, and handwritten mail outreach
sundial-org/awesome-openclaw-skills671Updated Mar 7, 2026

accli

FreeSummary

Work with Apple Calendar on macOS to list calendars, find and view events, and check busy time slots across calendars. Create, update, or delete events with details such as dates, locations, and descriptions.

  • Reviewing events on a work or personal calendar
  • Checking availability before scheduling a meeting
  • Creating or updating a calendar event
sundial-org/awesome-openclaw-skills671Updated Mar 7, 2026

See all skills by sundial-org

Report a problem with this skill