Skip to main content
skill CX Codex

meta-decompile — Claude Code skill: 1C object draft from XML

Reads a 1C metadata object XML and emits a compact JSON draft in the meta-compile format. Useful when a new object is easier to build from an existing one than to write from scratch.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add Nikolay-Shirokov/cc-1c-skills
/plugin install 1c-skills@cc-1c-skills
Open on GitHub

What meta-decompile does

The skill parses XML such as Catalogs/Name.xml and emits a JSON draft for /meta-compile. Structure and properties go in. UUIDs, module bodies, forms, templates and rights do not.

That makes it a one-way tool. A compiled draft produces a new object with a fresh identity, so every reference to the source object — from code, other objects, subsystem contents, predefined data — breaks. Never compile a draft over the source object and never pass it off as a reimport.

It runs through scripts/meta-decompile.ps1 under PowerShell. The object XML path is required; OutputPath is optional, and without it the JSON goes to stdout. An unsupported object type or a root that is not MetaDataObject returns a non-zero exit code and a message on stderr. For a targeted change to an existing object use /meta-edit, for backup and migration use the standard 1C export, and to just inspect the structure use /meta-info.

What it helps with

  • build a DSL draft of a new object from a working example
  • rename and adapt the attribute and tabular section set
  • get a draft ready for /meta-compile without hand-writing the structure
  • inspect what structure sits inside an object XML before rebuilding

Example prompts for the agent

  • /meta-decompile Catalogs/Sample.xml -OutputPath draft.json
  • take this example and build a new catalog from it: change name in draft.json, then compile
  • decompile Catalogs/Products.xml and show which attributes land in the draft

How to install meta-decompile

1Plugin marketplace

/plugin marketplace add Nikolay-Shirokov/cc-1c-skills
/plugin install 1c-skills@cc-1c-skills

This installs the whole 1c-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add Nikolay-Shirokov/cc-1c-skills --skill meta-decompile -a claude-code

3Manually: put the files in place

~/.claude/skills/meta-decompile/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/meta-decompile/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about meta-decompile

How do I install meta-decompile in Claude?

Through the marketplace: run /plugin marketplace add Nikolay-Shirokov/cc-1c-skills, then /plugin install 1c-skills@cc-1c-skills.

What does meta-decompile do?

It reads a 1C metadata object XML and produces a JSON draft in the meta-compile format, carrying the object's structure and properties.

How is meta-decompile different from meta-edit?

meta-edit changes an existing object in place. A decompile-then-compile round trip yields an object with a new identity and drops modules and forms, so it is the wrong tool for edits.

Source text

SKILL.md · MIT
---
name: meta-decompile
description: Декомпиляция объекта метаданных 1С в JSON-заготовку формата meta-compile. Используй когда нужно получить черновик DSL-описания нового объекта по образцу другого. Не сохраняет UUID/модули/формы.
argument-hint: <ObjectPath> [-OutputPath <out.json>]
disable-model-invocation: true
allowed-tools:
  - Bash
  - Read
  - Write
  - Glob
---

# /meta-decompile — DSL-заготовка из XML объекта метаданных

Читает XML объекта метаданных (`Catalogs/Имя.xml` и т.п.) и эмитит компактный JSON в формате `/meta-compile`. Назначение — **взять существующий объект образцом и собрать по нему НОВЫЙ**: декомпилировать → поправить → скомпилировать под другим именем.

## ⚠️ Главное: это НЕ обратимая выгрузка

Компиляция черновика создаёт **новый объект с новой идентичностью**, а не копию исходного. В JSON **не** попадают: UUID (идентичность самого объекта и всех дочерних), тела модулей, формы, макеты, права. Захватываются только структура и свойства.

Отсюда правило: **никогда не компилируй черновик поверх объекта-источника и не выдавай его за «реимпорт»** — у пересобранного объекта другие UUID, поэтому все ссылки на исходный объект (из кода, других объектов, состава подсистем, предопределённых данных) сломаются, а код модулей и формы пропадут.

## Когда использовать

**Собрать новый объект по образцу существующего** — получить DSL-заготовку рабочего объекта, переименовать и адаптировать состав, скомпилировать в новый. Быстрее, чем писать DSL с нуля для богатого объекта.

## Когда **не** использовать

- **Точечная правка существующего объекта** (добавить реквизит, ТЧ, свойство) → `/meta-edit`. Цикл decompile→compile тут вреден: даёт объект с новой идентичностью и теряет модули/формы.
- **Сохранить / восстановить / перенести тот же объект** (бэкап, миграция между конфигурациями с сохранением ссылок) → штатная выгрузка 1С (`/db-dump-xml` ↔ `/db-load-xml`, CF), а не decompile.
- **Просто понять структуру** объекта (реквизиты, ТЧ, типы) без пересборки → `/meta-info` (дешевле, не плодит файл).

## Параметры

| Параметр | Описание |
|----------|----------|
| `ObjectPath` | Путь к XML объекта (`Catalogs/Имя.xml`), обязательный |
| `OutputPath` | Путь к выходному JSON. Если не задан — JSON в stdout |

```powershell
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/meta-decompile.ps1" -ObjectPath "<Объект.xml>" -OutputPath "<out.json>"
```

Неподдерживаемый тип объекта или не-`MetaDataObject` root → ненулевой код выхода и сообщение в stderr.

## Workflow (сборка нового объекта по образцу)

1. `/meta-decompile <Образец.xml> -OutputPath draft.json` — получить заготовку.
2. В `draft.json` **сменить `name`** на имя нового объекта и адаптировать состав (реквизиты/ТЧ/свойства). Ссылки на *другие* объекты (владельцы, ввод на основании, типы) — по имени, сохраняются как есть.
3. `/meta-compile -JsonPath draft.json -OutputDir <ConfigDir>` — собрать (объект получит свежие UUID).
4. `/meta-validate` + `/meta-info` — проверить.
5. Модули, формы, макеты, права — добавить отдельно (в черновик они не попадают).

© Nikolay Shirokov · MIT · Nikolay-Shirokov/cc-1c-skills

Similar skills

SKILL.md skills catalog →

From the same set14

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor