laravel-tdd

laravel-tdd is a skill for Claude Code from shennawardana23/skillme. It costs 78 tokens per session (1,706 once invoked), scanned A, original, Apache-2.0.

A Laravel testing guide for building features with Pest or PHPUnit, including database setup, fake queues and notifications, authentication, and Inertia responses.

In plain words
What is it for?
Use it when writing or fixing Laravel controllers, models, policies, jobs, or notifications, and when checking that routes, validation, authentication, and side effects work.
Why use it?
It removes the guesswork around testing Laravel code at the right level and using the framework's own testing tools correctly.

Skill for Claude Code

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

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit Use it when writing or fixing Laravel controllers, models, policies, jobs, or notifications, and when checking that routes, validation, authentication, and side effects work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/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 shennawardana23/skillme --skill laravel-tdd
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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/shennawardana23/skillme/laravel-tdd/github.svg)](https://agentmods.dev/skills/shennawardana23/skillme/laravel-tdd)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/laravel-tdd"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/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/shennawardana23/skillme/laravel-tdd"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/laravel-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,706 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.
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.00078 $0.01706
Opus 5 $0.00039 $0.00853
Sonnet 5 $0.00016 $0.00341
Haiku 4.5 $0.00008 $0.00171

Measured 9d ago against content hash 62f496263714, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 9d 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 · 192 lines

How it starts

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

Laravel TDD

Red-green-refactor for Laravel, with the framework-specific parts that differ from a generic TDD loop: which database trait to reach for, which Facade::fake() to use for a given side effect, and how to assert an Inertia response instead of raw JSON.

For the generic RED-GREEN-REFACTOR cycle and the Prove-It bug-fix pattern, see skills/test-driven-development/. This skill covers what's specific to Laravel on top of that cycle.

Test layers

  • Unit — pure PHP: value objects, calculators, services with no framework dependency.
  • Feature — HTTP endpoints, auth, validation, policies, response shape.
  • Integration — database + queue + external boundaries together.

Pick the layer by what you need to prove, not by habit: a validation rule belongs in a Feature test that hits the route (it proves the FormRequest is wired in), not a Unit test that instantiates the rule class directly.

Framework choice

Default to Pest for new test files when the project has it installed; use PHPUnit only if the project already standardizes on it. Don't mix styles within one test file.

// Pest
test('owner can create project', function () {
    $user = User::factory()->create();

    $response = actingAs($user)->postJson('/api/projects', ['name' => 'New Project']);

    $response->assertCreated();
    assertDatabaseHas('projects', ['name' => 'New Project']);
});
// PHPUnit — same behavior, class-based
final class ProjectControllerTest extends TestCase
{
    use RefreshDatabase;

    public function test_owner_can_create_project(): void
    {
        $user = User::factory()->create();

        $response = $this->actingAs($user)->postJson('/api/projects', ['name' => 'New Project']);

        $response->assertCreated();
        $this->assertDatabaseHas('projects', ['name' => 'New Project']);
    }
}

Database trait: which one and why

  • RefreshDatabase — the default for feature/integration tests. On a connection with transaction support it migrates once per test run (a static flag) and wraps each test in a rolled-back transaction; on :memory: SQLite (no cross-connection transaction visibility) it re-migrates before every test, which is slower.
  • DatabaseTransactions — use when the schema is already migrated (e.g. a persistent test database) and you only need per-test rollback, skipping the migration-freshness check RefreshDatabase does.
  • DatabaseMigrations — full migrate-and-drop every test. Reserve for tests that specifically verify migration behavior; it's the slowest option and unnecessary for ordinary feature tests.

Read the full file on GitHub · 192 lines

Files

What ships with it

1 file 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. 9d ago First seen · 192 lines · 78 tokens per session scan A 62f496263714

Subscribe to this mod's changes

laravel-tdd is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 15d ago), licensed Apache-2.0. It adds 78 tokens to every session and 1,706 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

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

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

obra/superpowers · 17 tokens

wp-phpunit-writing-tests

Write PHPUnit tests for a WordPress plugin or theme. Covers the integration base class WPUnitTestCase and its snakecase setup() / teardown() fixtures (and why WordPress uses them via phpunit-polyfills), verified cleanup boundaries (without promising universal transaction rollback), the factory system (post creation…

Lonsdale201/wp-agent-skills · 205 tokens

laravel-testing

Test strategy for a layered Laravel application — which test style fits each layer, hand-written fakes over mocks, real-database tests for Query Classes and Repositories, pure tests for Value Objects, and feature tests that assert authorization, payload shape and query counts. Use when writing or reviewing Laravel…

Foysal50x/skills · 83 tokens

tdd

Enforces strict Test-Driven Development with RED-GREEN-REFACTOR cycles. Writes one failing test at a time, implements minimal code to pass, then refactors. Delegates to the test-provenance-guard skill during REFACTOR to detect tests-by-construction (static + mutation checks). Pairs with the code-quality skill: invokes…

mthines/agent-skills · 157 tokens

testing-expert

Ultimate Kotlin testing skill. Use this whenever writing, reviewing, or debugging ANY Kotlin test — unit, integration, property-based, or coroutine. Covers TDD (RED/GREEN/REFACTOR), Kotest + MockK + Kover, anti-pattern detection, and four-pillar quality framework. Triggers on: write a test, add coverage, why is this…

JosephSanjaya/skills · 115 tokens