baoyu-danger-x-to-markdown
Transforms X content into structured markdown files for easy saving and organization.
Install
mkdir -p .claude/skills/baoyu-danger-x-to-markdown && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3465" && unzip -o skill.zip -d .claude/skills/baoyu-danger-x-to-markdown && rm skill.zipInstalls to .claude/skills/baoyu-danger-x-to-markdown
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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.Key capabilities
- →Convert X tweets and threads to markdown
- →Extract X article content
- →Download media assets to local directories
- →Generate YAML front matter for metadata
- →Manage user consent for reverse-engineered API usage
How it works
The skill uses a reverse-engineered API to fetch content from X. It then formats the data into markdown, optionally downloading media assets based on user preferences stored in a configuration file.
Inputs & outputs
When to use baoyu-danger-x-to-markdown
- →Save threads as local markdown
- →Convert X articles for documentation
- →Archive tweets with metadata
- →Prepare social media content for storage
About this skill
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_TOKEN,X_CT0 - Chrome login (fallback): auto-opens Chrome, caches cookies locally
Extension Support
Custom configurations via EXTEND.md — see Preferences above.
When not to use it
- →When the user declines the disclaimer terms
- →When the X API changes and the tool is broken
Prerequisites
Limitations
- →Uses a reverse-engineered API, not official
- →May break if X changes its API
- →No guarantees or support provided
How it compares
It automates the archival of social media content into a structured local format, bypassing the need for manual copy-pasting.
Compared to similar skills
baoyu-danger-x-to-markdown side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| baoyu-danger-x-to-markdown (this skill) | 2 | 5mo | Review | Intermediate |
| second-brain | 0 | 5mo | No flags | Intermediate |
| qmd | 26 | 5mo | Review | Intermediate |
| wiki-query | 0 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by JimLiu
View all by JimLiu →You might also like
second-brain
Bradliebs
Build and maintain a Karpathy-style LLM-maintained personal wiki (a "Second Brain") as plain markdown the user owns. Use when the user wants to set up a second brain, capture/ingest a source into their notes, ask their knowledge base a question, file decisions, or keep a personal wiki organized. Tri
qmd
tobi
Search personal markdown knowledge bases, notes, meeting transcripts, and documentation using QMD - a local hybrid search engine. Combines BM25 keyword search, vector semantic search, and LLM re-ranking. Use when users ask to search notes, find documents, look up information in their knowledge base, retrieve meeting notes, or search documentation. Triggers on "search markdown files", "search my notes", "find in docs", "look up", "what did I write about", "meeting notes about".
wiki-query
AgriciDaniel
Answer questions using the Obsidian wiki vault. Reads hot cache first, then index, then relevant pages. Synthesizes answers with citations. Files good answers back as wiki pages. Supports quick, standard, and deep modes. Triggers on: what do you know about, query:, what is, explain, summarize, find
llm-wiki
rtl-buddy
Karpathy's LLM Wiki: build/query interlinked markdown KB.
zettelkasten-note
treylom
Create atomic, interconnected notes following Zettelkasten methodology
pdf-to-markdown
aliceisjustplaying
Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.