
Type adapter
Guides writing Sankhya @GlobalTypeAdapter classes for JSON and Jape conversion
Type adapter 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 Type adapter
This skill covers creating, reviewing and refactoring global type adapters in the Sankhya Addon Studio 2.0 stack, which define once how a given Java type is serialized to JSON, deserialized from JSON and mapped to database values. It explains when a global adapter is warranted, which of the TypeAdapter, JsonSerializer and JsonDeserializer interfaces to implement, and how the global-over-native precedence works.
The guide walks through a complete example for a java.time type, shows how a value object can be used in an entity column, and lists the adapters the SDK already provides with their Java and database types. It also sets out the rules that matter in practice: handle nulls, throw a parse exception instead of returning null silently, and never put business logic inside an adapter. A checklist and a table of anti-patterns support reviews.
The skill expects a Java 8 project built with Gradle on the Sankhya Addon Studio 2.0 runtime, using Gson for JSON. Its content is written in Portuguese, and it points to related skills for entities, repositories, controllers and Guice wiring.
When your agent uses it
Cria, revisa e refatora adaptadores de tipo Sankhya com `@GlobalTypeAdapter` (`TypeAdapter`, `JsonSerializer`/`JsonDeserializer`, tipos nativos, conversão JSON↔Java) — define, num lugar só, como um tipo serializa e desserializa em todo o addon. Use ao criar, alterar, revisar, auditar ou padronizar adaptadores de serialização JSON, ao corrigir formato de data/número no JSON de resposta, ao trabalhar com arquivos `*Adapter.java`, ou ao tocar em código com `@GlobalTypeAdapter`/`TypeAdapter`. NÃO usar para converter DTO↔Entidade campo a campo — isso é `mapstruct`.
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 (16 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/type-adapter:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/type-adapter &&
cp -R "$tmp/plugins/addon-studio/skills/type-adapter" ~/.claude/skills/type-adapter &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/type-adapter inside it instead.
Copy the skill folder to ~/.agents/skills/type-adapter 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/type-adapter &&
cp -R "$tmp/plugins/addon-studio/skills/type-adapter" ~/.agents/skills/type-adapter &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/type-adapter inside it instead.
Copy the skill folder to ~/.cursor/skills/type-adapter 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/type-adapter &&
cp -R "$tmp/plugins/addon-studio/skills/type-adapter" ~/.cursor/skills/type-adapter &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/type-adapter 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/type-adapterOr copy the folder to ~/.gemini/skills/type-adapter yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/type-adapter:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/snk-devcenter/addon-studio.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/type-adapter &&
cp -R "$tmp/plugins/addon-studio/skills/type-adapter" ~/.copilot/skills/type-adapter &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/type-adapter 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/type-adapter into your agent's skills folder as type-adapter. Agents that support SKILL.md read one folder per skill.
What it does
- Adapter scope decisions
- Explains when a type needs a global adapter and when the SDK's native adapters already cover it.
- JSON serializer and deserializer
- Shows how to convert a type to and from JSON with Gson interfaces and strict error handling.
- Database value mapping
- Covers fromVO and toVO conversions between Java objects and Jape database values.
- Value object columns
- Describes exposing a domain type in an entity column while the table keeps its primitive.
- Native adapter reference
- Tabulates the built-in adapters for types such as dates, UUIDs, URLs and booleans.
- Review checklist
- Provides a step list and anti-pattern table for creating or auditing adapters.
Good for
- Create a JSON adapter for a java.time type in a Sankhya addon
- Fix date or number formatting in an API response
- Review existing *Adapter.java classes for null handling and error behavior
- Map a value object to a database column in an entity
- Audit a Sankhya addon for adapters that duplicate native ones
Type adapter FAQ
When should I use a global type adapter?
When a type has no native support in the SDK or Gson, or when a native behavior needs to be overridden. The global adapter takes precedence over the native one.
Which interfaces should an adapter implement?
Only those the use case needs. JSON-only DTO types need JsonSerializer and JsonDeserializer, while types used in a @JapeEntity also need TypeAdapter.
Can a value object be passed to a @Criteria parameter?
No. The SDK does not apply the adapter to @Criteria parameters, so the method should receive the primitive value, for example via getDigits().
Does the adapter need a Guice binding?
The adapter itself does not need one, since the SDK discovers it through the annotation. Services injected into the adapter do need Guice wiring.
How do I install Type adapter in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/type-adapter to use it in all your projects, or to .claude/skills/type-adapter 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 Type adapter 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 Type adapter?
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 Type adapter?
The closest alternatives to Type adapter are Entity, Mapstruct, Test, Dependency injection and Controller advice.
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

