Skip to content

Add end-to-end English language support across skill flow, prompts, and tools - #22

Open
imAaryash wants to merge 6 commits into
titanwings:masterfrom
imAaryash:master
Open

Add end-to-end English language support across skill flow, prompts, and tools#22
imAaryash wants to merge 6 commits into
titanwings:masterfrom
imAaryash:master

Conversation

@imAaryash

Copy link
Copy Markdown

Summary

This PR adds full bilingual support (Chinese + English) to the ex-skill workflow, including language selection at the start, language-consistent prompt execution, and English-capable CLI tooling.

What Changed

  1. Added language-first onboarding in the main orchestration flow.
  2. Introduced preferred_language propagation across prompt stages so outputs stay in the chosen language.
  3. Updated prompt templates to remove Chinese-only assumptions and support zh/en generation.
  4. Extended Python tools with --lang support and bilingual CLI output:
  5. skill_writer.py
  6. version_manager.py
  7. wechat_parser.py
  8. wechat_decryptor.py
  9. Added language persistence in generated metadata (preferred_language / language).
  10. Added English skill template generation in skill_writer.
  11. Added repository .gitignore for Python/env/cache/generated artifacts, while preserving sample skill tracking.
  12. Created and validated one English sample skill variant: example_liuzhimin_en.

Validation

  1. Python compile checks passed for updated tool scripts.
  2. CLI smoke tests passed (help/list/create paths).
  3. Existing sample skill remains discoverable.
  4. New English skill is generated correctly and listed by tooling with language=en metadata.

Impact

  1. Users can now start in English and stay in English throughout the flow unless they explicitly switch.
  2. Tooling behavior now matches the multilingual product intent.
  3. Backward compatibility is preserved for existing Chinese skills.

