laravel-tdd
by affaan-mlaravel-tdd is a Laravel test-driven-development guide for PHPUnit and Pest. It helps with unit, feature, and integration test choices, database strategy, fakes, coverage targets, and a practical workflow for test automation.
This skill scores 84/100 because it provides a real, usable Laravel TDD workflow with clear triggers, test-layer guidance, and concrete database-testing advice. For directory users, that means it is worth installing if they want an opinionated testing helper for Laravel work, though it is more workflow-focused than tool-integrated and lacks extra support files.
- Clear use cases: new features, bug fixes, refactors, and Laravel testing tasks are explicitly named.
- Operational workflow is concrete: red-green-refactor cycle, test-layer selection, and database strategy guidance reduce guesswork.
- Material Laravel-specific leverage: covers PHPUnit/Pest, factories, database testing, fakes, coverage targets, and common Laravel targets like models, policies, jobs, and notifications.
- No scripts, references, or supporting resources are included, so execution depends entirely on the SKILL.md instructions.
- The repository is marked with an experimental/test signal, so users should verify fit and not expect a polished production-grade package.
Overview of laravel-tdd skill
The laravel-tdd skill is a practical Laravel test-driven-development guide for writing tests first, then implementing code with PHPUnit or Pest. It is best for developers who want a repeatable workflow for new features, bug fixes, refactors, and test automation in Laravel without improvising the test strategy each time.
What makes laravel-tdd useful is that it focuses on decisions that usually slow teams down: which test layer to use, when to reach for database refreshes, how to handle fakes, and how to keep coverage targets realistic. That makes the laravel-tdd skill more actionable than a generic “write tests” prompt.
Best fit for Laravel test automation
Use laravel-tdd when you need test automation for Laravel code that crosses HTTP, auth, validation, Eloquent, jobs, notifications, or queues. It is a strong fit if your project already values fast feedback loops and you want the skill to help you stay disciplined about red-green-refactor.
What it helps you decide faster
The main value of the laravel-tdd skill is not abstract TDD theory. It helps you decide:
- whether a change should start with a unit, feature, or integration test
- whether Pest or PHPUnit is the better default for the repo
- how much database setup the test really needs
- when fakes are enough and when real boundaries should be exercised
When it may not be the right choice
If you only want a one-off code sample, a broad Laravel prompt may be simpler. The laravel-tdd skill is most valuable when the output must match a working test workflow and you care about maintainability, coverage, and consistent structure across iterations.
How to Use laravel-tdd skill
Install the skill in your Claude Code setup
Install laravel-tdd with:
npx skills add affaan-m/everything-claude-code --skill laravel-tdd
That is the laravel-tdd install step most users need. After installation, invoke it in a Laravel repo where the model can inspect existing tests, test config, and the code under change.
Give the skill the right task shape
The best laravel-tdd usage starts with a concrete behavior request, not a vague implementation ask. Good inputs describe:
- the feature or bug
- the expected user-visible behavior
- existing models, routes, controllers, jobs, or notifications involved
- any test framework preference already used by the repo
Example of a stronger prompt:
“Use laravel-tdd to add passwordless login via email link. Prefer existing test style, write the failing feature test first, then implement the minimum code. Use fakes where appropriate and keep the tests aligned with current Laravel conventions.”
Read the most useful files first
For this laravel-tdd guide, start with SKILL.md, then scan the repository’s supporting docs if present. In this repo, SKILL.md is the main source of truth, and the most relevant sections are:
When to UseHow It WorksRed-Green-Refactor CycleTest Layers- database strategy guidance
If your project has its own Laravel conventions, compare them against the skill before writing tests so you do not fight the local test style.
Use a workflow that matches the skill’s intent
A good laravel-tdd workflow is:
- define the behavior in one sentence
- choose the test layer that proves that behavior
- write the failing test
- implement the minimum code to pass
- refactor only after the test is green
When you ask the model to follow this sequence, you reduce hallucinated implementation detail and get output that is easier to apply in a real Laravel codebase.
laravel-tdd skill FAQ
Is laravel-tdd only for PHPUnit users?
No. The skill supports both PHPUnit and Pest, with Pest preferred for new tests unless the project already standardizes on PHPUnit. If your repo is mixed, tell the model which style to match so it does not introduce inconsistency.
Do I need a large test suite before using it?
No. The laravel-tdd skill is useful even in small projects because it helps you choose the right test level for each change. It is especially helpful when you want the first few tests to set a pattern the rest of the team can follow.
How is this different from a normal Laravel prompt?
A normal prompt may generate code that works once but ignores test structure. The laravel-tdd skill centers the test-first workflow, the test layer choice, and the database strategy, which makes it better for Test Automation and more likely to fit a real Laravel project.
When should I skip this skill?
Skip it if you are not testing Laravel behavior, if you need a fast prototype with no test discipline, or if your app has a strict internal testing framework that conflicts with the skill’s PHPUnit/Pest assumptions.
How to Improve laravel-tdd skill
Give behavior, not just implementation goals
The strongest laravel-tdd results come from behavior specs. Instead of “build a notification system,” say “send an email notification when an invoice becomes overdue, and verify it with a feature test.” That gives the skill a testable target and reduces back-and-forth.
State the boundary and test style up front
Tell the model what should be tested and how. For example:
- “Use a feature test for the HTTP endpoint and a unit test for the pricing rule.”
- “Use
RefreshDatabasebecause the test touches Eloquent and policies.” - “Use Pest unless the existing suite is PHPUnit.”
Those details help the laravel-tdd skill avoid wrong defaults and produce output that fits your repo.
Watch for two common failure modes
The most common issues are over-testing implementation details and choosing the wrong test layer. If the first pass is too low-level, ask for a behavior-focused rewrite. If the test setup feels heavy, ask the model to minimize fixtures, prefer factories, and simplify database setup where possible.
Iterate with a failing test review
After the first output, review whether the test would actually fail for the right reason before the code change. If not, ask for a stricter assertion, a cleaner fixture, or a narrower scope. That is the fastest way to improve laravel-tdd output for Test Automation in real projects.
