Langchain adapters to support skills in your agent
Project description
Langchain Skills Adapters
Langchain adapters to support skills in your agent.
Features
- Supports the Anthropic Open Standard for Skills
- Follows the principle of progressive disclosure - Only loads skills if they are needed
- Loads skills from anywhere on your system
- Use as a tool or add as middleware to your agents
Installation
uv:
uv add langchain-skills-adapters
pip:
pip install langchain-skills-adapters
Skills Format
The skill directory must be in the following format to be loaded correctly:
skills/
├── skill-name/
│ ├── SKILL.md # Required: instructions + metadata
│ ├── scripts/ # Optional: executable code
│ ├── references/ # Optional: documentation
│ ├── assets/ # Optional: templates, resources
│ └── ... # Any other additional files or directories
└── other skills...
Skills must follow the Anthropic Open Standard for Skills. This includes having frontmatter with at minimum the name and skill description.
---
name: My Skill
description: This is my skill
---
# My Skill
Skill content
Usage
As a Tool
The SkillsTool creates a Langchain tool that can be used by your agent to activate a skill.
The description of the skills tool contains names and descriptions of all available skills from your skill directory.
This way, your agent will always see what skills are available to it before acting, and can use the tool to activate a skill and read its full content.
If your skills directory contains resource files (such as scripts, assets, etc.), you can add a ReadFileTool to enable your agent to read these files.
from langchain.agents import create_agent
from langchain_community.tools.file_management.read import ReadFileTool
from langchain_skills_adapters import SkillsTool
# Create the SkillsTool pointed to your skills directory
skills_dir = "/path/to/skills/"
skills_tool = SkillsTool(skills_dir)
# Optional: Add a file reading tool. Recommended if your agent needs to read resources from your skills directory (scripts, assets, etc.)
read_file_tool = ReadFileTool(root_dir=skills_dir)
# Create the agent
tools = [skills_tool, read_file_tool]
agent = create_agent("openai:gpt-5", tools=tools)
response = agent.invoke(input={"messages": {"role": "user", "content": "What skills do you have?"}})
As Middleware
The SkillsMiddleware is a Langchain middleware that adds skill info to your agent's system prompt before each model call.
It also adds a skills_file_read tool to your agent's tool list, allowing it to read skill files and other resources from your skills directory.
This way, your agent will always see what skills are available to it before acting, and can use the tool to read skill files and other resource files.
from langchain.agents import create_agent
from langchain_skills_adapters import SkillsMiddleware
# Create the SkillsTool pointed to your skills directory
skills_dir = "/path/to/skills/"
skills_middleware = SkillsMiddleware(skills_dir)
# Create the agent
agent = create_agent("openai:gpt-5", middleware=[skills_middleware])
response = agent.invoke(input={"messages": {"role": "user", "content": "What skills do you have?"}})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_skills_adapters-0.1.4.tar.gz.
File metadata
- Download URL: langchain_skills_adapters-0.1.4.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de9307ce8ea665738f0e0eaed4c6c7538bbe30313209f6574083c22230a9c9d
|
|
| MD5 |
b7b977b75549c906657999bcf997e554
|
|
| BLAKE2b-256 |
f5e79a662daf3ba796a70b87cf796ccb150d1db62ea9145db0aeafd2ae46e3c1
|
File details
Details for the file langchain_skills_adapters-0.1.4-py3-none-any.whl.
File metadata
- Download URL: langchain_skills_adapters-0.1.4-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d4c70e42c60b8a3e5c53dfd9e8a92e33df4e0bcc12d0ad6a7a757d8788a2d7
|
|
| MD5 |
dea87922ca10b59e219c163ee2691bc3
|
|
| BLAKE2b-256 |
4e5e86ef6a5141bb6a3a8b169b5330b7a543275f3d5e401346e2d42b4c2d5a8f
|