agentleFS
thunderphonethunderphone/skills/test-agent/SKILL.md

test-agent

Skill0 starsChanged 57 days agoMITView on GitHub

Test, grade, debug, and improve a ThunderPhone agent in a closed loop. Use when someone asks to generate scenarios, execute test runs, call /v1/simulations, use legacy test calls, inspect transcripts or grades, fix a prompt after failures, or decide whether an agent is ready to deploy.

  • Reads credentials
  • Sends data out

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Fix the smallest general rule: Prefer deleting, clarifying, or generalizing a prompt principle.

    line 70
  2. Distinctive:

    Every required criterion passes on the intended deployed revision.

    line 82
  3. Distinctive:

    No high-impact failure is hidden by an average score.

    line 83
  4. Distinctive:

    Follow test agents and simulate a call.

    line 100
  5. Distinctive:

    Do not use real customer data or unconsented recipients in tests.

    line 102
  6. Distinctive:

    Do not infer audio, ASR, latency, connection, tool, or legal success from synthetic text alone.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test an agent in a closed loop

  1. Name the behaviors. Define pass criteria for greeting, task completion, facts, language, tools, handoff, consent, interruptions, recovery, and call ending. Separate text, audio, latency, connection, and legal claims.
  2. Generate candidate scenarios with POST /v1/agents/{agent_id}/test-scenarios/generate. Review them; add edge cases and remove scenarios that do not match the business.
  3. Execute the saved set with POST /v1/agents/{agent_id}/test-runs/execute, then poll GET /v1/agents/{agent_id}/test-runs/{batch_id}.
{
  "channel": "web",
  "scenario_ids": [311, 312],
  "consent_to_charge": true
}
curl --fail-with-body -X POST "https://api.thunderphone.com/v1/agents/$AGENT_ID/test-runs/execute" \
  -H "Authorization: Bearer $THUNDERPHONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-ThunderPhone-Client: skills/test-agent@1.0" \
  --data-binary @test-run.json
import json, os, requests

with open("test-run.json", encoding="utf-8") as f:
    payload = json.load(f)
url = f"https://api.thunderphone.com/v1/agents/{os.environ['AGENT_ID']}/test-runs/execute"
r = requests.post(url, json=payload,
    headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}",
             "X-ThunderPhone-Client": "skills/test-agent@1.0"}, timeout=30)
r.raise_for_status()
print(r.json())
import { readFile } from "node:fs/promises";
const body = await readFile("test-run.json", "utf8");
const response = await fetch(`https://api.thunderphone.com/v1/agents/${process.env.AGENT_ID}/test-runs/execute`, {
  method: "POST", headers: { Authorization: `Bearer ${process.env.THUNDERPHONE_API_KEY}`,
    "Content-Type": "application/json", "X-ThunderPhone-Client": "skills/test-agent@1.0" }, body,
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
  1. Use the right execution surface. POST /v1/simulations is the canonical simulation API. POST /v1/test-calls remains available for older test-call workflows. Use real controlled audio calls for ASR, pronunciation, pacing, interruption, telephony, latency, and end-of-call evidence.
  2. Read evidence, not only scores. Inspect failed criteria, transcript turns, tool inputs/results, timing, call status, and audio where relevant. A text transcript cannot establish what was audible.
  3. Fix the smallest general rule. Prefer deleting, clarifying, or generalizing a prompt principle. Do not add a caller-response script for each failure. Fix tool contracts or knowledge sources at their source.
  4. Rerun the same scenarios, then add a regression case. Compare the exact agent revision and configuration used by both runs.

For an agent that already takes calls, the iterate-on-agent skill turns its real calls into dev and test sets and replays them against each prompt edit.

What a good pass looks like

  • Every required criterion passes on the intended deployed revision.
  • No high-impact failure is hidden by an average score.
  • Tools show verifiable success and safe failure behavior.
  • Audio-specific claims have audio evidence; connection and latency claims have telemetry.
  • The regression scenario fails before the fix and passes after it.
  • A separate controlled test covers production integrations and phone routing.

Errors

SymptomCauseFix
Batch never reaches terminal stateWorker or dependency is delayedPoll with backoff and inspect the batch error before rerunning.
Test passes but live call failsSimulation omitted audio, carrier, or live integration behaviorAdd an end-to-end controlled call and inspect live telemetry.
Each fix creates another exceptionPrompt is accumulating scriptsReplace branches with a general principle and verified facts.
Results cannot be comparedAgent revision or scenario set changed silentlyRecord revision, scenario IDs, configuration, and batch ID.

Source and safety rules

  • Follow test agents and simulate a call.
  • Confirm API behavior in test calls and test scenarios.
  • Do not use real customer data or unconsented recipients in tests.
  • Do not infer audio, ASR, latency, connection, tool, or legal success from synthetic text alone.

See references/test-matrix.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.