.claude/skills/localization-validator/SKILL.md
本地化验证技能,用于验证项目的本地化质量
npx skillsauth add shenjingnan/xiaozhi-client localization-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
该技能用于验证项目的本地化质量,确保所有面向中文开发者和用户的内容都符合项目的本地化标准,同时遵循务实开发理念。
// ❌ 错误 - 英文注释
// Get user data from API
// ✅ 正确 - 中文注释
// 从 API 获取用户数据
// ❌ 错误 - 英文描述
describe("User Component", () => {
it("should render user name correctly", () => {
// ...
});
});
// ✅ 正确 - 中文描述
describe("用户组件", () => {
it("应该正确渲染用户名称", () => {
// ...
});
});
// ❌ 错误 - 硬编码英文字符串
const serviceName = "unknown";
const status = "loading";
// ✅ 正确 - 使用中文常量
const UNKNOWN_SERVICE = "未知服务";
const LOADING_STATUS = "加载中";
以下情况可以保留英文:
使用 grep 查找英文注释模式:
grep -r "//.*[A-Z][a-z].*" --include="*.ts" --include="*.tsx" src/
查找英文测试描述:
grep -r "describe\|it(" --include="*.test.ts" --include="*.test.tsx" src/
查找硬编码英文字符串:
grep -r '"[a-zA-Z]\{3,\}"' --include="*.ts" --include="*.tsx" src/
| 英文 | 中文 | |------|------| | unknown | 未知 | | loading | 加载中 | | error | 错误 | | success | 成功 | | failed | 失败 | | pending | 待处理 | | completed | 已完成 | | configuration | 配置 | | parameter | 参数 | | component | 组件 | | service | 服务 | | server | 服务器 | | client | 客户端 |
当需要对项目进行本地化验证时:
可以将部分检查集成到 CI/CD 流程中,确保新代码符合本地化标准。
在 xiaozhi-client 项目的本地化过程中发现:
development
TypeScript严格模式检查
tools
Todo 管理技能,用于管理架构演进过程中的待办事项
testing
测试修复技能,用于分析和修复失败的测试用例
testing
测试创建技能,用于生成符合项目标准的测试用例