# Xhs Trend Scan

> Detects emerging concept words on Xiaohongshu (小红书) before they go mainstream — extracts 2-4 char Chinese n-grams from recent viral notes, filters against a 5000-word common lexicon baseline, and ranks by recency × viral note appearance × time concentration. Surfaces words like 「奥德赛时期」 1-2 weeks before mainstream pickup. Use when the user asks to 找新概念词 / 流行新词 / 哪些词刚开始火 / 新冒出来的词 / 早期热词识别 / trend s…

- **Type:** Skill
- **Install:** `agentstack add skill-jeorrysyd-xhs-viral-decoder-xhs-trend-scan`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Jeorrysyd](https://agentstack.voostack.com/s/jeorrysyd)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Jeorrysyd](https://github.com/Jeorrysyd)
- **Source:** https://github.com/Jeorrysyd/xhs-viral-decoder/tree/main/skills/xhs-trend-scan

## Install

```sh
agentstack add skill-jeorrysyd-xhs-viral-decoder-xhs-trend-scan
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# xhs-trend-scan — 流行新概念词识别

Mines TOP 60-90 recent viral notes for emerging vocabulary that hasn't yet gone mainstream — the 「2 weeks before everyone uses it」 advantage.

## When to use

User asks:
- 「本周有哪些新冒出来的概念词？」
- 「找出近 14 天才开始火的词」
- 「哪些词我应该早点用？」
- 「Find emerging concepts on xhs this week」

## Quick start

```bash
python3 shared/lib/cli.py trend-scan \
  --keywords 情绪管理,内耗,自我疗愈 \
  --window-days 14
```

If `--keywords` omitted, uses `config.yaml::defaults.keywords`.
If you've recently run `xhs-viral-pulse`, this skill auto-reuses that data (saves API calls).

## What it produces

Single docx in Feishu folder with 4 sections:

1. **TOP 10 emerging concepts** — table with 词 / first appearance date / freq / appearing in viral notes / score
2. **For each concept**: source note examples (showing how the word is used in context)
3. **Trend trajectory** — likes growth curve per concept
4. **Action推荐** — 3 concepts most worth Joyce adopting in next-week content

## Detection algorithm (key design)

```
score = (
    log(frequency_in_top_viral) * 3        # appears in viral notes = strong signal
  + recency_concentration * 2              # most appearances within last N days
  + cross_keyword_appearance * 2           # appears across multiple keyword searches
  - in_common_lexicon * 10                 # heavy penalty if it's a common Chinese word
  - in_existing_brand_lexicon * 5          # penalty if it's a brand/proper noun
)
```

Ranked descending; take TOP 10 with score > threshold.

## Common lexicon

5000-word Chinese baseline at `shared/data/common_lexicon.txt` — ensures we surface NEW words, not just common ones. Built from public Chinese frequency tables.

## Workflow detail

See [workflow.md](workflow.md).

## Composition with other skills

- **Pair with `xhs-viral-pulse`** to immediately incorporate trend words into the content plan
- **Pair with `xhs-viral-rewrite`** to use trend words as voice signature additions

## Failure modes — feishu output is REQUIRED

The skill **must** end with a Feishu doc URL handed back to the user. If feishu push fails for any reason, **stop and ask the user to fix the configuration**. Do NOT silently degrade to local-only output.

| Failure | Action |
|---|---|
| `lark-cli` binary not in PATH | STOP. Tell user to install lark-cli per [setup/02_install_lark_cli.md](../../setup/02_install_lark_cli.md). |
| `lark-cli` auth expired (`LarkAuthExpired`) | STOP. Tell user: `lark-cli auth login --as bot` |
| Bot lacks scope (`LarkScopeMissing`) | STOP. Show the `scope_url` from the error; user grants in 1 click in 飞书 console. |
| `config.yaml` missing `feishu.folder_token` | STOP. Tell user to edit `config.yaml`. |

Local markdown / JSON files saved during the run are intermediate artifacts — they are **not** the deliverable.

## Examples

See [examples.md](examples.md) and [../../examples/trend_scan_sample.md](../../examples/trend_scan_sample.md).

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Jeorrysyd](https://github.com/Jeorrysyd)
- **Source:** [Jeorrysyd/xhs-viral-decoder](https://github.com/Jeorrysyd/xhs-viral-decoder)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jeorrysyd-xhs-viral-decoder-xhs-trend-scan
- Seller: https://agentstack.voostack.com/s/jeorrysyd
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
