CNKI Watch
Use this skill when the user wants CNKI results in either of these modes:
- - manual journal query: return papers from a named journal,
- manual topic query: return CNKI papers related to a research topic,
- journal subscription: periodically push new papers from a named journal,
- topic subscription: periodically push new papers for a research topic.
When to use
- - The user gives a journal name and wants a one-off CNKI query.
- The user gives a research topic and wants titles plus source metadata.
- The user wants a recurring CNKI watch delivered back into OpenClaw.
Preconditions
- - The skill ships as a normal npm project with a root
package.json and declared dependencies. - Preferred runtime is still the OpenClaw gateway container, but local development runs are supported on Windows/macOS/Linux with Node.js 22+.
- On local runs, the script auto-installs missing JavaScript dependencies from
package.json on first use. Browser discovery supports Playwright-managed Chromium plus common Chrome/Edge installs. No custom NODE_PATH is required. - Prefer
CNKI_COOKIE. CNKI_USERNAME plus CNKI_PASSWORD is a fallback path for establishing a CNKI login session. - If CNKI shows captcha, slider verification, or another human-check page, stop and ask for a fresh
CNKI_COOKIE or a manually refreshed session. Do not invent alternative scraping logic in the model. - Treat OpenClaw runtime behavior as authoritative. The docs define the public contract; do not optimize for
quick_validate.py quirks at the expense of runtime compatibility.
Reference files:
- - INLINECODE8
- INLINECODE9
- INLINECODE10
Canonical entrypoint
Always use the bundled script instead of ad hoc CNKI browsing:
CODEBLOCK0
For local development outside OpenClaw:
CODEBLOCK1
Core commands
One-off journal lookup
CODEBLOCK2
One-off topic lookup
CODEBLOCK3
Create a journal subscription
CODEBLOCK4
Create a topic subscription
CODEBLOCK5
List and remove subscriptions
CODEBLOCK6
Workflow
- 1. Decide whether the user wants a manual query or a subscription.
- Preserve the journal name or topic text exactly unless the user explicitly asks to normalize it.
- Use
query-journal for a journal lookup and query-topic for a topic lookup. - Use
subscribe-journal or subscribe-topic for recurring pushes. If the user does not supply a schedule, use the configured defaultSchedule. - Respect skill config for
browserProfile, timezone, defaultSchedule, maxManualResults, and maxPushResults. - After creating, listing, running, or removing a subscription, report the subscription id, schedule, timezone, and status returned by the script.
Delivery rules
- - Subscription jobs run as isolated cron turns with no automatic announce delivery.
- The script is responsible for posting new findings back to the main OpenClaw chat, typically through
chat.inject. - Manual queries return metadata to the current turn and do not create subscription state.
- Subscription runs should push only new items and stay silent when there is no delta.
- Return metadata and CNKI links only. Do not promise PDFs, full text, or other copyrighted payloads.
Failure handling
- - If the script reports missing browser dependencies or an unusable runtime, fix the OpenClaw runtime and retry.
- If CNKI blocks the session with captcha or another verification flow, stop and ask for a fresh
CNKI_COOKIE or a manually refreshed CNKI session. - If a journal lookup returns weak matches, verify the exact journal name and tell the user that source filtering may need the precise CNKI source string.
- If credentials are missing, ask the user to populate
CNKI_COOKIE, or CNKI_USERNAME plus CNKI_PASSWORD, in the skill env config before retrying.
CNKI 监控
当用户需要以下任一模式的CNKI结果时使用此技能:
- - 手动期刊查询:返回指定期刊的论文
- 手动主题查询:返回与研究主题相关的CNKI论文
- 期刊订阅:定期推送指定期刊的新论文
- 主题订阅:定期推送研究主题的新论文
使用时机
- - 用户提供期刊名称并希望进行一次性CNKI查询
- 用户提供研究主题并希望获取标题及来源元数据
- 用户希望将定期CNKI监控结果推送回OpenClaw
前置条件
- - 该技能以标准npm项目形式发布,包含根目录package.json和声明的依赖项
- 首选运行环境仍为OpenClaw网关容器,但支持在Windows/macOS/Linux系统上使用Node.js 22+进行本地开发运行
- 本地运行时,脚本会在首次使用时自动从package.json安装缺失的JavaScript依赖项。浏览器发现支持Playwright管理的Chromium以及常见的Chrome/Edge安装。无需自定义NODEPATH
- 优先使用CNKICOOKIE。CNKIUSERNAME加CNKIPASSWORD是建立CNKI登录会话的备用方案
- 如果CNKI显示验证码、滑块验证或其他人工验证页面,请停止并请求提供新的CNKICOOKIE或手动刷新会话。不要在模型中发明替代的爬取逻辑
- 以OpenClaw运行时行为为准。文档定义了公共契约;不要为了quickvalidate.py的怪癖而牺牲运行时兼容性
参考文件:
- - references/config.md
- references/schedule.md
- references/commands.md
标准入口
始终使用捆绑脚本而非临时CNKI浏览:
bash
node {baseDir}/scripts/cnki-watch.mjs [flags]
在OpenClaw之外进行本地开发:
bash
cd {baseDir}
npm install
node scripts/cnki-watch.mjs --help
npx cnki-watch query-topic --topic 人工智能 --json
核心命令
一次性期刊查询
bash
node {baseDir}/scripts/cnki-watch.mjs query-journal --journal 计算机学报 --json
一次性主题查询
bash
node {baseDir}/scripts/cnki-watch.mjs query-topic --topic 大模型安全 --json
创建期刊订阅
bash
node {baseDir}/scripts/cnki-watch.mjs subscribe-journal --journal 计算机学报 --schedule daily@09:00 --json
创建主题订阅
bash
node {baseDir}/scripts/cnki-watch.mjs subscribe-topic --topic 大模型安全 --schedule weekly@mon@09:00 --json
列出和删除订阅
bash
node {baseDir}/scripts/cnki-watch.mjs list-subscriptions --json
node {baseDir}/scripts/cnki-watch.mjs unsubscribe --id --json
node {baseDir}/scripts/cnki-watch.mjs run-subscription --id --json
工作流程
- 1. 判断用户需要手动查询还是订阅
- 除非用户明确要求规范化,否则保留期刊名称或主题文本原样
- 使用query-journal进行期刊查询,使用query-topic进行主题查询
- 使用subscribe-journal或subscribe-topic进行定期推送。如果用户未提供计划,则使用配置的defaultSchedule
- 遵循技能配置中的browserProfile、timezone、defaultSchedule、maxManualResults和maxPushResults
- 创建、列出、运行或删除订阅后,报告脚本返回的订阅ID、计划、时区和状态
交付规则
- - 订阅作业作为独立的cron轮次运行,不自动进行公告交付
- 脚本负责将新发现发布回主OpenClaw聊天,通常通过chat.inject
- 手动查询将元数据返回当前轮次,不创建订阅状态
- 订阅运行应仅推送新项目,当无增量时保持静默
- 仅返回元数据和CNKI链接。不承诺PDF、全文或其他受版权保护的内容
故障处理
- - 如果脚本报告缺少浏览器依赖项或运行时不可用,请修复OpenClaw运行时并重试
- 如果CNKI通过验证码或其他验证流程阻止会话,请停止并请求提供新的CNKICOOKIE或手动刷新CNKI会话
- 如果期刊查询返回弱匹配结果,请验证确切的期刊名称,并告知用户源过滤可能需要精确的CNKI源字符串
- 如果缺少凭据,请要求用户在重试前在技能环境配置中填写CNKICOOKIE,或CNKIUSERNAME加CNKIPASSWORD