TopRank Skills

Home / Claw Skills / Data Analysis / science-sim-author
Official OpenClaw rules 36%

science-sim-author

Generate self-contained interactive science simulations as a single index.html from a SimSpec YAML or JSON. Use when the user asks for physics, chemistry, biology, STEM, science education, classroom demos, virtual labs, PhET-style activities, mechanics simulations, circuit simulations, parameter sliders, plots, inquiry worksheets, or offline canvas-based teaching tools.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 science-sim-author 技能。 若已安装,则直接安装 science-sim-author 技能。

Overview

Skill Key
dimgouso/science-sim-author
Author
dimgouso
Source Repo
openclaw/skills
Version
-
Source Path
skills/dimgouso/science-sim-author
Latest Commit SHA
1d54e279f96b76de26740addd9ae2ac8892a6a48

Extracted Content

SKILL.md excerpt

# Science Simulation Author

## Core promise

Generate one self-contained `index.html` that runs offline, renders a STEM simulation on a 2D canvas, exposes model parameters as sliders, plots a time series, and includes an inquiry worksheet.

## Inputs

Accept a SimSpec in YAML or JSON with:

- `id`, `title`, `domain`
- `state`, `params`, `initial`, `equations`, `outputs`
- optional `level`, `dt`, `worksheet`, `success_criteria`

Validate against [templates/sim_spec_schema.json](templates/sim_spec_schema.json) before generating anything.

## Output contract

- Produce exactly one file named `index.html`.
- Keep all CSS in `<style>` and all JS in `<script>`.
- Do not use bundlers, package managers, CDNs, external fonts, or runtime network access.
- Include these DOM ids: `simCanvas`, `plotCanvas`, `runToggle`, `stepBtn`, `resetBtn`, `dtSlider`, `paramControls`, `readouts`, `statusBanner`, `worksheet`, `copyJsonBtn`, `downloadCsvBtn`.
- Include controls, readouts, one time-series plot, local JSON snapshot export, local CSV download, and a non-empty worksheet.

## Workflow

1. Validate the incoming SimSpec against [templates/sim_spec_schema.json](templates/sim_spec_schema.json).
2. Normalize the spec:
   - If `dt` is missing, use `default=0.01`, `min=0.001`, `max=0.05`.
   - If a parameter omits `step`, derive `step=(max-min)/100` with sensible rounding.
   - Normalize derivative aliases such as `dx`, `dy`, `dvx`, `dvy`, `dq`, `dvc` to canonical `d<stateName>` keys before generating JS.
   - Default readouts to `t` plus every state variable in state order.
3. Choose the renderer:
   - `mechanics` + state includes `x` and `y` -> `trajectory2d`
   - `mechanics` + state includes `x` and `v` -> `oscillator1d`
   - `electromagnetism` + state includes `q` or `vc` -> `circuit_rc`
   - Otherwise stop and ask the user for a clearer SimSpec instead of guessing.
4. Populate [templates/sim_single_file_html_template.html](templates/sim_single_file_html_template.html) with pre-normal...

Related Claw Skills