name: china-policy-analyze
description: Use this skill when the user asks about Chinese economic policy, central policy documents, Five-Year Plans, Xi Jinping's economic speeches, policy language interpretation, local policy implementation, regulatory signals, economic cases, or opportunity analysis based on official Chinese sources.
⚠️ HARD RULES — READ FIRST, VIOLATION = WRONG ANSWER
规则0:时效性第一 — 永远用最新的
每次回答前,你必须:
- 确认当前时间(调用系统命令
date 或使用你的内置时间感知)
- 基于当前时间判断哪些政策文件在生效、哪些已过时
核心时效性规则:
- 当前是十五五规划期(2026-2030),不是十四五。引用五年规划时默认指十五五,除非用户明确提到十四五或历史对比
- 新一定大于旧 — 同一主题有多个文件时,优先引用最新的;被新文件取代的旧文件不再作为当前政策依据
- 引用任何文件前,先确认该文件是否仍然有效,是否已被后续文件修订或废止
- 模型训练数据可能停留在十四五时期,但现在是十五五,不要被训练数据带偏
- 当用户问"最新""当前"时,必须实时获取,不要依赖训练数据中的旧信息
错误示例: 用户问"现在的五年规划重点是什么?" → 回答十四五规划内容 ❌
正确示例: 用户问"现在的五年规划重点是什么?" → 回答十五五规划纲要(2026年3月13日批准)✅
规则1:官网永远优先,微信搜索只能在最后补充
WebFetch → 评估 → 不足时才搜微信。此顺序不可打破,无任何例外。
- ✅ 先完成所有 WebFetch 尝试(即使站点已知困难也必须试)
- ✅ 全部 WebFetch 结束后,评估是否已获取到足够关键信息
- ✅ 仅当信息不足时,才调用微信搜索做补充
- ❌ 绝不能因某次 WebFetch 失败就中途去搜微信
- ❌ 绝不能跳过任何官网直接搜微信(即使该站已知不可达)
- ❌ 绝不能在 WebFetch 已拿够内容时还搜微信
搜到微信内容后的验真规则:
微信文章常会提及原始政策来源(发文号、发文机关、官网链接等)。搜到内容后:
- 提取来源线索 — 从微信文章中找出它引用的官方文件号、发文机关、原文链接等
- 回查官网验证 — 根据这些线索,WebFetch 去官网查找原文进行验证
- 验对了:引用官网 — 以官网原文为准,引用官网来源和链接
- 没验对:必须标注 — 如果官网查不到或无法验证,在输出中必须明确标注:
⚠️ 此信息来自微信公众号,非官网原文,不代表一定权威,请自行辨别
规则2:CLI 路径取决于操作系统
.venv 在项目根目录(即 .config/opencode/skills/china-policy-analyze/),不在 skill/ 子目录下。
| OS | Command |
|---|
| Windows | C:\\Users\\<用户名>\\.config\\opencode\\skills\\china-policy-analyze\\.venv\\Scripts\\cpi.exe wechat-search "关键词" --fetch --json |
| Linux / macOS | cd ~/.config/opencode/skills/china-policy-analyze && source .venv/bin/activate && cpi wechat-search "关键词" --fetch --json |
⚠️ Windows 路径注意:是 china-policy-analyze\\.venv\\Scripts\\cpi.exe,不是 china-policy-analyze\\skill\\.venv\\Scripts\\cpi.exe
Purpose
This skill helps the agent answer questions and produce analysis based on Chinese official policy documents, speeches, economic meetings, laws, regulations, judicial cases, enforcement notices, and official economic data.
It is designed for:
- policy Q&A;
- policy language interpretation;
- Chinese economic policy reasoning;
- local implementation comparison;
- regulatory and judicial signal analysis;
- opportunity analysis for study, career, research, entrepreneurship, and project planning.
Real-Time Data Acquisition
This skill supports both local corpus lookup AND live web fetching from official sources.
When to fetch live data
- If the user asks about "latest" or "recent" policies, always fetch live
- If the user's question involves policies or events more recent than the corpus, fetch live
- If local data covers the question adequately, no need to fetch — but always tell the user whether the answer is from local corpus or live-fetched
How to fetch live data — WebFetch method (works on ANY agent)
Use your agent's built-in WebFetch tool. You do NOT need Python or any project-specific tools. Just fetch the URLs below and read the content directly.
Step 1: Find latest policy titles and dates
Fetch these listing pages to discover what's new:
Confirmed working — both listing and sub-pages (tested 2026-04-28 with Python HTMLFetcher):
# 国务院
https://www.gov.cn/zhengce/ ← 最新政策列表
https://www.gov.cn/zhengce/YYYYMM/content_XXXXXXX.htm ← 具体文件(注意:/zhengce/YYYYMM/ 不是 /zhengce/content/YYYYMM/)
# 发改委
https://www.ndrc.gov.cn/xwdt/xwfb/ ← 新闻发布列表
子页面示例: /xwdt/202604/t20260427_1389482.html ✅ 实测md=483
# 商务部
https://www.mofcom.gov.cn/xwfb/ ← 新闻发布列表
子页面示例: /xwfb/... ✅ 实测md=1761
# 工信部
https://www.miit.gov.cn/ ← 首页(新闻链接在首页)
子页面示例: /xwdt/gxdt/sjdt/art/2026/art_xxx.html ✅ 实测md=1932
# 司法部
https://www.moj.gov.cn/ ← 首页(政策链接在首页)
子页面: /pub/sfbgw/zwgkzt/... ✅ 实测md=8372
# 最高人民法院
https://www.court.gov.cn/ ← 首页
子页面: /zixun/.../content_XXXXXXX.html ✅ 实测md=1923
# 最高人民检察院
https://www.spp.gov.cn/ ← 首页
子页面: /spp/xwfb/.../index.shtml ✅ 实测md=14641
# 市场监管总局
https://www.samr.gov.cn/ ← 首页
子页面: /xw/zj/art/2026/art_xxx.html ✅ 实测md=684
# 生态环境部
https://www.mee.gov.cn/ ← 首页
子页面: /ywdt/hjzx/.../t20260427_XXXXXX.shtml ✅ 实测md=10845
# 外交部
https://www.mfa.gov.cn/wjbxw/ ← 外交部发言人表态
子页面: /web/wjbxw_673016/.../tXXXXXXX.shtml ✅ 实测md=15113
# 国新办(所有部委新闻发布会的统一平台)
https://www.scio.gov.cn/ ← 国新办新闻发布会、白皮书
# 统计局
https://www.stats.gov.cn/sj/zxfb/ ← 统计发布
子页面: /sj/zxfb/202604/t20260427_XXXXXXX.html ✅ 实测md=12645
# 金融监管总局
https://www.nfra.gov.cn/ ← 首页
⚠️ /xwzx/子路径返回404,需从首页提取文章链接
# 证监会
https://www.csrc.gov.cn/csrc/c100032/common_list.shtml ← 发布列表
子页面: /csrc/c106311/cXXXXXXX/content.shtml ✅ 实测md=975
# 人民银行(央行)
https://www.pbc.gov.cn/ ← 首页(栏目链接在首页)
⚠️ 短路径如 /goutongjiaoliu/ → 403! 必须用完整栏目路径:
新闻发布: /goutongjiaoliu/113456/113469/index.html ✅ 实测md=2538
具体新闻: /goutongjiaoliu/113456/113469/20260425XXXX/index.html ✅ 实测md=1861
货币政策: /rmyh/105145/index.html ✅ 实测md=2210
公告信息: /rmyh/105208/index.html ✅ 实测md=4044
法律法规: /tiaofasi/144941/index.html ✅ 实测md=5034
# 习近平重要讲话
http://jhsjk.people.cn/ ← 重要讲话数据库 ✅ 首页+子页面
Important URL patterns:
- Some ministry listing pages use JS rendering — their HTML may not contain article links. In that case, fetch the ministry homepage (not the listing sub-path), which usually has the latest news links embedded in the HTML.
- pbc.gov.cn: Short paths like
/goutongjiaoliu/ return 403 from CDN. But full column URLs (e.g., /goutongjiaoliu/113456/113469/index.html) work perfectly — fetch the homepage first to discover the correct paths.
These listing pages reliably return HTML with titles and dates. Read them to find relevant document titles.
Step 2: Fetch specific document content
The correct URL pattern for gov.cn policy documents is:
https://www.gov.cn/zhengce/YYYYMM/content_XXXXXXX.htm
NOT /zhengce/content/YYYYMM/ (that pattern returns 404).
To find the exact content URL, fetch the listing page at https://www.gov.cn/zhengce/ and look for links containing /content_ in the HTML. The href will be something like /zhengce/202604/content_7066998.htm — prefix with https://www.gov.cn.
If you get a 404 on a gov.cn URL:
- The URL path might be wrong. Try changing
/zhengce/content/YYYYMM/ to /zhengce/YYYYMM/
- Try searching on news.cn:
https://www.news.cn/politics/ — Xinhua often republishes the same content
- Try the gov.cn search:
https://sousuo.gov.cn/s.htm?t=govall&q=关键词 (may not work with WebFetch)
Confirmed working examples:
https://www.gov.cn/zhengce/202604/content_7066998.htm ← 中办国办:新就业群体(2026-04-26)
https://www.gov.cn/zhengce/202604/content_7066483.htm ← 国发〔2026〕7号 服务业扩能提质(2026-04-21)
https://www.gov.cn/zhengce/content/202604/content_7066483.htm ← 同一文件,也可访问(部分URL两种路径都可用)
Step 3: For Xi Jinping speeches and important meetings
http://jhsjk.people.cn/ ← 重要讲话数据库 (reliable, returns HTML with dates)
https://www.news.cn/politics/ ← 新华网时政 (reliable, full article content)
What does NOT work via WebFetch
These sites cannot be accessed from data center IPs:
| Site | Error |
|---|
www.customs.gov.cn (海关总署) | 412 (CDN JS challenge) |
www.mps.gov.cn (公安部) | 521 (cloud JS challenge) |
www.most.gov.cn (科技部) | JS-rendered empty shell (157 chars) |
www.mohrss.gov.cn (人社部) | JS-rendered empty shell (989 chars) |
You still MUST attempt WebFetch on these sites — the site status may change. Only after ALL WebFetch attempts are exhausted should you consider WeChat search (see WeChat section below).
pbc.gov.cn (央行) works! Previously marked as blocked because short paths like /goutongjiaoliu/ return 403 from CDN. But full column URLs (e.g., /goutongjiaoliu/113456/113469/index.html) work perfectly — fetch the homepage first to discover the correct paths.
Data freshness rules
- Local corpus data is always the baseline — use it first
- If local data covers the question adequately, no need to fetch live
- Always tell the user whether your answer is based on local corpus or live-fetched data
- Respect rate limits: never fetch more than 10 pages in one session
- If a fetched page has too little content (< 200 chars), it's likely a listing page — find and follow the actual content links
How to fetch live data — Python method (only if Python environment is available)
Note: Python HTMLFetcher uses browser-like headers and CAN access more sites than bare WebFetch:
- PBC:
www.pbc.gov.cn — works with full column paths (NOT short paths like /goutongjiaoliu/)
- Judicial/Legal:
www.moj.gov.cn, www.court.gov.cn, www.spp.gov.cn — all work with Python
- Market regulation:
www.samr.gov.cn — works with Python
- Still blocked:
www.customs.gov.cn (412), www.mps.gov.cn (521)
- JS-rendered empty shells:
www.most.gov.cn, www.mohrss.gov.cn
Python's main advantage: browser-like headers + automated batch fetching + HTML-to-markdown conversion.
WeChat Public Account (微信公众号) Article Search — 补充渠道
微信搜索是补充渠道,不是替代渠道。官网永远优先。
调用顺序(强制,无例外):
- 先完成所有 WebFetch 尝试 — 包括已知困难的站点也必须试,不要跳过
- 全部 WebFetch 结束后评估 — 是否已获取到足够关键信息/得出关键结论
- 仅当信息不足时,才搜微信做补充
绝对不能:
- ❌ 因为某次 WebFetch 失败就中途打断去搜微信
- ❌ 跳过某个官网直接搜微信(即使该站已知不可达)
- ❌ WebFetch 已经拿到足够内容还去搜微信
(此规则已在文档顶部 HARD RULES 处定义,此处不再重复)
当确认信息不足、需要搜微信时:
CLI method (quickest — use this first)
cd ~/.config/opencode/skills/china-policy-analyze && source .venv/bin/activate && cpi wechat-search "关键词" --fetch --json
cd ~/.config/opencode/skills/china-policy-analyze && source .venv/bin/activate && cpi wechat-search "利率政策" -a "中国人民银行" --fetch --json
cd ~/.config/opencode/skills/china-policy-analyze && source .venv/bin/activate && cpi wechat-search "降准" -c economy_finance --fetch --json
C:\\Users\\<用户名>\\.config\\opencode\\skills\\china-policy-analyze\\.venv\\Scripts\\cpi.exe wechat-search "关键词" --fetch --json
C:\\Users\\<用户名>\\.config\\opencode/skills/china-policy-analyze/.venv/Scripts/cpi.exe wechat-search "利率政策" -a "中国人民银行" --fetch --json
C:\\Users\\<用户名>\\.config\\opencode/skills/china-policy-analyze/.venv/Scripts/cpi.exe wechat-search "降准" -c economy_finance --fetch --json
Python method (if you need programmatic access)
from china_policy_skill.fetch.fetch_wechat import WeChatSearcher
ws = WeChatSearcher()
articles = ws.search_and_fetch("关键词", max_results=3)
articles = ws.search_by_account_and_fetch("中国人民银行", keyword="货币政策")
articles = ws.search_by_category_and_fetch("economy_finance", keyword="降准")
Account directory(按公众号搜索,更快更准)
40 verified high-quality policy WeChat accounts stored in config/wechat_accounts.yaml:
| Category | Key accounts | Authority |
|---|
| central_policy | 中国政府网, 国务院公报, 新华视点, 人民日报, 求是网, 经济日报 | S/A |
| economy_finance | 国家发改委, 财政部, 中国人民银行, 金融时报 | A |
| industry_regulation | 工信微报, 科技部, 市场监管总局, 证监会发布, 金融监管总局 | A |
| trade_foreign | 商务部, 外交小灵通, 中国海关发布 | A |
| people_livelihood | 生态环境部, 交通运输部, 农业农村部, 住建部, 人社部, 教育部, 国家卫健委 | A |
| law_justice | 司法部, 最高人民法院, 最高人民检察院, 中国普法 | A |
| professional | 北大法律信息网, 威科先行, 中伦视界, 中国法律评论, 中国改革报 | B |
from china_policy_skill.fetch.fetch_wechat import WeChatSearcher
ws = WeChatSearcher()
articles = ws.search_by_account("中国人民银行", keyword="利率", max_results=3)
articles = ws.search_by_account_and_fetch("中国人民银行", keyword="货币政策")
articles = ws.search_by_category("economy_finance", keyword="降准")
articles = ws.search_by_category_and_fetch("law_justice", keyword="司法解释")
acc = ws.get_account("中国政府网")
accounts = ws.find_accounts_by_topic("货币政策")
for category, accounts in ws.account_directory.items():
for acc in accounts:
print(f" {acc.name} ({acc.authority}): {acc.desc}")
How it works:
- Searches
weixin.sogou.com (搜狗微信搜索) — works reliably, returns titles + abstracts
- Follows Sogou's redirect links → extracts the real
mp.weixin.qq.com article URL from obfuscated JS
- Fetches the full article directly from
mp.weixin.qq.com — returns complete policy text
Limitations:
- Sogou search rate limit: ~10 queries per session before needing a pause
- Article URLs contain timestamps and signatures — they may expire after ~24 hours
- Some WeChat articles may have been deleted by the publisher
- Always cite the original official source when using WeChat content
If the full project is installed with Python:
cd ~/.config/opencode/skills/china-policy-analyze && source .venv/bin/activate && CPI_MAX_DOCS=5 python scripts/_run_daily_update.py
C:\\Users\\<用户名>\\.config\\opencode\\skills\\china-policy-analyze\\.venv\\Scripts\\python.exe scripts\\_run_daily_update.py
Or fetch a specific URL:
from china_policy_skill.fetch.fetch_html import HTMLFetcher
from china_policy_skill.parse.html_to_md import HTMLToMarkdown
fetcher = HTMLFetcher(timeout=15, rate_limit_delay=1.0)
result = fetcher.fetch('https://www.gov.cn/zhengce/202604/content_XXXXXXX.htm')
parser = HTMLToMarkdown()
markdown = parser.convert(result.html or '', result.url)
Source URLs are listed in config/sources.yaml.
Core Rules
- Prefer official sources over commentary.
- Always distinguish:
- original wording;
- structured interpretation;
- reasonable inference;
- personal advice;
- uncertainty.
- Never claim certainty about future economic outcomes.
- Never equate policy support with guaranteed business success.
- Never provide illegal or evasive advice.
- For every important claim, cite or identify the source document, institution, date, and relevant passage.
- MANDATORY: Every document reference in all output MUST include its issue date. Format: 《标题》(发文号, YYYY年M月D日). If no doc_number: 《标题》(YYYY年M月D日). If date unknown: write 日期不详. Never omit the date.
- When sources conflict, prefer newer, higher-level, more formal documents.
- For local policy analysis, compare actual implementation tools, not slogans only.
- For policy language, interpret wording strength based on document hierarchy, context, responsible units, deadlines, funding, projects, pilots, and enforcement signals.
Output Boundary
Do not:
- impersonate any leader, institution, ministry, court, procuratorate, or police authority;
- fabricate official positions;
- provide guaranteed investment or business outcomes;
- advise on illegal conduct, evasion, fraud, fake applications, regulatory arbitrage, or enforcement avoidance;
- treat unofficial commentary as official policy.
Quality Checklist
Before answering:
- Did I use official sources first?
- Did I separate original wording from interpretation?
- Did I explain policy phrases in plain language?
- Did I explain uncertainty?
- Did I avoid overclaiming?
- Did I check recency?
- Did I include the issue date on EVERY document reference? (MANDATORY)
- Did I include local implementation evidence if discussing local opportunities?
- Did I include legal/regulatory evidence if discussing risk?
Now we need to append the URL test results section at the end of the file. Let's add it.
We'll construct the new content as the existing content + new section.
Thus new_section = "\n\n## URL Test Results (2026-06-25)\n\n- 国家统计局: ok\n- 中国物流与采购联合会: ok\n- 人民银行: ok\n- 财政部: ok\n- 工信部: ok\n- 科技部: ok\n- 国家民族事务委员会: ok\n- 商务部: ok\n- 金融监管总局: ok\n- 证监会: ok\n- 外汇局: ok\n- 市场监管总局: ok\n- 海关总署: 000(连接失败)\n- 税务总局: ok\n- 人社部: ok\n"
Thus new_content = existing_content + new_section.
We need to combine them.
We will do a Python string concatenation.
We'll use execute_code to perform this operation and write back.
Let's do that.
<tool_call>
<function=execute_code>
<parameter=code>
import sys, json, os, pathlib, textwrap, re, subprocess, shlex, sys
Read existing SKILL.md
with open('./skill/SKILL.md', 'r', encoding='utf-8') as f:
existing_content = f.read()
Define new section
new_section = "\n\n## URL Test Results (2026-06-25)\n\n- 国家统计局: ok\n- 中国物流与采购联合会: ok\n- 人民银行: ok\n- 财政部: ok\n- 工信部: ok\n- 科技部: ok\n- 国家民族事务委员会: ok\n- 商务部: ok\n- 金融监管总局: ok\n- 证监会: ok\n- 外汇局: ok\n- 市场监管总局: ok\n- 海关总署: 000(连接失败)\n- 税务总局: ok\n- 人社部: ok\n"
Append new section
new_content = existing_content + new_section
Write back
with open('./skill/SKILL.md', 'w', encoding='utf-8') as f:
f.write(new_content)
print("SKILL.md updated successfully")