/bc-word-layout:al-word-layout-compositefrom BC Word Layout
Guides building, splitting, and debugging Business Central composable Word layouts: body, header/footer, and theme (.dotx). Covers file rules, style contracts, and common failures.
Ships in BC Word Layout. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Business Central (2026 release wave 2) can print a document from three separately managed Word files: a body layout for the report, a header/footer layout reused across reports, and a theme that gives every report the same colours, fonts and table looks. Defaults can be set globally, per company, per report or per layout. Microsoft's announcements describe the feature but not the file rules; the rules below come from Microsoft's own sample files and from one end-to-end case.
Needs BC 29.0 or later. Set the target first: application of at least 29.0.0.0 in the AL
project's app.json, or BCWL_BC_VERSION=29 for files outside a project (al-word-layout §1, "Target
Business Central version"). With a lower target, validate_layout reports the header/footer layout
as a bc-version error, and with an unknown one as a warning.
Evidence tags:
.dotx), header/footer ExternalDefaultDetailedHFDesign, bodies WordBody_1/2/3. Not in
tests/corpus/.| Body | Header/footer | Theme | |
|---|---|---|---|
| File | .docx | .docx | .dotx (main part content type …wordprocessingml.template.main+xml) |
| Dataset part(s) | the report's own (…/reports/<Report>/<id>/) | Tenant Report Defaults (…/reports/Tenant_Report_Defaults/2000000001/) | Tenant Report Defaults (no bindings) |
| May bind | anything in the report's dataset | only BCReportInformation/… (ReportMetadata, ReportRequest, CompanyMetadata, CompanyMetadata/CompanyAddressLines) | nothing |
| Headers/footers | none | the content: first-page and default parts (w:titlePg) | empty parts only |
| Look comes from | named styles only, no direct formatting | its own direct formatting (fixed colours) on top of a few standard styles | the style definitions + theme1.xml colours/fonts |
Each .docx/.dotx carries both dataset parts BC exports — the classic
urn:microsoft-dynamics-nav/reports/… one and an …/businesscentral/internal/extended/reports/… twin
[MS sample]. Bind to the classic one; the tools here recognise only that namespace as the BC part, so
the twin does not trip the single-part check. Both parts are transplanted from a BC export, never
written by hand (al-word-layout §1): the report's empty layout for a body, an exported header/footer or
theme layout for Tenant Report Defaults.
w:jc), widths, spacing and
w:tblLook flags are layout, not look, and are fine.BCLabel, BCNumber, BCLabelNumber, BCBlockTable,
BCDataTable, BCTotalsTable) plus NoSpacing [MS sample]; the verified Fresh body used built-in
Word styles only (Title, Subtitle, Heading2, Heading3, NoSpacing, Strong, Emphasis,
SubtleEmphasis, SubtleReference, ListTable4-Accent2, ListTable1Light-Accent1, PlainTable2,
ListTable1Light) [verified].styles.xml, theme-colour based
(w:themeColor, w:asciiTheme), plus the stock Office theme1.xml — WordBody_2 has 31 such styles
[MS sample]. The body then looks plain on its own and takes its look from the theme. Copy Word's
default definitions for built-in table/character styles from a Microsoft theme's styles.xml rather
than inventing them.firstRow, no banding), a data
table for lines (firstRow, banded), a totals table (lastRow) [MS sample]; layout tables carry
w:tblCaption / w:tblDescription ("Layout table. Used for positioning, not for tabular data.").format with only characterStyle (a style reference; it is refused until the body's own
styles.xml defines the id, which the bullets above require anyway), alignment on
set_text_format and set_cell_text, tableStyle on insert_repeater_table and insert_table
(e.g. BCDataTable, BCBlockTable — refused until the body's styles.xml defines it), and
borders: "none" on both (no border at all, insert_table's default). Inserts take the formatting
of the text before them, which adds nothing to a body that has none.format member (bold, italic,
underline, size, font, colour), on the insert tools and on set_text_format; set_cell_format
(rules and fills — its borderStyle: "none" writes an explicit "no border", which also hides the
theme table style's own rule); and the other two borders values on both table tools
(headerRule draws a rule under each first-row cell, grid a table-level grid). So a body's line
table is insert_repeater_table with borders: "none" and tableStyle: "BCDataTable".w:alias = column name, w:tag = #BC:InsertDataItem,DataItems/<Item>/<Column>
(Labels/<Column> for a Labels item); repeater alias Repeater: <Item>, tag
#BC:InsertRepeater,DataItems/<Item> [MS sample: WordBody_3; verified].w:sectPr; keep the header/footer layout's margins the same.BCReportInformation/CompanyMetadata/CompanyLogo,
CompanyDisplayName, CompanyPhone, CompanyEmail, CompanyHomePage, VAT/registration/bank fields
and their …Caption columns, CompanyAddressLines/CompanyAddressLine1…8 (line 1 is the name),
ReportMetadata/ReportCaption, ReportRequest/DateAndTime, … Tags: w:alias = column name,
w:tag = #BC:InsertDataItem,BCReportInformation/CompanyMetadata/CompanyPhone [MS sample].Header, Footer, NoSpacing) [MS sample: ExternalDefaultDetailedHFDesign].
So the header/footer keeps its look whichever theme is chosen; restyle it in its own file. The tools
write exactly this: the insert tools' format (bold, italic, underline, size, font, colour) on
fields, labels, static text and page numbers, and set_text_format to restyle what is already there
(a control by id, or a cell/row/text target with layoutPart header/footer).w:titlePg, put the full masthead in the first part and a slim
running header in default; give both footers the page number (PAGE / NUMPAGES fields) [verified].
Use get_layout_info partDetails to address the right part (al-word-layout §4).w:sectPr.insert_table / insert_field / insert_label / insert_picture / insert_page_number /
insert_page_conditional_text with layoutPart header/footer work on this file like on any layout — build the masthead and the
company-details footer as plain tables; there is no repeater in a header/footer..dotx and give the main part the template content type
[MS sample: all three themes]. A theme exported from BC can arrive with a .docx extension; rename it
to .dotx before opening or editing it.styles.xml, theme/theme1.xml (colour scheme + major/minor
fonts), numbering.xml (for the BCNoteBullet bullet), empty header/footer parts, the two Tenant
Report Defaults dataset parts, and a body holding only a small preview table (rows Header / Band /
Band / Total) that shows the main table style — it has no function.settings.xml declares <w:linkStyles/> (update the document's styles from the template) and a
w:clrSchemeMapping (maps text1/background1/accent1… to the theme colours) [MS sample; verified].set_layout_theme sets the colours and fonts of a layout's own theme part, not of a theme .dotx;
change a report theme's theme1.xml in Word (Design > Colors / Fonts) until a tool covers it.BCLabel, BCLabelNumber, BCNumber, BCNoteBullet, BCBlockTable,
BCDataTable, BCTotalsTable, BCCalculationTable, BCSignatureTable, BCDataTableInternal —
because Microsoft's bodies use them [MS sample: present in all three themes];styles.xml, keep every id, and change definitions.docDefaults, not in Normal: a paragraph style's colour beats a table
style's conditional colour, so a coloured Normal would block a white header row or total row
[verified].firstRow (w:shd + white w:rPr), zebra via
band1Horz/band2Horz, grand-total band via lastRow, hairlines via insideH. Paragraphs in those
rows of the body should be unstyled so the table style wins.Before handing over, list every w:pStyle / w:rStyle / w:tblStyle the body and the header/footer
use (get_layout_info's look.styles lists them with counts) and confirm each id exists in: the theme, the body's own styles.xml, and any Microsoft theme the
customer might pick instead (Calm, Default, Playful). In BC a missing id renders as plain text with no
error. Within one file, validate_layout catches all three kinds: table-style-resolves (a
w:tblStyle), character-style-resolves (a w:rStyle, including one that names a paragraph style) and
paragraph-style-resolves (a w:pStyle, including one that names a character or table style) warn about
ids that file's own styles.xml does not define. Every check against the theme file stays manual. Fonts get the same care: font-installed warns about a font Business Central
online does not have, including the theme's heading or body font when text refers to it, since BC prints
such text in a substitute font. Watch for Word's duplicate ids (BCLabel0, BCLabelNumber0) that appear when a body was attached to
a template in Word — no theme defines them [MS sample: WordBody_3].
Start from a bound single-file layout (al-word-layout-from-design) or the design itself:
| Design element | Goes to |
|---|---|
| Logo, company name/address/VAT, contact line, page numbers | header/footer (bound to Tenant Report Defaults) |
| Document title, document number, dates, addresses, lines, totals, notes, signatures | body |
| Colours and fonts | theme theme1.xml (accent1, text2, background2, major/minor fonts) |
| Text looks (title, captions, section headings, emphasised values) | theme definitions of the styles the body references |
| Table looks (header band, zebra, total band, shaded panels) | theme table-style definitions; in the body only w:tblStyle + w:tblLook |
Choose the body's style ids first (§2), then define them in the theme (§4). Say which design details moved or changed — e.g. the title moving below the header's masthead, or a panel's accent border becoming a plain shaded panel.
validate_layout level=full, preview_layout, render_preview_pages —
each part alone. The theme has no bindings; open it and look at the preview table. A bc-version
finding on the header/footer means the target is below 29 or unknown (see the top of this skill).document.xml + the
header/footer parts and w:sectPr references + the theme's styles.xml and theme1.xml, then
convert. Treat it as a mock..dotx theme with BC + built-in styles but no w:linkStyles and no
w:clrSchemeMapping, with a body referencing those styles, printed without the theme's styling.w:linkStyles + w:clrSchemeMapping, restyling only existing ids (built-in + the
BC set), and a body using built-in ids only, printed correctly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
business-central, word-layout, composable-layout, report-theme, dotx
npx claudepluginhub tkapitan/bc-word-layout-mcp --plugin bc-word-layout4 skills in this plugin
/al-word-layoutUse whenever inspecting, creating, editing, validating, or previewing a Business Central Word report layout (.docx) — BC Word layouts, report layouts, and their bound content controls (fields, labels, repeater tables) — through the bc-word-layout MCP tools, instead of hand-editing the underlying OOXML directly. Covers the inspect → edit → validate → preview workflow, the exact tool surface and parameters, what the tools do and do not support, and the error envelope every tool returns./al-word-layout-designUse when designing a NEW Business Central Word report layout (or re-shaping an existing document) — deciding what the document should look like before any edit tool is called. Covers the two archetype skeletons (trading document, list/analysis report), the observed BC design conventions (address blocks, caption placement, line-table alignment, borders, totals, header/footer chrome, typography), the BC-verified tool recipe for each block, and the stock idioms the tools cannot build. Complements al-word-layout, which covers the tool mechanics, workflow, and error envelope — that skill is HOW to call the tools; this one is WHAT to build./al-word-layout-from-designUse when someone already has a finished Word DESIGN of a Business Central document (a styled .docx with sample values typed in — logo box, colours, an invoice/quote/order mock-up) plus the report's empty BC layout, and wants a working, data-bound BC Word layout that keeps that design. Written for a functional consultant who does not code - the agent does all file work. Covers what to ask for, mapping sample text to dataset fields (and confirming it), building the bound layout, checking it, and the handover. Complements al-word-layout (tool mechanics) and al-word-layout-design (from-scratch conventions).Other plugins' skills for the same job