/trud-d365fo-xpp:d365-xpp-conventionsfrom D365FO X++ Development
Provides conventions for creating Dynamics 365 Finance & Operations X++ elements as metadata XML, including tables, EDTs, forms, extensions, and security privileges.
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.
Defaults for new elements, taken from the TRUDUtils Visual Studio add-in that generated them for years. Apply them without being asked. The user's explicit instructions win; so do the conventions already visible in the target model (if its key EDTs extend another type than Num, or its extension classes follow another scheme, follow the model).
d365-xpp-compile describes (Task setup).Label, HelpText, Caption and X++ strings (info("..."), checkFailed("...")). Don't create label files or use label IDs (not even @SYS ones) unless the user asks for labels.// Find the record), no /// headers that only restate the signature. The comments in the references/ templates are notes for you, not code to copy.<Element>.<Model> or an extension class, look in the model folder for one (AxTableExtension\SalesTable.*.xml; a class with [ExtensionOf(tableStr(SalesTable))], or d365-xpp-xref -ExtensionsOf) and add to it.xmlns attributes) and the property order from a standard element of the same type. Element order and namespaces matter: forms use xmlns="Microsoft.Dynamics.AX.Metadata.V6" and menu items xmlns="Microsoft.Dynamics.AX.Metadata.V1" on the root, while tables, EDTs, classes and privileges have none. Anything misplaced is silently ignored; d365-xpp-compile reports it as [ignored].d365-xpp-compile). The build syncs the project's new or changed tables, views and data entities; a change that needs a wider sync (for example an EDT used by tables outside the project) needs Visual Studio's Synchronize database: say so.A setup table (code + description) comes with its EDT, a form, a display menu item and two privileges, unless the user asks for less. Other tables (transactions, logs, parameters) get only what was asked, with the same table properties. Example names for prefix ABC and entity "Vehicle brand":
ABCVehicleBrand: Label "Vehicle brands", TableGroup Group, TitleField1 the key, TitleField2 Description, CacheLookup Found, CreatedBy, CreatedDateTime, ModifiedBy, ModifiedDateTime and AllowRowVersionChangeTracking Yes.ABCVehicleBrandId: string, Extends Num (no StringSize when it extends), Label "Vehicle brand", HelpText "Identification of the vehicle brand", ReferenceTable + TableReferences to the key field.VehicleBrandId (entity name without the prefix): AllowEdit No (it stays editable on a new record), IgnoreEDTRelation Yes, Mandatory Yes.Description with EDT Description.VehicleBrandIdIdx on the key, AlternateKey Yes; it is the table's ClusteredIndex, PrimaryIndex and ReplacementKey. Indexes are unique by default: a non-unique one needs AllowDuplicates Yes.AutoReport (key), AutoLookup, AutoIdentification (AutoPopulate Yes, key), AutoSummary, AutoBrowse, and Overview (label "Overview": key, Description).public static ABCVehicleBrand find(ABCVehicleBrandId _vehicleBrandId, boolean _forUpdate = false).<Prefix><Name>, label and help text on the EDT). Without one, pick a fitting standard EDT, else the type default: Int Integer, Real Amount, Date TransDate, DateTime TransDateTime, Time TimeHour24, Int64 RefRecId, Enum NoYesId, Container InfologData, Memo FreeTxt. A string without a fitting standard EDT gets a new EDT with a StringSize. Set StringSize only on an EDT without Extends.V prefix if it starts with a digit.ReferenceTable (or old-style Relations), add an AxTableRelationForeignKey named after the related table (<RelatedTable>_<Field> if taken): Cardinality ZeroMore, RelatedTableCardinality ZeroOne (ExactlyOne for a mandatory field), RelationshipType Association, OnDelete Restricted, and an AxTableRelationConstraintField with Field, RelatedField and SourceEDT. Copy the EDT relation's fixed-value conditions as AxTableRelationConstraintRelatedFixed.[SysClientCacheDataMethodAttribute(true)] public display <EDT> <name>().<Table>.<Model> extension. Prefix the names of new fields, field groups, indexes and relations there (ABCVehicleBrandId).SimpleList pattern): same name as the table, Caption = table label, root data source InsertIfEmpty No, action pane, quick filter, grid of the Overview field group.SimpleListDetails-Grid, "tabular") when the record has more fields than fit in a grid row, or lines.references/forms.md for both layouts before writing the form XML.<skill-dir>\scripts\Invoke-XppFormPattern.ps1 -Form <form .xml>; -Apply stamps every property the patterns enforce (Style, WidthMode, ArrangeMethod, PatternVersion...). The compiler doesn't check patterns.For a periodic job, a dialog operation, a data update or a file import, write a RunBase class (not SysOperation, unless the user asks for it or the model's existing operations use it). Read references/runbase.md and start from its template.
extends RunBaseBatch implements BatchRetryable; isRetryable() returns true; canRunInNewSession() returns false.canGoBatch() returns false, unless the user asks for batch processing or the work is long-running (many records, scheduled, recurring); then true, and run() must work without a client.ABCVehicleBrandUpdate). description() returns a literal string, which is also the menu item label.| Element | Name |
|---|---|
| Table, form, enum, EDT, view, data entity, menu, menu item, security role/duty extension | <Element>.<Model>, e.g. SalesTable.ContosoCustomizations |
| Extension class of a class, table, view, data entity, map | <Element>_<Model>_Extension, e.g. SalesTable_ContosoCustomizations_Extension |
| Extension class of a form | <Form>Form_<Model>_Extension (Form keeps it apart from the table of the same name) |
| Form data source / data field / control | <Form>Form_<DataSource>DS_<Model>_Extension, <Form>Form_<DataSource>DS_<Field>_<Model>_Extension, <Form>Form_<Control>_<Model>_Extension |
| Event handler class | <Element>_<Model>_EventHandler, form: <Form>Form_<Model>_EventHandler |
Class names are limited to 80 characters; if longer, use the prefix instead of the model name. Extension classes are final. For the code inside them (Chain of Command, event handlers, form extensions, lookups), use d365-xpp-extensions.
Label = form caption or class description(). HelpText "Set up " for a setup form, " operation" for a class.<MenuItem>View (entry point Grant with Read Allow) and <MenuItem>Maintain (Grant with Correct, Create, Delete, Read and Update all Allow). Labels " view" / " maintain". An action menu item usually needs only the Maintain privilege. A data entity is granted under DataEntityPermissions (IntegrationMode All). Add privileges to a duty or role only when asked.<skill-dir>\scripts\Invoke-XppFormPattern.ps1 uses the platform's own pattern engine (the form designer's "Apply pattern"). It finds PackagesLocalDirectory with d365-xpp-compile's XppCommon.ps1 (-PackagesDir overrides). Windows PowerShell 5.1; from Bash use powershell.exe -NoProfile -ExecutionPolicy Bypass -File ....
| Call | What it does |
|---|---|
-Pattern SimpleListDetails-Grid | Prints the control tree the pattern requires: type, required/optional, "many", sub-patterns, enforced property values. |
-List | Lists the active patterns. |
-Form <form .xml> | Checks the design and every sub-pattern container: missing required controls, controls the pattern doesn't allow, property values that differ. |
-Form <form .xml> -Apply | Applies the patterns and saves the form. Saves nothing if the control structure doesn't match. -Pattern <name> sets the design pattern first. |
Exit codes: 0 = OK, 1 = the form doesn't match, 2 = setup failure. The analyzer matches controls by type and order, so a missing control can be reported on its neighbour; compare with the -Pattern tree. After -Apply, run Add-XppProjectItem.ps1 as for any edited element.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
5 skills in this plugin
/d365-xpp-compileSet up the task's Visual Studio project and git branch, then build a Dynamics 365 Finance & Operations (D365 F&O, AX7) X++ project (.rnrproj) from the command line the way Visual Studio does on a development VM (CHE or VHD) - compile its package with xppc into PackagesLocalDirectory, compile labels, sync changed tables and data entities, restart the AOS so the change can be tested - and analyse the compile errors. Use this at the start of every task that will create or modify X++ / AOT elements (AxClass, AxTable, AxForm, table/form/class extensions, EDTs, enums, menu items, data entities, security, labels), before the first edit - to create or find the task's project and branch - and after the changes - add the changed elements to the project, build, and fix errors until the build is clean, without waiting to be asked. Also use when the user says "build/compile the project", "deploy it so I can test", "check that it compiles", "run xppc", or pastes X++ compiler errors./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