skills/go-i18n/SKILL.md
Use when defining or updating Go CLI i18n rules in this repo, especially around locale files, env-based language selection, and key naming.
npx skillsauth add castle-x/skills-x go-i18nInstall 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.
This skill documents the Go CLI i18n rules used in this repo, including language detection, locale files, and key naming conventions.
cmd/skills-xcmd/skills-x/i18n/i18n.gocmd/skills-x/i18n/locales/zh.yaml, cmd/skills-x/i18n/locales/en.yaml//go:embed locales/*.yaml (locales are embedded at build time)Priority order in detectLanguage():
SKILLS_LANGLANGLC_ALLzhNormalization uses prefix matching:
zh, zh_CN, zh_TW → zhen, en_US → enzhInitialize once (early in main):
import "github.com/castle-x/skills-x/cmd/skills-x/i18n"
i18n.MustInit()
Translate strings:
title := i18n.T("list_header")
msg := i18n.Tf("init_success", skillName)
Missing keys return the key itself (useful for spotting gaps).
Use lowercase + underscores with category prefixes:
app_ app metadatacmd_ command descriptions/flagslist_ list outputinit_ init outputerr_ error messagescat_ category namesskill_ skill descriptionsmeta_ meta warningsRule: Never mix Chinese and English in the same string. Use two locale keys instead.
cmd/skills-x/i18n/locales/zh.yamlcmd/skills-x/i18n/locales/en.yamli18n.T / i18n.Tf in Go code.make build) to embed the updated YAML.SKILLS_LANG=zh ./bin/skills-x listSKILLS_LANG=en ./bin/skills-x listAdd a skill_<skill-name> key to both locale files. The list view reads descriptions from i18n, not from the skill file.
# locales/en.yaml
init_success: "Installed: %s"
# locales/zh.yaml
init_success: "安装成功: %s"
fmt.Println(i18n.Tf("init_success", skillName))
| Item | Value |
|------|-------|
| Locale files | cmd/skills-x/i18n/locales/{zh,en}.yaml |
| Init | i18n.MustInit() |
| Translate | i18n.T, i18n.Tf |
| Language priority | SKILLS_LANG > LANG > LC_ALL > zh |
fmt.Sprintf before calling i18n.Tftools
Design specification for CLI TUI (Terminal User Interface). This skill provides comprehensive guidelines for implementing interactive terminal UI components, including page layout structure, color schemes, keyboard navigation, and multi-level navigation principles.
documentation
Guide for contributing new skills to the skills-x collection. This skill should be used when users want to add new open-source skills from external sources (like agentskills.io or anthropics/skills) to the skills-x repository. It covers the complete workflow from discovery to publishing.
tools
Use when designing or refining UIs that must be visually minimal, low-noise, and icon-forward while staying understandable for new users, especially when reducing text, consolidating controls, or streamlining dialogs, toolbars, search panels, or list results.
development
Integrate PocketBase as a Go library using the github.com/castle-x/goutils/pocketbase (gopb) package to build single-binary full-stack applications. Use when building Go applications that need user authentication, embedding PocketBase into Go binary, registering custom API routes, managing default users, serving embedded SPA frontend, or deploying single-binary applications. NOT for using PocketBase as a standalone separate process.