resources/boost/skills/blade/SKILL.md
Laravel Blade template conventions covering components, output escaping, security, structure, and formatting.
npx skillsauth add codebar-ag/coding-guidelines bladeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
resources/views/.x-* Alpine directives are used, Alpine is loaded by the frontend build/layout.wire:* directives are used, Livewire is installed and version-compatible.{{ }} by default.{!! !!} only for trusted, pre-sanitized HTML.<x-component>) for reusable UI.{{ }}) by default.<style> and <script> tags in Blade templates.@class and @style for conditional attributes.{{-- Escaped output — always use {{ }} for user data --}}
<h1>{{ $user->name }}</h1>
<p>{{ $post->excerpt }}</p>
{{-- Raw output — only for pre-sanitized content --}}
{!! $article->sanitizedBody !!}
{{-- Anonymous component --}}
<x-card>
<x-slot:title>{{ $invoice->title }}</x-slot:title>
<p>{{ $invoice->amount }}</p>
</x-card>
{{-- @class directive for conditional classes --}}
<div @class(['p-4 rounded', 'bg-green-100' => $active, 'bg-red-100' => $error])>
{{ $message }}
</div>
{{-- @style directive for conditional styles --}}
<div @style(['color: green' => $success, 'color: red' => $failure])>
{{ $text }}
</div>
{{-- Alpine.js via directive — no inline script tags --}}
<div x-data="{ open: false }">
<button @click="open = !open">Toggle</button>
<div x-show="open">Content</div>
</div>
{{-- Workflow example: convert repeated form markup into a component --}}
{{-- Step 1: Before --}}
<label for="email">Email</label>
<input id="email" name="email" type="email" value="{{ old('email', $user->email) }}">
@error('email') <p>{{ $message }}</p> @enderror
{{-- Step 2: After --}}
<x-form.input
name="email"
type="email"
label="Email"
:value="old('email', $user->email)"
/>
{{ }} (escaped) and not raw output.{!! !!} usage is documented as sanitized/trusted.{!! $user->input !!} for user-provided data — XSS vulnerability<style> or <script> tags directly in Blade files@if, @foreach, @while blocksLivewire/SKILL.md — interactive UI in Blade templatesDesign/SKILL.md — component-first design systemtesting
Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory.
tools
Reusable behaviour shared across multiple unrelated classes. Traits provide shared Eloquent scopes, accessors, lifecycle hooks, and small stateless helper methods.
development
Tailwind CSS v4 styling conventions. Use when working with CSS, Tailwind utilities, or customizing the theme in Laravel projects.
development
Orchestration classes that coordinate multiple Actions, external APIs, or domain operations into a cohesive workflow. Services own transaction boundaries and third-party API integrations.