|
| 1 | +--- |
| 2 | +title: Agent Skills |
| 3 | +--- |
| 4 | + |
| 5 | +import { Callout } from 'fumadocs-ui/components/callout' |
| 6 | + |
| 7 | +Agent Skills are reusable packages of instructions that give your AI agents specialized capabilities. Based on the open [Agent Skills](https://agentskills.io) format, skills let you capture domain expertise, workflows, and best practices that agents can load on demand. |
| 8 | + |
| 9 | +## How Skills Work |
| 10 | + |
| 11 | +Skills use **progressive disclosure** to keep agent context lean: |
| 12 | + |
| 13 | +1. **Discovery** — Only skill names and descriptions are included in the agent's system prompt (~50-100 tokens each) |
| 14 | +2. **Activation** — When the agent decides a skill is relevant, it calls the `load_skill` tool to load the full instructions into context |
| 15 | +3. **Execution** — The agent follows the loaded instructions to complete the task |
| 16 | + |
| 17 | +This means you can attach many skills to an agent without bloating its context window. The agent only loads what it needs. |
| 18 | + |
| 19 | +## Creating Skills |
| 20 | + |
| 21 | +Go to **Settings** (gear icon) and select **Skills** under the Tools section. |
| 22 | + |
| 23 | +Click **Add** to create a new skill with three fields: |
| 24 | + |
| 25 | +| Field | Description | |
| 26 | +|-------|-------------| |
| 27 | +| **Name** | A kebab-case identifier (e.g. `sql-expert`, `code-reviewer`). Max 64 characters. | |
| 28 | +| **Description** | A short explanation of what the skill does and when to use it. This is what the agent reads to decide whether to activate the skill. Max 1024 characters. | |
| 29 | +| **Content** | The full skill instructions in markdown. This is loaded when the agent activates the skill. | |
| 30 | + |
| 31 | +<Callout type="info"> |
| 32 | + The description is critical — it's the only thing the agent sees before deciding to load a skill. Be specific about when and why the skill should be used. |
| 33 | +</Callout> |
| 34 | + |
| 35 | +### Writing Good Skill Content |
| 36 | + |
| 37 | +Skill content follows the same conventions as [SKILL.md files](https://agentskills.io/specification): |
| 38 | + |
| 39 | +```markdown |
| 40 | +# SQL Expert |
| 41 | + |
| 42 | +## When to use this skill |
| 43 | +Use when the user asks you to write, optimize, or debug SQL queries. |
| 44 | + |
| 45 | +## Instructions |
| 46 | +1. Always ask which database engine (PostgreSQL, MySQL, SQLite) |
| 47 | +2. Use CTEs over subqueries for readability |
| 48 | +3. Add index recommendations when relevant |
| 49 | +4. Explain query plans for optimization requests |
| 50 | + |
| 51 | +## Common Patterns |
| 52 | +... |
| 53 | +``` |
| 54 | + |
| 55 | +## Adding Skills to an Agent |
| 56 | + |
| 57 | +Open any **Agent** block and find the **Skills** dropdown below the tools section. Select the skills you want the agent to have access to. |
| 58 | + |
| 59 | +Selected skills appear as chips that you can click to edit or remove. |
| 60 | + |
| 61 | +### What Happens at Runtime |
| 62 | + |
| 63 | +When the workflow runs: |
| 64 | + |
| 65 | +1. The agent's system prompt includes an `<available_skills>` section listing each skill's name and description |
| 66 | +2. A `load_skill` tool is automatically added to the agent's available tools |
| 67 | +3. When the agent determines a skill is relevant to the current task, it calls `load_skill` with the skill name |
| 68 | +4. The full skill content is returned as a tool response, giving the agent detailed instructions |
| 69 | + |
| 70 | +This works across all supported LLM providers — the `load_skill` tool uses standard tool-calling, so no provider-specific configuration is needed. |
| 71 | + |
| 72 | +## Tips |
| 73 | + |
| 74 | +- **Keep descriptions actionable** — Instead of "Helps with SQL", write "Write optimized SQL queries for PostgreSQL, MySQL, and SQLite, including index recommendations and query plan analysis" |
| 75 | +- **One skill per domain** — A focused `sql-expert` skill works better than a broad `database-everything` skill |
| 76 | +- **Use markdown structure** — Headers, lists, and code blocks help the agent parse and follow instructions |
| 77 | +- **Test iteratively** — Run your workflow and check if the agent activates the skill when expected |
| 78 | + |
| 79 | +## Learn More |
| 80 | + |
| 81 | +- [Agent Skills specification](https://agentskills.io) — The open format for portable agent skills |
| 82 | +- [Example skills](https://github.com/anthropics/skills) — Browse community skill examples |
| 83 | +- [Best practices](https://agentskills.io/what-are-skills) — Writing effective skills |
0 commit comments