Install the package in your Laravel project:
composer require --dev llm/skills
Enable the plugin in composer.json:
{
"config": {
"allow-plugins": {
"llm/skills": true
}
}
}
Initialize the config (optional but recommended):
composer skills:init
This creates a skills.json file in your project root with default settings.
Add a skill package to your composer.json:
{
"require-dev": {
"vendor/skill-package": "^1.0"
}
}
Run composer update to install it. The package should declare its skills in extra.skills:
{
"extra": {
"skills": {
"source": "path/to/skills"
}
}
}
Verify skills are synced:
composer skills:show
Check the .agents/skills/ directory for the imported skills.
Integrate a skill for AI-assisted Laravel migrations:
composer require --dev vendor/laravel-migration-skills
skills.json to trust the package:
{
"trusted": ["vendor/*"]
}
composer update to auto-sync the skill..agents/skills/migrate/.Vendor Side:
resources/skills/ directory (e.g., resources/skills/laravel-auth/).SKILL.md with Laravel-specific instructions (e.g., authentication flow templates).composer.json:
{
"extra": {
"skills": {
"source": "resources/skills"
}
}
}
Consumer Side:
composer.json under require-dev.composer update to auto-sync skills to .agents/skills/.SKILL.md for generating Laravel auth controllers).skills.json to create aliases for different agents:
{
"target": ".agents/skills",
"aliases": [".claude/skills", ".cursor/skills"]
}
.claude/skills).--discovery to include packages without explicit extra.skills:
composer skills:update --discovery
composer skills:update vendor/package --trust="vendor/*"
Skill for Artisan Commands:
SKILL.md containing Artisan command templates.# SKILL.md
## Laravel Command Generation
Use this skill to generate Artisan commands for:
- Database seeding
- Queue workers
- Console commands
templates/command.stub file for AI to fill in.Skill for Migration Writes:
SKILL.md for migration logic and templates/migration.stub.SKILL.md:
## Laravel Migration Helper
Generate migrations for:
- Table creation with indexes
- Foreign key constraints
- Soft deletes
Skill for API Resource Handling:
SKILL.md for API resource boilerplate (e.g., App\Http\Resources\PostResource).Auto-Sync in CI:
Ensure skills.json has "auto-sync": true to sync skills during composer install in CI.
Example GitHub Actions step:
- run: composer install
# Skills auto-synced here
- run: php artisan test
Cache Skills in CI:
Add .agents/skills/ to your CI cache (e.g., GitHub Actions cache) to avoid re-downloading skills on every run:
- uses: actions/cache@v3
with:
path: |
vendor
.agents/skills
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
composer skills:update --dry-run
composer skills:show
Trust Misconfiguration:
skills.json under "trusted" or use --trust in CLI:
composer skills:update vendor/package --trust="vendor/*"
composer skills:show to see skipped packages and reasons.Alias Conflicts:
.claude/skills) already exist as directories, causing failures.--alias to override:
composer skills:update --alias=.claude/skills
Auto-Sync Overrides:
composer install --no-scripts disables auto-sync, leaving skills unsynced.skills.json has "auto-sync": true or manually run:
composer skills:update
Malformed skills.json:
composer skills:init to generate a valid template or validate against the schema:
{
"$schema": "https://raw.githubusercontent.com/roxblnfk/skills/master/resources/skills.schema.json"
}
Cross-Platform Alias Issues:
Verbose Output:
Use -v or -vv flags for detailed logs:
composer skills:update -vv
Check Sync Status:
composer skills:show
SKIPPED entries to identify trust or discovery issues.Validate Donor Packages:
Ensure donor packages declare extra.skills correctly. Test with:
composer skills:update --discovery
Manual Sync: For debugging, manually trigger sync:
composer skills:update
Custom Trust Logic:
Override trust behavior by extending the plugin or using --trust dynamically:
composer skills:update --trust="vendor/*" --trust="another/*"
Post-Sync Hooks:
Add a post-update-cmd script in composer.json to run custom logic after sync:
{
"scripts": {
"post-update-cmd": [
"@php artisan skills:update",
"@php artisan your:custom-task"
]
}
}
Custom Target Directory:
Override the default .agents/skills path in skills.json:
{
"target": "custom/skills/path"
}
Dynamic Skill Loading:
Use --discovery to include packages without explicit skill declarations:
composer skills:update --discovery
Service Provider Integration: Load skills dynamically in a service provider:
public function boot()
{
$skillsPath = base_path('.agents/skills');
if (file_exists($skillsPath)) {
$this->loadSkillsFrom($skillsPath);
}
}
Skill-Based Artisan Commands: Create a custom Artisan command to generate files from skills:
// app/Console/Commands/
How can I help you explore Laravel packages today?