# Retrofit

> Retrofit is an open-source agent skill for developer tools. Sets up outbound HTTP calls to third-party APIs with Retrofit, Moshi and OkHttp in Sankhya. 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/retrofit
- **Repository:** https://github.com/snk-devcenter/addon-studio
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** retrofit
- **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 building an outbound HTTP integration inside a Sankhya Addon Studio 2.0 addon, where the addon acts as a client of an external REST or JSON API. It covers declaring the Retrofit, Moshi and OkHttp libraries as moduleLib dependencies in the module's Gradle file, writing a Retrofit client interface with Call return types, and wiring that client through a Guice custom module with a singleton provider.

The skill also explains how to create OkHttp interceptors for authentication, logging or headers, including the rule that only the first interceptor may be a component and later ones must be provided explicitly to avoid binding conflicts at deploy time. It offers two wiring options, a direct builder or a reusable factory, and common errors with their fixes, such as missing runtime classes or malformed JSON mapping.

The guidance is written for Java 8 with Lombok DTOs and ISO-8859-1 encoding, and it points to related skills for dependency injection, configuration values, testing with MockWebServer and error mapping.

## When your agent uses it

> Configura, revisa e debuga integração HTTP de saída em Sankhya Addon Studio — o addon como cliente de uma API de terceiro — usando Retrofit + Moshi + OkHttp — declara dependências `moduleLib` no `build.gradle`, escreve interface client (`@GET`/`@POST`/`@Body`/`@Path`/`@Query`/`@Headers`), faz wiring Guice via `@Provides @Singleton` em `@CustomModule`, cria interceptors OkHttp (autenticação, logging, headers). Use ao integrar API REST/JSON externa, ao consumir (não expor — expor endpoint do addon é `controller`), consumir endpoint de terceiro, adicionar lib Retrofit/Moshi/OkHttp, montar HTTP client, criar interceptor, ou diagnosticar `NoClassDefFoundError` runtime de classe Retrofit/OkHttp.

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

## Features

- **Gradle dependency setup:** Declares Retrofit, Moshi, OkHttp and optional converters as moduleLib dependencies in the module build file.
- **Retrofit client interface:** Shows how to annotate a client interface with HTTP verbs, path, query, header and body parameters.
- **Guice wiring:** Explains providing a singleton client through a custom module, with a direct or factory-based approach.
- **OkHttp interceptors:** Covers building authentication and header interceptors and ordering them in the request pipeline.
- **Error troubleshooting:** Lists common runtime and mapping errors with causes and corrections.

## Good for

- Connect an addon to a third-party REST API that returns JSON
- Add an authentication interceptor that sends a bearer token on each request
- Set up a Retrofit client with Guice in a Sankhya addon module
- Fix a NoClassDefFoundError for Retrofit or OkHttp classes at runtime
- Map JSON fields to DTOs when a remote response uses different 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/retrofit`:

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

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

### Codex

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

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

### Cursor

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

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

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

### VS Code

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

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

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

## FAQ

### Which dependency scope should I use for Retrofit in an Addon Studio project?

Use only the moduleLib configuration in the module's build.gradle, not implementation, because the plugin adds the jar to compilation and packages it into the EJB.

### Can I add more than one interceptor annotated as a component?

No. Only the first interceptor should be a component; later ones should be provided with @Provides @Singleton of their concrete type, otherwise Wildfly fails with a BindingAlreadySet error.

### Why must Retrofit client methods return Call?

The skill sets the convention of returning Call<T> so the caller decides when to run it, typically with execute() for synchronous calls.

### Does the skill cover exposing endpoints from the addon?

No. It is limited to consuming third-party APIs; exposing an addon endpoint is handled by a different controller skill.

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

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

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

The closest alternatives to Retrofit are Dependency injection, Test, Sankhya js, Sankhya utils and API integration.

## Where this comes from

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

## Alternatives

- [Dependency injection](https://ai-powered.com/skills/dependency-injection): Dependency injection 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.
- [Sankhya js](https://ai-powered.com/skills/sankhya-js): Sankhya js 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.
- [API integration](https://ai-powered.com/skills/api-integration-ajyadav013): API integration 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.
- [Controller](https://ai-powered.com/skills/controller): Controller is an open-source agent skill for developer tools.
- [Kotlin springboot](https://ai-powered.com/skills/kotlin-springboot): Kotlin springboot is an open-source agent skill for developer tools.

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