Skip to main content
skill CX Codex

template-add — Claude Code skill: what it does, how to install

Adds blank 1C metadata templates of various types and registers them in the parent object XML file.

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add Nikolay-Shirokov/cc-1c-skills
/plugin install 1c-skills@cc-1c-skills
Open on GitHub

What template-add does

The skill sets up fresh template directories for 1C metadata objects such as reports, data processors, catalogs, or documents. Supported types include HTML, plain text, spreadsheet documents, binary files, and Data Composition Schemas.

Execution relies on the add-template.ps1 PowerShell script. It builds the template metadata XML, drops starter template files into <ObjectName>/Templates/<TemplateName>, and inserts the <Template> tag under ChildObjects in the main XML file. When adding a DCS schema to a report, it can also populate MainDataCompositionSchema automatically.

Your workspace needs a working powershell.exe in PATH to run the generator script. For spreadsheet print forms, the tool automatically enforces the standard print form prefix.

What it helps with

  • generate a blank DCS schema for a 1C report
  • create a spreadsheet print layout and update object metadata
  • register a new template inside the parent XML file
  • scaffold binary or text template files for data processors

Example prompts for the agent

  • /template-add SalesReport MainDCS DataCompositionSchema
  • /template-add InvoicePrintForm InvoiceLayout SpreadsheetDocument
  • /template-add ItemCatalog UserManual HTML

How to install template-add

1Plugin marketplace

/plugin marketplace add Nikolay-Shirokov/cc-1c-skills
/plugin install 1c-skills@cc-1c-skills

This installs the whole 1c-skills plugin with all its skills

2Skills CLI (Vercel)

npx skills add Nikolay-Shirokov/cc-1c-skills --skill template-add -a claude-code

3Manually: put the files in place

~/.claude/skills/template-add/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/template-add/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about template-add

How to install template-add in Claude Code?

Register the marketplace repository and install the plugin: run /plugin marketplace add Nikolay-Shirokov/cc-1c-skills followed by /plugin install 1c-skills@cc-1c-skills.

What does template-add do?

It generates files for the specified 1C template type and registers the reference inside the parent object metadata XML.

What prerequisites are needed?

The helper runs operations via powershell.exe, so a functioning PowerShell environment must be accessible in your shell.

Source text

SKILL.md · MIT
---
name: template-add
description: Добавить пустой макет к объекту 1С. Используй когда нужно создать у объекта новый макет
argument-hint: <ObjectName> <TemplateName> <TemplateType>
allowed-tools:
  - Bash
  - Read
  - Write
  - Edit
  - Glob
  - Grep
---

# /template-add — Добавление макета

Создаёт макет указанного типа и регистрирует его в корневом XML объекта.

## Usage

```
/template-add <ObjectName> <TemplateName> <TemplateType>
```

| Параметр      | Обязательный | По умолчанию    | Описание                                         |
|---------------|:------------:|-----------------|--------------------------------------------------|
| ObjectName    | да           | —               | Имя объекта                                      |
| TemplateName  | да           | —               | Имя макета                                       |
| TemplateType  | да           | —               | Тип: HTML, Text, SpreadsheetDocument, BinaryData, DataCompositionSchema |
| Synonym       | нет          | = TemplateName  | Синоним макета                                   |
| Lang          | нет          | `ru`            | Код языка страницы — только для типа HTML. Повторный вызов с другим языком добавляет страницу в существующий макет |
| SrcDir        | нет          | `src`           | Путь к папке типа объектов (`Reports`, `DataProcessors`, `Catalogs`, `Documents`...), внутри которой лежит `<ObjectName>.xml`. Дефолт `src` подходит для каталогов с внешними обработками/отчётами, лежащими рядом |
| -SetMainSKD   | нет          | —               | Принудительно установить MainDataCompositionSchema |

## Команда

```powershell
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/add-template.ps1" -ObjectName "<ObjectName>" -TemplateName "<TemplateName>" -TemplateType "<TemplateType>" [-Synonym "<Synonym>"] [-Lang "<Lang>"] [-SrcDir "<SrcDir>"] [-SetMainSKD]
```

## Пример

Добавить основную СКД к отчёту в расширении:

```powershell
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/add-template.ps1" -ObjectName "ОтчётПродажи" -TemplateName "ОсновнаяСхемаКомпоновкиДанных" -TemplateType "DataCompositionSchema" -SrcDir "src/cfe/МоёРасширение/Reports"
```

## Маппинг типов

Пользователь может указать тип в свободной форме. Определи нужный по контексту:

| Пользователь пишет                          | TemplateType        | Расширение | Содержимое              |
|---------------------------------------------|---------------------|------------|-------------------------|
| HTML                                        | HTMLDocument        | `Template/<lang>.html` | Пустой HTML-документ |
| Text, текстовый документ, текст             | TextDocument        | `.txt`     | Пустой файл             |
| SpreadsheetDocument, табличный документ, MXL | SpreadsheetDocument | `.xml`     | Минимальный spreadsheet |
| BinaryData, двоичные данные                 | BinaryData          | `.bin`     | Пустой файл             |
| DataCompositionSchema, СКД, схема компоновки | DataCompositionSchema | `.xml`   | Минимальная DCS-схема   |

## Конвенция именования

Для макетов **печатных форм** (тип SpreadsheetDocument) применяй префикс `ПФ_MXL_`:

| Контекст                                                         | Формат имени               | Пример                  |
|------------------------------------------------------------------|----------------------------|-------------------------|
| Печатная форма (дополнительная обработка вида ПечатнаяФорма, или пользователь явно говорит «печатная форма») | `ПФ_MXL_<КраткоеИмя>`     | `ПФ_MXL_М11`, `ПФ_MXL_СчётФактура`, `ПФ_MXL_КонвертDL` |
| Прочие макеты (загрузка данных, служебные, настройки)            | Без префикса               | `МакетЗагрузки`, `НастройкиПечати` |

Если пользователь указал имя макета без префикса, но контекст — печатная форма, **добавь префикс `ПФ_MXL_` автоматически** и сообщи об этом.

## MainDataCompositionSchema (авто)

При добавлении макета типа `DataCompositionSchema` к `ExternalReport` или `Report`:
- Если `MainDataCompositionSchema` пуст — автоматически заполняется ссылкой на макет
- Используй `--SetMainSKD` чтобы перезаписать существующее значение

## Что создаётся

```
<SrcDir>/<ObjectName>/Templates/
├── <TemplateName>.xml              # Метаданные макета (1 UUID)
└── <TemplateName>/
    └── Ext/
        ├── Template.<ext>          # Содержимое макета
        └── Template/<lang>.html    # HTML: содержимое (Template.xml — дескриптор)
```

## Что модифицируется

- `<SrcDir>/<ObjectName>.xml` — добавляется `<Template>` в `ChildObjects`
- Для ExternalReport/Report: может обновляться `MainDataCompositionSchema`

© Nikolay Shirokov · MIT · Nikolay-Shirokov/cc-1c-skills

Topics and platforms

SKILL.md skills catalog →

From the same set59

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor