laravel-tdd

Guide TDD workflows for Laravel applications using Pest PHP.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/edstevo/standards --skill laravel-tdd-edstevo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/edstevo/standards/tree/main/resources/boost/skills/laravel-tdd
Command: npx skills add https://github.com/edstevo/standards --skill laravel-tdd-edstevo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers consistently apply Test-Driven Development (TDD) principles to Laravel projects, ensuring robust, well-tested code and efficient development cycles.

Core Features & Use Cases

  • Guided TDD Workflow: Follows the RED -> GREEN -> REFACTOR loop with clear steps.
  • Layered Testing Strategy: Provides guidance on choosing the right test layer (Unit, Model, Feature, Integration).
  • Test Structure & Reuse: Offers best practices for organizing tests and creating reusable support code.
  • Use Case: When building a new feature in a Laravel application, use this Skill to write failing tests first, then implement the minimum code to pass, and finally refactor both code and tests for maintainability.

Quick Start

Use the laravel-tdd skill to write a failing test for a new user creation feature.

Frequently Asked Questions about laravel-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply TDD to a Laravel application using Pest?

To apply TDD to Laravel using Pest, follow the RED -> GREEN -> REFACTOR loop: write a failing test first, implement the minimal code to pass it, then refactor for quality. This ensures robust, well-tested code and efficient development cycles.

What is the best way to structure Laravel tests with Pest?

Structure Laravel Pest tests using describe blocks and shared test support code to organize tests logically and create reusable components. This approach allows for better test layering across unit, model, feature, and integration levels.

How do I choose the right test layer for a Laravel feature?

Choose the right test layer in Laravel by evaluating whether the functionality requires unit, model, feature, or integration tests. Using the appropriate test layer ensures efficient testing and robust software development for specific application components.

Can I use this TDD workflow for refactoring existing Laravel code?

Yes, you can use this TDD workflow for refactoring existing Laravel code by writing failing tests first to verify current behavior, implementing minimal code to pass, and then refactoring both code and tests for maintainability.

Do I need Pest to follow test-driven development in Laravel?

Pest is the targeted testing framework for this TDD workflow in Laravel, providing the syntax for writing failing tests and structuring them with describe blocks. The core TDD principles apply regardless, but this guidance specifically leverages Pest.

Why write failing tests first when building Laravel features?

Writing failing tests first when building Laravel features ensures you implement only the minimal code required to pass the test, preventing over-engineering. This RED -> GREEN -> REFACTOR loop guarantees robust, well-tested code and efficient development.