Agent-based declarative testing with YAML test specs. Tests run in sub-agents to preserve main context while executing many tests. Supports MCP servers, APIs, and browser automation. Use when: testing MCP servers, running integration tests, validating tool behavior after changes, or creating regression test suites. Keywords: yaml tests, agent testing, mcp test, integration tests.
View on GitHubskills/testing-patterns/SKILL.md
February 4, 2026
Select agents to install to:
npx add-skill https://github.com/jezweb/claude-skills/blob/main/skills/testing-patterns/SKILL.md -a claude-code --skill testing-patternsInstallation paths:
.claude/skills/testing-patterns/# Testing Patterns A pragmatic approach to testing that emphasises: - **Live testing** over mocks - **Agent execution** to preserve context - **YAML specs** as documentation and tests - **Persistent results** committed to git ## Philosophy This is **not traditional TDD**. Instead: 1. **Test in production/staging** with good logging 2. **Use agents** to run tests (keeps main context clean) 3. **Define tests declaratively** in YAML (human-readable, version-controlled) 4. **Focus on integration** (real servers, real data) ### Why Agent-Based Testing? Running 50 tests in the main conversation would consume your entire context window. By delegating to a sub-agent: - Main context stays clean for development - Agent can run many tests without context pressure - Results come back as a summary - Failed tests get detailed investigation ## Commands | Command | Purpose | |---------|---------| | `/create-tests` | Discover project, generate test specs + testing agent | | `/run-tests` | Execute tests via agent(s), report results | | `/coverage` | Generate coverage report and identify uncovered code paths | **Quick workflow:** ``` /create-tests → Generates tests/specs/*.yaml + .claude/agents/test-runner.md /run-tests → Spawns agent, runs all tests, saves results /run-tests api → Run only specs matching "api" /run-tests --failed → Re-run only failed tests /coverage → Run tests with coverage, analyse gaps /coverage --threshold 80 → Fail if below 80% ``` ## Getting Started in a New Project This skill provides the **pattern and format**. Claude designs the actual tests based on your project context. **What happens when you ask "Create tests for this project":** 1. **Discovery** - Claude examines the project: - What MCP servers are configured? - What APIs or tools exist? - What does the code do? 2. **Test Design** - Claude creates project-specific tests: - Test cases for the actual tools/endpoints - Expected values based