Skip to content

Commit 478e5db

Browse files
[Feat] Refactor Skills (#845)
1 parent de989c8 commit 478e5db

File tree

327 files changed

+69677
-3075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+69677
-3075
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,40 @@
11

22

3+
34
repos:
45
- repo: https://github.com/pycqa/flake8.git
56
rev: 4.0.0
67
hooks:
78
- id: flake8
8-
exclude: |
9-
(?x)^(
10-
thirdparty/|
11-
examples/|
12-
tests/run.py|
13-
projects/fin_research/examples/|
14-
ms_agent/utils/prompts.py
15-
)$
9+
exclude: ^(thirdparty/|examples/|tests/|projects/agent_skills/|projects/fin_research/examples/|ms_agent/utils/prompts\.py)
1610
- repo: https://github.com/PyCQA/isort.git
1711
rev: 4.3.21
1812
hooks:
1913
- id: isort
20-
exclude: |
21-
(?x)^(
22-
examples/|
23-
projects/fin_research/examples/|
24-
tests/run.py|
25-
)$
14+
exclude: ^(examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
2615
- repo: https://github.com/pre-commit/mirrors-yapf.git
2716
rev: v0.30.0
2817
hooks:
2918
- id: yapf
30-
exclude: |
31-
(?x)^(
32-
thirdparty/|
33-
examples/|
34-
projects/fin_research/examples/|
35-
tests/run.py
36-
)$
19+
exclude: ^(thirdparty/|examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
3720
- repo: https://github.com/pre-commit/pre-commit-hooks.git
3821
rev: v3.1.0
3922
hooks:
4023
- id: trailing-whitespace
41-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
24+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4225
- id: check-yaml
43-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
26+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4427
- id: end-of-file-fixer
45-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
28+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4629
- id: requirements-txt-fixer
47-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
30+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4831
- id: double-quote-string-fixer
49-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
32+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
5033
- id: check-merge-conflict
51-
exclude: thirdparty/|tests/run.py
34+
exclude: ^(thirdparty/|tests/|projects/agent_skills/)
5235
- id: fix-encoding-pragma
53-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
36+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
5437
args: ["--remove"]
5538
- id: mixed-line-ending
56-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
39+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
5740
args: ["--fix=lf"]

.pre-commit-config_local.yaml

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,35 @@ repos:
33
rev: 4.0.0
44
hooks:
55
- id: flake8
6-
exclude: |
7-
(?x)^(
8-
thirdparty/|
9-
examples/|
10-
projects/fin_research/examples/|
11-
tests/run.py
12-
)$
6+
exclude: ^(thirdparty/|examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
137
- repo: /home/admin/pre-commit/isort
148
rev: 4.3.21
159
hooks:
1610
- id: isort
17-
exclude: |
18-
(?x)^(
19-
examples/|
20-
projects/fin_research/examples/|
21-
tests/run.py|
22-
)$
11+
exclude: ^(examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
2312
- repo: /home/admin/pre-commit/mirrors-yapf
2413
rev: v0.30.0
2514
hooks:
2615
- id: yapf
27-
exclude: |
28-
(?x)^(
29-
thirdparty/|
30-
examples/|
31-
projects/fin_research/examples/|
32-
tests/run.py
33-
)$
16+
exclude: ^(thirdparty/|examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
3417
- repo: /home/admin/pre-commit/pre-commit-hooks
3518
rev: v3.1.0
3619
hooks:
3720
- id: trailing-whitespace
38-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
21+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
3922
- id: check-yaml
40-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
23+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4124
- id: end-of-file-fixer
42-
exclude: thirdparty/|projects/fin_research/examples/
25+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4326
- id: requirements-txt-fixer
44-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
27+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4528
- id: double-quote-string-fixer
46-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
29+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
4730
- id: check-merge-conflict
48-
exclude: thirdparty/|tests/run.py
31+
exclude: ^(thirdparty/|tests/|projects/agent_skills/)
4932
- id: fix-encoding-pragma
50-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
33+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
5134
args: ["--remove"]
5235
- id: mixed-line-ending
53-
exclude: thirdparty/|tests/run.py|projects/fin_research/examples/
36+
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
5437
args: ["--fix=lf"]

README.md

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -262,58 +262,6 @@ asyncio.run(main())
262262
</details>
263263
264264
265-
### Agent Skills
266-
267-
**MS-Agent Skills** is an **Implementation** of the [**Anthropic-Agent-Skills**](https://docs.claude.com/en/docs/agents-and-tools/agent-skills) protocol, enabling agents to autonomously explore and execute complex tasks by leveraging predefined or custom "skills".
268-
269-
270-
#### Key Features
271-
272-
- 📜 **Standard Skill Protocol**: Fully compatible with the [Anthropic Skills](https://github.com/anthropics/skills) protocol
273-
- 🧠 **Heuristic Context Loading**: Loads only necessary context—such as `References`, `Resources`, and `Scripts` on demand
274-
- 🤖 **Autonomous Execution**: Agents autonomously analyze, plan, and decide which scripts and resources to execute based on skill definitions
275-
- 🔍 **Skill Management**: Supports batch loading of skills and can automatically retrieve and discover relevant skills based on user input
276-
- 🛡️ **Code Execution Environment**: Optional local direct code execution or secure sandboxed execution via [**ms-enclave**](https://github.com/modelscope/ms-enclave), with automatic dependency installation and environment isolation
277-
- 📁 **Multi-file Type Support**: Supports documentation, scripts, and resource files
278-
- 🧩 **Extensible Design**: The skill data structure is modularized, with implementations such as `SkillSchema` and `SkillContext` provided for easy extension and customization
279-
280-
281-
#### Quick Start
282-
283-
> 💡 Note:
284-
> 1. Before running the following examples, ensure that you have set the `OPENAI_API_KEY` and `OPENAI_BASE_URL` environment variables to access the required model APIs.
285-
> 2. Agent Skills requires ms-agent >= 1.4.0
286-
287-
288-
**Installation**:
289-
290-
```shell
291-
pip install ms-agent
292-
```
293-
294-
**Usage**:
295-
296-
> This example demonstrates how to configure and run an Agent Skill that generates generative art code based on p5.js flow fields.
297-
298-
299-
Refer to: [Run Skills](projects/agent_skills/run.py)
300-
301-
302-
**Result**:
303-
304-
<div align="center">
305-
<img src="https://github.com/user-attachments/assets/9d5d78bf-c2db-4280-b780-324eab74a41e" alt="FlowFieldParticles" width="750">
306-
<p><em>Agent-Skills: Flow Field Particles</em></p>
307-
</div>
308-
309-
310-
#### References
311-
- **README**: [MS-Agent Skills](projects/agent_skills/README.md)
312-
- **Anthropic Agent Skills Official Docs**: [Anthropic-Agent-Skills](https://docs.claude.com/en/docs/agents-and-tools/agent-skills)
313-
- **Anthropic Skills GitHub Repo**: [Skills](https://github.com/anthropics/skills)
314-
315-
316-
317265
### Agentic Insight
318266
319267
#### - Lightweight, Efficient, and Extensible Multi-modal Deep Research Framework

README_ZH.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -262,56 +262,6 @@ asyncio.run(main())
262262
</details>
263263

264264

265-
### Agent Skills
266-
267-
**MS-Agent Skills** 模块是对 [**Anthropic-Agent-Skills**](https://docs.claude.com/en/docs/agents-and-tools/agent-skills) 协议的实现,允许开发者轻松创建、管理和使用智能体技能,提升智能体在复杂任务上的表现。
268-
269-
270-
#### 1) 核心特性
271-
272-
- 📜 **标准技能协议**:完全兼容 [Anthropic Skills](https://github.com/anthropics/skills) 协议
273-
- 🧠 **启发式上下文加载**:仅在需要时加载必要的上下文,如`References``Resources``Scripts`
274-
- 🤖 **自主执行**:智能体根据技能定义,自主分析、规划和决策执行哪些脚本和资源
275-
- 🔍 **技能管理**:支持技能批量加载,可根据用户输入自动检索和发现相关技能
276-
- 🛡️ **代码执行环境**:可选代码本地直接执行,或使用沙箱环境([**ms-enclave**](https://github.com/modelscope/ms-enclave)),自动处理依赖项安装和环境隔离
277-
- 📁 **多文件类型支持**:支持文档、脚本和资源文件
278-
- 🧩 **可扩展设计**:对「技能」的数据结构进行了模块化设计,提供 `SkillSchema``SkillContext`等实现,便于扩展和定制
279-
280-
#### 2) 快速开始
281-
282-
> 💡 提示:
283-
> 1. 在运行以下示例之前,请确保设置了 `OPENAI_API_KEY``OPENAI_BASE_URL` 环境变量,以便访问所需的模型 API
284-
> 2. Agent Skills 要求 ms-agent 版本 >= 1.4.0
285-
286-
287-
**安装依赖**
288-
289-
```shell
290-
pip install ms-agent
291-
```
292-
293-
**使用示例**
294-
> 该示例展示了如何配置和运行一个Agent Skill,基于p5.js的流场生成艺术代码。
295-
296-
297-
参考代码: [Run Skills](projects/agent_skills/run.py)
298-
299-
300-
**运行结果**
301-
302-
<div align="center">
303-
<img src="https://github.com/user-attachments/assets/9d5d78bf-c2db-4280-b780-324eab74a41e" alt="FlowFieldParticles" width="750">
304-
<p><em>Agent-Skills: Flow Field Particles</em></p>
305-
</div>
306-
307-
308-
309-
#### 3) 参考文档
310-
- **README**:请参考 [MS-Agent Skills](projects/agent_skills/README.md)
311-
- **Anthropic Agent Skills官方文档**:请参考 [Anthropic-Agent-Skills](https://docs.claude.com/en/docs/agents-and-tools/agent-skills)
312-
- **Anthropic预定义Skills GitHub仓库**:请参考 [Skills](https://github.com/anthropics/skills)
313-
314-
315265
### Agentic Insight
316266

317267
#### - 轻量级、高效且可扩展的多模态深度研究框架

0 commit comments

Comments
 (0)