Skip to main content

Microsoft Agent Framework integration for the Agent Skills format (https://agentskills.io)

Project description

agentskills-agentframework

PyPI Python 3.12 | 3.13 License: MIT

Microsoft Agent Framework integration for the Agent Skills SDK - turn a skill registry into Agent Framework tools.

Generates a set of Microsoft Agent Framework FunctionTool instances from a SkillRegistry, ready to be passed to any Agent Framework agent.

Installation

pip install agentskills-agentframework

Requires Python 3.12 or 3.13. Installs agentskills-core and agent-framework as dependencies.

Note: agent-framework is currently a pre-release dependency (>=1.0.0rc3). The constraint will be updated once a stable release is published.

Usage

Context Provider (recommended)

The simplest way to integrate is via AgentSkillsContextProvider. It plugs into the Agent Framework lifecycle and automatically injects the skill catalog and tools on every agent.run() call — no manual system-prompt assembly required.

from pathlib import Path

from agent_framework import Agent
from agentskills_core import SkillRegistry
from agentskills_fs import LocalFileSystemSkillProvider
from agentskills_agentframework import AgentSkillsContextProvider

# Set up registry
provider = LocalFileSystemSkillProvider(Path("./skills"))
registry = SkillRegistry()
await registry.register("incident-response", provider)

# Create context provider
skills_context_provider = AgentSkillsContextProvider(registry)

# Pass it to the agent — catalog + tools are injected automatically
agent = Agent(
    client=client,  # any Agent Framework chat client
    name="SREAssistant",
    instructions="You are an SRE assistant.",
    context_providers=[skills_context_provider],
)
response = await agent.run("What severity is a full DB outage?")

See examples/agent-framework/ for full working demos including client setup.

Parameter Default Description
skills_instruction_prompt Built-in template Custom prompt template. Must contain {skills_catalog} and {tools_usage_instructions} placeholders.
skills_catalog_format "xml" Skills catalog format — "xml" or "markdown".
source_id "agentskills" Unique identifier for this provider instance.

Manual Tools

For full control over system-prompt construction, use get_tools() directly:

from pathlib import Path

from agent_framework import Agent
from agentskills_core import SkillRegistry
from agentskills_fs import LocalFileSystemSkillProvider
from agentskills_agentframework 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()

# Pass to agent
agent = Agent(
    client=client,  # any Agent Framework chat client
    name="SREAssistant",
    instructions=f"{catalog}\n\n{instructions}",
    tools=tools,
)

The catalog tells the agent what skills exist; the usage instructions tell it how to use the tools.

See examples/agent-framework/ for full working demos including client setup.

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
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 (FunctionTool with @tool decorator).

API

AgentSkillsContextProvider(registry, *, skills_instruction_prompt=None, skills_catalog_format="xml", source_id=None)

A BaseContextProvider that injects skill catalog + tools into the agent session automatically via before_run(). Skips injection when the registry has no skills.

get_tools(registry: SkillRegistry) -> list[FunctionTool]

Returns a list of Agent Framework function 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/agent-framework/ for full working demos.

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).

Note: Binary content (scripts, assets, references) is decoded as UTF-8 with errors="replace". Non-decodable bytes are replaced with the Unicode replacement character (�).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentskills_agentframework-0.2.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentskills_agentframework-0.2.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file agentskills_agentframework-0.2.3.tar.gz.

File metadata

  • Download URL: agentskills_agentframework-0.2.3.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.9 Windows/11

File hashes

Hashes for agentskills_agentframework-0.2.3.tar.gz
Algorithm Hash digest
SHA256 8fb5d6597f96fab917522b22bbb2af1428eba280619d143f6d5a5169e0852b15
MD5 dcff76f4594703d5946e329cc115563f
BLAKE2b-256 61221b9185feb5bcd29d7bcb41a1af81ffcb7805ffb7f8ad7415098b174ac1bc

See more details on using hashes here.

File details

Details for the file agentskills_agentframework-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for agentskills_agentframework-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7feaf329ea5d378afda8f901b379ce23e474def7485825fac28d91ad7f917409
MD5 328ca8e604b425e9b5b07cf6247cb285
BLAKE2b-256 a371cce127a096b920f88562858006ad1605a259559193c98ceae512b83bea11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page