framework_eng/skills/tool-usage/platform-data/xml-generation/extension-operations/SKILL.md
Operations with 1C configuration extensions (CFE) - init, borrowing objects, generating method interceptors, and analyzing extension composition. Helps manage CFE via xml-gen extension init/borrow/diff/validate.
npx skillsauth add steelmorgan/1c-agent-based-dev-framework extension-operationsInstall 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.
Working with 1C configuration extensions.
| Trigger | Action |
|---------|----------|
| Need to create an extension | extension init <output_dir> <Name> [--config-path <configPath>] |
| Need to borrow an object from the configuration | extension borrow <extPath> <configPath> "Type.Name" |
| Need to borrow a form | extension borrow <extPath> <configPath> "Catalog.Name.Form.FormName" |
| Need to add a property and display it on a standard form | extension borrow ... "Type.Name.Form.X" --borrow-main-attribute form |
| Need to generate a method interceptor | extension patch-method <extPath> --module "Catalog.X.Form.Y" --method "ПриЗаписи" --type Before |
| Need to analyze an extension | extension diff <extPath> <configPath> |
| Need to validate an extension | extension validate <extPath> |
Create a configuration extension.
xml-gen extension init <output_dir> <Name> [--config-path <configPath>] [--purpose Patch|Customization|AddOn] [--prefix <Prefix>]
Parameters (positional):
<output_dir> — directory where the extension will be created (first positional argument)<Name> — extension name (second positional argument)Parameters (flags):
--config-path — path to the base configuration (to read CompatibilityMode, DefaultLanguage, and Language UUID). Without it, [WARN] Language ExtendedConfigurationObject set to zeros.--purpose — purpose (default: Customization)--prefix — name prefix (default: from the name with _ suffix)Anti-pattern (old syntax): --name <Name> and --config <Path> do NOT work — the CLI accepts name and output as positional arguments, and the flag for the base configuration is called --config-path.
Borrowing an object from the base configuration.
xml-gen extension borrow <extensionPath> <configPath> "<objectSpec>"
objectSpec format:
Catalog.Товары — borrow an objectCatalog.Товары.Form.ФормаЭлемента — borrow a formСправочник.Товары — Russian synonyms are supportedCatalog.Товары ;; Document.Заказ — batch (separator ;;)Extension analysis: composition, interceptors, transfer verification.
xml-gen extension diff <extensionPath> <configPath> [--mode A|B]
&ИзменениеИКонтроль, check #Вставка/#КонецВставки, compare with the base configuration.Without the flag, the borrowed form does not have DataPath — form-edit will fail when trying to display an extension attribute.
# Attributes already displayed on the form (recommended)
xml-gen extension borrow <extPath> <configPath> "Catalog.Номенклатура.Form.ФормаЭлемента" --borrow-main-attribute form
# All attributes and tabular sections of the object
xml-gen extension borrow <extPath> <configPath> "Catalog.Номенклатура.Form.ФормаЭлемента" --borrow-main-attribute all
form — only attributes already displayed on the form (optimal in most cases).all — all object attributes and tabular sections (needed if you plan to display attributes that are not yet on the form).Typical scenario: borrow with --borrow-main-attribute form → add an attribute → form-edit.
Important: if the object has already been borrowed, the CLI adds the missing parts and does not overwrite them.
Generation of a method interceptor in the extension module.
xml-gen extension patch-method <extPath> \
--module "Catalog.X.Form.Y" \
--method "ПриЗаписи" \
--type Before|After|Instead|ModificationAndControl \
[--config <configPath>]
Parameters:
<extPath> — path to the extension directory--module — module path in the format Type.Name.ModuleType or Type.Name.Form.FormName--method — name of the intercepted method in the standard configuration--type — interception type (see table)--config — path to the base configuration (required for ModificationAndControl)Interception types:
| --type | BSL decorator | Purpose |
|----------|--------------|------------|
| Before | &Перед | Code before the original method call |
| After | &После | Code after the original method call |
| Instead | &Вместо | Full replacement of the original method |
| ModificationAndControl | &ИзменениеИКонтроль | Copy of the original method body with insertion markers |
ModulePath → BSL file mapping:
| ModulePath | File in the extension |
|------------|-------------------|
| Catalog.X.ObjectModule | Catalogs/X/Ext/ObjectModule.bsl |
| Catalog.X.ManagerModule | Catalogs/X/Ext/ManagerModule.bsl |
| Catalog.X.Form.Y | Catalogs/X/Forms/Y/Ext/Form/Module.bsl |
| CommonModule.X | CommonModules/X/Ext/Module.bsl |
| Document.X.ObjectModule | Documents/X/Ext/ObjectModule.bsl |
| Document.X.Form.Y | Documents/X/Forms/Y/Ext/Form/Module.bsl |
| InformationRegister.X.RecordSetModule | InformationRegisters/X/Ext/RecordSetModule.bsl |
Similarly for Report, DataProcessor, and other object types.
The interceptor procedure name is formed with the extension NamePrefix: Расш1_ПриЗаписи (read from the extension Configuration.xml).
For ModificationAndControl: the CLI reads the body of the original method from --config and inserts it with #Вставка/#КонецВставки markers. Requires --config.
If the file already exists: appends the procedure to the end of the module, does not overwrite it.
Validation of the extension (9 checks).
xml-gen extension validate <extensionPath>
Checks: MetaDataObject/Configuration, InternalInfo (7 ClassId), Properties (ObjectBelonging, Name, Purpose, Prefix), enum values, ChildObjects, DefaultLanguage, language files, object directories, borrowed objects (ObjectBelonging=Adopted + ExtendedConfigurationObject).
Adopted — borrowed object; absence of the attribute — own.&Перед, &После, &Вместо, &ИзменениеИКонтроль above a procedure with the extension prefix.#Вставка / #КонецВставки (or #Область <Префикс>_Вставка).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.