A useful agent often needs many different procedures at its fingertips: how to review code, how to deploy a service, how to onboard a new user, how to file a support ticket. Put all of that into the system prompt and the prompt swells: the model’s attention gets diffuse and you burn tokens on every call for instructions the current request does not need. That is what skills are for. Each skill is a folder on disk with aDocumentation Index
Fetch the complete documentation index at: https://docs.motus.lithosai.com/llms.txt
Use this file to discover all available pages before exploring further.
SKILL.md file that carries a short description and a longer instruction body. The agent only sees the descriptions up front. When a user request matches one, the agent calls load_skill(...) to pull in the full instructions (and any companion files) just for that turn.
Anatomy of a skill
A skill is a directory that contains at least aSKILL.md file. Everything else in the folder (reference docs, checklists, templates) is optional and lives alongside it.
SKILL.md is markdown with YAML frontmatter:
| Field | Purpose | Default |
|---|---|---|
name | Identifier the agent uses to load this skill. | Directory name |
description | One-line summary the agent reads when deciding whether to load. | Empty string |
Wiring skills into an agent
Passskills_dir to builtin_tools() and the agent picks up a load_skill tool automatically:
load_skill tool shows up next to the other built-in tools. Without skills_dir, load_skill is simply absent and the rest still work.
Directories that do not exist log a warning and yield zero skills. Subdirectories without a SKILL.md are silently skipped. A subdirectory with a malformed SKILL.md logs a warning and is skipped. YAML keys beyond name and description (like version:) are parsed but ignored. Calling load_skill("bogus_name") returns a helpful error string listing the available skills, rather than raising.
What the agent actually sees
When you wire skills in, theload_skill tool’s description is auto-generated and lists every skill by name and description:
description field in your SKILL.md is load-bearing. A vague description like "Deployment stuff" usually loses to a specific one like "Deploy an agent to the Motus cloud".
How a turn with skills unfolds
Discovery (at agent construction)
builtin_tools(skills_dir=...) scans the directory once, parses every SKILL.md it finds, and builds the load_skill tool. The agent never re-scans at runtime.Matching (during the turn)
The model reads the tool descriptions (including the skill listing) and decides whether the user’s request matches a skill. If yes, it calls
load_skill("skill_name").Loading and follow-up
The tool returns a string that starts with
Skill directory: /abs/path/to/skills/code_review and then the full instructions. The directory path is right there, so the agent can reach for its file tools (read_file, glob_search) to pull in companion files from the same folder as it needs them.load_skill tool definition.
Skills are instruction-shaped, not action-shaped. Loading a skill only adds text to the conversation; it does not fire other tools or mutate state. If a skill tells the agent to run a command, the agent still has to call the relevant tool itself. Skills are scoped per agent (whatever
skills_dir you passed to that one builtin_tools call) and are not dynamic: new SKILL.md files dropped into the folder after construction do not show up until you rebuild the agent.A concrete example
Here is what a request looks like end to end with the bundled example:Writing skills that work
A few habits that pay off:- One skill per task. Separate
deployandrollbackskills are easier to match and safer to follow than a singledeploymentskill that tries to do both. A big skill tends to get loaded for everything adjacent, and the agent wanders. - Push heavy reference material into companion files.
SKILL.mdshould cover the workflow and link out; a 400-line API table belongs in a companion file the agent reads only when it needs it. - Write instructions like you would for a careful junior. Numbered steps, bold labels, explicit output formats. The agent follows these as directives, not as suggestions.
Skills vs. system prompt vs. tools
They all add behavior, but they answer different questions.| Mechanism | When to reach for it |
|---|---|
| System prompt | Identity, global rules, the agent’s persona. Always in context. |
| Tools | Actions with side effects (run a command, read a file, call an API). |
| Skills | Procedures the agent occasionally needs to follow, not always. Instruction-shaped, not action-shaped. |
Where to go next
Tools
How built-in tools, custom tools, and guardrails fit together.
Agents
Wiring agents, system prompts, and memory.
Memory
What stays in context across turns, and how to keep it bounded.
Example on GitHub
Runnable
research and code_review skills with an agent that uses them.
