# Roadrunner Build Scenario From Osc

Build a RoadRunner Scenario programmatically from an OpenSCENARIO 1.x (.xosc) file...

- Repository: https://github.com/matlab/matlab-agentic-toolkit (1237 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-27
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-build-scenario-from-osc -g -a claude-code -y`
Codex: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-build-scenario-from-osc -g -a codex -y`
Cursor: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-build-scenario-from-osc -g -a cursor -y`
Gemini CLI: `npx skills add matlab/matlab-agentic-toolkit --skill roadrunner-build-scenario-from-osc -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add matlab/matlab-agentic-toolkit`

## Description

Build a RoadRunner Scenario programmatically from an OpenSCENARIO 1.x (.xosc) file using the `roadrunner-scenario-authoring` skill. Use when the user wants to recreate a scenario from a .xosc file, interpret an OpenSCENARIO file and build it programmatically, reconstruct a .xosc as a RoadRunner scenario, generate a MATLAB script from a .xosc file, or convert an OpenSCENARIO file to MATLAB code. Do NOT use when the user says "import" a .xosc file, that means they want RoadRunner's built-in importScenario API, not programmatic reconstruction. Handles position translation (LanePosition and RoadPosition to world coordinates), construct mapping, relative references, trajectory/route handling, parameter expressions, catalog references, and phase logic topology.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Build RoadRunner Scenario from OpenSCENARIO

Interpret an OpenSCENARIO 1.x (.xosc) file and recreate the scenario in
RoadRunner using the `roadrunner-scenario-authoring` skill. Translates positions,
maps constructs, preserves relative references, and builds correct phase logic.

## When to Use

- User has a .xosc file and wants to recreate it in RoadRunner
- User wants to programmatically build a scenario from OpenSCENARIO
- User says "build this .xosc in RoadRunner" or "recreate this scenario"
- User has an OpenSCENARIO file from a partner or standards body (e.g., Euro NCAP, ALKS)
- User wants to generate a MATLAB script from a .xosc file
- User says "convert this xosc to matlab" or "recreate with a matlab script"

## When NOT to Use

- User says "import" a .xosc file, they want `importScenario(rrApp, xoscPath)`, not this skill. Simply call the API directly.
- User wants to use RoadRunner's built-in `importScenario` (let them, it works for simple cases)
- User wants to create a scenario from scratch **without** a .xosc file (use `roadrunner-scenario-authoring`)
- User wants to export a scenario TO OpenSCENARIO (use `roadrunner-export-scenario`)

## Critical Rules

1. **Never fabricate actions or conditions not present in the source XOSC.**
   If a construct cannot be mapped, skip it and warn the user.

2. **Never propose workarounds.** Do not replace DistanceToPointCondition with
   DurationCondition, do not substitute SimulationTimeCondition for unsupported
   triggers, do not add any construct not in the source.

3. **Never simplify or duplicate trajectory vertices.** Extract exactly the
   polyline vertices present in the source XOSC, no fewer, no more. Do not
   reduce 90 vertices to 5. Do not duplicate start/end points during extraction.

4. **Never guess scenes.** Only report the .xodr filename from `<LogicFile>`.
   Import it, do not search for a scene with a similar name.

The rest: https://github.com/matlab/matlab-agentic-toolkit/blob/HEAD/skills-catalog/automotive/roadrunner-build-scenario-from-osc/SKILL.md
