mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-07-23 03:43:43 +08:00
强化市场校验与索引元数据
合并市场索引、分类、i18n 校验、skill-creator 工具和已修改 skill 版本号更新。
This commit is contained in:
10
docs/I18N.md
10
docs/I18N.md
@@ -76,11 +76,12 @@ market:
|
||||
### 新建 skill(首次贡献)
|
||||
|
||||
1. 在 `skills/<your-slug>/` 下新建目录与 `SKILL.md`。
|
||||
2. 编写中文 frontmatter + 中文 body:
|
||||
2. 编写中文 frontmatter + 中文 body,并给默认英文 locale 留可替换占位:
|
||||
- `name: <your-slug>`(ASCII)
|
||||
- `metadata.i18n.{default_locale: en-US, source_locale: zh-CN, locales: [zh-CN]}`
|
||||
- `metadata.i18n.{default_locale: en-US, source_locale: zh-CN, locales: [zh-CN, en-US]}`
|
||||
- `metadata.i18n.zh-CN.{name, short_desc, description}`
|
||||
- `metadata.i18n.zh-CN.body: ./SKILL.zh-CN.md`
|
||||
- `metadata.i18n.en-US.{name, short_desc, description, body: ./SKILL.md, translated_by: ai:pending}`
|
||||
- 中文正文写在 `SKILL.zh-CN.md`,首行 `<!-- locale: zh-CN -->`
|
||||
- 根 `SKILL.md` body 留作翻译占位符(CI 会替换)
|
||||
3. 本地校验:`uv run scripts/i18n/validate-i18n.py skills/<your-slug>`
|
||||
@@ -97,14 +98,14 @@ CI 用 [GitHub Models inference API](https://docs.github.com/en/github-models)
|
||||
- **切换模型**:repository → Settings → Variables → `TRANSLATE_MODEL`,取值参考 [GitHub Models marketplace](https://github.com/marketplace?type=models) 的 `publisher/model-name` 格式。
|
||||
- **切到 Anthropic Claude**:在 repo 加 secret `ANTHROPIC_API_KEY`,再加 variable `TRANSLATE_BACKEND=anthropic`、`TRANSLATE_MODEL=claude-sonnet-4-6`。
|
||||
|
||||
提交回仓库的方式:`desirecore-bot` 在同 PR 追加 commit `chore(i18n): auto-translate skills [skip ci]`,并在 PR 留 review comment 提示人工核对。
|
||||
提交回仓库的方式:`desirecore-bot` 在同 PR 追加 commit `chore(i18n): auto-translate skills`,并在 PR 留 comment 提示人工核对。该 commit 不带 `[skip ci]`,因为必需检查需要在翻译结果上重新运行。
|
||||
|
||||
### 修改已有 skill
|
||||
|
||||
1. 修改源语言 body(`SKILL.zh-CN.md`)或 `metadata.i18n.zh-CN.{name,short_desc,description}`。
|
||||
2. 不要手动改 `source_hash`。
|
||||
3. 开 PR。CI 检测 hash 变化,重新翻译目标 locale 并追加 commit。
|
||||
4. 若某个 locale 的 `translated_by: human`,CI 会跳过该 locale 并在 PR 留 review 提示「目标语已脱钩,请确认」,由你手工同步。
|
||||
4. 若某个 locale 的 `translated_by: human` 且 `source_hash` 与源语言不一致,CI 会失败并提示该人工翻译已过期。请手工同步目标语言正文,确认无误后更新 `source_hash`。
|
||||
|
||||
---
|
||||
|
||||
@@ -114,6 +115,7 @@ CI 用 [GitHub Models inference API](https://docs.github.com/en/github-models)
|
||||
# 校验 i18n 状态
|
||||
uv run scripts/i18n/validate-i18n.py
|
||||
uv run scripts/i18n/validate-i18n.py skills/web-access
|
||||
uv run scripts/i18n/validate-i18n.py --online # 可选:检查 entry.json 外部 URL
|
||||
|
||||
# 一次性把旧格式 SKILL.md 迁移到 i18n 格式(旧 skill 已迁完,新 skill 一般不需要)
|
||||
uv run scripts/i18n/migrate.py --apply skills/<your-slug>
|
||||
|
||||
Reference in New Issue
Block a user