SuperAPI AI Directory

meta-remove

Coding & development

View repository

Updated 10-15 17:18

About this skill

/meta-remove — deleting a metadata object

Safely deletes an object from an XML dump of a configuration. Before deletion, it checks for references to the object in attributes, code, and other metadata. If references are found, deletion is blocked.

Usage

/meta-remove <ConfigDir> -Object <Type.Name>

Parameters

Parameter Required Description
ConfigDir yes Root directory of the dump (where Configuration.xml is)
Object yes Object type and name: Catalog.Товары, Document.Заказ и т.д.
DryRun no Only show what will be deleted, without changes
KeepFiles no Do not delete files, only unregister
Force no Delete despite found references

Command

powershell.exe -NoProfile -File .claude/skills/meta-remove/scripts/meta-remove.ps1 -ConfigDir "<путь>" -Object "Catalog.Товары"

What it does

  1. Finds the object's files: {TypePlural}/{Name}.xml и {TypePlural}/{Name}/
  2. Checks references (blocks if present, unless -Force):
    • XML types in attributes of other objects: CatalogRef.Имя, DocumentRef.Имя и т.д.
    • BSL code: Справочники.Имя, Catalogs.Имя, calls to common modules
    • Document journals, event subscriptions, defined types
  3. Removes from Configuration.xml: removes from <ChildObjects>
  4. Clears subsystems: recursively removes from <Content>
  5. Deletes files: the object's XML file and directory

Supported types

Catalog, Document, Enum, Constant, InformationRegister, AccumulationRegister, AccountingRegister, CalculationRegister, ChartOfAccounts, ChartOfCharacteristicTypes, ChartOfCalculationTypes, BusinessProcess, Task, ExchangePlan, DocumentJournal, Report, DataProcessor, CommonModule, ScheduledJob, EventSubscription, HTTPService, WebService, DefinedType, Role, Subsystem, CommonForm, CommonTemplate, CommonPicture, CommonAttribute, SessionParameter, FunctionalOption, FunctionalOptionsParameter, Sequence, FilterCriterion, SettingsStorage, XDTOPackage, WSReference, StyleItem, Language

Output (object without references)

=== meta-remove: Catalog.Устаревший ===

[FOUND] Catalogs/Устаревший.xml
[FOUND] Catalogs/Устаревший/ (8 files)

--- Reference check ---
[OK]    No references found

--- Configuration.xml ---
[OK]    Removed <Catalog>Устаревший</Catalog> from ChildObjects
[OK]    Configuration.xml saved

--- Subsystems ---
[OK]    Removed from subsystem 'Справочники'

--- Files ---
[OK]    Deleted directory: Catalogs/Устаревший/
[OK]    Deleted file: Catalogs/Устаревший.xml

=== Done: 4 actions performed (1 subsystem references removed) ===

Output (object with references — blocked)

=== meta-remove: Catalog.Валюты ===

[FOUND] Catalogs/Валюты.xml
[FOUND] Catalogs/Валюты/ (4 files)

--- Reference check ---
[WARN]  Found 3 reference(s) to Catalog.Валюты:

        Documents/СчетНаОплату.xml
          pattern: CatalogRef.Валюты
        InformationRegisters/КурсыВалют.xml
          pattern: CatalogRef.Валюты
        CommonModules/РаботаСВалютами/Ext/Module.bsl
          pattern: Справочники.Валюты

[ERROR] Cannot remove: object has 3 reference(s).
        Use -Force to remove anyway, or fix references first.

Return code: 0 = success, 1 = errors or references found.

Checked references

Category Search patterns
XML attribute types CatalogRef.Name, DocumentRef.Name, EnumRef.Name etc.
BSL code (Russian) Справочники.Name, Документы.Name, Перечисления.Name etc.
BSL code (English) Catalogs.Name, Documents.Name, Enums.Name etc.
Common modules Name. (method calls), <Handler>Name., <MethodName>Name.

References from Configuration.xml, ConfigDumpInfo.xml, and subsystems are NOT considered blocking — they are cleared automatically.

Examples

# Проверка ссылок + dry run
... -ConfigDir C:\WS\tasks\cfsrc\acc_8.3.24 -Object "Catalog.Устаревший" -DryRun

# Удалить объект без ссылок
... -ConfigDir C:\WS\tasks\cfsrc\acc_8.3.24 -Object "Catalog.Устаревший"

# Принудительно удалить несмотря на ссылки
... -ConfigDir C:\WS\tasks\cfsrc\acc_8.3.24 -Object "Catalog.Устаревший" -Force

# Только дерегистрировать (файлы оставить)
... -ConfigDir C:\WS\tasks\cfsrc\acc_8.3.24 -Object "Report.Старый" -KeepFiles

# Удалить общий модуль
... -ConfigDir src -Object "CommonModule.МойМодуль"

When to use

  • Refactoring: removing unused objects
  • Cleanup: removing temporary/test objects
  • Migration: removing an object before recreating it with a different structure