ZJU-REAL/Easel / skills/builtin/skill-xhs-analyzer
redbook
Flagged小红书内容分析:搜索笔记、拉取互动数据、分析爆款规律、创作者画像、限流检测,支持 CLI 自动化操作。 当用户说"小红书数据分析""小红书爆款分析""笔记数据""小红书限流检测""小红书创作者画像""分析小红书账号"时使用。 发布与日常互动运营请用 skill-xhs-publisher。
| File | Kind | Size |
|---|---|---|
| .github/workflows/npm-publish.yml | config | 3.8 KB |
| EASEL-META.md | markdown | 2.1 KB |
| SKILL.md | skill md | 5.2 KB |
| package-lock.json | manifest | 36.6 KB |
| package.json | manifest | 1.6 KB |
| references/commands.md | markdown | 4.4 KB |
| references/modules.md | markdown | 6.2 KB |
| references/platform-signals.md | markdown | 1.7 KB |
| references/research-loop.md | markdown | 8.2 KB |
| references/technical-reference.md | markdown | 3.8 KB |
| scripts/postinstall.js | script | 4.5 KB |
| scripts/preuninstall.js | script | 1.4 KB |
| social-preview.html | other | 5.1 KB |
| social-preview.png | binary | 261.4 KB |
| src/cli.ts | script | 76.8 KB |
| src/lib/analyze.ts | script | 20.0 KB |
| src/lib/cdp-cookies.ts | script | 13.1 KB |
| src/lib/client.ts | script | 22.2 KB |
| src/lib/cookies.ts | script | 13.3 KB |
| src/lib/creator-signing.ts | script | 1.8 KB |
| src/lib/detect.ts | script | 6.6 KB |
| src/lib/fingerprint-data.ts | script | 2.3 KB |
| src/lib/health.ts | script | 5.5 KB |
| src/lib/platform.ts | script | 2.7 KB |
| src/lib/render.ts | script | 19.5 KB |
| src/lib/reply-strategy.ts | script | 6.0 KB |
| src/lib/signing.ts | script | 21.1 KB |
| src/lib/template.ts | script | 8.0 KB |
| src/lib/url.ts | script | 1.8 KB |
| tsconfig.json | config | 458 B |
SKILL.md
View on GitHub---
# ⚠️ name 保持 "redbook" —— clawhub 安装(`clawhub install redbook`)与下方 metadata.openclaw
# install 块均以此 name 为键;改名会破坏 OpenClaw/ClawHub 安装。目录名 skill-xhs-analyzer
# 与此 name 有意不一致,勿"对齐"目录名而改动 name。
name: redbook
description: >-
小红书内容分析:搜索笔记、拉取互动数据、分析爆款规律、创作者画像、限流检测,支持 CLI 自动化操作。
当用户说"小红书数据分析""小红书爆款分析""笔记数据""小红书限流检测""小红书创作者画像""分析小红书账号"时使用。
发布与日常互动运营请用 skill-xhs-publisher。
layer: attribute
metadata:
openclaw:
requires:
bins:
- redbook
install:
- kind: node
package: "@lucasygu/redbook"
bins: [redbook]
homepage: https://github.com/lucasygu/redbook
---
# Redbook — 小红书内容分析 CLI
用 `redbook` CLI 搜索笔记、读内容、分析创作者、提取爆款规律、研究选题。**OpenClaw 用户:** `clawhub install redbook` 或 `npm install -g @lucasygu/redbook --ignore-scripts`。Easel 环境里推荐 `--ignore-scripts`,避免上游 postinstall 额外写入带发布/评论能力的技能。
## ⚠️ 环境依赖
本 SKILL 不是 macOS 专属。Linux/WSL 可用 `REDBOOK_COOKIE_STRING` 或 `REDBOOK_COOKIE_FILE`(默认 `~/.redbook/cookies.json`)提供登录态;macOS keychain / 浏览器抽取只是 cookie 来源之一。
| 依赖 | 说明 |
|------|------|
| Node.js ≥ 22 | 运行 `@lucasygu/redbook` CLI |
| `redbook` binary | 经 `clawhub install redbook` / `npm install -g @lucasygu/redbook --ignore-scripts` 安装 |
| 登录 cookie | 优先 `REDBOOK_COOKIE_STRING`;其次 `REDBOOK_COOKIE_FILE` / `~/.redbook/cookies.json`;也可用已登录浏览器(桌面环境) |
| puppeteer-core + marked | 仅 `render` 卡片渲染需要(可选) |
## 与 skill-xhs-publisher 的分工边界
- **xhs-analyzer(本 SKILL)** = **分析**:搜索/数据/爆款规律/关键词矩阵/创作者画像/限流检测。
- **skill-xhs-publisher** = **发布 + 互动运营**:发图文/视频、日常评论/回复/点赞收藏、内容数据、通知抓取。
- 本 SKILL **只读**。不得调用 `comment`/`reply`/`like`/`collect`/`post` 等写命令;发布交给 `skill-xhs-publisher`,评论与回复交给 `skill-xhs-comment-reply`,由对应 Skill 执行确认和出站安全检查。
## Research discipline(先读这条)
XHS 风控节流的是**读取**,不只是写入。任何读超过几篇笔记的研究,都**必须**走 **[references/research-loop.md](references/research-loop.md)** 的研究循环 —— 默认 human-paced(~20 s/篇,一次一篇)。在紧循环里猛敲 `read`/`comments`/`analyze-viral` 会在几十次内触发验证码/IP 封(300012),账号降级数小时。⚡ Fast 模式仅应急,需打印警告 + 用户明确 opt-in。绝不并行或零延迟发读。
## Usage
```
redbook search "AI编程" --json # 搜索笔记
redbook read <webUrl> --json # 读笔记(用 search 返回的 webUrl,含 xsec_token)
redbook user <profileUrl> --json # 创作者档案
redbook analyze-viral <webUrl> --json # 单篇爆款分析(0-100 分)
redbook account-report --file ids.txt --json # 批量账号指标
redbook health --all --json # 笔记限流检测
```
**始终加 `--json`** 供程序解析。全部命令、选项、JSON 结构见 **[references/commands.md](references/commands.md)**。
## 能力概览
分析能力拆成 13 个可组合模块(A–M)+ 组合工作流,详见 **[references/modules.md](references/modules.md)**:
| 模块 | 能力 |
|------|------|
| A 关键词参与度矩阵 · B 跨主题热力图 · C 参与度信号 | 需求版图 |
| D 创作者画像 · D2 已知账号报告 · E 内容形态分解 | 竞争/形态 |
| F 机会评分 · G 受众推断 · H 内容头脑风暴 | 策略产出 |
| I 评论洞察 · J 爆款结构拆解 · K 互动机会识别 | 只读分析 |
| L 卡片渲染(离线) · M 笔记限流检测 | 产出/健康 |
组合示例:快速主题扫描 `A→C→F`;完整细分分析 `A→B→C→D→E→F→G→H`;单篇深挖 `analyze-viral`。
## 关键领域知识(references/)
| 文件 | 内容 |
|------|------|
| [platform-signals.md](references/platform-signals.md) | 收藏/点赞、评论/点赞、分享/点赞比率基准;排序语义;图文 vs 视频 |
| [modules.md](references/modules.md) | 13 个分析模块 A–M + 组合工作流 |
| [commands.md](references/commands.md) | 所有 redbook 命令详解 + 选项 + JSON 结构 + 全局选项 |
| [research-loop.md](references/research-loop.md) | 读操作节流:三模式/严格规则/状态契约/tick/驱动器/熔断器/写侧阈值 |
| [technical-reference.md](references/technical-reference.md) | 大陆 vs 全球后端、xsec_token、中文数字、错误处理、API vs 浏览器限制、输出格式 |
## Requirements
- Node.js ≥ 22 · 已安装 `redbook` · 提供 `REDBOOK_COOKIE_STRING` / cookie 文件,或在支持的桌面浏览器中已登录 xiaohongshu.com
- 仅卡片渲染额外需 `puppeteer-core` + `marked`(用本机 Chrome,无需额外下载浏览器)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |