laravel-tdd

laravel-tdd is a skill for Claude Code from iSerter/laravel-claude-agents. It costs 42 tokens per session (784 once invoked), scanned A, original, MIT.

A Test-Driven Development guide for Laravel applications using Pest PHP. Test-Driven Development means writing a failing test first, then the smallest code needed to pass it, and improving the code afterward.

In plain words
What is it for?
Use it when adding or repairing Laravel features, database behavior, authorization, queues, commands, middleware, or API endpoints. It also defines when to ask before applying the process to prototypes, configuration, or view-only changes.
Why use it?
It gives Laravel feature and bug-fix work a repeatable testing cycle. This helps verify expected behavior while developing controllers, models, APIs, validation, permissions, jobs, and other application logic.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the laravel-claude-agents plugin — 15 skills, 10 agents shipped together

Good fit Use it when adding or repairing Laravel features, database behavior, authorization, queues, commands, middleware, or API endpoints. It also defines when to ask before applying the process to prototypes, configuration, or view-only changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iserter/laravel-claude-agents/laravel-tdd
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.

Any agent
npx skills add iSerter/laravel-claude-agents --skill laravel-tdd
Clone the repo
git clone --depth 1 https://github.com/iSerter/laravel-claude-agents

Made for: Claude Code.

Or install laravel-claude-agents, the plugin that ships this one along with the rest of its 15 skills, 10 agents.

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 laravel-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/iserter/laravel-claude-agents/laravel-tdd/github.svg)](https://agentmods.dev/skills/iserter/laravel-claude-agents/laravel-tdd)
Your own site
<a href="https://agentmods.dev/skills/iserter/laravel-claude-agents/laravel-tdd"><img src="https://agentmods.dev/badge/skills/iserter/laravel-claude-agents/laravel-tdd/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel-tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/iserter/laravel-claude-agents/laravel-tdd"><img src="https://agentmods.dev/badge/skills/iserter/laravel-claude-agents/laravel-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 784 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 15 Feb 2026
How audits are shown
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.00042 $0.00784
Opus 5 $0.00021 $0.00392
Sonnet 5 $0.00008 $0.00157
Haiku 4.5 $0.00004 $0.00078

Measured 12d ago against content hash 364a1647221f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

laravel-tdd scanned grade A with 0 findings 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 12d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/laravel-tdd/SKILL.md · 147 lines

How it starts

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

Test-Driven Development for Laravel

Overview

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.

When to Use

Always for Laravel:

  • New features (controllers, models, services)
  • Bug fixes
  • API endpoints
  • Database migrations and models
  • Form validation
  • Authorization policies
  • Queue jobs
  • Artisan commands
  • Middleware

Exceptions (ask your human partner):

  • Throwaway prototypes
  • Configuration files
  • View-only changes (no logic)

The Laravel TDD Cycle

RED → Verify RED → GREEN → Verify GREEN → REFACTOR → Repeat

RED - Write Failing Test

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);
});

Verify RED - Watch It Fail

php artisan test --filter=authenticated_user_can_create_post

GREEN - Minimal Laravel Code

Write simplest Laravel code to pass the test.

Verify GREEN - Watch It Pass

php artisan test

REFACTOR - Clean Up Laravel Code

After green only:

  • Extract services for complex logic
  • Create policies for authorization
  • Add query scopes for reusability
  • Use events for side effects

Laravel-Specific Test Patterns

Database Testing

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']);
});

Read the full file on GitHub · 147 lines

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. 12d ago First seen · 147 lines · 42 tokens per session scan A 364a1647221f

Subscribe to this mod's changes

laravel-tdd is a skill published in the GitHub repository iSerter/laravel-claude-agents (45 stars, last pushed 4mo ago), licensed MIT. It adds 42 tokens to every session and 784 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. 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

Test Scaffold (Laravel/PHPUnit)

Generate PHP/Laravel (PHPUnit) test skeletons from specifications.

s977043/river-review · 23 tokens

laravel-tdd

Drives Laravel feature development with Pest or PHPUnit — factories, RefreshDatabase, fakes for queues/mail/notifications, Sanctum auth, and Inertia assertions. Use when writing or fixing a Laravel controller, Eloquent model, policy, job, or notification, when the project uses Pest/PHPUnit, or when asked to test an…

shennawardana23/skillme · 78 tokens

laravel-tdd

Use this skill when testing Laravel 13 applications. It covers Pest 4 installation and configuration, feature tests, model factories, HTTP tests, authentication tests, mocking with Laravel fakes, architecture tests, parallel testing, snapshot testing, Dusk browser tests, and CI integration. Target test split: 80%…

elmochilyas/laraskills · 0 tokens

php-quality

A PHP quality-check workflow using PHPStan, Pint, PHPUnit, Pest, or Laravel's test command. It checks code behavior, types, style, and formatting.

morodomi/dev-crew · 56 tokens

pw-test

Use when creating, executing, or managing Pest tests within ProcessWire or ProcessWire modules, including Test-Driven Development (TDD) tasks.

trk/processwire-boost · 32 tokens

laravel-tdd

Laravel testing strategies with PHPUnit, Pest, model factories, HTTP tests, Sanctum authentication testing, mocking, and coverage. Use when writing Laravel tests with PHPUnit or Pest, or driving a Laravel feature test-first.

userInner/SKILLS · 47 tokens