skills/laravel-ai-sdk/SKILL.md
Laravel AI SDK for building AI-powered features. Use when creating agents, generating images or audio, working with embeddings, vector search, or testing AI features. Triggers on tasks involving laravel/ai, AI agents, tool-calling, structured output, streaming, embeddings, reranking, or AI faking in tests.
npx skillsauth add asyrafhussin/agent-skills laravel-ai-sdkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive guide for building AI-powered features with the Laravel AI SDK (laravel/ai). Contains 17 rules across 7 categories covering agents, tools, media generation, embeddings, vector stores, and testing.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Agents | CRITICAL | agent- |
| 2 | Tools | HIGH | tool- |
| 3 | Embeddings & Search | HIGH | embed- |
| 4 | Media Generation | MEDIUM | media- |
| 5 | Files & Storage | MEDIUM | files- |
| 6 | Infrastructure | MEDIUM | infra- |
| 7 | Testing | HIGH | test- |
agent-create-configure - Create agents with artisan, PHP attribute configurationagent-prompting - Prompt agents, conversation context, RemembersConversationsagent-structured-output - Structured output with JSON schemaagent-streaming-async - Streaming, broadcasting, and queueing responsesagent-middleware - Agent middleware pipelineagent-anonymous - Anonymous agents for quick interactionstool-create - Create custom tools with schema and handle methodtool-provider - Provider tools: WebSearch, WebFetch, FileSearch, SimilaritySearchembed-generate-cache - Generate, store, and cache vector embeddingsembed-rerank - Rerank documents and collections by relevancemedia-images - Generate, store, and queue imagesmedia-audio-transcription - Text-to-speech and speech-to-textfiles-vector-stores - File storage and vector stores for RAGinfra-failover - Automatic provider failover for resiliencetest-agents - Fake agents, assert prompts, prevent stray promptstest-media - Fake images, audio, and transcriptionstest-data - Fake embeddings, reranking, files, and vector stores<?php
namespace App\Ai\Agents;
use Laravel\Ai\Contracts\Agent;
use Laravel\Ai\Promptable;
class SalesCoach implements Agent
{
use Promptable;
public function instructions(): string
{
return 'You are a sales coach, analyzing transcripts and providing feedback.';
}
}
use App\Ai\Agents\SalesCoach;
$response = SalesCoach::make()->prompt('Analyze this sales transcript...');
return (string) $response;
use Laravel\Ai\Image;
$image = Image::of('A donut sitting on the kitchen counter')
->landscape()
->generate();
$path = $image->store();
use Illuminate\Support\Str;
$embeddings = Str::of('Napa Valley has great wine.')->toEmbeddings();
use App\Ai\Agents\SalesCoach;
SalesCoach::fake(['First response', 'Second response']);
SalesCoach::make()->prompt('Analyze this...');
SalesCoach::assertPrompted('Analyze this...');
Read individual rule files for detailed explanations and code examples.
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
development
Laravel 13 conventions and best practices. Use when creating controllers, models, migrations, validation, services, or structuring Laravel applications. Triggers on tasks involving Laravel architecture, Eloquent, database, API development, or PHP patterns.
tools
Git best practices, branching strategies, commit conventions, and PR workflows. Use when reviewing git history, writing commits, setting up branching strategy, or improving git practices. Triggers on "git best practices", "commit message", "branching strategy", or "PR workflow".
tools
End-to-end testing with Playwright for web applications. Use when writing E2E tests, browser automation, form submission testing, or user flow testing. Triggers on "playwright", "e2e test", "browser test", "end-to-end", "form flow testing", or test files in tests/e2e/.
development
Detect AI-generated code patterns ("slop") in PHP/Laravel and TypeScript/React source — comment narration, generic naming, premature interfaces, defensive overdose, mock-everything tests, and the absence of human "scars". Use when reviewing AI-assisted PRs, auditing code for taste/quality (not metrics — that's technical-debt), or hardening a code-review checklist. Triggers on "review for AI slop", "find AI patterns", "check code feels human", "audit code-quality taste".