Skip to content

Feat: Deliver guidelines as a skill instead of writing into agent files#742

Closed
GoneTone wants to merge 1 commit intolaravel:mainfrom
GoneTone:deliver-guidelines-as-skills
Closed

Feat: Deliver guidelines as a skill instead of writing into agent files#742
GoneTone wants to merge 1 commit intolaravel:mainfrom
GoneTone:deliver-guidelines-as-skills

Conversation

@GoneTone
Copy link
Copy Markdown
Contributor

@GoneTone GoneTone commented Apr 2, 2026

Summary

For agents implementing SupportsSkills, guidelines are now composed into a single skill (laravel-boost-guidelines) written to the agent's skillsPath(), instead of writing the full guideline content directly into files like CLAUDE.md or AGENTS.md. Only a short activation instruction is written to the agent file. Agents not implementing SupportsSkills fall back to the existing behavior.

Benefit

Currently, boost:install and boost:update write all guideline content directly into agent files (CLAUDE.md, AGENTS.md, etc.), which pollutes these files with large amounts of generated content and makes them difficult to manage alongside user-authored content. This change keeps agent files clean by moving the guideline content into the skill system, while still ensuring AI agents are instructed to load the guidelines.

Changes

  • GuidelineSkillAdapter (new) — composes all guidelines into a single skill directory with SKILL.md at the agent's skillsPath()
  • GuidelineWriter::writeSkillActivation() (new) — writes a short activation instruction to the agent's guidelines file, replacing any existing full guideline content
  • InstallCommand::installGuidelinesAsSkill() (new) — branches guideline installation: SupportsSkills agents get the skill + activation instruction, others keep the existing full-guideline write

Why it does not break existing features

  • Non-SupportsSkills agents are unaffected — they continue to receive full guidelines in their agent file
  • For SupportsSkills agents, the existing <laravel-boost-guidelines> tag replacement logic handles the migration seamlessly — the old full content is replaced with the activation instruction on the next boost:install or boost:update
  • If skill writing fails, the code falls back to writing full guidelines to the agent file
  • All existing tests pass, new tests cover the adapter and writer changes

For agents implementing SupportsSkills, guidelines are now composed into
a single skill (laravel-boost-guidelines) in the agent's skillsPath(),
and only a short activation instruction is written to the agent file
(CLAUDE.md, AGENTS.md, etc.). Non-SupportsSkills agents fall back to the
existing full-guideline behavior.

- Add GuidelineSkillAdapter to compose guidelines into a single skill
- Add writeSkillActivation() to GuidelineWriter
- Branch InstallCommand by SupportsSkills capability with fallback
@pushpak1300
Copy link
Copy Markdown
Member

Thanks for your pull request!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain this package, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as an additional package so that the community can still take advantage of your contributions!

@pushpak1300 pushpak1300 closed this Apr 2, 2026
@GoneTone
Copy link
Copy Markdown
Contributor Author

GoneTone commented Apr 2, 2026

Thanks for your pull request!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain this package, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as an additional package so that the community can still take advantage of your contributions!

Thanks for the review!

This change modifies how InstallCommand and GuidelineWriter deliver guidelines internally — it branches the existing installGuidelines() flow based on whether an agent implements SupportsSkills. A separate package wouldn't be able to modify these internal behaviors since there are no extension points (events, hooks, or pipeline) that would allow an external package to intercept and redirect how guidelines are written to agent files.

That said, I completely understand the need to keep the codebase lean. Would it help if I reduced the scope further? The core change is quite small:

  • GuidelineSkillAdapter (49 lines) — composes guidelines into a single skill file
  • GuidelineWriter::writeSkillActivation() (5 lines) — writes the activation instruction
  • InstallCommand::installGuidelinesAsSkill() (12 lines) — branches the flow

The main motivation is that writing all guideline content directly into files like CLAUDE.md and AGENTS.md pollutes these files significantly, making them hard to manage alongside user-authored content. Moving the content into the skill system (which Boost already uses) keeps agent files clean while still delivering the same guidelines.

Happy to adjust the approach if there's a direction that would work better for the team.

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