Agent Skills: Reusable Knowledge for Agents and Progressive Disclosure
Agent Skills: Reusable Knowledge for Agents and Progressive Disclosure
> **Author**: Addy Osmani (Member of Technical Staff at Anthropic on Claude Code; former Engineering Director at Google Chrome & AI)
> **Original Source**: *Lesson 17: Agent Skills — Reusable Knowledge for Agents* (addyosmani.com)
---
1. Introduction: Tools vs. Skills
Tools give agents hands: they are functions that let models execute actions such as calling REST APIs, querying production databases, and compiling code. **Tools are about doing things.**
**Skills are about knowing things.** A skill packages domain expertise, architectural instructions, best practices, decision frameworks, and reference assets into a modular unit that an AI agent can discover and invoke only when needed.
Think about the difference between handing an engineer a torque wrench (a tool) versus a Boeing maintenance manual (a skill). The wrench allows them to tighten bolts; the manual tells them which bolts to tighten, in what exact sequence, to what torque rating, and what catastrophic failure modes to monitor.
The Kitchen Analogy
A professional kitchen contains tools (knives, pans, induction ranges) and recipe cards. A chef can pick up a knife without instructions. But to execute a specific high-end dish, they require the recipe card: it prescribes which tools to pull, in what order, at what temperature curve, and what acceptable visual output looks like.
Agent skills work identically: they are the recipe cards that dictate how an autonomous agent approaches a task, which tools to coordinate, and what quality gate separates success from failure.
> **Key Takeaway**: Tools let agents act. Skills instruct agents how, when, and under what constraints to act.
---
2. Why Skills Exist: The Context Window Tax
Consider a common scenario: an engineering team deploys an agent to perform code reviews. The team wants the agent to follow a strict review checklist, identify concurrency anti-patterns, and format findings with severity tags.
The naive approach is stuffing all instructions into the system prompt. However, system prompts accumulate debt rapidly. If a team packs code review rules, deployment runbooks, API design standards, and testing conventions into a single monolithic prompt, they end up with a bloated context window and an agent that performs mediocrity across the board.
Skills solve this structural trap through four mechanisms:
1. **Separation of Domain Expertise**: Each skill lives in its own directory, focused strictly on one domain.
2. **On-Demand Loading**: Instructions are pulled into context only when triggered by relevant tasks.
3. **Cross-Agent Portability**: A well-crafted skill runs across Claude Code, Gemini CLI, Codex, and Cursor.
4. **Independent Evolution**: Teams iterate on a skill's rules without re-deploying or restarting the agent harness.
Progressive Disclosure: The 3-Level Loading Architecture
Every token residing in an LLM context window carries a cost: both in billing dollars and in attention degradation. Loading 50,000 tokens of rules at session startup penalizes every subsequent interaction turn.
Skills implement **progressive disclosure** across three distinct layers:
``` [Level 1: Metadata (~100 tokens/skill)] ── Always in startup context (Name + Description) │ (Task matches trigger) ▼ [Level 2: Core Instructions (~2k tokens)] ── Loaded into memory (Workflow, gates, anti-patterns) │ (Explicit reference call) ▼ [Level 3: Deep Resources (On-Demand)] ── Loaded per step (Checklists, schemas, scripts) ```1. **Level 1 (Metadata)**: At startup, the agent loads only the `name` and `description` frontmatter for each installed skill (~100 tokens each). Even with 50 skills installed, the startup footprint remains under 5,000 tokens.
2. **Level 2 (Instructions)**: When a task matches the trigger, the agent reads the main `SKILL.md` body containing ordered workflows, decision gates, and output contracts (recommended under 5,000 tokens).
3. **Level 3 (Resources)**: Files in `references/`, `assets/`, and `scripts/` are parsed only when the Level 2 workflow explicitly demands them.
Empirical measurements demonstrate this architecture compressing a 150,000-token full-lifecycle suite down to ~2,000 tokens at initial handshake.
---
3. Skills vs. Tools vs. Model Context Protocol (MCP)
These three primitives operate across complementary system boundaries:
| Dimension | Skills | Tools / Function Calling | Model Context Protocol (MCP) |
|---|---|---|---|
| **Primary Value** | Structured knowledge and workflows | Executable host functions | Standardized protocol for external integration |
| **Physical Form** | Markdown instructions + reference files | Compiled code / functions | JSON-RPC client-server network protocol |
| **Execution** | Interpreted by LLM reasoning | Deterministic runtime execution | Remote network round-trips over SSE/Stdio |
| **Context Overhead** | Low (Progressive disclosure on demand) | Medium (Schema defined per tool) | Higher (Full schemas loaded upfront) |
| **Analogy** | The engineering recipe card | The machine tool | The standardized electrical wall outlet |
Unified Ecosystem Orchestration
In production agents, all three operate together:
* **The Skill** prescribes the workflow logic: *"Run test suite via `run_tests`, inspect staging health over Kubernetes MCP, and verify deployment via HTTP health probes."*
* **The Tool** carries out deterministic local actions.
* **The MCP Server** provides authenticated conduits into remote infrastructure.
---
4. Engineering Principles for Robust Skills
Writing a production-grade skill differs fundamentally from writing prompts for human readers. Effective skills observe five tenets:
1. Write for the Model, Not a Colleague
Language models require unambiguous trigger conditions, numbered deterministic sequences, explicit error recovery paths, and machine-verifiable output schemas. Avoid vague advice such as *"write clean code"*; state exact constraints: *"functions must not exceed 50 lines; public exports require return type annotations."*
2. Embed Explicit Decision Trees
Real-world execution requires handling forks in the road. Document branching rules explicitly:
```markdown ### Handling Large Pull Requests (>500 lines changed) - Prioritize audit on authentication, data schema migrations, and external endpoints. - Defer cosmetic nits if they do not impact security or runtime behavior. - Recommend splitting the PR when changes span multiple decoupled domains. ```3. Enforce Failure Contracts and Ground Truth
High-reliability skills include anti-rationalization tables: lists of common shortcuts models attempt when under token pressure (e.g., commenting out failing assertions, fabricating mocks, or returning partial scaffolds), paired with rigid counter-instructions.
---
5. Summary
The industry transition from monolithic system prompts to modular Agent Skills represents the maturation of autonomous software engineering. By treating domain knowledge as version-controlled code, development teams unlock scalable agentic workflows without falling into context exhaustion traps.