Index of every page on this site: llms.txt
All skills
jimliu avatar

/baoyu-danger-x-to-markdown

@bf1ff07 official
by Jim Liu 宝玉jimliu/baoyu-skills28k stars
3,011
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/jimliu/baoyu-skills/baoyu-danger-x-to-markdown

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈71 tokens for metadata: the name and description. ≈1.2k when used: this file. ≈521 more on demand in 2 files.

Description uses 3.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈283 characters, or 3.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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):

  1. Prefer built-in user-input tools exposed by the current agent runtime — e.g., AskUserQuestion, request_user_input, clarify, ask_user, or any equivalent.
  2. 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.
  3. 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

  1. {baseDir} = this SKILL.md's directory; script = {baseDir}/scripts/main.ts
  2. ${BUN_X} = bun if installed; else npx -y bun if npx available; else suggest installing bun

Consent Requirement (before any conversion)

  1. 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
  2. accepted: true and disclaimerVersion: "1.0" → print Warning: Using reverse-engineered X API. Accepted on: <acceptedAt> and proceed.
  3. 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?
  4. Accept → write the consent file:
    {
      "version": 1,
      "accepted": true,
      "acceptedAt": "<ISO timestamp>",
      "disclaimerVersion": "1.0"
    }
  5. 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):

  1. Run without --download-media → markdown saved
  2. Check it for remote media (https:// image/video links); none → done, no prompt
  3. Otherwise ask (header "Media", question "Download N images/videos to local files?"): "Yes" — download to local directories / "No" — keep remote URLs
  4. Yes → rerun with --download-media (overwrites markdown with localized links)

Authentication

  1. Environment variables (preferred): X_AUTH_TOKEN, X_CT0
  2. Chrome login (fallback): auto-opens Chrome, caches cookies locally

Extension Support

Custom configurations via EXTEND.md — see Preferences above.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert18d5 checks · Risk SAFE
  • Gen Agent Trust Hub18d

    The skill converts X (Twitter) tweets and articles to Markdown by interacting with X's APIs. It manages session cookies locally and handles media downloads. Security analysis identified minor risks related to the ingestion of untrusted external content and the execution of environment-detection commands.

  • Socket18d

    2 alerts: gptSecurity, gptAnomaly

  • Snyk18d

    Risk: HIGH · 2 issues

  • Runlayer8mo

    7/21 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at bf1ff07. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago
version
1.117.3
Other metadata
metadata
{
  "openclaw": {
    "homepage": "https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown",
    "requires": {
      "anyBins": [
        "bun",
        "npx"
      ]
    }
  }
}
  • twitter
  • x
  • markdown
  • conversion
  • scraping
  • yaml-frontmatter
  • content-extraction
  • bun

README badge

README badge for jimliu/baoyu-skills/baoyu-danger-x-to-markdown

Converts X (Twitter) tweets and articles to markdown with YAML front matter, requiring user consent for the reverse-engineered API. Handles single tweets, threads, and X Articles, with optional local media download and configurable output directories.

Generated from the current SKILL.md.

Does this use the official X API?
No. This skill uses a reverse-engineered X API and is not official. It may break if X changes their API and carries risks including possible account restrictions.
What authentication methods are supported?
The skill accepts X_AUTH_TOKEN and X_CT0 environment variables, or falls back to auto-opening Chrome to cache cookies locally.
Can this download media from tweets?
Yes. You can configure it to always download, never download, or be prompted each time. Downloaded images and videos are saved to local dirs/ next to the markdown and links are rewritten as relative paths.
What URL formats does this support?
It supports x.com and twitter.com tweet URLs (format: /user/status/id), and X Articles (format: /i/article/id).
Does this require user consent before running?
Yes. On first use, the skill displays a disclaimer about the reverse-engineered API and requires explicit acceptance before conversion. Consent is cached locally.

Generated from the current SKILL.md. These answers refresh after source changes.