Skip to content

Commit 5041d3c

Browse files
committed
feat: unify and enhance skills md
1 parent 01edb89 commit 5041d3c

File tree

14 files changed

+687
-575
lines changed

14 files changed

+687
-575
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: check-terminology
3+
description: Checks terminology consistency against project glossary and identifies zh_CN terms that need conversion to zh_TW. Use to verify term usage.
4+
argument-hint: <term-or-po-file>
5+
---
6+
7+
# check-terminology
8+
9+
Check terminology against project glossary and zh_CN/zh_TW mappings.
10+
11+
## Terminology Sources
12+
13+
1. **Primary:** `glossary.po` - Official Python glossary translations
14+
2. **Secondary:** `focused_terminology_dictionary.csv` - 118 key terms
15+
3. **Tertiary:** `.scripts/google_translate/utils.py` - zh_CN to zh_TW mappings
16+
17+
## Check Process
18+
19+
### For a Single Term
20+
1. Search in `../translate-po/references/terminology.md`
21+
2. Check if it's in `references/keep-in-english.md`
22+
3. If found, use the standard translation
23+
4. If not found, check `glossary.po` in project root
24+
25+
### For a PO File
26+
1. Extract all translated terms from msgstr
27+
2. Cross-reference against glossary
28+
3. Identify forbidden zh_CN terms
29+
4. Report inconsistencies
30+
31+
## Error Categories
32+
33+
### Category 1: Forbidden Terms (Must Fix)
34+
zh_CN terms that must be converted to zh_TW.
35+
36+
Example violations:
37+
- `函數` -> should be `函式`
38+
- `返回` -> should be `回傳`
39+
- `對象` -> should be `物件`
40+
41+
### Category 2: Inconsistent Terms (Should Review)
42+
Same English term translated differently across files.
43+
44+
### Category 3: Missing from Glossary (Informational)
45+
New terms not yet in the glossary.
46+
47+
## Context Decision Log
48+
49+
When a reviewer decides a translation depends on nearby context (above/below),
50+
record the decision here for future reference. Keep entries short and specific.
51+
52+
Format:
53+
- **Term/pattern:** ...
54+
- **Decision:** ...
55+
- **Context cue:** ...
56+
- **Example:** `source` -> `translation`
57+
58+
Example:
59+
- **Term/pattern:** 類型 / 型別
60+
- **Decision:** 用語依上下文;Python 型別物件用「型別」,一般分類用「類型」
61+
- **Context cue:** 出現 `int/str/dict/type` 或 "type object"
62+
- **Example:** "two types of packages" -> "兩種類型的套件"
63+
64+
Decision Log:
65+
- **Term/pattern:** 類型 / 型別
66+
- **Decision:** 用語依上下文;Python 型別物件用「型別」,一般分類用「類型」
67+
- **Context cue:** 出現 `int/str/dict/type` 或 "type object"
68+
- **Example:** "two types of packages" -> "兩種類型的套件"
69+
70+
## Quick Lookup
71+
72+
1. Check `../translate-po/references/terminology.md` first (authoritative, 186 terms)
73+
2. If term should stay in English, see `references/keep-in-english.md`
74+
75+
## References
76+
77+
- `../translate-po/references/terminology.md` - Complete term translations (186 terms)
78+
- `references/keep-in-english.md` - Terms that stay in English
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Terms to Keep in English
2+
3+
These terms should NOT be translated. They remain in English in all translations.
4+
5+
## Python Keywords
6+
7+
All Python keywords stay in English:
8+
```
9+
def, class, if, else, elif, for, while, try, except, finally,
10+
with, as, pass, break, continue, raise, assert, yield, from,
11+
global, nonlocal, del, in, is, not, and, or, return, import,
12+
async, await, lambda, True, False, None
13+
```
14+
15+
## Built-in Type Names (in code context)
16+
17+
When referring to actual Python types in code:
18+
```
19+
int, float, str, bytes, bool, complex
20+
list, tuple, dict, set, frozenset
21+
iterator, generator, iterable
22+
range, slice, type, object
23+
```
24+
25+
Note: In prose, these may be translated (e.g., "a list" -> "一個串列")
26+
27+
## Standard Library Modules
28+
29+
Module names stay in English:
30+
```
31+
os, sys, re, json, pickle, collections, itertools, functools,
32+
datetime, logging, unittest, typing, asyncio, pathlib, etc.
33+
```
34+
35+
## Exception Class Names
36+
37+
All exception names stay in English:
38+
```
39+
Exception, ValueError, TypeError, AttributeError, KeyError,
40+
IndexError, ImportError, RuntimeError, NameError, StopIteration,
41+
FileNotFoundError, PermissionError, ConnectionError, TimeoutError,
42+
NotImplementedError, MemoryError, RecursionError, ZeroDivisionError,
43+
OverflowError, UnboundLocalError, AssertionError, SyntaxError,
44+
IndentationError, TabError, UnicodeError, UnicodeDecodeError,
45+
UnicodeEncodeError, UnicodeTranslateError
46+
```
47+
48+
## Special Method Names
49+
50+
All dunder methods stay in English:
51+
```
52+
__init__, __str__, __repr__, __len__, __getitem__, __setitem__,
53+
__delitem__, __contains__, __iter__, __next__, __enter__, __exit__,
54+
__call__, __new__, __del__, __eq__, __hash__, __bool__, etc.
55+
```
56+
57+
## Technical Terms (Context Dependent)
58+
59+
These may stay in English in technical contexts:
60+
- `runtime` (執行時期 in prose)
61+
- `mock`, `patch` (testing terms)
62+
- `pickle` (serialization)
63+
- `GIL` (Global Interpreter Lock)
64+
- `API` (Application Programming Interface)
65+
- `URL`, `HTTP`, `HTML`, `JSON`, `XML`
66+
- `CPU`, `RAM`, `I/O`
67+
68+
## Brand/Project Names
69+
70+
- Python, CPython, PyPy, Jython
71+
- Sphinx, reStructuredText (reST)
72+
- GitHub, GitLab
73+
- NumPy, pandas, Django, Flask

.claude/skills/terminology-check.md

Lines changed: 0 additions & 196 deletions
This file was deleted.

0 commit comments

Comments
 (0)