tdd-with-pest — Claude Code skill for Symfony TDD
tdd-with-pest guides RED-GREEN-REFACTOR in Symfony projects using Pest v4. Use it to write new tests, reproduce bugs before a fix, or move PHPUnit tests to Pest syntax.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill tdd-with-pest -a claude-codeWhat tdd-with-pest does
The skill lays out a test-first loop: write an it() test with Foundry v2 factories, run it, and confirm the failure has the expected cause. Then make the smallest code change and run the tests again. It also covers configuring Pest in tests/Pest.php to use Symfony’s KernelTestCase and WebTestCase, including tests that need the HTTP client.
You need PHP 8.3+ and Pest v4. The setup uses uses() for integration and functional tests, and the skill recommends Factories and ResetDatabase traits for anonymous Pest test files. Symfony has no official Pest plugin, so bind KernelTestCase and WebTestCase through uses() instead of relying on one. The requested output includes the failed and passing test runs, changes to tests/Pest.php, edited test files, and the commands used.
What it helps with
- check that a new test fails for the expected reason
- write a regression test before fixing a bug
- configure Pest tests to use Symfony’s kernel and HTTP client
- convert PHPUnit class tests to Pest syntax
Example prompts for the agent
- Write an
it()test for this behavior, then confirm it fails for the right reason. - Configure
tests/Pest.phpfor integration tests withKernelTestCaseand Foundry factories. - Convert this PHPUnit test to Pest syntax and rerun the suite.
How to install tdd-with-pest
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill tdd-with-pest -a claude-code2Manually: put the files in place
~/.claude/skills/tdd-with-pest/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/tdd-with-pest/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill tdd-with-pest -a codex2Manually: put the files in place
.agents/skills/tdd-with-pest/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill tdd-with-pest -a cursor2Manually: put the files in place
.cursor/skills/tdd-with-pest/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/tdd-with-pest2Manually: put the files in place
.github/skills/tdd-with-pest/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill tdd-with-pest -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/tdd-with-pestManually: put the files in place
.devin/skills/tdd-with-pest/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about tdd-with-pest
How do I install tdd-with-pest in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill tdd-with-pest -a claude-code. The skill file is at ~/.claude/skills/tdd-with-pest/SKILL.md.
What does tdd-with-pest do?
It guides a RED-GREEN-REFACTOR workflow for Symfony projects using Pest, from checking a failing test to applying a change and running the suite again.
Which PHP and Pest versions does tdd-with-pest require?
It requires PHP 8.3+ and Pest v4. Symfony test classes are bound through uses() in tests/Pest.php.
Source text
SKILL.md · MIT
---
name: tdd-with-pest
description: Apply RED-GREEN-REFACTOR with Pest v4 (PHP 8.3+) for Symfony via the PHPUnit bridge; Foundry factories, WebTestCase, verify failures first
capabilities: [read, search, edit, shell]
tags: [testing, tdd]
# projected by `bun run build` — do not edit by hand
allowed-tools:
- Read
- Glob
- Grep
- Write
- Edit
- Bash
---
# Tdd With Pest (Symfony)
## Use when
- Driving a feature with RED-GREEN-REFACTOR in a project that runs Pest v4 (PHP 8.3+).
- Writing `it()` and `expect()` tests that need the Symfony kernel or an HTTP client.
- Converting existing PHPUnit class tests to Pest syntax with `pest-plugin-drift`.
- Adding a bug-reproducing test to a Pest suite before the fix.
## Default workflow
1. Confirm PHP 8.3+ and Pest v4, then generate `tests/Pest.php` with `./vendor/bin/pest --init`.
2. Bind the bridge classes in `tests/Pest.php`: `uses(KernelTestCase::class, Factories::class, ResetDatabase::class)->in('Integration')` and `uses(WebTestCase::class, ...)->in('Functional')`.
3. RED: write an `it()` test with Foundry v2 factories, run `./vendor/bin/pest --filter` and check it fails for the right reason.
4. GREEN: write the minimal code, then REFACTOR and re-run `./vendor/bin/pest`.
5. Gate the suite with `--parallel` and `--coverage --min=80`.
## Guardrails
- There is no official Symfony Pest plugin: never reference `pestphp/pest-plugin-symfony`, bind `KernelTestCase` or `WebTestCase` through `uses()`.
- Foundry v2 factories return real objects: no `->object()` call.
- Pest test files are anonymous, so use the `Factories` and `ResetDatabase` traits rather than the `#[ResetDatabase]` attribute.
- Chain related checks with `expect()->and()`; keep one concept per test.
## Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
## Output contract
- The failing `./vendor/bin/pest` output (RED), then the passing run.
- `tests/Pest.php` bindings added or changed.
- Test files changed and the commands executed.
## References
- `reference.md`
© dev-toolings · MIT · dev-toolings/superpowers-symfony