← Back to Skills Marketplace
barryyjj

Zsxq Search

by BarryYJJ · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ Security Clean
205
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install zsxq-search
Description
在知识星球上搜索指定关键词,自动切换全部星球范围、主题Tab和最新排序,并返回结构化搜索结果。
README (SKILL.md)

知识星球搜索技能

在知识星球(wx.zsxq.com)上搜索指定关键词并返回结果。

触发条件

以下说法均触发此技能:

  • "你去星球搜一下xx"
  • "星球搜一下xx"
  • "搜一下星球xx"
  • "知识星球搜索xx"
  • "在星球里搜xx"
  • "星球里有没有xx相关的"
  • "去知识星球找一下xx"
  • "zsxq搜xx"
  • "知识星球搜一下xx"
  • "zsxq搜一下xx"
  • "星球里找一下xx"
  • "帮我在星球搜xx"
  • "星球查一下xx"

默认配置

  • 浏览器Profile: openclaw
  • 搜索范围: 全部星球
  • Tab: 主题
  • 排序: 最新
  • targetId: 通过 browser(action="list_tabs") 动态获取,不要硬编码

操作流程

约定:以下所有 browser 调用均使用 profile="openclaw"\x3CtabId> 为当前标签页ID,需动态获取。

Step 1: 直接导航到全局搜索URL

核心方案: 从星球页面内部搜索默认为"当前星球"。知识星球的"全部星球"按钮是Angular组件(.search-btn > .all),JS的DOM click和MouseEvent都无法触发Angular事件绑定。 正确做法是直接导航到全局搜索URL(不带groupId参数)。

browser(action="navigate", profile="openclaw", targetId=\x3CtabId>, url="https://wx.zsxq.com/search/\x3CURL编码的关键词>?searchUid=0.999")

等待页面加载:

browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"wait", "timeMs":1000})

如果需要搜索"当前星球": URL加groupId参数:https://wx.zsxq.com/search/\x3C关键词>?groupId=\x3C星球ID>

登录态检测: 如果导航后跳转到登录页,告知用户"浏览器登录态已失效,请先登录后重试"。

Step 2: 切换到"主题"筛选

直接导航后默认显示"文件"tab,需切到"主题"。snapshot通常抓不到tab ref,用JS(参考 JS: clickTabItem):

browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"evaluate", "fn":"\x3C参考JS模板,tabName='主题'>"})

点击后等待结果刷新:

browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"wait", "timeMs":500})

Step 3: 切换到"最新"排序

snapshot同样抓不到排序按钮,用JS(参考 JS: clickSortOption):

browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"evaluate", "fn":"\x3C参考JS模板,sortName='最新'>"})

点击后等待排序刷新:

browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"wait", "timeMs":500})

Step 4: 截图确认搜索状态

browser(action="screenshot", profile="openclaw", targetId=\x3CtabId>)
read(\x3Cscreenshot_path>)

确认以下三项:

  1. 标题显示"已加入星球的主题"(全部星球)或"「xxx」星球的主题"(当前星球)
  2. "主题" Tab 已选中
  3. "最新"排序已激活

如果状态不对,回到对应步骤修正后重新确认。最多重试2次。

Step 5: 抓取结果并总结

必须用 compact=false,否则compact模式会省略搜索结果正文内容。

browser(action="snapshot", compact=false, profile="openclaw", targetId=\x3CtabId>)
  • 解析 snapshot 内容,按日期倒序整理为结构化总结返回用户
  • 只输出搜索结果,不输出中间步骤(导航、点tab、截图确认等过程全部跳过)
  • 如果搜索无结果(snapshot中出现"暂无搜索结果"等提示文字,或结果列表为空),告知用户并建议换关键词重试

Step 6(可选): 滚动加载更多结果

如果用户需要更多结果:

browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"evaluate", "fn":"window.scrollTo(0, document.body.scrollHeight)"})
browser(action="act", profile="openclaw", targetId=\x3CtabId>, request={"kind":"wait", "timeMs":1000})

滚动后重新snapshot(compact=false)获取新加载的结果。最多滚动3次,超过或连续两次无新内容则停止。

JS模板

以下JS片段供各步骤引用。 kind:"evaluate" 的参数名是 fn(不是 expression)! 箭头函数 () => {} 格式可用。IIFE (function(){})() 也可用。

JS: clickTabItem

点击搜索结果的Tab筛选项(全部/主题/文件/用户)。优先用 .tab-item class匹配,若class已变则fallback到 .navtabs 内按文本遍历。

() => {
  const tabName = '主题'; // 替换为目标Tab名
  const tab = [...document.querySelectorAll('.tab-item')].find(t => t.textContent.trim() === tabName && !t.classList.contains('tab-selected'));
  if (tab) { tab.click(); return 'clicked tab: ' + tabName; }
  const navtabs = document.querySelector('.navtabs, [class*="navtab"], [class*="tab-bar"]');
  if (navtabs) {
    const fallback = [...navtabs.querySelectorAll('*')].find(e => e.offsetHeight > 0 && e.offsetParent !== null && e.children.length === 0 && e.textContent.trim() === tabName);
    if (fallback) { fallback.click(); return 'clicked tab (fallback): ' + tabName; }
  }
  return 'tab not found: ' + tabName;
}

JS: clickSortOption

