add-xapi-events-to-microsim
БесплатноЗапускает вложенные скриптыНе проверенUse when the user wants an existing MicroSim or chapter quiz to record what students do with it. Typical requests are "add xAPI events", "add tracking or…
от dmccreary★ 115 звёзд на GitHubОб этом скилле
Add xAPI Events to a MicroSim
Version: 0.2 (2026-09-26). This version folds in the lessons of the first whole-book batch, the 20 sims of eight-hour-entrepreneur.
What this skill does
This skill takes a MicroSim that already works and makes it report what the student did, as xAPI statements, without changing what the sim does. The per-sim code is a thin mapping, usually 20 to 60 lines, onto a shared runtime. It is never a copy of the runtime.
The runtime decides Full vs. Compact from config and builds every statement. It also enforces the producer contract and renders the teaching panel. Your job is to decide which interactions are evidence, of what, and for which concept, and then wire them up.
The canonical runtime and the four reference sims live in the learning-record-store
repo. Read them whenever this skill points at one; they are the ground truth.
LRS_REPO=~/Documents/ws/learning-record-store
$LRS_REPO/docs/js/lrs-sim.js the API a sim calls (its header comment is the contract)
$LRS_REPO/docs/js/lrs-config.js per-book identity + default policy (example)
$LRS_REPO/docs/sims/bouncing-ball/ p5, slider + Start/Pause (verified)
$LRS_REPO/docs/sims/sine-wave/ p5, three sliders (verified)
$LRS_REPO/docs/sims/scientific-method/ Mermaid, hover + pin, page dwell (verified)
$LRS_REPO/docs/sims/animal-cell/ image overlay, explore + quiz (verified)
$LRS_REPO/docs/js/quiz-xapi.js chapter quiz page, answers only (verified)
$LRS_REPO/docs/specs/xapi-producer-contract-v1.md the statement rules
Scripts are in this skill's scripts/ directory (SKILL_DIR below). The Python scripts
need only the standard library, except the two that drive a browser. Run those with
uv run --with playwright==1.58.0 python ....
Principles, and why they matter
- Instrument the act the sim was designed for. Don't record every act you can detect. The sim's own instructions tell you which act was designed ("Click a node to see details", "Hover over a marker or a label"). Hover is absent on touch devices, so hover-only evidence is biased by device, and device correlates with school funding. Record hover only when it is the designed act, or when click is simply how a touchscreen does the same thing (then they are one act; see animal-cell).
- Not every interaction is evidence. Mouse crossings (<600 ms hover), mis-clicks
(<250 ms runs), glances (<1 s page dwell), and events the program fires on itself
(autosize,
setView,rangechange) are noise. If you emit them, dashboards will believe them. - Answers are never folded. A checked answer (a quiz item, a checked prediction, a
goal reached) is its own
answeredstatement in both modes, emitted as it happens. Only exposure evidence folds into the Compact summary. BKT reads the order of attempts. - Mode and teaching UI come from config, never from the sim. The book's
docs/js/lrs-config.jssets the default for every sim. A sim'smetadata.jsonxapiblock overrides it for that one sim. Production sims show nothing. - Any instrumented sim can become a teaching aid for one visit. A reader who adds
?xapi=teachingto the page that embeds the sim sees its statement log, with no file edited. So a production sim's layout must still work with the panel showing. The runtime grows the iframe to fit the panel, but a layout that fills its frame (100vh, or html/body at 100%) defeats that. Pin such a layout while the panel is present. - Never edit the runtime or a vendored library.
docs/js/lrs-*.jsis identical in every book. A vendored file such asshared-libs/diagram.jsis shared by many sims. Wrap functions and add listeners beside the originals instead. If the runtime truly lacks something, uselrs.emit(spec), or stop and tell the user. - The sim must still run without the runtime. Teachers paste p5 sketches into the
p5.js editor. Guard every call site with
if (window.LRSSim)or a nulllrs.scripts/check-no-runtime.pyproves it (step 9).
Workflow
Work through these steps in order. Steps 2–4 are the thinking. Show the user the evidence table from step 3 before you write code whenever there is anything debatable, for example two input paths to one act, a canvas hit-test, or no matching concept.
Step 0 — Locate the book and the sim
The book root is the directory containing mkdocs.yml. The sim is
docs/sims/<sim-name>/, containing main.html (the iframe payload), index.md (the
lesson page that embeds it), and usually metadata.json. For a chapter quiz, the "sim"
is the rendered quiz page; go straight to references/adapters/quiz-page.md.
For a batch request ("instrument chapter 5's sims"), handle one sim at a time and keep a running table of results. Finish and verify each sim before starting the next.
A whole book at once (proven on the 20 sims of `eight-hour-entrepreneur
Установить add-xapi-events-to-microsim в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл add-xapi-events-to-microsim?
Use when the user wants an existing MicroSim or chapter quiz to record what students do with it. Typical requests are "add xAPI events", "add tracking or analytics", "make this sim feed the LRS or LRS-Lite", "instrument chapter 5's sims", or "what should this sim record?". Use it even if they never say "xAPI". Not for building a new MicroSim (use microsim-generator) or for LRS backend work.
Как установить скилл add-xapi-events-to-microsim?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-xapi-events-to-microsim запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
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…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic