framework_eng/skills/tool-usage/platform-data/xml-generation/SKILL.md
MUST use WHEN you need to create, modify, or validate any 1C metadata XML (forms, roles, objects, MXL, SKD, EPF, extensions, configuration). Provides safe generation and targeted modification through the xml-gen CLI while following the no-manual-xml-edit rule.
npx skillsauth add steelmorgan/1c-agent-based-dev-framework xml-generationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The unified xml-gen CLI covers the full 1C XML workflow: generation from a JSON DSL, targeted modification of existing files, and validation. This SKILL.md is a router: it contains an overview, an index of sub-areas, and cross-cutting principles. For detailed specifications for each domain, go to the corresponding sub-skill (<name>/SKILL.md).
Install: python tools/install.py --install-xml-gen (requires JDK 17+).
xml-gen has two complementary work surfaces:
mxl/skd/form/role/meta compile and available decompilers, for example mxl decompile. Use this when the artifact is easier to describe declaratively and compile into Designer XML.epf init, epf add-template, form add-element, meta edit, template add, validate. Use this when you need to create or modify an existing metadata tree with explicit CLI actions.For maintaining the tool itself, xml-gen includes diagnostic oracle commands. They are not needed in normal XML generation/editing tasks; the reference for them is provided separately: references/behavioral-oracles.md.
Details are in §2 and the sub-skills. Universal commands (validate, form/template/help add, edit replace-text) are described in §3.
Do not use when: the EDT format is required (Designer only), DataSetUnion/CalculatedFields are needed in SKD (workaround: calculations in queries).
| Sub-area | What it does | When to use | Reference |
|-------------|------------|-----------------|-----------|
| forms-toolkit | info / edit / validate / element-mapping / epf-validate — the operational cycle for working with managed forms and EPF | analyzing form structure, adding fields, validation, Title→Name mapping for Vanessa | forms-toolkit/SKILL.md |
| form-dsl | compile a form from JSON DSL (form compile, including --from-object) | create a form from scratch or generate one from an object | form-dsl/SKILL.md |
| skd-dsl | compile SKD from JSON (skd compile) | create a data composition schema from scratch | skd-dsl/SKILL.md |
| skd-edit | patch operations on an existing SKD (skd add-parameter, skd add-field) | targeted Schema.xml edits | skd-edit/SKILL.md |
| mxl-dsl | MXL layouts / SpreadsheetDocument (mxl compile) | print forms, templates | mxl-dsl/SKILL.md |
| role-dsl | compile roles (role compile, role add-object, role add-right) | create/modify a role | role-dsl/SKILL.md |
| config-operations | work with the configuration root (config init/info/edit/validate) | initialize a new CF, navigate the root | config-operations/SKILL.md |
| meta-operations | 23 metadata object types (meta compile/info/edit) | Catalogs / Documents / InformationRegisters / Enums and others | meta-operations/SKILL.md |
| subsystem-interface | subsystems and command interfaces (subsystem compile/edit, interface edit/validate) | organizing the configuration interface | subsystem-interface/SKILL.md |
| epf-full | external processing and reports (epf init/add-form/add-template/bsp-init) | create EPF / ERF from scratch, including BSP variants | epf-full/SKILL.md |
| extension-operations | configuration extensions / CFE (extension init/borrow/diff) | create a CFE, borrow objects, compare an extension with its base | extension-operations/SKILL.md |
Universal commands (
xml-gen form add,template add,help add,edit replace-text,validate) are described in §3 below and do not have a separate sub-skill.
Four groups: validate (structural/semantic validation of any XML), form/template/help add (adding forms, layouts, help to any metadata object), edit replace-text (byte-for-byte replacement without line ending normalization).
When to use: validate — before and after each modification; form/template/help add — when you need to register a new artifact without rebuilding; edit replace-text — for targeted XML edits with multiline text in <v8:content> (tooltips, descriptions) or any replacement where preserving line endings matters.
→ references/universal-commands.md
Oracle commands are intended to support xml-gen and verify behavior on canonical XML, not for normal generation of a single artifact. Details, modes, and test matrices are in references/behavioral-oracles.md.
--format designer (default). EDT is not supported.utf-8-sig). Preserve the BOM when editing.<v8:content>. Do not use Claude Code Edit — xml-gen edit replace-text (→ references/universal-commands.md).validate before and after modification. On error, <domain> edit performs rollback automatically.form edit / meta edit / subsystem edit accepts arrays of operations; use that instead of repeated CLI calls.output/MyProcessor.xml. EPF forms: output/MyProcessor/Forms/MainForm/Ext/Form.xml.xml-gen oracle ... reads the canonical source and writes generated XML only under --out; do not point oracle output inside src/xml.xml-gen epf init --name MyProcessor output/
xml-gen epf add-form --epf MyProcessor --name MainForm output/
xml-gen validate --type epf output/MyProcessor
Details — epf-full/SKILL.md.
# 1. Изучить структуру
xml-gen form info "src/Catalogs/Контрагенты/Forms/ФормаЭлемента/Ext/Form.xml"
# 2. Добавить элемент с привязкой к реквизиту
xml-gen form add-element --type InputField --name Склад --path Объект.Склад \
--parent ГруппаШапка --after Контрагент \
"src/Catalogs/Контрагенты/Forms/ФормаЭлемента/Ext/Form.xml"
# 3. Проверить
xml-gen validate --type form "src/Catalogs/Контрагенты/Forms/ФормаЭлемента/Ext/Form.xml"
Details — forms-toolkit/SKILL.md (info/edit/validate) and form-dsl/SKILL.md (compile from scratch).
xml-gen skd compile schema.json Template.xml
xml-gen validate --type skd Template.xml
Details — skd-dsl/SKILL.md. For targeted edits of an existing Schema.xml — skd-edit/SKILL.md.
xml-gen extension init output_ext/ МоёРасширение --config-path output/
xml-gen extension borrow output_ext/ output/ "Catalog.Товары"
xml-gen extension diff output_ext/ output/
Details — extension-operations/SKILL.md.
# Неправильно: role compile с файлом на выход
xml-gen role compile role.json Roles/МояРоль.xml
# Правильно: output_dir → Roles/<Name>/Ext/Rights.xml
xml-gen role compile role.json output/
# Неправильно: form add-element без --path
xml-gen form add-element --type InputField --name Наименование Form.xml
# Правильно: --path связывает элемент с реквизитом
xml-gen form add-element --type InputField --name Наименование --path Наименование Form.xml
# Неправильно: role add-object с "view"
xml-gen role add-object --name Catalog.Номенклатура --rights view Rights.xml
# Правильно: права через запятую, регистр из enum RoleRight
xml-gen role add-object --name Catalog.Номенклатура --rights Read,View Rights.xml
For agents without a PreToolUse protocol (Codex, Cursor, Aider, Cline, etc.), it is recommended to set up additional protection layers:
tools/hooks/pre-commit) — extend it by calling --check for all staged .xml / .mxl files. This is a late safety net: it prevents the change from reaching the repository even if the agent ignored the rule:
python3 tools/hooks/block-direct-xml-edit.py --check "<staged-file>" --tool Edit
With exit code 2 — the file belongs to 1C metadata, and the commit is aborted.--check on the diff catches any attempt at direct edits before they reach main.Fine-tuning: the ONEC_ROOT_DIRS, EXCLUDE_SUBSTRINGS, and EXCLUDE_BASENAMES lists are defined as constants in tools/hooks/block-direct-xml-edit.py. Extend them if the project introduces a new 1C configuration pattern (for example, a nonstandard location) or a new false positive (a build XML with a unique name).
| Problem | Solution |
|----------|---------|
| Parent element not found (form) | Check the exact parent name in Form.xml — case matters |
| Object already exists (role) | role add-right instead of add-object |
| DataSet not found (skd) | Check the data set name in Schema.xml |
| Edit tool breaks line endings | Use xml-gen edit replace-text |
| DataSetUnion / CalculatedFields are needed in SKD | Workaround: calculations in queries |
| EDT format is needed | Not supported, Designer only |
depends_on:
testing
MUST use BEFORE making a judgment about the cause of a conflict, a test failure, or an artifact dispute. Defines the end-to-end verification method L1→L6 and the classification of the first broken link.
development
MUST use AFTER a work cycle with ≥2 iterations (wrote → error → fixed → success). Provides the retrospective procedure and the format for recording practice/anti-patterns in references/learned-patterns.md or {project}/.context/learned-patterns.md.
tools
MUST use WHEN you are writing reusable knowledge into RLM (pattern / architectural decision / stable domain fact) OR reading it before a non-trivial task/solution in the domain. Provides the breakdown of native-push vs RLM-pull, tools for writing and reading RLM, H-MEM levels, and hygiene.
testing
MUST use WHEN the task is classified as simple (< 20 lines, 1 file, no new metadata objects, no architectural decisions). Provides a short cycle of 3 steps with a guard on the self path and mandatory verify.