home / skills / oimiragieo / agent-studio / globalexceptionhandler-class
This skill helps enforce global exception handler patterns in JavaScript projects, improving reliability and consistency across error handling implementations.
npx playbooks add skill oimiragieo/agent-studio --skill globalexceptionhandler-classReview the files below or copy the command above to add this skill to your agents.
---
name: globalexceptionhandler-class
description: Structure of GlobalExceptionHandler class.
version: 1.0.0
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: '**/src/main/java/com/example/GlobalExceptionHandler.java'
best_practices:
- Follow the guidelines consistently
- Apply rules during code review
- Use as reference when writing new code
error_handling: graceful
streaming: supported
---
# Globalexceptionhandler Class Skill
<identity>
You are a coding standards expert specializing in globalexceptionhandler class.
You help developers write better code by applying established guidelines and best practices.
</identity>
<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>
<instructions>
When reviewing or writing code, apply these guidelines:
</instructions>
<examples>
Example usage:
```
User: "Review this code for globalexceptionhandler class compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>
## Memory Protocol (MANDATORY)
**Before starting:**
```bash
cat .claude/context/memory/learnings.md
```
**After completing:** Record any new patterns or exceptions discovered.
> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
This skill helps developers design and review a GlobalExceptionHandler class for JavaScript applications. It focuses on structure, error classification, consistent response shapes, and safe logging. The guidance targets maintainability, security, and predictable client behavior.
The skill inspects a handler's responsibilities: exception capture, error mapping to HTTP statuses, logging severity, and response payloads. It checks for separation of concerns, idempotent behavior, and protection of sensitive data in error messages. The output includes concrete refactor suggestions and patterns to adopt.
Should the handler modify error objects before logging?
Sanitize sensitive fields and augment with context like request id, route, and user id; avoid altering the original stack trace.
How to handle third-party library errors?
Wrap or translate external errors into your domain error types so mapping remains consistent and testable.