agentskills-langchain
LangChain integration for the Agent Skills SDK - turn a skill registry into LangChain tools.
Generates a set of LangChain StructuredTool instances from a SkillRegistry, ready to be passed to any LangChain agent.
Installation
pip install agentskills-langchain
Requires Python 3.12 or newer. Installs agentskills-core and langchain-core as dependencies.
Usage
from pathlib import Path
from agentskills_core import SkillRegistry
from agentskills_fs import LocalFileSystemSkillProvider
from agentskills_langchain import get_tools, get_tools_usage_instructions
# Set up registry
provider = LocalFileSystemSkillProvider(Path("./skills"))
registry = SkillRegistry()
await registry.register("incident-response", provider)
# Build tools + system prompt
tools = get_tools(registry)
catalog = await registry.get_skills_catalog(format="xml")
instructions = get_tools_usage_instructions()
system_prompt = f"{catalog}\n\n{instructions}"
Pass tools to your LangChain agent and inject system_prompt into the system message. The catalog tells the agent what skills exist; the usage instructions tell it how to use the tools.
Generated Tools
| Tool | Parameters | Description |
|---|---|---|
get_skill_metadata |
skill_id |
Get structured metadata (name, description, etc.) |
get_skill_body |
skill_id |
Load the full markdown instructions |
list_skill_resources |
skill_id |
List bundled references, scripts and assets |
get_skill_reference |
skill_id, name |
Read a reference document |
get_skill_script |
skill_id, name |
Read a script |
get_skill_asset |
skill_id, name |
Read an asset |
All tools are async-compatible (StructuredTool with coroutine).
list_skill_resources returns a JSON object keyed by resource kind. Not every backend can enumerate resources — a plain static HTTP host cannot. Rather than surfacing an exception, the tool returns {"supported": false, "note": "..."} in that case: "this cannot be listed" is something the model can act on by falling back to the names in the skill body, not an error worth retrying.
API
get_tools(registry: SkillRegistry, *, max_inline_binary_bytes: int = 65536) -> list[StructuredTool]
Returns a list of LangChain structured tools bound to the given registry.
get_tools_usage_instructions() -> str
Returns a markdown string explaining the progressive-disclosure workflow - read metadata, then body, then fetch resources on demand. Designed for system-prompt injection alongside the skill catalog.
Example
See examples/langchain/ for a full working demo.
Error Handling
| Scenario | Exception |
|---|---|
| Skill not found in registry | SkillNotFoundError |
| Resource not found in skill | ResourceNotFoundError |
| Provider errors (HTTP, filesystem) | AgentSkillsError |
All exceptions inherit from AgentSkillsError (from agentskills-core).
Binary Resources
Skill resources may be arbitrary files. Valid UTF-8 is returned as-is; anything else is returned as a JSON envelope, so a binary payload is never silently mangled into replacement characters:
{
"name": "architecture.png",
"media_type": "image/png",
"size_bytes": 20481,
"encoding": "base64",
"content": "iVBORw0KGgo..."
}
Base64 costs roughly 1.37 characters per byte, so binaries above 64 KiB are described rather than inlined - "encoding": "none" plus a note explaining the omission. Adjust the ceiling with:
tools = get_tools(registry, max_inline_binary_bytes=256 * 1024)
License
MIT
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 agentskills_langchain-0.3.0.tar.gz.
File metadata
- Download URL: agentskills_langchain-0.3.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b9c45db1763008edcf51fc9365d655f3717bdb78d369aa37136f0603d2e52d2
|
|
| MD5 |
f4a0c7dc5963a939f68f52bfcd42564f
|
|
| BLAKE2b-256 |
6135595ab55c5da17a947146408939cc1ec8f960ae8054f47d83b5e82eec4a94
|
Provenance
The following attestation bundles were made for agentskills_langchain-0.3.0.tar.gz:
Publisher:
publish.yml on pratikxpanda/agentskills-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentskills_langchain-0.3.0.tar.gz -
Subject digest:
7b9c45db1763008edcf51fc9365d655f3717bdb78d369aa37136f0603d2e52d2 - Sigstore transparency entry: 2298808983
- Sigstore integration time:
-
Permalink:
pratikxpanda/agentskills-sdk@8c402728312bf75b0a4457f4adf917cc18651a70 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/pratikxpanda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c402728312bf75b0a4457f4adf917cc18651a70 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentskills_langchain-0.3.0-py3-none-any.whl.
File metadata
- Download URL: agentskills_langchain-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
046217e5224c4b3c78859fe5b2266f1046c92995ee25608237cb7708428131a6
|
|
| MD5 |
7bfd789120a06d82397b59083e4c236a
|
|
| BLAKE2b-256 |
d71f019da71561472c90443689b378c373510ab6c7fda3e2ea7fcb3fa9798d22
|
Provenance
The following attestation bundles were made for agentskills_langchain-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on pratikxpanda/agentskills-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentskills_langchain-0.3.0-py3-none-any.whl -
Subject digest:
046217e5224c4b3c78859fe5b2266f1046c92995ee25608237cb7708428131a6 - Sigstore transparency entry: 2298809025
- Sigstore integration time:
-
Permalink:
pratikxpanda/agentskills-sdk@8c402728312bf75b0a4457f4adf917cc18651a70 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/pratikxpanda
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8c402728312bf75b0a4457f4adf917cc18651a70 -
Trigger Event:
push
-
Statement type: