Skip to content

feat: Enhance skill management with remote installation and file upload#601

Merged
xerrors merged 8 commits intomainfrom
feat/skills-update
Apr 3, 2026
Merged

feat: Enhance skill management with remote installation and file upload#601
xerrors merged 8 commits intomainfrom
feat/skills-update

Conversation

@xerrors
Copy link
Copy Markdown
Owner

@xerrors xerrors commented Apr 2, 2026

变更描述

增强 skills 的导入功能,可以导入单个SKILL.md 文件,ZIP压缩包。更重要的是,可以借助 skills.sh 的能力安装绝大多数 skills。

变更类型

  • 新功能

测试

  • 已在 Docker 环境测试
  • 相关功能正常工作

相关日志或者截图

PixPin_2026-04-02_16-38-41

说明

(可选)有什么需要特别说明的吗?


💡 提示: 提交前可以运行 make lintmake format 检查代码规范

xerrors and others added 6 commits April 2, 2026 16:07
- 新增 remote_skill_install_service.py 支持远程技能安装
- 更新 skill_service.py 增强技能管理功能
- 更新 skill_router.py 添加相关路由
- 更新前端组件 SkillsManagerComponent.vue
- 更新 ExtensionsView.vue
- 添加对应单元测试

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread backend/package/yuxi/services/remote_skill_install_service.py Dismissed
Comment thread backend/package/yuxi/services/remote_skill_install_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
Comment thread backend/package/yuxi/services/skill_service.py Dismissed
@supreme0597
Copy link
Copy Markdown
Contributor

牛逼,思维同频了,我这也在做。看来我不用继续了。坐等大佬合入

@supreme0597
Copy link
Copy Markdown
Contributor

  • 建议:可以做成表格,支持多选?

  • 企业内网,私有仓库需要登录鉴权。

  • 然后同时支持直接复制npx skills add owner/repo -a xx这种,强制添加或替换为-a yuxi。因为团队内部已经推广使用skills了。skills仓库可以适配修改yuxi,或者挂载目录适配.agent之类的。

  • 最后建议在沙箱中支持npx skills add owner/repo -a yuxi;可以扩展在线创建技能,npx skills init xxx这种。借助skill-create在聊天窗口直接创建技能,导入到平台中;同时衍生出管理员是否有权限查看skills管理页面?

@DSYZayn
Copy link
Copy Markdown
Contributor

DSYZayn commented Apr 2, 2026

Looks good

@xerrors xerrors marked this pull request as ready for review April 2, 2026 15:04
Copilot AI review requested due to automatic review settings April 2, 2026 15:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Skills management experience by expanding import options and introducing remote installation via skills.sh/npx skills, with corresponding backend endpoints, service logic, docs, and tests.

Changes:

  • Extend Skills import to support uploading a single SKILL.md in addition to ZIP packages.
  • Add remote Skill discovery + installation flow (frontend modal + backend endpoints calling npx skills in an isolated HOME).
  • Update docs, Docker image dependencies, and unit tests to cover the new behaviors.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web/src/views/ExtensionsView.vue Adds “远程安装” entry point and allows uploading .md alongside .zip.
web/src/components/SkillsManagerComponent.vue Implements remote install modal UI + API calls for listing/installing remote skills.
web/src/apis/skill_api.js Adds API wrappers for /remote/list and /remote/install.
backend/server/routers/skill_router.py Adds remote list/install routes and updates import docstring/log message.
backend/package/yuxi/services/skill_service.py Refactors import logic to support single SKILL.md upload and directory import helper.
backend/package/yuxi/services/remote_skill_install_service.py New service to run npx skills in isolated temp HOME, parse output, and import into system.
docker/api.Dockerfile Installs git to support remote skill acquisition workflows.
backend/test/unit/services/test_skill_service.py Adds coverage for single SKILL.md import and directory import validation.
backend/test/unit/services/test_remote_skill_install_service.py Adds unit tests for parsing/listing/installing remote skills with isolated HOME.
backend/test/unit/routers/test_skill_router.py Adds router tests for SKILL.md import and remote list/install routes.
docs/agents/skills-management.md Documents the new remote install flow and updated import options.
docs/develop-guides/roadmap.md Updates release notes/roadmap items to include the new Skills capabilities.
backend/package/yuxi/agents/middlewares/summary_middleware.py Minor import ordering adjustment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 21 to 30
<a-upload
accept=".zip"
accept=".zip,.md"
:show-upload-list="false"
:custom-request="handleImportUpload"
:disabled="skillsLoading || skillsImporting"
>
<a-button type="primary" :loading="skillsImporting" class="lucide-icon-btn">
<Upload :size="14" />
<span>上传 ZIP</span>
<span>上传 Skill</span>
</a-button>
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept=".zip,.md" 会允许用户选择任意 .md 文件,但后端 import_skill_zip() 仅接受 ZIP 或文件名以 SKILL.md(大小写不敏感)结尾的 Markdown;上传如 README.md 会直接返回 400,用户体验上容易困惑。建议在上传前做一次文件名校验(例如 beforeUpload / customRequest 内判断 file.name 是否为 SKILL.md 或以 skill.md 结尾),不符合时给出明确提示。

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 0378729 中添加 beforeUpload 校验。在 ExtensionsView.vue 的上传组件中加入了 before-upload 钩子,仅允许文件名为 .zip 结尾或大小写不敏感匹配 skill.md 的文件通过,其他 .md 文件(如 README.md)会直接提示"仅支持上传 .zip 文件或 SKILL.md 文件"并取消上传,不再发起请求。

Comment thread backend/package/yuxi/services/remote_skill_install_service.py
Comment thread backend/package/yuxi/services/remote_skill_install_service.py
@xerrors
Copy link
Copy Markdown
Owner Author

xerrors commented Apr 2, 2026

@supreme0597

多选可以添加,也不用做成表格,直接使用多选的组件就可以,这个鉴权就不懂了。剩下的那两个我研究研究,不过目录挂载.agent 这个我试过,行不通,会影响沙盒的文件挂载,影响路径解析,现在也是先安装到 .agents 下面,然后 copy 到 yuxi 的目录的

- 前端:在 ExtensionsView.vue 上传前添加 beforeUpload 校验,
  仅允许 .zip 或 SKILL.md 文件,其他 .md 文件给出明确错误提示
- 后端:import_skill_dir 添加路径限制检查(is_relative_to),
  确保来源目录在系统临时目录内,防止路径遍历
- 后端:install_remote_skill 改为扫描目录查找安装结果,
  避免直接用用户输入构造文件路径(消除 CodeQL 告警)
- 后端:_run_skills_cli 错误输出清洗 ANSI 控制字符并截断到 500 字符
- 后端:install_remote_skill 返回类型从 object 修正为 Skill

Agent-Logs-Url: https://github.com/xerrors/Yuxi/sessions/0145c647-72bc-41f9-b07b-04d4acf51932

Co-authored-by: xerrors <35524243+xerrors@users.noreply.github.com>
@xerrors xerrors merged commit 6b9b0a0 into main Apr 3, 2026
@xerrors xerrors deleted the feat/skills-update branch April 4, 2026 13:35
@supreme0597
Copy link
Copy Markdown
Contributor

这边有一个问题,就是win环境下不支持,会报错。

然后,后续怎么更新?会生成v2、v3这种?像之前一样,还是支持更新功能?

@xerrors
Copy link
Copy Markdown
Owner Author

xerrors commented Apr 5, 2026

这可能是因为历史版本导致的,如果出现名称冲突,会自动添加后缀。你可以将原本的已存在的删除一下,或者最好办的就是去数据库里面把同名的给删掉就好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants