baoyu-danger-x-to-markdown
What it does
This skill converts tweets, threads and X Articles into readable markdown files. It is for people who want to keep or archive posts from X.
When to use it
- βWhen you want to save a tweet or thread as a markdown file.
- βWhen you have an X Article you want to keep as readable text.
- βWhen you have an x.com or twitter.com link you want to convert.
Skill link
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βSave this tweet thread as a markdown file with the date and author in the header.β
5 new skills a week. 1 minute to read.
How it works
Your agent checks that you have accepted the consent terms, fetches the post through a reverse-engineered connection, and writes it to markdown with a header.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
X to Markdown
Tweets/threads β markdown with YAML front matter; X Articles β full content.
User Input Tools
When this skill prompts the user, follow this tool-selection rule (priority order):
- Prefer built-in user-input tools exposed by the current agent runtime β e.g.,
AskUserQuestion,request_user_input,clarify,ask_user, or any equivalent. - Fallback: if no such tool exists, emit a numbered plain-text message and ask the user to reply with the chosen number/answer for each question.
- Batching: if the tool supports multiple questions per call, combine all applicable questions into a single call; if only single-question, ask them one at a time in priority order.
Concrete AskUserQuestion references below are examples β substitute the local equivalent in other runtimes.
Script Directory
{baseDir}= this SKILL.md's directory; script ={baseDir}/scripts/main.ts${BUN_X}=bunif installed; elsenpx -y bunifnpxavailable; else suggest installing bun
Consent Requirement (before any conversion)
- Read the consent file:
- macOS:
~/Library/Application\ Support/baoyu-skills/x-to-markdown/consent.json - Linux:
~/.local/share/baoyu-skills/x-to-markdown/consent.json
- macOS:
accepted: trueanddisclaimerVersion: "1.0"β printWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>and proceed.- Missing or version mismatch β show this disclaimer and ask "Yes, I accept" | "No, I decline":
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? - Accept β write the consent file:
{ "version": 1, "accepted": true, "acceptedAt": "<ISO timestamp>", "disclaimerVersion": "1.0" } - Decline β output "User declined. Exiting." and stop.
Preferences (EXTEND.md)
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.
Usage
${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>
Output
---
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
Media Download
By EXTEND.md download_media: 1 β run with --download-media; 0 β run without; ask (default):
- Run without
--download-mediaβ markdown saved - Check it for remote media (
https://image/video links); none β done, no prompt - Otherwise ask (header "Media", question "Download N images/videos to local files?"): "Yes" β download to local directories / "No" β keep remote URLs
- Yes β rerun with
--download-media(overwrites markdown with localized links)
Authentication
- Environment variables (preferred): `X_AUTH_TOKE
FAQ
Why is consent needed?
The skill uses a reverse-engineered X connection, so it asks you to accept its terms the first time.
What does the file include?
It includes YAML front matter at the top with details about the post, followed by its content.
Does it save full X Articles?
Yes. The skill converts X Articles to their full content as well as tweets and threads.
Details
Original description by the author
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.
repo: JimLiu/baoyu-skills
Popularity
- GitHub stars
- 27k
- Ranking position
- #9953
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
release-skills
27kGuides your agent through a release for any project: bumping the version, updating changelogs and publishing a GitHub release or tag.
baoyu-article-illustrator
27kHelps your agent add illustrations to an article by finding the spots that need visuals and creating images in one consistent style.
baoyu-comic
27kShows your agent how to create an educational comic with panels, art styles and tones, such as a biography or a tutorial.
baoyu-compress-image
27kLets your agent shrink image files by converting them to WebP or PNG with automatic tool selection, so they load faster.
Similar skills
tavily
394kHelps your agent search the web with Tavily and pull the text from specific web pages, with options for depth, domains, and dates.
blogwatcher
394kLets your agent follow blogs and RSS or Atom feeds, check them for new articles, and mark the ones you have read.
data-scraper-agent
280kHelps your agent automatically collect data from any public source. It can be scheduled, enrich information, and save results. Useful for monitoring or tracking online data.