
baoyu-danger-x-to-markdown converts tweets, threads, and X articles into markdown files with YAML front matter, enabling users to save and archive social media content in a portable format. The skill uses a reverse-engineered X API and is designed for content creators and researchers who need to extract and preserve X content offline. It requires explicit user consent before operation due to its reliance on unofficial API endpoints that may change or trigger account restrictions.
$ npx -y skills add jimliu/baoyu-skills --skill baoyu-danger-x-to-markdown --agent claude-codeInstalls into .claude/skills of the current project.
Tweets/threads → markdown with YAML front matter; X Articles → full content.
When this skill prompts the user, follow this tool-selection rule (priority order):
AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.Concrete AskUserQuestion references below are examples — substitute the local equivalent in other runtimes.
{baseDir} = this SKILL.md's directory; script = {baseDir}/scripts/main.ts${BUN_X} = bun if installed; else npx -y bun if npx available; else suggest installing bun~/Library/Application\ Support/baoyu-skills/x-to-markdown/consent.json~/.local/share/baoyu-skills/x-to-markdown/consent.jsonaccepted: true and disclaimerVersion: "1.0" → print Warning: Using reverse-engineered X API. Accepted on: <acceptedAt> and proceed.DISCLAIMER
This tool uses a reverse-engineered X API, NOT official.
Risks:
- May break if X changes API
- No guarantees or support
- Possible account restrictions
- Use at your own risk
Accept terms and continue?
{
"version": 1,
"accepted": true,
"acceptedAt": "<ISO timestamp>",
"disclaimerVersion": "1.0"
}
First one found wins:
| Priority | Path | Scope |
|---|---|---|
| 1 | .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md | Project |
| 2 | ${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md | XDG |
| 3 | $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md | User home |
Found → read and apply. Not found → BLOCKING first-time setup: ask the questions in references/config/first-time-setup.md (Media, Output, Save — all in one call) before any conversion, write EXTEND.md at the chosen location, confirm "Preferences saved to [path]", then continue. Never create EXTEND.md with defaults without asking.
| Key | Default | Values |
|---|---|---|
download_media | ask | ask (prompt each time) / 1 (always) / 0 (never) |
default_output_dir | empty (= ./x-to-markdown/) | path or empty |
Value priority: CLI arguments (--download-media, -o) → EXTEND.md → skill defaults.
${BUN_X} {baseDir}/scripts/main.ts <url>
${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md
${BUN_X} {baseDir}/scripts/main.ts <url> --download-media
${BUN_X} {baseDir}/scripts/main.ts <url> --json
| Option | Description |
|---|---|
<url> | Tweet or article URL |
-o <path> | Output path |
--json | JSON output |
--download-media | Download images/videos to local imgs/ and videos/ next to the markdown, rewrite links to local relative paths |
--login | Refresh cookies only |
Supported URLs: https://x.com/<user>/status/<id>, https://twitter.com/<user>/status/<id>, https://x.com/i/article/<id>
---
url: "https://x.com/user/status/123"
author: "Name (@user)"
tweetCount: 3
coverImage: "https://pbs.twimg.com/media/example.jpg"
---
Content...
File structure: x-to-markdown/{username}/{tweet-id}/{content-slug}.md
By EXTEND.md download_media: 1 → run with --download-media; 0 → run without; ask (default):
--download-media → markdown savedhttps:// image/video links); none → done, no prompt--download-media (overwrites markdown with localized links)X_AUTH_TOKEN, X_CT0Custom configurations via EXTEND.md — see Preferences above.
Sponsors