agent-testing-patterns

agent-testing-patterns is a skill for Claude Code from organvm-iv-taxis/a-i--skills. It costs 58 tokens per session (1,840 once invoked), scanned A, original, Apache-2.0.

A guide to testing AI agents—software systems that use language models, tools, and conversations to complete tasks. It covers tests for tool calls, multiple conversation turns, error recovery, and outputs that may vary between runs.

In plain words
What is it for?
Use it to create unit, integration, and end-to-end tests, mock model calls, check tool use and conversation state, and build regression checks for agent workflows.
Why use it?
It helps you test agent behaviour without relying on exact wording, while also controlling the cost, delay, and flakiness of tests that call language models.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the example-skills plugin — 47 skills, 2 commands, 1 agent shipped together

Good fit Use it to create unit, integration, and end-to-end tests, mock model calls, check tool use and conversation state, and build regression checks for agent workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add organvm-iv-taxis/a-i--skills --skill agent-testing-patterns
Clone the repo
git clone --depth 1 https://github.com/organvm-iv-taxis/a-i--skills

Made for: Claude Code.

Or install example-skills, the plugin that ships this one along with the rest of its 47 skills, 2 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-testing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns/github.svg)](https://agentmods.dev/skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns)
Your own site
<a href="https://agentmods.dev/skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns"><img src="https://agentmods.dev/badge/skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-testing-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns"><img src="https://agentmods.dev/badge/skills/organvm-iv-taxis/a-i--skills/agent-testing-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,840 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01840
Opus 5 $0.00029 $0.00920
Sonnet 5 $0.00012 $0.00368
Haiku 4.5 $0.00006 $0.00184

Measured 11d ago against content hash 3172e1017a0b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

agent-testing-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

distributions/claude/skills/agent-testing-patterns/SKILL.md · 244 lines

How it starts

The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Testing Patterns

Test AI agent systems that use tools, make decisions, and produce non-deterministic outputs.

Testing Challenges

Challenge Cause Strategy
Non-deterministic output LLM randomness Assert on structure, not exact text
Tool use sequences Agent autonomy Verify tool calls, not call order
Multi-turn state Conversation context Snapshot-based assertions
Cost API calls Mock LLM in unit tests
Latency API round-trips Parallel test execution
Flakiness Model updates Semantic assertions, not string matches

Test Pyramid for Agents

        ╱╲
       ╱  ╲        E2E Agent Tests (few, expensive)
      ╱────╲       Full agent loop with real LLM
     ╱      ╲
    ╱────────╲     Integration Tests (moderate)
   ╱          ╲    Tool execution, state management
  ╱────────────╲
 ╱   Unit Tests ╲  Tool implementations, parsers, validators
╱────────────────╲

Unit Testing (No LLM)

Tool Implementation Tests

import pytest

def test_file_read_tool():
    tool = FileReadTool()
    result = tool.execute({"path": "test.txt"})
    assert result["content"] == "expected content"
    assert result["success"] is True

def test_file_read_tool_missing_file():
    tool = FileReadTool()
    result = tool.execute({"path": "nonexistent.txt"})
    assert result["success"] is False
    assert "not found" in result["error"].lower()

def test_tool_input_validation():
    tool = FileReadTool()
    with pytest.raises(ValueError, match="path is required"):
        tool.execute({})

Response Parser Tests

def test_parse_tool_call():
    raw = '{"tool": "search", "args": {"query": "python"}}'
    result = parse_tool_call(raw)
    assert result.tool == "search"
    assert result.args == {"query": "python"}

def test_parse_malformed_tool_call():
    raw = "not json at all"
    result = parse_tool_call(raw)
    assert result is None

Integration Testing (Mocked LLM)

Read the full file on GitHub · 244 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 244 lines · 58 tokens per session scan A 3172e1017a0b

Subscribe to this mod's changes

agent-testing-patterns is a skill published in the GitHub repository organvm-iv-taxis/a-i--skills (17 stars, last pushed 14d ago), licensed Apache-2.0. It adds 58 tokens to every session and 1,840 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.