# Callback

> Callback is an open-source agent skill for developer tools. Lets agents write, review and refactor Sankhya document callbacks with @Callback hooks. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/snk-devcenter/addon-studio/tree/main/plugins/addon-studio/skills/callback
- **Repository:** https://github.com/snk-devcenter/addon-studio
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** callback
- **Collection:** https://github.com/snk-devcenter/addon-studio
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill guides an agent through creating, reviewing and refactoring @Callback classes in the Sankhya Addon Studio 2.0 SDK. Such classes implement ICustomCallBack and run at fixed points of the commercial document lifecycle: header insertion or change, confirmation from the Central de Vendas or the Portal de Vendas, and batch billing in the portal. Because each class carries a single when/event pair, the skill stresses matching the event to the screen that triggers it.

The guidance covers the expected data keys and types for each event, the difference between BEFORE and AFTER timing, and how exceptions abort a confirmation. It also explains that AFTER callbacks run even when the operation failed, so they should check the error entry first, and that external calls should be asynchronous. It points to other skills for business rules on outgoing sales notes, JAPE CRUD listeners and grid action buttons.

Written in Portuguese for Java 8, Gradle and Wildfly/EJB projects with Guice injection. The skill ships as a single SKILL.md with no scripts.

## When your agent uses it

> Cria, revisa e refatora callbacks de documento Sankhya com `@Callback` (`ICustomCallBack` + `CallbackWhen` + `CallbackEvent`) — hooks que a plataforma dispara na inclusão/alteração do cabeçalho da nota, na confirmação pela Central de Vendas, na confirmação pelo Portal de Vendas e no faturamento em lote do portal. Use ao criar, alterar, revisar, auditar ou padronizar lógica que roda antes ou depois de confirmar documento comercial (pedido, nota de venda e também **nota de entrada/compra**), ao gerar ou emitir documento auxiliar antes da confirmação, ao abortar a confirmação com exceção, ao reagir ao resultado da confirmação inclusive quando ela falhou, ao interceptar inclusão/alteração de cabeçalho vinda dos portais ou de integração, ao interceptar o faturamento em lote no portal, ao trabalhar com classes `*Callback.java`, ou ao tocar em código com `@Callback`/`ICustomCallBack`. É também a skill de quem precisa descobrir **qual** `CallbackEvent` corresponde à tela: Central e Portal disparam eventos diferentes,

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/snk-devcenter/addon-studio/tree/HEAD/plugins/addon-studio/skills/callback)
- [License: MIT](https://github.com/snk-devcenter/addon-studio/tree/HEAD/plugins/addon-studio/skills/callback)

## Features

- **Event selection by screen:** Maps Central de Vendas, Portal de Vendas, portal billing and header insertion to the correct CallbackEvent.
- **BEFORE and AFTER timing:** Explains when to validate or abort versus when to react to the result of an operation.
- **Data keys per event:** Lists the exact keys and types passed in the data map for each event, including a casing pitfall.
- **Transaction and exception rules:** Covers how thrown exceptions are wrapped, why checked exceptions are not allowed, and transaction propagation risks.
- **Anti-pattern checklist:** Lists common mistakes such as duplicate annotations, synchronous API calls and misused messages, with fixes.

## Good for

- Validate a purchase invoice before it is confirmed in the Central de Vendas
- Run a check when a sales order is confirmed from the Portal de Vendas
- Send a confirmed document to an external system without blocking the confirmation
- Intercept header changes coming from portal or integration imports
- Review an existing callback class for wrong event or key names

## Install

### Claude Code

This skill ships in the `addon-studio` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add snk-devcenter/addon-studio
/plugin install addon-studio@snk-devcenter
```

Or copy only this skill to `~/.claude/skills/callback`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/callback &&
cp -R "$tmp/plugins/addon-studio/skills/callback" ~/.claude/skills/callback &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/callback` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/callback` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/callback &&
cp -R "$tmp/plugins/addon-studio/skills/callback" ~/.agents/skills/callback &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/callback` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/callback` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/callback &&
cp -R "$tmp/plugins/addon-studio/skills/callback" ~/.cursor/skills/callback &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/callback` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/snk-devcenter/addon-studio.git --path plugins/addon-studio/skills/callback
```

Or copy the folder to `~/.gemini/skills/callback` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/callback`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/callback &&
cp -R "$tmp/plugins/addon-studio/skills/callback" ~/.copilot/skills/callback &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/callback` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git
```

Then copy `addon-studio/plugins/addon-studio/skills/callback` into your agent's skills folder as `callback`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does Callback apply to purchase invoices?

Yes. The skill states that @Callback applies to all commercial documents, including Notas de Entrada, unlike @BusinessRule which covers outgoing sales notes and movements.

### Which event should I use for the Central and the Portal?

Central de Vendas confirmations use PROCESS_CONFIRMATION and Portal de Vendas confirmations use CONFIRMATION. Each needs its own class because @Callback is not repeatable.

### Do AFTER callbacks run if the operation failed?

Yes. The skill says AFTER runs even on error, so the callback should read the error entry and return early when it is set.

### Does the skill need XML or manual registration?

No. The skill says the annotation alone is enough and no XML or parameter editing is needed; injected services still need Guice wiring.

### How do I install Callback in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/callback to use it in all your projects, or to .claude/skills/callback 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 Callback 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 Callback?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Callback?

The closest alternatives to Callback are Listener, Sankhya utils, Test, Job and Sankhya js.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Listener](https://ai-powered.com/skills/listener): Listener is an open-source agent skill for developer tools.
- [Sankhya utils](https://ai-powered.com/skills/sankhya-utils): Sankhya utils is an open-source agent skill for developer tools.
- [Test](https://ai-powered.com/skills/test-snk-devcenter): Test is an open-source agent skill for developer tools.
- [Job](https://ai-powered.com/skills/job): Job is an open-source agent skill for developer tools.
- [Sankhya js](https://ai-powered.com/skills/sankhya-js): Sankhya js is an open-source agent skill for developer tools.
- [Jsp](https://ai-powered.com/skills/jsp): Jsp is an open-source agent skill for developer tools.
- [Before load listener](https://ai-powered.com/skills/before-load-listener): Before load listener is an open-source agent skill for developer tools.
- [Data dictionary](https://ai-powered.com/skills/data-dictionary): Data dictionary is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/callback
