egma-ai/egma/write-voice-agent-tests
Claude Code and agent skill by egma-ai/egma
- community
Checking that the SKILL.md file is still in the repository.
Write or edit tests for a voice agent that can run on the Egma platform.
Install
npx vskill@latest install egma-ai/egma/write-voice-agent-testsSKILL.md
First off, check if there's a newer version of this skill
Use npx skills update write-voice-agent-tests to update the project/global version of this skill installed on the developer's machine.
Writing tests for voice agents that can run on the Egma platform
An Egma Test describes one situation that a voice agent should handle and the expected behaviors that should hold during that situation. Tests are grouped inside Suites. Each Test runs once for every Persona named in it.
A Suite and its Tests do not store the Agent or Connection they run against. The Agent and Connection are selected later when starting a Run.
Currently, Egma supports these voice agents platforms - retell, livekit-agents (python/ js) framework & pipecat (python).
We need to do three things to create good tests:
- Find or create the Suite that should hold the Tests.
- Understand the voice agent and create appropriate tests for it.
- Write test files and push them to Egma.
1. Find or create the Suite
- First off, check whether
egma/config.yamlexists.
- If it does not exist, run
egma init. This initializes the repository and pulls its current Egma state. - If it already exists, run
egma pullbefore deciding whether a Suite needs to be created.
- Every direct directory under
egma/tests/is one Suite. Itssuite.yamlfile holds the Suite ID and display name.
- If the correct Suite already exists, use it.
- If a new Suite is needed, create it through the CLI:
egma suite create appointment-booking --name "Appointment booking"
2. Understand the voice agent and decide the tests
This is one of the most crucial step. Here you should read the voice agent’s prompt, tools, the overall harness that makes this voice agent behave the way it does (example multiple subagents, context strategies, etc) and any crucial metadata the voice agent should have before a production session startup path before writing Tests such as organisation name, tenant ID, locale, or agent configuration.
Important concepts to know before writing them:
A. One Test is one situation
- Write the Scenario as a situation that a real human might find themselves in while speaking with the voice agent being tested.
- Each Test should cover one clear situation. For example, “call the recepionist to book an appointment at medspa "ABC" but ask for a specific provider "XYZ" and be flexible around dates but you don't know which treatment is right for your skin and so first you'd like to discuss some options but you're someone who's not very decisive". Replace with actual values that you infer from calling the tools attached to this voice agent.
B. Each scenario has one or more personas
- A persona is just a digital human who is enacting the scenario. Different personas have different characteristics. Creating new personas is out of scope for this skill but use one of the default personas. you can run
egma persona listfind the available persona names/ their IDs. If several personas could be appropriate, choose one or two most appropriate by default.
C. Expected behaviors
- An expected behavior is simply a lens through which an LLM based grader should look at the entire transcript of a simulation and determine whether that expected behavior is actually observed or not. Each expected behavior should be a binary 0/1 decision for the LLM grader. This of an expected behavior like an assertion in classical testing.
- Each behavior should make one clear claim. What these behaviors should be must be grounded in the voice agent’s actual prompt, harness, tools, and the product requirements to the best of your knowledge.
- Usually aim to write around three or four expected behaviors for one Test. Split unrelated requirements into separate Tests.
D. Mock tools
- You can add mock tools to a test when you don't want real writes to happen or want to use a controlled backend state. Egma supplies mock tools to the vocie agent of supported platforms and leaves any tools whose mocks were not supplied as it is. For example, you might want to read real availability slots / provider info for a appointment booking voice agent but don't want to create fake appointments in prodution CRM systems.
- To create a mock tool, use the exact tool name supplied to the agent and the same response shape that the real tool returns. A Mock Tool contains exactly one of the following in its result json that will be supplied to the agent during simulation
answerfor a successful resulterrorfor a failed/erronous result- If egma tests are being written in this repo for the first time - err on the side of writing mocks for write tools. If the agent has only read tools, mock atleast one read tool. If the agent has no tools, you can skip writing mocks.
- For livekit agents, you will need to setup the agent with egma sdk in order to use mock tools. egma has support for livekit-agents python and js/ts with dedicated sdks. Refer Egma livekit python package or Egma livekit js sdk for info on how to setup the agent code to listen for mock tools.
- For pipecat bots, the egma sdk line
await simulation(worker, runner_args)fromegma.pipecatanswers mock tools; see the Pipecat Python SDK guide. Mock any tool the bot's LLM can call, whether it was registered withregister_functionor given in the LLM context. - Never mock a Pipecat Flows function (a function whose handler comes from
pipecat.flows). Egma does not mock Flows functions, and a simulation whose test mocks one fails when the flow first offers that function. Unmocked Flows functions run for real and are recorded, so write behaviors about them instead.
E. Session initiation data
- Many agents need per-session context and certain dynamic variables supplied before they speak even a single word - such as an organisation name which they represent, tenant ID, or some other agent configuration needed for the agent to do its job properly in production. Egma provides a way to supply this data for each simulation so that it is as close to the agent's production behavior as possible.
- To find what dynamic variables / job dispatch metadata/ inbound webhooks etc that the agent being tested depends on - carefully look at its code and setting. Inspect the agent’s entrypoint, the normal path it goes through before speaking anything and identify which variables need to be supplied in the simulation. Once you have the required session initiation metadata needed, you can use the
## Envsection of each test to supply curated data that makes the most sense for that test. - For each of the supported agent platforms, egma has a specifc field in its env json that it supplies.
- If the agent is based on retell - use
retell_dynamic_variablesin the env section to supply any inbound webhook and dynamic variables data used by the agent. Egma passes it as is to the retell agent as its dynamic variables. - If the agent is based on livekit, use a
job_dispatch_metadatain the env section. for values the LiveKit agent reads fromctx.job.metadata. Make sure the code of the livekit agent is able to read the needed data fromctx.job.metadata. If the agent must detect whether its running in an Egma simulation, you can add a check whenctx.room.namestarts withegma-sim-. - If the agent is based on pipecat, use
pipecat_body_paramsin the env section for values the bot reads fromrunner_args.body(for examplerunner_args.body.get("tenant")). It is a JSON object and its values can be any JSON (not only strings). Egma merges it into thebodyof the start request it sends for each simulation, the same body a production client sends, so the bot reads it exactly as in production. - The key
egmainsidepipecat_body_paramsis reserved: Egma adds its ownegmakey to every start request, and a test that holds one is refused onegma push. Name the key something else. - The object can be at most 512 KiB once serialized. Put a large value in the developer's own store and pass its id instead.
- Do not use the
egmakey to detect a simulation in the bot; the egma SDK handles it. - Finally, use realistic, non-secret values to pass in the env section. Ask the developer only when a required value cannot be found or safely inferred. Use the default test orgs that usually the developer uses while iterating on the voice agent themselves.
3. Write the Test files and push them
You can now actually start writing the tests. A test can be created by simply creating a new md file in a suite directory. Once all tests are created, push them to the platform using egma push.
A test file should look like this:
{ "answer": { "slots": [ "Wednesday 15:00", "Wednesday 16:30" ] } }
{ "retell_dynamic_variables": { "clinic_name": "Youth Medspa, Walnut Creek branch", "assistant_name": "Emily" }, "job_dispatch_metadata": { "clinic_name": "Youth Medspa, Walnut Creek branch", "assistant_name": "Emily" }, "pipecat_body_params": { "clinic_name": "Youth Medspa, Walnut Creek branch", "assistant_name": "Emily" } }
The above example shows retell_dynamic_variables, job_dispatch_metadata & pipecat_body_params only for reference. In reality, you should only supply the field corresponding to the platform the agent is built on.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/write-voice-agent-tests/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/egma-ai/egma/write-voice-agent-tests)