simulink-configure-model-for-code-generation
Configure Simulink models for Embedded Coder (ERT), Simulink Coder (GRT rapid-prototyping), or AUTOSAR code generation
Install / Use
npx skills add matlab/simulink-agentic-toolkit --skill simulink-configure-model-for-code-generationInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
OperationsSupported Platforms
Our assessment of simulink-configure-model-for-code-generation
simulink-configure-model-for-code-generation scores 85/100 on our quality scale, 491st of 726 Operations skills we index.
Its SKILL.md is 21 KB long, split into 6 sections with 1 code example: a thorough specification that gives an agent plenty to work with.
With 1,148 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 18 days ago, so simulink-configure-model-for-code-generation is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
simulink-configure-model-for-code-generation compared with similar skills
All 4 of these similar skills score higher than simulink-configure-model-for-code-generation; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| simulink-configure-model-for-code-generation (this skill)by matlab | 85 | 1.1k | 18d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 91.2k | 19d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.4k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 85.7k | today | MCP Server |
| crawl4aiby unclecode | 100 | 84.8k | today | MCP Server |
Frequently asked questions
- How do I install simulink-configure-model-for-code-generation?
- Run
npx skills add matlab/simulink-agentic-toolkit --skill simulink-configure-model-for-code-generation. The install tabs above show the steps for each supported agent. - Which AI agents does simulink-configure-model-for-code-generation work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is simulink-configure-model-for-code-generation safe to use?
- It declares no license and scores 88/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is simulink-configure-model-for-code-generation still maintained?
- The repository was last updated 18 days ago, so simulink-configure-model-for-code-generation is actively maintained.
Skill content
View source on GitHubname: simulink-configure-model-for-code-generation description: > Configure 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 MISRA C/C++ compliance (ERT/AUTOSAR only — Simulink Coder does not ship MISRA profiles), or set up GRT, ERT, AUTOSAR, or shared-library targets. Handles target selection, hardware mapping, model hierarchy propagation, and constraint introspection via the configure_for_codegen function. Do NOT use for GRT shared-library variants (grt_malloc.tlc), DDS, or ROS, or for iterative optimization workflows that measure baseline metrics, apply targeted changes, and re-measure to confirm improvement. license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md metadata: author: MathWorks version: "2.0.0"
Configure a Simulink Model for Code Generation
Configure Simulink models for Embedded Coder (ERT), Simulink Coder (GRT rapid-prototyping), or AUTOSAR code generation using the configure_for_codegen function.
When to Use
- User asks to configure a model for code generation, production deployment, Embedded Coder, or Simulink Coder rapid prototyping
- User mentions GRT, ERT, AUTOSAR, ARM, embedded target, production code, or rapid-prototyping code
- User asks for MISRA C or MISRA C++ compliance (ERT or AUTOSAR only — MISRA is not supported on GRT)
- User describes a deployment target in domain language ("deploy to ECU", "minimize flash", "rapid prototyping on a desktop target")
When NOT to Use
- Simulation-only tasks (running a model, tuning parameters, viewing signals)
- Data dictionary or bus object configuration (standalone, not as part of code-gen setup)
- Test harness creation or coverage analysis
- GRT shared-library variants (
grt_malloc.tlc+ manual-shared -fPIClinking) — no clean happy path; deferred out of scope - MISRA compliance on GRT (Simulink Coder does not ship MISRA profiles — pick ERT if MISRA is required) or AUTOSAR on GRT
- DDS (Data Distribution Service) or ROS targets
- Modifying or formatting generated code files after code generation
- Iterative optimization of generated code after configuration — measuring baseline metrics, applying targeted changes, and re-measuring to confirm improvement
Rules
-
Never expose the script's wrapper parameter names — describe the decision and its effect in domain terms. The
configure_for_codegenwrapper parameter names (ConfigOnly,Build,Interface,OutputDir,Compliance,Objective,Target,Hardware,Language) are an implementation detail of the script — they must never appear in text you show the user, and neither shouldname="value"syntax. This prohibition covers only the wrapper arguments. It does not restrict describing what the configuration does at the model or ConfigSet level: you may and should explain the engineering substance of each choice in domain terms. Combine both — name the decision, then describe its effect. Tier-1 decision phrasing (safe as-is): "configured the model but did not build", "used a nonreusable function interface", "optimized for speed", "placed generated code next to the model". Concept-level effect phrasing (also safe, and expected on cascade-driven decisions): "optimizing for speed enables an execution-efficiency cascade — strength reduction, inlined parameters, and removal of division-by-zero protection"; "a reusable function interface produces multi-instance/reentrant code that passes state by pointer"; "a MISRA C profile drives specific style rules — casting mode, signed shifts, unreachable-default suppression". Caution: prefer engineering-concept language over raw Simulink ConfigSet parameter identifiers — say "inlines parameters," not "setsInlineInvariantSignals"; say "removes division-by-zero protection," not "setsNoFixptDivByZeroProtection". This applies to defaults, confirmations, follow-up questions, and error paraphrasing — everywhere except the phrase-mapping table below (which is your internal lookup, not user-facing). -
Model must be open. The model must already be open in MATLAB before calling
configure_for_codegen. If it is not, open it directly withopen_system('<model>')viaevaluate_matlab_code— no separate skill is needed for this. -
Model must be saved to disk (or the user must supply a destination). The script writes generated code next to the model's
.slxfile. If the model is a freshnew_system/untitled window with no file on disk, the script cannot infer a location and returnssuccess:falsewith a message asking the user to save the model or supply an explicit output directory. Relay that message verbatim and ask the user which they prefer — never guess a location on their behalf, and never callsave_systemwithout permission (see "Do not save" rule below). -
Model must be compilable. The model and all its dependencies (data dictionaries, referenced models, bus objects, MATLAB path entries) must be resolvable in the current MATLAB session. If configuration fails due to missing dependencies, inform the user what is unresolved and ask them to fix the environment — do not attempt
addpathor other path manipulation on their behalf. -
Do not save; inform, then offer. The script does not call
save_systemand does not persist any bound data dictionaries. When configuration succeeds, explicitly tell the user nothing has been saved — model and dictionary changes exist only in memory, so they can review or discard freely. As a courtesy, ask whether they want to save now. Only save if the user says yes. Saving is outside the scope of this skill's core responsibility.- Name every file that would be saved. The script's JSON output includes a
pendingSavesfield listing the exact files whose in-memory state must be persisted for the configuration to reload correctly — always at least each configured.slx, plus any.slddwhen a model's active ConfigSet is a ConfigSetRef backed by a data dictionary (the script writes the applied settings into a new dictionary entry, and saving the.slxalone would persist a reference to an entry that is not yet on disk — on reload,get_param(model, 'SystemTargetFile')would fail with "Unable to get parameter ... from referenced configuration set ... in data dictionary."). - Save via the mechanism named by
kind. ReadpendingSavesfrom the script output, name every entry when offering to save, and — on user consent — save each file using the mechanism named in itskindfield (model→save_system,dictionary→Simulink.data.dictionary.open(...).saveChanges()). Never useSimulink.data.dictionary.saveAll; it would persist unrelated dictionaries that happen to be open in the session. If the user declines, save nothing.
- Name every file that would be saved. The script's JSON output includes a
-
All configuration is performed via
configure_for_codegen(in the skill'sscripts/directory), called throughevaluate_matlab_codewithproject_pathset toSKILL_DIR/scripts— whereSKILL_DIRis the absolute filesystem path this SKILL.md was loaded from. Do not guess a workspace-relative path (MCP rejects paths under.claude/); resolveSKILL_DIRto whichever absolute location the loader used. Do notaddpaththe user's model or dictionary folders — the script handles CWD/dictionary resolution internally and self-cleans. Passmodelas an open model name — with or without the.slx/.mdlextension; the script strips it either way (e.g.'mbasic'or'mbasic.slx'both work). The model must already be open (see rule above). The agent never callsset_paramdirectly. -
Resolve MISRA ambiguity in your response. "MISRA" alone is ambiguous — MISRA C and MISRA C++ are distinct standards. If the user says only "MISRA" without specifying, pick the one matching the source language (MISRA C for C, MISRA C++ for C++) and explicitly state the assumption in your final response — e.g., "Assuming MISRA C since the target language is C. Let me know if you meant MISRA C++."
-
State your inference for every required choice you didn't get verbatim from the user. The four required inputs — target framework, source language, hardware device, and optimization objective — must each either come directly from the user or be a silently-safe inference that you explicitly narrate back. Never expose the script's wrapper parameter names. Common inferences to narrate (same treatment as the MISRA ambiguity rule):
| User phrasing | Inferred choice | How to say it back | |---|---|---| | "embedded C", "production C" (no C++ mention) | source language = C | "Using C as the source language since you said 'embedded C' — let me know if you meant C++." | | "AUTOSAR" (bare, no Classic/Adaptive) | target = AUTOSAR Classic | "Using AUTOSAR Classic since you didn't specify — say the word if you meant AUTOSAR Adaptive." | | "embedded", "production", "ECU" (no shared-library / AUTOSAR / rapid-prototyping mention) | target = ERT executable | "Building for an ERT executable target — tell me if you want a shared library instead." | | "rapid prototyping", "GRT", "generate GRT code", "desktop test target", "HIL desktop target" | target = GRT | "Using the GRT rapid-prototyping target since you asked for rapid prototyping — this is Simulink Coder, not Embedded Coder. Tell me if you meant a production ERT build." | | "ARM Cortex-A", "Cortex-M4", "x86-64" (short form) | full hardware device string | "Mapped 'ARM Cortex-A' to the ARM Compatible ARM Cortex-A device — let me know if you meant a different variant." |
-
Ask one batched clarifying question for what you cannot safely infer — never guess silently. Among the four required inputs,
hardwareandobjectiveare never silently defaulted — the wrong device string picks the wrong word sizes and endianness, and the choice between speed, memory footprint, and step-through debuggability is a real engineering tradeoff the user must own.targetmay be inferred as ERT executable when the user says "embedded", "production", "ECU", or nothing target-related;languagemay be inferred as C in the same conditions. If either or both of hardware / objective is missing after the phrase-mapping pass, ask a single consolidated question naming exactly what you need, then proceed once. Do not ask one parameter at a time. Example: "To configure this I need two things: (1) which processor family — ARM Cortex-A, ARM Cortex-M, x86-64, PowerPC, or something else? (2) should I optimize for execution speed, memory footprint, or step-through debuggability (preserves block-to-code traceability)?" This is the one allowed exception to the "one call, not two" rule below — a single upfront clarifying question, then exactly one script call. -
Extract all parameters before the first call — one call, not two. Read the user's request once and map every phrase to a
configure_for_codegenparameter, then invoke exactly once. Making a second corrective call to add a parameter you forgot (e.g.ConfigOnly,Compliance,Build) is a rule violation. Common phrase mappings:| User phrase | Parameter | |---|---| | "just configure", "apply settings only", "prepare the model but don't generate code" |
ConfigOnly=true| | "codegen", "generate code", "generate the code but don't build/compile", "generate code without building an executable" | (no override — defaultsConfigOnly=false, Build=falsegenerate source without a toolchain build) | | "build it", "compile it", "generate and build", "produce an executable" |Build=true| | "MISRA" (bare) |Compliance="MISRA C"or"MISRA C++"perLanguage(see MISRA ambiguity rule) | | "speed", "fast", "execution efficiency" |Objective="Speed"| | "small f
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
91.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.4kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Scrapling
85.7k🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
crawl4ai
84.8kOpen-source web crawler and scraper for LLMs and AI agents: any website into clean, LLM-ready Markdown. Run it yourself, or use Crawl4AI Cloud with one key.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
