scalable/ai/agentic patterns/lesson 02 cph / /
lesson 02 / 07 · 14 min · updated ·

skills — the smallest unit

a tool call plus the prompting, validation, and return-shape glue around it. reusable across agents.

what a skill is

a skill is the smallest reusable unit in the pattern vocabulary. it's a tool call plus everything around it that the tool call needs to be safe and composable: a name the llm sees, a description that tells it when to reach for the skill, an input check that fires before anything runs, an output check that fires before anything is trusted, and the handler itself. if you've written tool-use with any sdk, you've written most of a skill. the pattern is about treating it as a first-class object.

skills are defined once, used by many agents. a persona picks a subset it's allowed to use; the skill itself has no idea which persona called it. that's the whole point of the separation.

the shape, runnable

define a skill — click run
ready

four things to notice, because each one breaks if you forget it:

validation fires before the api call

try an invalid input — validation catches it
ready

the skill threw ValidationError before run executed. in a real system, that means the hallucinated 9-hour booking never hit your calendar api. tweak the durationMin to 60 and the validation passes — the skill runs end-to-end.

reuse across personas

same skill, two personas, different guardrails
ready

this is the payoff. book_slot lives in both the scheduler's toolbox and the assistant's toolbox, but each persona wraps it with different guardrails. the assistant needs to confirm before booking; the scheduler doesn't. neither change touches the skill itself.

why this matters. in a real codebase you'll end up with 30–80 skills long before you have 30 agents — i crossed the 40-skill line on my first production agent and the cleanup was painful. treating them as reusable, independently testable objects is the difference between a library you grow and a copy-paste sprawl you regret.

when it breaks

next up: extensions, the middleware pattern that wraps the loop around a skill — memory injection, retries, telemetry, safety.

scalable labs·cvr 30091604·github·linkedin·hello@scalable.dk