Skip to main content
Skills are reusable agent capabilities that provide specialized workflows and domain knowledge. You can use Agent Skills to provide your deep agent with new capabilities and expertise. For ready-to-use skills that improve your agent’s performance on LangChain ecosystem tasks, see the LangChain Skills repository. Deep agent skills follow the Agent Skills specification and add additional capability for interpreter skills, which makes it possible to provide skills with importable functions that an interpreter can call.

What are skills

Skills are a directory of folders, where each folder has one or more files that contain context the agent can use:
  • A SKILL.md file containing instructions and metadata about the skill
  • Additional scripts (optional)
  • Additional reference info, such as docs (optional)
  • Additional assets, such as templates and other resources (optional)
Any additional assets (scripts, docs, templates, or other resources) must be referenced in the SKILL.md file with information on what the file contains and how to use it so the agent can decide when to use them.

How skills work

When you create a deep agent, you can pass in a list of directories containing skills. As the agent starts, it reads through the frontmatter of each SKILL.md file. When the agent receives a prompt, the agent checks if it can use any skills while fulfilling the prompt. If it finds a matching prompt, it then reviews the rest of the skill files. This pattern of only reviewing the skill information when needed is called progressive disclosure.

Example

You might have a skills folder that contains a skill to use a docs site in a certain way, as well as another skill to search the arXiv preprint repository of research papers:
The SKILL.md file always follows the same pattern, starting with metadata in the frontmatter and followed by the instructions for the skill. The following example shows a skill that gives instructions on how to provide relevant langgraph docs when prompted:
The referenced helper code would be placed in index.ts:
For more example skills, see Deep Agents example skills.
ImportantRefer to the full Agent Skills Specification for information on constraints and best practices when authoring skill files. Notably:
  • The description field is truncated to 1024 characters if it exceeds that length.
  • In Deep Agents, SKILL.md files must be under 10 MB. Files exceeding this limit are skipped during skill loading.

Full example

The following example shows a SKILL.md file using all available frontmatter fields:

Usage

Pass the skills directory when creating your deep agent:
skills
list[str]
List of skill source paths.Paths must be specified using forward slashes and are relative to the backend’s root.
  • If omitted, no skills are loaded.
  • When using StateBackend (default), provide skill files with invoke(files={...}). Use create_file_data() from deepagents.backends.utils to format file contents; raw strings are not supported.
  • With FilesystemBackend, skills are loaded from disk relative to the backend’s root_dir.
Later sources override earlier ones for skills with the same name (last one wins).
The SDK only loads the sources you pass in skills. It does not automatically scan CLI directories such as ~/.deepagents/... or ~/.agents/....For CLI storage conventions, see App data.
If you want CLI-style layering in SDK code, pass all desired sources explicitly in lowest-to-highest precedence order:
Then pass that ordered list as skills when creating your agent.

Source precedence

When multiple skill sources contain a skill with the same name, the skill from the source listed later in the skills array takes precedence (last one wins). This lets you layer skills from different origins.

Skills for subagents

When you use subagents, you can configure which skills each type has access to:
  • General-purpose subagent: Automatically inherits skills from the main agent when you pass skills to create_deep_agent. No additional configuration is needed.
  • Custom subagents: Do not inherit the main agent’s skills. Add a skills parameter to each subagent definition with that subagent’s skill source paths.
Skill state is fully isolated: the main agent’s skills are not visible to subagents, and subagent skills are not visible to the main agent.
For more information on subagent configuration and skills inheritance, see Subagents.

What the agent sees

When skills are configured, a “Skills System” section is injected into the agent’s system prompt. The agent uses this information to follow a three-step process:
  1. Match—When a user prompt arrives, the agent checks whether any skill’s description matches the task.
  2. Read—If a skill applies, the agent reads the full SKILL.md file using the path shown in its skills list.
  3. Execute—The agent follows the skill’s instructions and accesses any supporting files (scripts, templates, reference docs) as needed.
Write clear, specific descriptions in your SKILL.md frontmatter. The agent decides whether to use a skill based on the description alone—detailed descriptions lead to better skill matching.

Execute code with skills

Skills support code execution in two ways:

Use interpreter skills

Interpreter skills are skills that expose code modules to an interpreter. Regular skills give the agent instructions and context. Interpreter skills also give the agent importable functions it can call from interpreter code. This lets you package domain-specific logic once and make it available as a deterministic building block inside the agent’s workspace. Instead of asking the model to re-create a parser, scorer, normalizer, validator, or aggregation routine from scratch, the agent can import a tested helper and compose it with tools, subagents, and runtime state. Use interpreter skills for code that should be:
  • Reusable across prompts, agents, or projects.
  • Deterministic enough that you want the same behavior every time.
  • Too detailed to keep in the model context as instructions.
  • Useful inside larger workflows, such as scoring search results, normalizing API responses, validating records, grouping rows, or converting data into a report-ready shape.
To make a skill importable:
1

Add a module entry

Add a module key to the skill’s SKILL.md frontmatter. The value is a JavaScript or TypeScript file path relative to the skill directory.
2

Configure skills normally

Pass the skill source path with the skills argument when creating the agent.
3

Use the same backend

Configure the interpreter middleware with the same backend that SkillsMiddleware uses to load skill files.
4

Import from interpreter code

The agent imports the helper module with await import("@/skills/<name>").
Minimal skill layout:
Then configure the agent:
The agent can now import the module from interpreter code:

Execute skill scripts in a sandbox

Skills can include scripts alongside the SKILL.md file, such as, for example, a Python file that performs a search or data transformation. The agent can read these scripts from any backend, but to execute them, the agent needs access to a shell — which only sandbox backends provide. When you use a CompositeBackend that routes skills to a StoreBackend for persistence while using a sandbox as the default backend, skill files live in the store rather than in the sandbox is where code runs. For sandboxes to be able to use the scripts, you must use custom middleware to upload skill scripts into the sandbox before the agent starts:
The middleware’s before_agent hook runs before each agent invocation, reading skill files from that shared namespace and uploading them into the sandbox filesystem. Once synced, the agent can execute scripts with the execute tool just like any other file in the sandbox. For a more complete example that also syncs memories bidirectionally, see syncing skills and memories with custom middleware.

Skills vs. memory

Skills and memory (AGENTS.md files) serve different purposes:

When to use skills and tools

These are a few general guidelines for using tools and skills:
  • Use skills when there is a lot of context to reduce the number of tokens in the system prompt.
  • Use skills to bundle capabilities together into larger actions and provide additional context beyond single tool descriptions.
  • Use tools if the agent does not have access to the file system.
Trace how your agent discovers and executes skills with LangSmith. Follow the observability quickstart to get set up.