hive.x-automation
できること
このスキルは、ブラウザでのよくあるXの作業に関するテスト済みの手順を、AIに与えます。投稿、返信、検索を、すべて手でクリックせずに手伝ってほしい人向けです。
使う場面
- ✓ブラウザを通じて、投稿や返信をXに送りたいとき。
- ✓Xを検索し、結果に返信したいとき。
- ✓自分の投稿をXから削除したいとき。
スキルのリンク
https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/x-automation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Xで「AIツール」について投稿を検索し、もっとも役立つ三件に返信してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、ブラウザを使い、スクリーンショットで正しい位置を見つけ、Xの作成欄に入力します。送信ボタンが有効にならない原因など、既知の癖を把握しており、それを回避します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
X / Twitter Automation
X uses Draft.js (the original Facebook rich-text editor) for the compose text area, which was the original canary for all the rich-text editor quirks the browser-automation skill now documents. Most of the site is otherwise stable — data-testid attributes have held up for years, the SPA is reasonably honest about what it renders, and shadow DOM is minimal. The hard parts are the composer, rate limiting, and the occasional anti-bot challenge.
Always activate browser-automation first. This skill assumes you already know about CSS-px coordinates, click-first typing, and Input.insertText. The guidance below is X-specific.
Timing expectations
browser_navigate(wait_until="load")returns in 1.3–1.6 s on a warm cache.- After navigation,
sleep(2–3)for SPA hydration before querying selectors. - Compose modal slide-in: ~1.5 s after clicking reply / compose.
- First 1–2 characters typed into the compose editor may be dropped — see "Draft.js quirks" below.
Verified selectors (2026-04-11)
| Target | Selector |
|---|---|
| Home nav link | a[data-testid='AppTabBar_Home_Link'] |
| Explore nav link | a[data-testid='AppTabBar_Explore_Link'] |
| Notifications | a[data-testid='AppTabBar_Notifications_Link'] |
| Main search input | input[data-testid='SearchBox_Search_Input'] |
| Compose text area | [data-testid='tweetTextarea_0'] (Draft.js contenteditable) |
| Post / Tweet submit button | [data-testid='tweetButton'] |
| Reply button (on feed / tweet detail) | [data-testid='reply'] |
| Like button | [data-testid='like'] |
| Retweet / repost button | [data-testid='retweet'] |
| Caret (⋯) menu on a post | [data-testid='caret'] |
| Confirmation sheet confirm button | [data-testid='confirmationSheetConfirm'] |
| Tweet article wrapper | article[data-testid='tweet'] |
| Close modal / composer | [aria-label='Close'] or press Escape |
All of these are light-DOM data-testid attributes — wait_for_selector and browser_type(selector=...) work on them directly, no shadow piercing needed.
Post new tweet flow
browser_navigate("https://x.com/home", wait_until="load")
sleep(3)
# Open the compose UI (click the post-new-tweet nav or use shortcut N)
browser_press("n") # keyboard shortcut — opens compose modal
sleep(1.5)
# Click the textarea to make sure Draft.js is in edit mode
ta_rect = browser_get_rect("[data-testid='tweetTextarea_0']")
browser_click_coordinate(ta_rect.cx, ta_rect.cy)
sleep(0.5)
# Type — browser_type handles Draft.js correctly now via Input.insertText
browser_type("[data-testid='tweetTextarea_0']", tweet_text)
sleep(1.0) # let Draft.js commit state
# Verify the Post button is enabled — never click blindly, Draft.js sometimes
# doesn't register the input even with a prior click.
state = browser_evaluate("""
(function(){
const btn = document.querySelector('[data-testid="tweetButton"]');
if (!btn) return {found: false};
return {
found: true,
disabled: btn.disabled || btn.getAttribute('aria-disabled') === 'true',
};
})();
""")
if state['found'] and not state['disabled']:
browser_click("[data-testid='tweetButton']")
sleep(2)
browser_press("Escape") # close any leftover modal
Posting a tweet WITH an image
Critical: NEVER click the photo button. On x.com/compose/post the media button is a styled <button> that triggers Chrome's native OS file picker when clicked — that dialog is unreachable via CDP and will wedge the automation. Instead, set the file directly on the hidden <input type='file'> element using browser_upload:
# 1. Open the compose modal as usual
browser_press("n")
sleep(1.5)
browser_click_coordinate(ta_rect.cx, ta_rect.cy)
sleep(0.5)
browser_type("[data-testid='tweetTextarea_0']", tweet_text)
# 2. Find the hidden file input X uses for media uploads.
# X's input is marked with data-testid='fileInput' and accepts
# image/*,video/*. It's hidden (display:none) but still mounted.
inputs = browser_evaluate("""
(function(){
return Array.from(document.querySelectorAll('input[type="file"]'))
.map(el => ({
testid: el.getAttribute('data-testid') || '',
accept: el.accept || '',
multiple: el.multiple,
}));
})();
""")
# Expect to see: [{testid: 'fileInput', accept: 'image/jpeg,...', multiple: true}]
# 3. Set the file WITHOUT opening any dialog
browser_upload(
selector="input[data-testid='fileI
よくある質問
なぜ送信ボタンがときどきオフのままなのですか?
Xの文章エディターが、一部の入力を黙って無視することがあるため、スキルは送信ボタンが有効になる入力方法を説明しています。
Xはこの作業の回数を制限しますか?
レート制限や時折の確認が起きうることをスキルは記しており、その範囲内で作業します。
どのXのページを扱いますか?
ホーム、検索、作成、通知などの主要なページを扱い、セレクターは2026年4月に確認されています。
詳細
作者による元の説明
Read before automating X / Twitter with browser_* tools. Verified flows for post, reply, delete, search-and-engage, plus the Draft.js compose quirks that silently disable the send button. Includes the daily-reply and job-market-reply playbooks. Requires hive.browser-automation for the underlying screenshot + coordinate workflow. Verified 2026-04-11.
repo: aden-hive/hive
人気
- GitHubのスター
- 11k
- ランキング
- #11817
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
browser-edge-cases
11kエージェントが、LinkedIn、X、スクリプトの多いページなど、扱いの難しいサイトでブラウザ自動化が失敗する原因を直せるよう支援します。
hive.browser-automation
11kエージェントが、hive-browserツールを使い、スクリーンショットとクリックで、自分のChromeブラウザを操作できるよう支援します。
hive.colony-progress-tracker
11kエージェントが、タスクを確保し、その手順と確認を共有データベースに記録できるよう支援します。作業が進むにつれて追跡されます。
hive.context-preservation
11kエージェントが、長いツールの結果から重要な事実を、メモとして保存し、古い詳細がメモリから消される前に残せるよう支援します。