OpenCC
v1.0.0Chinese character conversion between Simplified/Traditional and regional variants. Use when Pi needs to convert Chinese text with precision and awareness of...
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description, README, SKILL.md, pyproject.toml, scripts/convert.py, and tests all align: the skill wraps the OpenCC conversion library and exposes CLI and Python usage. There are no unrelated environment variables, binaries, or credentials requested.
Instruction Scope
Runtime instructions and the CLI script only read input text (positional argument, stdin, or an input file), perform conversion via opencc.OpenCC(...).convert(...), and write output to stdout or a file. They do not access external endpoints, secrets, or unrelated system files. Note: the skill expects OpenCC JSON mode files (e.g., s2t.json) to be available via the opencc package at runtime — the repo does not include those JSON files itself, so correct behavior depends on the installed opencc package providing them.
Install Mechanism
No registry install spec is provided in the skill metadata, but SKILL.md/README suggest installing via 'uv add opencc' or 'pip install opencc' and pyproject.toml declares dependency 'opencc>=1.2.0'. Installing a PyPI package is expected for this functionality. This is a normal install pattern, but the runtime depends on the authenticity and contents of the opencc package (which may include native components).
Credentials
The skill requests no environment variables, no credentials, and no config paths. All code operates on supplied text/files and uses the opencc library only — there is no disproportionate secret access or credential request.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or global agent settings, and is user-invocable. It does not persist credentials or enable itself automatically in a privileged way.
Assessment
This skill appears coherent and purely focused on Chinese character conversion, but before installing you should: 1) Verify which opencc package you'll install (pip package name and maintainer) and pin a known-good version — malicious or typo-squatted PyPI packages are possible. 2) Confirm the opencc package you install provides the expected JSON mode files (s2t.json, s2tw.json, etc.) or supply them from a trusted OpenCC release. 3) If you require production or high-assurance use, audit the installed opencc package (check for native code, post-install hooks, and network behavior) and run the included tests (pytest test_convert.py). 4) No secrets or network endpoints are present in the skill itself, but keep general supply-chain caution for third-party dependencies.Like a lobster shell, security has layers — review code before you run it.
latest
OpenCC Skill for OpenClaw
Convert Chinese text with precision using OpenCC (Open Chinese Convert).
Quick Start
Basic Conversions
import opencc
# Simplified → Traditional
converter = opencc.OpenCC('s2t.json')
result = converter.convert('汉字') # → 漢字
# Traditional → Simplified
converter = opencc.OpenCC('t2s.json')
result = converter.convert('漢字') # → 汉字
# Simplified → Taiwan Standard (正體)
converter = opencc.OpenCC('s2tw.json')
result = converter.convert('软件') # → 軟體
# Simplified → Hong Kong variant (繁體)
converter = opencc.OpenCC('s2hk.json')
result = converter.convert('软件') # → 軟件
Conversion Modes
| Config | Source | Target | Use Case |
|---|---|---|---|
s2t.json | Simplified | Traditional (OpenCC) | Generic traditional conversion |
t2s.json | Traditional | Simplified | Generic simplified conversion |
s2tw.json | Simplified | Taiwan Standard (正體) | Taiwan-specific terminology |
tw2s.json | Taiwan Standard | Simplified | Taiwan to Mainland |
s2hk.json | Simplified | Hong Kong (繁體) | Hong Kong variant |
hk2s.json | Hong Kong | Simplified | Hong Kong to Mainland |
s2twp.json | Simplified | Taiwan + idioms | Taiwan terminology + common phrases |
tw2sp.json | Taiwan | Simplified + idioms | Taiwan to Mainland with idioms |
t2tw.json | Traditional | Taiwan Standard | Standardize to Taiwan |
t2hk.json | Traditional | Hong Kong | Standardize to Hong Kong |
hk2t.json | Hong Kong | Traditional | Hong Kong to OpenCC standard |
t2jp.json | Traditional | Japanese Kanji (Shinjitai) | Convert to modern Japanese |
jp2t.json | Japanese | Traditional Chinese | Japanese to traditional Chinese |
tw2t.json | Taiwan Standard | Traditional | Taiwan to OpenCC standard |
Use Cases
When to Use OpenCC
- Blog writing with regional awareness — Ensure blog uses consistent Taiwan/Mainland terminology
- Content localization — Convert content for different Chinese-speaking regions
- Character normalization — Standardize variant characters (e.g., 裏 vs 裡)
- Multi-script content — Convert between Chinese and Japanese Kanji as needed
Region-Specific Guidance
- Mainland China: Use
s2tfor traditional,t2sfor simplified - Taiwan (正體): Use
s2twfor precise Taiwan terminology,s2twpfor common phrases - Hong Kong: Use
s2hkfor Hong Kong variant - Japan: Use
t2jpfor modern Japanese Kanji
CLI Usage
Use the included convert.py script:
# Command line conversion
python scripts/convert.py --source s2t "汉字转换"
# With stdin
echo "汉字转换" | python scripts/convert.py --source s2t
# Save to file
python scripts/convert.py --source s2t --input input.txt --output output.txt
Installation
# Using uv (recommended)
uv add opencc
# Or with pip
pip install opencc
API Reference
See references/opencc_guide.md for:
- Detailed conversion mode descriptions
- Common conversion patterns
- Performance considerations
- Troubleshooting
Characteristics
- Character-level conversion: Precise character-by-character transformation
- Phrase-level conversion: Smart phrase detection for accurate multi-character terms
- Variant handling: Distinguishes between character variants (e.g., 裏/裡)
- Regional awareness: Customized rules for Mainland, Taiwan, Hong Kong, Japan
- No linguistic translation: Converts writing system only, not meaning
Limitations
- Not a translator: Converts writing systems, not languages. Cannot convert between Cantonese/Mandarin or other dialects.
- Phrase-based: Some contexts may require manual review (e.g., proper nouns, technical terms)
- Regional boundaries: Different regions have different standards; always verify output matches your target
Files
scripts/convert.py— Python CLI wrapperreferences/opencc_guide.md— Detailed mode referencepyproject.toml— Python project configuration with uv
Comments
Loading comments...
