SuperAPI AI Directory

mxl-compile

General & other

View repository

Updated 10-15 17:18

About this skill

/mxl-compile — Layout compiler from DSL

Accepts a compact JSON layout definition and generates a correct Template.xml for a 1C spreadsheet document. Claude describes what is needed (areas, parameters, styles), the script ensures correctness of the XML (palettes, indices, merges, namespace).

Usage

/mxl-compile <JsonPath> <OutputPath>

Parameters

Parameter Required Description
JsonPath yes Path to the JSON layout definition
OutputPath yes Path for generating Template.xml

Command

powershell.exe -NoProfile -File .claude/skills/mxl-compile/scripts/mxl-compile.ps1 -JsonPath "<путь>.json" -OutputPath "<путь>/Template.xml"

Workflow

  1. Claude writes the JSON definition (Write tool) → file .json
  2. Claude calls /mxl-compile to generate Template.xml
  3. Claude calls /mxl-validate to check correctness
  4. Claude calls /mxl-info to verify the structure

If the layout is created from an image (screenshot, scan of a printed form) — first call /img-grid to overlay a grid, use it to determine column boundaries and proportions, then use "Nx" widths + "page" for automatic calculation of dimensions.

DSL JSON schema

Full format specification: docs/mxl-dsl-spec.md (read via the Read tool before writing JSON).

Brief structure:

{ columns, page, defaultWidth, columnWidths,
  fonts: { name: { face, size, bold, italic, underline, strikeout } },
  styles: { name: { font, align, valign, border, borderWidth, wrap, format } },
  areas: [{ name, rows: [{ height, rowStyle, cells: [
    { col, span, rowspan, style, param, detail, text, template }
  ]}]}]
}

Key rules:

  • page — page format ("A4-landscape", "A4-portrait" or a number). Automatically calculates defaultWidth from the sum of proportions "Nx"
  • col — 1-based column position
  • rowStyle — auto-fill of gaps with a style (borders across the full width)
  • The fill type is determined automatically: param → Parameter, text → Text, template → Template
  • rowspan — merging rows downward (rowStyle takes occupied cells into account)