# Repository

> Repository is an open-source agent skill for developer tools. Guides building and reviewing Sankhya @Repository data-access interfaces for Addon Studio. 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/repository
- **Repository:** https://github.com/snk-devcenter/addon-studio
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** repository
- **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 covers the data-access layer of Sankhya Addon Studio 2.0 addons. It walks the agent through declaring a repository interface that extends JapeRepository, choosing between inherited CRUD methods, @Criteria finders, @NativeQuery queries and @Modifying writes, and handling pagination and composite keys.

The guidance includes concrete rules for common pitfalls: null-checking findByPK results, declaring checked exceptions on calling methods, using @Parameter with explicit names, keeping S/N flags as literals in clauses, and externalizing multi-database queries into SQL or XML files. It also points to related skills for entities, macros and tests.

The skill expects a Java 8 project built with Gradle and the Sankhya JAPE SDK, with files encoded in ISO-8859-1. The instructions are written in Portuguese and reference Oracle and MSSQL syntax differences.

## When your agent uses it

> Cria, revisa e refatora interfaces `@Repository` Sankhya estendendo `JapeRepository<ID, Entity>` com `@Criteria`, `@NativeQuery`, `@Modifying`, `@Parameter(name = "...")`, paginação, `findByPK` (retorno nullable, `throws Exception`). Use ao criar, alterar, revisar, auditar ou padronizar a camada de acesso a dados, ao implementar consulta/listagem/filtro/paginação/busca — a query mora aqui, inclusive quando o pedido é só "listar/filtrar/paginar X" sem citar rota nem app: comece por aqui, não por `controller` nem pelo sub-agent `controller-designer`, mesmo que um endpoint venha depois; se o pedido cita endpoint, rota, REST ou app mobile, o dono é `controller`, que chama este repository, ao escrever query custom, ao paginar (registros por página) ou filtrar por faixa de data/período, ao trabalhar com arquivos `*Repository.java`, ou ao tocar em código com `@Repository`/`JapeRepository`.

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

## Features

- **Repository interface setup:** Shows how to declare a JapeRepository interface with the correct ID and entity type parameters.
- **Criteria-based finders:** Explains @Criteria clause syntax, the required this. prefix and when to name parameters explicitly.
- **Native queries and results:** Covers @NativeQuery with DTO result interfaces, simple return types and external SQL or XML files.
- **Write operations:** Describes @Modifying methods, their allowed return types and the transactional wrapping they need.
- **Pagination limits:** Explains PageRequest and Sort usage with @Criteria and the cursor-style paging without total counts.
- **Common pitfalls checklist:** Lists frequent errors such as wrong imports, Optional misuse and Boolean parameters on S/N columns.

## Good for

- Create a repository with filtered lookups for a Sankhya table
- Review an existing @Repository for misuse of findByPK or missing throws Exception
- Add paginated listing by date range to a data-access layer
- Write a native SQL query with a DTO result for a report
- Convert a multi-database query into an XML file with Oracle and MSSQL variants

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

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

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

### Codex

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

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

### Cursor

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

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

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

### VS Code

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

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

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

## FAQ

### Does the skill support Spring Data style query method names?

No. It states that query methods by name are not supported and recommends @Criteria or @NativeQuery instead.

### Can pagination be used with native queries?

No. Pagination is supported only with @Criteria, and Page exposes no total count, so a separate COUNT query is needed for totals.

### What does findByPK return when no record exists?

It returns the entity type, which may be null, rather than an Optional, so the skill recommends a manual null check.

### Which Java and build environment does Repository target?

The compatibility note lists Sankhya Addon Studio 2.0 with Wildfly/EJB and JAPE SDK, Java 8, Gradle and ISO-8859-1 encoding.

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

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

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 Repository?

The closest alternatives to Repository are Entity, Test, Before load listener, Sankhya utils and Data dictionary.

## Where this comes from

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

## Alternatives

- [Entity](https://ai-powered.com/skills/entity): Entity 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.
- [Before load listener](https://ai-powered.com/skills/before-load-listener): Before load 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.
- [Data dictionary](https://ai-powered.com/skills/data-dictionary): Data dictionary 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.
- [Type adapter](https://ai-powered.com/skills/type-adapter): Type adapter is an open-source agent skill for developer tools.
- [Dependency injection](https://ai-powered.com/skills/dependency-injection): Dependency injection is an open-source agent skill for developer tools.

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