# Sankhya utils

> Sankhya utils is an open-source agent skill for developer tools. Gives the agent the Sankhya Java backend utility classes to use instead of hand-written. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/snk-devcenter/addon-studio/tree/main/plugins/addon-studio/skills/sankhya-utils
- **Repository:** https://github.com/snk-devcenter/addon-studio
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** sankhya-utils
- **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 points the agent to the com.sankhya.util helper classes that the Sankhya platform already provides on the classpath of an Addon Studio project. It covers string null-safety and Brazilian formatting, BigDecimal rounding and division, date arithmetic on Timestamp values, collection and map checks, JDBC resource closing, dynamic IN clauses, XML and JSON reading, named resource locks, session temporary files, and CPF, CNPJ, e-mail and PIS validators.

The skill includes a substitution table that maps common hand-written patterns to the matching utility, along with a list of pitfalls. Examples include divide using two significant digits by default, some helpers not being null-safe, and StringUtils.isEmpty calling toString on arbitrary objects. It also explains which classes do not apply, such as REST validation and DTO mapping, which belong to other Addon Studio skills.

The skill targets Java 8 with Gradle in the Sankhya Addon Studio 2.0 environment, with Wildfly and JAPE. No extra dependency is needed because the package comes with the platform. It is meant for backend Java code, not the HTML5 front-end utilities of sankhya-js.

## When your agent uses it

> Classes utilitárias do backend Java que a plataforma Sankhya já expõe no classpath do addon (`com.sankhya.util`) — `StringUtils`, `BigDecimalUtil`, `TimeUtils`, `XMLUtils`, `JsonUtils`, `JdbcUtils`, `SQLUtils`, `CollectionUtils`, `MapUtils`, `ExceptionNavigator`, `ResourceLock`, `SessionFile`, `UIDGenerator`, validadores de CPF/CNPJ/e-mail/PIS. Use quando o cálculo, a conversão ou a formatação acontece no Java do addon (backend, não na tela). Dentro de um projeto Addon Studio, "arredondar para N casas", "tratar quando vier null" ou "formatar como moeda" não é pergunta genérica de Java, mesmo sem nenhum termo Sankhya na mensagem: carregue antes de responder, porque a resposta de memória (`setScale`/`String.format`/`NumberFormat`/`SimpleDateFormat` à mão) duplica utilitário que a plataforma já expõe no classpath; sem citar tela/`.js`/HTML é aqui (inclusive quando o valor é "pra mostrar"/"pra exibir": sem arquivo de tela citado, quem arredonda e formata é o Java). Use também antes de escrever à mão null-check, c

## 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/sankhya-utils)
- [License: MIT](https://github.com/snk-devcenter/addon-studio/tree/HEAD/plugins/addon-studio/skills/sankhya-utils)

## Features

- **String null-safety helpers:** Checks for empty, null and trimmed strings, plus safe equality and Brazilian masks for CPF, CNPJ, CEP and phone.
- **BigDecimal rounding and division:** Null-safe arithmetic, half-up rounding, percentages and currency formatting for monetary values.
- **Timestamp date arithmetic:** Adds days and years, clears time, compares dates ignoring hours and builds period boundaries.
- **Safe resource closing:** Closes ResultSet, Statement and Connection without nested try/catch blocks.
- **Dynamic IN clause builder:** Builds IN and NOT IN clauses that split large value lists into batches.
- **Document and e-mail validators:** Validates CPF, CNPJ, e-mail and PIS numbers through dedicated validator classes.
- **Named resource locks:** Serializes access to a business resource locally or across the cluster.

## Good for

- Round a monetary value to two decimal places in a service class
- Build a due date by adding a number of days to today
- Validate a CPF or CNPJ before saving a record
- Close database resources cleanly in a DAO
- Build a dynamic IN clause from a list of codes
- Read values from an XML integration payload without null checks

## 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/sankhya-utils`:

```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/sankhya-utils &&
cp -R "$tmp/plugins/addon-studio/skills/sankhya-utils" ~/.claude/skills/sankhya-utils &&
rm -rf "$tmp"
```

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

### Codex

Copy the skill folder to `~/.agents/skills/sankhya-utils` 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/sankhya-utils &&
cp -R "$tmp/plugins/addon-studio/skills/sankhya-utils" ~/.agents/skills/sankhya-utils &&
rm -rf "$tmp"
```

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

### Cursor

Copy the skill folder to `~/.cursor/skills/sankhya-utils` 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/sankhya-utils &&
cp -R "$tmp/plugins/addon-studio/skills/sankhya-utils" ~/.cursor/skills/sankhya-utils &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/sankhya-utils` 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/sankhya-utils
```

Or copy the folder to `~/.gemini/skills/sankhya-utils` yourself.

### VS Code

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

```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/sankhya-utils &&
cp -R "$tmp/plugins/addon-studio/skills/sankhya-utils" ~/.copilot/skills/sankhya-utils &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/sankhya-utils` 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/sankhya-utils` into your agent's skills folder as `sankhya-utils`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Do I need to add a dependency to build.gradle?

No. The com.sankhya.util package comes with the platform classpath, so only the import is needed.

### Should I use this for REST endpoint validation?

No. The skill says REST payload validation should use @Valid with DTOs, handled by the controller skill.

### Is Sankhya utils for the HTML5 front end?

No. Front-end utilities with the same names belong to the sankhya-js framework and are excluded.

### How do I install Sankhya utils in Claude Code?

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

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 Sankhya utils?

The closest alternatives to Sankhya utils are Test, Jsp, Callback, Sankhya js and Data dictionary.

## Where this comes from

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

## Alternatives

- [Test](https://ai-powered.com/skills/test-snk-devcenter): Test 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.
- [Callback](https://ai-powered.com/skills/callback): Callback 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.
- [Data dictionary](https://ai-powered.com/skills/data-dictionary): Data dictionary is an open-source agent skill for developer tools.
- [Macros](https://ai-powered.com/skills/macros): Macros is an open-source agent skill for developer tools.
- [Repository](https://ai-powered.com/skills/repository): Repository is an open-source agent skill for developer tools.
- [Entity](https://ai-powered.com/skills/entity): Entity is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/sankhya-utils