在排序容器内精确点击排序选项(综合/最新/精华)。

() => {
  const sortName = '最新'; // 替换为目标排序名
  const container = document.querySelector('.search-sort-container, [class*="sort"]');
  if (!container) return 'sort container not found';
  const el = [...container.querySelectorAll('*')].find(e => e.offsetHeight > 0 && e.offsetParent !== null && e.children.length === 0 && e.textContent.trim() === sortName);
  if (el) { el.click(); return 'clicked sort: ' + sortName; }
  return 'sort option not found: ' + sortName;
}

页面结构参考

区域 CSS选择器/特征 说明
全局搜索URL /search/\x3C关键词> 不带groupId=全部星球
当前星球搜索URL /search/\x3C关键词>?groupId=\x3CID> 带groupId=当前星球
搜索范围按钮 .search-btn > .current / .search-btn > .all JS click无效(Angular绑定)
Tab栏 .navtabs 全部 / 主题 / 文件 / 用户
Tab项 .tab-item 选中态: .tab-selected
排序区 .search-sort-container 综合 / 最新 / 精华
搜索结果 snapshot中的列表项 每条包含:标题、摘要、日期、来源星球
无结果提示 "暂无搜索结果" 等文本 需识别并告知用户

注意事项

  • 全部星球搜索用直接导航/search/\x3C关键词>,不经过星球页面内部搜索面板。Angular组件的"全部星球"按钮JS click无效。
  • ref失效:导航或页面跳转后ref全部失效,必须重新snapshot获取新ref
  • evaluate参数名是fnkind:"evaluate" 必须用 fn 参数传JS代码,不能用 expression
  • compact模式:获取ref和检测状态用compact=true抓取搜索结果必须用compact=false
  • tabId动态获取:不要硬编码,浏览器重启后会变化
  • 重试上限:状态校验最多重试2次,滚动加载最多3次,避免死循环
  • 登录态:全局搜索URL如跳转到登录页,提示用户手动登录
  • 不要建议用户安装 Chrome Browser Relay 扩展
Usage Guidance
This skill will operate your agent's browser profile (named 'openclaw') and run JS in the site to perform searches. That behavior is expected for a web-search skill, but consider: 1) use a dedicated browser profile without unrelated accounts or sensitive sessions; 2) verify you are comfortable the agent can access the profile's cookies (it will use your login to fetch results); 3) the skill can read page DOM and screenshots — don't use it against pages containing secrets you don't want the agent to access; 4) no external installs or extra credentials are required. If you want tighter isolation, create a fresh browser profile for this skill or require manual login each time.
Capability Analysis
Type: OpenClaw Skill Name: zsxq-search Version: 1.1.1 The skill bundle provides a legitimate tool for searching content on the Knowledge Planet (wx.zsxq.com) platform. It uses standard OpenClaw browser automation commands to navigate to search URLs, interact with the web interface via JavaScript injection for tab switching and sorting, and extract results using snapshots. There is no evidence of data exfiltration, credential theft, or malicious prompt injection; the instructions in SKILL.md are focused entirely on the stated search functionality.
Capability Assessment
Purpose & Capability
Name/description (search 知识星球) matches the instructions: navigate to the site's search URL, select tabs/sort, snapshot results, parse and return them. No unrelated binaries, env vars, or installs are requested.
Instruction Scope
Instructions rely on browser actions (navigate, evaluate JS, snapshot, screenshot) and run small in-page JS snippets to click elements and scroll. This is appropriate for web scraping/search automation, but it does require access to a browser profile ('openclaw') and the ability to evaluate arbitrary JS in pages — which can read page DOM and any data accessible in that profile/session. The skill explicitly instructs to detect login state and not to expose intermediate steps; it does not request unrelated system files or other environment variables.
Install Mechanism
Instruction-only skill with no install spec, no downloads, and no third-party package pulls. Lowest-risk install profile.
Credentials
No environment variables, credentials, or config paths are requested. The only sensitive resource used is a browser profile (session cookies) which is proportional to the stated purpose of searching a site requiring login.
Persistence & Privilege
always is false and autonomous invocation is default; the skill does not request persistent or elevated platform privileges and does not modify other skills or global configs.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install zsxq-search
  3. After installation, invoke the skill by name or use /zsxq-search
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.1
Add: 搜索结果只输出最终结果,不输出中间步骤
v1.1.0
Fix: 全部星球搜索改为直接导航URL方案(Angular组件JS click无效),简化流程为6步,删除失效的search panel JS模板,修正evaluate参数名为fn
v1.0.0
Initial release: knowledge planet (zsxq.com) search skill with browser automation. Supports all-group search, topic filtering, latest sort, JS templates with fallback selectors, login detection, and scroll-to-load.
Metadata
Slug zsxq-search
Version 1.1.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is Zsxq Search?

在知识星球上搜索指定关键词,自动切换全部星球范围、主题Tab和最新排序,并返回结构化搜索结果。 It is an AI Agent Skill for Claude Code / OpenClaw, with 205 downloads so far.

How do I install Zsxq Search?

Run "/install zsxq-search" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Zsxq Search free?

Yes, Zsxq Search is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Zsxq Search support?

Zsxq Search is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Zsxq Search?

It is built and maintained by BarryYJJ (@barryyjj); the current version is v1.1.1.

💬 Comments