testing-ai-agents

Community

Test AI agent code with pytest.

Authorimsanghaar
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides a comprehensive framework for ensuring the correctness and reliability of AI agent code through robust testing practices, distinguishing between code correctness and LLM reasoning quality.

Core Features & Use Cases

  • TDD for Agent Code: Implement Test-Driven Development specifically for AI agent applications, focusing on deterministic code correctness.
  • Mocking LLM Calls: Effectively mock external LLM API calls using libraries like respx and pytest-mockllm to isolate and test your agent's logic without incurring API costs or latency.
  • Testing Frameworks: Integrates seamlessly with pytest, pytest-asyncio, and httpx for testing FastAPI endpoints, SQLModel operations, and agent tools.
  • Use Case: Ensure your AI agent correctly parses tool calls, interacts with your database as expected, and handles API errors gracefully, all without making live LLM calls during development.

Quick Start

Use the testing-ai-agents skill to set up pytest for your FastAPI application, including mocking LLM calls with respx.

Dependency Matrix

Required Modules

pytestpytest-asynciohttpxrespxpytest-covpytest-mockllm

Components

scriptsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: testing-ai-agents
Download link: https://github.com/imsanghaar/agentfactory/archive/main.zip#testing-ai-agents

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.