SkillAgentSearch skills...

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-generation

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

85/100

Category

Operations

Supported Platforms

Universal

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.

Substance
30/30
Structure
15/20
Description
12/15
Adoption
13/20
Freshness
15/15

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.

SkillScoreStarsUpdatedFormat
simulink-configure-model-for-code-generation (this skill)by matlab851.1k18d agoSKILL.md
Agent-Reachby Panniantong10091.2k19d agoCLAUDE.md
headroomby headroomlabs-ai10074.4ktodayCLAUDE.md
Scraplingby D4Vinci10085.7ktodayMCP Server
crawl4aiby unclecode10084.8ktodayMCP 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.

name: 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 -fPIC linking) — 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_codegen wrapper 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 should name="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 "sets InlineInvariantSignals"; say "removes division-by-zero protection," not "sets NoFixptDivByZeroProtection". 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 with open_system('<model>') via evaluate_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 .slx file. If the model is a fresh new_system/untitled window with no file on disk, the script cannot infer a location and returns success:false with 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 call save_system without 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 addpath or other path manipulation on their behalf.

  • Do not save; inform, then offer. The script does not call save_system and 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 pendingSaves field 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 .sldd when 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 .slx alone 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. Read pendingSaves from the script output, name every entry when offering to save, and — on user consent — save each file using the mechanism named in its kind field (model → save_system, dictionary → Simulink.data.dictionary.open(...).saveChanges()). Never use Simulink.data.dictionary.saveAll; it would persist unrelated dictionaries that happen to be open in the session. If the user declines, save nothing.
  • All configuration is performed via configure_for_codegen (in the skill's scripts/ directory), called through evaluate_matlab_code with project_path set to SKILL_DIR/scripts — where SKILL_DIR is the absolute filesystem path this SKILL.md was loaded from. Do not guess a workspace-relative path (MCP rejects paths under .claude/); resolve SKILL_DIR to whichever absolute location the loader used. Do not addpath the user's model or dictionary folders — the script handles CWD/dictionary resolution internally and self-cleans. Pass model as an open model name — with or without the .slx/.mdl extension; 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 calls set_param directly.

  • 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, hardware and objective are 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. target may be inferred as ERT executable when the user says "embedded", "production", "ECU", or nothing target-related; language may 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_codegen parameter, 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 — defaults ConfigOnly=false, Build=false generate 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++" per Language (see MISRA ambiguity rule) | | "speed", "fast", "execution efficiency" | Objective="Speed" | | "small f

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars1.1k
CategoryOperations
Updated18d ago
Forks106

Languages

HTML

Trust signals

88/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 medium