2.9 KiB
2.9 KiB
name, description
| name | description |
|---|---|
| xiaohongshu-engage | Browse XiaoHongShu (小红书) with Playwright and execute account interactions end-to-end: discover content, open notes, like, favorite, and post concise comments. Use when the user asks to '逛逛', browse feed content, or delegate 点赞/收藏/评论 on their logged-in account. |
Xiaohongshu Engage
Workflow
- Confirm login state before interacting.
- Navigate to discovery feed and identify relevant content.
- Open note details and perform requested engagement actions.
- Validate action success from UI state.
- Summarize exactly what was done.
Shared Session Policy
- Reuse a single Playwright CLI session across all web-automation skills:
export PLAYWRIGHT_SHARED_SESSION=codex-shared
- Use
/Users/xd/java/xhs/tools/pwas the only Playwright CLI entrypoint. - Do not pass
--sessiondirectly in skill-specific commands.
1) Confirm Login State
- Snapshot current page.
- Check that the sidebar includes the
我entry and that profile link is accessible. - If not logged in, stop and ask the user to complete login first.
2) Enter Feed And Pick Topics
- Click
发现. - Prefer topics related to user context or explicit interest (for example AI, coding, photography, travel).
- Open one note at a time from the card list.
3) Engage On A Note
For each selected note:
- Click
点赞. - Click
收藏. - Enter a concise comment and submit.
- Keep comments specific to note content, short, and polite.
Comment style:
- 1 sentence, <= 35 Chinese characters preferred.
- Avoid arguments, sarcasm, or sensitive claims.
- Prefer useful and neutral phrasing.
Examples:
这个思路很实用,感谢分享。观点很清晰,落地建议也很有帮助。内容很有启发,我也在实践类似方法。
4) Verify Success Signals
After each action, verify at least one visible signal:
- Like count increases or icon state toggles.
收藏成功toast appears or favorite count changes.评论成功toast appears and new comment is present in comment list.
If a send/click fails because overlay intercepts:
- Re-snapshot.
- Wait briefly and retry.
- Use keyboard
Entersubmission as fallback for comment sending.
5) Handle UI Reliability
- Re-snapshot after navigation, modal open/close, and any major DOM change.
- Treat stale refs as expected behavior; refresh refs before retrying.
- Close note modal before opening another card when interactions become blocked.
6) Report Back To User
Return a compact action log:
- Which notes were engaged.
- How many likes, favorites, and comments were completed.
- Any failures or skipped items.
Boundaries
- Do not follow users, send private messages, or change profile/account settings unless explicitly requested.
- Do not post repeated or spammy comments across multiple notes.
- Stop and notify user if login state is lost or account safety prompts appear.