feat(general-skills): 通用技能对齐 Agent Skills 官方规范(frontmatter 校验/标准导出/allowed-tools 门控) - #54
Open
tianling536 wants to merge 2 commits into
Open
feat(general-skills): 通用技能对齐 Agent Skills 官方规范(frontmatter 校验/标准导出/allowed-tools 门控)#54tianling536 wants to merge 2 commits into
tianling536 wants to merge 2 commits into
Conversation
hm1229
self-requested a review
August 1, 2026 09:25
Collaborator
|
感谢您的补充,这里的部分功能我们在新版中已经进行了调整,部分功能为了新版的执行可能不完全兼容,等我们更新稳定后再进行merge |
Collaborator
|
您好,我们目前已将新版能力进行了更新,方便的话修改后我们继续评审 |
tianling536
force-pushed
the
feat/general-skills-standard
branch
from
August 6, 2026 16:08
e97b4be to
13efe05
Compare
Contributor
Author
|
已按新版能力完成适配(rebase 到 main 6f72f96,commit 13efe05),当前 MERGEABLE。逐点说明:
验证:全量 1313 passed、ruff 零告警、前端 build 通过、技能页 i18n 无缺失。 本 PR 当前的独有增量收敛为:规范层(frontmatter 校验/组装/解析)、保存与发布的规范校验、标准 zip 导出、runner 的 allowed-tools 门控与 SKILL.md 规范化物化、页面规范字段与导出按钮。 |
added 2 commits
August 7, 2026 22:20
规范层(app/general_skills/standard.py):
- name/description 规范校验(1-64 小写连字符/1-1024)
- YAML frontmatter 解析与 SKILL.md 组装;可选字段
license/compatibility/metadata/allowed-tools 全支持
- name 恒等于 slug(规范:与目录名一致);存量技能读路径同样输出规范形态
保存与发布:
- /import 与 _create_imported_general_skill(zip/GitHub/clawhub)统一归一化:
frontmatter 以表单/解析字段重组、正文保留;新建 slug 不合规 400,
导入名不合规自动 _slugify 清洗;published 缺 description 400,草稿宽限
- publish 端点发布前强制规范校验
- 新增 GET /{slug}/export 导出标准 zip(根目录=slug,SKILL.md 规范化)
运行时:
- 物化到工作区的 SKILL.md 一律规范化
- allowed-tools 门控:未声明 Bash 时 runtime 仅 python(计划输入约束+
计划后强制),声明 Bash(...) 或缺省不限制
前端:
- 新建模板换标准 SKILL.md skeleton;基本信息新增 license/compatibility/
allowed-tools 三字段(与 frontmatter 同步)
- 文件编辑器支持任意路径(scripts/references/assets)
- 编辑器新增"导出技能包"按钮
测试:规范层 10 例、保存归一化/非法 slug/发布校验/导出 zip 往返/
物化标准化/门控等;存量测试按归一化新行为对齐;全量 1243 passed、
ruff 零告警、前端 build 与 i18n 新增文案齐全
- 与 main 的文件树/新建文件夹/能力范围(capability_scope)合并:保留上游实现, 叠加本 PR 的规范字段(license/compatibility/allowed-tools)与导出技能包 - runner 物化:保留上游 skill_directories 目录创建,SKILL.md 仍按规范化物化 - 上游新增测试夹具按规范补 description;en.json 合入上游新文案并补齐渲染切换等翻译
tianling536
force-pushed
the
feat/general-skills-standard
branch
from
August 7, 2026 14:39
13efe05 to
14eb5c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
让通用技能(General Skill)的创建/保存/导出全面对齐 Agent Skills 官方规范。此前页面新建技能只是一份裸 Markdown(无 YAML frontmatter、无规范校验、无标准导出),产物在标准工具链里不可用。
规范层(新模块
app/general_skills/standard.py)name(1-64,小写字母/数字/连字符,不可首尾/连续连字符)、description(1-1024,做什么+何时用);license/compatibility(≤500) /metadata(键值对) /allowed-tools(空格分隔)全支持;保存与发布
/import与_create_imported_general_skill(zip/GitHub/clawhub)统一归一化:frontmatter 以表单/解析字段重组(name=slug、可选字段透传、正文保留);_slugify清洗;published缺 description 400(草稿宽限,发布时强制);publish端点发布前强制规范校验;GET /{slug}/export:导出标准 zip(根目录=slug,SKILL.md 为规范化版本)——与既有 zip 导入形成往返。运行时
allowed-tools且不含 Bash 时,runner 计划输入仅给 python、计划后再强制校验(生成 bash 即拒绝触发反思重生成);声明Bash(...)或未声明则不限制。前端
scripts/run.py、references/guide.md、assets/),mime 按扩展名推断;验证
i18n:check报告的 67 条均为 main 预存在,与纯净 main 一致)。兼容性
编辑器升级(e97b4be 追加)
scripts/run.py、references/guide.md、assets/data.json三个规范目录模板(重名自动追加序号),另有"自定义路径…"展开内联输入(回车创建、Esc 收起)——按规范目录结构建技能一步到位。