Skip to content

feat: add skill short description and overview presentation fields (#1035, part 1) - #1043

Open
xiaoyaner0201 wants to merge 4 commits into
iflytek:mainfrom
xiaoyaner0201:feat/1035-skill-presentation
Open

xiaoyaner0201 wants to merge 4 commits into
iflytek:mainfrom
xiaoyaner0201:feat/1035-skill-presentation

Conversation

@xiaoyaner0201

Copy link
Copy Markdown
Contributor

Summary

First slice of #1035, following the boundaries agreed in #1035 (comment): user-facing presentation fields. Homepage featured picks will come in a separate PR.

One skill, two readers: display name, short description and overview for people; SKILL.md for the agent. Step one; homepage picks come separately.

  • Two optional fields next to the existing display name:
    • Short description (plain text, ≤ 200 chars): used on cards, lists and search results.
    • Overview (Markdown, ≤ 20,000 chars): used on the detail page overview.
  • Sources: web publish form (shortDescription, overview, resetPresentation) or SKILL.md metadata (metadata.short-description, metadata.overview) for CLI publishing. Explicit web values win. The uploaded package and SKILL.md are never rewritten.
  • Stored in the version snapshot (parsedMetadataJson) like displayNameOverride from feat(publish): support version-consistent skill display names #957 — no DB migration.
  • Defaults: short description → original description; overview → README → SKILL.md.
  • Inheritance: a new version with no values inherits the custom values of the version published at submission time, records presentationInheritedFrom, and stays fixed for that submission. Default state is stored empty, so later versions read their own package defaults (old default text is never copied as custom).
  • "Restore default" clears custom values and stops inheritance.
  • Pending isolation: a pending-review version does not change public title/summary; approval, yank fallback, promotion and rerelease read the matching version snapshot.
  • Search: display name and short description are indexed; the original package description is kept in search_text, so existing retrieval still works. Overview is not indexed.
  • Detail page: overview tab shows the overview when set, otherwise the existing README → SKILL.md path, plus a "View SKILL.md" entry bound to the selected version and existing permissions.
  • Docs: protocol (docs/07), lifecycle (docs/14), search (docs/04), CLI README; OpenSpec change add-skill-presentation-fields; regenerated OpenAPI types; en/zh translations.

Validation

  • Domain module (./mvnw -pl skillhub-domain -am test): all pass, including new tests for inheritance, frozen inheritance, default-not-copied, restore-default, pending isolation, approval, yank, promotion, rerelease, length limits and snapshots with extra fields.
  • Search rebuild test and publish controller test: pass.
  • Web: make typecheck-web, make lint-web, make test-frontend (1,362 tests) and build: pass.
  • make test-backend-app: on this machine the only failures (1,526 run: 3 failures, 1 error) are GitHub-sync concurrency/integration tests whose failing set changes run to run; the same command on the untouched base 326cbd62 also fails there (5 failures, 10 errors). Everything else passes. Leaving CI as the referee.
cd server && ./mvnw -pl skillhub-domain -am test
make test-backend-app
make generate-api typecheck-web lint-web test-frontend

Risk

  • User-facing impact: new optional fields; skills without them look exactly as before.
  • Deployment / migration: none (snapshot JSON only, old snapshots stay compatible).
  • Rollback: revert the PR; stored extra snapshot keys are ignored by older code.

Notes

中文说明

概要

这是 #1035 的第一个 PR,按 #1035 (comment) 里对齐的边界实现面向用户的展示信息。首页精选会另开 PR

同一个 skill,两种读者:展示名、简要描述、详细描述给人看,SKILL.md 给 Agent 看。第一步,首页精选另行提交

  • 在已有展示名旁边新增两个可选字段:
    • 简要描述(纯文本,最多 200 字符):用于卡片、列表和搜索结果
    • 详细描述(Markdown,最多 20000 字符):用于详情页概览
  • 来源:网页发布表单(shortDescription、overview、resetPresentation),或 CLI 发布时读取 SKILL.md 的 metadata.short-description、metadata.overview。网页填写优先,上传包和 SKILL.md 原文不改
  • 和 feat(publish): support version-consistent skill display names #957 的 displayNameOverride 一样存在版本快照里,不新增数据库迁移
  • 默认值:简要描述回退到原 description,详细描述回退到 README → SKILL.md
  • 继承:新版本没填时,继承提交时已发布版的自定义内容,记录 presentationInheritedFrom,结果固定在这次提交。默认状态存为空,后续版本读新包自己的默认内容,不会把旧默认文本当成自定义复制过去
  • “恢复默认”会清空自定义内容并停止继承
  • 待审隔离:待审核版本不改公开的标题和简介;审核通过、撤回回退、提升和重新发布都从对应版本快照读取
  • 搜索:展示名和简要描述进索引,原 description 保留在 search_text,原有检索不受影响;详细描述暂不进索引
  • 详情页:概览优先显示详细描述,没有就走原来的 README → SKILL.md,另加跟随所选版本和原有权限的“查看 SKILL.md”入口
  • 文档:协议、生命周期、搜索、CLI README,OpenSpec 变更 add-skill-presentation-fields,重新生成的 OpenAPI 类型,中英文翻译

验证

  • 领域模块全量测试通过,包含继承、继承固定、默认值不复制、恢复默认、待审隔离、审核、撤回、提升、重新发布、长度上限和带扩展字段快照的新测试
  • 搜索重建、发布接口测试通过
  • 前端类型检查、lint、1362 项单测和构建通过
  • make test-backend-app:1526 项里只剩 GitHub 同步相关的并发/集成测试不稳定(每次失败的用例不同;同一命令在未改动的 base 326cbd62 上也会失败,5 失败 10 错误)。其余全部通过,交给 CI 确认

风险

  • 用户影响:新增可选字段,没填的技能展示和以前完全一样
  • 部署和迁移:无(只改快照 JSON,旧快照兼容)
  • 回滚:直接回退本 PR,老代码会忽略快照里多出的字段

Signed-off-by: 千乘妍 (Xiaoyaner) <xiaoyaner0201@users.noreply.github.com>
Signed-off-by: 千乘妍 (Xiaoyaner) <xiaoyaner0201@users.noreply.github.com>
…ance

Signed-off-by: 千乘妍 (Xiaoyaner) <xiaoyaner0201@users.noreply.github.com>
Signed-off-by: 千乘妍 (Xiaoyaner) <xiaoyaner0201@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant