
simulink-customize-a2l
Customize A2L (ASAP2) files generated from Simulink models using coder.asap2 and coder.mapping APIs. Use this skill when adding COMPUMETHODs, creating GROUPs, converting STDAXIS to COMAXIS, adding BITOPERATIONs, creating VARIANTCODING, excluding measurements or struct elements, removing DEFAULTEVENTLIST, or any A2L customization for calibration tool compatibility (INCA, CANape). Also use when the user mentions ASAP2, ECU calibration data, A2L export.
- Installs
- 0
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-customize-a2l- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads simulink-customize-a2l automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Customize A2L Files
Customize A2L (ASAP2) files generated from Simulink models using the coder.asap2 and coder.mapping APIs, avoiding silent errors and undocumented pitfalls.
When to Use
- Adding or modifying COMPU_METHODs (LINEAR, RAT_FUNC, TAB_VERB, IDENTICAL)
- Creating or modifying GROUPs in the A2L file
- Converting STD_AXIS to COM_AXIS for lookup tables
- Adding BIT_OPERATION (LEFT_SHIFT, RIGHT_SHIFT, SIGN_EXTEND) to measurements
- Creating VARIANT_CODING (VarCriterion, VarCharacteristic)
- Excluding inports, outports, or struct elements from the A2L
- Removing DEFAULT_EVENT_LIST or other IF_DATA blocks
- Any customization passed via
CustomEcuDescriptionstocoder.asap2.export
When NOT to Use
- Reading or parsing existing A2L files (use Vehicle Network Toolbox
a2lfile) - Configuring XCP/CAN transport layers
- Setting up Simulink model code generation (storage classes, data dictionaries)
- General Embedded Coder build workflows without A2L customization
Core Workflow
Decision: Direct export vs. customization workflow
- No element customization needed (only configuration like excluding struct elements or DEFAULT_EVENT_LIST): call
coder.asap2.exportdirectly with name-value options. NogetEcuDescriptionsneeded. - Element customization needed (adding/modifying/deleting measurements, characteristics, groups, etc.): use the full
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.
Key Functions
| 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.
Pattern Routing
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 |
Release Requirements
| 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.
Common Mistakes
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 |
Conventions
- Verify A2L output with
filereadafter export — usecontainsfor additions,~containsfor deletions/exclusions - Use string arrays (not char vectors or cell arrays) for all multi-value properties
- Pass all configuration at
getEcuDescriptions()construction time - Use
ForceShared=truefor STD→COM_AXIS (never build AXIS_PTS manually for this) - Use
delete(descObj, 'ElementType', 'Name')to remove auto-created placeholders — this is the only recovery from the auto-creation trap caused byset()on a reference name before the referenced object exists - Prefer
coder.mapping.apiovercoder.asap2when settings should persist with the model
Copyright 2026 The MathWorks, Inc.
FAQ
What does the simulink-customize-a2l skill do?
Customize A2L (ASAP2) files generated from Simulink models using coder.asap2 and coder.mapping APIs. Use this skill when adding COMPUMETHODs, creating GROUPs, converting STDAXIS to COMAXIS, adding BITOPERATIONs, creating VARIANTCODING, excluding measurements or struct elements, removing DEFAULTEVENTLIST, or any A2L customization for calibration tool compatibility (INCA, CANape). Also use when the user mentions ASAP2, ECU calibration data, A2L export.
How do I install simulink-customize-a2l?
Run npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-customize-a2l in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/simulink-customize-a2l/ (personal) or .claude/skills/simulink-customize-a2l/ (project).
Which AI agents can use simulink-customize-a2l?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is simulink-customize-a2l safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains simulink-customize-a2l?
It is published by matlab in matlab/simulink-agentic-toolkit. It has 0 recorded installs.
More from matlab/simulink-agentic-toolkit
building-simulink-models
matlab/simulink-agentic-toolkit
Builds and edits Simulink, System Composer, Stateflow, and Simscape models. Use when modifying model structure, parameters, ports, connections, or Stateflow chart internals.
simulating-simulink-models
matlab/simulink-agentic-toolkit
Configures Simulink simulations non-destructively using SimulationInput objects — parameter overrides without modifying the model, batch sweeps via parsim, custom input signals via Dataset, and simulation data retrieval via logsout. Use when running sim()/parsim() with setVariable, setBlockParameter, setExternalInput, or when performing parameter sweeps and multi-run analysis. Not needed for one-shot simulations without configuration.
testing-simulink-models
matlab/simulink-agentic-toolkit
Tests Simulink models using either ephemeral Gherkin-based tests (modeltest) for quick validation or persistent tests (Simulink Test API) authored from requirements or behavioral specs. Requires Simulink Test.
specifying-plant-models
matlab/simulink-agentic-toolkit
Specify plant models for closed-loop simulation: system specs, architecture, build plans, validation plans. Use when creating, updating, or reviewing plant model specifications, planning plant model architecture, or planning plant model validation.
specifying-mbd-algorithms
matlab/simulink-agentic-toolkit
Specify algorithms for Model-Based Design: system specs, architecture specs, implementation plans, test plans. Use when creating specifications for controllers, signal processing, diagnostics, estimators, or other algorithms authored in Simulink, Stateflow, System Composer, or MATLAB Function blocks.
generate-requirement-drafts
matlab/simulink-agentic-toolkit
Generates draft requirements from Simulink models. Use when drafting or updating requirement artifacts from a model. Prefers Requirements Toolbox (.slreqx) when available; falls back to structured YAML.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available