Repository navigation
feat(skills): show skill version on detail page - #102
Open
TreeTreeDi wants to merge 2 commits into
Open
TreeTreeDi wants to merge 2 commits into
TreeTreeDi wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
TreeTreeDi
marked this pull request as draft
October 30, 2026 02:21
TreeTreeDi
marked this pull request as ready for review
October 30, 2026 02:23
This branch has not been deployed
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.
Closes #101
改了什么
技能详情页左侧「技能目录」标题右侧原本固定显示
-的位置,现在显示技能版本号(如v2.0.1),鼠标悬停提示版本来源。版本按以下优先级取值:
metadata.json的versionSKILL.mdfrontmatter 的metadata.version,其次顶层versionv{publish_revision}skills_items新增publish_revision(INT,默认 1)。启动时ensureStorageReady自动补列,sql/doraemon.sql同步更新。displayVersion/versionSource),存量技能不需要迁移数据就能显示。metadata.json:installer.ts的复制逻辑去掉了对它的排除(.git等目录仍排除),copy 模式和软链失败回退时的安装副本也会保留这个文件。位置选择:左侧栏「技能目录」右侧
version || -,是现有设计预留的版本位。直接填进去,不打乱布局。权衡
version字段(编辑表单「版本号」、CLI--version,默认0.0.0)不进入展示链。registry resolve / versions 依赖它,语义保持不变。metadata.json。metadata.version/version的小解析器,没有引入 yaml 依赖。待确认
version字段(非默认0.0.0时)要不要排在自增兜底前面?编辑表单里的「版本号」输入是否还需要保留?验证
v2.0.1(SKILL.md 里同时写了metadata.version: 9.9.9,确认 metadata.json 优先);frontmatter →v1.2.0;无版本 → 上传、再上传、编辑重传 zip 后显示v3。tooltip 文案也核对过。npm run lint(0 error)、npm run check-types通过。node --test test/*.test.js:194 通过;1 个失败是header-nav-config的「顶栏样式覆盖更多标题」用例,在 master 上同样失败,与本改动无关。test/skill-display-version.test.js。另外给两个已有测试的 mock 补了SkillsFile.findOne/Sequelize.literal。验收截图
本地 dev 实测,截图来自技能详情页左侧「技能目录」标题右边的版本位。
1. metadata.json 优先:显示
V2.0.1。版本取自metadata.json;同一个包的 SKILL.md 里还写了metadata.version: 9.9.9,没有被采用。2. SKILL.md frontmatter:显示
V1.2.0,取自 frontmatter 的metadata.version。3. 发布自增兜底:显示
V3。这个技能没声明版本,依次经过首次上传、重新上传、编辑时重传 zip,每次 +1,最终为 3。4. CLI 安装保留 metadata.json:用本地构建的 dt-skill 以 copy 模式安装
ver-test-metadata-json,.claude/skills/下的安装副本和.agents/skills/下的 canonical 目录里都有metadata.json,内容为version: 2.0.1。需求外发现
metadata.json(installer.ts的EXCLUDE_FILES),本地安装后的副本里没有这个文件。本 PR 已去掉这项排除,见验收截图 4。test/header-nav-config.test.js在 master 上就失败。