Documentation Index
Fetch the complete documentation index at: https://docs.selftune.dev/llms.txt
Use this file to discover all available pages before exploring further.
The problem
A skill that starts as 50 lines of markdown tends to grow. You add edge cases, new workflows, reference tables. Before long it’s 800 lines and the agent loads it all into context every time — even when only one workflow is needed. The agent skills spec recommends keeping SKILL.md under 500 lines. But real-world skills often need more than that. The solution is structure.The router pattern
Instead of putting every instruction in SKILL.md, use it as a router — a compact entry point that identifies which workflow the user needs and loads only that workflow’s instructions.- Frontmatter — name, description, trigger keywords
- Router table — maps user intent to a workflow file
- Shared context — only what every workflow needs (e.g., data model basics)
When to split into workflows
Split when you notice:- Distinct entry points — users arrive with different intents (create vs. edit vs. analyze)
- Non-overlapping instructions — the steps for one workflow don’t apply to another
- Growing SKILL.md — you’re past 300 lines and still adding
- All instructions apply to every invocation
- The skill is genuinely simple (under 200 lines)
- Splitting would create workflows with only 20 lines each
Scripts vs. inline instructions
A common question: should the logic live as markdown instructions or as a script? Use markdown instructions when the agent needs judgment — choosing between approaches, adapting to context, interpreting ambiguous input. Use scripts when the logic is deterministic — validation, data transformation, formatting. Scripts are faster, cheaper (no tokens), and more reliable for repeatable operations.CLI error steering
A powerful technique for keeping skills lean: instead of documenting every possible error path in SKILL.md, let your CLI or scripts return actionable error messages that steer the agent.References vs. workflows
| Type | Purpose | When to load |
|---|---|---|
| Workflow | Step-by-step instructions for a specific task | When the router selects it |
| Reference | Lookup tables, schemas, specs | Only when a workflow says to |
Nesting skills vs. composing them
The agent skills spec treats each skill as an independent unit. If you have two related capabilities, you have two options: One skill with multiple workflows — use when the capabilities share context, data models, or are always used together. Separate skills — use when the capabilities are independently useful and don’t share state. Don’t create “meta-skills” that orchestrate other skills unless you have a concrete need. The agent is already good at routing between independent skills.Next steps
Managing Context
Keep your skill’s context footprint small.
Testing Triggers
Verify your skill fires when it should.