Skills require
deepagents>=1.7.0.Usage
Create a top-level skills directory
Create a directory to hold all skills for your project, such as
skills/ under your backend root.Create a subdirectory inside your skills directory for your skill
Each skill is a directory containing a Deep agent skills follow the Agent Skills specification.
SKILL.md file: a markdown file with YAML frontmatter (name and description) followed by instructions the agent follows when the skill is activated. A skill directory can also optionally include supporting files such as scripts, reference docs, and templates.skills
langgraph-docs
SKILL.md
scripts
references
assets
Add a `SKILL.md` file with YAML frontmatter and instructions.
The
SKILL.md starts with YAML frontmatter followed by markdown instructions:Reference any supporting resources in your
SKILL.md with a description of what each file contains and when to use it. The agent discovers these files through the references in the skill instructions.Pass the skills path when creating your agent
Pass the path to your top-level skills directory in the This example uses
skills argument when creating your agent:FilesystemBackend to load skills from disk. For other storage options, including loading skills from remote sources, see Backends and remote skill loading.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 withinvoke(files={...}). Usecreate_file_data()fromdeepagents.backends.utilsto format file contents; raw strings are not supported. - With
FilesystemBackend, skills are loaded from disk relative to the backend’sroot_dir.
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, such as base skills overridden by project-specific versions.Invoke the agent
Send a task to the agent with
invoke(). At startup, the agent loads each skill’s name and description from frontmatter into the system prompt. When your task matches a skill’s description, the agent reads that skill’s SKILL.md and follows its instructions.How skills work
As agents take on more complex tasks, the context they need grows with them. Loading all instructions into the system prompt wastes tokens on information irrelevant to the current task, and providing the same guidance manually across sessions does not scale.Skills use progressive disclosure: the agent loads skill information in layers instead of all at once. At startup, it sees only each skill’s name and description. When a skill is invoked, it reads the full
SKILL.md instructions. Supporting files load afterward, only when the instructions call for them.| Level | What loads | When |
|---|---|---|
| 1. Metadata | name and description from SKILL.md frontmatter | Agent startup, for every configured skill |
| 2. Instructions | Full SKILL.md body | When the skill is invoked |
| 3. Resources | Supporting files under scripts/, references/, and assets/ | As needed after invocation, when the instructions reference them |
SkillsMiddleware handles the first two levels, with the third level being handled by the LLM:
- Discovery (level 1): At agent start, the middleware scans the configured skill paths, parses each
SKILL.mdfrontmatter, and injects thenameanddescriptionfields into the system prompt. - Read (level 2): When the agent invokes a skill, it reads the full
SKILL.mdcontent viaread_file. - Execute (level 3): After invocation, the agent follows the skill’s instructions and reads supporting files (scripts, references, assets) only as the instructions require.
When to use skills
If you find yourself giving similar instructions to an agent, especially if they are detailed and contain multiple steps, consider codifying the instructions for the agent. That way, in future when you want to accomplish a similar task, the agent will already know what to do. Skills are especially helpful for codifying:- Step-by-step workflows: Workflows that span multiple steps, similar to recipes.
- Domain-specific knowledge: Instruct the agent on how to use tools for the workflow. For example, include information on where to pull information from, including other reference information or scripts that the skill may have access to.
- Instructions with executable code: Bundle procedures with scripts or modules the agent can run, so it follows tested logic instead of regenerating it from instructions each time. See Execute code with skills.
- Guidelines: Provide the agent with supporting instructions about guardrails to adhere to. For example, following a specific format or style guide, or specifying to always run tests as part of the workflow.
Write effective skills
The Agent Skills specification includes guidance on structuring skills for reliable discovery and activation. The following recommendations build on that foundation with practical patterns for Deep Agents. Keep frontmatter concise and theSKILL.md body under 5,000 tokens. Every skill’s frontmatter is added to the system prompt at discovery, while the full body is only read when activated. Keeping both layers small means you can load many skills without crowding the context window.
Write specific descriptions. During discovery, the description field is the only information the agent sees for each skill. A good description tells the agent both what the skill does and when to activate it, with specific keywords the agent can match against:
SKILL.md under 500 lines. When instructions grow longer, move detailed reference material into supporting resource files and reference them from the main SKILL.md:
skills
data-pipeline
SKILL.md
references
schema-reference.md
error-codes.md
SKILL.md and avoid deeply nested reference chains, which force the agent through multiple reads to reach the information it needs.
Structure instructions for the agent. Write your SKILL.md body as clear instructions the agent can follow:
- Step-by-step procedures for multi-step workflows
- Decision criteria for choosing between approaches
- Examples of expected inputs and outputs so the agent knows what success looks like
- Edge cases the agent should handle or flag to the user
- Consolidating related capabilities into a single skill with sections for each sub-task
- Using reference files to keep the main
SKILL.mdconcise while covering multiple sub-tasks
Add supporting resources
BeyondSKILL.md, a skill directory can include any additional files or directories. The Agent Skills specification defines three optional directories for common resource types. Deep Agents does not load these files at discovery or activation. The agent reads or executes them only when your SKILL.md instructions say to.
scripts/
The scripts/ directory holds executable code the agent can run, such as API clients, data transforms, or validation checks. Scripts should:
- Be self-contained or clearly document dependencies
- Include helpful error messages
- Handle edge cases gracefully
references/
The references/ directory holds supplementary documentation the agent reads on demand. Use it for material that is too detailed for SKILL.md but still task-specific, such as:
REFERENCE.mdfor detailed technical referenceFORMS.mdfor form templates or structured data formats- Domain-specific guides (
finance.md,legal.md, and similar)
assets/
The assets/ directory holds static resources the agent uses but does not need to read as instructions, such as:
- Document or configuration templates
- Images (diagrams, examples)
- Data files (lookup tables, schemas)
SKILL.md when the agent should open or copy each asset.
Reference files from SKILL.md
When you reference supporting files, use paths relative to the skill root:
SKILL.md. Avoid deeply nested reference chains that force the agent through multiple reads to reach the information it needs.
Backends and remote skill loading
Deep Agents supports different backends depending on how you want to store and manage skill files:StateBackend: Stores files in LangGraph agent state for the current thread.StoreBackend: Stores files in a LangGraph store for durable, cross-thread storage.FilesystemBackend: Reads and writes skill files from disk under a configurableroot_dir.
- StateBackend
- StoreBackend
- FilesystemBackend
Load skills at runtime
When you have a large collection of skills but only a subset is relevant for a given run, select which skills to load based on runtime context such as user role, tenant, or request type. There are two main approaches:Dynamic skill lists
The simplest approach is to construct theskills array before creating the agent. Choose which skill paths to include based on whatever runtime context you have:
Namespaced skills
For multi-tenant applications where each user’s skill set is managed independently, route/skills/ to a StoreBackend with a namespace factory. Populate each namespace with only the skills that user should have access to, and the middleware resolves to the correct set at runtime:
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
skillstocreate_deep_agent. No additional configuration is needed. - Custom subagents: Do not inherit the main agent’s skills. Add a
skillsparameter to each subagent definition with that subagent’s skill source paths.
Skill permissions
Production deployments usually need to control three things: which skills each user can see, whether the agent can modify skill files, and whether writes require human approval. You control visibility with theskills argument and backend routing, access with filesystem permissions, and approval with interrupt_on or permission rules with mode="interrupt".
Share skills across users
To give every user access to the same curated library, route/skills/ to a shared StoreBackend and seed it from your application code or an admin workflow. Use an organization-scoped namespace so all agents in that org resolve to the same store:
- Namespace by org ID for workspace-wide skills (see Enforce read-only skills).
- Namespace by user ID when each user needs an independent library (namespaced skills).
/company-policies/SKILL.md and values that include content and encoding fields. The /skills/ route prefix is stripped before records are read from the store.
For a managed solution that handles skill access, sharing, and workspace-level visibility, see Fleet skills.
You can also combine shared and personal libraries: route /skills/shared/ to an organization-scoped StoreBackend, route /skills/personal/ to a user-scoped backend, and pass both paths in skills. See Allow agents to write skills.
Limit skills by user context
Not every user should see every skill. Control which skills load at runtime based on role, tenant, or other request context. There are two main approaches:- Dynamic skill lists — Build the
skillsarray before creating the agent. Pass different path lists for different roles or request types. Works when skills live in a shared backend and you filter by path. - Namespaced skills — Route
/skills/to aStoreBackendwith a namespace factory keyed on user or tenant ID. Populate each namespace with only the skills that identity should access.
Enforce read-only skills
To share skills without letting agents modify them, route/skills/ to a shared store and deny write operations under /skills/** with filesystem permissions. The agent can discover and read skills; only your application code or an admin workflow updates the store.
Require approval for skill writes
If agents may write to skill files but you want a human in the loop first, use eitherinterrupt_on or a permission rule with mode="interrupt". Both pause before write_file or edit_file runs and use the same resume flow.
interrupt_on={"write_file": True, "edit_file": True} to require approval for all filesystem writes, not only skills paths. See Human-in-the-loop for handling and resuming interrupts.
Allow agents to edit personal skills
By default, agents can write to skill files if the backend permits it and no permission rule blocks the path. To let agents create or refine skills without touching shared libraries:- Route a writable path such as
/skills/personal/to a user-scopedStoreBackend. - Pass that path (along with any shared paths) in
skills. - Do not add a
denyrule for the writable path. Place more specific rules before broader deny rules if you mix shared and personal paths (rule ordering).
write_file and edit_file to create or update SKILL.md and supporting files under the writable path. To capture general learnings outside the skills format, route a separate path such as /memories/ to another writable backend. See Backends for routing and store setup.
Execute code with skills
Without code execution, skills are passive: the agent reads instructions and follows them using its available tools. Code execution turns skills into active capabilities. A skill can ship a tested script that calls an API, transforms data, validates output, or runs a pipeline — and the agent executes it deterministically rather than regenerating the logic from instructions each time. This is especially valuable for workflows that require exact behavior (data transformations, API integrations, compliance checks) or that depend on libraries the agent cannot use through tool calls alone. Skills support code execution in two ways:- Sandbox scripts when the agent needs to install dependencies, run tests, call CLIs, or work with an operating-system filesystem.
- Interpreter skills when the agent needs reusable, importable helpers available from interpreter code.
Sandbox scripts
Skills can include scripts alongside theSKILL.md file. Reference scripts in your SKILL.md so the agent knows they exist and when to run them:
skills
arxiv-search
SKILL.md
scripts
search.ts
before_agent: Read skill files from the backend and upload them into the sandbox so the agent can execute scripts from the start.after_agent: Download any updated or newly created skill files from the sandbox and write them back to the backend so changes persist across runs.
Interpreter skills
Interpreter skills 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. Instead of asking the model to re-create a parser, 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
Add an entrypoint
Add a
metadata.entrypoint key to the skill’s SKILL.md frontmatter. The value is a JavaScript or TypeScript file path relative to the skill directory.Configure skills normally
Pass the skill source path with the
skills argument when creating the agent.Use the same backend
Configure the interpreter middleware with the same backend that
SkillsMiddleware uses to load skill files.skills
order-helpers
SKILL.md
scripts
index.ts
Troubleshooting
Use LangSmith traces to debug skill discovery,read_file calls on SKILL.md, and supporting resource access. Follow the tracing quickstart to get set up. We recommend you also set up LangSmith Engine, which monitors your traces, detects issues, and proposes fixes.
Skill not activated
Problem: The agent handles the task without reading the skill’sSKILL.md.
Solutions:
-
Make the description more specific. The agent selects skills from the
descriptionfield alone at discovery. Include what the skill does, when to use it, and keywords the agent can match: - Reduce overlap between skills. If multiple skills have similar descriptions, the agent may skip the right one or pick the wrong one. Differentiate descriptions or consolidate related skills.
-
Confirm the skill is in the
skillsarray. Skills load only from paths you pass at agent creation or from subagent-specificskillsparameters.
Skills missing at startup
Problem: The agent does not list a skill in its system prompt, orread_file on SKILL.md fails.
Solutions:
-
Check the skill path. Paths must use forward slashes and be relative to the backend root. With
FilesystemBackend, the path is relative toroot_dir. WithStateBackend, pass skill files ininvoke(files={...})usingcreate_file_data(). -
Validate
SKILL.mdfrontmatter. Thenamemust match the parent directory name and follow the Agent Skills specification. Use theskills-refvalidation tool to check formatting. -
Check file size. Deep Agents skips
SKILL.mdfiles over 10 MB during discovery. - Check layered sources. When the same skill name appears in multiple sources, the last source wins. An older or empty skill from a later path can override the one you expect.
Supporting files not found
Problem: The agent readsSKILL.md but cannot access scripts, references, or assets.
Solutions:
-
Reference files from
SKILL.md. The agent does not auto-discover supporting files. State what each file contains and when to use it. Use relative paths from the skill root. - Keep paths within the skill directory. File paths resolve against the backend. Confirm supporting files exist at the paths your instructions reference.
- Sync skills into sandboxes. If you use sandbox backends, skill files outside the container are not available until you copy them in. See Sandbox scripts and syncing skills and memories with custom middleware.
Scripts or imports fail
Problem: The agent reads a script but cannot run it, orimport("@/skills/<name>") fails in the interpreter.
Solutions:
- Use a sandbox for shell execution. The agent can read scripts from any backend, but running them requires a sandbox backend. See Execute code with skills.
-
Configure interpreter middleware. Interpreter skills require
metadata.entrypointinSKILL.mdfrontmatter and interpreter middleware with the same backend that loads skill files. -
Match skill and interpreter backends. If
SkillsMiddlewareand the interpreter use different backends, import paths may not resolve to the files you expect.
Subagent cannot access a skill
Problem: A custom subagent does not see skills that the main agent uses. Solution: Custom subagents do not inherit the main agent’s skills. Add askills parameter to each subagent definition with that subagent’s skill source paths. The general-purpose subagent inherits skills from create_deep_agent automatically.
Reference
Skills, memory, and tools
Skills, memory (AGENTS.md files), and tools all provide context or capabilities to the agent. The following table summarizes when to reach for each:
| Skills | Memory | Tools | |
|---|---|---|---|
| Purpose | On-demand capabilities discovered through progressive disclosure | Persistent context loaded at startup | Programmatic actions the agent can call |
| Loading | Read only when the agent determines relevance | Loaded at agent start | Available every turn |
| Format | SKILL.md in named directories | AGENTS.md files | Functions bound to the agent |
| Layering | User, then project (last wins) | User, then project (combined) | Defined at agent creation |
| Use when | Instructions are task-specific and potentially large | Context is always relevant (project conventions, preferences) | The agent needs a programmatic action, or does not have access to the file system |
Frontmatter fields
The Agent Skills specification defines the following frontmatter fields:| Field | Required | Description |
|---|---|---|
name | Yes | Lowercase alphanumeric with hyphens, 1-64 characters. Must match the parent directory name. |
description | Yes | What the skill does and when to use it. Max 1,024 characters. |
license | No | License name or reference to a bundled license file. |
compatibility | No | Environment requirements (system packages, network access). Max 500 characters. |
metadata | No | Arbitrary key-value pairs for additional properties. |
allowed-tools | No | Space-separated list of pre-approved tools the skill can use. Experimental. |
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

