Instructions describe how an agent always behaves. A skill describes how to do one particular job, and only takes up context while that job is at hand.

use Clutch\Laravel\Skills\Skill;
use Clutch\Laravel\Skills\SkillRegistry;

app(SkillRegistry::class)->add(new Skill(
    name: 'refund-policy',
    description: 'How we decide and process a refund.',
    content: <<<'TEXT'
    Refunds under $50 are automatic. Above that, check the account age first...
    TEXT,
));

Or keep them as files, one directory per skill with a SKILL.md inside:

// config/clutch.php
'skills' => ['path' => resource_path('skills')],

The model sees every skill’s name and description, and pulls in the body of the one it needs. Ten procedures pasted into instructions cost tokens on every turn of every session; ten skills cost a line each until one is used.

Give a session a subset when it should not see everything:

Clutch::agent(SupportAgent::class)->withSkills(['refund-policy'])->create();

Back to top

A community package, not affiliated with or endorsed by Laravel. Released under the MIT licence.

This site uses Just the Docs, a documentation theme for Jekyll.