Why I deleted my custom Laravel AI coding guidelines

Laravel Daily////3 min read

AI coding rules shrink as models mature

For months, developers maintained extensive lists of custom rules to keep AI agents from breaking Laravel codebases. Early models stumbled on PHP enums, generated duplicate migration timestamps, and ignored frontend builds. Today, frontier LLMs like Claude 3.5 Sonnet and GPT-4o have improved to the point where many manual constraints are obsolete. They handle basic casting, migration ordering, and self-debugging out of the box. Instead of writing passive rule files, we can now offload safety checks to automated tooling and robust planning phases.

Prerequisites

To get the most out of this modern workflow, you should have a solid grasp of:

Key libraries and tools

  • Laravel Boost: An official tool by Ashley Hindel that injects deep, context-aware Laravel rules directly into your agent files.
  • Vasque: A managed websocket alternative to Laravel Reverb or Pusher, also built by Hindel, perfect for handling heavy real-time data efficiently.
  • context7: A global CLI documentation tool used as a fallback source when looking up Laravel docs.
Why I deleted my custom Laravel AI coding guidelines
I Deleted My Custom Laravel AI Guidelines. Here’s Why.

Let hooks run your frontend builds

One persistent headache with AI agents is their tendency to modify Blade templates or Tailwind styles without rebuilding assets. Instead of begging the LLM to run npm run build in a text file, you can enforce this behavior using post-tool execution hooks in Claude Code or Codex CLI.

Here is how you configure a two-stage bash script check inside your global Claude directory.

First, create the change detector script (front_end_detect.sh):

#!/bin/bash
# Detect changes in frontend assets
if git diff --name-only | grep -E '\.(blade\.php|css|js)$' > /dev/null; then
    touch .claude_frontend.flag
fi

Next, create the execution script (front_end_build.sh):

#!/bin/bash
# Run build if flag exists
if [ -f .claude_frontend.flag ]; then
    echo "Frontend changes detected. Rebuilding..."
    npm run build
    rm .claude_frontend.flag
fi

Configuring settings and hook files

To execute these scripts automatically, register them in your tool's configuration.

For Claude Code, add this to your settings.json:

{
  "hooks": {
    "post_tool_use": {
      "write_file": "/path/to/front_end_detect.sh",
      "edit_file": "/path/to/front_end_detect.sh"
    },
    "stop": "/path/to/front_end_build.sh"
  }
}

For Codex CLI, define the absolute paths in hooks.json:

{
  "post_tool_use": {
    "command": "/absolute/path/to/front_end_detect.sh"
  },
  "stop": {
    "command": "/absolute/path/to/front_end_build.sh"
  }
}

Keep rules for niche ecosystems

While standard Laravel patterns are baked deeply into modern models, niche ecosystems still need help. Filament v3 remains a challenge. LLMs often fallback to obsolete v2 patterns, like placing forms and tables directly inside resource files instead of separating them into distinct classes. For these specialized packages, keep your custom guidelines active until training data catches up.

Topic DensityMention share of the most discussed topics · 15 mentions across 7 distinct topics
Laravel
33%· products
Claude Code
20%· products
Codex CLI
20%· products
Ashley Hindel
7%· people
Filament
7%· products
Other topics
13%
End of Article
Source video
Why I deleted my custom Laravel AI coding guidelines

I Deleted My Custom Laravel AI Guidelines. Here’s Why.

Watch

Laravel Daily // 19:35

Tutorials, and demo projects with Laravel framework. Host: Povilas Korop

Who and what they mention most
Laravel
48.5%16
Composer
15.2%5
Filament
15.2%5
3 min read0%
3 min read