i18n-translate
Translate one, multiple, or all explicitly requested FastGPT i18next namespace JSON files from the completed Simplified Chinese source into every supported target locale, with product-language research and structural validation. Use only when the user explicitly invokes `$i18n-translate` and identifies namespace names, files under `packages/web/i18n/zh-CN/`, or all namespaces; never trigger implicitly for ordinary i18n, copywriting, or documentation work.
git clone --depth 1 https://github.com/labring/FastGPT /tmp/i18n-translate && cp -r /tmp/i18n-translate/.agents/skills/system/i18n-translate ~/.claude/skills/i18n-translateSKILL.md
# FastGPT i18n Namespace Translation
Treat `packages/web/i18n/zh-CN/<namespace>.json` as the semantic and structural source of truth. Translate the specified namespace into all sibling locale directories without changing runtime behavior.
Before translating, read both of these references completely:
- [references/translation-guidelines.md](references/translation-guidelines.md)
- [references/fastgpt-glossary.json](references/fastgpt-glossary.json)
## Workflow
### 1. Resolve and constrain the scope
- Require explicit namespace names, source files, or `all` from the user.
- Resolve a bare namespace such as `app` to `packages/web/i18n/zh-CN/app.json`.
- Resolve `all` to every JSON file directly under `packages/web/i18n/zh-CN/`, sorted by filename.
- Reject a source outside `zh-CN`; ask for the Simplified Chinese source instead.
- Discover target locales from sibling directories under `packages/web/i18n/`, excluding `zh-CN`.
- Edit only the selected namespace files. Create a missing target namespace file when its locale directory already exists, but never create a new locale.
- Preserve unrelated user changes already present in target files.
### 2. Establish product meaning before wording
- Read the complete Chinese source and every existing target file.
- Use `rg` to find how the same product concept is translated elsewhere in `packages/web/i18n/en/`.
- Inspect call sites for ambiguous labels, actions, state names, errors, or placeholders. Determine whether the text is a button, heading, status, description, toast, or validation message.
- Follow this evidence order: the FastGPT glossary; feature behavior and UI context; nearby translation style; official n8n or Dify English product language; general technical usage.
- Match the longest glossary term first. A compound such as `知识库引用` overrides the separate entries for `知识库` and `引用`.
- Treat forbidden glossary translations as errors. If a needed FastGPT product concept is missing from the glossary, report it instead of inventing a new canonical term.
- Never copy competitor terminology merely because it exists. If evidence still conflicts, pause and ask the user about the specific term.
### 3. Translate locale by locale
- Keep JSON keys, nesting, key order, value types, and formatting aligned with the Chinese source.
- Preserve interpolation variables such as `{{name}}`, rich-text tags such as `<bold>`, URLs, literal escape sequences, and intentional line breaks exactly.
- Align each target's key set with the Chinese source. Remove a target-only key only after confirming it is absent from the complete source file; do not infer from a partial snippet.
- For `en`, write concise, natural North American product English. Translate intent rather than syntax, use sentence case by default, and favor familiar product terms over literal Chinese constructions.
- For `zh-Hant`, write region-neutral, natural Traditional Chinese rather than applying blind character conversion. Prefer established repository terminology when regional variants differ.
- For future locales, use native product language for that locale. If reliable translation is not possible, pause before editing and ask whether to omit that locale or wait for a qualified reviewer; do not silently deliver a partial locale set.
- Reuse one translation for one product concept unless the UI context genuinely changes its meaning.
- When the same term is inconsistent outside the specified namespace, report the finding but do not modify another namespace without the user's approval.
### 4. Validate before finishing
Run the bundled validator from the repository root:
```bash
node .agents/skills/system/i18n-translate/scripts/validate-namespace.mjs \
packages/web/i18n/zh-CN/<namespace>.json
```
For `all`, run the validator once for every source namespace and require every run to finish with zero errors and zero warnings.
Then:
- Format only the changed namespace JSON files with the repository formatter.
- Run the validator again after formatting.
- Review `git diff -- <source-and-target-files>` for mistranslation, accidental key changes, stale values, inconsistent capitalization, and unrelated edits.
- Search the English target for untranslated Han text. Treat valid Chinese brand names or user-visible examples as reviewed exceptions, not automatic failures.
- Do not run the full test suite for translation-only changes unless the user requests it or code/configuration outside locale JSON also changed.
## Completion response
Report:
- the namespace and locales translated;
- files created or updated;
- validation commands and results;
- any intentionally retained source-language text or unresolved terminology.
Do not write a separate summary document.Expert prompt engineering skill that transforms Claude into "Alpha-Prompt" - a master prompt engineer who collaboratively crafts high-quality prompts through flexible dialogue. Activates when user asks to "optimize prompt", "improve system instruction", "enhance AI instruction", or mentions prompt engineering tasks.
当用户需要弃用一个工作流节点(保留向后兼容、隐藏出模板面板)时触发该 skill。FastGPT 工作流节点的弃用流程标准化封装,覆盖模板、Dispatcher、UI 引用等所有需要改动的位置。
将 FastGPT 文档从中文翻译为面向北美用户的英文。当用户提到翻译文档、i18n、国际化、translate docs、新增/修改了中文文档需要同步英文版时,使用此 skill。也适用于用户要求检查文档翻译缺失、批量翻译、或对比中英文文档差异的场景。
为 FastGPT 新资源接入权限管理。当用户需要为新资源(如 AgentSkill、Plugin 等)添加权限支持时触发。
FastGPT API 开发规范。重点强调使用 zod schema 定义入参和出参,在 API 文档中声明路由信息,编写对应的 OpenAPI 文档,以及在 API 路由中使用 schema.parse 进行验证。
仅当用户明确手动指定使用 pr-review skill 时触发;不要因为用户传入 PR 链接、要求 review 或要求代码审查而自动触发。
当用户需要编写一个单元测试时,触发该 skill,编写单元测试。
手动触发的 FastGPT PR 或本地分支变更梳理技能。仅当用户显式调用 $pr-change-analysis 时使用;用于 reviewer 分析一个 GitHub PR 或当前本地分支相对 upstream/main 的需求变更、影响范围、代码质量与代码风格,不用于自动审查触发。