imjszhang/js-eyes/js-x-ops-skill
Claude Code and agent skill by imjszhang/js-eyes
- community
Checking that the SKILL.md file is still in the repository.
X.com (Twitter) 内容只读 + 浏览器导航 + 账号监控 skill:搜索 / 用户主页 / 推文详情 / 首页 Feed 走 X.com 内部 GraphQL 同源端点(DOM 兜底),浏览器侧仅 location.assign 改 URL;内置 monitor 子系统做定时监控 + webhook 通知;写操作(reply/post/quote/thread)保持 v2.0.1 透传,v3.1 将拆到专用工具。
Install
npx vskill@latest install imjszhang/js-eyes/js-x-ops-skillSKILL.md
js-x-ops-skill
面向 x.com / twitter.com 的 skill。v3.0 起切到 PAGE_PROFILES + Bridges + Session 架构,参考 js-reddit-ops-skill 的设计取舍:
- 数据获取:READ 数据优先走 X.com 内部 GraphQL 同源端点(
/i/api/graphql/<queryId>/<op>),与浏览器同源、复用 cookie + bearer;DOM 解析(bridges/common.js::parseTweetArticle)保留为兜底 - safety 分级:READ + INTERACTIVE 已经落地;DESTRUCTIVE(reply / post / quote / thread)目前透传 v2.0.1 的
scripts/x-post.js,v3.1 拆 compose-bridge 后将走 `--confirm` + 默认 `--dry-run`
依赖与前置
- Node.js 22+、JS Eyes 2.8.5+;JS Eyes Server 已启动(
js-eyes server start) - 浏览器扩展:已安装并连上 server
- 登录态:浏览器里已经人工登录 x.com(本 skill 不做任何登录自动化);READ 工具默认
navigateOnReuse=false / reuseAnyXTab=true,bridge 在任意 x.com / twitter.com tab 里 fetch 同源 GraphQL;用户当前 tab 不会被切走 - Raw Eval:bridge 首次注入需要宿主设置
security.allowRawEval: true;JS Eyes 2.5+ 会把该设置同步到扩展,扩展存储中的显式false仍可强制关闭 - Chrome:要求 135+;Chrome 138+ 还需开启浏览器控制的 Allow User Scripts
安全红线(READ / INTERACTIVE / DESTRUCTIVE)
本 skill 的所有工具都会被归入以下三档之一。审计界线按「是否改 X 业务数据」而非「是否触网」来划:
READ(默认档)
纯读,不改任何 DOM、不改 URL、不触发任何业务写操作。
- 走
fetchXGraphQL(opName, vars, features)调 X.com 内部 GraphQL(GET,复用浏览器同源 cookie + 写死 bearer) - DOM 路径仅作为 bridge 失败时的兜底,由
bridges/common.js::parseTweetArticle / collectTweetsFromDom提供 - 工具:
x_search_tweets/x_get_profile/x_get_post/x_get_home_feed/x_session_state
INTERACTIVE(v3.0+)
只改浏览器自己的 URL,不改 X 侧任何业务数据。实现硬约束:
- 仅
location.assign(newUrl),禁止模拟点击任何 DOM CTA - bridge 端
navigateLocation()拒绝跨域 URL(必须是*.x.com/*.twitter.com) - 调用返回
{from, to, hint},CLI 端awaitBridgeAfterNav重注 bridge + state 自校验 skill.definition.js里带interactive: true/destructive: false- 工具:
x_navigate_search/x_navigate_profile/x_navigate_post/x_navigate_home
DESTRUCTIVE(v3.0 透传 v2 行为,v3.1 拆专用工具)
x_get_post 的 schema 里仍保留 --reply / --post / --quote / --thread / --image / --thread-delay / --thread-max / --reply-style 等写参数(v2.0.1 行为,CLI 透传 scripts/x-post.js),description 标 deprecated。等 v3.1 完成后:
- 拆
bridges/compose-bridge.js:DESTRUCTIVE 唯一入口 - 4 个独立工具:
x_create_tweet/x_reply_tweet/x_quote_tweet/x_create_thread - 默认
--dry-run,必须显式--confirm才落地 - 砍掉
x_get_post的写参数
提供的 AI 工具
| 档位 | 工具 | 页面 | 说明 | ||
|---|---|---|---|---|---|
| READ | x_search_tweets | /search?q= | 浏览器搜索:keyword / sort / maxPages / since / until / lang / from / minLikes … | ||
| READ | x_search_archive | —(Official API) | 全库/近期搜索:`scope=all | recent,需 X_BEARER_TOKEN`,可能产生 API 费用;无需浏览器 | |
| DESTRUCTIVE | x_create_article | —(Official API) | 创建 Article 草稿(Markdown→DraftJS);publish 需 confirm=true;OAuth 写凭证 | ||
| DESTRUCTIVE | x_publish_article | —(Official API) | 发布已有 Article 草稿;需 confirm=true;可能需 X Premium | ||
| READ | x_get_profile | /<username> | 用户主页时间线:username / maxPages / includeReplies / since | ||
| READ | x_get_post | /<user>/status/<id> 或 /i/article/<id> 或 t.co/* | 推文/Article 详情(自动识别);withThread / withReplies;写参数 deprecated | ||
| READ | x_download_media | /<user>/status/<id> | 读取推文并下载图片/视频到本地(local file side effect) | ||
| READ | x_get_home_feed | /home | 首页 Feed:feed=foryou/following / maxPages | ||
| READ | x_session_state | 任意 X tab | 登录态 + whoami(cookie + /i/api/1.1/account/settings.json;返回 loggedIn / username / screenName / userId? / displayName? / name(=screen_name)) | ||
| INTERACTIVE | x_navigate_search | /search?q=&f= | 仅 location.assign 切搜索页 | ||
| INTERACTIVE | x_navigate_profile | /<username>[/with_replies] | 仅 location.assign 切用户主页 / with_replies tab | ||
| INTERACTIVE | x_navigate_post | /i/status/<id> | 仅 location.assign 切推文详情 | ||
| INTERACTIVE | x_navigate_home | /home[/following] | 仅 location.assign 切首页 + feed |
全部工具都是 optional: true(按需加载),入参详见 skill.definition.js::TOOL_DEFINITIONS。
Monitor(账号监控,5 个受控 AI 工具 + CLI)
v3.0.5 新增:周期性拉 x_get_profile → 去重 → 发 webhook 通知。完整文档见 `docs/dev/monitor.md`。
| 档位 | 工具 / 命令 | 副作用 | 暴露面 | |
|---|---|---|---|---|
| READ-like | x_monitor_list_accounts / x_monitor_get_status | 读本地 config / state | AI + CLI | |
| 本地写 | x_monitor_add_account / x_monitor_remove_account | 写 ~/.js-eyes/skill-data/js-x-ops-skill/monitor/config.json | AI + CLI | |
| READ(X 侧) | x_monitor_test_account | 对 X 是 READ,不写 state、不发通知 | AI + CLI | |
| 通知副作用 | monitor init / monitor check / monitor daemon / monitor stop | 真实 webhook 通知、启停守护进程 | 仅 CLI,不暴露给 AI |
原则:会对第三方通知渠道产生副作用的动作永远只走 CLI / 外部调度器,AI 只能做配置管理 + READ 验证。
内部踩点 CLI(不进 skill.definition.js,仅供本仓库开发者排查)
下面两条只在 CLI 暴露、不暴露给 AI tool 列表,用于改版后定位 DOM 结构变化或抓 XHR 形态:
| CLI | 用途 | |
|---|---|---|
node index.js dom-dump [--anchors] [--limit N] | 一次性 snapshot 当前 X tab 上的关键 DOM 节点(article[data-testid="tweet"] / [data-testid] / [role="link"]),输出 tag/id/class/testid + text outline | |
node index.js xhr-log [--filter <regex>] [--limit N] | 读 performance.getEntriesByType('resource'),过滤 i/api/graphql/ 命中条目,按 pathname 聚合;不写 listener、不挂 hook,纯读浏览器 buffer |
CLI
官方 X API v2 通道
READ 工具默认仍走浏览器同源 GraphQL;官方 REST API 只作为 CLI / scripts/x-post.js --via auto|api 的可选通道。端点统一使用 https://api.x.com。
凭证从 console.x.com 的 App 页面获取:
X_BEARER_TOKEN:只读请求优先使用;适用于api status/api timeline/api tweets/ `api search-all` / `api search-recent`X_API_KEY/X_API_SECRET/X_ACCESS_TOKEN/X_ACCESS_TOKEN_SECRET:OAuth 1.0a 用户上下文四元组;发帖、回复、Quote、媒体上传、Article 草稿/发布必须配置
CLI 会从当前目录和 skill 目录向上查找 .env,并只填充尚未存在的环境变量;真实环境变量优先级高于 .env。
Official API 代理(Node 出站)
Browser / GraphQL READ 仍走 Chrome 自身代理;Official API 的 Node fetch 默认直连。若本机需代理才能访问 api.x.com,配置 HTTP(S) 或 SOCKS5 代理:
| 变量 | 说明 | |
|---|---|---|
JS_X_OPS_PROXY | 推荐;专用变量,优先级最高 | |
HTTPS_PROXY / HTTP_PROXY / ALL_PROXY | 标准 fallback(ALL_PROXY 常用于 socks5://) | |
JS_X_OPS_PROXY=off | 强制直连(忽略 lower-priority 代理) |
- 支持
http:///https://(如 Clash mixed-port)与socks5:///socks:///socks5h:// - 不支持
socks4:// api status输出含proxy.enabled/proxy.host/proxy.protocol(不含密码)- 无代理且请求失败时,
access.hint会提示设置JS_X_OPS_PROXY
注意:api quote 使用官方 quote_tweet_id 参数;X API 文档标注 Quote-posting 需要 Enterprise 计划,自助按量付费账号可能返回 403。媒体上传已使用 X API v2 的 POST /2/media/upload 和 POST /2/media/metadata。
Official API 搜索(Archive)与浏览器搜索对比
| 维度 | search / x_search_tweets | api search-all / x_search_archive | ||
|---|---|---|---|---|
| 数据范围 | 网页可见结果,偏近期 | search/all:2006 至今;search/recent:7 天 | ||
| 凭证 | js-eyes 浏览器登录态 | `X_BEARER_TOKEN`(全库推荐 Pay-per-use) | ||
| 计费 | 无 API 费用 | 按量付费 | ||
| 排序 | top / latest / media | `sort-order=recency | relevancy`(仅 search-all) | |
| 依赖 | 需要 X tab | 纯 HTTP,无需浏览器 |
AI 工具 x_search_archive 参数:keyword(必填)、scope(all|recent,默认 all)、maxPages / maxResults、startTime / endTime、sortOrder、from / since / until / lang / 互动数过滤等,与 CLI 操作符一致。403 通常表示账号无全库搜索权限。
Official API Articles(长文发布)
| 维度 | api tweet | api article-* / x_create_article | |
|---|---|---|---|
| 内容 | 短帖 ≤280 字 | 长文 Article(DraftJS) | |
| 格式 | 纯文本 | Markdown → DraftJS(标题/列表/引用/富文本/内嵌图/封面) | |
| 默认行为 | 立即发布 | draft-first(需 --publish 或 article-publish) | |
| 凭证 | OAuth 1.0a | OAuth 1.0a(Bearer 不可用) | |
| Premium | 一般不需要 | 发布通常需 X Premium |
Markdown 支持:#/##/### 标题、-/* 无序列表、1. 有序列表、> 引用、**bold**/*italic*/~~strike~~、[link](url)、本地 、@mention、#hashtag。
内嵌推文:
远程图片:Markdown 中 https:// 图片默认跳过;CLI 加 --fetch-remote-images 或 AI 工具 fetchRemoteImages=true 才会下载上传。
AI 工具:
x_create_article:title+bodyMarkdown/bodyFile;publish=true时必须confirm=truex_publish_article:articleId+confirm=true
READ 调度:readMode、visual 与重放(v3.2)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/js-x-ops-skill/SKILL.md
Popularity
- Repository stars
- 43
- Repository forks
- 7
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Jul 2026, 3 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/imjszhang/js-eyes/js-x-ops-skill)