From superpowers-laravel
Guides Laravel TDD with Pest/PHPUnit: RED-GREEN-REFACTOR cycle using model factories, HTTP feature tests, parallel runners; verify failures before implementation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-laravel:tdd-with-pestThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Write the test first. Watch it fail. Write minimal code to pass. Keep tests fast and realistic.
Write the test first. Watch it fail. Write minimal code to pass. Keep tests fast and realistic.
# Sail
sail artisan test --parallel
# Non-Sail
php artisan test --parallel
Prefer Pest (default in new Laravel apps). PHPUnit is fine if your project uses it.
Example (feature):
it('rejects empty email on signup', function () {
$response = $this->post('/register', [
'name' => 'Alice',
'email' => '',
'password' => 'secret',
'password_confirmation' => 'secret',
]);
$response->assertSessionHasErrors('email');
});
Run and confirm it fails for the right reason.
Write the simplest code to pass your failing test. No extras. No refactors.
Remove duplication, clarify names, extract small services. Keep tests green.
npx claudepluginhub jpcaparas/superpowers-laravel --plugin superpowers-laravelGuides Test-Driven Development for Laravel apps using Pest PHP: write failing tests first for features, bug fixes, controllers, models, APIs, then minimal code to pass and refactor.
Guides TDD workflow for Laravel with PHPUnit/Pest: unit/feature/integration tests, factories, DB strategies (RefreshDatabase), fakes, and 80%+ coverage targets.
Write tests with Pest 3/PHPUnit, feature tests, unit tests, mocking, fakes, and factories. Use when testing controllers, services, models, or implementing TDD.