framework/skills/tool-usage/platform-data/xml-generation/role-dsl/SKILL.md
Use for генерации ролей 1С с правами доступа через JSON DSL и точечного редактирования Rights.xml. Helps создать роль с нуля и управлять отдельными правами через xml-gen role compile/add-object/add-right.
npx skillsauth add steelmorgan/1c-agent-based-dev-framework role-dslInstall 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.
| Триггер | Действие |
|---------|----------|
| Создать роль с нуля (права на объекты) | role compile с JSON DSL |
| Добавить права на объект в существующую роль | role add-object → xml-generation §3 |
| Изменить право для существующего объекта | role add-right → xml-generation §3 |
| Анализировать существующую роль | role info <Rights.xml> |
# Компиляция из DSL
xml-gen role compile [--format designer|edt] <input.json> <output_dir>
# Результат (Designer): output_dir/Roles/<Name>.xml + output_dir/Roles/<Name>/Ext/Rights.xml
# Аудит прав: объекты, права, RLS, шаблоны
xml-gen role info <Rights.xml>
# Точечное редактирование
xml-gen role add-object --name <ObjectName> --rights <Right1,Right2,...> <Rights.xml>
xml-gen role add-right --object <ObjectName> --name <RightName> --value <true|false> <Rights.xml>
{
"name": "ИмяРоли",
"objects": [
{"name": "Catalog.Номенклатура", "rights": ["Read", "Insert", "Update", "Delete"]},
{"name": "Document.РеализацияТоваров", "rights": ["Read", "Insert"]},
{"name": "Report.ОтчётПоПродажам", "rights": ["View"]}
]
}
Корневые поля DSL (8 шт.): name, objects, templates, comment, synonym, setForNewObjects, setForAttributesByDefault, independentRightsOfChildObjects.
Типы объектов: Catalog, Document, Report, DataProcessor, InformationRegister, AccumulationRegister
Права (enum RoleRight, строго PascalCase): Read, Insert, Update, Delete, View, Edit, InteractiveInsert, InteractiveDelete, Posting, UndoPosting.
// ❌ map-форма {"rights": {"Type.Name": [...]}} — НЕ поддерживается
// CLI: Unrecognized field "rights" — корневое поле объекта RoleDsl должно быть "objects" (массив)
{"name": "X", "rights": {"Catalog.Номенклатура": ["Read"]}}
// ✅ array-форма "objects": [...]
{"name": "X", "objects": [{"name": "Catalog.Номенклатура", "rights": ["Read"]}]}
// ❌ права в camelCase → enum не распознает
"objects": [{"name": "Catalog.Номенклатура", "rights": ["read", "insert"]}]
// ✅ enum RoleRight: строго PascalCase
"objects": [{"name": "Catalog.Номенклатура", "rights": ["Read", "Insert"]}]
// ❌ объект без типа → CLI не определит применимость прав
"objects": [{"name": "Номенклатура", "rights": ["Read"]}]
// ✅ ТипОбъекта.ИмяОбъекта
"objects": [{"name": "Catalog.Номенклатура", "rights": ["Read"]}]
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.