agentleFS
dafaalzdafaalz/agent-skills/skills/laravel/SKILL.md

laravel

Skill2 starsChanged 2 months agoMITView on GitHub

Use when building, modifying, reviewing, testing, or debugging Laravel applications, Eloquent queries, Artisan commands, Blade or Livewire components, Inertia adapters, Form Requests, migrations, or queue jobs. Don't use for non-PHP stacks, static sites, or plain WordPress themes.

  • Reads credentials

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow these four steps in sequence:

    line 16
  2. Distinctive:

    Check the Laravel version and PHP runtime:

    line 22
  3. Very specific:

    When search-docs is present, query it for version-specific documentation and package contracts.

    line 27
  4. Very specific:

    When search-docs is absent, inspect framework behavior with native Artisan commands in references/cli-introspection.md or read vendor …

    line 28
  5. Distinctive:

    Keep database queries inside Eloquent models, repositories, or query scopes, keeping Blade templates, Inertia controllers, and JsonResource …

    line 57
  6. Distinctive:

    Run automated verification commands before finishing work:

    line 65
  7. Distinctive:

    Check code style with Laravel Pint when installed in the repository:

    line 71
  8. Distinctive:

    Prefer native framework utilities over custom helper functions or external packages.

    line 82

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Laravel

Deterministic, test-driven workflows for Laravel applications.

Overview

Build, refactor, and debug Laravel applications using native Artisan inspection and established repository conventions. Delegate architectural scoping to superpower skills, write tests before implementation, and verify changes with automated test suites and Pint formatting.

Workflow

Follow these four steps in sequence:

Step 1. Environment and runtime probe

Probe framework version, configuration, and database state before modifying application files:

  1. Check the Laravel version and PHP runtime:
    php artisan --version
  2. Detect the laravel/boost MCP server in available tools:
    • When search-docs is present, query it for version-specific documentation and package contracts.
    • When search-docs is absent, inspect framework behavior with native Artisan commands in references/cli-introspection.md or read vendor source directly.
  3. Inspect affected database tables and route definitions:
    php artisan model:show <ModelName>
    php artisan route:list --name=<routeName>

Completion criterion. Command output confirms Laravel version, runtime settings, affected database schemas, and route mappings.

Step 2. Convention mapping and reference selection

Audit sibling controllers, models, migrations, and test files for established project patterns. Match affected application layers to the reference index below:

ConcernReference guide
CLI introspection, runtime discovery, logsreferences/cli-introspection.md
Eloquent queries, N+1 prevention, migrations, castsreferences/eloquent-and-database.md
Controllers, Form Requests, route binding, resourcesreferences/routing-and-controllers.md
Pest and PHPUnit tests, HTTP assertions, service fakesreferences/testing-patterns.md
Authorization policies, SQL injection safety, mass assignmentreferences/security-and-hardening.md

Completion criterion. Every modified file adheres to conventions observed in sibling files and matches its corresponding reference guide.

Step 3. Implementation and boundary isolation

Apply minimal, isolated modifications using test-first development:

  1. For new features or bug fixes, coordinate with the tdd skill to establish failing tests before writing production code.
  2. For error diagnosis, coordinate with the systematic-debugging skill to inspect storage/logs/laravel.log and verify reproducing steps first.
  3. Keep database queries inside Eloquent models, repositories, or query scopes, keeping Blade templates, Inertia controllers, and JsonResource classes free of queries.
  4. Extract validation into Form Request classes and pass only $request->validated() into models.
  5. Eager load relationships using with() or loadMissing() to eliminate N+1 queries.

Completion criterion. Implementation passes input validation, eagerly loads database relations, and keeps business logic separated from HTTP controllers.

Step 4. Verification pass

Run automated verification commands before finishing work:

  1. Execute the narrowest relevant test suite:
    php artisan test --filter=<TestClassOrMethod>
  2. Check code style with Laravel Pint when installed in the repository:
    vendor/bin/pint --test
  3. Inspect the git diff of modified files. Confirm that input passes through validation, migrations declare explicit constraints, and queries load relationships eagerly.

Completion criterion. Targeted tests pass with exit code 0 and Pint reports zero code style violations.

Decision rules

  • Audit sibling files before introducing patterns. Consistent project conventions take precedence over alternate architectures.
  • Prefer native framework utilities over custom helper functions or external packages.
  • Pass raw SQL through parameterized bindings with positional placeholders.
  • Maintain CSRF protection, route middleware, and model authorization policies during tests. Fix test fixtures rather than disabling security middleware.
  • Store credentials and private keys in .env and config/ files. Application code must never contain hardcoded secrets.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.