Add a reusable refund policy or customer support tone guide as a Skill so your AI agent only loads it when the conversation makes it relevant.
Use OnDemand mode to expose guidance as a zero-argument tool the model calls itself, keeping your system prompt short for most requests.
Switch to Lite mode when you have many skills so the model first fetches a list of available guides before picking the one it needs.
Store behavior guides in your database via Eloquent so non-technical team members can update AI instructions without a code deploy.
Requires PHP 8.3+, Laravel 12+, and laravel/ai 0.6 or later, package is experimental RFC infrastructure.
Laravel AI Skills is a PHP package that adds a "Skills" concept to the Laravel AI SDK. The Laravel AI SDK already has the idea of "tools": PHP classes that do something, like looking up a database record or calling an external API. This package argues there is a second type of thing an AI agent often needs: guidance on how to behave in a situation, not an action to take. The package calls these Skills and gives them a proper abstraction: their own base class, their own artisan scaffolding command, their own attribute for registration, and their own delivery modes. A Skill is a PHP class with a guide() method that returns text. That text might be a tone guide for customer support replies, a refund policy, or an escalation procedure. When the AI agent needs to respond to something relevant, it can call the skill to retrieve that guidance, rather than having the guidance baked into every request whether it is needed or not. There are three delivery modes. OnDemand (the default) exposes each skill as a zero-argument tool that the model calls when it decides the guidance is relevant. Full injects the skill content directly into the system prompt on every request, suitable for rules that always apply. Lite is for agents with many skills: it exposes two meta-tools (one that lists available skills, one that fetches a specific skill by name) to keep the tool list short, at the cost of requiring two round-trips before the model has the content it needs. The package includes a helper for structuring the system prompt in the order that benefits AI provider prefix caching: static instructions first, then Full-mode skill content, then any per-request dynamic content like the current user plan. Skills can also be database-driven (returning an Eloquent query result), injected with runtime context, and cached. A Skill::fake() helper makes unit testing straightforward. The package is described as experimental RFC infrastructure: the author is using it in production to gather real-world feedback before proposing the Skills concept as a first-class feature to the laravel/ai maintainers. It requires PHP 8.3+, Laravel 12+, and laravel/ai version 0.6 or later.
← foodlz on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.