agentskills-agentframework 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentskills_agentframework/__init__.py +22 -0
- agentskills_agentframework/py.typed +0 -0
- agentskills_agentframework/tools.py +187 -0
- agentskills_agentframework-0.1.0.dist-info/METADATA +86 -0
- agentskills_agentframework-0.1.0.dist-info/RECORD +6 -0
- agentskills_agentframework-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Microsoft Agent Framework integration for Agent Skills.
|
|
2
|
+
|
|
3
|
+
This package bridges :mod:`agentskills_core` and `Microsoft Agent Framework
|
|
4
|
+
<https://github.com/microsoft/agent-framework>`_, providing:
|
|
5
|
+
|
|
6
|
+
* :func:`get_tools` -- generates five
|
|
7
|
+
:class:`~agent_framework.FunctionTool` instances that let an
|
|
8
|
+
AI agent consume skills.
|
|
9
|
+
* :func:`get_tools_usage_instructions` -- returns agent-facing
|
|
10
|
+
instructions explaining how to use the tools.
|
|
11
|
+
|
|
12
|
+
Install::
|
|
13
|
+
|
|
14
|
+
pip install agentskills-agentframework
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from agentskills_agentframework.tools import get_tools, get_tools_usage_instructions
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"get_tools",
|
|
21
|
+
"get_tools_usage_instructions",
|
|
22
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""Microsoft Agent Framework integration for Agent Skills.
|
|
2
|
+
|
|
3
|
+
This module converts a :class:`~agentskills_core.SkillRegistry` into a
|
|
4
|
+
set of :class:`~agent_framework.FunctionTool` instances that an AI
|
|
5
|
+
agent can invoke to read skill metadata and instructions, and retrieve
|
|
6
|
+
bundled resources.
|
|
7
|
+
|
|
8
|
+
Skill *discovery* is handled separately: the application injects the
|
|
9
|
+
skill catalog (via :meth:`SkillRegistry.get_skills_catalog`) into the
|
|
10
|
+
system prompt so the agent already knows which skills are available.
|
|
11
|
+
The tools here cover **activation and resource retrieval** only.
|
|
12
|
+
|
|
13
|
+
============================== =============================================
|
|
14
|
+
Tool name Description
|
|
15
|
+
============================== =============================================
|
|
16
|
+
``get_skill_metadata`` Read frontmatter (name, description, ...).
|
|
17
|
+
``get_skill_body`` Load full skill instructions.
|
|
18
|
+
``get_skill_reference`` Read a single reference document.
|
|
19
|
+
``get_skill_script`` Read a single script.
|
|
20
|
+
``get_skill_asset`` Read a single asset.
|
|
21
|
+
============================== =============================================
|
|
22
|
+
|
|
23
|
+
All tools are ``async`` to match the underlying async provider interface.
|
|
24
|
+
|
|
25
|
+
Example::
|
|
26
|
+
|
|
27
|
+
from agentskills_agentframework import get_tools
|
|
28
|
+
|
|
29
|
+
tools = get_tools(registry)
|
|
30
|
+
# Pass *tools* to a Microsoft Agent Framework agent.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
from __future__ import annotations
|
|
34
|
+
|
|
35
|
+
import json
|
|
36
|
+
|
|
37
|
+
from agent_framework import FunctionTool, tool
|
|
38
|
+
|
|
39
|
+
from agentskills_core import SkillRegistry
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_tools(registry: SkillRegistry) -> list[FunctionTool]:
|
|
43
|
+
"""Build Agent Framework tools that expose an Agent Skills registry.
|
|
44
|
+
|
|
45
|
+
Each tool wraps a :class:`~agentskills_core.SkillRegistry` or
|
|
46
|
+
:class:`~agentskills_core.Skill` method, serialising the result
|
|
47
|
+
as JSON (for dicts) or plain text (for content bodies).
|
|
48
|
+
Tools are **read-only** -- they retrieve content but never execute
|
|
49
|
+
scripts or modify state.
|
|
50
|
+
|
|
51
|
+
Skill discovery is handled via the catalog in the system prompt,
|
|
52
|
+
so no ``list_skills`` tool is included.
|
|
53
|
+
|
|
54
|
+
All tools are async coroutines.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
registry: The :class:`~agentskills_core.SkillRegistry` whose
|
|
58
|
+
skills should be exposed as tools.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
A list of :class:`~agent_framework.FunctionTool`
|
|
62
|
+
instances ready to be passed to an Agent Framework agent.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
@tool(
|
|
66
|
+
name="get_skill_metadata",
|
|
67
|
+
description=(
|
|
68
|
+
"Get structured metadata (name, description, and optional "
|
|
69
|
+
"fields like license, compatibility, metadata) for a specific skill."
|
|
70
|
+
),
|
|
71
|
+
)
|
|
72
|
+
async def get_skill_metadata(skill_id: str) -> str:
|
|
73
|
+
"""Get structured metadata for a skill."""
|
|
74
|
+
skill = registry.get_skill(skill_id)
|
|
75
|
+
return json.dumps(await skill.get_metadata())
|
|
76
|
+
|
|
77
|
+
@tool(
|
|
78
|
+
name="get_skill_body",
|
|
79
|
+
description=(
|
|
80
|
+
"Get the full instructions and guidance (markdown body) for a specific skill."
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
async def get_skill_body(skill_id: str) -> str:
|
|
84
|
+
"""Get the full instructions / markdown body for a skill."""
|
|
85
|
+
skill = registry.get_skill(skill_id)
|
|
86
|
+
return await skill.get_body()
|
|
87
|
+
|
|
88
|
+
@tool(
|
|
89
|
+
name="get_skill_reference",
|
|
90
|
+
description=(
|
|
91
|
+
"Get the full content of a specific reference document "
|
|
92
|
+
"from a skill. Provide both skill_id and the reference name."
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
async def get_skill_reference(skill_id: str, name: str) -> str:
|
|
96
|
+
"""Get the content of a specific reference document."""
|
|
97
|
+
skill = registry.get_skill(skill_id)
|
|
98
|
+
return (await skill.get_reference(name)).decode("utf-8", errors="replace")
|
|
99
|
+
|
|
100
|
+
@tool(
|
|
101
|
+
name="get_skill_asset",
|
|
102
|
+
description=(
|
|
103
|
+
"Get the content of a specific asset from a skill. "
|
|
104
|
+
"Provide both skill_id and the asset name."
|
|
105
|
+
),
|
|
106
|
+
)
|
|
107
|
+
async def get_skill_asset(skill_id: str, name: str) -> str:
|
|
108
|
+
"""Get the content of a specific asset."""
|
|
109
|
+
skill = registry.get_skill(skill_id)
|
|
110
|
+
return (await skill.get_asset(name)).decode("utf-8", errors="replace")
|
|
111
|
+
|
|
112
|
+
@tool(
|
|
113
|
+
name="get_skill_script",
|
|
114
|
+
description=(
|
|
115
|
+
"Get the content of a specific script from a skill. "
|
|
116
|
+
"Provide both skill_id and the script name."
|
|
117
|
+
),
|
|
118
|
+
)
|
|
119
|
+
async def get_skill_script(skill_id: str, name: str) -> str:
|
|
120
|
+
"""Get the content of a specific script."""
|
|
121
|
+
skill = registry.get_skill(skill_id)
|
|
122
|
+
return (await skill.get_script(name)).decode("utf-8", errors="replace")
|
|
123
|
+
|
|
124
|
+
return [
|
|
125
|
+
get_skill_metadata,
|
|
126
|
+
get_skill_body,
|
|
127
|
+
get_skill_reference,
|
|
128
|
+
get_skill_asset,
|
|
129
|
+
get_skill_script,
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def get_tools_usage_instructions() -> str:
|
|
134
|
+
"""Return agent instructions for using the Agent Skills tools.
|
|
135
|
+
|
|
136
|
+
This text explains to an AI agent **how** to use the skill
|
|
137
|
+
tools (``get_skill_metadata``, ``get_skill_body``,
|
|
138
|
+
``get_skill_reference``, ``get_skill_script``, ``get_skill_asset``)
|
|
139
|
+
following the progressive-disclosure workflow.
|
|
140
|
+
|
|
141
|
+
Combine with the skill catalog produced by
|
|
142
|
+
:meth:`SkillRegistry.get_skills_catalog` to give the agent both
|
|
143
|
+
*what* skills are available and *how* to interact with them::
|
|
144
|
+
|
|
145
|
+
catalog = await registry.get_skills_catalog(format="xml")
|
|
146
|
+
instructions = get_tools_usage_instructions()
|
|
147
|
+
system_prompt = f"{catalog}\\n\\n{instructions}"
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
A multi-line instruction string ready for system-prompt
|
|
151
|
+
insertion.
|
|
152
|
+
"""
|
|
153
|
+
return _TOOLS_USAGE_INSTRUCTIONS
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
_TOOLS_USAGE_INSTRUCTIONS = """\
|
|
157
|
+
## How to Use Agent Skills
|
|
158
|
+
|
|
159
|
+
You have access to a set of **Agent Skills** — curated knowledge \
|
|
160
|
+
bundles that contain step-by-step instructions, reference documents, \
|
|
161
|
+
scripts, and assets. The available skills are listed above.
|
|
162
|
+
|
|
163
|
+
### Workflow
|
|
164
|
+
|
|
165
|
+
1. **Pick a skill** — Choose the most relevant skill from the catalog \
|
|
166
|
+
above based on the user's request.
|
|
167
|
+
2. **Read metadata** — Call `get_skill_metadata(skill_id)` to get \
|
|
168
|
+
structured information (name, description, and optional fields).
|
|
169
|
+
3. **Read the body** — Call `get_skill_body(skill_id)` to load the \
|
|
170
|
+
full instructions. Follow these instructions carefully.
|
|
171
|
+
4. **Fetch resources on demand** — The skill body will reference \
|
|
172
|
+
specific resources by name. Use the appropriate tool to retrieve them:
|
|
173
|
+
- `get_skill_reference(skill_id, name)` — reference documents \
|
|
174
|
+
(policies, templates, runbooks)
|
|
175
|
+
- `get_skill_script(skill_id, name)` — executable scripts
|
|
176
|
+
- `get_skill_asset(skill_id, name)` — diagrams, data files, or \
|
|
177
|
+
other assets
|
|
178
|
+
|
|
179
|
+
### Important guidelines
|
|
180
|
+
|
|
181
|
+
- **Do not guess resource names.** Only fetch resources that are \
|
|
182
|
+
explicitly mentioned in the skill body.
|
|
183
|
+
- **Follow progressive disclosure.** Read the skill body first, then \
|
|
184
|
+
fetch only the resources you need for the current step.
|
|
185
|
+
- **One skill at a time.** Focus on the most relevant skill for the \
|
|
186
|
+
user's request. If multiple skills apply, address them sequentially.\
|
|
187
|
+
"""
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentskills-agentframework
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Microsoft Agent Framework integration for the Agent Skills format (https://agentskills.io)
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Pratik Panda
|
|
7
|
+
Requires-Python: >=3.12,<4.0
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
16
|
+
Requires-Dist: agent-framework (>=1.0.0b1)
|
|
17
|
+
Requires-Dist: agentskills-core (>=0.1.0)
|
|
18
|
+
Project-URL: Homepage, https://agentskills.io
|
|
19
|
+
Project-URL: Repository, https://github.com/pratikxpanda/agentskills-sdk
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# agentskills-agentframework
|
|
23
|
+
|
|
24
|
+
> Microsoft Agent Framework integration for the [Agent Skills SDK](../../../README.md) — turn a skill registry into Agent Framework tools.
|
|
25
|
+
|
|
26
|
+
Generates a set of [Microsoft Agent Framework](https://pypi.org/project/agent-framework/) `FunctionTool` instances from a `SkillRegistry`, ready to be passed to any Agent Framework agent.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install agentskills-agentframework
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Requires Python 3.12+. Installs `agentskills-core` and `agent-framework` as dependencies.
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from agentskills_core import SkillRegistry
|
|
40
|
+
from agentskills_fs import LocalFileSystemSkillProvider
|
|
41
|
+
from agentskills_agentframework import get_tools, get_tools_usage_instructions
|
|
42
|
+
|
|
43
|
+
# Set up registry
|
|
44
|
+
provider = LocalFileSystemSkillProvider(Path("./skills"))
|
|
45
|
+
registry = SkillRegistry()
|
|
46
|
+
await registry.register("incident-response", provider)
|
|
47
|
+
|
|
48
|
+
# Build tools + system prompt
|
|
49
|
+
tools = get_tools(registry)
|
|
50
|
+
catalog = await registry.get_skills_catalog(format="xml")
|
|
51
|
+
instructions = get_tools_usage_instructions()
|
|
52
|
+
system_prompt = f"{catalog}\n\n{instructions}"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Pass `tools` to your Agent Framework agent and inject `system_prompt` into the `instructions`. The catalog tells the agent *what* skills exist; the usage instructions tell it *how* to use the tools.
|
|
56
|
+
|
|
57
|
+
## Generated Tools
|
|
58
|
+
|
|
59
|
+
| Tool | Parameters | Description |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| `get_skill_metadata` | `skill_id` | Get structured metadata (name, description, etc.) |
|
|
62
|
+
| `get_skill_body` | `skill_id` | Load the full markdown instructions |
|
|
63
|
+
| `get_skill_reference` | `skill_id`, `name` | Read a reference document |
|
|
64
|
+
| `get_skill_script` | `skill_id`, `name` | Read a script |
|
|
65
|
+
| `get_skill_asset` | `skill_id`, `name` | Read an asset |
|
|
66
|
+
|
|
67
|
+
All tools are async-compatible (`FunctionTool` with `@tool` decorator).
|
|
68
|
+
|
|
69
|
+
## API
|
|
70
|
+
|
|
71
|
+
### `get_tools(registry: SkillRegistry) -> list[FunctionTool]`
|
|
72
|
+
|
|
73
|
+
Returns a list of Agent Framework function tools bound to the given registry.
|
|
74
|
+
|
|
75
|
+
### `get_tools_usage_instructions() -> str`
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
## Example
|
|
80
|
+
|
|
81
|
+
See [examples/agent-framework/](../../../examples/agent-framework/) for full working demos.
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|
|
86
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
agentskills_agentframework/__init__.py,sha256=lF8beb8XKG-OvYkGBRglXYu2KqDKyhN395pyXgF-A0E,672
|
|
2
|
+
agentskills_agentframework/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
agentskills_agentframework/tools.py,sha256=R6VB-TTj31Ajr4lEaeYX4fqMbgX70IE0pcs_s_Z8394,7222
|
|
4
|
+
agentskills_agentframework-0.1.0.dist-info/METADATA,sha256=xIgviuOwg9OGIW-N-y7_gcesmiWPKVUP_vyBgvNFDjE,3192
|
|
5
|
+
agentskills_agentframework-0.1.0.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
|
|
6
|
+
agentskills_agentframework-0.1.0.dist-info/RECORD,,
|