This skill is positioned as a "WeChat local digital asset vault + local query and analysis console". By default, it only reads the local database and local processes, and does not click the WeChat interface; unless the user explicitly permits it, it does not operate the WeChat UI. By default, it only processes the official first WeChat container com.tencent.xinWeChat, and does not process dual-instance/second WeChat containers.
This version incorporates the advantages of two types of external tools:
- WeChat CLI style: unified command entry, JSON default output, recent sessions, history, global search, contact details, group members, statistics, export, Favorites, unread and incremental new messages.
- Baoyu group chat summary workflow: archive by group, continue from the last summary, summary material package, group member profile directory, history index, image description extension points, and the safety habit of "for large batches, save to files first, then analyze".
Privacy boundaries
- Do not output keys, complete salts, wxids, or raw chat database content in replies or logs, unless the user explicitly requests display.
- Keys, configuration, plaintext databases, manifests, incremental state, and export directories are all managed by the local configuration file; skill documentation must not contain real absolute paths, wxids, contacts, or chat content from any personal machine.
- It is recommended to place keys and plaintext databases in the local private application data directory, and place readable reports in a user-selected export directory; paths can be described with placeholders or configuration fields.
- Do not copy plaintext databases to the project workspace, desktop, cloud drive directories, or chat replies; the workspace should only contain export reports explicitly requested by the user.
Automatic mode selection
Choose the minimum necessary action based on the user's instruction:
- If the user says "first time using, cannot decrypt, key is gone, decrypt everything, full rebuild": take the full route.
- If the user says "continue, update it, incremental, recent, today, new messages": take the incremental route.
- If the user names a contact/group chat/session ID: export only that one session; if necessary, first incrementally decrypt the message database.
- If the user gives a time range: export or analyze only within that time range.
- If the user asks about Moments/Favorites: only read the corresponding decrypted database; if the key is missing, capture it again.
- When the user explicitly says "group chat summary, group chat highlights, daily report, review, continue from last time", prioritize using
vault_cli.py digest-sourceto generate the material package, then write the brief based on the materials; do not explain the entire skill as a summary tool. - When the user requests not to operate the WeChat interface, only use
--match-only, saved keys, decrypted databases, or local database files; do not start Computer Use.
Unified query entry
For daily queries, prioritize using scripts/vault_cli.py. It only reads the decrypted vault, does not capture keys, and does not touch the WeChat UI.
python3 {{SKILL_DIR}}/scripts/vault_cli.py status --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py sessions --limit 20 --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py unread --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py new-messages --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py contacts --query "关键词" --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py members "群名" --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py history "联系人或群名" --start-time "2026-05-01" --end-time "2026-05-14" --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py search "关键词" --chat "群名" --type link --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py stats "群名" --start-time "2026-05-01" --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py export "群名" --format markdown --output ./chat.md
python3 {{SKILL_DIR}}/scripts/vault_cli.py favorites --type article --query "关键词" --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py moments --name "联系人" --start "2026-05-01" --format text
Message type filtering supports:text、image、voice、video、sticker、location、link、file、call、system。
Group chat summary material package
When the user wants "group chat highlights, daily report, summarize the group chat, see what this group has been chatting about recently, continue from last time":
python3 {{SKILL_DIR}}/scripts/vault_cli.py digest-source "群名" --start "2026-05-01" --end "2026-05-14" --format text
python3 {{SKILL_DIR}}/scripts/vault_cli.py digest-source "群名" --since-last --data-root ~/Documents/wechat-digests --format text
The output will be saved to {data_root}/{group_id}-{group_name}/sources/, and create:
profiles/: Standard group member profile.profiles-roast/: Sharp-tongued version of the profile, must be kept separate from the standard version.imgs/: Image description extension point, format is{message_id}.txt, one line describes one image.sources/*.json: Machine-readable message material, speech statistics, and path information.sources/*.md: Material draft for easy human reading and writing.
The material pack does not automatically update history.json. Only after the final summary is written and confirmed is the summary history updated, to avoid a half-finished product polluting the "continue from last time" anchor.
Common commands
View which databases exist on this machine, without launching WeChat:
python3 {{SKILL_DIR}}/scripts/extract_keys.py --list-dbs
Match keys using an existing capture log, without launching WeChat:
python3 {{SKILL_DIR}}/scripts/extract_keys.py --match-only --targets all --reuse-log
First-time full key capture. Use only when you need to capture new keys; do not touch the second WeChat:
python3 {{SKILL_DIR}}/scripts/extract_keys.py --targets all --duration 240
Full decryption to the private vault:
python3 {{SKILL_DIR}}/scripts/decrypt_all_dbs.py --mode full
Daily incremental refresh. Only skips unchanged databases, does not reprocess all content:
python3 {{SKILL_DIR}}/scripts/decrypt_all_dbs.py --mode incremental
Export the complete chat for a contact:
python3 {{SKILL_DIR}}/scripts/export_chat.py --contact "联系人备注" --mode full
Export new chats for a contact:
python3 {{SKILL_DIR}}/scripts/export_chat.py --contact "联系人备注" --mode incremental
Export by exact conversation ID and time range:
python3 {{SKILL_DIR}}/scripts/export_chat.py --chat-id "contact_username" --since "2025-01-01"
Old scripts can still be used for narrow tasks; if the user has not specified otherwise, prefer vault_cli.py。
Workflow
Full route
Used for initial setup, switching devices, key changes after a WeChat upgrade, and when the user explicitly requests a full rebuild.
- First run
extract_keys.py --list-dbsto see local databases, without showing sensitive salt. - If
~/.config/wechat-keys.jsonalready has a key, first try to reuse it with--match-only --targets all --reuse-log. - Only run key capture when reuse fails or key databases are missing.
- Run
decrypt_all_dbs.py --mode full, and plaintext databases are written to the private vault. - Read the manifest to confirm the number of decrypted items and failed items.
Incremental route
Used for daily updates, continuing previous work, and analyzing only recent new content.
- Run
decrypt_all_dbs.py --mode incremental。 - If the target is a contact/group chat, run
export_chat.py --mode incremental。 - If there are no new messages, directly tell the user there is no new content.
- Incremental state is written only to the vault's
statedirectory, not into the skill document.
Specified conversation analysis
Used for "analyze my chat with so-and-so", "export this conversation ID", and "help me write the next reply".
- If the user provides a remark/nickname, use
export_chat.py --contact。 - If the user provides a WeChat userName or conversation ID, use
export_chat.py --chat-id。 - After export, read the report and analyze the relationship, tone, risks, and next-step wording according to the user's goal.
- Do not display all original text by default; only give the complete timeline or report path when the user asks to "parse carefully".
Moments/Favorites parsing
Prefer using the already decrypted sns/sns.db、favorite/favorite.db、message_resource.db. When keys are missing, only supplement the relevant databases, and do not perform a full capture. Output to the user-configured export directory.
Group chat highlights/daily report route
- First run incremental decryption to ensure the plaintext vault is up to date.
- Use
vault_cli.py contactsorsessionsto resolve the group name and confirm the unique group chat. - Use
digest-sourceto generate a material pack by time range; for large groups or long time ranges, write to a file first, and do not stuff hundreds or thousands of raw messages directly into the conversation. - Read
sources/*.mdand the necessarysources/*.json, first outline the topic skeleton, then write the main text. - The output structure should preferably use: title, message statistics, speaker ranking, opening overview, group member profiles, categorized body, unresolved issues, fixed ending.
- When a sharp-tongued version is needed, it may be written separately based on the same material, but it must not make personal attacks, infer health/family/identity attributes, or use timestamps to infer sleep schedules or location.
- Image content is invisible by default; only if
imgs/{message_id}.txtexists may the description in it be used for the summary. Otherwise, you may only write "the image content is invisible; based on the context, it is inferred that a picture is being discussed here" and must not fabricate the visuals. - After the summary is confirmed, then update the
history.jsonandhistory-digests.jsonlunder the group directory; the user's request to "continue from last time" depends on these files.
Output principles
- In replies, prioritize conclusions, file paths, and next-step suggestions; put the complete original text in a Markdown file.
- When private chats are involved, a small amount of necessary original text may be quoted; avoid pasting the entire database content into the chat.
- Clearly distinguish between the "decrypted plaintext database," "readable export reports," and "key configuration."
- Whenever decryption is completed, explain the save location and whether it contains plaintext privacy.
Existing scripts
scripts/vault_cli.py: unified local query entry point; absorbs the common command forms of WeChat CLI and adds Moments and summary material packages.scripts/extract_keys.py: local key capture, reuse, and matching.scripts/decrypt_all_dbs.py: full/incremental decryption, written to a private vault, and generates a manifest.scripts/export_chat.py: export complete/incremental chat records by contact, group chat, or conversation ID.scripts/list_contacts.py: list contacts and group chats.scripts/wechat_digest.py: daily summary script, used only when the user explicitly requests a summary.scripts/search_sns.py: Moments search assistant.