# Xhs Cdp Ops

> Reusable CDP-style Xiaohongshu operations patterns for archive/publish/search workflows, with runtime safety guards (single-instance lock) and smoke checks. Use when users ask to stabilize XHS automation, add ops-grade CLI flows, or benchmark against repos like white0dew/XiaohongshuSkills.

- Skill: `yanghu819/xhs-cdp-ops` (Agent Skill, multi-file: 6 files)
- Install (CLI): `npx skillmds add yanghu819/xhs-cdp-ops`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yanghu819/xhs-cdp-ops/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: yanghu819 (https://skillmd.com/u/yanghu819)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/yanghu819/xhs-cdp-ops

---


# xhs-cdp-ops

This skill captures operational patterns learned from production-style XHS CDP tools and applies them to our local pipeline with safe defaults.

## What this skill focuses on

- Runtime safety:
  - single-instance lock to prevent concurrent script collisions
  - clear exit code `3` for lock conflicts
- Login stability:
  - positive login TTL cache (default 12h)
  - lightweight session verification with fallback strategy
- CLI discipline:
  - consistent `--help` contracts
  - predictable script entry points
- Ops workflow:
  - profile archive pipeline checks
  - render/copy iteration command sanity checks
  - structured `*_RESULT` JSON output for downstream automation
  - optional CSV export for index/analytics

## Local scripts covered

- `/Users/hy3/Desktop/setting/xhs-pipeline/scripts/run_lock.py`
- `/Users/hy3/Desktop/setting/xhs-pipeline/scripts/xhs_ops_common.py`
- `/Users/hy3/Desktop/setting/xhs-pipeline/scripts/run_red_blue_mimic.py`
- `/Users/hy3/Desktop/setting/xhs-pipeline/scripts/generate_xhs_variants.py`
- `/Users/hy3/Desktop/setting/xhs-pipeline/scripts/download_xhs_profile_archive.py`
- `/Users/hy3/Desktop/setting/xhs-pipeline/scripts/download_xhs_profile_full.py`

## Smoke command

```bash
bash scripts/smoke_ops.sh
```

## Output

- `state/ops_smoke_<timestamp>.log`

## Notes

- This skill does not publish or comment by default.
- It is intentionally small and atomic for Codex + Claude Code reuse.

