Agent with a skill
An agent with two tools and one skill. The tools are what it can do; the skill is prose that shapes how, loaded only when the model decides it needs it. Source .
.agentdeck/
├── agents/handover_desk/agent.py # two @tools + Agent(..., skills=["shift-notes"])
└── skills/shift-notes/SKILL.md # frontmatter + instructions the model loads on demand
run.py # two turns on one session: a lookup, then a noteThe directory name is the skill’s name and must match the name: in its frontmatter.
description: is what the agent sees when deciding whether the skill applies. Both are required,
or Deck.build() fails naming the bundle.
Run it
uv pip install agentdeck-sdk
export OPENAI_MODEL=gpt-4.1-mini OPENAI_API_KEY=sk-...
python run.pyFiling a note writes handover_notes.json into the working directory. That file is the observable
side effect, so delete it between runs if you want a clean one.
What to look at
- A skill is not a tool.
skills=[...]puts itsdescriptionin the agent’s instructions; the model then callsload_skill("shift-notes")to read the prose, and only then writes the note. Watchtool.call.startedand you will seeload_skillfire beforefile_handover_note. - The contract is prose plus a tool call, nothing typed.
SKILL.mdsays to ask before filing if the user has not said what is still open, and the model reading it is the enforcement. Never import a skill’s own module from agent code. - The skill earns its place by changing the output. Ask for a note without it and you get three
invented sentences; with it, the model asks for what is missing first. That is the reason to
reach for a skill instead of a longer
instructionsstring. session_idis what makes the second turn a follow-up. Both runs share one session, so the note turn already knows which shift was discussed.
Last updated on