About livekit-simulations
A skill for generating and running simulation scenarios for LiveKit agents, aimed at developers testing conversational agents. It builds a risk checklist from local code and user priorities, then requires scenario coverage for each risk; simulations are currently in private beta.
Key features
- 01Read agent code locally without uploading it
- 02Build an explicit checklist from agent constraints
- 03Write scenarios guided by the user's test focus
- 04Require at least one scenario for every risk
- 05Assemble YAML configuration and run simulations
Use cases
- 01Test agent behavior when required information is missing
- 02Check handling of invalid input and empty lookups
- 03Verify guardrails against out-of-scope or harmful requests
- 04Rerun regression scenarios after prompt, model, or tool changes
MCP support
The skill states that simulations are not yet documented and have no MCP coverage; consult `lk agent simulate --help` for the command surface. It recommends using the LiveKit MCP server only after simulations are documented.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ livekit/ agent-skills --skill livekit-simulationsAfter installing, type/livekit-simulationsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/analyzing-the-agent.mduser-guidance.mdwriting-scenarios.mdscripts/build_scenarios.pyDetails
From the project README⚠️ Simulations are in private beta (not yet generally available).
- No docs/MCP coverage yet. For the
lk agent simulatecommand surface, uselk agent simulate --helpand the LiveKit Cloud dashboard rather thanlk docs/ MCP until simulations are documented.- Recent SDK required. Running simulations needs the 1.6 line of
livekit-agents. Confirm the installed version rather than assuming.- Limited availability / auth. Creating runs needs the project enabled for simulations and a current
lk cloud authsession. (Generating scenarios — the main job of this skill — needs neither; it's fully local.)
Generating Simulation Scenarios
The most valuable thing you can do with simulations is generate good test scenarios for the user's agent — grounded in the agent's actual code and in what the user wants stress-tested — then run them. You do this locally: you read the code with your normal tools (nothing is uploaded), and you (the coding agent) are the model that does the generation, so no extra API keys or services are needed.
A scenario = a simulated user's persona + goals (instructions) and the pass criteria (agent_expectations). A simulation plays each scenario against the agent over text and an LLM judge scores it. Your job is to produce a high-quality, diverse, on-target set of scenarios and write them to a YAML scenarios file the CLI can run.
What makes this better than autopilot
A naive "just generate some tests" misses the point. Three things make this skill worth using:
- It reads the agent's real code — so scenarios respect what the agent can actually do and where it blocks (especially constraints/unavailable items), instead of guessing from the name.
- It is steered by the user. The user knows what they're worried about. Always capture that intent and thread it through. This is the headline — see
references/user-guidance.md. - It guarantees coverage of every risk. Left alone, generation drifts to plausible happy-path calls and silently skips the hard cases — withholding a required field, supplying an invalid value, an empty lookup, and the guardrail/abuse surface (out-of-scope, harmful, professional-advice, sensitive-data, prompt-extraction). This skill turns the agent's constraints into an explicit risk checklist and requires at least one scenario per item — see
references/analyzing-the-agent.mdandreferences/writing-scenarios.md.
The flow
- Describe the agent + build the risk checklist — read its code locally and write a test-oriented description (Identity / Capabilities / Constraints) to
description.md, and an explicit risk checklist torisks.yaml(one entry per must-test constraint/guardrail, each with anidandcategory). Followreferences/analyzing-the-agent.md. Never upload the code. - Get the user's test focus — if they didn't say what to probe, ask. Apply it per
references/user-guidance.md(append a# Test Focustodescription.md, and bias authoring). Focus is additive — it deepens chosen risks but never drops the per-risk coverage floor. If they truly have no preference, generate broad and say so. - Author the scenarios — at least one per risk — write a diverse set of ~10 scenarios grounded in
description.mdand the focus, generating the persona / mood / situation variety from your own judgment (this version ships no attribute libraries). Guarantee coverage: everyrisks.yamlitem gets ≥1 dedicated scenario, written with the shape that actually exercises it, and tagged withcovers: [<risk id>, …]. Followreferences/writing-scenarios.md(schema, the "Party A talks to the agent" rules, no prior state, no real PII, outcome-based expectations, the adversarial-shape taxonomy, the coverage check, don't write bad tests). Write them toauthored.yaml. Add any user-pinned must-tests here too. - Assemble the config (coverage-enforced) —
python scripts/build_scenarios.py assemble --in authored.yaml --agent-description-file description.md --risks risks.yaml --strict --out scenarios.yaml(validates the schema, fails if any risk is uncovered, and emits the YAML scenarios filelk agent simulate --scenariosloads). Fix gaps and re-run until it passes. - Run it —
lk agent simulate --scenarios scenarios.yaml(confirm exact flags with--help; needs the SDK/auth noted in the beta block). Show the user the results and offer to re-roll, re-focus, or add scenarios.
Reuse saved scenarios.yaml files as a regression suite — re-run them after prompt/model/tool changes.
Principles
- Never upload the user's code. Reading it locally is the point; it's their IP.
- The user's intent is the differentiator — incorporate it every time; don't silently autopilot.
- Ground every scenario in the description, especially Constraints — a scenario the agent can't possibly satisfy (or a guardrail it should refuse) must have expectations that reflect that.
- The script is deterministic glue; you are the generator. Let
build_scenarios.pyhandle assembly + the coverage check; you do the reading, the judgement, the diversity, and the authoring.
Verify, don't invent (freeze-forever)
This skill is the method (no bundled libraries — you supply diversity yourself). The exact lk agent simulate flags, the CI wait/fail flag, the minimum SDK version, and the dashboard come from live sources because they change — use lk agent simulate --help and (post-beta) lk docs / the LiveKit MCP server. A wrong flag wastes a run; look it up rather than guessing.
After running: acting on results (secondary)
Once a run completes, read the per-scenario pass/fail, the run summary, and the transcripts of failures. Fix the agent where a failure is real (and re-run); recognize when a failure is actually a bad scenario and fix the scenario instead. Keep this lightweight — modern models are already good at the fix step; the durable value of this skill is the scenarios you generate and keep.