Converts X (Twitter) tweets and articles to markdown with YAML front matter. Uses reverse-engineered API requiring user consent. Use when user mentions "X to markdown", "tweet to markdown", "save tweet", or provides x.com/twitter.com URLs for conversion.
84%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
High
Do not use without reviewing
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.
JimLiu/baoyu-skills
ca703c2
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.