/laravel-claude-agents:laravel-tddfrom laravel-claude-agents
Guides Test-Driven Development for Laravel apps using Pest PHP. Write failing tests first, implement minimal passing code, then refactor. Covers feature, API, database, and authorization testing.
Ships in laravel-claude-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Write the test first. Watch it fail. Write minimal code to pass.
This skill adapts TDD principles specifically for Laravel applications using Pest PHP, Laravel's testing features, and framework-specific patterns.
Always for Laravel:
Exceptions (ask your human partner):
RED → Verify RED → GREEN → Verify GREEN → REFACTOR → Repeat
Write one minimal test showing what the Laravel feature should do.
Feature Test Example:
<?php
use App\Models\User;
use App\Models\Post;
test('authenticated user can create post', function () {
$user = User::factory()->create();
$this->actingAs($user)
->post('/posts', [
'title' => 'My First Post',
'content' => 'Post content here',
])
->assertRedirect('/posts');
expect(Post::where('title', 'My First Post')->exists())->toBeTrue();
expect(Post::first()->user_id)->toBe($user->id);
});
php artisan test --filter=authenticated_user_can_create_post
Write simplest Laravel code to pass the test.
php artisan test
After green only:
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
test('creates post in database', function () {
$user = User::factory()->create();
$this->actingAs($user)
->post('/posts', ['title' => 'Test', 'content' => 'Content']);
$this->assertDatabaseHas('posts', ['title' => 'Test']);
});
test('user cannot delete others posts', function () {
$user = User::factory()->create();
$post = Post::factory()->create();
$this->actingAs($user)
->delete("/posts/{$post->id}")
->assertForbidden();
});
test('creates post via API', function () {
$user = User::factory()->create();
$this->actingAs($user, 'sanctum')
->postJson('/api/posts', ['title' => 'API Post', 'content' => 'Content'])
->assertCreated();
});
Every Laravel feature → Test exists and failed first
Otherwise → Not TDD
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub iserter/laravel-claude-agents --plugin laravel-claude-agents15 skills in this plugin
/eloquent-best-practicesBest practices for Laravel Eloquent ORM including query optimization, relationship management, and avoiding common pitfalls like N+1 queries./laravel-api-resource-patternsBest practices for Laravel API Resources including resource transformation, collection handling, conditional attributes, and relationship loading./laravel-authorization-patternsBest practices for Laravel authorization including Gates, Policies, middleware auth, and Blade directives for access control.Other plugins' skills for the same job