fix(install): three quality issues affecting generated AI tooling files#790
Open
barrytarter wants to merge 1 commit intolaravel:mainfrom
Open
fix(install): three quality issues affecting generated AI tooling files#790barrytarter wants to merge 1 commit intolaravel:mainfrom
barrytarter wants to merge 1 commit intolaravel:mainfrom
Conversation
Three independent generator bugs surfaced via PR reviews after upgrading
projects from Boost v1 → v2. All three are tooling-quality issues; no
behavioral or breaking changes.
1) GuidelineAssist::appPath() now normalizes path separators to '/'
On Windows, app_path()/base_path() concatenation injects DIRECTORY_SEPARATOR
('\') into the result, while caller-supplied sub-paths use '/'. Without
normalization, $assist->appPath('Http/Kernel.php') returned the mixed
"app\Http/Kernel.php", which then leaked into generated CLAUDE.md content
(e.g. the laravel/v12 guideline). Display paths in markdown should always
use forward slashes regardless of host OS.
2) RendersBladeGuidelines::processBoostSnippets renders captions as #### headings
@boostsnippet("Name", "lang") previously emitted "<!-- Name -->" before the
fenced code block. HTML comments render as visible text in some Markdown
processors, don't contribute to TOC/navigation, and are unconventional in
skill files. Now emits "#### Name" — proper sub-heading that integrates
with the document structure.
3) SkillWriter::copyFile ensures trailing newline on generated skill files
Both .blade.php-rendered and .md-source paths called trim() on content
before writing, stripping the trailing newline. file_put_contents then
wrote the content without restoring it, producing skill files that ended
without "\n" — creating noisy "no newline at end of file" diffs every time
anyone touched the file. Now appends "\n" if missing before writing.
Tests:
- Updated existing appPath tests to assert forward-slash output (was
DIRECTORY_SEPARATOR which masked the Windows bug on Linux CI).
- Added new test "appPath always uses forward-slash separators for guideline
output" covering Windows-style mixed-separator inputs.
- Updated existing boostsnippet tests (3 assertions) to expect "#### Name"
instead of "<!-- Name -->".
- Added new test "writes skill files with a trailing newline" using a fixture
that intentionally lacks a trailing newline, verifying SkillWriter restores
it.
All 10 directly affected tests pass. Pre-existing ToolExecutor failures on
Windows are independent of these changes (verified on upstream/main).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent generator-quality bugs in Boost v2 that surfaced via PR reviews on multiple downstream projects after
composer require --dev laravel/boost:^2.0 && php artisan boost:install. All are tooling-quality issues — no behavioral or breaking changes.GuidelineAssist::appPath()outputs mixed path separators on Windows (e.g.,app\Http/Kernel.php)src/Install/GuidelineAssist.php@boostsnippetdirective renders captions as<!-- Name -->HTML comments instead of Markdown sub-headingssrc/Concerns/RendersBladeGuidelines.phpSkillWriter::copyFilecallstrim()then writes without restoring)src/Install/SkillWriter.phpBug 1 — Path separators
GuidelineAssist::appPath('Http/Kernel.php')does:On Windows,
app_path()andbase_path()concatenate with\while the caller-supplied sub-path uses/. The result isapp\Http/Kernel.php— mixed separators that leak into generatedCLAUDE.mdcontent (notably thelaravel/v12guideline lines likeapp\Console/Kernel.php). Display paths in Markdown should always use forward slashes regardless of host OS.Fix: normalize
\→/on the result.Bug 2 — HTML comment captions
@boostsnippet("Basic Vue Page Component", "vue") ... @endboostsnippetpreviously rendered as:Basic Vue Page Component
Tests: 10 passed (23 assertions) on the touched test files