baoyu-danger-x-to-markdown
🤖 AI Summary
Converts X (Twitter) content—including tweets, threads, and articles—into structured Markdown with YAML front matter, extracting full content and metadata. It prioritizes built-in agent runtime user-input tools for interactive prompts, with a fallback to numbered plain-text questions.
How to Install
Claude Code:
git clone --depth 1 https://github.com/JimLiu/baoyu-skills.git && cp baoyu-skills/skills/baoyu-danger-x-to-markdown ~/.claude/skills/baoyu-danger-x-to-markdown -r# X to Markdown
Converts X content to markdown:
- Tweets/threads → Markdown with YAML front matter
- X Articles → Full content extraction
## 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
Scripts located in `scripts/` subdirectory.
**Path Resolution**:
1. `{baseDir}` = this SKILL.md's directory
2. Script path = `{baseDir}/scripts/main.ts`
3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun
## Consent Requirement
**Before any conversion**, check and obtain consent.
### Consent Flow
**Step 1**: Check consent file
```bash
# macOS
cat ~/Library/Application\ Support/baoyu-skills/x-to-markdown/consent.json
# Linux
cat ~/.local/share/baoyu-skills/x-to-markdown/consent.json
```
**Step 2**: If `accepted: true` and `disclaimerVersion: "1.0"` → print warning and proceed:
```
Warning: Using reverse-engineered X API. Accepted on:
```
**Step 3**: If missing or version mismatch → display disclaimer:
```
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?
```
Use `AskUserQuestion` with options: "Yes, I accept" | "No, I decline"
**Step 4**: On accept → create consent file:
```json
{
"version": 1,
"accepted": true,
"acceptedAt": "",
"disclaimerVersion": "1.0"
}
```
**Step 5**: On decline → output "User declined. Exiting." and stop.
## Preferences (EXTEND.md)
Check EXTEND.md in priority order — the 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 |
| Result | Action |
|--------|--------|
| Found | Read, parse, apply settings |
| Not found | **MUST** run first-time setup (see below) — do NOT silently create defaults |
**EXTEND.md supports**: Download media by default, default output directory.
### First-Time Setup (BLOCKING)
**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their
Details
| Category | AI/ML → ml |
| Source | JimLiu/baoyu-skills |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 22.3K |
| Est. per Skill | N/A (shared across 21 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | N/A |
Related Skills
agentfolio
AgentFolio Role: Autonomous Agent Discovery Guide Use this skill when you want to discover, compare,
auri-core
Auri - Core Product Skill Overview Auri: assistente de voz inteligente (Alexa + Claude claude-opus-4
pptx-official
PPTX creation, editing, and analysis Overview A user may ask you to create, edit, or analyze the con
seo-fundamentals
SEO Fundamentals Foundational principles for sustainable search visibility. This skill explains how
Works Well With
Skills from the same repository — often designed to work together
baoyu-article-illustrator
Article Illustrator Analyze articles, identify illustration positions, generate images with Type × S
baoyu-comic
Knowledge Comic Creator Create original knowledge comics with flexible art style × tone combinations
baoyu-compress-image
Image Compressor Compresses images using best available tool (sips → cwebp → ImageMagick → Sharp). S