Agent Architecture/Workflow Patterns
Intermediate10 min

Skills: On-Demand Specialization

The Skills pattern loads specialized prompts and knowledge on-demand via progressive disclosure — the agent stays in control while skills inject expertise only when relevant.

Quick Reference

  • Skills are prompt-driven specializations — not separate agents, but on-demand knowledge injection
  • Progressive disclosure: the agent sees skill summaries first, loads full content only when relevant
  • SKILL.md files with frontmatter metadata define each skill's trigger conditions and content
  • Skills vs. subagents: skills keep one agent in control, subagents delegate to separate agents
  • Skills vs. memory: skills are on-demand (loaded when relevant), memory is always injected
  • Hierarchical skills support parent-child relationships for complex domain coverage

What Are Skills?

Agent ContextAlways loaded (~1K tokens)sql-expertapi-designsecuritytestingloadssql-expertFull content (~1.5K tokens)Use CTEs over subqueriesAdd index suggestionsParameterize inputsWithout SkillsAll 20 skills loaded = 30K tokensContext window overloadedWith SkillsSummaries + 2 active = 4K tokens87% context savings87% saved

Summaries always in context (~50 tokens each) → full skill loaded only when activated

Definition

A Skill is a specialized prompt + knowledge bundle that an agent loads on-demand. Instead of stuffing every capability into the system prompt, skills let the agent progressively discover and load expertise only when the task requires it. The agent stays in control — skills augment its knowledge, they don't replace its decision-making.

Think of skills like reference books on a shelf. The agent can see the titles (summaries) at all times, but only pulls a book off the shelf and reads it when the current task requires that knowledge. This keeps the context window lean while still giving the agent access to deep expertise across many domains.

AspectSkillsSubagentsTools
What it isPrompt/knowledge injectionSeparate agent executionCode execution
Context impactAdds to current agent's contextIsolated context windowMinimal (just result)
ControlAgent stays in controlDelegated to subagentAgent calls and gets result
Best forDomain expertise, workflowsComplex parallel tasksDeterministic operations
OverheadLow (prompt injection)High (new agent instance)Low (function call)