
Listener
Gives the agent Sankhya @Listener persistence hooks for insert, update and delete events
Listener is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 7
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Listener
This skill guides an agent through writing, reviewing and standardizing Sankhya persistence listeners built with the @Listener annotation on a class that extends PersistenceEventAdapter. It covers reacting to before and after insert, update and delete events on any JAPE entity, including native instances, and explains how the listener is registered automatically without editing XML.
The guidance keeps listeners thin: they filter the event, adjust the DynamicVO and delegate business rules to injected services. It explains how to use ModifingFields to act only on changed fields, how to work with typed entities through EventEntity and EntityMapper so that update events do not wipe unrelated columns, and how to block a write or delete by throwing a typed exception in a before method. It also lists common pitfalls such as loops caused by writing to the same instance, synchronous external calls inside a transaction, and transaction propagation settings on called services.
The skill is written for Java 8 projects on the Sankhya Addon Studio 2.0 stack (Wildfly/EJB, JAPE SDK, Guice, Gradle), with Lombok logging and ISO-8859-1 source files.
When your agent uses it
Cria, revisa e padroniza listeners de persistência Sankhya com `@Listener` (classe estende `PersistenceEventAdapter`) — reage a eventos CRUD (before/after insert, update, delete) de qualquer entidade JAPE, inclusive instâncias nativas. Use ao criar, alterar, revisar, auditar ou padronizar reação a gravação/exclusão de registros, ao validar ou preencher campos automaticamente no insert/update, ao exigir campo preenchido/não vazio (sinal prático: o dev fala do campo *da tabela* no insert/update, não de payload nem de tela — vale para qualquer origem de gravação: REST, tela, job, integração; se for só o payload que chega no endpoint, é `controller`; se for `NOT NULL` na coluna, é `database`), ao implementar auditoria de alterações (quem mudou e quando) — inclusive em documento nativo, como gravar automaticamente quem mudou o status do pedido —, ao reagir a mudança de status de um registro, ao bloquear gravação ou exclusão com exceção em `before*`, ao trabalhar com classes `*Listener` de persistência, ou ao tocar
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 (33 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/listener:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/listener &&
cp -R "$tmp/plugins/addon-studio/skills/listener" ~/.claude/skills/listener &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/listener inside it instead.
Copy the skill folder to ~/.agents/skills/listener 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/listener &&
cp -R "$tmp/plugins/addon-studio/skills/listener" ~/.agents/skills/listener &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/listener inside it instead.
Copy the skill folder to ~/.cursor/skills/listener 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/listener &&
cp -R "$tmp/plugins/addon-studio/skills/listener" ~/.cursor/skills/listener &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/listener 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/listenerOr copy the folder to ~/.gemini/skills/listener yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/listener:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/listener &&
cp -R "$tmp/plugins/addon-studio/skills/listener" ~/.copilot/skills/listener &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/listener 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/listener into your agent's skills folder as listener. Agents that support SKILL.md read one folder per skill.
What it does
- Persistence event hooks
- Covers before and after insert, update and delete methods on a PersistenceEventAdapter subclass.
- Changed-field filtering
- Shows how to react only when specific fields change using ModifingFields checks.
- Typed entity updates
- Explains EventEntity usage so only the columns a rule changed are written back to the VO.
- Write blocking
- Describes stopping inserts and deletes with typed business exceptions raised in before methods.
- Transaction and loop safety
- Lists guidance on transaction propagation, after-commit tasks and guard clauses against event loops.
- Common pitfalls checklist
- Provides an anti-pattern table and a checklist for creating a new listener.
Good for
- Create a listener that recalculates a total when quantity or unit price changes
- Block deletion of a record when dependent data exists
- Audit who changed the status of an order and when
- Review an existing listener for loops or unsafe external calls
- Validate a required table field on insert regardless of where the write comes from
Listener FAQ
Which Sankhya entities can the listener watch?
Any JAPE entity, including the add-on's own entities and native system instances such as CabecalhoNota or Parceiro, named through the instanceNames attribute.
Does the listener need manual XML registration?
No. The @Listener annotation registers it automatically.
When should I use this instead of a BeforeLoadListener?
Use @Listener for reacting to insert, update or delete. Use @BeforeLoadListener for filtering reads and searches, which is covered by a separate skill.
Can I call an external HTTP API from the listener?
The skill says synchronous external calls inside the listener are not allowed; it recommends writing to a queue table and processing it with a job or asynchronous worker.
How do I install Listener in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/listener to use it in all your projects, or to .claude/skills/listener 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 Listener 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 Listener?
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 Listener?
The closest alternatives to Listener are Before load listener, Callback, Entity, Test and Job.
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

Sets up global Sankhya exception handlers with rollback, error DTOs and HTTP status
- 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