Introduce session-level language selection and i18n across the project. Add .gitignore and update README/SKILL to require language choice and to lock subsequent prompts to preferred_language. Update prompt files (prompts/*.md) to accept and respect preferred_language and to produce English/Chinese outputs. Extend tools with language-aware behavior: skill_writer (templates, language normalization, generation/update hooks), version_manager, wechat_decryptor, and wechat_parser (CLI --lang flags, tr helpers, localized messages and outputs). Ensure created meta stores preferred_language and CLI outputs reflect chosen language.
Copilot AI review requested due to automatic review settings April 9, 2026 09:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds bilingual (Chinese/English) support across the ex-skill workflow by introducing a preferred_language concept in the docs/prompts and extending the Python CLI tools to generate/output content in the selected language.

Changes:

  • Added language selection guidance (preferred_language) to the workflow docs and propagated language rules into prompt templates.
  • Extended CLI tools with --lang and bilingual runtime output (WeChat decrypt/parse, version manager, skill writer).
  • Added English skill template generation and persisted language metadata (preferred_language / language) in generated meta.json, plus a new .gitignore.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/wechat_parser.py Adds --lang, translation helper, and English-capable output formatting for extracted chats.
tools/wechat_decryptor.py Adds --lang and bilingual runtime messaging for decrypt flow.
tools/version_manager.py Adds --lang and bilingual output for list/rollback/cleanup.
tools/skill_writer.py Adds EN/ZH templates, language normalization, and persists preferred language in metadata.
SKILL.md Documents Step 0 language selection and “language-locked” execution behavior.
README.md Notes new language selection behavior in the user flow.
prompts/intake.md Adds preferred_language rules for bilingual intake prompts.
prompts/chat_analyzer.md Adds preferred_language rules for bilingual chat analysis output.
prompts/persona_analyzer.md Adds preferred_language rules for bilingual persona analysis output.
prompts/persona_builder.md Adds preferred_language rules for bilingual persona generation.
prompts/merger.md Adds preferred_language rules for bilingual merge reporting/output consistency.
prompts/correction_handler.md Adds preferred_language rules for bilingual correction handling and writing.
.gitignore Ignores Python/tool artifacts and generated skills while keeping a sample skill tracked.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/wechat_parser.py
Comment on lines 606 to 610
lines += [
"---",
"",
f"## 日常闲聊(风格参考,共 {len(classified['daily_messages'])} 条,全部输出)",
f"## {(f'Daily Chat (style reference, {len(classified['daily_messages'])} messages, full output)' if is_en else f'日常闲聊(风格参考,共 {len(classified['daily_messages'])} 条,全部输出)')}",
"",

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This f-string has a quoting issue: the inner f-strings use single quotes while also indexing classified['daily_messages'], which will raise a SyntaxError and prevent the script from running. Consider computing the daily message count into a variable (or using double quotes for dict keys / avoiding nested f-strings) and then building the header string without nested quoting conflicts.

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_parser.py Outdated
Comment on lines +657 to +690
@@ -670,9 +687,12 @@ def main():
parser.add_argument("--list-contacts", action="store_true", help="列出所有联系人")
parser.add_argument("--no-context", action="store_true", help="不包含完整对话片段")
parser.add_argument("--json", action="store_true", help="以 JSON 格式输出原始消息")
parser.add_argument("--lang", choices=["zh", "en"], default="zh", help="CLI/output language")

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI --lang flag only affects runtime prints after parse_args(), but argparse help/epilog and most help= strings remain Chinese (and the description is now always English). This means --lang en won't produce an English --help experience, and the default zh experience still shows an English description. If the goal is truly bilingual CLI UX, consider a small pre-parse of --lang (e.g., parse_known_args) to set the language before constructing the full parser, and localize description, epilog, and argument help strings accordingly (or keep them bilingual).

Copilot uses AI. Check for mistakes.
Comment thread tools/skill_writer.py Outdated
Comment on lines +424 to +438
elif args.action == "update":
if not args.slug:
print("错误:update 操作需要 --slug", file=sys.stderr)
err = "Error: update requires --slug" if lang == "en" else "错误:update 操作需要 --slug"
print(err, file=sys.stderr)
sys.exit(1)

skill_dir = base_dir / args.slug
if not skill_dir.exists():
print(f"错误:找不到 Skill 目录 {skill_dir}", file=sys.stderr)
err = f"Error: skill directory not found: {skill_dir}" if lang == "en" else f"错误:找不到 Skill 目录 {skill_dir}"
print(err, file=sys.stderr)
sys.exit(1)

persona_patch = Path(args.persona_patch).read_text(encoding="utf-8") if args.persona_patch else None
new_version = update_ex_skill(skill_dir, persona_patch)
print(f"✅ Skill 已更新到 {new_version}:{skill_dir}")
new_version = update_ex_skill(skill_dir, persona_patch, language=None)
if lang == "en":

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update can be invoked without --persona-patch (it’s optional), but update_ex_skill() will still archive the current version, bump meta.version, and rewrite SKILL.md/meta.json even when there is no patch/correction to apply. This creates “empty” versions and changes timestamps without any actual content update. Consider requiring --persona-patch for --action update (or making update_ex_skill early-return/no-op when both persona_patch and correction are missing).

Copilot uses AI. Check for mistakes.
Add English workflow files (SKILL_EN.md and prompts_en/*) and update README to point maintainers to the English pack. Update SKILL.md to route prompt usage based on preferred_language (zh/en). Internationalize and clean up tooling: update skill_writer.py, version_manager.py, wechat_decryptor.py, and wechat_parser.py with English help text, improved docstrings, language flags, and bilingual error/output messages so CLI and generated content can follow preferred_language. Also add safer argument/help strings and minor robustness fixes when reading files.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/wechat_parser.py
Comment on lines 609 to 613
lines += [
"---",
"",
f"## 日常闲聊(风格参考,共 {len(classified['daily_messages'])} 条,全部输出)",
f"## {(f'Daily Chat (style reference, {len(classified['daily_messages'])} messages, full output)' if is_en else f'日常闲聊(风格参考,共 {len(classified['daily_messages'])} 条,全部输出)')}",
"",

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This f-string will not parse because it nests single-quoted f-strings that also contain single-quoted dict keys (classified['daily_messages']). Please refactor to avoid nested f-strings (e.g., compute the count in a variable and use one f-string, or use different quote styles).

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py Outdated
Comment on lines 40 to 46
except ImportError:
print("请先安装依赖:pip install psutil", file=sys.stderr)
print("Please install dependency first: pip install psutil", file=sys.stderr)
sys.exit(1)

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependency error messages here ignore the selected --lang and always print English, even though this script defines tr()/CLI_LANG for bilingual output. Please route these user-facing errors through tr(...) so zh users still get Chinese output (and keep the experience consistent with the rest of the tool).

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py
Comment on lines 130 to 135
try:
import pymem
import pymem.process
except ImportError:
print("请先安装依赖:pip install pymem", file=sys.stderr)
print("Please install dependency first: pip install pymem", file=sys.stderr)
sys.exit(1)

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same localization issue as above: this ImportError path always prints English and does not use tr(...), so --lang zh users get mixed-language output. Please wrap this message with tr(...) (or otherwise localize consistently).

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py
Comment on lines 402 to 408
try:
from Crypto.Hash import HMAC, SHA1
from Crypto.Protocol.KDF import PBKDF2
from Crypto.Cipher import AES
except ImportError:
print("请先安装依赖:pip install pycryptodome", file=sys.stderr)
print("Please install dependency first: pip install pycryptodome", file=sys.stderr)
sys.exit(1)

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same localization issue as above: this ImportError path always prints English and bypasses tr(...), which breaks the tool’s bilingual output contract. Please use tr(...) for the dependency-install guidance as well.

Copilot uses AI. Check for mistakes.
Comment thread tools/skill_writer.py Outdated
Comment on lines +414 to +416
pref_lang = get_preferred_language(meta, lang)
skill_dir = create_ex_skill(base_dir, slug, meta, persona_content, pref_lang)
if lang == "en":

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In create, pref_lang = get_preferred_language(meta, lang) will always pick the CLI language because --lang defaults to a non-empty value ("zh"). That means a meta.json containing preferred_language=en/language=en will still generate a Chinese SKILL.md unless the caller explicitly passes --lang en, which undermines language persistence. Consider making --lang default to an "auto"/None mode (use meta when present), or only overriding meta when the user explicitly supplies --lang.

Copilot uses AI. Check for mistakes.
Comment thread SKILL_EN.md
Comment on lines +57 to +63
Method A commands:
python tools/wechat_decryptor.py --find-key-only
python tools/wechat_parser.py --db-dir ./decrypted/ --target "<wechat_name>" --output messages.txt

Method B command:
python tools/wechat_parser.py --imessage --target "<phone_or_apple_id>" --output messages.txt

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this English workflow guide, the example tool commands omit --lang en even though the tools default to --lang zh. As written, following these steps will still produce Chinese CLI/output text. Consider adding --lang en to the wechat_decryptor/wechat_parser/skill_writer/version_manager command examples so the workflow stays consistently English.

Copilot uses AI. Check for mistakes.
Expose language options and English docs across tools: update SKILL_EN.md examples to include --lang en. Extend skill_writer.py to accept an --lang (auto/zh/en) option, handle lang override, and produce English output when requested; translate inline comments and docstrings to English and adjust creation/update flows. Update wechat_decryptor.py and wechat_parser.py with English docstrings/comments, better tr() usage for bilingual messages, improved platform/key extraction messaging, and iMessage/WeChat parsing wording. Overall this adds/enhances localization support and clarifies CLI help and runtime messages.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/wechat_parser.py
Comment on lines +42 to +49
CLI_LANG = "zh"


def normalize_language(language: str | None) -> str:
value = (language or "").strip().lower()
if value in {"en", "english"}:
return "en"
return "zh"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file uses PEP 604 union types (e.g., str | None / int | None), which is a Python 3.10+ syntax and will raise a SyntaxError on Python 3.9. The repository README advertises Python 3.9+, so either rewrite these annotations to Optional[...]/Union[...] (or remove them) or bump the documented minimum Python version accordingly.

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py
Comment on lines +18 to +25
CLI_LANG = "zh"


def normalize_language(language: str | None) -> str:
value = (language or "").strip().lower()
if value in {"en", "english"}:
return "en"
return "zh"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file uses PEP 604 union types (e.g., str | None / int | None), which is Python 3.10+ syntax and will fail to run on Python 3.9. The repo README indicates Python 3.9+, so either change these annotations to Optional[...]/Union[...] or update the documented minimum Python version.

Copilot uses AI. Check for mistakes.
Comment thread tools/version_manager.py
Comment on lines 22 to +29
MAX_VERSIONS = 10


def normalize_language(language: str | None) -> str:
value = (language or "").strip().lower()
if value in {"en", "english"}:
return "en"
return "zh"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalize_language uses str | None (PEP 604), which requires Python 3.10+. If this repo targets Python 3.9+ (as indicated in README), this script will fail with a SyntaxError on 3.9. Consider switching to Optional[str]/Union[str, None] (or raising the minimum Python version).

Copilot uses AI. Check for mistakes.
Comment thread tools/skill_writer.py
Comment on lines 425 to +442
elif args.action == "update":
if not args.slug:
print("错误:update 操作需要 --slug", file=sys.stderr)
err = "Error: update requires --slug" if lang == "en" else "错误:update 操作需要 --slug"
print(err, file=sys.stderr)
sys.exit(1)

skill_dir = base_dir / args.slug
if not skill_dir.exists():
print(f"错误:找不到 Skill 目录 {skill_dir}", file=sys.stderr)
err = f"Error: skill directory not found: {skill_dir}" if lang == "en" else f"错误:找不到 Skill 目录 {skill_dir}"
print(err, file=sys.stderr)
sys.exit(1)

persona_patch = Path(args.persona_patch).read_text(encoding="utf-8") if args.persona_patch else None
new_version = update_ex_skill(skill_dir, persona_patch)
print(f"✅ Skill 已更新到 {new_version}:{skill_dir}")
new_version = update_ex_skill(skill_dir, persona_patch, language=None)
if lang == "en":
print(f"✅ Skill updated to {new_version}: {skill_dir}")
else:
print(f"✅ Skill 已更新到 {new_version}:{skill_dir}")

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --lang flag is documented as affecting “CLI and generation language”, but in the update path the override is never passed through (language=None). This makes --lang en ineffective for update, and also prevents intentionally switching a skill’s language during an update. Consider passing language=lang_override (or updating the flag/help text if override is intentionally unsupported).

Copilot uses AI. Check for mistakes.
Comment thread tools/skill_writer.py
Comment on lines 374 to 378
args = parser.parse_args()
base_dir = Path(args.base_dir).expanduser()
lang_override = None if args.lang == "auto" else normalize_language(args.lang)
lang = lang_override or "zh"

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With --lang auto, lang is forced to zh, so CLI output language does not auto-detect from existing skill metadata (e.g., updating an English skill will still print Chinese status lines). Consider inferring lang from meta.json when action is update (and possibly list) and args.lang=auto.

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py
Comment on lines 517 to 520
def main():
if not IS_WINDOWS and not IS_MACOS:
print("错误:此工具仅支持 Windows macOS", file=sys.stderr)
print("Error: this tool supports only Windows and macOS", file=sys.stderr)
sys.exit(1)

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error path always prints English, but the script otherwise supports --lang-controlled bilingual output. Consider printing a bilingual message here (or parsing --lang before the platform check) so users on unsupported platforms still get consistent language behavior.

Copilot uses AI. Check for mistakes.
@imAaryash

Copy link
Copy Markdown
Author

@copilot apply changes based on the comments in this thread

Make language normalization and various function signatures use typing.Optional for clearer type hints. Enhance skill_writer to determine update language from meta.json (when lang_override is unset), require --persona-patch for updates, pass the lang_override to update_ex_skill, and show localized success/error messages. Add a pre-parser in wechat_decryptor to set CLI_LANG early and use localized error text for unsupported platforms. Small cleanup: import Optional where needed and adjust other signatures to return Optional types.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SKILL.md
Comment on lines 18 to 26
收到 `/create-ex` 后,按以下流程运行:

```
Step 1 → 基础信息录入 (参考 prompts/intake.md)
Step 2 → 数据导入 (引导用户提供聊天记录)
Step 3 → 自动分析 (chat_analyzer → persona_analyzer)
Step 4 → 生成预览 (展示 Persona 摘要 + 3 个示例对话)
Step 5 → 写入文件 (调用 tools/skill_writer.py)
```

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The top-level flow block still starts at Step 1, but Step 0 (language selection) is now mandatory. Update the flow snippet to include Step 0 (and keep the step numbering/order consistent) so readers don’t miss the required first step.

Copilot uses AI. Check for mistakes.
Comment thread SKILL.md
Comment on lines +34 to +35
语言选择后,保存状态变量 `preferred_language`(`zh` 或 `en`),后续所有用户可见内容都必须严格使用该语言。

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc says all user-visible output must strictly follow preferred_language, but the tool commands later in the workflow default to Chinese unless --lang is passed. Consider explicitly stating that when invoking tools/wechat_decryptor.py, tools/wechat_parser.py, tools/skill_writer.py, and tools/version_manager.py, the orchestrator should forward --lang {preferred_language} (or equivalent) to keep CLI/tool output consistent.

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_parser.py
Comment on lines +570 to +573
f"# {source} {('Chat Extraction Result' if is_en else '聊天记录提取结果')}",
f"{('Target' if is_en else '目标人物')}:{target_name}",
f"{('Messages sent by TA' if is_en else 'TA 发送的消息数')}:{classified['total_their_count']}",
f"{('Total messages' if is_en else '对话总消息数')}:{classified['total_count']}",

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In English mode, the header lines still use the full-width Chinese colon (e.g., Target:...). For cleaner English output (and easier downstream parsing), use the ASCII : when language is en.

Copilot uses AI. Check for mistakes.
Comment thread prompts_en/intake.md
Comment on lines +48 to +54
A) WeChat automatic extraction
- Keep WeChat desktop logged in
- Run tools/wechat_decryptor.py --find-key-only
- Run tools/wechat_parser.py --db-dir ./decrypted/ --target "<wechat_name>" --output messages.txt

B) iMessage automatic extraction (macOS)
- Run tools/wechat_parser.py --imessage --db ~/Library/Messages/chat.db --target "<phone_or_apple_id>" --output messages.txt

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This English intake script suggests running the tooling commands without --lang en. Since the tools default to Chinese output, the command examples here should include --lang en (and ideally mention forwarding the session’s preferred_language) to keep the workflow language-consistent.

Copilot uses AI. Check for mistakes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/wechat_decryptor.py Outdated
Comment on lines 530 to 546
parser = argparse.ArgumentParser(
description="微信 PC/Mac 端数据库解密工具",
description="WeChat desktop database decryptor",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
示例:
# 自动从内存提取密钥并解密所有数据库
python wechat_decryptor.py --db-dir <MSG目录> --output ./decrypted/
Examples:
# Extract key from memory and decrypt all databases
python wechat_decryptor.py --db-dir <MSG_DIR> --output ./decrypted/

# 只打印密钥
# Print key only
python wechat_decryptor.py --find-key-only

# 用已知密钥解密单个文件
# Decrypt one DB with a known key
python wechat_decryptor.py --key "abcdef1234..." --db "./MSG0.db" --output "./out/"

# 验证密钥是否正确
# Validate key against a DB
python wechat_decryptor.py --key "abcdef1234..." --test-db "./MSG0.db"
"""

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--lang is parsed and CLI_LANG/tr() exist, but the argparse description/epilog are always English. This means --lang zh (or default zh) still shows English help/usage text, which undermines the bilingual CLI goal. Consider selecting description/epilog via tr() (similar to tools/wechat_parser.py) after a pre-parse of --lang.

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py Outdated
Comment on lines +548 to +554
parser.add_argument("--db-dir", help="Directory containing WeChat message databases")
parser.add_argument("--db", help="Path to a single database file")
parser.add_argument("--output", default="./decrypted", help="Output directory for decrypted files (default: ./decrypted)")
parser.add_argument("--key", help="Known key in hex format (skip memory extraction)")
parser.add_argument("--find-key-only", action="store_true", help="Print extracted key only; do not decrypt")
parser.add_argument("--test-db", help="Validate key against one DB file (use with --key)")
parser.add_argument("--lang", choices=["zh", "en"], default="zh", help="CLI language")

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argparse option help strings here are hard-coded in English, so --lang zh doesn’t localize the CLI help output. If bilingual help is intended, wrap these help= values with tr(...) (or build the parser after setting CLI_LANG via a pre-parser).

Copilot uses AI. Check for mistakes.
Comment thread tools/wechat_decryptor.py
Comment on lines 2 to 7
"""
微信 PC 端数据库解密工具
WeChat desktop database decryptor (Windows + macOS).

支持:
- Windows:微信 3.x(SQLCipher 加密,从 WeChatWin.dll 内存提取密钥)
- macOS:微信 Mac 版(SQLCipher 加密,从 WeChat 进程内存提取密钥)

解密原理:
微信 PC/Mac 端将聊天数据库用 SQLCipher 加密存储。
加密密钥在微信运行时驻留在进程内存中,可通过特征码扫描提取。
提取后用 SQLCipher 的 PRAGMA key 解密数据库。

用法:
python wechat_decryptor.py --find-key-only
python wechat_decryptor.py --db-dir <MSG目录> --output ./decrypted/
python wechat_decryptor.py --key "abcd1234" --db "./MSG0.db" --output "./decrypted/"

依赖:
pip install pycryptodome psutil
Windows 额外:pip install pymem
macOS 额外:无(使用 lldb)

注意:
- 运行时微信客户端必须处于登录状态(需从内存读取密钥)
- macOS 可能需要关闭 SIP 或授予终端 Full Disk Access 权限
- 解密后的数据库仅用于个人读取,不要分发
Extracts SQLCipher keys from a running WeChat process and decrypts local
message databases for personal export workflows.
"""

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The top-level docstring was reduced to a brief English summary and no longer documents key prerequisites/safety notes (e.g., required dependencies like psutil/pycryptodome/pymem, WeChat login requirement, macOS Full Disk Access/SIP caveats, and personal-use warning). Restoring those details (in zh/en) would make the tool safer and easier to run without reading the source.

Copilot uses AI. Check for mistakes.
Comment thread tools/version_manager.py
Comment on lines 111 to +117
def main():
parser = argparse.ArgumentParser(description="前任 Skill 版本管理器")
parser = argparse.ArgumentParser(description="Ex Skill version manager")
parser.add_argument("--action", required=True, choices=["list", "rollback", "cleanup"])
parser.add_argument("--slug", required=True, help="前任 slug")
parser.add_argument("--version", help="目标版本号(rollback 时使用)")
parser.add_argument("--base-dir", default="./exes", help="前任 Skill 根目录")
parser.add_argument("--slug", required=True, help="Ex skill slug")
parser.add_argument("--version", help="Target version for rollback (e.g. v2)")
parser.add_argument("--base-dir", default="./exes", help="Root ex skill directory")
parser.add_argument("--lang", choices=["zh", "en"], default="zh", help="CLI language")

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--lang is parsed only after the argparse parser is constructed, so --help (and argparse-generated errors) will always be English. If the goal is bilingual CLI output, consider a small pre-parse for --lang (parse_known_args) and then build the main parser with localized description/help strings based on that value (as done in tools/wechat_parser.py).

Copilot uses AI. Check for mistakes.
Comment thread tools/skill_writer.py
Comment on lines 354 to 372
def main() -> None:
parser = argparse.ArgumentParser(description="前任 Skill 文件写入器")
parser = argparse.ArgumentParser(description="Ex Skill file writer")
parser.add_argument("--action", required=True, choices=["create", "update", "list"])
parser.add_argument("--slug", help="前任 slug(用于目录名)")
parser.add_argument("--name", help="前任称呼")
parser.add_argument("--meta", help="meta.json 文件路径")
parser.add_argument("--persona", help="persona.md 内容文件路径")
parser.add_argument("--persona-patch", help="persona.md 增量更新内容文件路径")
parser.add_argument("--slug", help="Ex skill slug (folder name)")
parser.add_argument("--name", help="Display name for the ex skill")
parser.add_argument("--meta", help="Path to meta.json")
parser.add_argument("--persona", help="Path to persona.md content file")
parser.add_argument("--persona-patch", help="Path to incremental persona patch file")
parser.add_argument(
"--base-dir",
default="./exes",
help="前任 Skill 根目录(默认:./exes)",
help="Ex Skill root directory (default: ./exes)",
)
parser.add_argument(
"--lang",
choices=["auto", "zh", "en"],
default="auto",
help="CLI and generation language (auto, zh, or en)",
)

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--lang affects runtime output, but argparse help/usage text is always English because the parser is built before language selection. If bilingual CLI output is a requirement, add a pre-parse for --lang and localize description and help= strings accordingly (similar to tools/wechat_parser.py).

Copilot uses AI. Check for mistakes.
Comment thread SKILL.md
Comment on lines 89 to 93
## Step 2:数据导入

引导用户选择导入方式:
引导用户选择导入方式(按 `preferred_language` 输出)

```

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step now requires all guidance to follow preferred_language, but the example commands below don’t pass --lang {preferred_language} (English sessions will otherwise default to zh output). Also, the WeChat flow shows wechat_decryptor.py --find-key-only and then immediately parses ./decrypted/, but --find-key-only exits without decrypting; the instructions should include an actual decrypt invocation (e.g., --db-dir ... --output ... or using --key to decrypt) before running wechat_parser.py --db-dir ....

Copilot uses AI. Check for mistakes.
Introduce multilingual CLI support and update docs to use {preferred_language}. SKILL.md and SKILL_EN.md: add --lang/{preferred_language} to wechat_decryptor/parser and skill/version commands, and document a manual-key fallback flow for decryption. tools/wechat_decryptor.py: add bilingual header (EN/ZH) with prerequisites/safety notes, localized epilog examples, and localized argument help strings; add --lang argument handling and switch epilog/help text based on language.
@imAaryash

Copy link
Copy Markdown
Author

Hii @titanwings can you review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants