clip family'sOfficial Account member: deposit Official Account articles into the vault.
Customer-readable description
What this skill can do
Archive a single WeChat Official Account article to an Obsidian vault: fetch the static HTML, extract the title, author, body, publish time, and images, and store it according to the clip family conventions; when a PDF is needed, prefer exporting via Obsidian
| What the customer wants | What the skill will do | What the customer can see |
|---|---|---|
| Complete the work covered by this skill | Read the user request, necessary context, and this skill's main workflow, and execute the minimal reliable steps | The customer will see Obsidian/vault file changes, terminal logs, generated artifact paths, and the final receipt. |
| Missing dependencies, permissions, configuration, or key | Stop actions that require external state and clearly state what is missing | Install commands, application addresses, configuration paths, or questions that need customer confirmation |
| Execution complete | Summarize successes, skips, failures, file changes, and verification results | A completion receipt that can be copied into a ticket/log |
How the customer uses it
- Describe the goal in natural language and provide the necessary inputs: files, URL, repo, workspace, proposal, vault, or platform account status.
- The Agent first determines whether this skill applies, then checks dependencies, configuration, permissions, and risky actions.
- For actions that can be dry-run or previewed, provide a preview first; for actions involving deletion, overwriting, sending, publishing, or writing remote state, ask the customer for confirmation first.
- After execution, verify the real output; do not substitute "looks successful" for evidence.
- The final reply must give the customer a visible summary: what was done, log summary, file changes, issues, and next steps.
Dependencies and installation
Install this skill (single skill):
npx skills add soia-team/soia-open-skills -g -a '*' -s soia-pkm-clip-wechat -y
The current script's configuration entry point:
OBSIDIAN_VAULT=<vault-path>
OBSIDIAN_ARTICLES=<vault-relative-articles-dir>
- CLI
--vault/--articles-dirtakes precedence over environment variables; if neither is provided, only search upward from the current directory for a real.obsidian/flag. - The current stdlib script does not parse YAML
config.yml, and does not need an API key, cookie, or other credentials; do not create a configuration file that will not take effect. - Strong dependencies, optional dependencies, and third-party skill relationships must be based on this
SKILL.md's subsequent "dependencies / prerequisites / resources / boundaries" description; if it is not clearly written, first supplement the description or ask the customer, and do not guess. - Third-party skills may only declare dependencies and installation methods; do not directly modify third-party skill files.
Logs and completion receipt
Every execution must let the customer see the process and results. Minimum receipt format:
完成:<一句话说明本次完成了什么>。
日志摘要:
- started: <检查到的输入/配置/依赖,不打印秘密值>
- processed: <数量或范围>
- created/updated: <数量或路径>
- skipped/failed: <数量和原因>
文件变化:
- <绝对路径或“未改动文件”>
验证:
- <运行过的检查、命令或人工核对点>
问题与下一步:
- <缺 key / 缺依赖 / 需要客户确认 / 建议下一条命令;没有则写“无”>
Fetch
- Input:
https://mp.weixin.qq.com/s/... - The WeChat Official Account article isstatic HTML(easier to fetch than X, no API needed): stdlib
urllib.requestfetch the page → parse#js_content(body),#activity-name/og:title(title), author meta (credited author),#js_name(Official Account name),createTime/oriCreateTime(Publish time fallback). - Images: extract
data-srcand keep as remote links; the current script does not download images, offline conversion is handled by a later process. - Script:
scripts/archive_wechat.py <url> --vault <path>(pure Python standard library; supports--dry-run、--json, URL deduplication, body quality gate, and atomic write).
python3 scripts/archive_wechat.py <url> \
--vault <vault-path> \
--articles-dir <vault-relative-articles-dir> \
--dry-run --json
First do a dry-run to verify the title, author, publish time,body_chars, image count, and content_complete, then remove --dry-run and write. If #js_contentcannot be found, the body is abnormally short, or interception page keywords are hit, writing is refused by default; only use --allow-incomplete。
when the client explicitly accepts an incomplete archive. Landing (unified spec for the clip family)
- Path:
<vault-articles-dir>/<年>/<月>/YYYY-MM-DD-公众号-<作者>-<标题>.md - frontmatter:
tags:[文章摘抄]、source: 公众号、url、author、publisher、published_at、captured_at、topics:[]、content_complete - Body paragraphs:
## 摘要(AI fills in),## 原文、## 我的看法(leave blank),## 关联 - After archiving, AI fills in the summary + topics; the script has already filed it by publish month.
Verification
python3 -m unittest discover -s tests -p 'test_*.py'
python3 -m py_compile scripts/archive_wechat.py
When the repository maintainer runs from the repo root, replace the paths with skills/soia-pkm-clip-wechat/tests and skills/soia-pkm-clip-wechat/scripts/archive_wechat.py. These two checks specifically prevent SKILL from again declaring a script that is not delivered with the installation package.
Export PDF after archiving
When the user also requests "convert to PDF / export PDF", first complete the Markdown archiving, summary, topics, and month filing, then read and execute references/obsidian-pdf-export.md. As long as the target file is inside the Obsidian vault, prefer calling Obsidian's built-in "Export PDF"; external PDF engines can only be used as an explicit fallback.
Closed-loop position
★clip-wechat(收) → organize → distill → compose → publish. Shares the landing spec with clip-x/web/drive; only the source differs.
Receipt after completion
Delivery order: first write the file to disk, then output the receipt below; do not reverse the order; explicitly mark uncertain metadata (such as author or publish time parsing failure) as "unverified" in the receipt; do not fabricate.
After executingyou mustoutput to the user (do not silently finish):
- What was done — summarize the completed work in one sentence.
- File changes — list newly created / modified / moved files (full paths); if no files were changed, state "no files changed".
- Next steps — optional follow-up suggestions (such as the next skill to connect to).