/trud-d365fo-xpp:d365-xpp-compilefrom D365FO X++ Development
Builds Dynamics 365 Finance & Operations X++ projects from the command line: compiles with xppc, compiles labels, syncs tables/data entities, restarts AOS, and analyzes compile errors. Use before and after every X++ change.
Ships in D365FO X++ Development. 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.
Read when SKILL.md points to them; scripts run unread.
Before the first edit: the task's project and git branch. After every X++ change: add the changed elements to the project → build → analyse and fix → repeat until clean → full build before handing back.
On a CHE or VHD development VM, X++ is built into the running environment: the AOS runs the binaries in PackagesLocalDirectory\<Package>\bin. Visual Studio's Build can't run from the command line, and X++ compiles a whole package anyway, so Invoke-XppProjectBuild.ps1 does what a Visual Studio build does, for the package of the project's model:
xppc.exe into <Package>\bin: incremental, or everything with -Full.LabelC.exe when they changed since the last build.SyncEngine.exe, a partial sync, when their files changed since the last sync.-CheckOnly only compiles, into a scratch folder (%TEMP%\xppc-scratch\<module>): nothing is stopped, deployed or synced, and the AOS keeps running the deployed binaries. Use it for quick iterations while fixing errors, or when someone else is testing on the VM.
All scripts are in <skill-dir>/scripts/. They are Windows PowerShell 5.1 scripts. Run them with the PowerShell tool:
& "<skill-dir>\scripts\Invoke-XppProjectBuild.ps1" -Project "C:\Repos\Contoso\Projects\ABC123_Feature\ABC123_Feature\ABC123_Feature.rnrproj"
From Bash, use powershell.exe -NoProfile -ExecutionPolicy Bypass -File "<skill-dir>/scripts/Invoke-XppProjectBuild.ps1" -Project ....
| Script | What it does |
|---|---|
Add-XppProjectItem.ps1 -Project <rnrproj> -Element AxClass\A, AxTableExtension\SalesTable.ABC | Checks the element files exist in the project's model and are well-formed XML. Normalizes them, and the project file, to the VS file format (UTF-8 without BOM, CRLF, no newline at end of file). Adds missing <Content> items, sorted and filed under the VS element-type folder. Idempotent. -Element also accepts paths to element .xml files or one comma-separated string. -NoNormalize skips the rewrite. |
... -Remove | Removes the elements from the project instead (for deleted or renamed elements). Don't edit the .rnrproj by hand. |
... -Create -Model <ModelName> | Creates the project, plus a .sln one folder up, using VS's layout: <root>\<Name>\<Name>.sln and <root>\<Name>\<Name>\<Name>.rnrproj. |
Invoke-XppProjectBuild.ps1 -Project <rnrproj or folder> | Runs pre-checks, builds incrementally as described above, and prints the report. Exit code: 0 = clean, 1 = compile, label or sync errors, 2 = setup failure. |
... -Full | Full compile of the package (about 30 s for a large customization package), and the labels. |
... -CheckOnly | Compile only, into the scratch folder. -OutputDir changes that folder. |
... -Sync | Sync the project's tables, views and entities even if their files didn't change (for example after a database restore). -SqlServer and -SqlDatabase default to localhost and AxDB. |
... -RemoveStaleCache | Deletes compiler-cache files whose source was renamed or deleted. |
... -AllWarnings | Also lists warnings outside the project. |
... -CheckLabels | Also checks that referenced labels exist and that label IDs are unique. Off by default. |
The packages folder (<drive>:\AosService\PackagesLocalDirectory) is found automatically. Override it with -PackagesDir or $env:D365_PACKAGES_DIR. XppCommon.ps1 is shared: d365-xpp-conventions\scripts\Invoke-XppFormPattern.ps1 dot-sources it for Find-PackagesDir.
Give build calls a long tool timeout (600000 ms): a full compile takes about 30 s and a sync about 2 minutes. If it might take longer, run it in the background and wait for it to finish.
Every task that creates or changes X++ elements gets its own Visual Studio project and, when the code is in git, its own branch. Questions and investigations that change nothing need neither.
Names come from the project rules: CLAUDE.md first, otherwise the pattern of the existing projects (the repo's Projects\ folder) and branches (git branch -a). Usually the ticket number plus a short description, e.g. project ABC123_SalesRelease and branch feature/ABC123-sales-release. If the rules need a ticket number and you don't have one, ask.
**/*ABC123*.rnrproj). Otherwise create it with Add-XppProjectItem.ps1 -Create next to the sibling projects, with the model the elements live in (the <package>\<model>\Ax... folder of the element files). One project per task.git -C <model folder> rev-parse --show-toplevel).
git status is clean, create the task branch from the default branch (the one the rules name, else origin/HEAD, else main/master; git fetch first when there is a remote) and switch to it.AxLabelFile) and security objects. Don't add elements you only read; remove deleted or renamed ones with -Remove.
Add-XppProjectItem.ps1 after editing element files even when the element is already in the project. The Write tool saves LF line endings; the script restores the VS format so the git diff stays clean.Invoke-XppProjectBuild.ps1. -CheckOnly is fine while fixing errors.-Full, without -CheckOnly) before telling the user you're done or testing the change, and after renaming or deleting elements or changing method signatures or other shared APIs.
[other] error.-RemoveStaleCache. Otherwise the old type stays in the compiler cache and can hide those errors.Checks :
[format] AxClass\ABCFoo: LF line endings ... -> run Add-XppProjectItem.ps1 on it
[missing] / [xml] ... -> blocking; nothing is built until fixed
[ignored] AxTable\ABCFoo: AxTable[ABCFoo]/CreatedBy: out of order, must come before Relations
-> the element compiles WITHOUT this property; fix the XML
[cache] stale compiler cache ... -> rerun with -RemoveStaleCache
AOS : stopped IIS and batch service
Compile : 31 s, xppc exit code 1; logs ...
Labels : skipped, the compile failed
Sync : skipped, the compile failed
AOS : IIS started, batch service started; ...
ERRORS (2; 1 in project elements)
1. [project] Class ABCFoo, run, line 12 col 9 (NotDeclared)
'undefinedVar' is not declared.
at C:\...\AxClass\ABCFoo.xml:23 <- line in the XML file to edit
> undefinedVar = 5; <- the source line
2. [other] Class ABCBar, bar, line 6 col 16 (ParameterMissing)
RESULT: FAILED - ...
[ignored] lists XML elements that Visual Studio and xppc silently skip: an unknown property name, a wrong XML namespace (a menu item root without xmlns="Microsoft.Dynamics.AX.Metadata.V1" is read as completely empty), or a property out of order. The compiler never reports these, so the result is FAILED until you move, rename or re-namespace the element as the message says. Copy the order from a standard element of the same type.FATAL ERRORS come from the text log (for example an invalid character in a class source) and stop the compile of that element.[project] errors are in your elements. Fix them.[other] errors are in elements outside the project. In a full build right after your change, they are almost always callers or subclasses you broke. Fix the caller, or reconsider the change. If the element isn't in your diff and doesn't use anything you changed, the error existed before: tell the user, don't rewrite unrelated code.DEPLOY PROBLEMS are label compile or sync errors (logs in %TEMP%\xppc-logs\<module>). A sync error usually means a table change the database can't take as is (for example a shorter field or a new unique index on duplicate data).-Full to see all of them.line/col are the numbers Visual Studio's code editor shows. For classes and tables, at file:line gives the exact XML line. For forms, search the form XML for the method.references/xpp-compile-errors.md.Say what was built and how, for example: "Full build of package ContosoCustomizations, labels compiled, ABCVehicleBrand synced, AOS restarted: 0 errors; project elements have 1 warning, pre-existing." Say so when a build was only -CheckOnly: then nothing is deployed and the change can't be tested yet. List any warnings your change introduced and any [other] errors you left alone, with the reason.
XppMetadata cache and the package bin.-CheckOnly.%TEMP%\xppc-state, not in the database. After a database restore, build once with -Sync.xppc.out.txt in the log folder. Usual causes are a concurrent build or low disk space.bin folder is incomplete. The script passes -refPath for <Package>\bin and PackagesLocalDirectory\bin; run one -Full build.xppc accepts -classes= but ignores it: it always compiles the whole package.-CheckLabels, xppc does not check label references. An unknown @ABC:Foo compiles and shows up raw in the UI. When you add labels, check them in <model>\AxLabelFile\LabelResources\en-US\<File>.en-US.label.txt (Id=Text lines, ; comment lines), or run with -CheckLabels. Its output is noisy on legacy code that references label files missing from the box.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/d365-xpp-conventionsConventions for creating Dynamics 365 Finance & Operations (D365 F&O, AX7) X++ elements as metadata XML - new tables and table fields, EDTs, table relations, setup forms (simple list, list and details with a tabular grid), RunBase dialog and batch classes, table/form/enum extensions, Chain of Command and event handler classes, menu items and security privileges. Use this before writing the XML whenever you create a table, add fields to a table or table extension, create a form, an extension or extension class, a RunBase/RunBaseBatch class or other periodic operation, a menu item or a privilege - even when the user only says "create a table for X", "add a field", or "make a job that updates Y"./d365-xpp-extensionsRules and recipes for extending standard Dynamics 365 Finance & Operations (D365 F&O, AX7) X++ code from your own model - Chain of Command wrappers ([ExtensionOf], next), pre/post, data-event and form event handlers, delegate subscribers, form, data source and control extensions, lookups (control, field, reference group, multi-select) and fields added to RunBase or SysOperation dialogs. Use this before writing or reviewing any [ExtensionOf] class or event handler class, and whenever the task changes, blocks or adds to standard behaviour - "add a check before posting", "default this field on the sales line", "filter this lookup", "add a field to this dialog", "hide this button on the form", "why is my extension not called", "review this extension" - even when the user doesn't say Chain of Command, CoC or extension.npx claudepluginhub trudax/d365fo-xpp-skills --plugin trud-d365fo-xpp