go-hichat-api: Skill for Claude Code

.claude/skills/i18n/SKILL.md

i18n is a skill for Claude Code from iceymoss/go-hichat-api. It costs 48 tokens per session (1,272 once invoked), scanned A, original, Apache-2.0.

A translation setup for web and front-end components in Chinese and English. It stores matching language entries in a shared dictionary and lets components display the selected language.

In plain words
What is it for?
Use it to find visible text that needs translation, add Chinese and English entries, connect buttons and messages to the translation function, and handle simple placeholders such as item counts.
Why use it?
It replaces user-visible Chinese text hard-coded in components, so pages can switch languages and missing translations can fall back to Chinese or the translation key.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is iceymoss/go-hichat-api's own configuration. It tells Claude Code how to work on go-hichat-api itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything go-hichat-api configures →

Reuse

Borrowing it

Nothing to install: this file belongs to iceymoss/go-hichat-api. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/iceymoss/go-hichat-api/main/.claude/skills/i18n/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/iceymoss/go-hichat-api

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for i18n

README.md
[![agentmods](https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/i18n/github.svg)](https://agentmods.dev/skills/iceymoss/go-hichat-api/i18n)
Your own site
<a href="https://agentmods.dev/skills/iceymoss/go-hichat-api/i18n"><img src="https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/i18n/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for i18n

Your own site · 80×15
<a href="https://agentmods.dev/skills/iceymoss/go-hichat-api/i18n"><img src="https://agentmods.dev/badge/skills/iceymoss/go-hichat-api/i18n.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,272 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 63
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01272
Opus 5 $0.00024 $0.00636
Sonnet 5 $0.00010 $0.00254
Haiku 4.5 $0.00005 $0.00127

Measured 9d ago against content hash 2b469d6e059f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

i18n scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/i18n/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

web/ 前端的用户可见文本接入多语言。本项目不用 react-i18next,也没有 web/src/i18n/locales/*.json(CLAUDE.md / frontend.md 里那句已过时,以本文为准)。

机制(真相)

  • 字典:web/src/lib/i18n.ts —— 一个扁平对象 dict['zh-CN'] / dict['en'],key 用点号命名(如 trend.publish)。
  • 取值函数:t(key, lang),缺失时回退 zh-CN,再回退 key 本身。不支持占位符插值
  • Hook:web/src/hooks/use-i18n.tsuseT(),返回 (key) => translate(key, lang),lang 来自 useSettingsStore(s => s.language)
  • 占位符:自己用 .replace(),例如 t('trend.imageLimit').replace('{count}', String(n))

步骤

1. 找出硬编码中文

cd web
# 列某组件里所有非注释的中文行
grep -nE "[一-鿿]" src/components/im/Xxx.tsx | grep -vE "^\s*[0-9]+:\s*(//|/\*|\*)"

逐条判断是否用户可见(按钮/标题/placeholder/title/toast/空态/确认弹窗都算)。不该翻译的:语言名本身(简体中文 / English)、代码注释、日志、接口字段名。

2. 在 lib/i18n.ts 加 key

zh-CN 块末尾和 en 块末尾各加一组,分组写注释,两边 key 必须一一对应:

// zh-CN 块
'xxx.title': '我的相册',
'xxx.itemCount': '{count} 项',
// en 块
'xxx.title': 'Album',
'xxx.itemCount': '{count} items',
  • 命名空间按模块取前缀(trend.* / fav.* / pe.* / sec.* / upc.* 等)。
  • 先复用已有 key,文案一致就别新建:通用 common.save/cancel/confirm/back/loadMore、时间 group.time.justNow/minutesAgo/hoursAgo/monthDay、在线 chat.online/offline

3. 组件里接 useT

import { useT } from '@/hooks/use-i18n';

export default function Xxx() {
  const t = useT();           // 必须在所有 early return 之前(Hooks 规则)
  ...
  <span>{t('xxx.title')}</span>
  <input placeholder={t('xxx.search')} />
  toast.success(t('xxx.saved'));
  <div>{t('xxx.itemCount').replace('{count}', String(n))}</div>
}

每个子组件都要各自 const t = useT() —— 子组件拿不到父组件的 t

4. 校验

cd web && npx tsc --noEmit -p tsconfig.json 2>&1 | grep <你改的文件名>
# 再确认无残留(排除注释/语言名/兜底)
grep -nE "[一-鿿]" src/components/im/Xxx.tsx | grep -vE "//|/\*|\*|简体中文"

预存的既有报错(如 aspectSquare/ringColor)与本次无关,只看自己文件。

常见坑(务必照做)

  • 模块级常量表const TYPE_MAP = {1:{label:'文本'}}):函数体外拿不到 t。把 label:'文本' 改成 labelKey:'trend.type.text',渲染时 t(cfg.labelKey)
  • 模块级辅助函数fmtTime / getUserName):加一个 t 参数 fmtTime(date, t),所有调用点传进去。
  • 变量名遮蔽.map(t => ...)const t = list.find(...) 会把翻译函数 t 遮蔽。重命名迭代/局部变量(tr / ty),别动翻译函数名。
  • early return 之前调 HookuseT() 不能放在 if (!open) return null 之后。
  • 富文本拆分你的数据将<strong>永久删除</strong> 这种,拆成 t('a')<strong>{t('b')}</strong>t('c') 三段 key。
  • 批量替换:用 perl -0pi -e "s/.../.../g"不要加 -CSD,否则中文字节与解码不匹配会全部 miss)。

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 85 lines · 48 tokens per session scan A 2b469d6e059f

Subscribe to this mod's changes

i18n is a skill published in the GitHub repository iceymoss/go-hichat-api (41 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 48 tokens to every session and 1,272 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

harden

Improve interface resilience through better error handling, i18n support, text overflow handling, and edge case management. Makes interfaces robust and production-ready. Use when the user asks to harden, make production-ready, handle edge cases, add error states, or fix overflow and i18n issues.

fengshao1227/ccg-workflow · 62 tokens

localization-toolkit

This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the i18n framework, replacing hard-coded strings, ensuring en-US/zh-CN coverage, mapping error codes to localized messages…

zebbern/claude-code-guide · 82 tokens

json-ui

CRITICAL: Use for json-ui component rendering and development. Triggers on: json-ui, json render, component catalog, report render, HTML report, I18nString, i18n, bilingual, language switch, dual language, PaperHeader, AuthorList, Abstract, MetricsGrid, Section, Highlight, Zod schema, catalog.ts, cli.ts…

actionbook/actionbook · 118 tokens

experience-ui-bundle-localize

MUST activate to localize / internationalize a uiBundles//src/ project (React or Angular): extract hardcoded user-facing strings into Custom Labels, wire a runtime i18n library over the Platform SDK backend, add labels for another language, or troubleshoot label rendering across locales. Triggers: user-facing string…

forcedotcom/sf-skills · 225 tokens

extract-source-sample

Given the path to a finished content-goose ad-run folder, extract everything that defines that ad — recipe shot list, VO script, characters, voices, world, atom-skills, master mp4 — and emit a source-sample.json in the exact shape the upload-ad-sample skill writes to the Goose Ads library. Also links every character…

gooseworks-ai/goose-skills · 160 tokens

experience-lwc-rtl-validate

Use this skill to review a Lightning Web Component (.html, .js, .css files) for right-to-left (RTL) internationalization correctness, producing a finding list with code-level fixes covering CSS logical properties, bidirectional text handling, keyboard semantics, and RTL-aware SLDS class usage. TRIGGER when the user…

forcedotcom/sf-skills · 197 tokens