jimliu/baoyu-skills

baoyu-danger-x-to-markdown

Converts X (Twitter) tweets and articles to markdown with YAML front matter.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-danger-x-to-markdown

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 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):

  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
  1. accepted: true and disclaimerVersion: "1.0" → print Warning: Using reverse-engineered X API. Accepted on: <acceptedAt> and proceed.
  2. 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?
  1. Accept → write the consent file:
json
   {
     "version": 1,
     "accepted": true,
     "acceptedAt": "<ISO timestamp>",
     "disclaimerVersion": "1.0"
   }
  1. Decline → output "User declined. Exiting." and stop.

Preferences (EXTEND.md)

First one found wins:

PriorityPathScope
1.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.mdProject
2${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.mdXDG
3$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.mdUser 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.

KeyDefaultValues
download_mediaaskask (prompt each time) / 1 (always) / 0 (never)
default_output_dirempty (= ./x-to-markdown/)path or empty

Value priority: CLI arguments (--download-media, -o) → EXTEND.md → skill defaults.

Usage

bash
${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
OptionDescription
<url>Tweet or article URL
-o <path>Output path
--jsonJSON output
--download-mediaDownload images/videos to local imgs/ and videos/ next to the markdown, rewrite links to local relative paths
--loginRefresh cookies only

Supported URLs: https://x.com/<user>/status/<id>, https://twitter.com/<user>/status/<id>, https://x.com/i/article/<id>

Output

markdown
---
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.

같은 저장소의 Skills

더 많은 Skills

모든 Skills
jimliu
커뮤니티

baoyu-compress-image

Compresses images to WebP (default) or PNG with automatic tool selection. Use when user asks to "compress image", "optimize image", "convert to webp", or reduce image file size.

1시간 설치 수
6
GitHub Stars
2.7만
업데이트
11월 1일
jimliu
커뮤니티

baoyu-url-to-markdown

Fetch any URL and convert to markdown using baoyu-fetch CLI (Chrome CDP with site-specific adapters). Built-in adapters for X/Twitter, YouTube transcripts, Hacker News threads, and generic pages via Defuddle. Handles login/CAPTCHA via interaction wait modes. Use when user wants to save a webpage as markdown.

1시간 설치 수
6
GitHub Stars
2.7만
업데이트
11월 1일
jimliu
커뮤니티

baoyu-comic

Knowledge comic creator supporting multiple art styles and tones. Creates original educational comics with detailed panel layouts and batch-capable image generation. Use when user asks to create "知识漫画", "教育漫画", "biography comic", "tutorial comic", or "Logicomix-style comic".

1시간 설치 수
5
GitHub Stars
2.7만
업데이트
11월 1일
jimliu
커뮤니티

baoyu-cover-image

Generates article cover images with 5 dimensions (type, palette, rendering, text, mood) combining 11 color palettes and 7 rendering styles. Supports cinematic (2.35:1), widescreen (16:9), and square (1:1) aspects. Use when user asks to "generate cover image", "create article cover", or "make cover".

1시간 설치 수
6
GitHub Stars
2.7만
업데이트
11월 1일