前端测试
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 工程开发
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 底层运行要求
- Node.js
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: internationalizing-websites
description: Adds multi-language support to Next.js websites with proper SEO configuration including hreflang…
category: 工程开发
runtime: Node.js
---
# internationalizing-websites 输出预览
## PART A: 任务判断
- 适用问题:代码实现、重构、调试或代码审查。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“When to use this Skill / Supported Languages / Internationalization Workflow”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于代码实现、重构、调试或代码审查,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“When to use this Skill / Supported Languages / Internationalization Workflow”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文没有稳定的斜杠命令要求。安装验证后通常全局生效,直接在对话里点名这个 Skill 并描述任务即可。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件。
先用一个小任务确认它会围绕“When to use this Skill / Supported Languages / Internationalization Workflow”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: internationalizing-websites
description: Adds multi-language support to Next.js websites with proper SEO configuration including hreflang…
category: 工程开发
source: tomevault-io/skills-registry
---
# internationalizing-websites
## 什么时候使用
- 把工程方向的常用动作沉淀成 Agent 可调用的技能 适合处理工程开发场景下的代码实现、调试、重构、测试或代码审查,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代…
- 面向代码实现、重构、调试或代码审查,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「When to use this Skill / Supported Languages / Internationalization Workflow」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "internationalizing-websites" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> When to use this Skill / Supported Languages / Internationalization Workflow
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Node.js | 读取文件、写入/修改文件 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Internationalizing Websites
Complete workflow for adding multi-language support to Next.js websites with SEO best practices.
When to use this Skill
- Adding new language versions to existing website
- Setting up i18n (internationalization) for new website
- Configuring SEO for multiple languages
- User mentions: "add language", "translation", "localization", "hreflang", "multi-language"
Supported Languages
Common target markets:
- 🇺🇸 English (en) - Global market
- 🇯🇵 Japanese (ja) - Asian market
- 🇨🇳 Chinese (zh) - Chinese market
Extended support available for:
- Korean (ko), Portuguese (pt), Spanish (es), French (fr), German (de)
- Arabic (ar), Vietnamese (vi), Hindi (hi), Indonesian (id), Thai (th)
- Traditional Chinese (zh-hk), Italian (it), Russian (ru)
Internationalization Workflow
Copy this checklist and track your progress:
i18n Progress:
- [ ] Step 1: Prepare base language files
- [ ] Step 2: Add new language files
- [ ] Step 3: Update configuration files
- [ ] Step 4: Add translations
- [ ] Step 5: Configure SEO elements
- [ ] Step 6: Validate and test
Step 1: Prepare base language files
Ensure English (en.json) files exist as templates:
Required directories:
i18n/messages/en.json- Main translationsi18n/pages/landing/en.json- Landing page translations
Verify structure:
# Check if base files exist
ls i18n/messages/en.json
ls i18n/pages/landing/en.json
If missing, create them with complete translation keys for your website.
Step 2: Add new language files
Run the language addition script:
node scripts/i18n-add-languages.mjs
What this script does:
- Copies
en.jsonto all target language files - Updates
i18n/locale.tswith new locales - Updates
i18n/request.tswith language mappings - Updates
public/sitemap.xmlwith new language URLs
Script configuration (in i18n-add-languages.mjs):
languagesarray - List of languages to addlanguageNamesobject - Language display namestargetDirsarray - Directories containing translation files
See WORKFLOW.md for detailed step-by-step guide.
Step 3: Verify configuration updates
Check i18n/locale.ts:
export const locales = ["en", "ja", "zh", "ko", ...];
export const localeNames: any = {
en: "English",
ja: "日本語",
zh: "中文",
ko: "한국어",
...
};
Check i18n/request.ts:
- Language code mappings configured
zh-CN→zh,zh-HK→zh-hkmappings present
Check public/sitemap.xml:
- All language versions listed
hreflangtags present for each URL
Step 4: Add translations
Option A: Using AI translation (faster but needs review):
# Add structured data and pricing translations
node scripts/i18n-add-schema.js
Configure translations in the script's translations object.
Option B: Manual translation (recommended for quality):
Edit each language file with proper translations:
# Open language file
code i18n/messages/ja.json
Translation best practices:
- Use native speakers when possible
- Maintain SEO keywords in target language
- Adapt content to local culture, don't just translate
- Keep formatting consistent (placeholders, variables)
See reference/locale-codes.md for language code reference.
Step 5: Configure SEO elements
hreflang tags - Automatic via sitemap, but verify:
See reference/hreflang-guide.md for complete guide.
Localized meta tags - Translate in each language file:
{
"metadata": {
"title": "Your Site Title",
"description": "Your SEO description"
}
}
URL structure - Verify correct format:
- English:
https://example.com/orhttps://example.com/en/ - Japanese:
https://example.com/ja/ - Chinese:
https://example.com/zh/
Step 6: Validate and test
Build the project:
npm run build
CRITICAL: Fix any errors before proceeding.
Manual testing:
Language switcher:
- Visit each language version
- Verify language switcher shows all languages
- Click each language link, verify correct page loads
Content display:
- Check all pages render correctly in each language
- Verify no untranslated text (check for English in non-English pages)
- Test special characters display correctly (Japanese, Chinese, Arabic)
SEO elements:
- Inspect
<html lang="...">attribute matches page language - Verify
<link rel="alternate" hreflang="...">tags present - Check meta tags are in correct language
- Inspect
Automated validation:
# Check sitemap
curl https://your-site.com/sitemap.xml | grep hreflang
# Validate hreflang (use online tool)
# Google Search Console > Internationalization > hreflang
SEO checklist - See reference/seo-checklist.md.
If validation fails:
- Review error messages carefully
- Check configuration files for typos
- Verify language codes are correct
- Return to Step 3 and fix issues
Only proceed when all validations pass.
Important Notes
Language Code Standards
Use ISO 639-1 (two-letter codes) with optional regional variants:
en- Englishja- Japanesezh- Simplified Chinesezh-hk- Traditional Chinese (Hong Kong)pt- Portuguesept-br- Brazilian Portuguese
See reference/locale-codes.md for complete list.
SEO Implications
Correct i18n improves SEO by:
- Targeting users in their native language
- Avoiding duplicate content penalties
- Helping search engines serve correct language version
Common SEO mistakes to avoid:
- ❌ Auto-redirect based on IP (prevents search engines from crawling all versions)
- ❌ Missing hreflang tags (causes duplicate content issues)
- ❌ Inconsistent URL structure across languages
- ❌ Untranslated meta tags
Translation Quality
AI translation vs Human translation:
- ✅ AI: Fast, cost-effective, good for initial draft
- ⚠️ AI: May miss cultural nuances, needs review
- ✅ Human: Better quality, cultural adaptation
- ⚠️ Human: Slower, more expensive
Recommended approach:
- Use AI to generate initial translations
- Have native speaker review and refine
- Test with target market users
- Iterate based on feedback
Next.js i18n Routing
The system uses next-intl for routing:
- Automatic locale detection from URL
- Language switcher component
- Localized navigation
Configuration in i18n/locale.ts and i18n/request.ts.
Post-Internationalization Tasks
After adding languages:
- Submit updated sitemap to Google Search Console
- Create separate Search Console properties for each language/region
- Monitor international organic traffic in Analytics
- A/B test translations if conversion rates differ by language
- Set up alerts for international crawl errors
Script Locations
All i18n scripts are in the scripts/ directory:
i18n-add-languages.mjs- Add new language filesi18n-add-schema.js- Add structured data translations
Reference Materials
- WORKFLOW.md - Detailed step-by-step workflow
- reference/hreflang-guide.md - hreflang implementation guide
- reference/locale-codes.md - Language codes reference
- reference/seo-checklist.md - International SEO checklist
For troubleshooting, see WORKFLOW.md troubleshooting section.
Source: ComeOnOliver/skillshub — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核