
Laravel TDD Workflow
Guides an agent to write Laravel tests first using PHPUnit or Pest, factories, fakes and coverage goals.
- Repository
- affaan-m/ECC
- Stars
- 295,127
- Licence
- MIT
- Files
- 1 file
What it does
This is a set of written instructions that teaches an AI agent how to build Laravel web applications test-first: write a failing test, make the smallest change that passes it, then tidy the code. It explains which kind of test to use (unit, feature/HTTP, or integration), how to reset the database between tests, when to prefer Pest over PHPUnit, and how to fake queues, mail, notifications and external HTTP calls. It is documentation for the agent, not a program; it does not run anything by itself.
Great for
- PHP developers building or maintaining Laravel APIs and web apps who want consistent tests
- Teams that want an AI agent to add tests alongside new features or bug fixes
- Developers who want examples of Pest and PHPUnit syntax for Laravel features like policies, jobs and notifications
Skip it if
- Non-PHP or non-Laravel projects, since the examples and advice are specific to Laravel's testing helpers
- People expecting the skill to run tests or install tools automatically; it only guides the agent's writing, and the agent still needs a working Laravel project and test runner
- Projects where the 80% coverage target or the database strategy would conflict with existing conventions and should be adapted first
Try asking
- “Write a Pest feature test for a new POST /api/projects endpoint that checks ownership and validation”
- “Add RefreshDatabase-based tests for my Eloquent Project model and its slug lookup”
- “Test that a checkout job is dispatched using Bus or Queue fakes without actually running it”
- “Help me set up phpunit.xml to use an in-memory SQLite database for fast tests”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the MIT licence and an attribution note.
laravel-tdd.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip laravel-tdd.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip laravel-tdd.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Point the agent at your existing test setup first so it follows your project's PHPUnit or Pest conventions rather than defaulting to Pest.
- Use a separate test database configuration so tests never touch development or production data, as the skill recommends.
- Review generated tests before running them; the skill's examples are templates and assume names like Project and User exist in your app.
What's inside
- SKILL.md
Redistributed unmodified from affaan-m/ECC under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.