{"id":"617c031b-6c20-45e6-956e-e6f72b1e9fc5","entityType":"agent","slug":"clawhub-jimliu-baoyu-danger-x-to-markdown","name":"Baoyu Danger X To Markdown","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jimliu-baoyu-danger-x-to-markdown","canonicalPath":"/agent/clawhub-jimliu-baoyu-danger-x-to-markdown","generatedAt":"2026-10-10T01:52:06.397Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":null},"description":"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... Skill: Baoyu Danger X To Markdown Owner: jimliu Summary: 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... Tags: latest:1.117.3 Version history: v1.117.3 | 2026-06-01T03:30:59.320Z | user Fix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1. v1.117.2 | 2026-05-18T02:14:14.865Z","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.6K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-danger-x-to-markdown","sourceUrl":"https://clawhub.ai/jimliu/baoyu-danger-x-to-markdown","homepage":"https://clawhub.ai/jimliu/skills/baoyu-danger-x-to-markdown","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jimliu/baoyu-danger-x-to-markdown","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jimliu/skills/baoyu-danger-x-to-markdown","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":57,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"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..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":null},"stars":null,"forks":null,"downloads":2587,"packageName":null,"latestVersion":"1.117.3","tractionLabel":"2.6K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T13:11:00.020Z","lastCrawledAt":"2026-10-09T13:11:00.020Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T13:11:00.020Z","lastVerifiedAt":null,"highlights":[{"version":"1.117.3","createdAt":"2026-06-01T03:30:59.320Z","changelog":"Fix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1.","fileCount":22,"zipByteSize":41489},{"version":"1.117.2","createdAt":"2026-05-18T02:14:14.865Z","changelog":"## 1.117.2 - 2026-05-17 ### Documentation - `baoyu-cover-image`: ban programmatic text repair on generated bitmaps — disallow ImageMagick / Pillow / Canvas / SVG / HTML overlays to cover, rewrite, or replace title/subtitle text; regenerate from a corrected prompt or switch to a lower-text or no-title variant instead - `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-image-cards`, `baoyu-xhs-images`, `baoyu-infographic`, `baoyu-slide-deck`: sync the same text-repair ban with skill-specific text categories (labels/captions, dialogue/sound effects, titles/body/tags, headings/data values, slide titles/bullets)","fileCount":22,"zipByteSize":41537},{"version":"1.115.4","createdAt":"2026-05-11T23:48:21.762Z","changelog":"### Documentation - Image generation backend selection: emphasize Codex `imagegen` as the priority runtime-native tool (invoke via the `Skill` tool with `skill: \"imagegen\"`) and forbid SVG/HTML/canvas substitution when no raster backend can be resolved — fall through to asking the user instead of silently emitting code-based art. Updated in `docs/image-generation-tools.md` and inlined into `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-cover-image`, `baoyu-image-cards`, `baoyu-infographic`, `baoyu-slide-deck`, and `baoyu-xhs-images`.","fileCount":21,"zipByteSize":40245},{"version":"1.103.2","createdAt":"2026-04-21T22:01:46.255Z","changelog":"- Added explicit guidance on user input tools: prefer built-in agent tools (e.g., AskUserQuestion); fall back to plain-text prompts if unavailable. - Consolidated and simplified the EXTEND.md preferences path/priority table for clarity. - Removed duplicated or redundant OS-specific code snippets for EXTEND.md, referencing a concise priority order instead. - Clarified that any references to AskUserQuestion are illustrative; use the local equivalent in other runtimes. - Removed two files related to baoyu-chrome-cdp, cleaning up the scripts/vendor directory.","fileCount":21,"zipByteSize":40245},{"version":"1.103.1","createdAt":"2026-04-13T16:14:44.474Z","changelog":"## 1.103.1 - 2026-04-13 ### Fixes - `baoyu-markdown-to-html`: decode HTML entities and strip tags from article summary - `baoyu-post-to-weibo`: decode HTML entities and strip tags from article summary","fileCount":23,"zipByteSize":45458},{"version":"1.103.0","createdAt":"2026-04-13T01:19:46.058Z","changelog":"## 1.103.0 - 2026-04-12 ### Features - baoyu-diagram: add multi-diagram mode for article-wide diagram generation ### Fixes - baoyu-article-illustrator: prevent color names and hex codes from appearing as visible text in generated images - baoyu-cover-image: prevent color names and hex codes from appearing as visible text in generated images - baoyu-image-cards: prevent color names from appearing as visible text in generated images - baoyu-post-to-wechat: decode HTML entities and strip tags from article summary","fileCount":23,"zipByteSize":45457},{"version":"1.76.3","createdAt":"2026-04-09T16:26:30.237Z","changelog":"- Updated dependencies in scripts/vendor/baoyu-chrome-cdp/package.json. - Made code changes in scripts/cookies.ts and scripts/vendor/baoyu-chrome-cdp/src/index.ts. - Removed obsolete test file: scripts/vendor/baoyu-chrome-cdp/src/index.test.ts. - No changes to SKILL.md content or user-facing features.","fileCount":22,"zipByteSize":45162},{"version":"1.76.2","createdAt":"2026-03-25T21:31:40.288Z","changelog":"- Removed 10 files, including media assets (images and videos) and related sample markdowns. - Clean-up eliminates bundled example content from the repository. - No changes to core functionality or documentation.","fileCount":23,"zipByteSize":47809}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-danger-x-to-markdown","setupComplexity":"low","setupSteps":["Node.js workspace detected. Install dependencies securely: run `npm ci --ignore-scripts` to prevent post-install lifecycle triggers from running arbitrary code, then selectively audit the dependency tree.","Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T01:52:06.393Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-danger-x-to-markdown/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":null},"readme":"Skill: Baoyu Danger X To Markdown\n\nOwner: jimliu\n\nSummary: 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...\n\nTags: latest:1.117.3\n\nVersion history:\n\nv1.117.3 | 2026-06-01T03:30:59.320Z | user\n\nFix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1.\n\nv1.117.2 | 2026-05-18T02:14:14.865Z | user\n\n## 1.117.2 - 2026-05-17\n\n### Documentation\n- `baoyu-cover-image`: ban programmatic text repair on generated bitmaps — disallow ImageMagick / Pillow / Canvas / SVG / HTML overlays to cover, rewrite, or replace title/subtitle text; regenerate from a corrected prompt or switch to a lower-text or no-title variant instead\n- `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-image-cards`, `baoyu-xhs-images`, `baoyu-infographic`, `baoyu-slide-deck`: sync the same text-repair ban with skill-specific text categories (labels/captions, dialogue/sound effects, titles/body/tags, headings/data values, slide titles/bullets)\n\nv1.115.4 | 2026-05-11T23:48:21.762Z | user\n\n### Documentation\n- Image generation backend selection: emphasize Codex `imagegen` as the priority runtime-native tool (invoke via the `Skill` tool with `skill: \"imagegen\"`) and forbid SVG/HTML/canvas substitution when no raster backend can be resolved — fall through to asking the user instead of silently emitting code-based art. Updated in `docs/image-generation-tools.md` and inlined into `baoyu-article-illustrator`, `baoyu-comic`, `baoyu-cover-image`, `baoyu-image-cards`, `baoyu-infographic`, `baoyu-slide-deck`, and `baoyu-xhs-images`.\n\nv1.103.2 | 2026-04-21T22:01:46.255Z | auto\n\n- Added explicit guidance on user input tools: prefer built-in agent tools (e.g., AskUserQuestion); fall back to plain-text prompts if unavailable.\n- Consolidated and simplified the EXTEND.md preferences path/priority table for clarity.\n- Removed duplicated or redundant OS-specific code snippets for EXTEND.md, referencing a concise priority order instead.\n- Clarified that any references to AskUserQuestion are illustrative; use the local equivalent in other runtimes.\n- Removed two files related to baoyu-chrome-cdp, cleaning up the scripts/vendor directory.\n\nv1.103.1 | 2026-04-13T16:14:44.474Z | user\n\n## 1.103.1 - 2026-04-13\n\n### Fixes\n- `baoyu-markdown-to-html`: decode HTML entities and strip tags from article summary\n- `baoyu-post-to-weibo`: decode HTML entities and strip tags from article summary\n\nv1.103.0 | 2026-04-13T01:19:46.058Z | user\n\n## 1.103.0 - 2026-04-12\n\n### Features\n- baoyu-diagram: add multi-diagram mode for article-wide diagram generation\n\n### Fixes\n- baoyu-article-illustrator: prevent color names and hex codes from appearing as visible text in generated images\n- baoyu-cover-image: prevent color names and hex codes from appearing as visible text in generated images\n- baoyu-image-cards: prevent color names from appearing as visible text in generated images\n- baoyu-post-to-wechat: decode HTML entities and strip tags from article summary\n\nv1.76.3 | 2026-04-09T16:26:30.237Z | auto\n\n- Updated dependencies in scripts/vendor/baoyu-chrome-cdp/package.json.\n- Made code changes in scripts/cookies.ts and scripts/vendor/baoyu-chrome-cdp/src/index.ts.\n- Removed obsolete test file: scripts/vendor/baoyu-chrome-cdp/src/index.test.ts.\n- No changes to SKILL.md content or user-facing features.\n\nv1.76.2 | 2026-03-25T21:31:40.288Z | auto\n\n- Removed 10 files, including media assets (images and videos) and related sample markdowns.\n- Clean-up eliminates bundled example content from the repository.\n- No changes to core functionality or documentation.\n\nv1.76.1 | 2026-03-22T04:22:45.131Z | auto\n\n- Added or updated tests in scripts/markdown.test.ts.\n- No changes to core logic or user-facing features.\n- Documentation and version unchanged.\n\nv1.73.0 | 2026-03-19T02:56:46.297Z | user\n\n### Features\n- add video media support for X articles with poster image and video link rendering\n\nv1.72.0 | 2026-03-18T07:25:51.006Z | user\n\n## 1.72.0 - 2026-03-18\n\n### Features\n- `baoyu-danger-x-to-markdown`: add MARKDOWN entity support for rendering embedded markdown/code blocks in X articles\n\nv1.69.1 | 2026-03-16T18:00:45.430Z | user\n\n## 1.69.1 - 2026-03-16\n\n### Fixes\n- `baoyu-chrome-cdp`: tighten chrome auto-connect logic to reduce false positives\n\nv1.60.0 | 2026-03-12T03:45:07.162Z | user\n\n## 1.60.0 - 2026-03-11\n\n### Features\n- `baoyu-url-to-markdown`: support reusing existing Chrome CDP instances and fix port detection order\n\n### Fixes\n- `baoyu-post-to-x`: add missing `fs` import in x-article\n\n### Refactor\n- Unify all CDP skills to use shared `baoyu-chrome-cdp` package with vendored copies\n- Simplify CLAUDE.md, move detailed documentation to `docs/` directory\n- Publish skills directly from synced vendor, removing separate artifact preparation step\n\nv1.0.0 | 2026-03-09T16:12:34.285Z | auto\n\nInitial release with comprehensive consent and configuration flows:\n\n- Converts X (Twitter) tweets and articles to markdown with YAML front matter.\n- Requires explicit user consent due to the use of a reverse-engineered API.\n- Enforces a first-time blocking setup for media handling and output directory preferences, creating an EXTEND.md configuration file only after user input.\n- Supports media download options and configurable output paths.\n- Honors preferences set via CLI arguments, config file, or defaults, with priority clearly defined.\n- Provides clear consent, setup, and usage instructions for a safe and transparent experience.\n\nArchive index:\n\nArchive v1.117.3: 22 files, 41489 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (392b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (148b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), skill-card.md (2229b), SKILL.md (7389b), _meta.json (147b)\n\nFile v1.117.3:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.117.3\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply settings |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently create defaults |\n\n**EXTEND.md supports**: Download media by default, default output directory.\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.117.3:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.117.3\",\n  \"publishedAt\": 1780284659320\n}\n\nFile v1.117.3:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.117.3:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.1\"\n  }\n}\n\nFile v1.117.3:skill-card.md\n\n## Description:\n\nConverts X (Twitter) tweets, threads, and articles to Markdown with YAML front matter using a disclosed reverse-engineered API flow that requires user consent.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jimliu](https://clawhub.ai/user/jimliu)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent users use this skill to save X posts, threads, and articles as local Markdown files for review, archiving, or downstream writing workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles live X session cookies.\n\nMitigation: Use a dedicated X account or Chrome profile, avoid shared or synced cookie storage, and rotate or revoke X sessions after use.\n\nRisk: Media downloads can fetch files from content the user did not author.\n\nMitigation: Avoid --download-media for untrusted content until URL allowlisting, download limits, and safer cookie storage are added.\n\nRisk: The converter uses a reverse-engineered X API rather than an official API.\n\nMitigation: Require the documented consent flow before conversion and warn users that the API may break or affect account access.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/jimliu/skills/baoyu-danger-x-to-markdown)\n- [Baoyu skills homepage](https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown)\n- [First-time setup reference](references/config/first-time-setup.md)\n\n## Skill Output:\n\n**Output Type(s):** [Markdown, Text, JSON, Files, Shell commands, Configuration guidance]\n\n**Output Format:** [Markdown files with YAML front matter, optional JSON status output, and shell commands for running the converter.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can optionally download referenced media to local imgs/ and videos/ directories and rewrite Markdown links.]\n\n## Skill Version(s):\n\n1.117.3 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.117.2: 22 files, 41537 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (392b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (148b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), skill-card.md (2461b), SKILL.md (7388b), _meta.json (147b)\n\nFile v1.117.2:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply settings |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently create defaults |\n\n**EXTEND.md supports**: Download media by default, default output directory.\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.117.2:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.117.2\",\n  \"publishedAt\": 1779070454865\n}\n\nFile v1.117.2:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.117.2:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.0\"\n  }\n}\n\nFile v1.117.2:skill-card.md\n\n## Description: <br>\nConverts 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. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[jimliu](https://clawhub.ai/user/jimliu) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, writers, researchers, and content archivists use this skill to convert X/Twitter tweets, threads, and articles into Markdown files with YAML front matter, optionally localizing images and videos. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill handles live X/Twitter session cookies and may cache them locally. <br>\nMitigation: Use a dedicated or low-risk X account, avoid shared machines, do not print tokens, and delete the saved cookie file when finished. <br>\nRisk: The skill uses reverse-engineered X APIs that may break or trigger account restrictions if X changes behavior. <br>\nMitigation: Require explicit user consent before conversion and review the disclaimer before use. <br>\nRisk: Media downloading fetches files from tweet or article media sources. <br>\nMitigation: Download media only when the source content is trusted, or keep remote media links instead. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/jimliu/baoyu-danger-x-to-markdown) <br>\n- [Project homepage](https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown) <br>\n- [First-time setup reference](references/config/first-time-setup.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Markdown, Files, Configuration, Shell commands, JSON] <br>\n**Output Format:** [Markdown files with YAML front matter, optional localized media files, and optional JSON output] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires an X/Twitter URL and may require X session cookies through environment variables or Chrome login.] <br>\n\n## Skill Version(s): <br>\n1.117.2 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.115.4: 21 files, 40245 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (392b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (148b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), SKILL.md (7388b), _meta.json (147b)\n\nFile v1.115.4:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply settings |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently create defaults |\n\n**EXTEND.md supports**: Download media by default, default output directory.\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.115.4:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.115.4\",\n  \"publishedAt\": 1778543301762\n}\n\nFile v1.115.4:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.115.4:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.0\"\n  }\n}\n\nArchive v1.103.2: 21 files, 40245 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (392b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (148b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), SKILL.md (7388b), _meta.json (147b)\n\nFile v1.103.2:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | User home |\n\n| Result | Action |\n|--------|--------|\n| Found | Read, parse, apply settings |\n| Not found | **MUST** run first-time setup (see below) — do NOT silently create defaults |\n\n**EXTEND.md supports**: Download media by default, default output directory.\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.103.2:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.103.2\",\n  \"publishedAt\": 1776808906255\n}\n\nFile v1.103.2:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.103.2:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.0\"\n  }\n}\n\nArchive v1.103.1: 23 files, 45458 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (336b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (172b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), scripts/vendor/baoyu-chrome-cdp/package.json (168b), scripts/vendor/baoyu-chrome-cdp/src/index.ts (17982b), SKILL.md (9461b), _meta.json (147b)\n\nFile v1.103.1:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md existence (priority order):\n\n```bash\n# macOS, Linux, WSL, Git Bash\ntest -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo \"project\"\ntest -f \"${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"xdg\"\ntest -f \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"user\"\n```\n\n```powershell\n# PowerShell (Windows)\nif (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { \"project\" }\n$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { \"$HOME/.config\" }\nif (Test-Path \"$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"xdg\" }\nif (Test-Path \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"user\" }\n```\n\n┌────────────────────────────────────────────────────────────┬───────────────────┐\n│                            Path                            │     Location      │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md         │ Project directory │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md   │ User home         │\n└────────────────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ **MUST** run first-time setup (see below) — do NOT silently create defaults │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Download media by default | Default output directory\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.103.1:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.103.1\",\n  \"publishedAt\": 1776096884474\n}\n\nFile v1.103.1:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.103.1:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"file:./vendor/baoyu-chrome-cdp\"\n  }\n}\n\nFile v1.103.1:scripts/vendor/baoyu-chrome-cdp/package.json\n\n{\n  \"name\": \"baoyu-chrome-cdp\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"files\": [\n    \"src\"\n  ],\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }\n}\n\nArchive v1.103.0: 23 files, 45457 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (336b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (172b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), scripts/vendor/baoyu-chrome-cdp/package.json (168b), scripts/vendor/baoyu-chrome-cdp/src/index.ts (17982b), SKILL.md (9461b), _meta.json (147b)\n\nFile v1.103.0:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md existence (priority order):\n\n```bash\n# macOS, Linux, WSL, Git Bash\ntest -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo \"project\"\ntest -f \"${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"xdg\"\ntest -f \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"user\"\n```\n\n```powershell\n# PowerShell (Windows)\nif (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { \"project\" }\n$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { \"$HOME/.config\" }\nif (Test-Path \"$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"xdg\" }\nif (Test-Path \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"user\" }\n```\n\n┌────────────────────────────────────────────────────────────┬───────────────────┐\n│                            Path                            │     Location      │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md         │ Project directory │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md   │ User home         │\n└────────────────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ **MUST** run first-time setup (see below) — do NOT silently create defaults │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Download media by default | Default output directory\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.103.0:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.103.0\",\n  \"publishedAt\": 1776043186058\n}\n\nFile v1.103.0:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.103.0:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"file:./vendor/baoyu-chrome-cdp\"\n  }\n}\n\nFile v1.103.0:scripts/vendor/baoyu-chrome-cdp/package.json\n\n{\n  \"name\": \"baoyu-chrome-cdp\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"files\": [\n    \"src\"\n  ],\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }\n}\n\nArchive v1.76.3: 22 files, 45162 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9537b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (172b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), scripts/vendor/baoyu-chrome-cdp/package.json (168b), scripts/vendor/baoyu-chrome-cdp/src/index.ts (17982b), SKILL.md (9461b), _meta.json (146b)\n\nFile v1.76.3:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md existence (priority order):\n\n```bash\n# macOS, Linux, WSL, Git Bash\ntest -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo \"project\"\ntest -f \"${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"xdg\"\ntest -f \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"user\"\n```\n\n```powershell\n# PowerShell (Windows)\nif (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { \"project\" }\n$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { \"$HOME/.config\" }\nif (Test-Path \"$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"xdg\" }\nif (Test-Path \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"user\" }\n```\n\n┌────────────────────────────────────────────────────────────┬───────────────────┐\n│                            Path                            │     Location      │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md         │ Project directory │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md   │ User home         │\n└────────────────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ **MUST** run first-time setup (see below) — do NOT silently create defaults │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Download media by default | Default output directory\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.76.3:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.76.3\",\n  \"publishedAt\": 1775751990237\n}\n\nFile v1.76.3:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.76.3:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"file:./vendor/baoyu-chrome-cdp\"\n  }\n}\n\nFile v1.76.3:scripts/vendor/baoyu-chrome-cdp/package.json\n\n{\n  \"name\": \"baoyu-chrome-cdp\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"files\": [\n    \"src\"\n  ],\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }\n}\n\nArchive v1.76.2: 23 files, 47809 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9626b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (172b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), scripts/vendor/baoyu-chrome-cdp/package.json (140b), scripts/vendor/baoyu-chrome-cdp/src/index.test.ts (9557b), scripts/vendor/baoyu-chrome-cdp/src/index.ts (17190b), SKILL.md (9461b), _meta.json (146b)\n\nFile v1.76.2:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md existence (priority order):\n\n```bash\n# macOS, Linux, WSL, Git Bash\ntest -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo \"project\"\ntest -f \"${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"xdg\"\ntest -f \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"user\"\n```\n\n```powershell\n# PowerShell (Windows)\nif (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { \"project\" }\n$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { \"$HOME/.config\" }\nif (Test-Path \"$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"xdg\" }\nif (Test-Path \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"user\" }\n```\n\n┌────────────────────────────────────────────────────────────┬───────────────────┐\n│                            Path                            │     Location      │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md         │ Project directory │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md   │ User home         │\n└────────────────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ **MUST** run first-time setup (see below) — do NOT silently create defaults │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Download media by default | Default output directory\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.76.2:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.76.2\",\n  \"publishedAt\": 1774474300288\n}\n\nFile v1.76.2:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.76.2:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"file:./vendor/baoyu-chrome-cdp\"\n  }\n}\n\nFile v1.76.2:scripts/vendor/baoyu-chrome-cdp/package.json\n\n{\n  \"name\": \"baoyu-chrome-cdp\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }\n}\n\nArchive v1.76.1: 33 files, 7854628 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (314b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9626b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4804b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (172b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), scripts/vendor/baoyu-chrome-cdp/package.json (140b), scripts/vendor/baoyu-chrome-cdp/src/index.test.ts (9557b), scripts/vendor/baoyu-chrome-cdp/src/index.ts (17190b), SKILL.md (9461b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-001-HDkjCxZXsAAuC9i.jpg (270873b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-002-DtZq1ovv4Ro2ag23.jpg (245026b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-003-HDkaT1IWwAAszMV.jpg (78856b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-004-HDke0dcWgAAG9tQ.jpg (28281b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-005-HDkbF5LWIAAkYIu.jpg (128301b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-006-GK_zFor61umELZW6.jpg (7652b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/videos/video-001-EuYCBNNbumgIE_x.mp4 (3862535b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/videos/video-002-ZxTQLrLJPAXY86tj.mp4 (3352724b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/we-turned-openclaw-into-a-self-improving-vibe-marketer-for-o.md (5459b), _meta.json (146b)\n\nFile v1.76.1:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md existence (priority order):\n\n```bash\n# macOS, Linux, WSL, Git Bash\ntest -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo \"project\"\ntest -f \"${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"xdg\"\ntest -f \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"user\"\n```\n\n```powershell\n# PowerShell (Windows)\nif (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { \"project\" }\n$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { \"$HOME/.config\" }\nif (Test-Path \"$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"xdg\" }\nif (Test-Path \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"user\" }\n```\n\n┌────────────────────────────────────────────────────────────┬───────────────────┐\n│                            Path                            │     Location      │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md         │ Project directory │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md   │ User home         │\n└────────────────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ **MUST** run first-time setup (see below) — do NOT silently create defaults │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Download media by default | Default output directory\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.76.1:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.76.1\",\n  \"publishedAt\": 1774153365131\n}\n\nFile v1.76.1:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.76.1:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"file:./vendor/baoyu-chrome-cdp\"\n  }\n}\n\nFile v1.76.1:scripts/vendor/baoyu-chrome-cdp/package.json\n\n{\n  \"name\": \"baoyu-chrome-cdp\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }\n}\n\nFile v1.76.1:x-to-markdown/ErnestoSOFTWARE/2033917717762191659/we-turned-openclaw-into-a-self-improving-vibe-marketer-for-o.md\n\n---\nurl: \"https://x.com/ErnestoSOFTWARE/status/2033917717762191659\"\nrequestedUrl: \"https://x.com/ErnestoSOFTWARE/status/2033917717762191659\"\nauthor: \"Ernesto Lopez (@ErnestoSOFTWARE)\"\nauthorName: \"Ernesto Lopez\"\nauthorUsername: \"ErnestoSOFTWARE\"\nauthorUrl: \"https://x.com/ErnestoSOFTWARE\"\ntweetCount: 1\ncoverImage: \"imgs/img-001-HDkjCxZXsAAuC9i.jpg\"\n---\n\n# We turned Openclaw into a self improving vibe marketer for our $300,000/yr app.\n\n1 of our apps does $300,000/yr, we scaled this app with literally only 4 winning ad creatives using tiktok spark ads, and currently we are scaling to $1m/y with an ad system that runs autonomously by our Openclaw agent Eddie. \n\nthe reason we delegated our ad cretion porccess to eddie is becuase \n\neven though @maubaron and I cracked gold with 4 ads that fueled the whole growth of the app, they eventually burnt out. \n\nand no longer produce the same results. thats the reality of ads.\nthey usually last 1-2 months\n\nalso making new winning ads is time consuming. \n\nand thats why we outsourced our whole ad creation system to Eddie \nusing Arcads + Apify + the insane brain of markup files we created for him. \n\nhere is exactly how the whole system works:\n\n![Eddies beautiful brain](imgs/img-002-DtZq1ovv4Ro2ag23.jpg)\n[video](videos/video-001-EuYCBNNbumgIE_x.mp4)\n\n## Part 1: Eddie researches our competitors automatically\n\n![](imgs/img-003-HDkaT1IWwAAszMV.jpg)\n\nEddie has a custom skill called ad-research.\nit uses Apify to scrape the Meta Ad Library directly.\n\nyou give it a keyword or an advertisers name ( whatever your niche is.)\n\nEddie pulls every active video ad running in that niche right now.\n10, 20, 50 ads and sorts them from oldest to newest\n\nOlder ads usually means more profitable. \nthen he downloads the actual video files from fbcdn.\n\nthen he runs every single video through OpenAI Whisper.\nword for word transcription.\n\n\nhe grabs every hook and breaks down every video.\nEddie runs this for every competitor in the niche\n\n\nby the end you have a full intel dump of what angles work \n\n## Part 2: Eddie learns your brand voice\n\nmost AI tools generate scripts and the scripts read like a marketing blog. \nSuper generic and no personality. \n\nEddie runs on .md files.\nmarkdown files that define exactly how to write.\n\nwriting-rules.md is the anti-AI filter.\n\nit bans every word that AI overuses.\n\nhe is trained on this wikipedia article: \n[https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing)\n\nThis completely avoids all AI slop.\nalso here is another prompt that works\n\n\nthen there is the brand voice file.\nwhich is trained on our influencer videos \n\nAnd split into 3 files\n[Voice.md](http://voice.md/)\n[product.md](http://product.md/)\n[icp.md](http://icp.md/) \n\neddie know how to talk like someone in our niche\nhe knows exactly what the product does\nand he knows exactly who needs it\n\nEddie loads both files before writing a single word.\n\nevery script comes out in our voice.\n\nwith our positioning.\n\nwith our specific product facts baked in.\n\n## Part 3: Eddie generates 100s of script variations\n\nfrom the competitor research, Eddie writes original scripts.\nfor every competitor ad it found, it generates 2 outputs:\n\n\n![](imgs/img-004-HDke0dcWgAAG9tQ.jpg)\n\n→ the original competitor script (body copy + transcript + angle breakdown)\n\n→ a rewrite (same angle, same structure, our product and our voice )\n\nso if Eddie scraped 30 competitor ads across 5 competitors, thats 30 rewrites.\n\neach one in our voice. then we have the multiplier which is the ICP\n\nwe multiply the ads by the different icp ( ideal customer profiles ) that we know would buy and use our app. \n\neach one built on a proven angle.\nthen Eddie generates variations on the top performers.\n\n50, 80, 100 variations.\n\none session.\nall built on competitor data.\n\nall in Prayer Lock's voice.\n\n## Part 4: split between creators and Arcads\n\nthe best scripts go two places.\n\n1. to our UGC creators.\n\nEddie sends them the top 10-15 scripts + the refference video from competitors.\n\nthey film them. we pay $15-50/video.\n\n2. the rest go to Arcads via API.\n\nEddie pushes scripts directly into Arcads.\nArcads has 300+ AI actors + the ones we have made ourself\n\nEddie triggers the renders.\nand makes thousands of ads in a few minutes\n\n![example of one of our generations](imgs/img-005-HDkbF5LWIAAkYIu.jpg)\n\nsame script → 5 different actors.\nsame actor → 10 different hooks.\nwe get back 50+ finished video ads.\n\nheres an example of how it looks \n\n![video](imgs/img-006-GK_zFor61umELZW6.jpg)\n[video](videos/video-002-ZxTQLrLJPAXY86tj.mp4)\n\ncombined with our creators, we are testing 100+ creatives per month.\nwe let meta handle which creatives to push\n\nbut wait.. it gets even crazier\n\n## Part 5: the self improvement  loop\n\nafter the ads run, performance data goes back into Eddie via singulars api\nWhich is the mmp that we use.\n\nhe analyzes which ads had the best CPA\ndoubles down on that creative direction\n\nAnd makes a mental note on what works best.\n\nthen on the next run he generates a new batch based on the winners.generate → evaluate → regenerate.\n\nthe system gets better on every cycle.\n\nthe whole pipeline runs mostly without us, \nand we are still refining this systme\n\nwe are running one of the very first vibe advertising eco-systems in the app space. \n\nthank you arcads for sponsoring our experiments, try it out here\nhttp://www.arcads.ai/?comet_custom=ernestoSOFTWARE\n\nArchive v1.73.0: 33 files, 7854615 bytes\n\nFiles: references/config/first-time-setup.md (2491b), scripts/bun.lock (314b), scripts/constants.ts (6708b), scripts/cookie-file.ts (2449b), scripts/cookies.ts (9626b), scripts/graphql.ts (12854b), scripts/http.ts (3527b), scripts/main.ts (19074b), scripts/markdown.test.ts (4737b), scripts/markdown.ts (21046b), scripts/media-localizer.ts (10440b), scripts/package.json (172b), scripts/paths.ts (2233b), scripts/referenced-tweets.ts (2261b), scripts/thread-markdown.ts (8212b), scripts/thread.ts (8942b), scripts/tweet-article.ts (2936b), scripts/tweet-to-markdown.ts (6393b), scripts/types.ts (1526b), scripts/vendor/baoyu-chrome-cdp/package.json (140b), scripts/vendor/baoyu-chrome-cdp/src/index.test.ts (9557b), scripts/vendor/baoyu-chrome-cdp/src/index.ts (17190b), SKILL.md (9461b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-001-HDkjCxZXsAAuC9i.jpg (270873b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-002-DtZq1ovv4Ro2ag23.jpg (245026b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-003-HDkaT1IWwAAszMV.jpg (78856b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-004-HDke0dcWgAAG9tQ.jpg (28281b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-005-HDkbF5LWIAAkYIu.jpg (128301b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/imgs/img-006-GK_zFor61umELZW6.jpg (7652b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/videos/video-001-EuYCBNNbumgIE_x.mp4 (3862535b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/videos/video-002-ZxTQLrLJPAXY86tj.mp4 (3352724b), x-to-markdown/ErnestoSOFTWARE/2033917717762191659/we-turned-openclaw-into-a-self-improving-vibe-marketer-for-o.md (5459b), _meta.json (146b)\n\nFile v1.73.0:SKILL.md\n\n---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.56.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md existence (priority order):\n\n```bash\n# macOS, Linux, WSL, Git Bash\ntest -f .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md && echo \"project\"\ntest -f \"${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"xdg\"\ntest -f \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\" && echo \"user\"\n```\n\n```powershell\n# PowerShell (Windows)\nif (Test-Path .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md) { \"project\" }\n$xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { \"$HOME/.config\" }\nif (Test-Path \"$xdg/baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"xdg\" }\nif (Test-Path \"$HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md\") { \"user\" }\n```\n\n┌────────────────────────────────────────────────────────────┬───────────────────┐\n│                            Path                            │     Location      │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md         │ Project directory │\n├────────────────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md   │ User home         │\n└────────────────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ **MUST** run first-time setup (see below) — do NOT silently create defaults │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Download media by default | Default output directory\n\n### First-Time Setup (BLOCKING)\n\n**CRITICAL**: When EXTEND.md is not found, you **MUST use `AskUserQuestion`** to ask the user for their preferences before creating EXTEND.md. **NEVER** create EXTEND.md with defaults without asking. This is a **BLOCKING** operation — do NOT proceed with any conversion until setup is complete.\n\nUse `AskUserQuestion` with ALL questions in ONE call:\n\n**Question 1** — header: \"Media\", question: \"How to handle images and videos in tweets?\"\n- \"Ask each time (Recommended)\" — After saving markdown, ask whether to download media\n- \"Always download\" — Always download media to local imgs/ and videos/ directories\n- \"Never download\" — Keep original remote URLs in markdown\n\n**Question 2** — header: \"Output\", question: \"Default output directory?\"\n- \"x-to-markdown (Recommended)\" — Save to ./x-to-markdown/{username}/{tweet-id}.md\n- (User may choose \"Other\" to type a custom path)\n\n**Question 3** — header: \"Save\", question: \"Where to save preferences?\"\n- \"User (Recommended)\" — ~/.baoyu-skills/ (all projects)\n- \"Project\" — .baoyu-skills/ (this project only)\n\nAfter user answers, create EXTEND.md at the chosen location, confirm \"Preferences saved to [path]\", then continue.\n\nFull reference: [references/config/first-time-setup.md](references/config/first-time-setup.md)\n\n### Supported Keys\n\n| Key | Default | Values | Description |\n|-----|---------|--------|-------------|\n| `download_media` | `ask` | `ask` / `1` / `0` | `ask` = prompt each time, `1` = always download, `0` = never |\n| `default_output_dir` | empty | path or empty | Default output directory (empty = `./x-to-markdown/`) |\n\n**Value priority**:\n1. CLI arguments (`--download-media`, `-o`)\n2. EXTEND.md\n3. Skill defaults\n\n## Usage\n\n```bash\n${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `<url>` | Tweet or article URL |\n| `-o <path>` | Output path |\n| `--json` | JSON output |\n| `--download-media` | Download image/video assets to local `imgs/` and `videos/`, and rewrite markdown links to local relative paths |\n| `--login` | Refresh cookies only |\n\n## Supported URLs\n\n- `https://x.com/<user>/status/<id>`\n- `https://twitter.com/<user>/status/<id>`\n- `https://x.com/i/article/<id>`\n\n## Output\n\n```markdown\n---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent...\n```\n\n**File structure**: `x-to-markdown/{username}/{tweet-id}/{content-slug}.md`\n\nWhen `--download-media` is enabled:\n- Images are saved to `imgs/` next to the markdown file\n- Videos are saved to `videos/` next to the markdown file\n- Markdown media links are rewritten to local relative paths\n\n## Media Download Workflow\n\nBased on `download_media` setting in EXTEND.md:\n\n| Setting | Behavior |\n|---------|----------|\n| `1` (always) | Run script with `--download-media` flag |\n| `0` (never) | Run script without `--download-media` flag |\n| `ask` (default) | Follow the ask-each-time flow below |\n\n### Ask-Each-Time Flow\n\n1. Run script **without** `--download-media` → markdown saved\n2. Check saved markdown for remote media URLs (`https://` in image/video links)\n3. **If no remote media found** → done, no prompt needed\n4. **If remote media found** → use `AskUserQuestion`:\n   - header: \"Media\", question: \"Download N images/videos to local files?\"\n   - \"Yes\" — Download to local directories\n   - \"No\" — Keep remote URLs\n5. If user confirms → run script **again** with `--download-media` (overwrites markdown with localized links)\n\n## Authentication\n\n1. **Environment variables** (preferred): `X_AUTH_TOKEN`, `X_CT0`\n2. **Chrome login** (fallback): Auto-opens Chrome, caches cookies locally\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.73.0:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.73.0\",\n  \"publishedAt\": 1773889006297\n}\n\nFile v1.73.0:references/config/first-time-setup.md\n\n---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again.\n\nFile v1.73.0:scripts/package.json\n\n{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"file:./vendor/baoyu-chrome-cdp\"\n  }\n}\n\nFile v1.73.0:scripts/vendor/baoyu-chrome-cdp/package.json\n\n{\n  \"name\": \"baoyu-chrome-cdp\",\n  \"private\": true,\n  \"version\": \"0.1.0\",\n  \"type\": \"module\",\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  }\n}\n\nFile v1.73.0:x-to-markdown/ErnestoSOFTWARE/2033917717762191659/we-turned-openclaw-into-a-self-improving-vibe-marketer-for-o.md\n\n---\nurl: \"https://x.com/ErnestoSOFTWARE/status/2033917717762191659\"\nrequestedUrl: \"https://x.com/ErnestoSOFTWARE/status/2033917717762191659\"\nauthor: \"Ernesto Lopez (@ErnestoSOFTWARE)\"\nauthorName: \"Ernesto Lopez\"\nauthorUsername: \"ErnestoSOFTWARE\"\nauthorUrl: \"https://x.com/ErnestoSOFTWARE\"\ntweetCount: 1\ncoverImage: \"imgs/img-001-HDkjCxZXsAAuC9i.jpg\"\n---\n\n# We turned Openclaw into a self improving vibe marketer for our $300,000/yr app.\n\n1 of our apps does $300,000/yr, we scaled this app with literally only 4 winning ad creatives using tiktok spark ads, and currently we are scaling to $1m/y with an ad system that runs autonomously by our Openclaw agent Eddie. \n\nthe reason we delegated our ad cretion porccess to eddie is becuase \n\neven though @maubaron and I cracked gold with 4 ads that fueled the whole growth of the app, they eventually burnt out. \n\nand no longer produce the same results. thats the reality of ads.\nthey usually last 1-2 months\n\nalso making new winning ads is time consuming. \n\nand thats why we outsourced our whole ad creation system to Eddie \nusing Arcads + Apify + the insane brain of markup files we created for him. \n\nhere is exactly how the whole system works:\n\n![Eddies beautiful brain](imgs/img-002-DtZq1ovv4Ro2ag23.jpg)\n[video](videos/video-001-EuYCBNNbumgIE_x.mp4)\n\n## Part 1: Eddie researches our competitors automatically\n\n![](imgs/img-003-HDkaT1IWwAAszMV.jpg)\n\nEddie has a custom skill called ad-research.\nit uses Apify to scrape the Meta Ad Library directly.\n\nyou give it a keyword or an advertisers name ( whatever your niche is.)\n\nEddie pulls every active video ad running in that niche right now.\n10, 20, 50 ads and sorts them from oldest to newest\n\nOlder ads usually means more profitable. \nthen he downloads the actual video files from fbcdn.\n\nthen he runs every single video through OpenAI Whisper.\nword for word transcription.\n\n\nhe grabs every hook and breaks down every video.\nEddie runs this for every competitor in the niche\n\n\nby the end you have a full intel dump of what angles work \n\n## Part 2: Eddie learns your brand voice\n\nmost AI tools generate scripts and the scripts read like a marketing blog. \nSuper generic and no personality. \n\nEddie runs on .md files.\nmarkdown files that define exactly how to write.\n\nwriting-rules.md is the anti-AI filter.\n\nit bans every word that AI overuses.\n\nhe is trained on this wikipedia article: \n[https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing)\n\nThis completely avoids all AI slop.\nalso here is another prompt that works\n\n\nthen there is the brand voice file.\nwhich is trained on our influencer videos \n\nAnd split into 3 files\n[Voice.md](http://voice.md/)\n[product.md](http://product.md/)\n[icp.md](http://icp.md/) \n\neddie know how to talk like someone in our niche\nhe knows exactly what the product does\nand he knows exactly who needs it\n\nEddie loads both files before writing a single word.\n\nevery script comes out in our voice.\n\nwith our positioning.\n\nwith our specific product facts baked in.\n\n## Part 3: Eddie generates 100s of script variations\n\nfrom the competitor research, Eddie writes original scripts.\nfor every competitor ad it found, it generates 2 outputs:\n\n\n![](imgs/img-004-HDke0dcWgAAG9tQ.jpg)\n\n→ the original competitor script (body copy + transcript + angle breakdown)\n\n→ a rewrite (same angle, same structure, our product and our voice )\n\nso if Eddie scraped 30 competitor ads across 5 competitors, thats 30 rewrites.\n\neach one in our voice. then we have the multiplier which is the ICP\n\nwe multiply the ads by the different icp ( ideal customer profiles ) that we know would buy and use our app. \n\neach one built on a proven angle.\nthen Eddie generates variations on the top performers.\n\n50, 80, 100 variations.\n\none session.\nall built on competitor data.\n\nall in Prayer Lock's voice.\n\n## Part 4: split between creators and Arcads\n\nthe best scripts go two places.\n\n1. to our UGC creators.\n\nEddie sends them the top 10-15 scripts + the refference video from competitors.\n\nthey film them. we pay $15-50/video.\n\n2. the rest go to Arcads via API.\n\nEddie pushes scripts directly into Arcads.\nArcads has 300+ AI actors + the ones we have made ourself\n\nEddie triggers the renders.\nand makes thousands of ads in a few minutes\n\n![example of one of our generations](imgs/img-005-HDkbF5LWIAAkYIu.jpg)\n\nsame script → 5 different actors.\nsame actor → 10 different hooks.\nwe get back 50+ finished video ads.\n\nheres an example of how it looks \n\n![video](imgs/img-006-GK_zFor61umELZW6.jpg)\n[video](videos/video-002-ZxTQLrLJPAXY86tj.mp4)\n\ncombined with our creators, we are testing 100+ creatives per month.\nwe let meta handle which creatives to push\n\nbut wait.. it gets even crazier\n\n## Part 5: the self improvement  loop\n\nafter the ads run, performance data goes back into Eddie via singulars api\nWhich is the mmp that we use.\n\nhe analyzes which ads had the best CPA\ndoubles down on that creative direction\n\nAnd makes a mental note on what works best.\n\nthen on the next run he generates a new batch based on the winners.generate → evaluate → regenerate.\n\nthe system gets better on every cycle.\n\nthe whole pipeline runs mostly without us, \nand we are still refining this systme\n\nwe are running one of the very first vibe advertising eco-systems in the app space. \n\nthank you arcads for sponsoring our experiments, try it out here\nhttp://www.arcads.ai/?comet_custom=ernestoSOFTWARE","readmeExcerpt":"Skill: Baoyu Danger X To Markdown Owner: jimliu Summary: 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... Tags: latest:1.117.3 Version history: v1.117.3 | 2026-06-01T03:30:59.320Z | user Fix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1. v1.117.2 | 2026-05-18T02:14:14.865Z","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json"},{"language":"text","snippet":"Warning: Using reverse-engineered X API. Accepted on: <acceptedAt>"},{"language":"text","snippet":"DISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?"},{"language":"json","snippet":"{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}"},{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/main.ts <url>\n${BUN_X} {baseDir}/scripts/main.ts <url> -o output.md\n${BUN_X} {baseDir}/scripts/main.ts <url> --download-media\n${BUN_X} {baseDir}/scripts/main.ts <url> --json"},{"language":"markdown","snippet":"---\nurl: \"https://x.com/user/status/123\"\nauthor: \"Name (@user)\"\ntweetCount: 3\ncoverImage: \"https://pbs.twimg.com/media/example.jpg\"\n---\n\nContent..."}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: baoyu-danger-x-to-markdown\ndescription: 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.\nversion: 1.117.3\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# X to Markdown\n\nConverts X content to markdown:\n- Tweets/threads → Markdown with YAML front matter\n- X Articles → Full content extraction\n\n## User Input Tools\n\nWhen this skill prompts the user, follow this tool-selection rule (priority order):\n\n1. **Prefer built-in user-input tools** exposed by the current agent runtime — e.g., `AskUserQuestion`, `request_user_input`, `clarify`, `ask_user`, or any equivalent.\n2. **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.\n3. **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.\n\nConcrete `AskUserQuestion` references below are examples — substitute the local equivalent in other runtimes.\n\n## Script Directory\n\nScripts located in `scripts/` subdirectory.\n\n**Path Resolution**:\n1. `{baseDir}` = this SKILL.md's directory\n2. Script path = `{baseDir}/scripts/main.ts`\n3. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n## Consent Requirement\n\n**Before any conversion**, check and obtain consent.\n\n### Consent Flow\n\n**Step 1**: Check consent file\n\n```bash\n# macOS\ncat ~/Library/Application\\ Support/baoyu-skills/x-to-markdown/consent.json\n\n# Linux\ncat ~/.local/share/baoyu-skills/x-to-markdown/consent.json\n```\n\n**Step 2**: If `accepted: true` and `disclaimerVersion: \"1.0\"` → print warning and proceed:\n```\nWarning: Using reverse-engineered X API. Accepted on: <acceptedAt>\n```\n\n**Step 3**: If missing or version mismatch → display disclaimer:\n```\nDISCLAIMER\n\nThis tool uses a reverse-engineered X API, NOT official.\n\nRisks:\n- May break if X changes API\n- No guarantees or support\n- Possible account restrictions\n- Use at your own risk\n\nAccept terms and continue?\n```\n\nUse `AskUserQuestion` with options: \"Yes, I accept\" | \"No, I decline\"\n\n**Step 4**: On accept → create consent file:\n```json\n{\n  \"version\": 1,\n  \"accepted\": true,\n  \"acceptedAt\": \"<ISO timestamp>\",\n  \"disclaimerVersion\": \"1.0\"\n}\n```\n\n**Step 5**: On decline → output \"User declined. Exiting.\" and stop.\n\n## Preferences (EXTEND.md)\n\nCheck EXTEND.md in priority order — the first one found wins:\n\n| Priority | Path | Scope |\n|----------|------|-------|\n| 1 | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-danger-x-to-markdown/E"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-danger-x-to-markdown\",\n  \"version\": \"1.117.3\",\n  \"publishedAt\": 1780284659320\n}"},{"path":"references/config/first-time-setup.md","content":"---\nname: first-time-setup\ndescription: First-time setup flow for baoyu-danger-x-to-markdown preferences\n---\n\n# First-Time Setup\n\n## Overview\n\nWhen no EXTEND.md is found, guide user through preference setup.\n\n**BLOCKING OPERATION**: This setup MUST complete before ANY other workflow steps. Do NOT:\n- Start converting tweets or articles\n- Ask about URLs or output paths\n- Proceed to any conversion\n\nONLY ask the questions in this setup flow, save EXTEND.md, then continue.\n\n## Setup Flow\n\n```\nNo EXTEND.md found\n        |\n        v\n+---------------------+\n| AskUserQuestion     |\n| (all questions)     |\n+---------------------+\n        |\n        v\n+---------------------+\n| Create EXTEND.md    |\n+---------------------+\n        |\n        v\n    Continue conversion\n```\n\n## Questions\n\n**Language**: Use user's input language or saved language preference.\n\nUse AskUserQuestion with ALL questions in ONE call:\n\n### Question 1: Download Media\n\n```yaml\nheader: \"Media\"\nquestion: \"How to handle images and videos in tweets?\"\noptions:\n  - label: \"Ask each time (Recommended)\"\n    description: \"After saving markdown, ask whether to download media\"\n  - label: \"Always download\"\n    description: \"Always download media to local imgs/ and videos/ directories\"\n  - label: \"Never download\"\n    description: \"Keep original remote URLs in markdown\"\n```\n\n### Question 2: Default Output Directory\n\n```yaml\nheader: \"Output\"\nquestion: \"Default output directory?\"\noptions:\n  - label: \"x-to-markdown (Recommended)\"\n    description: \"Save to ./x-to-markdown/{username}/{tweet-id}.md\"\n```\n\nNote: User will likely choose \"Other\" to type a custom path.\n\n### Question 3: Save Location\n\n```yaml\nheader: \"Save\"\nquestion: \"Where to save preferences?\"\noptions:\n  - label: \"User (Recommended)\"\n    description: \"~/.baoyu-skills/ (all projects)\"\n  - label: \"Project\"\n    description: \".baoyu-skills/ (this project only)\"\n```\n\n## Save Locations\n\n| Choice | Path | Scope |\n|--------|------|-------|\n| User | `~/.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | All projects |\n| Project | `.baoyu-skills/baoyu-danger-x-to-markdown/EXTEND.md` | Current project |\n\n## After Setup\n\n1. Create directory if needed\n2. Write EXTEND.md\n3. Confirm: \"Preferences saved to [path]\"\n4. Continue with conversion using saved preferences\n\n## EXTEND.md Template\n\n```md\ndownload_media: [ask/1/0]\ndefault_output_dir: [path or empty]\n```\n\n## Modifying Preferences Later\n\nUsers can edit EXTEND.md directly or delete it to trigger setup again."},{"path":"scripts/package.json","content":"{\n  \"name\": \"baoyu-danger-x-to-markdown-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.1\"\n  }\n}"},{"path":"skill-card.md","content":"## Description:\n\nConverts X (Twitter) tweets, threads, and articles to Markdown with YAML front matter using a disclosed reverse-engineered API flow that requires user consent.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[jimliu](https://clawhub.ai/user/jimliu)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent users use this skill to save X posts, threads, and articles as local Markdown files for review, archiving, or downstream writing workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles live X session cookies.\n\nMitigation: Use a dedicated X account or Chrome profile, avoid shared or synced cookie storage, and rotate or revoke X sessions after use.\n\nRisk: Media downloads can fetch files from content the user did not author.\n\nMitigation: Avoid --download-media for untrusted content until URL allowlisting, download limits, and safer cookie storage are added.\n\nRisk: The converter uses a reverse-engineered X API rather than an official API.\n\nMitigation: Require the documented consent flow before conversion and warn users that the API may break or affect account access.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/jimliu/skills/baoyu-danger-x-to-markdown)\n- [Baoyu skills homepage](https://github.com/JimLiu/baoyu-skills#baoyu-danger-x-to-markdown)\n- [First-time setup reference](references/config/first-time-setup.md)\n\n## Skill Output:\n\n**Output Type(s):** [Markdown, Text, JSON, Files, Shell commands, Configuration guidance]\n\n**Output Format:** [Markdown files with YAML front matter, optional JSON status output, and shell commands for running the converter.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can optionally download referenced media to local imgs/ and videos/ directories and rewrite Markdown links.]\n\n## Skill Version(s):\n\n1.117.3 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"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... Skill: Baoyu Danger X To Markdown Owner: jimliu Summary: 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... Tags: latest:1.117.3 Version history: v1.117.3 | 2026-06-01T03:30:59.320Z | user Fix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1. v1.117.2 | 2026-05-18T02:14:14.865Z","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1688,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T13:11:00.020Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:52:06.397Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}