{"id":"188c1dd4-2659-4881-9be2-4700f428f68e","entityType":"agent","slug":"clawhub-jimliu-baoyu-post-to-x","name":"Baoyu Post To X","canonicalUrl":"https://www.xpersona.co/agent/clawhub-jimliu-baoyu-post-to-x","canonicalPath":"/agent/clawhub-jimliu-baoyu-post-to-x","generatedAt":"2026-10-10T00:50:18.167Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:05:54.645Z","emptyReason":null},"description":"Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests f...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 4.6K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-post-to-x","sourceUrl":"https://clawhub.ai/jimliu/baoyu-post-to-x","homepage":"https://clawhub.ai/jimliu/skills/baoyu-post-to-x","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/jimliu/baoyu-post-to-x","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/jimliu/skills/baoyu-post-to-x","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":73,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Baoyu Post To X technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:05:54.645Z","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-09T05:05:54.645Z","emptyReason":null},"stars":null,"forks":null,"downloads":4608,"packageName":null,"latestVersion":"1.58.1","tractionLabel":"4.6K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T05:05:54.644Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T05:05:54.645Z","lastCrawledAt":"2026-10-09T05:05:54.644Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T05:05:54.644Z","lastVerifiedAt":null,"highlights":[{"version":"1.58.1","createdAt":"2026-06-01T03:31:29.739Z","changelog":"Fix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1.","fileCount":18,"zipByteSize":59419},{"version":"1.57.2","createdAt":"2026-05-24T22:09:44.592Z","changelog":"baoyu-post-to-x 1.57.2 - Major update: Adds explicit multi-path execution instructions for posts to X (Codex Chrome plugin, Chrome Computer Use, or CDP script), with clear rules for each. - Now honors user preference for Codex Chrome plugin/@chrome and gives detailed instructions for Chrome extension automation, permissions, and error handling. - Introduces a dedicated script for checking paste/file-upload permissions. - Updates documentation: improved clarity on file/script paths, runtime selection, and X Article image flows. - Enhances EXTEND.md preference order and scope explanation. - Adds test coverage for utility functions.","fileCount":17,"zipByteSize":55450},{"version":"0.1.0","createdAt":"2026-02-05T03:44:38.722Z","changelog":"Initial release of baoyu-post-to-x – post content, images, videos, and articles to X (Twitter) using real Chrome automation. - Supports regular posts (text + up to 4 images), video uploads, quote tweets, and X Articles (Markdown long-form, for Premium users). - Uses Chrome CDP to bypass anti-automation measures. - Includes script directory layout and agent execution instructions. - Preferences and custom settings supported via EXTEND.md at project or user level. - First-time login to X is interactive and session persists for later use. - Reference guides provided for troubleshooting and article workflow.","fileCount":12,"zipByteSize":35490}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-post-to-x","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17dfbhg0khk4fvtnx0stqg0yx83j25z:baoyu-post-to-x` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/jimliu/baoyu-post-to-x before using production credentials."],"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-post-to-x/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/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-10T00:50:18.166Z"}},"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-post-to-x/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-jimliu-baoyu-post-to-x/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":"medium","updatedAt":"2026-10-09T05:05:54.645Z","emptyReason":null},"readme":"Skill: Baoyu Post To X\n\nOwner: jimliu\n\nSummary: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests f...\n\nTags: latest:1.58.1\n\nVersion history:\n\nv1.58.1 | 2026-06-01T03:31:29.739Z | user\n\nFix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1.\n\nv1.57.2 | 2026-05-24T22:09:44.592Z | auto\n\nbaoyu-post-to-x 1.57.2\n\n- Major update: Adds explicit multi-path execution instructions for posts to X (Codex Chrome plugin, Chrome Computer Use, or CDP script), with clear rules for each.\n- Now honors user preference for Codex Chrome plugin/@chrome and gives detailed instructions for Chrome extension automation, permissions, and error handling.\n- Introduces a dedicated script for checking paste/file-upload permissions.\n- Updates documentation: improved clarity on file/script paths, runtime selection, and X Article image flows.\n- Enhances EXTEND.md preference order and scope explanation.\n- Adds test coverage for utility functions.\n\nv0.1.0 | 2026-02-05T03:44:38.722Z | auto\n\nInitial release of baoyu-post-to-x – post content, images, videos, and articles to X (Twitter) using real Chrome automation.\n\n- Supports regular posts (text + up to 4 images), video uploads, quote tweets, and X Articles (Markdown long-form, for Premium users).\n- Uses Chrome CDP to bypass anti-automation measures.\n- Includes script directory layout and agent execution instructions.\n- Preferences and custom settings supported via EXTEND.md at project or user level.\n- First-time login to X is interactive and session persists for later use.\n- Reference guides provided for troubleshooting and article workflow.\n\nArchive index:\n\nArchive v1.58.1: 18 files, 59419 bytes\n\nFiles: references/articles.md (13457b), references/regular-posts.md (4132b), scripts/bun.lock (23955b), scripts/check-paste-permissions.ts (8310b), scripts/copy-to-clipboard.ts (12179b), scripts/md-to-html.test.ts (3017b), scripts/md-to-html.ts (12505b), scripts/package.json (379b), scripts/paste-from-clipboard.ts (5659b), scripts/x-article.ts (31699b), scripts/x-browser.ts (9002b), scripts/x-quote.ts (9112b), scripts/x-utils.test.ts (1676b), scripts/x-utils.ts (8817b), scripts/x-video.ts (9536b), skill-card.md (2977b), SKILL.md (17668b), _meta.json (135b)\n\nFile v1.58.1:SKILL.md\n\n---\nname: baoyu-post-to-x\ndescription: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests for the Codex Chrome plugin/@chrome by using the Chrome Extension workflow; otherwise use Chrome Computer Use when available and fall back to real Chrome CDP scripts only when allowed. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\".\nversion: 1.58.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-post-to-x\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Post to X (Twitter)\n\nPosts text, images, videos, and long-form articles to X via a real Chrome browser.\n\nIn Codex, do not conflate these browser paths:\n- **Codex Chrome plugin / `@chrome` / Chrome Extension**: use the bundled `chrome:Chrome` skill and its Node REPL browser client. This is required whenever the user says \"Codex Chrome plugin\", \"Codex 自带的 Chrome 插件\", `@chrome`, or similar.\n- **Chrome Computer Use**: use `mcp__computer_use__.*` against the visible Google Chrome UI only when the user asks for Computer Use or no Chrome-plugin preference is stated and Computer Use is available.\n- **CDP script mode**: use only as a fallback when the selected mode is unavailable or the user explicitly asks for CDP/script mode.\n\n## Script Directory\n\n**Important**: All scripts are located in the `scripts/` subdirectory of this skill.\n\n**Agent Execution Instructions**:\n1. Determine this SKILL.md file's directory path as `{baseDir}`\n2. Script path = `{baseDir}/scripts/<script-name>.ts`\n3. Replace all `{baseDir}` in this document with the actual path\n4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n**Script Reference**:\n| Script | Purpose |\n|--------|---------|\n| `scripts/x-browser.ts` | Regular posts (text + images), CDP fallback |\n| `scripts/x-video.ts` | Video posts (text + video), CDP fallback |\n| `scripts/x-quote.ts` | Quote tweet with comment, CDP fallback |\n| `scripts/x-article.ts` | Long-form article publishing (Markdown), CDP fallback |\n| `scripts/md-to-html.ts` | Markdown → HTML conversion |\n| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |\n| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |\n| `scripts/check-paste-permissions.ts` | Verify environment & permissions |\n\n## Execution Mode Selection (Required)\n\nChoose exactly one mode before interacting with X:\n\n1. If the user explicitly asks for the Codex Chrome plugin, `@chrome`, the Chrome extension, or \"Codex 自带的 Chrome 插件\", use **Codex Chrome Plugin Mode**. Do not call Computer Use first.\n2. If the user explicitly asks for Chrome Computer Use, use **Chrome Computer Use Mode**. Do not fall back to CDP, Playwright, the in-app Browser, or the Chrome plugin without telling the user and getting approval.\n3. If the user explicitly asks for CDP/script mode, use **CDP Script Mode**.\n4. Otherwise, prefer **Chrome Computer Use Mode**. For Markdown **X Articles with local content images**, use the tested X editor flow: insert each body image from the toolbar (`Insert` -> `Media` -> dialog icon button `Add photos or video`) at its placeholder, then delete the placeholder text. Use CDP Script Mode only when the selected browser-control mode is unavailable or the UI upload/selection flow is unreliable.\n\nNever use the in-app Browser for X publishing workflows.\n\n## Codex Chrome Plugin Mode\n\nUse this mode whenever the user requests the Codex Chrome plugin, `@chrome`, or the Chrome Extension path. This uses the user's real Chrome profile and X login through the bundled Chrome plugin, not Computer Use and not CDP.\n\n**Setup**\n1. Load the `chrome:Chrome` skill before browser work.\n2. Use `tool_search` for `node_repl js` if the Node REPL `js` tool is not already visible.\n3. Initialize the Chrome browser client exactly as the Chrome skill specifies, then run a lightweight call such as `browser.user.openTabs()` to verify the extension connection.\n4. If the first lightweight call fails, wait 2 seconds and retry once. If it still fails, follow the Chrome skill's extension checks and recovery steps. If checks pass but communication still fails, ask the user before opening a new Chrome window. Do not switch to Computer Use or CDP silently.\n\n**General rules**\n- Use the Chrome plugin's `browser.tabs.*`, `tab.playwright.*`, `tab.cua.*`, and file chooser APIs for X UI actions.\n- Shell commands are allowed for Markdown preprocessing and rich-HTML clipboard preparation. For X Article body images, do not rely on image clipboard paste; use the editor's `Insert` -> `Media` upload flow.\n- If a file upload fails with `Not allowed`, tell the user: `To enable file upload, go to chrome://extensions in Chrome, click Details under the Codex extension, and enable \"Allow access to file URLs.\" See https://developers.openai.com/codex/app/chrome-extension#upload-files for details.`\n- If the Chrome plugin reports `native pipe is closed`, retry the lightweight browser call once after 2 seconds, then run the Chrome skill health checks. If Chrome is running, the extension is enabled, and the native host manifest is correct, ask permission to open a new Chrome window and retry. Do not keep sending browser actions through the broken pipe.\n- Never click `Publish`, `Post`, or any externally visible submit action without explicit final confirmation from the user in the current conversation.\n\n**X Articles**\n1. Convert Markdown and keep the image map:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n   ```\n2. Read the JSON output for `title`, `coverImage`, and `contentImages` (`placeholder` → `localPath`).\n3. Open or create the article draft at `https://x.com/compose/articles`.\n4. Upload the cover with the Chrome plugin file chooser flow. If upload is blocked by extension permissions, stop and report the exact permission fix above.\n5. Fill the title, then copy rich HTML:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n   ```\n6. Paste into the article body with a real paste keystroke through the Chrome plugin. On macOS use `Meta+V`.\n7. Verify the editor text contains the article body and `XIMGPH_` placeholders. Do not rely on `tab.clipboard.readText()` as proof of the system clipboard after shell clipboard writes; on macOS verify with `pbpaste` if needed.\n8. For each `contentImages` item in placeholder order:\n   - Locate the visible placeholder text (`XIMGPH_N`) and click it to place the caret there.\n   - Open the toolbar menu `Insert` -> `Media`.\n   - In the modal, click the icon button with `aria-label=\"Add photos or video\"`; do not click the text/dropzone or hidden file input.\n   - Use the file chooser to upload that image's `localPath`.\n   - After the image appears, if `XIMGPH_N` remains above it, select exactly that placeholder and press `Delete` first. Use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n   - Verify the placeholder count for that `XIMGPH_N` is `0`.\n9. Open Preview and verify title, cover, body, links, and images.\n10. Ask for explicit confirmation before clicking `Publish`.\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-post-to-x/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md` | User home |\n\nIf none found, use defaults.\n\n**EXTEND.md supports**: Default Chrome profile\n\n## Prerequisites\n\n- Google Chrome or Chromium\n- `bun` runtime\n- First run: log in to X manually (session saved)\n\n## Pre-flight Check (Optional)\n\nBefore first use, suggest running the environment check. User can skip if they prefer.\n\n```bash\n${BUN_X} {baseDir}/scripts/check-paste-permissions.ts\n```\n\nChecks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.\n\n**If any check fails**, provide fix guidance per item:\n\n| Check | Fix |\n|-------|-----|\n| Chrome | Install Chrome or set `X_BROWSER_CHROME_PATH` env var |\n| Profile dir | Shared profile at `baoyu-skills/chrome-profile` (see CLAUDE.md Chrome Profile section) |\n| Bun runtime | `brew install oven-sh/bun/bun` (macOS) or `npm install -g bun` |\n| Accessibility (macOS) | System Settings → Privacy & Security → Accessibility → enable terminal app |\n| Clipboard copy | Ensure Swift/AppKit available (macOS Xcode CLI tools: `xcode-select --install`) |\n| Paste keystroke (macOS) | Same as Accessibility fix above |\n| Paste keystroke (Linux) | Install `xdotool` (X11) or `ydotool` (Wayland) |\n\n## References\n\n- **Regular Posts**: See `references/regular-posts.md` for manual workflow, troubleshooting, and technical details\n- **X Articles**: See `references/articles.md` for long-form article publishing guide\n\n---\n\n## Chrome Computer Use Mode\n\nUse this mode when the user explicitly asks for Chrome Computer Use, or when no Chrome-plugin preference is stated and Codex can control `Google Chrome` with Computer Use. This uses the user's existing Chrome window, cookies, login, extensions, and X session.\n\n**General rules**:\n- Start each assistant turn that controls Chrome by calling `get_app_state` for `Google Chrome`.\n- Prefer element-index actions when available; use coordinates only for editor text selection or drag selection.\n- Do not use the in-app Browser, the Chrome plugin, Playwright, or CDP for X UI actions in this mode unless the user approves a mode change.\n- Never click `Publish`, `Post`, or any externally visible submit action without an explicit final confirmation from the user in the current conversation.\n\n**Regular posts**:\n1. Open or navigate Chrome to `https://x.com/compose/post`.\n2. Type the post text into the composer using Computer Use.\n3. For each image, run:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /absolute/path/to/image.png\n   ```\n4. Paste with Computer Use (`super+v` on macOS, `control+v` on Windows/Linux), then wait until X finishes uploading media.\n5. Ask for confirmation before clicking `Post`.\n\n**Video posts**:\n1. Open or navigate Chrome to `https://x.com/compose/post`.\n2. Type the post text into the composer.\n3. Use the visible media upload/file picker UI to attach the video.\n4. Wait for upload and processing to complete.\n5. Ask for confirmation before clicking `Post`.\n\n**Quote tweets**:\n1. Open the tweet URL in Chrome.\n2. Use the visible quote/repost UI to choose Quote.\n3. Type the comment.\n4. Ask for confirmation before clicking `Post`.\n\n**X Articles**:\n1. Convert Markdown and keep the image map:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n   ```\n2. Read the JSON output for `title`, `coverImage`, and `contentImages` (`placeholder` → `localPath`).\n3. In Chrome, open `https://x.com/compose/articles`, create or open the draft, upload the cover if present, and fill the title.\n4. Copy rich HTML to the clipboard:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n   ```\n5. Paste into the article body with Computer Use.\n6. For each `contentImages` entry in placeholder order:\n   - Locate the exact visible placeholder text such as `XIMGPH_3` and click it to set the insertion point.\n   - Open the toolbar `Insert` dropdown, choose `Media`, then click the modal's icon button labeled `Add photos or video`.\n   - Use the native file picker to choose the image's `localPath`.\n   - Wait until the image block appears and any upload activity is finished.\n   - If the placeholder remains above the inserted image, reselect exactly that placeholder text and press `Delete` first. Use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n7. Verify no `XIMGPH_` placeholders remain and the expected images appear.\n8. Open Preview and verify title, cover, body, links, and images.\n9. Ask for explicit confirmation before clicking `Publish`.\n\nIf Computer Use selection, toolbar upload, or file-picker control becomes unreliable, stop and report the blocker instead of switching to the Chrome plugin or CDP silently.\n\n---\n\n## CDP Script Mode (Fallback)\n\nUse the script sections below only when the selected browser-control mode is unavailable, unreliable, or explicitly not requested. These scripts launch or reuse a real Chrome instance via CDP and keep the browser open for review.\n\nDo not use CDP Script Mode when the user explicitly requires the Codex Chrome plugin or Chrome Computer Use unless the user approves the fallback after you explain the blocker.\n\n---\n\n## Post Type Selection\n\nUnless the user explicitly specifies the post type:\n- **Plain text** + within 10,000 characters → **Regular Post** (Premium members support up to 10,000 characters, non-Premium: 280)\n- **Markdown file** (.md) → **X Article**\n\n## Regular Posts\n\n```bash\n${BUN_X} {baseDir}/scripts/x-browser.ts \"Hello!\" --image ./photo.png\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--image <path>` | Image file (repeatable, max 4) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-browser.ts`.\n\n---\n\n## Video Posts\n\nText + video file.\n\n```bash\n${BUN_X} {baseDir}/scripts/x-video.ts \"Check this out!\" --video ./clip.mp4\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--video <path>` | Video file (MP4, MOV, WebM) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-video.ts`.\n\n**Limits**: Regular 140s max, Premium 60min. Processing: 30-60s.\n\n---\n\n## Quote Tweets\n\nQuote an existing tweet with comment.\n\n```bash\n${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 \"Great insight!\"\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<tweet-url>` | URL to quote (positional) |\n| `<comment>` | Comment text (positional, optional) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-quote.ts`.\n\n---\n\n## X Articles\n\nLong-form Markdown articles (requires X Premium).\n\n```bash\n${BUN_X} {baseDir}/scripts/x-article.ts article.md\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<markdown>` | Markdown file (positional) |\n| `--cover <path>` | Cover image |\n| `--title <text>` | Override title |\n\n**Frontmatter**: `title`, `cover_image` supported in YAML front matter.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, follow **Codex Chrome Plugin Mode** above. If the user explicitly requested Chrome Computer Use, follow **Chrome Computer Use Mode**. Otherwise, prefer Chrome Computer Use; for Markdown articles with local content images, use the toolbar `Insert` -> `Media` image-upload workflow before falling back to `x-article.ts` in **CDP Script Mode**.\n\n**CDP fallback note**: The script opens browser with article filled in. User reviews and publishes manually unless `--submit` is used.\n\n**Publish safety**: Do not use `--submit` or click `Publish` unless the user explicitly confirms the final public publish action.\n\n**Post-Composition Check**: The script automatically verifies after all images are inserted:\n- Remaining `XIMGPH_` placeholders in editor content\n- Expected vs actual image count\n\nIf the check fails (warnings in output), alert the user with the specific issues before they publish.\n\n---\n\n## Troubleshooting\n\n### Chrome debug port not ready\n\nCDP fallback only: if a script fails with `Chrome debug port not ready` or `Unable to connect`, kill existing Chrome CDP instances first, then retry:\n\n```bash\npkill -f \"Chrome.*remote-debugging-port\" 2>/dev/null; pkill -f \"Chromium.*remote-debugging-port\" 2>/dev/null; sleep 2\n```\n\n**Important**: This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.\n\n## Notes\n\n- First run: manual login required (session persists)\n- In Codex Chrome Plugin Mode and Chrome Computer Use Mode, use the user's existing Chrome session and do not launch a separate CDP profile\n- CDP scripts only fill content into the browser by default; user must review and publish manually unless `--submit` is explicitly used\n- Cross-platform: macOS, Linux, Windows\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.58.1:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-post-to-x\",\n  \"version\": \"1.58.1\",\n  \"publishedAt\": 1780284689739\n}\n\nFile v1.58.1:references/articles.md\n\n# X Articles - Detailed Guide\n\nPublish Markdown articles to X Articles editor with rich text formatting and images.\n\n## Mode Selection\n\nIn Codex, choose the browser-control mode from the user's wording:\n\n1. If the user says \"Codex Chrome plugin\", \"Codex 自带的 Chrome 插件\", `@chrome`, or Chrome Extension, use **Codex Chrome Plugin Workflow**. Do not try Computer Use first.\n2. If the user explicitly asks for Chrome Computer Use, use **Computer Use Workflow**.\n3. If the user explicitly asks for CDP/script mode, use **CDP Script Workflow**.\n4. Otherwise, use Computer Use when available; if unavailable or blocked, use CDP Script Workflow.\n\nNever use the in-app Browser for X Article publishing. Never switch away from an explicitly requested mode without explaining the blocker and getting approval.\n\n## Prerequisites\n\n- X Premium subscription (required for Articles)\n- Google Chrome installed\n- `bun` installed\n\n## Usage\n\n### Codex Chrome Plugin (When Requested)\n\nUse the `chrome:Chrome` skill and its Node REPL browser client. Verify the connection with a lightweight call such as `browser.user.openTabs()`. If it fails, wait 2 seconds and retry once, then follow the Chrome skill's health checks.\n\nPrepare the article HTML and image map:\n\n```bash\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n```\n\nCopy generated HTML as rich text:\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n```\n\nUse the Chrome plugin's tab, Playwright-wrapper, CUA, clipboard, and file chooser APIs for all X UI operations. If upload fails with `Not allowed`, stop and tell the user to enable file URL access for the Codex Chrome Extension in `chrome://extensions` → Details.\n\n### Chrome Computer Use\n\nPrepare the article HTML and image map:\n\n```bash\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n```\n\nCopy the generated HTML as rich text:\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n```\n\nThen use Codex Computer Use against `Google Chrome` for all X UI operations.\n\n### CDP Script Fallback\n\n```bash\n# Publish markdown article (preview mode)\n${BUN_X} {baseDir}/scripts/x-article.ts article.md\n\n# With custom cover image\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\n\n# Actually publish\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --submit\n```\n\nDo not use `--submit` unless the user has explicitly confirmed the final public publish action.\n\n## Markdown Format\n\n```markdown\n---\ntitle: My Article Title\ncover_image: /path/to/cover.jpg\n---\n\n# Title (becomes article title)\n\nRegular paragraph text with **bold** and *italic*.\n\n## Section Header\n\nMore content here.\n\n![Image alt text](./image.png)\n\n- List item 1\n- List item 2\n\n1. Numbered item\n2. Another item\n\n> Blockquote text\n\n[Link text](https://example.com)\n\n\\`\\`\\`\nCode blocks become blockquotes (X doesn't support code)\n\\`\\`\\`\n```\n\n## Frontmatter Fields\n\n| Field | Description |\n|-------|-------------|\n| `title` | Article title (or uses first H1) |\n| `cover_image` | Cover image path or URL |\n| `cover` | Alias for cover_image |\n| `image` | Alias for cover_image |\n\n## Image Handling\n\n1. **Cover Image**: First image or `cover_image` from frontmatter\n2. **Remote Images**: Automatically downloaded to temp directory\n3. **Placeholders**: Images in content use `XIMGPH_N` format\n4. **Insertion**: Placeholders are found, selected, and replaced with actual images\n\n## Markdown to HTML Script\n\nConvert markdown and inspect structure:\n\n```bash\n# Get JSON with all metadata\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md\n\n# Output HTML only\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --html-only\n\n# Save HTML to file\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/article.html\n```\n\nJSON output:\n```json\n{\n  \"title\": \"Article Title\",\n  \"coverImage\": \"/path/to/cover.jpg\",\n  \"contentImages\": [\n    {\n      \"placeholder\": \"XIMGPH_1\",\n      \"localPath\": \"/tmp/x-article-images/img.png\",\n      \"blockIndex\": 5\n    }\n  ],\n  \"html\": \"<p>Content...</p>\",\n  \"totalBlocks\": 20\n}\n```\n\n## Supported Formatting\n\n| Markdown | HTML Output |\n|----------|-------------|\n| `# H1` | Title only (not in body) |\n| `## H2` - `###### H6` | `<h2>` |\n| `**bold**` | `<strong>` |\n| `*italic*` | `<em>` |\n| `[text](url)` | `<a href>` |\n| `> quote` | `<blockquote>` |\n| `` `code` `` | `<code>` |\n| ```` ``` ```` | `<blockquote>` (X limitation) |\n| `- item` | `<ul><li>` |\n| `1. item` | `<ol><li>` |\n| `![](img)` | Image placeholder |\n\n## Codex Chrome Plugin Workflow\n\n1. **Load Chrome skill**: use `chrome:Chrome`, not Computer Use.\n2. **Connect**: initialize the Chrome plugin browser client and verify with `browser.user.openTabs()`.\n3. **Parse Markdown**: run `md-to-html.ts --save-html /tmp/x-article-body.html > /tmp/x-article.json`.\n4. **Read the map**: use `/tmp/x-article.json` for `title`, `coverImage`, and `contentImages`.\n5. **Open X Articles**: open or claim a Chrome tab for `https://x.com/compose/articles`.\n6. **Create Draft**: click the create/write button if needed, or open the target draft.\n7. **Upload Cover**: use the Chrome plugin file chooser flow. If file upload returns `Not allowed`, report the Chrome Extension file-access fix and stop.\n8. **Fill Title**: fill the title field.\n9. **Paste Content**:\n   - Run `copy-to-clipboard.ts html --file /tmp/x-article-body.html`.\n   - Click the article body.\n   - Press `Meta+V` on macOS or `Control+V` on Windows/Linux through the Chrome plugin.\n   - Verify the article body appeared and contains `XIMGPH_` placeholders. On macOS, use `pbpaste` to verify shell-written system clipboard contents if paste is suspicious; `tab.clipboard.readText()` may not reflect the system clipboard after shell writes.\n10. **Insert Images**: for each `contentImages` item in placeholder order:\n   - Locate the exact visible placeholder text (`XIMGPH_N`) and click it to put the insertion point there.\n   - Open the editor toolbar dropdown `Insert` and choose `Media`.\n   - In the `Insert` modal, click the icon button with `aria-label=\"Add photos or video\"`; do not click the \"Choose a file or drag it here\" text/dropzone or hidden file input.\n   - Use the Chrome plugin file chooser flow to upload that image's `localPath`.\n   - Wait until the image block appears. If `XIMGPH_N` remains above the image, select exactly that placeholder and press `Delete` first; use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n   - Verify that placeholder's count is `0` before continuing.\n11. **Verify**:\n   - Inspect the editor for `XIMGPH_` residue.\n   - Confirm the expected number of image blocks is visible.\n   - Open Preview and verify title, cover, body, links, and images.\n12. **Publish Safety**: ask the user for explicit final confirmation before clicking `Publish`.\n\nIf the Chrome plugin reports `native pipe is closed`, retry one lightweight browser call after 2 seconds, then run the Chrome skill health checks. If Chrome, the extension, and native host are healthy, ask the user before opening a new Chrome window and retrying.\n\n## Computer Use Workflow\n\n1. **Detect Computer Use**: call `get_app_state` for `Google Chrome`; use `tool_search` first if the tools are not visible.\n2. **Parse Markdown**: run `md-to-html.ts --save-html /tmp/x-article-body.html > /tmp/x-article.json`.\n3. **Read the map**: use `/tmp/x-article.json` for `title`, `coverImage`, and `contentImages`.\n4. **Open X Articles**: use Chrome Computer Use to navigate to `https://x.com/compose/articles`.\n5. **Create Draft**: click the create/write button if needed, or open the target draft.\n6. **Upload Cover**: if `coverImage` exists, use Chrome's visible upload/file picker UI. If the file picker cannot be operated reliably, stop and ask for help rather than switching to CDP silently.\n7. **Fill Title**: type the title into the title field.\n8. **Paste Content**:\n   - Run `copy-to-clipboard.ts html --file /tmp/x-article-body.html`.\n   - Click the article body.\n   - Press `super+v` on macOS or `control+v` on Windows/Linux with Computer Use.\n9. **Insert Images**: for each `contentImages` item in placeholder order:\n   - Locate the exact visible placeholder text (`XIMGPH_N`) and click it to put the insertion point there.\n   - Open the editor toolbar dropdown `Insert`, choose `Media`, then click the icon button with `aria-label=\"Add photos or video\"` inside the modal.\n   - Use the native file picker to choose that image's `localPath`.\n   - Wait until the image block appears and upload activity is complete.\n   - If `XIMGPH_N` remains above the inserted image, reselect exactly that placeholder text and press `Delete` first; use `Backspace` only if `Delete` fails and the Computer Use state confirms the selected text is exactly the placeholder.\n   - Confirm that placeholder is gone before continuing.\n10. **Verify**:\n   - Inspect the Computer Use state for `XIMGPH_` residue.\n   - Confirm the expected number of image blocks is visible.\n   - Open Preview and verify title, cover, body, links, and images.\n11. **Publish Safety**: ask the user for explicit final confirmation before clicking `Publish`.\n\n## CDP Script Workflow (Fallback)\n\n1. **Parse Markdown**: Extract title, cover, content images, generate HTML\n2. **Launch Chrome**: Real browser with CDP, persistent login\n3. **Navigate**: Open `x.com/compose/articles`\n4. **Create Article**: Click create button if on list page\n5. **Upload Cover**: Use file input for cover image\n6. **Fill Title**: Type title into title field\n7. **Paste Content**: Copy HTML to clipboard, paste into editor\n8. **Insert Images**: For each placeholder in placeholder order:\n   - Find and click the placeholder text in the editor\n   - Use `Insert` -> `Media`\n   - Click the modal's icon button labeled `Add photos or video`\n   - Upload the matching image file\n   - Delete the leftover placeholder text with `Delete` after the image appears\n9. **Post-Composition Check** (automatic):\n   - Scan editor for remaining `XIMGPH_` placeholders\n   - Compare expected vs actual image count\n   - Warn if issues found\n10. **Review**: Browser stays open for 60s preview\n11. **Publish**: Only with `--submit` flag and explicit user confirmation\n\n## Example Session\n\n```\nUser: /post-to-x article ./blog/my-post.md --cover ./thumbnail.png\n\nClaude:\n1. Detects that the user requested the Codex Chrome plugin\n2. Parses markdown: title=\"My Post\", 3 content images\n3. Saves `/tmp/x-article-body.html` and `/tmp/x-article.json`\n4. Uses the Chrome plugin to open X Articles and create a draft\n5. Uploads thumbnail.png as cover\n6. Fills title \"My Post\"\n7. Pastes HTML content with a real Chrome paste\n8. Inserts 3 images at placeholder positions\n9. Opens Preview and asks before publishing\n```\n\n## Troubleshooting\n\n- **No create button**: Ensure X Premium subscription is active\n- **Cover upload fails**: Check file path and format (PNG, JPEG)\n- **Images not inserting**: Verify placeholders exist in pasted content; use `Insert` -> `Media` -> modal icon button `Add photos or video`, not image clipboard paste, the dropzone text, or the hidden file input.\n- **Content not pasting**: Check HTML clipboard: `${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/test.html`\n- **Chrome plugin `native pipe is closed`**: retry once after 2 seconds, then run Chrome skill checks; ask before opening a new Chrome window if checks pass.\n- **Chrome plugin upload `Not allowed`**: enable file URL access for the Codex Chrome Extension in `chrome://extensions` → Details.\n- **Computer Use unavailable**: Use the CDP fallback script, unless the user explicitly required Chrome Computer Use.\n- **Placeholder remains after upload**: Select only the placeholder text and press `Delete` after upload completes. Use `Backspace` only if `Delete` fails and the selection is exactly the placeholder.\n\n## How It Works\n\n1. `md-to-html.ts` converts Markdown to HTML:\n   - Extracts frontmatter (title, cover)\n   - Converts markdown to HTML\n   - Replaces images with unique placeholders\n   - Downloads remote images locally\n   - Returns structured JSON\n\n2. The Codex Chrome plugin publishes through the user's real Chrome session when explicitly requested:\n   - Uses the user's active Chrome profile and logged-in X session\n   - Uses the Chrome Extension browser client rather than Computer Use or CDP\n   - Uses `copy-to-clipboard.ts` for rich HTML body paste\n   - Inserts body images through X's toolbar `Insert` -> `Media` modal and its `Add photos or video` icon button\n   - Keeps the final publish click under user confirmation\n\n3. Chrome Computer Use publishes through the user's visible Chrome UI:\n   - Uses the user's active Chrome profile and logged-in X session\n   - Uses `copy-to-clipboard.ts` for rich HTML body paste\n   - Inserts body images through X's toolbar `Insert` -> `Media` modal and its `Add photos or video` icon button\n   - Uses real keystrokes (`super+v`/`control+v`) through Codex Computer Use\n   - Keeps the final publish click under user confirmation\n\n4. `x-article.ts` publishes via CDP as a fallback:\n   - Launches real Chrome (bypasses detection)\n   - Uses persistent profile (saved login)\n   - Navigates and fills editor via DOM manipulation\n   - Pastes HTML from system clipboard\n   - Finds/selects/replaces each image placeholder\n\nFile v1.58.1:references/regular-posts.md\n\n# Regular Posts - Detailed Guide\n\nDetailed documentation for posting text and images to X.\n\n## Manual Workflow\n\nIf you prefer step-by-step control:\n\n### Step 0: Prefer Chrome Computer Use in Codex\n\nWhen running inside Codex, first detect whether Chrome Computer Use is enabled:\n\n1. If Computer Use tools are already visible, call `get_app_state` for `Google Chrome`.\n2. If not, use `tool_search` for `computer-use get_app_state click press_key drag scroll Google Chrome`, then call `get_app_state`.\n3. If `get_app_state` succeeds, use the user's real Chrome with Computer Use for all X UI actions.\n4. Use CDP scripts only when Computer Use is unavailable or explicitly requested.\n\nIf the user explicitly asks for Chrome Computer Use, do not use Playwright, the in-app Browser, or CDP without approval.\n\n### Step 1: Copy Image to Clipboard\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /path/to/image.png\n```\n\n### Step 2: Paste from Clipboard\n\n```bash\n# Simple paste to frontmost app\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts\n\n# Paste to Chrome with retries\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts --app \"Google Chrome\" --retries 5\n\n# Quick paste with shorter delay\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts --delay 200\n```\n\n### Step 3: Use Chrome Computer Use (Preferred)\n\n1. Use `get_app_state` for `Google Chrome`.\n2. Navigate Chrome to `https://x.com/compose/post` if needed.\n3. Click the composer and type the post text.\n4. Copy each image to the clipboard with `copy-to-clipboard.ts image <path>`.\n5. Press `super+v` on macOS or `control+v` on Windows/Linux with Computer Use.\n6. Wait until X finishes media upload.\n7. Ask for explicit confirmation before clicking `Post`.\n\n## Image Support\n\n- Formats: PNG, JPEG, GIF, WebP\n- Max 4 images per post\n- Images copied to system clipboard, then pasted via keyboard shortcut\n\n## Example Session\n\n```\nUser: /post-to-x \"Hello from Claude!\" --image ./screenshot.png\n\nClaude:\n1. Detects Chrome Computer Use\n2. Opens X compose in the user's real Chrome\n3. Types text into editor\n4. Copies image to clipboard and pastes with Computer Use\n5. Waits for upload and verifies the preview\n6. Asks before clicking Post\n```\n\n## Troubleshooting\n\n- **Chrome not found**: Set `X_BROWSER_CHROME_PATH` environment variable\n- **Not logged in**: First run opens Chrome - log in manually, cookies are saved\n- **Image paste fails**:\n  - Verify clipboard script: `${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image <path>`\n  - On macOS, grant \"Accessibility\" permission to Terminal/iTerm in System Settings > Privacy & Security > Accessibility\n  - Keep Chrome window visible and in front during paste operations\n- **osascript permission denied**: Grant Terminal accessibility permissions in System Preferences\n- **Rate limited**: Wait a few minutes before retrying\n\n## How It Works\n\nIn Chrome Computer Use mode:\n1. Codex controls the user's visible Google Chrome window\n2. Text is typed through the real UI\n3. Images are copied to the system clipboard and pasted with real keystrokes\n4. The user confirms before the final public post\n\nThe `x-browser.ts` script is the CDP fallback. It uses Chrome DevTools Protocol (CDP) to:\n1. Launch real Chrome (not Playwright) with `--disable-blink-features=AutomationControlled`\n2. Use persistent profile directory for saved login sessions\n3. Interact with X via CDP commands (Runtime.evaluate, Input.dispatchKeyEvent)\n4. **Paste images using osascript** (macOS): Sends real Cmd+V keystroke to Chrome, bypassing CDP's synthetic events that X can detect\n\nThis approach bypasses X's anti-automation detection that blocks Playwright/Puppeteer.\n\n### Image Paste Mechanism (macOS)\n\nCDP's `Input.dispatchKeyEvent` sends \"synthetic\" keyboard events that websites can detect. X ignores synthetic paste events for security. The solution:\n\n1. Copy image to system clipboard via Swift/AppKit (`copy-to-clipboard.ts`)\n2. Bring Chrome to front via `osascript`\n3. Send real Cmd+V keystroke via `osascript` and System Events\n4. Wait for upload to complete\n\nThis requires Terminal to have \"Accessibility\" permission in System Settings.\n\nFile v1.58.1:scripts/package.json\n\n{\n  \"name\": \"baoyu-post-to-x-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.1\",\n    \"baoyu-md\": \"^0.1.1\",\n    \"front-matter\": \"^4.0.2\",\n    \"highlight.js\": \"^11.11.1\",\n    \"marked\": \"^15.0.6\",\n    \"remark-cjk-friendly\": \"^1.1.0\",\n    \"remark-parse\": \"^11.0.0\",\n    \"remark-stringify\": \"^11.0.0\",\n    \"unified\": \"^11.0.5\"\n  }\n}\n\nFile v1.58.1:skill-card.md\n\n## Description:\n\nPosts text, media, quote tweets, and long-form Markdown articles to X (Twitter) through Chrome-based workflows while keeping final publishing under user confirmation.\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\nSocial media operators, creators, and developer agents use this skill to prepare X posts, quote tweets, media posts, and long-form X Articles from user-provided content. The skill is suited for workflows where the agent drafts or stages content in Chrome and the user reviews before any public publishing action.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can prepare externally visible X posts and articles in a real account session.\n\nMitigation: Review every prepared post or article and require explicit final user confirmation before clicking Post, Publish, or using a submit path.\n\nRisk: The skill may control Chrome, clipboard contents, file picker actions, and paste keystrokes.\n\nMitigation: Install and run it only in trusted environments where the user accepts those permissions and can observe the browser session.\n\nRisk: Markdown articles with remote images can introduce untrusted external content into the workflow.\n\nMitigation: Avoid processing untrusted Markdown with remote images; review article content and image sources before staging in X.\n\nRisk: The npx fallback can execute runtime tooling that is not already installed locally.\n\nMitigation: Prefer a preinstalled trusted Bun runtime and review dependency updates before use.\n\nRisk: Troubleshooting can include broad Chrome process-kill recovery for CDP sessions.\n\nMitigation: Use caution before process recovery steps and preserve important browser work before allowing Chrome session cleanup.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/jimliu/skills/baoyu-post-to-x)\n- [Baoyu Skills Homepage](https://github.com/JimLiu/baoyu-skills#baoyu-post-to-x)\n- [Regular Posts Guide](references/regular-posts.md)\n- [X Articles Guide](references/articles.md)\n- [Codex Chrome Extension File Upload Guidance](https://developers.openai.com/codex/app/chrome-extension#upload-files)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell command examples and prepared browser draft content]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May stage content in a real Chrome/X session; final public posting requires explicit user confirmation.]\n\n## Skill Version(s):\n\n1.58.1 (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.57.2: 17 files, 55450 bytes\n\nFiles: references/articles.md (13457b), references/regular-posts.md (4132b), scripts/bun.lock (16529b), scripts/check-paste-permissions.ts (8310b), scripts/copy-to-clipboard.ts (12179b), scripts/md-to-html.ts (13827b), scripts/package.json (353b), scripts/paste-from-clipboard.ts (5659b), scripts/x-article.ts (31699b), scripts/x-browser.ts (9002b), scripts/x-quote.ts (9112b), scripts/x-utils.test.ts (1676b), scripts/x-utils.ts (8817b), scripts/x-video.ts (9536b), skill-card.md (3175b), SKILL.md (17668b), _meta.json (135b)\n\nFile v1.57.2:SKILL.md\n\n---\nname: baoyu-post-to-x\ndescription: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests for the Codex Chrome plugin/@chrome by using the Chrome Extension workflow; otherwise use Chrome Computer Use when available and fall back to real Chrome CDP scripts only when allowed. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\".\nversion: 1.57.2\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-post-to-x\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Post to X (Twitter)\n\nPosts text, images, videos, and long-form articles to X via a real Chrome browser.\n\nIn Codex, do not conflate these browser paths:\n- **Codex Chrome plugin / `@chrome` / Chrome Extension**: use the bundled `chrome:Chrome` skill and its Node REPL browser client. This is required whenever the user says \"Codex Chrome plugin\", \"Codex 自带的 Chrome 插件\", `@chrome`, or similar.\n- **Chrome Computer Use**: use `mcp__computer_use__.*` against the visible Google Chrome UI only when the user asks for Computer Use or no Chrome-plugin preference is stated and Computer Use is available.\n- **CDP script mode**: use only as a fallback when the selected mode is unavailable or the user explicitly asks for CDP/script mode.\n\n## Script Directory\n\n**Important**: All scripts are located in the `scripts/` subdirectory of this skill.\n\n**Agent Execution Instructions**:\n1. Determine this SKILL.md file's directory path as `{baseDir}`\n2. Script path = `{baseDir}/scripts/<script-name>.ts`\n3. Replace all `{baseDir}` in this document with the actual path\n4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n**Script Reference**:\n| Script | Purpose |\n|--------|---------|\n| `scripts/x-browser.ts` | Regular posts (text + images), CDP fallback |\n| `scripts/x-video.ts` | Video posts (text + video), CDP fallback |\n| `scripts/x-quote.ts` | Quote tweet with comment, CDP fallback |\n| `scripts/x-article.ts` | Long-form article publishing (Markdown), CDP fallback |\n| `scripts/md-to-html.ts` | Markdown → HTML conversion |\n| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |\n| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |\n| `scripts/check-paste-permissions.ts` | Verify environment & permissions |\n\n## Execution Mode Selection (Required)\n\nChoose exactly one mode before interacting with X:\n\n1. If the user explicitly asks for the Codex Chrome plugin, `@chrome`, the Chrome extension, or \"Codex 自带的 Chrome 插件\", use **Codex Chrome Plugin Mode**. Do not call Computer Use first.\n2. If the user explicitly asks for Chrome Computer Use, use **Chrome Computer Use Mode**. Do not fall back to CDP, Playwright, the in-app Browser, or the Chrome plugin without telling the user and getting approval.\n3. If the user explicitly asks for CDP/script mode, use **CDP Script Mode**.\n4. Otherwise, prefer **Chrome Computer Use Mode**. For Markdown **X Articles with local content images**, use the tested X editor flow: insert each body image from the toolbar (`Insert` -> `Media` -> dialog icon button `Add photos or video`) at its placeholder, then delete the placeholder text. Use CDP Script Mode only when the selected browser-control mode is unavailable or the UI upload/selection flow is unreliable.\n\nNever use the in-app Browser for X publishing workflows.\n\n## Codex Chrome Plugin Mode\n\nUse this mode whenever the user requests the Codex Chrome plugin, `@chrome`, or the Chrome Extension path. This uses the user's real Chrome profile and X login through the bundled Chrome plugin, not Computer Use and not CDP.\n\n**Setup**\n1. Load the `chrome:Chrome` skill before browser work.\n2. Use `tool_search` for `node_repl js` if the Node REPL `js` tool is not already visible.\n3. Initialize the Chrome browser client exactly as the Chrome skill specifies, then run a lightweight call such as `browser.user.openTabs()` to verify the extension connection.\n4. If the first lightweight call fails, wait 2 seconds and retry once. If it still fails, follow the Chrome skill's extension checks and recovery steps. If checks pass but communication still fails, ask the user before opening a new Chrome window. Do not switch to Computer Use or CDP silently.\n\n**General rules**\n- Use the Chrome plugin's `browser.tabs.*`, `tab.playwright.*`, `tab.cua.*`, and file chooser APIs for X UI actions.\n- Shell commands are allowed for Markdown preprocessing and rich-HTML clipboard preparation. For X Article body images, do not rely on image clipboard paste; use the editor's `Insert` -> `Media` upload flow.\n- If a file upload fails with `Not allowed`, tell the user: `To enable file upload, go to chrome://extensions in Chrome, click Details under the Codex extension, and enable \"Allow access to file URLs.\" See https://developers.openai.com/codex/app/chrome-extension#upload-files for details.`\n- If the Chrome plugin reports `native pipe is closed`, retry the lightweight browser call once after 2 seconds, then run the Chrome skill health checks. If Chrome is running, the extension is enabled, and the native host manifest is correct, ask permission to open a new Chrome window and retry. Do not keep sending browser actions through the broken pipe.\n- Never click `Publish`, `Post`, or any externally visible submit action without explicit final confirmation from the user in the current conversation.\n\n**X Articles**\n1. Convert Markdown and keep the image map:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n   ```\n2. Read the JSON output for `title`, `coverImage`, and `contentImages` (`placeholder` → `localPath`).\n3. Open or create the article draft at `https://x.com/compose/articles`.\n4. Upload the cover with the Chrome plugin file chooser flow. If upload is blocked by extension permissions, stop and report the exact permission fix above.\n5. Fill the title, then copy rich HTML:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n   ```\n6. Paste into the article body with a real paste keystroke through the Chrome plugin. On macOS use `Meta+V`.\n7. Verify the editor text contains the article body and `XIMGPH_` placeholders. Do not rely on `tab.clipboard.readText()` as proof of the system clipboard after shell clipboard writes; on macOS verify with `pbpaste` if needed.\n8. For each `contentImages` item in placeholder order:\n   - Locate the visible placeholder text (`XIMGPH_N`) and click it to place the caret there.\n   - Open the toolbar menu `Insert` -> `Media`.\n   - In the modal, click the icon button with `aria-label=\"Add photos or video\"`; do not click the text/dropzone or hidden file input.\n   - Use the file chooser to upload that image's `localPath`.\n   - After the image appears, if `XIMGPH_N` remains above it, select exactly that placeholder and press `Delete` first. Use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n   - Verify the placeholder count for that `XIMGPH_N` is `0`.\n9. Open Preview and verify title, cover, body, links, and images.\n10. Ask for explicit confirmation before clicking `Publish`.\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-post-to-x/EXTEND.md` | Project |\n| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-x/EXTEND.md` | XDG |\n| 3 | `$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md` | User home |\n\nIf none found, use defaults.\n\n**EXTEND.md supports**: Default Chrome profile\n\n## Prerequisites\n\n- Google Chrome or Chromium\n- `bun` runtime\n- First run: log in to X manually (session saved)\n\n## Pre-flight Check (Optional)\n\nBefore first use, suggest running the environment check. User can skip if they prefer.\n\n```bash\n${BUN_X} {baseDir}/scripts/check-paste-permissions.ts\n```\n\nChecks: Chrome, profile isolation, Bun, Accessibility, clipboard, paste keystroke, Chrome conflicts.\n\n**If any check fails**, provide fix guidance per item:\n\n| Check | Fix |\n|-------|-----|\n| Chrome | Install Chrome or set `X_BROWSER_CHROME_PATH` env var |\n| Profile dir | Shared profile at `baoyu-skills/chrome-profile` (see CLAUDE.md Chrome Profile section) |\n| Bun runtime | `brew install oven-sh/bun/bun` (macOS) or `npm install -g bun` |\n| Accessibility (macOS) | System Settings → Privacy & Security → Accessibility → enable terminal app |\n| Clipboard copy | Ensure Swift/AppKit available (macOS Xcode CLI tools: `xcode-select --install`) |\n| Paste keystroke (macOS) | Same as Accessibility fix above |\n| Paste keystroke (Linux) | Install `xdotool` (X11) or `ydotool` (Wayland) |\n\n## References\n\n- **Regular Posts**: See `references/regular-posts.md` for manual workflow, troubleshooting, and technical details\n- **X Articles**: See `references/articles.md` for long-form article publishing guide\n\n---\n\n## Chrome Computer Use Mode\n\nUse this mode when the user explicitly asks for Chrome Computer Use, or when no Chrome-plugin preference is stated and Codex can control `Google Chrome` with Computer Use. This uses the user's existing Chrome window, cookies, login, extensions, and X session.\n\n**General rules**:\n- Start each assistant turn that controls Chrome by calling `get_app_state` for `Google Chrome`.\n- Prefer element-index actions when available; use coordinates only for editor text selection or drag selection.\n- Do not use the in-app Browser, the Chrome plugin, Playwright, or CDP for X UI actions in this mode unless the user approves a mode change.\n- Never click `Publish`, `Post`, or any externally visible submit action without an explicit final confirmation from the user in the current conversation.\n\n**Regular posts**:\n1. Open or navigate Chrome to `https://x.com/compose/post`.\n2. Type the post text into the composer using Computer Use.\n3. For each image, run:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /absolute/path/to/image.png\n   ```\n4. Paste with Computer Use (`super+v` on macOS, `control+v` on Windows/Linux), then wait until X finishes uploading media.\n5. Ask for confirmation before clicking `Post`.\n\n**Video posts**:\n1. Open or navigate Chrome to `https://x.com/compose/post`.\n2. Type the post text into the composer.\n3. Use the visible media upload/file picker UI to attach the video.\n4. Wait for upload and processing to complete.\n5. Ask for confirmation before clicking `Post`.\n\n**Quote tweets**:\n1. Open the tweet URL in Chrome.\n2. Use the visible quote/repost UI to choose Quote.\n3. Type the comment.\n4. Ask for confirmation before clicking `Post`.\n\n**X Articles**:\n1. Convert Markdown and keep the image map:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n   ```\n2. Read the JSON output for `title`, `coverImage`, and `contentImages` (`placeholder` → `localPath`).\n3. In Chrome, open `https://x.com/compose/articles`, create or open the draft, upload the cover if present, and fill the title.\n4. Copy rich HTML to the clipboard:\n   ```bash\n   ${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n   ```\n5. Paste into the article body with Computer Use.\n6. For each `contentImages` entry in placeholder order:\n   - Locate the exact visible placeholder text such as `XIMGPH_3` and click it to set the insertion point.\n   - Open the toolbar `Insert` dropdown, choose `Media`, then click the modal's icon button labeled `Add photos or video`.\n   - Use the native file picker to choose the image's `localPath`.\n   - Wait until the image block appears and any upload activity is finished.\n   - If the placeholder remains above the inserted image, reselect exactly that placeholder text and press `Delete` first. Use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n7. Verify no `XIMGPH_` placeholders remain and the expected images appear.\n8. Open Preview and verify title, cover, body, links, and images.\n9. Ask for explicit confirmation before clicking `Publish`.\n\nIf Computer Use selection, toolbar upload, or file-picker control becomes unreliable, stop and report the blocker instead of switching to the Chrome plugin or CDP silently.\n\n---\n\n## CDP Script Mode (Fallback)\n\nUse the script sections below only when the selected browser-control mode is unavailable, unreliable, or explicitly not requested. These scripts launch or reuse a real Chrome instance via CDP and keep the browser open for review.\n\nDo not use CDP Script Mode when the user explicitly requires the Codex Chrome plugin or Chrome Computer Use unless the user approves the fallback after you explain the blocker.\n\n---\n\n## Post Type Selection\n\nUnless the user explicitly specifies the post type:\n- **Plain text** + within 10,000 characters → **Regular Post** (Premium members support up to 10,000 characters, non-Premium: 280)\n- **Markdown file** (.md) → **X Article**\n\n## Regular Posts\n\n```bash\n${BUN_X} {baseDir}/scripts/x-browser.ts \"Hello!\" --image ./photo.png\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--image <path>` | Image file (repeatable, max 4) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-browser.ts`.\n\n---\n\n## Video Posts\n\nText + video file.\n\n```bash\n${BUN_X} {baseDir}/scripts/x-video.ts \"Check this out!\" --video ./clip.mp4\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--video <path>` | Video file (MP4, MOV, WebM) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-video.ts`.\n\n**Limits**: Regular 140s max, Premium 60min. Processing: 30-60s.\n\n---\n\n## Quote Tweets\n\nQuote an existing tweet with comment.\n\n```bash\n${BUN_X} {baseDir}/scripts/x-quote.ts https://x.com/user/status/123 \"Great insight!\"\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<tweet-url>` | URL to quote (positional) |\n| `<comment>` | Comment text (positional, optional) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Note**: Script opens browser with content filled in. User reviews and publishes manually.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, use **Codex Chrome Plugin Mode**. Otherwise, if Chrome Computer Use is enabled, use **Chrome Computer Use Mode** instead of running `x-quote.ts`.\n\n---\n\n## X Articles\n\nLong-form Markdown articles (requires X Premium).\n\n```bash\n${BUN_X} {baseDir}/scripts/x-article.ts article.md\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<markdown>` | Markdown file (positional) |\n| `--cover <path>` | Cover image |\n| `--title <text>` | Override title |\n\n**Frontmatter**: `title`, `cover_image` supported in YAML front matter.\n\n**Codex mode note**: If the user explicitly requested the Codex Chrome plugin, follow **Codex Chrome Plugin Mode** above. If the user explicitly requested Chrome Computer Use, follow **Chrome Computer Use Mode**. Otherwise, prefer Chrome Computer Use; for Markdown articles with local content images, use the toolbar `Insert` -> `Media` image-upload workflow before falling back to `x-article.ts` in **CDP Script Mode**.\n\n**CDP fallback note**: The script opens browser with article filled in. User reviews and publishes manually unless `--submit` is used.\n\n**Publish safety**: Do not use `--submit` or click `Publish` unless the user explicitly confirms the final public publish action.\n\n**Post-Composition Check**: The script automatically verifies after all images are inserted:\n- Remaining `XIMGPH_` placeholders in editor content\n- Expected vs actual image count\n\nIf the check fails (warnings in output), alert the user with the specific issues before they publish.\n\n---\n\n## Troubleshooting\n\n### Chrome debug port not ready\n\nCDP fallback only: if a script fails with `Chrome debug port not ready` or `Unable to connect`, kill existing Chrome CDP instances first, then retry:\n\n```bash\npkill -f \"Chrome.*remote-debugging-port\" 2>/dev/null; pkill -f \"Chromium.*remote-debugging-port\" 2>/dev/null; sleep 2\n```\n\n**Important**: This should be done automatically — when encountering this error, kill Chrome CDP instances and retry the command without asking the user.\n\n## Notes\n\n- First run: manual login required (session persists)\n- In Codex Chrome Plugin Mode and Chrome Computer Use Mode, use the user's existing Chrome session and do not launch a separate CDP profile\n- CDP scripts only fill content into the browser by default; user must review and publish manually unless `--submit` is explicitly used\n- Cross-platform: macOS, Linux, Windows\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v1.57.2:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-post-to-x\",\n  \"version\": \"1.57.2\",\n  \"publishedAt\": 1779660584592\n}\n\nFile v1.57.2:references/articles.md\n\n# X Articles - Detailed Guide\n\nPublish Markdown articles to X Articles editor with rich text formatting and images.\n\n## Mode Selection\n\nIn Codex, choose the browser-control mode from the user's wording:\n\n1. If the user says \"Codex Chrome plugin\", \"Codex 自带的 Chrome 插件\", `@chrome`, or Chrome Extension, use **Codex Chrome Plugin Workflow**. Do not try Computer Use first.\n2. If the user explicitly asks for Chrome Computer Use, use **Computer Use Workflow**.\n3. If the user explicitly asks for CDP/script mode, use **CDP Script Workflow**.\n4. Otherwise, use Computer Use when available; if unavailable or blocked, use CDP Script Workflow.\n\nNever use the in-app Browser for X Article publishing. Never switch away from an explicitly requested mode without explaining the blocker and getting approval.\n\n## Prerequisites\n\n- X Premium subscription (required for Articles)\n- Google Chrome installed\n- `bun` installed\n\n## Usage\n\n### Codex Chrome Plugin (When Requested)\n\nUse the `chrome:Chrome` skill and its Node REPL browser client. Verify the connection with a lightweight call such as `browser.user.openTabs()`. If it fails, wait 2 seconds and retry once, then follow the Chrome skill's health checks.\n\nPrepare the article HTML and image map:\n\n```bash\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n```\n\nCopy generated HTML as rich text:\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n```\n\nUse the Chrome plugin's tab, Playwright-wrapper, CUA, clipboard, and file chooser APIs for all X UI operations. If upload fails with `Not allowed`, stop and tell the user to enable file URL access for the Codex Chrome Extension in `chrome://extensions` → Details.\n\n### Chrome Computer Use\n\nPrepare the article HTML and image map:\n\n```bash\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n```\n\nCopy the generated HTML as rich text:\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n```\n\nThen use Codex Computer Use against `Google Chrome` for all X UI operations.\n\n### CDP Script Fallback\n\n```bash\n# Publish markdown article (preview mode)\n${BUN_X} {baseDir}/scripts/x-article.ts article.md\n\n# With custom cover image\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\n\n# Actually publish\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --submit\n```\n\nDo not use `--submit` unless the user has explicitly confirmed the final public publish action.\n\n## Markdown Format\n\n```markdown\n---\ntitle: My Article Title\ncover_image: /path/to/cover.jpg\n---\n\n# Title (becomes article title)\n\nRegular paragraph text with **bold** and *italic*.\n\n## Section Header\n\nMore content here.\n\n![Image alt text](./image.png)\n\n- List item 1\n- List item 2\n\n1. Numbered item\n2. Another item\n\n> Blockquote text\n\n[Link text](https://example.com)\n\n\\`\\`\\`\nCode blocks become blockquotes (X doesn't support code)\n\\`\\`\\`\n```\n\n## Frontmatter Fields\n\n| Field | Description |\n|-------|-------------|\n| `title` | Article title (or uses first H1) |\n| `cover_image` | Cover image path or URL |\n| `cover` | Alias for cover_image |\n| `image` | Alias for cover_image |\n\n## Image Handling\n\n1. **Cover Image**: First image or `cover_image` from frontmatter\n2. **Remote Images**: Automatically downloaded to temp directory\n3. **Placeholders**: Images in content use `XIMGPH_N` format\n4. **Insertion**: Placeholders are found, selected, and replaced with actual images\n\n## Markdown to HTML Script\n\nConvert markdown and inspect structure:\n\n```bash\n# Get JSON with all metadata\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md\n\n# Output HTML only\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --html-only\n\n# Save HTML to file\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/article.html\n```\n\nJSON output:\n```json\n{\n  \"title\": \"Article Title\",\n  \"coverImage\": \"/path/to/cover.jpg\",\n  \"contentImages\": [\n    {\n      \"placeholder\": \"XIMGPH_1\",\n      \"localPath\": \"/tmp/x-article-images/img.png\",\n      \"blockIndex\": 5\n    }\n  ],\n  \"html\": \"<p>Content...</p>\",\n  \"totalBlocks\": 20\n}\n```\n\n## Supported Formatting\n\n| Markdown | HTML Output |\n|----------|-------------|\n| `# H1` | Title only (not in body) |\n| `## H2` - `###### H6` | `<h2>` |\n| `**bold**` | `<strong>` |\n| `*italic*` | `<em>` |\n| `[text](url)` | `<a href>` |\n| `> quote` | `<blockquote>` |\n| `` `code` `` | `<code>` |\n| ```` ``` ```` | `<blockquote>` (X limitation) |\n| `- item` | `<ul><li>` |\n| `1. item` | `<ol><li>` |\n| `![](img)` | Image placeholder |\n\n## Codex Chrome Plugin Workflow\n\n1. **Load Chrome skill**: use `chrome:Chrome`, not Computer Use.\n2. **Connect**: initialize the Chrome plugin browser client and verify with `browser.user.openTabs()`.\n3. **Parse Markdown**: run `md-to-html.ts --save-html /tmp/x-article-body.html > /tmp/x-article.json`.\n4. **Read the map**: use `/tmp/x-article.json` for `title`, `coverImage`, and `contentImages`.\n5. **Open X Articles**: open or claim a Chrome tab for `https://x.com/compose/articles`.\n6. **Create Draft**: click the create/write button if needed, or open the target draft.\n7. **Upload Cover**: use the Chrome plugin file chooser flow. If file upload returns `Not allowed`, report the Chrome Extension file-access fix and stop.\n8. **Fill Title**: fill the title field.\n9. **Paste Content**:\n   - Run `copy-to-clipboard.ts html --file /tmp/x-article-body.html`.\n   - Click the article body.\n   - Press `Meta+V` on macOS or `Control+V` on Windows/Linux through the Chrome plugin.\n   - Verify the article body appeared and contains `XIMGPH_` placeholders. On macOS, use `pbpaste` to verify shell-written system clipboard contents if paste is suspicious; `tab.clipboard.readText()` may not reflect the system clipboard after shell writes.\n10. **Insert Images**: for each `contentImages` item in placeholder order:\n   - Locate the exact visible placeholder text (`XIMGPH_N`) and click it to put the insertion point there.\n   - Open the editor toolbar dropdown `Insert` and choose `Media`.\n   - In the `Insert` modal, click the icon button with `aria-label=\"Add photos or video\"`; do not click the \"Choose a file or drag it here\" text/dropzone or hidden file input.\n   - Use the Chrome plugin file chooser flow to upload that image's `localPath`.\n   - Wait until the image block appears. If `XIMGPH_N` remains above the image, select exactly that placeholder and press `Delete` first; use `Backspace` only if `Delete` fails and the selected text is confirmed to be exactly the placeholder.\n   - Verify that placeholder's count is `0` before continuing.\n11. **Verify**:\n   - Inspect the editor for `XIMGPH_` residue.\n   - Confirm the expected number of image blocks is visible.\n   - Open Preview and verify title, cover, body, links, and images.\n12. **Publish Safety**: ask the user for explicit final confirmation before clicking `Publish`.\n\nIf the Chrome plugin reports `native pipe is closed`, retry one lightweight browser call after 2 seconds, then run the Chrome skill health checks. If Chrome, the extension, and native host are healthy, ask the user before opening a new Chrome window and retrying.\n\n## Computer Use Workflow\n\n1. **Detect Computer Use**: call `get_app_state` for `Google Chrome`; use `tool_search` first if the tools are not visible.\n2. **Parse Markdown**: run `md-to-html.ts --save-html /tmp/x-article-body.html > /tmp/x-article.json`.\n3. **Read the map**: use `/tmp/x-article.json` for `title`, `coverImage`, and `contentImages`.\n4. **Open X Articles**: use Chrome Computer Use to navigate to `https://x.com/compose/articles`.\n5. **Create Draft**: click the create/write button if needed, or open the target draft.\n6. **Upload Cover**: if `coverImage` exists, use Chrome's visible upload/file picker UI. If the file picker cannot be operated reliably, stop and ask for help rather than switching to CDP silently.\n7. **Fill Title**: type the title into the title field.\n8. **Paste Content**:\n   - Run `copy-to-clipboard.ts html --file /tmp/x-article-body.html`.\n   - Click the article body.\n   - Press `super+v` on macOS or `control+v` on Windows/Linux with Computer Use.\n9. **Insert Images**: for each `contentImages` item in placeholder order:\n   - Locate the exact visible placeholder text (`XIMGPH_N`) and click it to put the insertion point there.\n   - Open the editor toolbar dropdown `Insert`, choose `Media`, then click the icon button with `aria-label=\"Add photos or video\"` inside the modal.\n   - Use the native file picker to choose that image's `localPath`.\n   - Wait until the image block appears and upload activity is complete.\n   - If `XIMGPH_N` remains above the inserted image, reselect exactly that placeholder text and press `Delete` first; use `Backspace` only if `Delete` fails and the Computer Use state confirms the selected text is exactly the placeholder.\n   - Confirm that placeholder is gone before continuing.\n10. **Verify**:\n   - Inspect the Computer Use state for `XIMGPH_` residue.\n   - Confirm the expected number of image blocks is visible.\n   - Open Preview and verify title, cover, body, links, and images.\n11. **Publish Safety**: ask the user for explicit final confirmation before clicking `Publish`.\n\n## CDP Script Workflow (Fallback)\n\n1. **Parse Markdown**: Extract title, cover, content images, generate HTML\n2. **Launch Chrome**: Real browser with CDP, persistent login\n3. **Navigate**: Open `x.com/compose/articles`\n4. **Create Article**: Click create button if on list page\n5. **Upload Cover**: Use file input for cover image\n6. **Fill Title**: Type title into title field\n7. **Paste Content**: Copy HTML to clipboard, paste into editor\n8. **Insert Images**: For each placeholder in placeholder order:\n   - Find and click the placeholder text in the editor\n   - Use `Insert` -> `Media`\n   - Click the modal's icon button labeled `Add photos or video`\n   - Upload the matching image file\n   - Delete the leftover placeholder text with `Delete` after the image appears\n9. **Post-Composition Check** (automatic):\n   - Scan editor for remaining `XIMGPH_` placeholders\n   - Compare expected vs actual image count\n   - Warn if issues found\n10. **Review**: Browser stays open for 60s preview\n11. **Publish**: Only with `--submit` flag and explicit user confirmation\n\n## Example Session\n\n```\nUser: /post-to-x article ./blog/my-post.md --cover ./thumbnail.png\n\nClaude:\n1. Detects that the user requested the Codex Chrome plugin\n2. Parses markdown: title=\"My Post\", 3 content images\n3. Saves `/tmp/x-article-body.html` and `/tmp/x-article.json`\n4. Uses the Chrome plugin to open X Articles and create a draft\n5. Uploads thumbnail.png as cover\n6. Fills title \"My Post\"\n7. Pastes HTML content with a real Chrome paste\n8. Inserts 3 images at placeholder positions\n9. Opens Preview and asks before publishing\n```\n\n## Troubleshooting\n\n- **No create button**: Ensure X Premium subscription is active\n- **Cover upload fails**: Check file path and format (PNG, JPEG)\n- **Images not inserting**: Verify placeholders exist in pasted content; use `Insert` -> `Media` -> modal icon button `Add photos or video`, not image clipboard paste, the dropzone text, or the hidden file input.\n- **Content not pasting**: Check HTML clipboard: `${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/test.html`\n- **Chrome plugin `native pipe is closed`**: retry once after 2 seconds, then run Chrome skill checks; ask before opening a new Chrome window if checks pass.\n- **Chrome plugin upload `Not allowed`**: enable file URL access for the Codex Chrome Extension in `chrome://extensions` → Details.\n- **Computer Use unavailable**: Use the CDP fallback script, unless the user explicitly required Chrome Computer Use.\n- **Placeholder remains after upload**: Select only the placeholder text and press `Delete` after upload completes. Use `Backspace` only if `Delete` fails and the selection is exactly the placeholder.\n\n## How It Works\n\n1. `md-to-html.ts` converts Markdown to HTML:\n   - Extracts frontmatter (title, cover)\n   - Converts markdown to HTML\n   - Replaces images with unique placeholders\n   - Downloads remote images locally\n   - Returns structured JSON\n\n2. The Codex Chrome plugin publishes through the user's real Chrome session when explicitly requested:\n   - Uses the user's active Chrome profile and logged-in X session\n   - Uses the Chrome Extension browser client rather than Computer Use or CDP\n   - Uses `copy-to-clipboard.ts` for rich HTML body paste\n   - Inserts body images through X's toolbar `Insert` -> `Media` modal and its `Add photos or video` icon button\n   - Keeps the final publish click under user confirmation\n\n3. Chrome Computer Use publishes through the user's visible Chrome UI:\n   - Uses the user's active Chrome profile and logged-in X session\n   - Uses `copy-to-clipboard.ts` for rich HTML body paste\n   - Inserts body images through X's toolbar `Insert` -> `Media` modal and its `Add photos or video` icon button\n   - Uses real keystrokes (`super+v`/`control+v`) through Codex Computer Use\n   - Keeps the final publish click under user confirmation\n\n4. `x-article.ts` publishes via CDP as a fallback:\n   - Launches real Chrome (bypasses detection)\n   - Uses persistent profile (saved login)\n   - Navigates and fills editor via DOM manipulation\n   - Pastes HTML from system clipboard\n   - Finds/selects/replaces each image placeholder\n\nFile v1.57.2:references/regular-posts.md\n\n# Regular Posts - Detailed Guide\n\nDetailed documentation for posting text and images to X.\n\n## Manual Workflow\n\nIf you prefer step-by-step control:\n\n### Step 0: Prefer Chrome Computer Use in Codex\n\nWhen running inside Codex, first detect whether Chrome Computer Use is enabled:\n\n1. If Computer Use tools are already visible, call `get_app_state` for `Google Chrome`.\n2. If not, use `tool_search` for `computer-use get_app_state click press_key drag scroll Google Chrome`, then call `get_app_state`.\n3. If `get_app_state` succeeds, use the user's real Chrome with Computer Use for all X UI actions.\n4. Use CDP scripts only when Computer Use is unavailable or explicitly requested.\n\nIf the user explicitly asks for Chrome Computer Use, do not use Playwright, the in-app Browser, or CDP without approval.\n\n### Step 1: Copy Image to Clipboard\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /path/to/image.png\n```\n\n### Step 2: Paste from Clipboard\n\n```bash\n# Simple paste to frontmost app\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts\n\n# Paste to Chrome with retries\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts --app \"Google Chrome\" --retries 5\n\n# Quick paste with shorter delay\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts --delay 200\n```\n\n### Step 3: Use Chrome Computer Use (Preferred)\n\n1. Use `get_app_state` for `Google Chrome`.\n2. Navigate Chrome to `https://x.com/compose/post` if needed.\n3. Click the composer and type the post text.\n4. Copy each image to the clipboard with `copy-to-clipboard.ts image <path>`.\n5. Press `super+v` on macOS or `control+v` on Windows/Linux with Computer Use.\n6. Wait until X finishes media upload.\n7. Ask for explicit confirmation before clicking `Post`.\n\n## Image Support\n\n- Formats: PNG, JPEG, GIF, WebP\n- Max 4 images per post\n- Images copied to system clipboard, then pasted via keyboard shortcut\n\n## Example Session\n\n```\nUser: /post-to-x \"Hello from Claude!\" --image ./screenshot.png\n\nClaude:\n1. Detects Chrome Computer Use\n2. Opens X compose in the user's real Chrome\n3. Types text into editor\n4. Copies image to clipboard and pastes with Computer Use\n5. Waits for upload and verifies the preview\n6. Asks before clicking Post\n```\n\n## Troubleshooting\n\n- **Chrome not found**: Set `X_BROWSER_CHROME_PATH` environment variable\n- **Not logged in**: First run opens Chrome - log in manually, cookies are saved\n- **Image paste fails**:\n  - Verify clipboard script: `${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image <path>`\n  - On macOS, grant \"Accessibility\" permission to Terminal/iTerm in System Settings > Privacy & Security > Accessibility\n  - Keep Chrome window visible and in front during paste operations\n- **osascript permission denied**: Grant Terminal accessibility permissions in System Preferences\n- **Rate limited**: Wait a few minutes before retrying\n\n## How It Works\n\nIn Chrome Computer Use mode:\n1. Codex controls the user's visible Google Chrome window\n2. Text is typed through the real UI\n3. Images are copied to the system clipboard and pasted with real keystrokes\n4. The user confirms before the final public post\n\nThe `x-browser.ts` script is the CDP fallback. It uses Chrome DevTools Protocol (CDP) to:\n1. Launch real Chrome (not Playwright) with `--disable-blink-features=AutomationControlled`\n2. Use persistent profile directory for saved login sessions\n3. Interact with X via CDP commands (Runtime.evaluate, Input.dispatchKeyEvent)\n4. **Paste images using osascript** (macOS): Sends real Cmd+V keystroke to Chrome, bypassing CDP's synthetic events that X can detect\n\nThis approach bypasses X's anti-automation detection that blocks Playwright/Puppeteer.\n\n### Image Paste Mechanism (macOS)\n\nCDP's `Input.dispatchKeyEvent` sends \"synthetic\" keyboard events that websites can detect. X ignores synthetic paste events for security. The solution:\n\n1. Copy image to system clipboard via Swift/AppKit (`copy-to-clipboard.ts`)\n2. Bring Chrome to front via `osascript`\n3. Send real Cmd+V keystroke via `osascript` and System Events\n4. Wait for upload to complete\n\nThis requires Terminal to have \"Accessibility\" permission in System Settings.\n\nFile v1.57.2:scripts/package.json\n\n{\n  \"name\": \"baoyu-post-to-x-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.0\",\n    \"front-matter\": \"^4.0.2\",\n    \"highlight.js\": \"^11.11.1\",\n    \"marked\": \"^15.0.6\",\n    \"remark-cjk-friendly\": \"^1.1.0\",\n    \"remark-parse\": \"^11.0.0\",\n    \"remark-stringify\": \"^11.0.0\",\n    \"unified\": \"^11.0.5\"\n  }\n}\n\nFile v1.57.2:skill-card.md\n\n## Description: <br>\nPosts content and articles to X (Twitter), including regular posts with images or videos and long-form Markdown articles, using Chrome-based workflows selected from the user's requested mode. <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 and agent users use this skill to prepare X posts, quote posts, media posts, and X Articles from text, Markdown, and local media while keeping the final public publish action under user confirmation. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can operate a real logged-in X account and prepare externally visible posts or articles. <br>\nMitigation: Review every composed post before publishing, require explicit final confirmation, and avoid unattended --submit flows. <br>\nRisk: The skill uses Chrome sessions, raw session-cookie checks, OS-level paste, and clipboard operations that can expose account or clipboard-sensitive data. <br>\nMitigation: Run only in a trusted local environment, keep Chrome visible for review, and avoid placing secrets or unrelated sensitive content on the clipboard during use. <br>\nRisk: Remote images, local file uploads, and browser automation can behave differently across environments and permissions. <br>\nMitigation: Prefer visible Chrome plugin or Computer Use workflows, use trusted media sources, and stop for user review when upload permissions or editor behavior fail. <br>\nRisk: Chrome cleanup or process-kill guidance can disrupt active browser work if applied broadly. <br>\nMitigation: Scope cleanup to the specific debugging session and get user approval before actions that could close unrelated Chrome windows or sessions. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/jimliu/baoyu-post-to-x) <br>\n- [Project Homepage](https://github.com/JimLiu/baoyu-skills#baoyu-post-to-x) <br>\n- [Regular Posts Guide](references/regular-posts.md) <br>\n- [X Articles Guide](references/articles.md) <br>\n- [Codex Chrome Extension File Upload Guidance](https://developers.openai.com/codex/app/chrome-extension#upload-files) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands, browser workflow steps, and generated posting or article drafts in a logged-in Chrome session] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May compose externally visible X posts or articles; final publishing should require explicit user confirmation and unattended --submit flows should be avoided unless clearly requested.] <br>\n\n## Skill Version(s): <br>\n1.57.2 (source: frontmatter and release evidence) <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 v0.1.0: 12 files, 35490 bytes\n\nFiles: references/articles.md (4618b), references/regular-posts.md (3456b), scripts/copy-to-clipboard.ts (12163b), scripts/md-to-html.ts (12638b), scripts/paste-from-clipboard.ts (5659b), scripts/x-article.ts (28519b), scripts/x-browser.ts (7772b), scripts/x-quote.ts (8634b), scripts/x-utils.ts (8712b), scripts/x-video.ts (9068b), SKILL.md (7000b), _meta.json (134b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: baoyu-post-to-x\ndescription: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). Uses real Chrome with CDP to bypass anti-automation. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\".\n---\n\n# Post to X (Twitter)\n\nPosts text, images, videos, and long-form articles to X via real Chrome browser (bypasses anti-bot detection).\n\n## Script Directory\n\n**Important**: All scripts are located in the `scripts/` subdirectory of this skill.\n\n**Agent Execution Instructions**:\n1. Determine this SKILL.md file's directory path as `SKILL_DIR`\n2. Script path = `${SKILL_DIR}/scripts/<script-name>.ts`\n3. Replace all `${SKILL_DIR}` in this document with the actual path\n\n**Script Reference**:\n| Script | Purpose |\n|--------|---------|\n| `scripts/x-browser.ts` | Regular posts (text + images) |\n| `scripts/x-video.ts` | Video posts (text + video) |\n| `scripts/x-quote.ts` | Quote tweet with comment |\n| `scripts/x-article.ts` | Long-form article publishing (Markdown) |\n| `scripts/md-to-html.ts` | Markdown → HTML conversion |\n| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |\n| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |\n\n## Preferences (EXTEND.md)\n\nUse Bash to check EXTEND.md existence (priority order):\n\n```bash\n# Check project-level first\ntest -f .baoyu-skills/baoyu-post-to-x/EXTEND.md && echo \"project\"\n\n# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)\ntest -f \"$HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md\" && echo \"user\"\n```\n\n┌──────────────────────────────────────────────────┬───────────────────┐\n│                       Path                       │     Location      │\n├──────────────────────────────────────────────────┼───────────────────┤\n│ .baoyu-skills/baoyu-post-to-x/EXTEND.md          │ Project directory │\n├──────────────────────────────────────────────────┼───────────────────┤\n│ $HOME/.baoyu-skills/baoyu-post-to-x/EXTEND.md    │ User home         │\n└──────────────────────────────────────────────────┴───────────────────┘\n\n┌───────────┬───────────────────────────────────────────────────────────────────────────┐\n│  Result   │                                  Action                                   │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Found     │ Read, parse, apply settings                                               │\n├───────────┼───────────────────────────────────────────────────────────────────────────┤\n│ Not found │ Use defaults                                                              │\n└───────────┴───────────────────────────────────────────────────────────────────────────┘\n\n**EXTEND.md Supports**: Default Chrome profile | Auto-submit preference\n\n## Prerequisites\n\n- Google Chrome or Chromium\n- `bun` runtime\n- First run: log in to X manually (session saved)\n\n## References\n\n- **Regular Posts**: See `references/regular-posts.md` for manual workflow, troubleshooting, and technical details\n- **X Articles**: See `references/articles.md` for long-form article publishing guide\n\n---\n\n## Regular Posts\n\nText + up to 4 images.\n\n```bash\nnpx -y bun ${SKILL_DIR}/scripts/x-browser.ts \"Hello!\" --image ./photo.png          # Preview\nnpx -y bun ${SKILL_DIR}/scripts/x-browser.ts \"Hello!\" --image ./photo.png --submit  # Post\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--image <path>` | Image file (repeatable, max 4) |\n| `--submit` | Post (default: preview) |\n| `--profile <dir>` | Custom Chrome profile |\n\n---\n\n## Video Posts\n\nText + video file.\n\n```bash\nnpx -y bun ${SKILL_DIR}/scripts/x-video.ts \"Check this out!\" --video ./clip.mp4          # Preview\nnpx -y bun ${SKILL_DIR}/scripts/x-video.ts \"Amazing content\" --video ./demo.mp4 --submit  # Post\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<text>` | Post content (positional) |\n| `--video <path>` | Video file (MP4, MOV, WebM) |\n| `--submit` | Post (default: preview) |\n| `--profile <dir>` | Custom Chrome profile |\n\n**Limits**: Regular 140s max, Premium 60min. Processing: 30-60s.\n\n---\n\n## Quote Tweets\n\nQuote an existing tweet with comment.\n\n```bash\nnpx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 \"Great insight!\"          # Preview\nnpx -y bun ${SKILL_DIR}/scripts/x-quote.ts https://x.com/user/status/123 \"I agree!\" --submit       # Post\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<tweet-url>` | URL to quote (positional) |\n| `<comment>` | Comment text (positional, optional) |\n| `--submit` | Post (default: preview) |\n| `--profile <dir>` | Custom Chrome profile |\n\n---\n\n## X Articles\n\nLong-form Markdown articles (requires X Premium).\n\n```bash\nnpx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md                        # Preview\nnpx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --cover ./cover.jpg    # With cover\nnpx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --submit               # Publish\n```\n\n**Parameters**:\n| Parameter | Description |\n|-----------|-------------|\n| `<markdown>` | Markdown file (positional) |\n| `--cover <path>` | Cover image |\n| `--title <text>` | Override title |\n| `--submit` | Publish (default: preview) |\n\n**Frontmatter**: `title`, `cover_image` supported in YAML front matter.\n\n---\n\n## Notes\n\n- First run: manual login required (session persists)\n- Always preview before `--submit`\n- Cross-platform: macOS, Linux, Windows\n\n## Extension Support\n\nCustom configurations via EXTEND.md. See **Preferences** section for paths and supported options.\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-post-to-x\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1770263078722\n}\n\nFile v0.1.0:references/articles.md\n\n# X Articles - Detailed Guide\n\nPublish Markdown articles to X Articles editor with rich text formatting and images.\n\n## Prerequisites\n\n- X Premium subscription (required for Articles)\n- Google Chrome installed\n- `bun` installed\n\n## Usage\n\n```bash\n# Publish markdown article (preview mode)\nnpx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md\n\n# With custom cover image\nnpx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --cover ./cover.jpg\n\n# Actually publish\nnpx -y bun ${SKILL_DIR}/scripts/x-article.ts article.md --submit\n```\n\n## Markdown Format\n\n```markdown\n---\ntitle: My Article Title\ncover_image: /path/to/cover.jpg\n---\n\n# Title (becomes article title)\n\nRegular paragraph text with **bold** and *italic*.\n\n## Section Header\n\nMore content here.\n\n![Image alt text](./image.png)\n\n- List item 1\n- List item 2\n\n1. Numbered item\n2. Another item\n\n> Blockquote text\n\n[Link text](https://example.com)\n\n\\`\\`\\`\nCode blocks become blockquotes (X doesn't support code)\n\\`\\`\\`\n```\n\n## Frontmatter Fields\n\n| Field | Description |\n|-------|-------------|\n| `title` | Article title (or uses first H1) |\n| `cover_image` | Cover image path or URL |\n| `cover` | Alias for cover_image |\n| `image` | Alias for cover_image |\n\n## Image Handling\n\n1. **Cover Image**: First image or `cover_image` from frontmatter\n2. **Remote Images**: Automatically downloaded to temp directory\n3. **Placeholders**: Images in content use `XIMGPH_N` format\n4. **Insertion**: Placeholders are found, selected, and replaced with actual images\n\n## Markdown to HTML Script\n\nConvert markdown and inspect structure:\n\n```bash\n# Get JSON with all metadata\nnpx -y bun ${SKILL_DIR}/scripts/md-to-html.ts article.md\n\n# Output HTML only\nnpx -y bun ${SKILL_DIR}/scripts/md-to-html.ts article.md --html-only\n\n# Save HTML to file\nnpx -y bun ${SKILL_DIR}/scripts/md-to-html.ts article.md --save-html /tmp/article.html\n```\n\nJSON output:\n```json\n{\n  \"title\": \"Article Title\",\n  \"coverImage\": \"/path/to/cover.jpg\",\n  \"contentImages\": [\n    {\n      \"placeholder\": \"XIMGPH_1\",\n      \"localPath\": \"/tmp/x-article-images/img.png\",\n      \"blockIndex\": 5\n    }\n  ],\n  \"html\": \"<p>Content...</p>\",\n  \"totalBlocks\": 20\n}\n```\n\n## Supported Formatting\n\n| Markdown | HTML Output |\n|----------|-------------|\n| `# H1` | Title only (not in body) |\n| `## H2` - `###### H6` | `<h2>` |\n| `**bold**` | `<strong>` |\n| `*italic*` | `<em>` |\n| `[text](url)` | `<a href>` |\n| `> quote` | `<blockquote>` |\n| `` `code` `` | `<code>` |\n| ```` ``` ```` | `<blockquote>` (X limitation) |\n| `- item` | `<ul><li>` |\n| `1. item` | `<ol><li>` |\n| `![](img)` | Image placeholder |\n\n## Workflow\n\n1. **Parse Markdown**: Extract title, cover, content images, generate HTML\n2. **Launch Chrome**: Real browser with CDP, persistent login\n3. **Navigate**: Open `x.com/compose/articles`\n4. **Create Article**: Click create button if on list page\n5. **Upload Cover**: Use file input for cover image\n6. **Fill Title**: Type title into title field\n7. **Paste Content**: Copy HTML to clipboard, paste into editor\n8. **Insert Images**: For each placeholder (reverse order):\n   - Find placeholder text in editor\n   - Select the placeholder\n   - Copy image to clipboard\n   - Paste to replace selection\n9. **Review**: Browser stays open for 60s preview\n10. **Publish**: Only with `--submit` flag\n\n## Example Session\n\n```\nUser: /post-to-x article ./blog/my-post.md --cover ./thumbnail.png\n\nClaude:\n1. Parses markdown: title=\"My Post\", 3 content images\n2. Launches Chrome with CDP\n3. Navigates to x.com/compose/articles\n4. Clicks create button\n5. Uploads thumbnail.png as cover\n6. Fills title \"My Post\"\n7. Pastes HTML content\n8. Inserts 3 images at placeholder positions\n9. Reports: \"Article composed. Review and use --submit to publish.\"\n```\n\n## Troubleshooting\n\n- **No create button**: Ensure X Premium subscription is active\n- **Cover upload fails**: Check file path and format (PNG, JPEG)\n- **Images not inserting**: Verify placeholders exist in pasted content\n- **Content not pasting**: Check HTML clipboard: `npx -y bun ${SKILL_DIR}/scripts/copy-to-clipboard.ts html --file /tmp/test.html`\n\n## How It Works\n\n1. `md-to-html.ts` converts Markdown to HTML:\n   - Extracts frontmatter (title, cover)\n   - Converts markdown to HTML\n   - Replaces images with unique placeholders\n   - Downloads remote images locally\n   - Returns structured JSON\n\n2. `x-article.ts` publishes via CDP:\n   - Launches real Chrome (bypasses detection)\n   - Uses persistent profile (saved login)\n   - Navigates and fills editor via DOM manipulation\n   - Pastes HTML from system clipboard\n   - Finds/selects/replaces each image placeholder\n\nFile v0.1.0:references/regular-posts.md\n\n# Regular Posts - Detailed Guide\n\nDetailed documentation for posting text and images to X.\n\n## Manual Workflow\n\nIf you prefer step-by-step control:\n\n### Step 1: Copy Image to Clipboard\n\n```bash\nnpx -y bun ${SKILL_DIR}/scripts/copy-to-clipboard.ts image /path/to/image.png\n```\n\n### Step 2: Paste from Clipboard\n\n```bash\n# Simple paste to frontmost app\nnpx -y bun ${SKILL_DIR}/scripts/paste-from-clipboard.ts\n\n# Paste to Chrome with retries\nnpx -y bun ${SKILL_DIR}/scripts/paste-from-clipboard.ts --app \"Google Chrome\" --retries 5\n\n# Quick paste with shorter delay\nnpx -y bun ${SKILL_DIR}/scripts/paste-from-clipboard.ts --delay 200\n```\n\n### Step 3: Use Playwright MCP (if Chrome session available)\n\n```bash\n# Navigate\nmcp__playwright__browser_navigate url=\"https://x.com/compose/post\"\n\n# Get element refs\nmcp__playwright__browser_snapshot\n\n# Type text\nmcp__playwright__browser_click element=\"editor\" ref=\"<ref>\"\nmcp__playwright__browser_type element=\"editor\" ref=\"<ref>\" text=\"Your content\"\n\n# Paste image (after copying to clipboard)\nmcp__playwright__browser_press_key key=\"Meta+v\"  # macOS\n# or\nmcp__playwright__browser_press_key key=\"Control+v\"  # Windows/Linux\n\n# Screenshot to verify\nmcp__playwright__browser_take_screenshot filename=\"preview.png\"\n```\n\n## Image Support\n\n- Formats: PNG, JPEG, GIF, WebP\n- Max 4 images per post\n- Images copied to system clipboard, then pasted via keyboard shortcut\n\n## Example Session\n\n```\nUser: /post-to-x \"Hello from Claude!\" --image ./screenshot.png\n\nClaude:\n1. Runs: npx -y bun ${SKILL_DIR}/scripts/x-browser.ts \"Hello from Claude!\" --image ./screenshot.png\n2. Chrome opens with X compose page\n3. Text is typed into editor\n4. Image is copied to clipboard and pasted\n5. Browser stays open 30s for preview\n6. Reports: \"Post composed. Use --submit to post.\"\n```\n\n## Troubleshooting\n\n- **Chrome not found**: Set `X_BROWSER_CHROME_PATH` environment variable\n- **Not logged in**: First run opens Chrome - log in manually, cookies are saved\n- **Image paste fails**:\n  - Verify clipboard script: `npx -y bun ${SKILL_DIR}/scripts/copy-to-clipboard.ts image <path>`\n  - On macOS, grant \"Accessibility\" permission to Terminal/iTerm in System Settings > Privacy & Security > Accessibility\n  - Keep Chrome window visible and in front during paste operations\n- **osascript permission denied**: Grant Terminal accessibility permissions in System Preferences\n- **Rate limited**: Wait a few minutes before retrying\n\n## How It Works\n\nThe `x-browser.ts` script uses Chrome DevTools Protocol (CDP) to:\n1. Launch real Chrome (not Playwright) with `--disable-blink-features=AutomationControlled`\n2. Use persistent profile directory for saved login sessions\n3. Interact with X via CDP commands (Runtime.evaluate, Input.dispatchKeyEvent)\n4. **Paste images using osascript** (macOS): Sends real Cmd+V keystroke to Chrome, bypassing CDP's synthetic events that X can detect\n\nThis approach bypasses X's anti-automation detection that blocks Playwright/Puppeteer.\n\n### Image Paste Mechanism (macOS)\n\nCDP's `Input.dispatchKeyEvent` sends \"synthetic\" keyboard events that websites can detect. X ignores synthetic paste events for security. The solution:\n\n1. Copy image to system clipboard via Swift/AppKit (`copy-to-clipboard.ts`)\n2. Bring Chrome to front via `osascript`\n3. Send real Cmd+V keystroke via `osascript` and System Events\n4. Wait for upload to complete\n\nThis requires Terminal to have \"Accessibility\" permission in System Settings.","readmeExcerpt":"Skill: Baoyu Post To X Owner: jimliu Summary: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests f... Tags: latest:1.58.1 Version history: v1.58.1 | 2026-06-01T03:31:29.739Z | user Fix stale npm shared package dependency pins for baoyu-md and baoyu-chrome-cdp 0.1.1. v1.57.2 | 2026-05-24T22:09:44.592Z | auto baoyu-","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json"},{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html"},{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/check-paste-permissions.ts"},{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /absolute/path/to/image.png"},{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json"},{"language":"bash","snippet":"${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: baoyu-post-to-x\ndescription: Posts content and articles to X (Twitter). Supports regular posts with images/videos and X Articles (long-form Markdown). In Codex, honor explicit requests for the Codex Chrome plugin/@chrome by using the Chrome Extension workflow; otherwise use Chrome Computer Use when available and fall back to real Chrome CDP scripts only when allowed. Use when user asks to \"post to X\", \"tweet\", \"publish to Twitter\", or \"share on X\".\nversion: 1.58.1\nmetadata:\n  openclaw:\n    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-post-to-x\n    requires:\n      anyBins:\n        - bun\n        - npx\n---\n\n# Post to X (Twitter)\n\nPosts text, images, videos, and long-form articles to X via a real Chrome browser.\n\nIn Codex, do not conflate these browser paths:\n- **Codex Chrome plugin / `@chrome` / Chrome Extension**: use the bundled `chrome:Chrome` skill and its Node REPL browser client. This is required whenever the user says \"Codex Chrome plugin\", \"Codex 自带的 Chrome 插件\", `@chrome`, or similar.\n- **Chrome Computer Use**: use `mcp__computer_use__.*` against the visible Google Chrome UI only when the user asks for Computer Use or no Chrome-plugin preference is stated and Computer Use is available.\n- **CDP script mode**: use only as a fallback when the selected mode is unavailable or the user explicitly asks for CDP/script mode.\n\n## Script Directory\n\n**Important**: All scripts are located in the `scripts/` subdirectory of this skill.\n\n**Agent Execution Instructions**:\n1. Determine this SKILL.md file's directory path as `{baseDir}`\n2. Script path = `{baseDir}/scripts/<script-name>.ts`\n3. Replace all `{baseDir}` in this document with the actual path\n4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun\n\n**Script Reference**:\n| Script | Purpose |\n|--------|---------|\n| `scripts/x-browser.ts` | Regular posts (text + images), CDP fallback |\n| `scripts/x-video.ts` | Video posts (text + video), CDP fallback |\n| `scripts/x-quote.ts` | Quote tweet with comment, CDP fallback |\n| `scripts/x-article.ts` | Long-form article publishing (Markdown), CDP fallback |\n| `scripts/md-to-html.ts` | Markdown → HTML conversion |\n| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |\n| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |\n| `scripts/check-paste-permissions.ts` | Verify environment & permissions |\n\n## Execution Mode Selection (Required)\n\nChoose exactly one mode before interacting with X:\n\n1. If the user explicitly asks for the Codex Chrome plugin, `@chrome`, the Chrome extension, or \"Codex 自带的 Chrome 插件\", use **Codex Chrome Plugin Mode**. Do not call Computer Use first.\n2. If the user explicitly asks for Chrome Computer Use, use **Chrome Computer Use Mode**. Do not fall back to CDP, Playwright, the in-app Browser, or the Chrome plugin without telling the user and getting approval.\n3. If the user explicitly asks for CDP/script mode, use **CDP Script Mode**.\n4. "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7csrrndw79hpke5d0gsnx93d82k67r\",\n  \"slug\": \"baoyu-post-to-x\",\n  \"version\": \"1.58.1\",\n  \"publishedAt\": 1780284689739\n}"},{"path":"references/articles.md","content":"# X Articles - Detailed Guide\n\nPublish Markdown articles to X Articles editor with rich text formatting and images.\n\n## Mode Selection\n\nIn Codex, choose the browser-control mode from the user's wording:\n\n1. If the user says \"Codex Chrome plugin\", \"Codex 自带的 Chrome 插件\", `@chrome`, or Chrome Extension, use **Codex Chrome Plugin Workflow**. Do not try Computer Use first.\n2. If the user explicitly asks for Chrome Computer Use, use **Computer Use Workflow**.\n3. If the user explicitly asks for CDP/script mode, use **CDP Script Workflow**.\n4. Otherwise, use Computer Use when available; if unavailable or blocked, use CDP Script Workflow.\n\nNever use the in-app Browser for X Article publishing. Never switch away from an explicitly requested mode without explaining the blocker and getting approval.\n\n## Prerequisites\n\n- X Premium subscription (required for Articles)\n- Google Chrome installed\n- `bun` installed\n\n## Usage\n\n### Codex Chrome Plugin (When Requested)\n\nUse the `chrome:Chrome` skill and its Node REPL browser client. Verify the connection with a lightweight call such as `browser.user.openTabs()`. If it fails, wait 2 seconds and retry once, then follow the Chrome skill's health checks.\n\nPrepare the article HTML and image map:\n\n```bash\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n```\n\nCopy generated HTML as rich text:\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n```\n\nUse the Chrome plugin's tab, Playwright-wrapper, CUA, clipboard, and file chooser APIs for all X UI operations. If upload fails with `Not allowed`, stop and tell the user to enable file URL access for the Codex Chrome Extension in `chrome://extensions` → Details.\n\n### Chrome Computer Use\n\nPrepare the article HTML and image map:\n\n```bash\n${BUN_X} {baseDir}/scripts/md-to-html.ts article.md --save-html /tmp/x-article-body.html > /tmp/x-article.json\n```\n\nCopy the generated HTML as rich text:\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts html --file /tmp/x-article-body.html\n```\n\nThen use Codex Computer Use against `Google Chrome` for all X UI operations.\n\n### CDP Script Fallback\n\n```bash\n# Publish markdown article (preview mode)\n${BUN_X} {baseDir}/scripts/x-article.ts article.md\n\n# With custom cover image\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --cover ./cover.jpg\n\n# Actually publish\n${BUN_X} {baseDir}/scripts/x-article.ts article.md --submit\n```\n\nDo not use `--submit` unless the user has explicitly confirmed the final public publish action.\n\n## Markdown Format\n\n```markdown\n---\ntitle: My Article Title\ncover_image: /path/to/cover.jpg\n---\n\n# Title (becomes article title)\n\nRegular paragraph text with **bold** and *italic*.\n\n## Section Header\n\nMore content here.\n\n![Image alt text](./image.png)\n\n- List item 1\n- List item 2\n\n1. Numbered item\n2. Another item\n\n> Blockquote text\n\n[Link text](https://example.com)\n\n\\`\\`\\`\nCode blocks become blockquotes (X doesn't support "},{"path":"references/regular-posts.md","content":"# Regular Posts - Detailed Guide\n\nDetailed documentation for posting text and images to X.\n\n## Manual Workflow\n\nIf you prefer step-by-step control:\n\n### Step 0: Prefer Chrome Computer Use in Codex\n\nWhen running inside Codex, first detect whether Chrome Computer Use is enabled:\n\n1. If Computer Use tools are already visible, call `get_app_state` for `Google Chrome`.\n2. If not, use `tool_search` for `computer-use get_app_state click press_key drag scroll Google Chrome`, then call `get_app_state`.\n3. If `get_app_state` succeeds, use the user's real Chrome with Computer Use for all X UI actions.\n4. Use CDP scripts only when Computer Use is unavailable or explicitly requested.\n\nIf the user explicitly asks for Chrome Computer Use, do not use Playwright, the in-app Browser, or CDP without approval.\n\n### Step 1: Copy Image to Clipboard\n\n```bash\n${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image /path/to/image.png\n```\n\n### Step 2: Paste from Clipboard\n\n```bash\n# Simple paste to frontmost app\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts\n\n# Paste to Chrome with retries\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts --app \"Google Chrome\" --retries 5\n\n# Quick paste with shorter delay\n${BUN_X} {baseDir}/scripts/paste-from-clipboard.ts --delay 200\n```\n\n### Step 3: Use Chrome Computer Use (Preferred)\n\n1. Use `get_app_state` for `Google Chrome`.\n2. Navigate Chrome to `https://x.com/compose/post` if needed.\n3. Click the composer and type the post text.\n4. Copy each image to the clipboard with `copy-to-clipboard.ts image <path>`.\n5. Press `super+v` on macOS or `control+v` on Windows/Linux with Computer Use.\n6. Wait until X finishes media upload.\n7. Ask for explicit confirmation before clicking `Post`.\n\n## Image Support\n\n- Formats: PNG, JPEG, GIF, WebP\n- Max 4 images per post\n- Images copied to system clipboard, then pasted via keyboard shortcut\n\n## Example Session\n\n```\nUser: /post-to-x \"Hello from Claude!\" --image ./screenshot.png\n\nClaude:\n1. Detects Chrome Computer Use\n2. Opens X compose in the user's real Chrome\n3. Types text into editor\n4. Copies image to clipboard and pastes with Computer Use\n5. Waits for upload and verifies the preview\n6. Asks before clicking Post\n```\n\n## Troubleshooting\n\n- **Chrome not found**: Set `X_BROWSER_CHROME_PATH` environment variable\n- **Not logged in**: First run opens Chrome - log in manually, cookies are saved\n- **Image paste fails**:\n  - Verify clipboard script: `${BUN_X} {baseDir}/scripts/copy-to-clipboard.ts image <path>`\n  - On macOS, grant \"Accessibility\" permission to Terminal/iTerm in System Settings > Privacy & Security > Accessibility\n  - Keep Chrome window visible and in front during paste operations\n- **osascript permission denied**: Grant Terminal accessibility permissions in System Preferences\n- **Rate limited**: Wait a few minutes before retrying\n\n## How It Works\n\nIn Chrome Computer Use mode:\n1. Codex controls the user's visible Google Chrome window\n2. Text is typed through the real UI\n3. Images are copie"},{"path":"scripts/package.json","content":"{\n  \"name\": \"baoyu-post-to-x-scripts\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"dependencies\": {\n    \"baoyu-chrome-cdp\": \"^0.1.1\",\n    \"baoyu-md\": \"^0.1.1\",\n    \"front-matter\": \"^4.0.2\",\n    \"highlight.js\": \"^11.11.1\",\n    \"marked\": \"^15.0.6\",\n    \"remark-cjk-friendly\": \"^1.1.0\",\n    \"remark-parse\": \"^11.0.0\",\n    \"remark-stringify\": \"^11.0.0\",\n    \"unified\": \"^11.0.5\"\n  }\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1568,"uniquenessScore":40,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T05:05:54.645Z","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-09T05:05:54.645Z","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-10T00:50:18.167Z","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"}]}}}