AgentSkillsCN

1c-mxl-validate

从服务器数据库初始化全新1C项目——创建文件夹结构、复制技能、自动识别1C版本、生成.1c-devbase.bat、转储配置与扩展、配置OpenSpec与Git。当用户提出“创建1C项目”、“初始化项目”、“从数据库部署项目”、“1C项目初始化”等需求,或需要基于现有数据库快速搭建全新的1C开发环境时,此工具包将为您提供高效解决方案。

SKILL.md
--- frontmatter
name: 1c-mxl-validate
description: "Validate structural correctness of a 1C spreadsheet document (MXL/Template.xml). Use after generating or editing layouts to check for structural errors that 1C may silently ignore."

1C MXL Validate — Layout Validator

Checks Template.xml for structural errors that the 1C platform may silently ignore (potentially causing data loss or layout corruption).

Usage

code
1c-mxl-validate <TemplatePath>
1c-mxl-validate <ProcessorName> <TemplateName>
ParameterRequiredDefaultDescription
TemplatePathnoDirect path to Template.xml
ProcessorNamenoProcessor name (alternative to path)
TemplateNamenoTemplate name (alternative to path)
SrcDirnosrcSource directory
MaxErrorsno20Stop after N errors

Specify either -TemplatePath, or both -ProcessorName and -TemplateName.

Command

powershell
powershell.exe -NoProfile -File skills/1c-mxl-validate/scripts/mxl-validate.ps1 -TemplatePath "<path>"

Or by processor/template name:

powershell
powershell.exe -NoProfile -File skills/1c-mxl-validate/scripts/mxl-validate.ps1 -ProcessorName "<Name>" -TemplateName "<Template>" [-SrcDir "<dir>"]

Checks Performed

#CheckSeverity
1<height> >= max row index + 1ERROR
2<vgRows> <= <height>WARN
3Cell format indices (<f>) within format paletteERROR
4Row/column <formatIndex> within paletteERROR
5Cell column indices (<i>) within column count (accounting for column set)ERROR
6Row <columnsID> references existing column setERROR
7Merge/namedItem <columnsID> references existing setERROR
8Named area ranges within document boundariesERROR
9Merge ranges within document boundariesERROR
10Font indices in formats within font paletteERROR
11Border line indices in formats within line paletteERROR
12Drawing pictureIndex references existing pictureERROR

Output

code
=== Validation: TemplateName ===

[OK]    height (40) >= max row index + 1 (40), rowsItem count=34
[OK]    Font refs: max=3, palette size=4
[ERROR] Row 15: cell format index 38 > format palette size (37)
[OK]    Column indices: max in default set=32, default column count=33
---
Errors: 1, Warnings: 0

Return code: 0 = all checks passed, 1 = errors found.

When to Use

  • After layout generation: run validator to find structural errors before building
  • After editing Template.xml: ensure indices and references remain valid
  • When debugging: fix found issues and re-run until all checks pass

Overflow Protection

Stops after 20 errors by default (configurable via -MaxErrors). Summary line with error/warning counts is always shown.