Skip to main content
skill CX Codex

skd-decompile — Claude Code skill: what it does, how to install

Converts a 1C data composition schema from Template.xml into a JSON draft for skd-compile. Useful for scaffolding a new report from an existing sample.

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 skd-decompile does

The skill executes skd-decompile.ps1 via PowerShell. It reads a 1C SKD layout from Template.xml and maps fields, parameters, variants, and templates into a JSON draft formatted for skd-compile. If -OutputPath is omitted, output goes directly to stdout.

The generated JSON is not a lossless representation. Any construct the tool cannot translate receives an __unsupported__ sentinel tag, and every coordinate is logged into a companion .warnings.md file. The compiler will reject the schema until these nodes are manually rewritten or removed. Nested schemas and Picture cells cause the script to halt with a non-zero exit code.

This skill is not meant for minor adjustments. A full decompile-compile cycle rewrites the entire XML file and creates massive Git diffs, so small edits require /skd-edit instead.

What it helps with

  • decompile a 1C SKD Template.xml into a JSON structure
  • scaffold a new report from an existing schema
  • generate an editable draft for the skd-compile tool
  • detect unsupported SKD elements before major refactoring

Example prompts for the agent

  • Decompile this report schema: /skd-decompile src/Reports/Sales/Template.xml -OutputPath draft.json
  • Convert Template.xml to a JSON draft in stdout: /skd-decompile Ext/Template.xml
  • Extract the SKD layout into a draft file: /skd-decompile ./Template.xml -OutputPath report.json

How to install skd-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 skd-decompile -a claude-code

3Manually: put the files in place

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

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

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

Questions about skd-decompile

How to install skd-decompile in Claude Code?

Run two commands in Claude Code in order: first register the repository with /plugin marketplace add Nikolay-Shirokov/cc-1c-skills, then install the package with /plugin install 1c-skills@cc-1c-skills.

What does skd-decompile do?

It parses a 1C SKD Template.xml file and outputs a JSON draft for skd-compile. It helps scaffold new reports from existing templates and conduct large-scale schema restructuring.

Why should skd-decompile be avoided for small edits?

The decompile and compile workflow rewrites the entire XML structure and generates heavy Git diffs. For targeted modifications like adding fields or filters, use /skd-edit instead.

Source text

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

# /skd-decompile — JSON-черновик из Template.xml СКД

Читает Template.xml и эмитит JSON в формате `skd-compile`. **Результат — черновик**, а не обратимое представление: см. раздел «Что получаешь».

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

- **Scaffold нового отчёта по образцу** — взять существующий СКД, получить JSON, поправить и скомпилировать в новый.
- **Структурный рефакторинг** — переписать вариант, перерисовать шаблон, перебрать набор полей.

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

- **Точечные правки готового отчёта** (добавить поле, фильтр, итог, переименовать) → `/skd-edit`. Цикл «декомпиляция → правка JSON → компиляция» переписывает шаблон целиком, может терять непокрытые конструкции и даёт большой diff в исходниках. `/skd-edit` правит адресно, без полной реконструкции.

## Параметры

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

```powershell
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/skd-decompile.ps1" -TemplatePath "<Template.xml>" -OutputPath "<out.json>"
```

## Что получаешь

JSON-черновик в формате `/skd-compile` — **не полное обратимое представление СКД**. На вход компилятору такой JSON напрямую может не пойти: в нём встречаются sentinel-узлы (маркер `__unsupported__`).

- **Готовые узлы** — большая часть СКД (поля, параметры, шаблоны, варианты со structure/filter/order/conditionalAppearance и т.п.) ложится в JSON как обычные узлы DSL.
- **Sentinel-узлы** — места, где встретилась конструкция, которую декомпилятор не умеет выразить в DSL. JSON остаётся валидным, но компилятор откажется его собирать, пока sentinel не **заменён ручной реализацией** (явный raw `template`, прописанный appearance и т.п.) **или не удалён**, если в новом отчёте конструкция не нужна. Это намеренный барьер — чтобы непокрытое не уехало в финальный отчёт незамеченным.
- **`<basename>.warnings.md`** рядом с `OutputPath` — список всех sentinel-узлов с координатами в исходнике, по нему удобно обходить места под ручную доработку.
- **Критичные конструкции** (Picture cells, ХранилищеЗначения, вложенные схемы, не-СКД root) — скрипт падает с ненулевым кодом и сообщением в stderr; такой Template как образец не годится.

## Workflow

1. `/skd-decompile <Template.xml> -OutputPath draft.json` — получить черновик.
2. Открыть `draft.warnings.md`, посмотреть, что не покрылось.
3. Поправить JSON под задачу. Sentinel-узлы — заменить на ручную реализацию (через явный raw `template`, через ручное описание appearance и т.п.) либо удалить, если конструкция в новом отчёте не нужна.
4. `/skd-compile -DefinitionFile draft.json -OutputPath new-Template.xml` — собрать обратно.
5. `/skd-validate` + `/skd-info` — проверить.

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

Topics and platforms

SKILL.md skills catalog →

From the same set59

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