From 82eaa249aab788b1469c8b4452c8f59478fbb460 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Feb 2026 21:07:05 +0000 Subject: [PATCH 1/4] Add Laravel Boost guideline and Aire development skill Add third-party integration files for Laravel Boost so that AI agents using Boost will understand how to build forms with Aire: - Guideline (resources/boost/guidelines/core.blade.php): loaded upfront, provides an overview of Aire and instructs agents to activate the aire-development skill whenever working on forms. - Skill (resources/boost/skills/aire-development/SKILL.md): on-demand detailed reference covering the fluent API, Blade components, data binding, validation, Alpine.js integration, theming, and complete form examples. https://claude.ai/code/session_012zEXFUPRKYipGr2kgFshGC --- resources/boost/guidelines/core.blade.php | 15 + .../boost/skills/aire-development/SKILL.md | 373 ++++++++++++++++++ 2 files changed, 388 insertions(+) create mode 100644 resources/boost/guidelines/core.blade.php create mode 100644 resources/boost/skills/aire-development/SKILL.md diff --git a/resources/boost/guidelines/core.blade.php b/resources/boost/guidelines/core.blade.php new file mode 100644 index 0000000..f719b62 --- /dev/null +++ b/resources/boost/guidelines/core.blade.php @@ -0,0 +1,15 @@ +## Aire Form Builder + +This project uses **Aire** (`glhd/aire`) for all HTML form rendering. Aire is a Laravel form builder that provides a fluent PHP API and Blade components for building forms with automatic CSRF protection, data binding, validation, and Tailwind CSS styling. + +### Key Conventions + +- **Always use Aire** for building forms. Never write raw `
` or `` HTML tags manually. +- Use the `Aire` facade or `` Blade components — never instantiate element classes directly. +- Aire automatically handles CSRF tokens, method spoofing (`PUT`/`PATCH`/`DELETE`), old input repopulation, and validation error display. +- Elements are automatically grouped with their label and error messages by default. +- The default theme uses Tailwind CSS classes. + +### When to Activate the Skill + +Whenever you are working on anything related to forms — creating, editing, debugging, styling, or validating forms — activate the `aire-development` skill for detailed API reference and usage patterns. diff --git a/resources/boost/skills/aire-development/SKILL.md b/resources/boost/skills/aire-development/SKILL.md new file mode 100644 index 0000000..11c460d --- /dev/null +++ b/resources/boost/skills/aire-development/SKILL.md @@ -0,0 +1,373 @@ +--- +name: aire-development +description: Build and work with Aire forms in Laravel, including the fluent PHP API, Blade components, data binding, validation, and theming. +--- + +# Aire Form Development + +## When to use this skill + +Use this skill when creating, modifying, debugging, or styling HTML forms in a Laravel application that uses the `glhd/aire` package. This includes any work involving form elements, data binding, validation, or form theming. + +## Overview + +Aire is a Laravel form builder with a fluent API. It is accessed via the `Aire` facade (`Galahad\Aire\Support\Facades\Aire`) or via `` Blade components. Aire automatically handles CSRF tokens, HTTP method spoofing, old input repopulation, and server-side validation error display. + +## Opening and Closing Forms + +Every form must be opened and closed. Aire uses output buffering between open and close to capture form fields. + +### Facade API + +```php +{{ Aire::open()->route('users.store') }} + {{-- form fields --}} +{{ Aire::close() }} +``` + +### Blade Component API + +```html + + {{-- form fields --}} + +``` + +### Setting the Action + +```php +// From a named route (method is inferred automatically): +Aire::open()->route('users.store') +Aire::open()->route('users.update', $user) + +// From a URL: +Aire::open()->action('/users') + +// Resourceful (auto-detects store vs. update based on model existence): +Aire::open()->resourceful($user) +Aire::open()->resourceful($user, 'admin.users') +``` + +### HTTP Methods + +Aire automatically infers the method from the route. You can also set it explicitly: + +```php +Aire::open()->route('users.store') // POST (inferred) +Aire::open()->route('users.update', $user) // PUT (inferred) +Aire::open()->post() +Aire::open()->put() +Aire::open()->patch() +Aire::open()->delete() +``` + +For `PUT`, `PATCH`, and `DELETE`, Aire automatically adds a hidden `_method` field and sets the real method to `POST`. + +### Form Encoding + +```php +Aire::open()->multipart() // multipart/form-data (required for file uploads) +Aire::open()->urlEncoded() // application/x-www-form-urlencoded +``` + +## Data Binding + +Bind an Eloquent model, array, or object to auto-populate form fields: + +```php +{{ Aire::open()->route('users.update', $user)->bind($user) }} + {{ Aire::input('name', 'Name') }} {{-- pre-filled with $user->name --}} +{{ Aire::close() }} +``` + +Or with `resourceful` (which calls `bind` internally): + +```php +{{ Aire::open()->resourceful($user) }} +``` + +**Value precedence** (highest to lowest): +1. Explicitly set via `->value()` +2. Old input from session (after validation failure) +3. Bound data from the model/array/object + +## Available Form Elements + +### Text Inputs + +```php +Aire::input('name', 'Full Name') +Aire::email('email', 'Email Address') +Aire::password('password', 'Password') +Aire::search('q', 'Search') +Aire::tel('phone', 'Phone') +Aire::url('website', 'Website') +Aire::number('age', 'Age') +Aire::range('rating', 'Rating', 1, 10) +``` + +### Date and Time Inputs + +```php +Aire::date('start_date', 'Start Date') +Aire::dateTime('event_at', 'Event Date/Time') +Aire::dateTimeLocal('local_at', 'Local Date/Time') +Aire::time('start_time', 'Start Time') +Aire::month('birth_month', 'Birth Month') +Aire::week('target_week', 'Target Week') +``` + +### Other Inputs + +```php +Aire::color('theme_color', 'Theme Color') +Aire::file('avatar', 'Avatar') +Aire::hidden('user_id', $user->id) +``` + +### Textarea + +```php +Aire::textArea('bio', 'Biography') +``` + +### Select + +```php +// Options as key => value array: +Aire::select(['draft' => 'Draft', 'published' => 'Published'], 'status', 'Status') + +// Timezone select (pre-populated): +Aire::timezoneSelect('timezone', 'Timezone') +``` + +### Checkboxes + +```php +// Single checkbox: +Aire::checkbox('terms', 'I agree to the terms') + +// Checkbox group (multiple values): +Aire::checkboxGroup(['red' => 'Red', 'blue' => 'Blue', 'green' => 'Green'], 'colors', 'Favorite Colors') +``` + +### Radio Buttons + +```php +Aire::radioGroup(['sm' => 'Small', 'md' => 'Medium', 'lg' => 'Large'], 'size', 'Size') +``` + +### Buttons + +```php +Aire::submit('Save') +Aire::button('Cancel') +``` + +### Error Summary + +Display a summary of all validation errors at the top of the form: + +```php +Aire::summary() // Shows error count +Aire::summary()->verbose() // Shows itemized error list +``` + +## Blade Component Syntax + +All elements are available as `` Blade components. Method names become kebab-case attributes: + +```html + + + + + + + + + + +``` + +## Fluent Element Methods + +All elements support chaining. Common methods available on every input element: + +```php +Aire::input('name', 'Name') + ->id('custom-id') // Set the element ID + ->value('default') // Set an explicit value + ->required() // HTML required attribute + ->disabled() // HTML disabled attribute + ->readOnly() // HTML readonly attribute + ->placeholder('Enter name') // Placeholder text + ->autoComplete('name') // Autocomplete attribute + ->autoFocus() // Autofocus attribute + ->addClass('custom-class') // Add CSS class + ->removeClass('old-class') // Remove CSS class + ->data('key', 'value') // data-* attribute + ->variant('lg') // Apply a theme variant + ->variants('lg primary') // Apply multiple variants +``` + +## Grouping (Labels, Help Text, Errors) + +By default, every form element is wrapped in a "group" that renders a label, the input, help text, and validation errors together. This is controlled by the `group_by_default` config option. + +```php +Aire::input('name') + ->label('Full Name') // Set the label text + ->helpText('Enter your legal name') // Help text below the input + ->withoutGroup() // Render input without the group wrapper + ->grouped() // Force grouping (if disabled by default) + ->groupClass('mb-4') // Add CSS class to the group wrapper + ->groupId('name-group') // Set group wrapper ID + ->prepend('$') // Prepend content inside the group + ->append('.00') // Append content inside the group +``` + +## Validation + +### Server-Side Validation Errors + +Aire automatically reads errors from the session (set by Laravel's `validate()` or `FormRequest`) and displays them inline within each element's group. No extra configuration needed. + +### Using a Custom Error Bag + +```php +Aire::open()->errorBag('login') +``` + +### Client-Side Validation + +Aire includes optional JavaScript-based client-side validation using the `validatorjs` library: + +```php +// Pass validation rules directly: +Aire::open() + ->route('users.store') + ->validate([ + 'name' => 'required|min:3', + 'email' => 'required|email', + ]) + +// Or reference a FormRequest class: +Aire::open() + ->route('users.store') + ->validate(StoreUserRequest::class) + +// Disable client-side validation for a specific form: +Aire::open()->withoutValidation() +``` + +## Alpine.js Integration + +Aire can generate `x-data` and `x-model` attributes for Alpine.js: + +```php +Aire::open()->asAlpineComponent() +Aire::open()->asAlpineComponent(['extra_key' => 'value']) +``` + +When enabled, each input element will get an `x-model` attribute matching its name, and the form gets an `x-data` attribute with JSON-serialized initial values. + +## Theming and Customization + +### Publishing Configuration + +```bash +php artisan vendor:publish --tag=aire-config +``` + +This publishes `config/aire.php` where you can set: + +- `default_classes`: CSS classes for each element type +- `variant_classes`: Named style variants (e.g., `sm`, `lg`, `primary`) +- `validation_classes`: CSS classes for validation states (`none`, `valid`, `invalid`) +- `group_by_default`: Whether elements are grouped by default +- `validate_by_default`: Whether client-side validation is on by default + +### Publishing Views + +```bash +php artisan vendor:publish --tag=aire-views +``` + +Override any Blade template in `resources/views/vendor/aire/`. + +### Custom Themes + +```php +// In a service provider: +$aire->setTheme('my-theme-namespace', 'optional-prefix', $configArray); +``` + +## Complete Form Examples + +### Create Form + +```php +{{ Aire::open()->route('posts.store') }} + {{ Aire::summary() }} + {{ Aire::input('title', 'Title')->required() }} + {{ Aire::textArea('body', 'Content') }} + {{ Aire::select(['draft' => 'Draft', 'published' => 'Published'], 'status', 'Status') }} + {{ Aire::submit('Create Post') }} +{{ Aire::close() }} +``` + +### Edit Form with Model Binding + +```php +{{ Aire::open()->resourceful($post) }} + {{ Aire::summary() }} + {{ Aire::input('title', 'Title')->required() }} + {{ Aire::textArea('body', 'Content') }} + {{ Aire::select(['draft' => 'Draft', 'published' => 'Published'], 'status', 'Status') }} + {{ Aire::submit('Update Post') }} +{{ Aire::close() }} +``` + +### Delete Form + +```php +{{ Aire::open()->route('posts.destroy', $post) }} + {{ Aire::submit('Delete Post')->variant('danger') }} +{{ Aire::close() }} +``` + +### Form with Client-Side Validation + +```php +{{ Aire::open()->route('users.store')->validate(StoreUserRequest::class) }} + {{ Aire::summary() }} + {{ Aire::input('name', 'Name')->required() }} + {{ Aire::email('email', 'Email')->required() }} + {{ Aire::password('password', 'Password')->required() }} + {{ Aire::password('password_confirmation', 'Confirm Password')->required() }} + {{ Aire::submit('Register') }} +{{ Aire::close() }} +``` + +### File Upload Form + +```php +{{ Aire::open()->route('avatars.store')->multipart() }} + {{ Aire::file('avatar', 'Profile Photo') }} + {{ Aire::submit('Upload') }} +{{ Aire::close() }} +``` + +### Blade Component Form + +```html + + + + + + + + +``` From a2e73960a8def42eef969d58dd8b69885d803960 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Feb 2026 21:43:06 +0000 Subject: [PATCH 2/4] Trim guideline to bare minimum, rely on skill for details https://claude.ai/code/session_012zEXFUPRKYipGr2kgFshGC --- resources/boost/guidelines/core.blade.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/resources/boost/guidelines/core.blade.php b/resources/boost/guidelines/core.blade.php index f719b62..aed51c3 100644 --- a/resources/boost/guidelines/core.blade.php +++ b/resources/boost/guidelines/core.blade.php @@ -1,15 +1 @@ -## Aire Form Builder - -This project uses **Aire** (`glhd/aire`) for all HTML form rendering. Aire is a Laravel form builder that provides a fluent PHP API and Blade components for building forms with automatic CSRF protection, data binding, validation, and Tailwind CSS styling. - -### Key Conventions - -- **Always use Aire** for building forms. Never write raw `` or `` HTML tags manually. -- Use the `Aire` facade or `` Blade components — never instantiate element classes directly. -- Aire automatically handles CSRF tokens, method spoofing (`PUT`/`PATCH`/`DELETE`), old input repopulation, and validation error display. -- Elements are automatically grouped with their label and error messages by default. -- The default theme uses Tailwind CSS classes. - -### When to Activate the Skill - -Whenever you are working on anything related to forms — creating, editing, debugging, styling, or validating forms — activate the `aire-development` skill for detailed API reference and usage patterns. +This project uses **Aire** (`glhd/aire`) for all HTML form rendering. Always use Aire for forms — never write raw `` or `` tags. When doing any work related to forms, activate the `aire-development` skill. From d5def172bca59e5cf4c62c2f0cf9a00dbdc5d89a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Feb 2026 21:45:42 +0000 Subject: [PATCH 3/4] Remove Blade component examples and custom themes from skill Use only the Aire:: facade API (Blade components are not fully baked). Replace custom themes section with a simpler configuration section. https://claude.ai/code/session_012zEXFUPRKYipGr2kgFshGC --- .../boost/skills/aire-development/SKILL.md | 60 ++----------------- 1 file changed, 6 insertions(+), 54 deletions(-) diff --git a/resources/boost/skills/aire-development/SKILL.md b/resources/boost/skills/aire-development/SKILL.md index 11c460d..9050927 100644 --- a/resources/boost/skills/aire-development/SKILL.md +++ b/resources/boost/skills/aire-development/SKILL.md @@ -1,38 +1,28 @@ --- name: aire-development -description: Build and work with Aire forms in Laravel, including the fluent PHP API, Blade components, data binding, validation, and theming. +description: Build and work with Aire forms in Laravel, including the fluent PHP API, data binding, validation, and customization. --- # Aire Form Development ## When to use this skill -Use this skill when creating, modifying, debugging, or styling HTML forms in a Laravel application that uses the `glhd/aire` package. This includes any work involving form elements, data binding, validation, or form theming. +Use this skill when creating, modifying, debugging, or styling HTML forms in a Laravel application that uses the `glhd/aire` package. This includes any work involving form elements, data binding, validation, or form customization. ## Overview -Aire is a Laravel form builder with a fluent API. It is accessed via the `Aire` facade (`Galahad\Aire\Support\Facades\Aire`) or via `` Blade components. Aire automatically handles CSRF tokens, HTTP method spoofing, old input repopulation, and server-side validation error display. +Aire is a Laravel form builder with a fluent API. It is accessed via the `Aire` facade (`Galahad\Aire\Support\Facades\Aire`). Always use the `Aire::` facade calls — do not use `` Blade components. Aire automatically handles CSRF tokens, HTTP method spoofing, old input repopulation, and server-side validation error display. ## Opening and Closing Forms Every form must be opened and closed. Aire uses output buffering between open and close to capture form fields. -### Facade API - ```php {{ Aire::open()->route('users.store') }} {{-- form fields --}} {{ Aire::close() }} ``` -### Blade Component API - -```html - - {{-- form fields --}} - -``` - ### Setting the Action ```php @@ -173,23 +163,6 @@ Aire::summary() // Shows error count Aire::summary()->verbose() // Shows itemized error list ``` -## Blade Component Syntax - -All elements are available as `` Blade components. Method names become kebab-case attributes: - -```html - - - - - - - - - - -``` - ## Fluent Element Methods All elements support chaining. Common methods available on every input element: @@ -272,9 +245,9 @@ Aire::open()->asAlpineComponent(['extra_key' => 'value']) When enabled, each input element will get an `x-model` attribute matching its name, and the form gets an `x-data` attribute with JSON-serialized initial values. -## Theming and Customization +## Configuration -### Publishing Configuration +Publish the config file to customize Aire's behavior: ```bash php artisan vendor:publish --tag=aire-config @@ -288,21 +261,12 @@ This publishes `config/aire.php` where you can set: - `group_by_default`: Whether elements are grouped by default - `validate_by_default`: Whether client-side validation is on by default -### Publishing Views +You can also publish and override Blade templates: ```bash php artisan vendor:publish --tag=aire-views ``` -Override any Blade template in `resources/views/vendor/aire/`. - -### Custom Themes - -```php -// In a service provider: -$aire->setTheme('my-theme-namespace', 'optional-prefix', $configArray); -``` - ## Complete Form Examples ### Create Form @@ -359,15 +323,3 @@ $aire->setTheme('my-theme-namespace', 'optional-prefix', $configArray); {{ Aire::close() }} ``` -### Blade Component Form - -```html - - - - - - - - -``` From d6fafde0d9bb1d79e92ebb6d8c44ff91c706282c Mon Sep 17 00:00:00 2001 From: Chris Morrell Date: Sat, 14 Feb 2026 17:11:48 -0500 Subject: [PATCH 4/4] Update Aire skill documentation: remove facade preference note and add autoSize() to textarea examples --- resources/boost/skills/aire-development/SKILL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/boost/skills/aire-development/SKILL.md b/resources/boost/skills/aire-development/SKILL.md index 9050927..01e8b86 100644 --- a/resources/boost/skills/aire-development/SKILL.md +++ b/resources/boost/skills/aire-development/SKILL.md @@ -11,7 +11,7 @@ Use this skill when creating, modifying, debugging, or styling HTML forms in a L ## Overview -Aire is a Laravel form builder with a fluent API. It is accessed via the `Aire` facade (`Galahad\Aire\Support\Facades\Aire`). Always use the `Aire::` facade calls — do not use `` Blade components. Aire automatically handles CSRF tokens, HTTP method spoofing, old input repopulation, and server-side validation error display. +Aire is a Laravel form builder with a fluent API. It is accessed via the `Aire` facade (`Galahad\Aire\Support\Facades\Aire`). Aire automatically handles CSRF tokens, HTTP method spoofing, old input repopulation, and server-side validation error display. ## Opening and Closing Forms @@ -275,7 +275,7 @@ php artisan vendor:publish --tag=aire-views {{ Aire::open()->route('posts.store') }} {{ Aire::summary() }} {{ Aire::input('title', 'Title')->required() }} - {{ Aire::textArea('body', 'Content') }} + {{ Aire::textArea('body', 'Content')->autoSize() }} {{ Aire::select(['draft' => 'Draft', 'published' => 'Published'], 'status', 'Status') }} {{ Aire::submit('Create Post') }} {{ Aire::close() }} @@ -287,7 +287,7 @@ php artisan vendor:publish --tag=aire-views {{ Aire::open()->resourceful($post) }} {{ Aire::summary() }} {{ Aire::input('title', 'Title')->required() }} - {{ Aire::textArea('body', 'Content') }} + {{ Aire::textArea('body', 'Content')->autoSize() }} {{ Aire::select(['draft' => 'Draft', 'published' => 'Published'], 'status', 'Status') }} {{ Aire::submit('Update Post') }} {{ Aire::close() }}