# Merge on root

> Merge on root is an open-source agent skill for developer tools. Adds custom fields to native Sankhya records through a 1:1 extension table. 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/merge-on-root
- **Repository:** https://github.com/snk-devcenter/addon-studio
- **GitHub stars:** 7
- **License:** MIT
- **Skill name:** merge-on-root
- **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 shows how to extend a Sankhya entity such as a partner, product or invoice with new fields without altering the native table. The data lives in a separate extension table that shares the root's primary key and is linked by a one-to-one relation marked for merge on root, so the platform shows both as a single record on screen.

The guide walks through the pieces: a dbscript that creates the extension table with a physical foreign key back to the root, a data dictionary file for the extension with its own tab layout, a relation declaration in the root's dictionary entry that sets insert and update flags, and the matching Java entities. It also lists pitfalls such as cascade settings, why one-to-many data needs a separate tab, and why existing records without an extension row are normal.

The skill is written for the Sankhya Addon Studio 2.0 stack, using Java 8, Gradle and ISO-8859-1 encoding, and it is meant for projects that follow the addon studio file layout.

## When your agent uses it

> Estende uma entidade com campos novos sem criar coluna na tabela dela — tabela de extensão com a mesma PK, ligada por `@OneToOne` com `@ref-param[merge-on-root=true]`, que a plataforma funde na tela e no registro da entidade raiz. É o caminho oficial para guardar informação nova em entidade nativa do Sankhya (Parceiro, Produto, Nota, TOP...). Use quando o dev pedir campo novo, coluna nova ou "guardar mais um dado" num cadastro ou documento nativo — "preciso de um campo a mais na tela de Parceiros", "adicionar uma flag no produto", "gravar X junto da nota" —, ao estender tabela do próprio addon sem mexer nela, ou ao revisar `<nativeTable>` com `<fields>`, `ALTER TABLE` em tabela nativa (`TGF*`, `TSI*`, `TCS*`) ou instância nova sobre tabela nativa. Em tabela nativa que o projeto ainda não declara em `<nativeTable>`, a resposta nunca é `ALTER TABLE` nem `<field>` dentro de `<nativeTable>`: o campo vai para a tabela de extensão; tabela que o projeto já estende por `<nativeTable>` segue o padrão que já usa. A tab

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

## Features

- **Extension table design:** Creates a table with the same primary key as the root entity and a foreign key to it.
- **Root relation setup:** Declares a one-to-one merge relation in the native table's data dictionary entry.
- **Data dictionary fields:** Defines extension fields and their tab placement inside the root record screen.
- **Java entity mapping:** Provides entity classes for the extension and, when needed, the root with cascade settings.
- **Anti-pattern checklist:** Lists practices to avoid, such as altering native tables directly or using one-to-many for merges.

## Good for

- Add an integration flag to the partner registration screen
- Store an extra date field alongside a native product record
- Attach a custom value to an invoice without changing its table
- Review an addon project for direct changes to native Sankhya tables

## 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/merge-on-root`:

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

For one project only, put the folder in `.claude/skills/merge-on-root` inside it instead.

### Codex

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

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

### Cursor

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

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

Or copy the folder to `~/.gemini/skills/merge-on-root` yourself.

### VS Code

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

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

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

## FAQ

### Does Merge on root modify native Sankhya tables?

No. It avoids ALTER TABLE on native tables and places new columns in a separate extension table linked to the root record.

### When should I use a one-to-many relation instead?

Merge on root only merges one-to-one data. When a root record needs several values, the guide recommends a child table shown in a separate tab.

### What happens to existing records without an extension row?

That is the normal state. The extension row is created when the root record is saved with insert enabled.

### How do I install Merge on root in Claude Code?

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

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 Merge on root?

The closest alternatives to Merge on root are Entity, Data dictionary, Repository, Sankhya js and Test.

## 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.
- [Data dictionary](https://ai-powered.com/skills/data-dictionary): Data dictionary 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.
- [Sankhya js](https://ai-powered.com/skills/sankhya-js): Sankhya js 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.
- [Jsp](https://ai-powered.com/skills/jsp): Jsp 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.
- [Before load listener](https://ai-powered.com/skills/before-load-listener): Before load listener is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/merge-on-root
