feat: add Claude settings, skills, and agent guidelines · python/python-docs-zh-tw@dfc07eb · GitHub
Skip to content

Commit dfc07eb

Browse files
committed
feat: add Claude settings, skills, and agent guidelines
1 parent 8cf5abe commit dfc07eb

7 files changed

Lines changed: 585 additions & 42 deletions

File tree

.claude/settings.json

Lines changed: 46 additions & 0 deletions
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
name: terminology-check
3+
description: Check and enforce terminology consistency based on project glossary. Identifies zh_CN variants and suggests zh_TW corrections.
4+
metadata:
5+
short-description: Terminology consistency checker
6+
---
7+
8+
# terminology-check
9+
10+
## Scope
11+
- Check terminology against project glossary
12+
- Identify zh_CN to zh_TW conversion needs
13+
- Track term usage consistency across files
14+
- Suggest standardized translations
15+
16+
## Terminology Sources
17+
18+
### Primary: glossary.po
19+
Official Python glossary translations at project root.
20+
21+
### Secondary: terminology.md
22+
Quick reference at `doc-translate/references/terminology.md`.
23+
24+
### Tertiary: Built-in Mapping
25+
Common zh_CN to zh_TW corrections (from `.scripts/google_translate/utils.py`).
26+
27+
## Forbidden Terms (zh_CN -> zh_TW)
28+
29+
These Simplified Chinese terms MUST be converted:
30+
31+
| Forbidden | Required | English |
32+
|-----------|----------|---------|
33+
| 創建 | 建立 | create |
34+
| 代碼 | 程式碼 | code |
35+
| 信息 | 資訊 | information |
36+
| 模塊 | 模組 | module |
37+
| 標誌 | 旗標 | flag |
38+
| 異常 | 例外 | exception |
39+
| 解釋器 | 直譯器 | interpreter |
40+
| 頭文件 | 標頭檔 | header |
41+
| 對象 | 物件 | object |
42+
| 支持 | 支援 | support |
43+
| 默認 | 預設 | default |
44+
| 兼容 | 相容 | compatible |
45+
| 字符串 | 字串 | string |
46+
|| 巨集 | macro |
47+
| 描述符 | 描述器 | descriptor |
48+
| 字節 | 位元組 | bytes |
49+
| 緩存 | 快取 | cache |
50+
| 調用 | 呼叫 | call |
51+
| 哈希 | 雜湊 | hash |
52+
| 類型 | 型別 | type |
53+
| 子類 | 子類別 | subclass |
54+
| 實現 | 實作 | implement |
55+
| 數據 | 資料 | data |
56+
| 返回 | 回傳 | return |
57+
| 指針 | 指標 | pointer |
58+
| 字段 | 欄位 | field |
59+
| 擴展 | 擴充 | extension |
60+
| 遞歸 | 遞迴 | recursive |
61+
| 用戶 | 使用者 | user |
62+
| 算法 | 演算法 | algorithm |
63+
| 優化 | 最佳化 | optimize |
64+
| 字符 | 字元 | character |
65+
| 設置 | 設定 | setting |
66+
| 線程 | 執行緒 | thread |
67+
| 進程 | 行程 | process |
68+
| 迭代 | 疊代 | iterate |
69+
| 內存 | 記憶體 | memory |
70+
| 打印 | 印出 | print |
71+
| 異步 | 非同步 | async |
72+
| 調試 | 除錯 | debug |
73+
| 堆棧 | 堆疊 | stack |
74+
| 回調 | 回呼 | callback |
75+
| 公共 | 公開 | public |
76+
| 函數 | 函式 | function |
77+
| 變量 | 變數 | variable |
78+
| 常量 | 常數 | constant |
79+
| 添加 | 新增 | add |
80+
| 轉義 | 跳脫 | escape |
81+
| 基類 | 基底類別 | base class |
82+
83+
## High-Frequency Terms (Keep in English)
84+
85+
These terms should NOT be translated, even if glossary has translations:
86+
87+
```
88+
int, float, str, bytes, bool
89+
list, tuple, dict, set
90+
iterator, generator, iterable
91+
pickle, module, method
92+
True, False, None
93+
```
94+
95+
## Standard Translations
96+
97+
Core Python terms with required zh_TW translations:
98+
99+
| English | Traditional Chinese |
100+
|---------|---------------------|
101+
| abstract base class | 抽象基底類別 |
102+
| annotation | 註釋 |
103+
| argument | 引數 |
104+
| attribute | 屬性 |
105+
| callable | 可呼叫物件 |
106+
| class | 類別 |
107+
| closure | 閉包 |
108+
| context manager | 情境管理器 |
109+
| coroutine | 協程 |
110+
| decorator | 裝飾器 |
111+
| descriptor | 描述器 |
112+
| dictionary | 字典 |
113+
| docstring | 說明字串 |
114+
| exception | 例外 |
115+
| expression | 運算式 |
116+
| function | 函式 |
117+
| generator | 產生器 |
118+
| global | 全域 |
119+
| immutable | 不可變物件 |
120+
| import | 引入 |
121+
| instance | 實例 |
122+
| interpreter | 直譯器 |
123+
| iterable | 可疊代物件 |
124+
| iterator | 疊代器 |
125+
| keyword argument | 關鍵字引數 |
126+
| list comprehension | 串列綜合運算 |
127+
| local | 區域 |
128+
| method | 方法 |
129+
| module | 模組 |
130+
| mutable | 可變物件 |
131+
| namespace | 命名空間 |
132+
| object | 物件 |
133+
| package | 套件 |
134+
| parameter | 參數 |
135+
| positional argument | 位置引數 |
136+
| sequence | 序列 |
137+
| slice | 切片 |
138+
| statement | 陳述式 |
139+
| type | 型別 |
140+
| variable | 變數 |
141+
142+
## Check Process
143+
144+
1. **Extract terms** - Parse msgstr for Chinese phrases and English words
145+
2. **Check forbidden** - Flag any zh_CN variants from the forbidden list
146+
3. **Check consistency** - Compare with other translations of same term
147+
4. **Check glossary** - Verify against official glossary.po
148+
5. **Report issues** - List violations with suggestions
149+
150+
## Output Format
151+
152+
```
153+
=== Terminology Report: library/functions.po ===
154+
155+
FORBIDDEN TERMS (must fix):
156+
Line 42: "函數" -> "函式" (function)
157+
Line 78: "返回" -> "回傳" (return)
158+
Line 156: "對象" -> "物件" (object)
159+
160+
INCONSISTENT TERMS (review):
161+
"iterator" translated as:
162+
- "疊代器" (45 occurrences) <- standard
163+
- "迭代器" (3 occurrences) <- zh_CN variant
164+
165+
Total: 3 forbidden, 1 inconsistent
166+
```
167+
168+
## Related Skills
169+
- `doc-translate` - General translation rules
170+
- `validate-translation` - Comprehensive validation

.claude/skills/translate-po.md

Lines changed: 156 additions & 0 deletions

0 commit comments

Comments
 (0)