Social Media Analysis Skill
Scope: skill/scripts/collectors/ (bilibili.py, douyin.py, douyin_openapi.py, weibo.py, xiaohongshu.py, base.py), skill/scripts/run_pipeline.py, skill/references/ (analysis-rules.md, platforms/, exceptions.md, etc.), skill/evals/, and tools/skill_eval/.
Invariants
- Two-tier layout: repo root (developer-facing) +
skill/ (Agent-Skills-spec deliverable: SKILL.md, scripts/, references/, assets/, evals/).
- Production code never calls an LLM; the Agent executes classification/business-insight steps through external JSON files (
source/classification-results.json, source/business-insight-results.json).
- Two-phase model workflow:
--with-llm-tax → write taxonomy-results.json outside workspace → --classification-results (validated, sealed by digest) → --with-business-insights → write business-insight-results.json.
- Collection and analysis are independent create-only commits:
--input collection must be a sealed workspace; --output analysis must not exist. Failure never overwrites or deletes.
- Resume (
--resume --out) only accepts the same platform + canonical URL whose .complete and manifest.json pass verify_committed_workspace.
BaseCollector ABC: supports, check_access, collect_profile, collect_post_list, collect_post_detail, collect_comments, get_collection_coverage, normalize_profile, normalize_post.
- Platform-specific constraints in
skill/references/platforms/; per-platform adapters under skill/scripts/collectors/.
When to use
- Adding or editing platform adapters (Bilibili/Douyin/Weibo/Xiaohongshu).
- Changing collection pipeline (
collect.py, collect_douyin_authorized.py, import_index_snapshot.py).
- Touching analysis pipeline (
run_pipeline.py, immutable_workspace.py, task_contract.py).
- Modifying
skill/references/ domain rules or skill/evals/ evaluation data.
Verification
python3 -m pytest tests/ -q full regression.
- Local smoke (real network, public pages only):
python3 skill/scripts/collect.py <url> --limit 5 --out workspace/smoke.
- Dataset integrity:
python3 tools/skill_eval/split_dataset.py --verify.
git diff --check before commit.
1---2name: social-media-analysis3description: Social-media account content analysis pipeline for public-social-account-analyzer. Use for platform adapters (Bilibili/Douyin/Weibo/Xiaohongshu), content classification, business insights, taxonomy drafts, and immutable analysis workspaces.4metadata:5 source: https://skillmd.com/skills/luckycat133/social-media-analysis6---78# Social Media Analysis Skill910Scope: `skill/scripts/collectors/` (bilibili.py, douyin.py, douyin_openapi.py, weibo.py, xiaohongshu.py, base.py), `skill/scripts/run_pipeline.py`, `skill/references/` (analysis-rules.md, platforms/, exceptions.md, etc.), `skill/evals/`, and `tools/skill_eval/`.1112## Invariants1314- Two-tier layout: repo root (developer-facing) + `skill/` (Agent-Skills-spec deliverable: `SKILL.md`, `scripts/`, `references/`, `assets/`, `evals/`).15- Production code never calls an LLM; the Agent executes classification/business-insight steps through external JSON files (`source/classification-results.json`, `source/business-insight-results.json`).16- Two-phase model workflow: `--with-llm-tax` → write `taxonomy-results.json` outside workspace → `--classification-results` (validated, sealed by digest) → `--with-business-insights` → write `business-insight-results.json`.17- Collection and analysis are independent create-only commits: `--input` collection must be a sealed workspace; `--output` analysis must not exist. Failure never overwrites or deletes.18- Resume (`--resume --out`) only accepts the same platform + canonical URL whose `.complete` and `manifest.json` pass `verify_committed_workspace`.19- `BaseCollector` ABC: `supports`, `check_access`, `collect_profile`, `collect_post_list`, `collect_post_detail`, `collect_comments`, `get_collection_coverage`, `normalize_profile`, `normalize_post`.20- Platform-specific constraints in `skill/references/platforms/`; per-platform adapters under `skill/scripts/collectors/`.2122## When to use2324- Adding or editing platform adapters (Bilibili/Douyin/Weibo/Xiaohongshu).25- Changing collection pipeline (`collect.py`, `collect_douyin_authorized.py`, `import_index_snapshot.py`).26- Touching analysis pipeline (`run_pipeline.py`, `immutable_workspace.py`, `task_contract.py`).27- Modifying `skill/references/` domain rules or `skill/evals/` evaluation data.2829## Verification3031- `python3 -m pytest tests/ -q` full regression.32- Local smoke (real network, public pages only): `python3 skill/scripts/collect.py <url> --limit 5 --out workspace/smoke`.33- Dataset integrity: `python3 tools/skill_eval/split_dataset.py --verify`.34- `git diff --check` before commit.