baoyu-danger-x-to-markdown
Skill này làm gì
Skill này chuyển tweet, chuỗi tweet và X Article thành file markdown dễ đọc. Skill dành cho người muốn giữ hoặc lưu trữ bài đăng từ X.
Khi nào nên dùng
- ✓Khi bạn muốn lưu một tweet hoặc chuỗi tweet thành file markdown.
- ✓Khi bạn có một X Article muốn giữ dưới dạng văn bản dễ đọc.
- ✓Khi bạn có một liên kết x.com hoặc twitter.com muốn chuyển đổi.
Liên kết skill
https://github.com/JimLiu/baoyu-skills/blob/main/skills/baoyu-danger-x-to-markdown/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Lưu chuỗi tweet này thành file markdown, với ngày và tác giả nằm trong phần đầu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent của bạn kiểm tra bạn đã chấp nhận điều khoản đồng ý chưa, lấy bài đăng qua một kết nối X được dịch ngược, rồi ghi nó ra markdown kèm phần đầu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Vì sao cần đồng ý?
Skill dùng một kết nối X được dịch ngược, nên lần đầu tiên nó yêu cầu bạn chấp nhận điều khoản.
File gồm những gì?
File có phần YAML front matter ở đầu với thông tin về bài đăng, theo sau là nội dung.
Skill có lưu toàn bộ X Article không?
Có. Skill chuyển X Article thành toàn bộ nội dung, cũng như tweet và chuỗi tweet.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 27k
- Vị trí xếp hạng
- #9953
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
release-skills
27kHướng dẫn agent của bạn qua quy trình phát hành cho mọi dự án: tăng số phiên bản, cập nhật changelog và xuất bản bản phát hành hoặc thẻ trên GitHub.
baoyu-article-illustrator
27kGiúp agent của bạn minh họa bài viết bằng cách tìm những chỗ cần hình ảnh và tạo ảnh theo một phong cách nhất quán.
baoyu-comic
27kCho agent của bạn cách tạo truyện tranh giáo dục có khung, phong cách vẽ và giọng điệu khác nhau, chẳng hạn như tiểu sử hoặc hướng dẫn.
baoyu-compress-image
27kCho phép agent của bạn thu nhỏ file ảnh bằng cách chuyển sang WebP hoặc PNG với tự động chọn công cụ, để ảnh tải nhanh hơn.
Skill tương tự
tavily
394kGiúp agent của bạn tìm kiếm web bằng Tavily và lấy văn bản từ các trang cụ thể, với tùy chọn về độ sâu, tên miền và ngày tháng.
blogwatcher
394kCho phép agent của bạn theo dõi blog và nguồn cấp RSS hoặc Atom, kiểm tra bài viết mới và đánh dấu những bài bạn đã đọc.
data-scraper-agent
280kGiúp agent tự động thu thập dữ liệu từ mọi nguồn công khai. Có thể lên lịch, bổ sung thông tin và lưu kết quả. Hữu ích để theo dõi dữ liệu trực tuyến.