When to use skills vs tools
| Feature | Tools | Skills |
|---|---|---|
| What it is | A Python function the agent calls | A directory of knowledge the agent reads |
| When it runs | During the agent loop (function execution) | During the agent loop (file reads) |
| Best for | Taking actions (API calls, calculations, mutations) | How-to guides, playbooks, reference docs |
| Schema | Typed Pydantic model | Unstructured markdown + files |
| Side effects | Yes (executes code) | Read-only (by default) |
Creating a skill
A skill is a directory with aSKILL.md file:
SKILL.md format
SKILL.md
name, description) helps the agent decide which skill is relevant. The markdown body is the knowledge content.
Registering skills on an agent
skills_dir and registers each subdirectory as an available skill. The agent can discover and read skills using built-in tools.
Built-in skill tools
When an agent has skills, AFK automatically provides these tools:| Tool | Purpose | Returns |
|---|---|---|
list_skills | List all available skills | [{"name": "...", "description": "..."}] |
read_skill_md | Read a skill’s SKILL.md | Markdown content |
read_skill_file | Read any file in a skill directory | File content |
run_skill_command | Execute a command from a skill’s scripts | Command output |
How the agent uses skills
The agent autonomously decides which skills to read based on the user’s question. You don’t need to explicitly tell it which skill to use.Security controls
File access restrictions
File access restrictions
By default,
read_skill_file only allows reading files within the skill directory. Path traversal (../) is blocked.Command execution policies
Command execution policies
run_skill_command is gated by policy. You can allowlist specific commands:Read-only mode
Read-only mode
To disable command execution entirely, only register the read-only skill tools:
Design guidelines
- One skill per topic. Keep skills focused (e.g.,
deployment,monitoring,database) rather than creating one giant knowledge base. - Write SKILL.md for the agent, not a human. The agent reads this file, so be explicit about what to do in each scenario.
- Include examples. Show the agent what good output looks like.
- Version your skills. Store skills in git alongside your agent code.
- Gate commands. Always use policy rules for
run_skill_command.