Creates a template of the specified type and registers it in the object's root XML.
Usage
/template-add <ObjectName> <TemplateName> <TemplateType>
| Parameter | Required | Default | Description |
|---|---|---|---|
| ObjectName | yes | — | Object name |
| TemplateName | yes | — | Template name |
| TemplateType | yes | — | Type: HTML, Text, SpreadsheetDocument, BinaryData, DataCompositionSchema |
| Synonym | no | = TemplateName | Template synonym |
| SrcDir | no | src |
Source directory |
| --SetMainSKD | no | — | Force setting MainDataCompositionSchema |
Command
powershell.exe -NoProfile -File .claude/skills/template-add/scripts/add-template.ps1 -ObjectName "<ObjectName>" -TemplateName "<TemplateName>" -TemplateType "<TemplateType>" [-Synonym "<Synonym>"] [-SrcDir "<SrcDir>"] [-SetMainSKD]
Type mapping
The user may specify the type in free form. Determine the required one from the context:
| User writes | TemplateType | Extension | Content |
|---|---|---|---|
| HTML | HTMLDocument | .html |
Empty HTML document |
| Text, text document, text | TextDocument | .txt |
Empty file |
| SpreadsheetDocument, spreadsheet document, MXL | SpreadsheetDocument | .xml |
Minimal spreadsheet |
| BinaryData, binary data | BinaryData | .bin |
Empty file |
| DataCompositionSchema, DCS, composition schema | DataCompositionSchema | .xml |
Minimal DCS schema |
Naming convention
For templates of print forms (type SpreadsheetDocument) apply the prefix ПФ_MXL_:
| Context | Name format | Example |
|---|---|---|
| Print form (additional processing of the PrintForm kind, or the user explicitly says "print form") | ПФ_MXL_<КраткоеИмя> |
ПФ_MXL_М11, ПФ_MXL_СчётФактура, ПФ_MXL_КонвертDL |
| Other templates (data loading, utility, settings) | Without prefix | МакетЗагрузки, НастройкиПечати |
If the user specified a template name without a prefix, but the context is a print form, add the prefix ПФ_MXL_ automatically and report this.
MainDataCompositionSchema (auto)
When adding a template of type DataCompositionSchema к ExternalReport or Report:
- If
MainDataCompositionSchemais empty — it is automatically filled with a reference to the template - Use
--SetMainSKDto overwrite the existing value
What is created
<SrcDir>/<ObjectName>/Templates/
├── <TemplateName>.xml # Метаданные макета (1 UUID)
└── <TemplateName>/
└── Ext/
└── Template.<ext> # Содержимое макета
What is modified
<SrcDir>/<ObjectName>.xml— added<Template>to the end ofChildObjects- For ExternalReport/Report: can be updated
MainDataCompositionSchema