Customizes A2L (ASAP2) files from Simulink models using coder.asap2 and coder.mapping APIs. Adds COMPU_METHODs, GROUPs, BIT_OPERATIONs, VARIANT_CODING, converts axes, excludes elements, and removes DEFAULT_EVENT_LIST for calibration tool compatibility (INCA, CANape).
Ships in code-generation. 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.
Customize A2L (ASAP2) files generated from Simulink models using the coder.asap2 and coder.mapping APIs, avoiding silent errors and undocumented pitfalls.
CustomEcuDescriptions to coder.asap2.exporta2lfile)coder.asap2.export directly with name-value options. No getEcuDescriptions needed.getEcuDescriptions → customize → export workflow.% === Path A: Config-only (no element changes) ===
load_system(modelName);
slbuild(modelName);
coder.asap2.export(modelName, SupportStructureElements=false, IncludeDefaultEventList=false);
% === Path B: Element customization ===
load_system(modelName);
slbuild(modelName);
% 1. Create ECU descriptions — pass ALL configuration options here
descObj = coder.asap2.getEcuDescriptions(modelName, ...
SupportStructureElements=false, ...
IncludeDefaultEventList=false);
% 2. Customize elements
add(descObj, newElement);
set(descObj, 'ElementType', 'Name', Prop=value);
info = get(descObj, 'ElementType', 'Name');
names = find(descObj, 'ElementType');
delete(descObj, 'ElementType', 'Name');
% 3. Export — MUST pass descObj back or all customizations are silently lost
coder.asap2.export(modelName, CustomEcuDescriptions=descObj);
Critical: When using Path B, omitting CustomEcuDescriptions=descObj in the export call silently discards all customizations with no error.
Critical: When using Path B, construction-time options (SupportStructureElements, etc.) CANNOT be passed to export alongside CustomEcuDescriptions — they must be passed to getEcuDescriptions.
| Function | Purpose |
|---|---|
coder.asap2.getEcuDescriptions | Create ECU description object (construction-time config) |
coder.asap2.export | Export A2L file with customizations |
coder.asap2.CompuMethod | Create computation method |
coder.asap2.Characteristic | Create characteristic (parameter) |
coder.asap2.Measurement | Create measurement (signal) |
coder.asap2.Group | Create A2L group |
coder.asap2.RecordLayout | Create record layout |
coder.asap2.AxisInfo | Create axis points or axis descriptor |
coder.asap2.VarCriterion | Create variant criterion |
coder.asap2.VarCharacteristic | Create variant characteristic |
coder.asap2.Function | Create FUNCTION object for grouping measurements/characteristics |
coder.mapping.api.get | Get code mapping object (persistent settings) |
setInport / setOutport | Control inport/outport A2L export (persistent) |
See references/object-properties.md for mandatory fields, valid types, and creation order for each coder.asap2.* class.
Match the user's task to the correct reference for detailed guidance:
| Task | Key Rule | Reference |
|---|---|---|
| Add COMPU_METHOD (RAT_FUNC, LINEAR, TAB_VERB) | RAT_FUNC COEFFS direction is PHYS→INT — invert the desired formula | references/compu-method-guidance.md |
| Convert STD_AXIS to COM_AXIS (shared breakpoints) | Use ForceShared=true on the Characteristic — do NOT manually create AXIS_PTS | references/customization-patterns.md |
| Add BIT_OPERATION to a measurement | Must set BOTH BitMask AND MaskData — either alone produces no output | references/customization-patterns.md |
| Exclude inports/outports persistently | Use coder.mapping.api + setInport/setOutport + slbuild | references/customization-patterns.md |
| Create VARIANT_CODING | Must create supporting CHARACTERISTIC objects (selection + variant-dependent) with RecordLayouts and CompuMethods BEFORE VarCriterion/VarCharacteristic. All multi-value properties must be string arrays (not char/cell). | references/variant-coding-guidance.md |
| Create Characteristic (CURVE, MAP, CUBOID) | RecordLayout struct array must match axis count for STD_AXIS types | references/object-properties.md |
| Create Measurement | Set DataType='SWORD', EcuAddress='@ECU_Address@name@', CompuMethodName='NO_COMPU_METHOD' as defaults | references/object-properties.md |
| Create Group | See mandatory fields and ROOT constraint | references/object-properties.md |
| Create RecordLayout | Struct array required for multi-axis types (MAP, CUBOID); single struct for VALUE/VAL_BLK | references/object-properties.md |
| Create AxisInfo / AXIS_PTS | Dual role: add(descObj, axisInfo) creates AXIS_PTS; characteristic.AxisInfo = [...] creates AXIS_DESCR | references/object-properties.md |
| Control construction-time options (SupportStructureElements, IncludeDefaultEventList, etc.) | Must pass at getEcuDescriptions() — cannot set after construction or pass to export with CustomEcuDescriptions | references/construction-time-properties.md |
| Feature | Minimum Release |
|---|---|
| COMPU_METHOD, Measurement, Characteristic, BIT_OPERATION | R2022b |
| RecordLayout, AxisInfo (STD_AXIS, CUBOID) | R2023a |
| Group (ROOT groups) | R2023b |
| VarCriterion, VarCharacteristic (variant coding) | R2025a |
If the user's release is too old, inform them. Do not attempt workarounds — the APIs do not exist on older releases.
These cause silent failures or incorrect calibration data. Always check before generating code:
| Mistake | Why It's Wrong | Correct Approach |
|---|---|---|
coder.asap2.export(modelName) without CustomEcuDescriptions=descObj | Silently discards all customizations — no error, exports default A2L | Always pass descObj back when using the customization workflow |
RAT_FUNC Coefficients = [0 0.5 -40 0 0 1] for "PHYS = 0.5×INT - 40" | COEFFS is PHYS→INT, not INT→PHYS — produces the inverse conversion | Invert: INT = 2×PHYS + 80 → [0 2 80 0 0 1]. See references/compu-method-guidance.md |
set(descObj, ..., 'CompuMethodName', name) before adding the CompuMethod | set() auto-creates a placeholder that blocks subsequent add() | delete() the auto-created placeholder, then add() the user's version |
MaskData.Shift without BitMask | BIT_OPERATION block is only emitted when both are set | Always set BitMask (e.g., '0xFF') alongside MaskData |
MaskData.Shift = 3 expecting LEFT_SHIFT | Positive = RIGHT_SHIFT; sign is counterintuitive | Use -3 for LEFT_SHIFT 3 |
| Manually creating AXIS_PTS for STD→COM_AXIS | Unnecessary complexity; error-prone struct array handling | Use set(descObj, 'Characteristic', name, 'ForceShared', true) |
descObj.SupportStructureElements = false | Not a settable property after construction | Pass at creation: getEcuDescriptions(mdl, SupportStructureElements=false) |
VarAddress = '0x5000' (char vector) | Char vector silently produces empty output — no addresses, no criterion name | Must be string array: ["0x5000","0x5008"] |
CompuVTabValues.Integers = [0,1,2] | Property does not exist | Use CompuVTabValues.Values = [0, 1, 2] |
CompuVTabValues.Literals = {'A','B'} (cell array) | Accepted without error but exports 0 elements | Must be string array: ["A","B"] |
Skipping slbuild after setInport/setOutport | Export silently produces stale A2L with old settings | Always slbuild after code mapping changes before export |
Hardcoding EcuAddress = '0x0000' | Calibration tools cannot resolve the address at import time | Use '@ECU_Address@<elementName>@' for linker resolution |
| Leaving mandatory fields unset on new objects | Blank fields produce invalid A2L — calibration tools reject the file | See references/object-properties.md for required fields per class |
| Creating VarCriterion/VarCharacteristic without supporting CHARACTERISTICs | VARIANT_CODING references characteristics that don't exist — calibration tool rejects the file | Create selection CHARACTERISTIC (with TAB_VERB CompuMethod) and variant-dependent CHARACTERISTIC (with RecordLayout) BEFORE VarCriterion/VarCharacteristic. See references/variant-coding-guidance.md |
fileread after export — use contains for additions, ~contains for deletions/exclusionsgetEcuDescriptions() construction timeForceShared=true for STD→COM_AXIS (never build AXIS_PTS manually for this)delete(descObj, 'ElementType', 'Name') to remove auto-created placeholders — this is the only recovery from the auto-creation trap caused by set() on a reference name before the referenced object existscoder.mapping.api over coder.asap2 when settings should persist with the modelCopyright 2026 The MathWorks, Inc.
manifest.yaml (opens in a new tab)references/compu-method-guidance.md (opens in a new tab)references/construction-time-properties.md (opens in a new tab)references/customization-patterns.md (opens in a new tab)references/object-properties.md (opens in a new tab)references/variant-coding-guidance.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/simulink-author-classic-autosar-swcUse this skill when authoring, reworking, or validating a Classic AUTOSAR software component (SWC) in Simulink, including autosar.api mappings, runnables, timing events, sender-receiver ports, client-server operations, IRVs, BSW service callers, and component ARXML updates.
/simulink-configure-code-interfacesUse the skill to control and verify the code interface configuration of your model — how Simulink® model elements are represented in the generated C or C++ code. This includes — (1) specifying names, types (storage classes), and placement of variables that represent model elements (for example, making a model parameter tunable as a global extern variable); (2) specifying names, types, and placement of functions that represent model algorithms; (3) selecting the deployment type (Component, Subcomponent, or Automatic); (4) selecting the interface configuration type (data or service interface); (5) linking a shared Embedded Coder dictionary to a model; (6) creating Embedded Coder dictionary entries and setting their properties; (7) for service interface configuration — specifying service interface definitions, including sender, receiver, client, and server services. Items 1 and 2 can be set per element or as a category-wide default. Item 1 applies to GRT and ERT models; the rest to ERT models only./simulink-configure-model-for-code-generationConfigure Simulink models for Embedded Coder (ERT), Simulink Coder (GRT rapid-prototyping), or AUTOSAR code generation. Use when the user asks to generate embedded C or C++ code, run a full build of a model, produce a code generation report, configure a model for production/ECU deployment or rapid-prototyping code, target ARM or x86 hardware, apply a MISRA C/C++ code-generation profile (ERT/AUTOSAR only, not GRT), or set up GRT, ERT, AUTOSAR, or shared-library targets. Handles target selection, hardware mapping, model hierarchy propagation, and optional support-flag introspection. Do NOT use for GRT shared-library variants (grt_malloc.tlc), DDS, or ROS. Do NOT use for Simulink Real-Time/Speedgoat targets (simulink-configure-real-time-model), Classic AUTOSAR component mapping/ports/runnables/ARXML authoring (simulink-author-classic-autosar-swc), auditing a model against MISRA guidelines (checking-model-compliance), or iterative optimization of existing generated code (simulink-optimizing-embedded-code).
/simulink-optimizing-embedded-codeRoutes Embedded Coder workflows for Simulink models. Use when asked to optimize or improve generated code, reduce code metrics, author Code Replacement Libraries, or improve Embedded Coder output. Targets: execution time, memory (RAM, ROM, stack), code size, MISRA compliance. Works iteratively with measurement, gating, and rollback. Triggers: optimize generated code, reduce runtime, shrink code size, improve code efficiency, reduce memory, speed up generated code, MISRA compliance, author CRL. CAUTION: Do NOT optimize generated code without this skill — the gating and rollback workflow is essential./simulink-single-precision-conversionConverts a double-precision Simulink system or subsystem to single precision using DataTypeWorkflow.Single (Fixed-Point Designer). The single conversion replaces all user-specified double-precision data types, as well as output data types that compile to double precision, with single-precision data types. Use this skill when converting Simulink systems to single precision, reducing memory usage of a Simulink system, optimizing for embedded targets. Do NOT use for standalone MATLAB .m code single conversion./slci-compatibility-analysisUse when you need to verify a Simulink model is compatible with SLCI code inspection, or to apply fixes for identified incompatibilities. Checks model configuration, identifies incompatibilities, and explains why each constraint is required for verification. Also invoked by slci-inspection-incompatibility-analysis to fix constraints and obtain compatibility results. Trigger keywords: checkCompatibility, SLCI compatibility, code inspection readiness, Model Advisor compatibility report.
/code-generation:simulink-customize-a2lfrom code-generation
npx claudepluginhub matlab/simulink-agentic-toolkit --plugin code-generationOther plugins' skills for the same job