feat(general-skills): 按 Agent Skills 标准升级通用技能(规范校验/标准导入导出/目录树编辑器) - #54
Open
tianling536 wants to merge 2 commits into
Open
feat(general-skills): 按 Agent Skills 标准升级通用技能(规范校验/标准导入导出/目录树编辑器)#54tianling536 wants to merge 2 commits into
tianling536 wants to merge 2 commits into
Conversation
added 2 commits
July 31, 2026 07:28
规范层(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 新增文案齐全
- 文件列表从平铺改为目录树:按路径组织层级、文件夹可折叠(默认展开)、 文件显示 basename 并缩进、悬停看完整路径;右键菜单(重命名/删除)不变 - 新建文件改下拉菜单:预置 scripts/run.py、references/guide.md、 assets/data.json 三个规范目录模板(重名自动加序号),自定义路径项 展开内联输入(回车创建/Esc 收起)
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 收起)——按规范目录结构建技能一步到位。