evlog Map Rule Creator
evloghq/evlog
Walks through adding a new rule or framework adapter to `evlog map` in @evlog/cli, from the rule source and registry to types, tests, docs and the published skill.
A skill your agent uses when implementing custom error classes, error middleware, structured logging, retry logic, or graceful shutdown patterns in backend applications.
$ npx skills add MadAppGang/claude-code --skill error-handling -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install MadAppGang/claude-code error-handling --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dev/skills/backend/error-handling .claude/skills/error-handling && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "error-handling" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handling into .claude/skills/error-handling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "error-handling", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handlingType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add MadAppGang/claude-code --skill error-handling -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install MadAppGang/claude-code error-handling --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/dev/skills/backend/error-handling .agents/skills/error-handling && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "error-handling" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handling into .agents/skills/error-handling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "error-handling", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add MadAppGang/claude-code --skill error-handling -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install MadAppGang/claude-code error-handling --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/dev/skills/backend/error-handling .cursor/skills/error-handling && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "error-handling" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handling into .cursor/skills/error-handling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "error-handling", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/MadAppGang/claude-code.git --path plugins/dev/skills/backend/error-handling--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add MadAppGang/claude-code --skill error-handling -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install MadAppGang/claude-code error-handling --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/dev/skills/backend/error-handling .gemini/skills/error-handling && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "error-handling" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handling into .gemini/skills/error-handling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "error-handling", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install MadAppGang/claude-code error-handlingInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add MadAppGang/claude-code --skill error-handling -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/dev/skills/backend/error-handling .github/skills/error-handling && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "error-handling" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handling into .github/skills/error-handling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "error-handling", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add MadAppGang/claude-code --skill error-handling -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install MadAppGang/claude-code error-handling --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/dev/skills/backend/error-handling .opencode/skills/error-handling && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "error-handling" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/backend/error-handling into .opencode/skills/error-handling/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "error-handling", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
error-handlingA skill your agent uses when implementing custom error classes, error middleware, structured logging, retry logic, or graceful shutdown patterns in backend applications.
Error Handling is an agent skill from MadAppGang/claude-code. Use when implementing custom error classes, error middleware, structured logging, retry logic, or graceful shutdown patterns in backend applications.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Error handling and Observability. The repository describes itself as: claude code plugins marketplace. The licence is MIT.
Read from SKILL.md and the folder at commit 6097ad4. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and json).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Error Handling loads about 2.6k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 55 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from MadAppGang/claude-code at commit 6097ad4, republished under its MIT licence (© MadAppGang). 55 words, ~2,559 tokens.
.claude/skills/error-handling/SKILL.md (or your agent's skills folder).Backend error handling patterns for building robust and debuggable services.
// Base application error
class AppError extends Error {
constructor(
message: string,
public code: string,
public statusCode: number = 500,
public isOperational: boolean = true
) {
super(message);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
// Specific error types
class ValidationError extends AppError {
constructor(message: string, public fields?: Record<string, string>) {
super(message, 'VALIDATION_ERROR', 400);
}
}
class NotFoundError extends AppError {
constructor(resource: string, id?: string) {
super(
id ? `${resource} with id ${id} not found` : `${resource} not found`,
'NOT_FOUND',
404
);
}
}
class UnauthorizedError extends AppError {
constructor(message: string = 'Unauthorized') {
super(message, 'UNAUTHORIZED', 401);
}
}
class ForbiddenError extends AppError {
constructor(message: string = 'Forbidden') {
super(message, 'FORBIDDEN', 403);
}
}
class ConflictError extends AppError {
constructor(message: string) {
super(message, 'CONFLICT', 409);
}
}
class RateLimitError extends AppError {
constructor(public retryAfter: number) {
super('Too many requests', 'RATE_LIMIT', 429);
}
}interface ErrorResponse {
error: {
code: string;
message: string;
details?: unknown;
stack?: string; // Only in development
};
meta: {
requestId: string;
timestamp: string;
};
}
function formatError(error: AppError, requestId: string): ErrorResponse {
const response: ErrorResponse = {
error: {
code: error.code,
message: error.message,
},
meta: {
requestId,
timestamp: new Date().toISOString(),
},
};
if (error instanceof ValidationError && error.fields) {
response.error.details = error.fields;
}
if (process.env.NODE_ENV === 'development') {
response.error.stack = error.stack;
}
return response;
}// Validation error
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": {
"email": "Invalid email format",
"password": "Must be at least 8 characters"
}
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2024-01-15T10:30:00Z"
}
}
// Not found error
{
"error": {
"code": "NOT_FOUND",
"message": "User with id 123 not found"
},
"meta": {
"requestId": "req_def456",
"timestamp": "2024-01-15T10:30:00Z"
}
}
// Server error (production)
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
},
"meta": {
"requestId": "req_ghi789",
"timestamp": "2024-01-15T10:30:00Z"
}
}import { Request, Response, NextFunction } from 'express';
// Async handler wrapper
function asyncHandler(fn: Function) {
return (req: Request, res: Response, next: NextFunction) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
}
// Error handler middleware
function errorHandler(
error: Error,
req: Request,
res: Response,
next: NextFunction
) {
const requestId = req.headers['x-request-id'] as string || generateId();
// Log error
logger.error('Request failed', {
requestId,
error: error.message,
stack: error.stack,
path: req.path,
method: req.method,
});
// Handle known errors
if (error instanceof AppError) {
return res.status(error.statusCode).json(
formatError(error, requestId)
);
}
// Handle unknown errors
const internalError = new AppError(
process.env.NODE_ENV === 'production'
? 'An unexpected error occurred'
: error.message,
'INTERNAL_ERROR',
500,
false // Not operational
);
res.status(500).json(formatError(internalError, requestId));
}
// Usage
app.get('/users/:id', asyncHandler(async (req, res) => {
const user = await userService.findById(req.params.id);
if (!user) throw new NotFoundError('User', req.params.id);
res.json({ data: user });
}));
app.use(errorHandler);import { z, ZodError } from 'zod';
const createUserSchema = z.object({
email: z.string().email('Invalid email format'),
password: z.string().min(8, 'Password must be at least 8 characters'),
name: z.string().min(2, 'Name must be at least 2 characters'),
});
function validateBody<T>(schema: z.Schema<T>) {
return (req: Request, res: Response, next: NextFunction) => {
try {
req.body = schema.parse(req.body);
next();
} catch (error) {
if (error instanceof ZodError) {
const fields = error.errors.reduce((acc, err) => {
acc[err.path.join('.')] = err.message;
return acc;
}, {} as Record<string, string>);
throw new ValidationError('Invalid input data', fields);
}
throw error;
}
};
}
// Usage
app.post('/users', validateBody(createUserSchema), createUser);import { DatabaseError, UniqueConstraintError } from 'pg';
function handleDatabaseError(error: Error): AppError {
if (error instanceof UniqueConstraintError) {
return new ConflictError('Resource already exists');
}
if (error.message.includes('foreign key')) {
return new ValidationError('Referenced resource does not exist');
}
// Log unexpected database errors
logger.error('Database error', { error: error.message });
return new AppError('Database operation failed', 'DATABASE_ERROR', 500);
}
// Repository example
async function createUser(data: CreateUserInput): Promise<User> {
try {
return await db.users.create(data);
} catch (error) {
throw handleDatabaseError(error);
}
}class ExternalServiceError extends AppError {
constructor(
service: string,
public originalError?: Error
) {
super(
`External service ${service} failed`,
'EXTERNAL_SERVICE_ERROR',
503
);
}
}
async function callExternalAPI(url: string) {
try {
const response = await fetch(url, {
signal: AbortSignal.timeout(5000), // 5 second timeout
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return await response.json();
} catch (error) {
if (error.name === 'AbortError') {
throw new ExternalServiceError('API', new Error('Timeout'));
}
throw new ExternalServiceError('API', error);
}
}interface RetryOptions {
maxAttempts: number;
baseDelay: number;
maxDelay: number;
shouldRetry?: (error: Error) => boolean;
}
async function withRetry<T>(
fn: () => Promise<T>,
options: RetryOptions
): Promise<T> {
const { maxAttempts, baseDelay, maxDelay, shouldRetry } = options;
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
return await fn();
} catch (error) {
const canRetry = shouldRetry?.(error) ?? true;
if (!canRetry || attempt === maxAttempts) {
throw error;
}
const delay = Math.min(
baseDelay * Math.pow(2, attempt - 1),
maxDelay
);
logger.warn('Retrying operation', {
attempt,
maxAttempts,
delay,
error: error.message,
});
await sleep(delay);
}
}
throw new Error('Unreachable');
}
// Usage
const result = await withRetry(
() => externalAPI.call(),
{
maxAttempts: 3,
baseDelay: 1000,
maxDelay: 10000,
shouldRetry: (error) => error instanceof ExternalServiceError,
}
);// Structured logging
interface LogContext {
requestId?: string;
userId?: string;
[key: string]: unknown;
}
const logger = {
info: (message: string, context?: LogContext) => {
console.log(JSON.stringify({ level: 'info', message, ...context }));
},
warn: (message: string, context?: LogContext) => {
console.log(JSON.stringify({ level: 'warn', message, ...context }));
},
error: (message: string, context?: LogContext & { error?: string; stack?: string }) => {
console.error(JSON.stringify({ level: 'error', message, ...context }));
},
};
// Error logging middleware
function logErrors(error: Error, req: Request, res: Response, next: NextFunction) {
logger.error('Request error', {
requestId: req.headers['x-request-id'] as string,
userId: req.user?.id,
path: req.path,
method: req.method,
error: error.message,
stack: error.stack,
});
next(error);
}async function gracefulShutdown(signal: string) {
logger.info('Shutdown signal received', { signal });
// Stop accepting new requests
server.close(() => {
logger.info('HTTP server closed');
});
// Close database connections
await db.close();
logger.info('Database connections closed');
// Close other resources
await redis.quit();
logger.info('Redis connection closed');
process.exit(0);
}
process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));
process.on('SIGINT', () => gracefulShutdown('SIGINT'));
// Handle uncaught errors
process.on('uncaughtException', (error) => {
logger.error('Uncaught exception', { error: error.message, stack: error.stack });
gracefulShutdown('uncaughtException');
});
process.on('unhandledRejection', (reason) => {
logger.error('Unhandled rejection', { reason: String(reason) });
gracefulShutdown('unhandledRejection');
});Error handling patterns for robust backend services
© MadAppGang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/dev/skills/backend/error-handling of MadAppGang/claude-code.
Open the folder on GitHubat commit 6097ad4
Error Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Error Handling this skillMadAppGang/claude-code | 285 | — | ~2.6k | Automated safety check: Pass | MIT | |
| evlog Map Rule Creatorevloghq/evlog | 1.9k | — | ~2.9k | Automated safety check: Pass | MIT | |
| fp-go Logging PatternsIBM/fp-go | 2k | — | ~3.7k | Automated safety check: Pass | Apache-2.0 | |
| Rust SkillsJMBeresford/retrom | 2.1k | 1 repos | ~9.5k | Automated safety check: Pass | MIT | |
| Logging and Error Reporting for Warpwarpdotdev/warp | 65k | 1 repos | ~5.6k | Automated safety check: Pass | AGPL-3.0 | |
| Error HandlingCloudAI-X/claude-workflow-v2 | 1.4k | — | ~3.4k | Automated safety check: Pass | MIT |
evloghq/evlog
Walks through adding a new rule or framework adapter to `evlog map` in @evlog/cli, from the rule source and registry to types, tests, docs and the published skill.
IBM/fp-go
Adds logging to fp-go functional pipelines with Tap operators, entry and exit logs and error context, so that logging never changes the value or error flowing through.
JMBeresford/retrom
Comprehensive Rust coding guidelines with 265 rules across 26 categories.
warpdotdev/warp
Guides log level choices and when to raise a structured Sentry event instead of a plain log line in the Warp Rust codebase, keeping secrets out of logs.
CloudAI-X/claude-workflow-v2
Implements error handling patterns, structured logging, retry strategies, circuit breakers, and graceful degradation.
getsentry/toolkit
Review code for correct logging and error handling patterns.
MadAppGang/claude-code
Content brief template and creation methodology for SEO-optimized content.
MadAppGang/claude-code
A skill your agent uses when detecting project technology stack from files/configs/directory structure, auto-loading framework-specific skills, or analyzing multi-stack fullstack projects (e.g…
MadAppGang/claude-code
On-page SEO optimization techniques including keyword density, meta tags, heading structure, and readability.
MadAppGang/claude-code
Techniques for expanding seed keywords and clustering by topic and intent.
MadAppGang/claude-code
SERP analysis techniques for intent classification, feature identification, and competitive intelligence.
MadAppGang/claude-code
A skill your agent uses when deciding whether to launch an agent, selecting which agent to use, or coordinating multiple agents.
Categories
A skill your agent uses when implementing custom error classes, error middleware, structured logging, retry logic, or graceful shutdown patterns in backend applications. Error Handling is an agent skill from MadAppGang/claude-code. Use when implementing custom error classes, error middleware, structured logging, retry logic, or graceful shutdown patterns in backend applications.
Error Handling fits situations like: implementing custom error classes; error middleware; structured logging; graceful shutdown patterns in backend applications.
Run `npx skills add MadAppGang/claude-code --skill error-handling -a claude-code`. Or copy the skill folder (plugins/dev/skills/backend/error-handling in MadAppGang/claude-code) into .claude/skills/error-handling in your project. Claude Code loads it when a task matches its description.
Run `npx skills add MadAppGang/claude-code --skill error-handling -a codex`. Or copy the skill folder (plugins/dev/skills/backend/error-handling in MadAppGang/claude-code) into .agents/skills/error-handling in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MadAppGang/claude-code --skill error-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/error-handling, .gemini/skills/error-handling, .github/skills/error-handling and .opencode/skills/error-handling in your project.
SKILL.md names no scripts, command-line tools or credentials: Error Handling is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Error Handling is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Error Handling: evlog Map Rule Creator (evloghq/evlog, 1.9k stars), fp-go Logging Patterns (IBM/fp-go, 2k stars), Rust Skills (JMBeresford/retrom, 2.1k stars) and Logging and Error Reporting for Warp (warpdotdev/warp, 65k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
MadAppGang (a GitHub organization) maintains it in MadAppGang/claude-code, which has 285 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on March 15, 2026.
Source: MadAppGang/claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.