mcpField
X
xiaohongshu-tools

xiaohongshu-tools

github.com/postplusai数据与数据库27138 次安装1 天前更新
代码仓库

关于 xiaohongshu-tools

为小红书技能系列提供本地数据处理脚本的执行支持。它限定使用指定的采集键,并涵盖数据规范化、账号与笔记排名、评论聚类,以及主题图和商家报告生成。

主要功能

  1. 01运行受支持的小红书采集键
  2. 02规范化采集数据集
  3. 03排名账号、笔记和商品
  4. 04聚类评论
  5. 05生成主题图和商家报告

适用场景

  1. 01处理采集的小红书账号笔记
  2. 02分析小红书搜索结果
  3. 03生成账号或商品排名

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/postplusai/postplus-skills --skill xiaohongshu-tools

安装后在 Claude Code 中输入/xiaohongshu-tools确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

_postplus_shared/00-core/shared-collection/scripts/
collection_actor_run.mjs
_postplus_shared/00-core/shared-collection/scripts/lib/
hosted_collection_bridge.mjs
_postplus_shared/00-core/shared-runtime/scripts/
download_videos_from_manifest_with_ytdlp.mjs
_postplus_shared/00-core/shared-runtime/scripts/lib/
execution_approval.mjs
hosted_billing_summary.mjs
hosted_execution_protocol.mjs
hosted_media_generation_bridge.mjs
local_skill_cli.mjs
network_runtime.mjs
postplus_cli_config.mjs
postplus_cloud_client.mjs
skill_runtime.mjs
scripts/
build_xhs_merchant_report.mjs
build_xhs_topic_map.mjs
cluster_xhs_comments.mjs
extract_xhs_vendor_page_products.mjs
normalize_xhs_dataset.mjs
rank_xhs_accounts.mjs
rank_xhs_posts.mjs
rank_xhs_products.mjs
run_xhs_actor.mjs
scripts/lib/
xhs_common.mjs

详细介绍

小红书工具

请遵循以下共享公共技能规则:

  • postplus-shared 公共技能规则

在实现或运行小红书技能族的本地执行层时,请使用本技能。

主要脚本:

  • scripts/run_xhs_actor.mjs
  • scripts/normalize_xhs_dataset.mjs
  • scripts/extract_xhs_vendor_page_products.mjs
  • scripts/rank_xhs_accounts.mjs
  • scripts/rank_xhs_posts.mjs
  • scripts/cluster_xhs_comments.mjs
  • scripts/rank_xhs_products.mjs
  • scripts/build_xhs_topic_map.mjs
  • scripts/build_xhs_merchant_report.mjs

共享辅助模块:

  • scripts/lib/xhs_common.mjs

参考契约:

  • ../xiaohongshu-references/tool-contracts.md
  • ../xiaohongshu-references/normalized-schema.md

执行规则

除非 schema 确实要求,否则不要自行发明 actor 专属的下游工作流。

优先使用:

  • scripts/run_xhs_actor.mjs
  • ${CLAUDE_SKILL_DIR}/_postplus_shared/00-core/shared-collection/scripts/collection_actor_run.mjs

在原始数据收集完成后,本技能应专注于稳定的本地契约。

支持的采集键

本支持技能只能运行以下 PostPlus 公共采集键:

  • xhs-account-posts
  • xhs-search

最小运行示例:

node ${CLAUDE_SKILL_DIR}/scripts/run_xhs_actor.mjs \
  --collection-key xhs-account-posts \
  --input <work-folder>/.postplus/xiaohongshu-tools/xhs-account-posts-input.json \
  --output <work-folder>/.postplus/xiaohongshu-tools/xhs-account-posts-raw.json

node ${CLAUDE_SKILL_DIR}/scripts/run_xhs_actor.mjs \
  --collection-key xhs-search \
  --input <work-folder>/.postplus/xiaohongshu-tools/xhs-search-input.json \
  --output <work-folder>/.postplus/xiaohongshu-tools/xhs-search-raw.json

不要传入提供商专属的采集名称或未发布的键。

公共技能执行契约

  • 将 actor 输入、原始数据集、规范化数据集、排名输出、 聚类评论、商品排名和话题图谱保留在 <work-folder>/.postplus/xiaohongshu-tools/ 下
  • 仅将最终面向用户的候选清单或报告保留在 .postplus/ 之外
  • 在更大范围采集之前,先进行一次有界的第一轮采集
  • 如果 PostPlus Cloud 服务不可用、未授权,或返回稳定的 网络错误,请立即停止,而不要切换到临时的 shell 拼接方案

评论

支持 Markdown