All skills
asyrafhussin avatar

/laravel-ai-sdk

@7221662

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.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/laravel-ai-sdk

This session only. Nothing lands on disk.

rulesagent-anonymous.md

≈516 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Anonymous Agents

Impact: MEDIUM (Quick AI interactions without dedicated agent classes)

Use the agent() function for one-off prompts that don't warrant a dedicated agent class. Supports instructions, messages, tools, and structured output inline.

Bad Example

// Creating a full agent class for a single-use, trivial prompt
// app/Ai/Agents/QuickTranslator.php — overkill for a one-liner
class QuickTranslator implements Agent
{
    use Promptable;

    public function instructions(): string
    {
        return 'You translate text to French.';
    }
}

// Used exactly once
$response = (new QuickTranslator)->prompt('Hello, how are you?');

Good Example

use function Laravel\Ai\{agent};

// Simple anonymous agent
$response = agent(
    instructions: 'You are an expert at software development.',
)->prompt('Tell me about Laravel');
// Anonymous agent with structured output
use Illuminate\Contracts\JsonSchema\JsonSchema;
use function Laravel\Ai\{agent};

$response = agent(
    schema: fn (JsonSchema $schema) => [
        'number' => $schema->integer()->required(),
    ],
)->prompt('Generate a random number less than 100');

$number = $response['number']; // int
// Anonymous agent with tools and messages
use function Laravel\Ai\{agent};

$response = agent(
    instructions: 'You are a helpful assistant.',
    messages: $previousMessages,
    tools: [new MyCustomTool],
)->prompt('Search for relevant documents');

Why

  • No boilerplate: Skip creating a class for trivial, one-off prompts
  • Full-featured: Supports instructions, tools, messages, and structured output
  • Inline: Keep simple AI calls close to where they're used
  • Upgrade path: Extract to a dedicated agent class when complexity grows

Reference: Laravel AI SDK — Anonymous Agents

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk MEDIUM
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive guide for the Laravel AI SDK but contains deceptive metadata claiming authorship by the 'Laravel Community' despite being associated with the user 'asyrafhussin'. It also presents an indirect prompt injection surface by documenting patterns for ingesting untrusted data (such as transcripts and external URLs) while granting agents capabilities like file system storage and network access.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7221662. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 7 months ago
Other metadata
metadata
{
  "author": "Laravel Community",
  "version": "1.0.0",
  "laravelVersion": "13.x",
  "phpVersion": "8.3+"
}

README badge

README badge for asyrafhussin/agent-skills/laravel-ai-sdk