pest

pest is a skill for Claude Code, Codex from xobotyi/cc-foundry. It costs 60 tokens per session (3,589 once invoked), scanned B, original, MIT.

A guide to Pest, a PHP testing framework built on PHPUnit, where tests use functions and expect() checks instead of test classes and assertion methods.

In plain words
What is it for?
Writing and running Pest tests, including datasets, hooks, configuration, architecture checks, mutation testing, type coverage, and browser tests.
Why use it?
It helps keep Pest tests consistent and explains Pest-specific choices without replacing general PHPUnit guidance.

Skill for Claude CodeCodex

Part of the php plugin — 3 skills shipped together

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.

agentmods
npx agentmods add skills/xobotyi/cc-foundry/pest
Any agent
npx skills add xobotyi/cc-foundry --skill pest
Clone the repo
git clone --depth 1 https://github.com/xobotyi/cc-foundry

Made for: Claude Code, Codex.

Or install php, the plugin that ships this one along with the rest of its 3 skills.

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 pest

README.md
[![agentmods](https://agentmods.dev/badge/skills/xobotyi/cc-foundry/pest.svg)](https://agentmods.dev/skills/xobotyi/cc-foundry/pest)
Your own site
<a href="https://agentmods.dev/skills/xobotyi/cc-foundry/pest"><img src="https://agentmods.dev/badge/skills/xobotyi/cc-foundry/pest.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,589 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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.00060 $0.03589
Opus 5 $0.00030 $0.01795
Sonnet 5 $0.00012 $0.00718
Haiku 4.5 $0.00006 $0.00359

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

Security

Grade B, and why

pest scanned grade B with 1 finding 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 5d 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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

When **reviewing** tests: cite the specific issue and show the fix inline. Don't lecture — state what's wrong and how to
plugins/php/skills/pest/SKILL.md · 281 lines

How it starts

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

Pest

Tests are functions, not classes. Write the expectation, not the ceremony — expect($x)->toBe($y), and let the description say what the code does.

Pest is a testing framework built on the PHPUnit engine: closures instead of test-case methods, an expect() expectation API instead of $this->assert*, and first-class architecture, mutation, type-coverage, and browser testing. $this inside a test closure is a PHPUnit TestCase, so the full PHPUnit assertion and test-double API stays available. All patterns target Pest 4 on PHP 8.5+ (it runs on the PHPUnit 12 engine; its own floor is PHP 8.3).

This skill governs Pest-specific decisions. It does not restate universal testing philosophy (test behavior not implementation, arrange-act-assert, isolation, mock at boundaries), the PHPUnit assertion/double API, coverage attributes, or phpunit.xml internals — those live in the phpunit skill and apply unchanged here.

References

  • Full expectation catalog + modifiers, higher-order & custom expectations → [${CLAUDE_SKILL_DIR}/references/expectations.md] — every expect() method by category, not/and/each/sequence, expect()->extend()/intercept()/pipe()
  • Architecture testing — arch() rules and presets → [${CLAUDE_SKILL_DIR}/references/architecture.md] — all arch expectations, php/security/laravel/strict presets, modifiers, wildcards
  • Mutation, type coverage, snapshot, stress, browser testing → [${CLAUDE_SKILL_DIR}/references/advanced-features.md] — opt-in modes, their plugins, drivers, and CLI flags
  • Pest.php configuration + full CLI flag catalog + PHPUnit migration → [${CLAUDE_SKILL_DIR}/references/configuration.md] — pest()->extend/use/in/group, global hooks, every run flag, Drift

Test Structure

Install with composer require pestphp/pest --dev --with-all-dependencies (remove phpunit/phpunit first). Pest's --init scaffolds tests/Unit/ and tests/Feature/, a base tests/TestCase.php, and tests/Pest.php. Files are suffixed *Test.php.

Read the full file on GitHub · 281 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 281 lines · 60 tokens per session scan B bc874b828ff1

Subscribe to this mod's changes

pest is a skill published in the GitHub repository xobotyi/cc-foundry (20 stars, last pushed 3d ago), licensed MIT. It adds 60 tokens to every session and 3,589 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

pest-testing

Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to…

coollabsio/coolify · 171 tokens

pest-testing

Use this skill for Pest PHP testing in Laravel projects only. Trigger whenever any test is being written, edited, fixed, or refactored — including fixing tests that broke after a code change, adding assertions, converting PHPUnit to Pest, adding datasets, and TDD workflows. Always activate when the user asks how to…

liberusoftware/real-estate-laravel · 187 tokens

craft-pest

Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core harness. ALWAYS load when writing, running, fixing, or reviewing tests for a Craft plugin or module, and whenever a suite touches a real Craft install. Covers why rollback is opt-in, tests/Pest.php +…

michtio/craftcms-claude-skills · 353 tokens

laravel-testing

Laravel 13 testing with Pest PHP 4 or PHPUnit 12. Use when writing feature tests, unit tests, or any test code in a Laravel application. Triggers on tasks involving HTTP tests, model factories, database assertions, mocking facades, authentication testing, or test organisation patterns.

AsyrafHussin/agent-skills · 62 tokens

phpunit-unit-test-reviewing

Internal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent.

shopwareLabs/ai-coding-tools · 31 tokens

phpunit-unit-test-writing

Use this skill when the user asks to write, generate, create, or add PHPUnit unit tests for a Shopware 6 source class — phrases like "write unit tests for X", "generate tests for ClassName", "create PHPUnit tests", "add test coverage", "test this class", "cover this with tests", "I need tests for", "unit test this"…

shopwareLabs/ai-coding-tools · 187 tokens