Files
cc-1c-skills/.claude/skills/role-compile/SKILL.md
T
Nick ShirokovandClaude Opus 4.7 cd3a242b12 refactor(skills): portable script paths via ${CLAUDE_SKILL_DIR}
Replace literal `.claude/skills/<owner>/...` paths in SKILL.md with the
`${CLAUDE_SKILL_DIR}` variable that Claude Code substitutes at invocation
time. Same-skill references become `${CLAUDE_SKILL_DIR}/<rest>`,
cross-skill references (erf-* → epf-*) become
`${CLAUDE_SKILL_DIR}/../<other>/<rest>`. All paths now wrapped in double
quotes to handle install locations with spaces.

This unblocks plugin-mode installation: literal `.claude/skills/...`
paths fail when the skill is loaded from `~/.claude/plugins/cache/...`
or from a personal `~/.claude/skills/` install. Drop-in mode continues
to work because Claude Code resolves the variable in all install scopes.

Verified via pilot:
- Project drop-in (cc-1c-skills repo)
- Personal `~/.claude/skills/cf-info/`
- Plugin via `/plugin marketplace add <local-path>`

Scope: 61 SKILL.md, 125 path replacements (8 cross-skill).
Scripts unchanged — they already use \$PSScriptRoot and ../<sibling>
patterns that resolve correctly under the bundled cache layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 15:30:06 +03:00

4.7 KiB
Raw Blame History

name, description, argument-hint, allowed-tools
name description argument-hint allowed-tools
role-compile Создание роли 1С из описания прав. Используй когда нужно создать новую роль с набором прав на объекты <JsonPath> <OutputDir>
Bash
Read
Write
Glob

/role-compile — генерация роли 1С из JSON DSL

Принимает JSON-определение роли → генерирует Roles/Имя.xml (метаданные) и Roles/Имя/Ext/Rights.xml (права). UUID автоматически.

Параметры и команда

Параметр Описание
JsonPath Путь к JSON-определению роли
OutputDir Корень выгрузки конфигурации (где Configuration.xml, Roles/ и т.д.)
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/role-compile.ps1" -JsonPath "<json>" -OutputDir "<ConfigDir>"

Создаёт {OutputDir}/Roles/Имя.xml и {OutputDir}/Roles/Имя/Ext/Rights.xml. Регистрирует <Role> в Configuration.xml.

JSON DSL

Структура

{ "name": "ИмяРоли", "synonym": "Отображаемое имя", "objects": [...], "templates": [...] }

Необязательные: comment (""), setForNewObjects (false), setForAttributesByDefault (true), independentRightsOfChildObjects (false).

Shorthand-строки и объектная форма

"objects": [
  "Catalog.Номенклатура: @view",
  "Document.Реализация: @edit",
  "DataProcessor.Загрузка: @view",
  "InformationRegister.Цены: Read, Update",
  { "name": "Document.Продажа", "preset": "view", "rights": {"Delete": false}, "rls": {"Read": "#Шаблон(\"\")"} }
]
  • Shorthand: "Тип.Имя: @пресет" или "Тип.Имя: Право1, Право2"
  • Объектная форма: preset + rights (переопределения) + rls (ограничения)

Пресеты

Пресет Действие
@view Просмотр — Read, View (+InputByString для справочников/документов; Use+View для обработок/отчётов)
@edit Полное редактирование — CRUD + Interactive* + Posting (документы)

@ обязателен в shorthand. В объектной форме — "preset": "view" без @.

Для сервисов (WebService, HTTPService, IntegrationService) пресеты не определены — используй явные права: "WebService.Имя: Use".

Русские синонимы

Поддерживаются русские типы (Справочник→Catalog, Документ→Document) и права (Чтение→Read, Просмотр→View). Смешивание допустимо: "Справочник.Контрагенты: Чтение, View".

Шаблоны RLS

"templates": [{"name": "ДляОбъекта(Мод)", "condition": "ГДЕ Организация = &ТекОрг"}]

Ссылка в rls: "#ДляОбъекта(\"\")". Символ & автоматически экранируется в XML.

Примеры

Простая роль

{
  "name": "ЧтениеНоменклатуры", "synonym": "Чтение номенклатуры",
  "objects": ["Catalog.Номенклатура: @view", "Catalog.Контрагенты: @view", "DataProcessor.Загрузка: @view"]
}

Роль с RLS

{
  "name": "ЧтениеДокументовПоОрганизации",
  "synonym": "Чтение документов (ограничение по организации)",
  "objects": [
    "Catalog.Организации: @view",
    {"name": "Document.РеализацияТоваровУслуг", "preset": "view", "rls": {"Read": "#ДляОбъекта(\"\")"}}
  ],
  "templates": [{"name": "ДляОбъекта(Модификатор)", "condition": "ГДЕ Организация = &ТекущаяОрганизация"}]
}

Подробные таблицы пресетов, русских синонимов и дополнительные примеры — в dsl-reference.md.

Верификация

/role-validate <RightsPath> [MetadataPath]  — проверка корректности XML, прав, RLS
/role-info <RightsPath>                     — визуальная сводка структуры