
Controller advice
Sets up global Sankhya exception handlers with rollback, error DTOs and HTTP status
Controller advice is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 7
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Controller advice
This skill guides the creation, review and consolidation of a single global exception handling layer for Sankhya Addon Studio 2.0 projects, built on a ControllerAdvice class with ExceptionHandler methods. It covers the rules that make these handlers work: handlers must return an object or primitive rather than void, each exception should map to exactly one handler across the project, and generic catch-all handlers for Exception should be avoided.
The skill also sets out a standard error response shape with a code, message, status and timestamp, and insists that stack traces stay in server logs rather than reaching the client. It includes a suggested log level table for common Sankhya and Java exceptions, plus an anti-pattern list and a checklist for adding a new advice class.
It expects a Java 8 Gradle project using the Addon Studio web and Lombok annotations, and it refers to a related controller skill for the endpoints that raise these exceptions. The content is written in Portuguese.
When your agent uses it
Cria, revisa e padroniza handlers globais de exceção Sankhya com `@ControllerAdvice` + `@ExceptionHandler` — rollback automático, DTO de erro, mapeamento de status HTTP, inclusive para violação de `@Valid` vinda do controller. Declarar a constraint no DTO é `controller`; aqui mora a resposta HTTP da violação e de qualquer exceção do addon. Use ao criar, alterar, revisar, auditar ou consolidar tratamento de exceções globais em projetos Sankhya Addon Studio, quando exceção do addon volta stacktrace cru para o cliente ou cada endpoint trata erro do seu jeito, ou ao tocar em código com `@ControllerAdvice`/`@ExceptionHandler`.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (7 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the addon-studio plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add snk-devcenter/addon-studio
/plugin install addon-studio@snk-devcenterOr copy only this skill to ~/.claude/skills/controller-advice:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/controller-advice &&
cp -R "$tmp/plugins/addon-studio/skills/controller-advice" ~/.claude/skills/controller-advice &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/controller-advice inside it instead.
Copy the skill folder to ~/.agents/skills/controller-advice to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/controller-advice &&
cp -R "$tmp/plugins/addon-studio/skills/controller-advice" ~/.agents/skills/controller-advice &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/controller-advice inside it instead.
Copy the skill folder to ~/.cursor/skills/controller-advice to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/controller-advice &&
cp -R "$tmp/plugins/addon-studio/skills/controller-advice" ~/.cursor/skills/controller-advice &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/controller-advice inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/snk-devcenter/addon-studio.git --path plugins/addon-studio/skills/controller-adviceOr copy the folder to ~/.gemini/skills/controller-advice yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/controller-advice:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/controller-advice &&
cp -R "$tmp/plugins/addon-studio/skills/controller-advice" ~/.copilot/skills/controller-advice &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/controller-advice inside it instead.
Get the folder:
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.gitThen copy addon-studio/plugins/addon-studio/skills/controller-advice into your agent's skills folder as controller-advice. Agents that support SKILL.md read one folder per skill.
What it does
- Global exception advice
- Shows how to centralize handling for all controllers in one ControllerAdvice class.
- Standard error response
- Provides a DTO with code, message, status and timestamp fields for client-facing errors.
- Handler design rules
- Explains constraints such as non-void return types and one handler per exception.
- Log level guidance
- Suggests logging levels for common entity, validation, integration and IO exceptions.
- Anti-pattern checklist
- Lists practices to avoid, such as catch-all handlers and exposed stack traces.
Good for
- Create a global exception handler for an Addon Studio project
- Review existing controllers for inconsistent error responses
- Consolidate duplicate exception handlers across the codebase
- Map service exceptions to proper HTTP status codes
- Stop stack traces from leaking to API clients
Controller advice FAQ
Does a caught exception in an exception handler roll back the transaction?
Yes. Catching an exception marks the active transaction for rollback automatically, so no manual action is needed.
Can an ExceptionHandler method return void?
No. Handlers must return an object or primitive because the result is serialized to JSON with Gson.
Should I use a catch-all handler for Exception?
No. The skill advises declaring specific exception classes, since a generic handler can take over exceptions meant for more specific handlers.
What does the skill require from the environment?
It targets Sankhya Addon Studio 2.0 with Wildfly/EJB and JAPE SDK, Java 8, Gradle and ISO-8859-1 encoding.
How do I install Controller advice in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/controller-advice to use it in all your projects, or to .claude/skills/controller-advice in one project. Or install the addon-studio plugin, which includes it: /plugin marketplace add snk-devcenter/addon-studio, then /plugin install addon-studio@snk-devcenter.
Does Controller advice run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Controller advice?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Controller advice?
The closest alternatives to Controller advice are Controller, Type adapter, Test, Callback and Retrofit.
Where this comes from
- Description: from the skill's own SKILL.md.
More from snk-devcenter/addon-studio

Adds dynamic search filters to Sankhya entity finders before the query runs
- Open source
- 7 GitHub stars
- Developer tools

Guides writing Sankhya commercial business rules with @BusinessRule for sales documents
- Open source
- 7 GitHub stars
- Enterprise it

Lets agents write, review and refactor Sankhya document callbacks with @Callback hooks
- Open source
- 7 GitHub stars
- Developer tools

Builds and reviews Sankhya REST endpoints with @Controller, DTOs and transactions
- Open source
- 7 GitHub stars
- Developer tools

Generates Sankhya CRUD screens from table XML in datadictionary/ with no JS or HTML
- Open source
- 7 GitHub stars
- Developer tools

Creates and audits dual MSSQL/Oracle database migration scripts for Sankhya addons
- Open source
- 7 GitHub stars
- Databases

