Skip to content

Conversation

ashleyhindle
Copy link
Collaborator

@ashleyhindle ashleyhindle commented Aug 27, 2025

What & Why

Inertia released a new <Form> component which makes building forms a lot easier. We want Boost to help AI/users make use of this component, when it's available.

Core

  • Adds initial conditional Inertia form guidelines 🙌 Trying to be mindful of versions, how new <Form> is, and existing project conventions
  • Adds basic Svelte Inertia guidelines

Extra

  • Adds special Inertia GuidelineAssist class to conditionally include guidelines
  • Adds @boostsnippet directive to simplify adding verbatim code snippets without accidentally running PHP code or Vue {{ errors.name }} code being ran

How I tested

Building a feature

  1. Created new Inertia project using Boost via local path in composer.json
  2. Ran boost:install, checked the resulting guidelines
  3. Asked AI to build me forms
    Prompt example:
Can we add a basic form to the homepage @routes/web.php for "Preferred things?" with different questions using different input options (input, select, radio, checkbox, etc..), and on submit we just show a nice markdown file of their preferences?

Manually reading

  1. php all.php > all.md; open all.md to read through all guidelines
  2. ./artisan boost:install; less CLAUDE.md to read through guidelines for this specific test project

Notes/thoughts

  • I did try to add indention removal so conditionals are cleaner (i.e. .ai/inertia-laravel/2/core.blade.php), but when we want indented lists it's problematic. Have to revisit this.
    • In future we might need the ability to conditionally include whole files. React's 'forms.blade.php' is a bit messy with the conditionals being so big, but what if it was just: @if(hasForms()) @include('.forms-with-component.blade.php') @else @include('.forms-without-component.blade.php')? Then we can keep the guidelines separately managed, and instead conditionally include the entire file.
      • This just requires those files to not be auto-included by the composer, so we'd need some exclusion logic there, which is for a future PR.
  • I wanted to check existing Inertia files to see if <Form> is in use, then we can strengthen the language and exclude the useForm part, but that's extra tricky for v1, I think that's a v2 thing.
    • We have to be careful with our language in the guidelines here, as 99% of people aren't using <Form> yet, so we can't enforce that usage bringing their codebase out of alignment.

Demo

CleanShot 2025-08-27 at 15 15 01@2x
CleanShot.2025-08-27.at.15.18.26.mp4

@ashleyhindle ashleyhindle changed the title feat: allow indentation in guidelines and remove in composition feat: guidelines: add Inertia form guidelines Aug 27, 2025
@ashleyhindle ashleyhindle marked this pull request as ready for review August 27, 2025 15:28
@ashleyhindle ashleyhindle merged commit a18c040 into main Aug 27, 2025
10 checks passed
@ashleyhindle ashleyhindle deleted the add-inertia-form-component-guidelines branch August 27, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants