diff --git a/README.md b/README.md index c4a32af..9db4d17 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,11 @@ A local skill lives at `skills//SKILL.md` and combines YAML frontmatter with Only `SKILL.md` carries frontmatter. Localized `SKILL..md` files contain the body, start with the corresponding locale comment, and are referenced by the i18n metadata. For example, `SKILL.zh-CN.md` starts with ``. Market skills must set `disable-model-invocation: true` or omit the field; `false` is rejected. -Register every local built-in skill in `builtin-skills.json.skills`, supply its sidecar, and use a valid market category. See the [frontmatter schema](scripts/i18n/schema/skill-frontmatter.schema.json), [Web Access example](skills/web-access/SKILL.md), and [i18n authoring guide](docs/I18N.md) (Chinese). +Register only the local skills selected for automatic global installation in `builtin-skills.json.skills`, sorted by ID. Other local skills remain available for optional marketplace installation; they do not need an entry in this list. Every local skill still needs its sidecar and a valid market category. See the [frontmatter schema](scripts/i18n/schema/skill-frontmatter.schema.json), [Web Access example](skills/web-access/SKILL.md), and [i18n authoring guide](docs/I18N.md) (Chinese). -The `retired` list identifies former built-in skills that clients may retire at startup. Clients remove only market/bundled copies tracked in `skills.lock` whose `SKILL.md` hash still matches the installation record. Manually installed or locally modified copies are preserved. An ID must never appear in both `skills` and `retired`. +Removing an ID from `skills` stops automatic installation and updates without removing existing installations or its marketplace listing. Do not add it to `retired` merely to make it optional: retirement may also remove an unchanged official copy that a user installed from the marketplace. + +The `retired` list explicitly requests cleanup of former built-in installations at startup. Clients require managed bundled or official-market ownership, an unchanged installed-tree digest, and no local runtime state before removing a copy. Unmanaged, third-party, locally modified, or runtime-bearing copies are preserved. An ID must never appear in both `skills` and `retired`. ### External skills and collections diff --git a/README.zh-CN.md b/README.zh-CN.md index 30a4539..f526b97 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -107,9 +107,11 @@ uv run scripts/i18n/validate-i18n.py 只有 `SKILL.md` 包含 frontmatter。`SKILL..md` 仅包含对应语言正文,以匹配的语言注释开头,并由 i18n 元数据引用。例如,`SKILL.zh-CN.md` 的首行是 ``。市场技能的 `disable-model-invocation` 只能设为 `true` 或省略,`false` 会被拒绝。 -每个本地内置技能都必须登记到 `builtin-skills.json.skills`,提供 sidecar,并使用有效分类。参考 [frontmatter Schema](scripts/i18n/schema/skill-frontmatter.schema.json)、[联网访问技能](skills/web-access/SKILL.md)和[多语言作者指南](docs/I18N.md)。 +只有需要自动安装到全局的本地技能才登记到 `builtin-skills.json.skills`,并按 ID 排序。其他本地技能仍可从市场按需安装,无需进入此清单。所有本地技能仍须提供 sidecar,并使用有效分类。参考 [frontmatter Schema](scripts/i18n/schema/skill-frontmatter.schema.json)、[联网访问技能](skills/web-access/SKILL.md)和[多语言作者指南](docs/I18N.md)。 -`retired` 用于声明客户端可在启动时退役的旧内置技能。客户端只删除同时满足以下条件的副本:由 `skills.lock` 记录为市场或随包内容,且 `SKILL.md` 哈希仍与安装记录一致。手动安装或经过本地修改的副本会被保留。同一个 ID 不得同时出现在 `skills` 和 `retired` 中。 +从 `skills` 移除 ID 只停止自动安装和更新,不删除已有安装或市场条目。仅改为可选安装时不要加入 `retired`:退役机制也可能清理用户从市场主动安装、内容未修改的官方副本。 + +`retired` 用于明确要求在启动时清理旧内置安装。客户端仅在确认随包或官方市场管理归属、完整安装树摘要未偏离且没有本地运行状态时删除副本。无管理证据、第三方来源、本地修改或带有运行状态的副本均保留。同一个 ID 不得同时出现在 `skills` 和 `retired` 中。 ### 外部技能与技能集合 diff --git a/builtin-skills.json b/builtin-skills.json index f24fe6f..ced5ab7 100644 --- a/builtin-skills.json +++ b/builtin-skills.json @@ -1,15 +1,10 @@ { "skills": [ "app-developer", - "baidu-poi-search", - "ccgp-gov-procurement", "clone-agent", - "cnipa-patent-search", "code-intelligence", "configuring-compute", "create-agent", - "creditchina-query", - "dashscope-image-gen", "delete-agent", "dev-environment-setup", "discover-agent", @@ -21,9 +16,6 @@ "manage-skills", "manage-teams", "markdown", - "minimax-music-gen", - "minimax-video-gen", - "multi-source-sentiment", "nodejs-runtime", "pdf", "pptx", @@ -33,14 +25,11 @@ "s3-storage-operations", "skill-creator", "tech-diagram", - "tianyancha-risk", "tool-mcp-authoring", "update-agent", "using-services", "web-access", "workflow", - "workforce-optimization", - "xiaomi-tts", "xlsx" ], "retired": [] diff --git a/scripts/i18n/test_validate_i18n.py b/scripts/i18n/test_validate_i18n.py index a714565..28c7b9d 100644 --- a/scripts/i18n/test_validate_i18n.py +++ b/scripts/i18n/test_validate_i18n.py @@ -57,6 +57,32 @@ class BuiltinSkillManifestTests(unittest.TestCase): VALIDATOR.validate_builtin_manifest(report, payload, skills) return report.issues + def test_allows_optional_local_skills_without_retirement(self) -> None: + self.assertEqual([], self.validate( + {"skills": ["default-skill"], "retired": []}, + ["default-skill", "optional-skill"], + )) + + def test_allows_no_automatic_installations(self) -> None: + self.assertEqual([], self.validate( + {"skills": [], "retired": []}, + ["optional-skill"], + )) + + def test_rejects_non_local_automatic_installations(self) -> None: + issues = self.validate( + {"skills": ["missing-skill"], "retired": []}, + ["optional-skill"], + ) + self.assertTrue(any("contains non-local skills" in issue.message for issue in issues)) + + def test_rejects_duplicate_active_skills(self) -> None: + issues = self.validate( + {"skills": ["default-skill", "default-skill"], "retired": []}, + ["default-skill", "optional-skill"], + ) + self.assertTrue(any("duplicate Skill IDs" in issue.message for issue in issues)) + def test_allows_disjoint_sorted_retired_ids(self) -> None: self.assertEqual([], self.validate( {"skills": ["new-skill"], "retired": ["old-skill"]}, diff --git a/scripts/i18n/validate-i18n.py b/scripts/i18n/validate-i18n.py index 07e2570..a9e2563 100755 --- a/scripts/i18n/validate-i18n.py +++ b/scripts/i18n/validate-i18n.py @@ -15,7 +15,7 @@ Checks: 6. Frontmatter parses cleanly; heading count of locale body matches source body (+/- 0). 7. categories.json's per-category i18n covers all locales declared in manifest.json. 8. Top-level description is 1-1024 chars (spec); top-level name is 1-64 chars (spec). - 9. Skill/Agent/Team counts and builtin skill index match the repository contents. + 9. Skill/Agent/Team counts match the repository contents; the builtin skill index is a sorted local subset. 10. Skill, Agent, Team, and entry.json category references exist in categories.json. 11. entry.json pointers have the required marketplace fields, valid inline SVG icons, and safe source URLs. Team pointers additionally accept only git sources, because a team is installed by forking @@ -437,20 +437,17 @@ def validate_builtin_manifest( f"active and retired Skill IDs overlap {overlap}", )) - expected = sorted(skill_md_names) - actual = list(skills) - if actual != expected: - missing = sorted(set(expected) - set(actual)) - extra = sorted(set(actual) - set(expected)) - order_issue = not missing and not extra - parts = [] - if missing: - parts.append(f"missing local SKILL.md skills {missing}") - if extra: - parts.append(f"contains non-local skills {extra}") - if order_issue: - parts.append("skills list is not sorted") - report.add(Issue("builtin-skills.json", "builtin-skills", "; ".join(parts))) + # Local content also serves optional marketplace installations. Only the + # explicitly selected subset is installed automatically by the client. + non_local = sorted(set(skills) - set(skill_md_names)) + if non_local: + report.add(Issue( + "builtin-skills.json", + "builtin-skills", + f"contains non-local skills {non_local}", + )) + if skills != sorted(skills): + report.add(Issue("builtin-skills.json", "builtin-skills", "skills list is not sorted")) def validate_agent_json(report: Report, agent_file: Path, category_ids: set[str]) -> None: