[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DDQQG2JFN5NHQQHX7DQBVV":3,"skill-same:01M7DDQQG2JFN5NHQQHX7DQBVV":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":49},"01M7DDQQG2JFN5NHQQHX7DQBVV","x-com",null,"X.com (Twitter) platform operations playbook for agent-browser. Covers browse, engagement, content creation, social graph, profile, navigation, and lists operations with tested step-by-step agent-browser commands.","GitCoder052023\u002FOpenAgent","GitCoder052023","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F152955835?v=4","01M7DDPRFG37RBG6V6Y0V6DMTP","Hamdan Khubaib","01M7DDPRGJPX4K1F6B0YVXZ6E0",4,"MIT","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fskills\u002Fx-com\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\ndescription: \"X.com (Twitter) platform operations playbook for agent-browser. Covers browse, engagement, content creation, social graph, profile, navigation, and lists operations with tested step-by-step agent-browser commands.\"\nallowed-tools:\n  - Bash\nuser-invocable: true\n---\n\n# X.com (Twitter) — Agent Browser Playbook\n\nPlatform-specific operation sequences for agent-browser on x.com.\nEach operation documents: preconditions, step-by-step agent-browser commands, verification method, and known pitfalls.\n\n**Status**: All sections (1-7) tested and documented.\n**Tested with**: agent-browser 0.24.0, Chrome CDP on port 9222, account @mashijiann.\n**Last updated**: 2026-05-06\n\n---\n\n## Table of Contents\n\n- [1. Browse & Read](#1-browse--read)\n  - [1.1 Open Home Timeline](#11-open-home-timeline)\n  - [1.2 Open a Specific Tweet by URL](#12-open-a-specific-tweet-by-url)\n  - [1.3 Search Tweets by Keyword](#13-search-tweets-by-keyword)\n  - [1.4 View a User Profile](#14-view-a-user-profile)\n  - [1.5 Read Tweet Thread \u002F Replies](#15-read-tweet-thread--replies)\n  - [1.6 Read Notifications](#16-read-notifications)\n  - [1.7 Read DMs (Direct Messages)](#17-read-dms-direct-messages)\n- [2. Engagement — React to Content](#2-engagement--react-to-content)\n  - [2.1 Like a Tweet](#21-like-a-tweet)\n  - [2.2 Unlike a Tweet](#22-unlike-a-tweet)\n  - [2.3 Retweet (Repost)](#23-retweet-repost)\n  - [2.4 Undo Retweet](#24-undo-retweet)\n  - [2.5 Bookmark a Tweet](#25-bookmark-a-tweet)\n  - [2.6 Remove Bookmark](#26-remove-bookmark)\n- [3. Content Creation](#3-content-creation)\n  - [3.1 Post a New Tweet (Text Only)](#31-post-a-new-tweet-text-only)\n  - [3.2 Post a Tweet with Image](#32-post-a-tweet-with-image)\n  - [3.3 Reply to a Tweet](#33-reply-to-a-tweet)\n  - [3.4 Quote Tweet](#34-quote-tweet)\n  - [3.5 Delete Own Tweet](#35-delete-own-tweet)\n- [4. Social Graph](#4-social-graph)\n  - [4.1 Follow a User](#41-follow-a-user)\n  - [4.2 Unfollow a User](#42-unfollow-a-user)\n  - [4.3 View Followers List](#43-view-followers-list)\n  - [4.4 View Following List](#44-view-following-list)\n- [5. Profile Management](#5-profile-management)\n  - [5.1 View Own Profile](#51-view-own-profile)\n  - [5.2 Edit Bio \u002F Display Name](#52-edit-bio--display-name)\n  - [5.3 Pin a Tweet](#53-pin-a-tweet)\n- [6. Navigation & Utility](#6-navigation--utility)\n  - [6.1 Switch Between Tabs (For You \u002F Following)](#61-switch-between-tabs-for-you--following)\n  - [6.2 Scroll to Load More Tweets](#62-scroll-to-load-more-tweets)\n  - [6.3 Handle Login Popups \u002F Modals](#63-handle-login-popups--modals)\n  - [6.4 Handle Cookie Consent Banner](#64-handle-cookie-consent-banner)\n  - [6.5 Dismiss \"Turn on notifications\" Prompt](#65-dismiss-turn-on-notifications-prompt)\n- [7. Lists](#7-lists)\n  - [7.1 View Own Lists](#71-view-own-lists)\n  - [7.2 View a List Timeline](#72-view-a-list-timeline)\n  - [7.3 Browse List Members](#73-browse-list-members)\n  - [7.4 Create a New List](#74-create-a-new-list)\n  - [7.5 Add Member to List](#75-add-member-to-list)\n  - [7.6 Remove Member from List](#76-remove-member-from-list)\n  - [7.7 Delete a List](#77-delete-a-list)\n\n---\n\n> **Device targeting:** Operations run against desktop Chrome by default. To\n> operate the mobile web surface, set `DEVICE_PROFILE=ios|android` in `.env` or\n> prefix agent-browser commands with `-p ios|android`. When logging an action,\n> pass `--device \u003Ctarget>` for provenance (it does not change dedup — a like is\n> account-level).\n\n## 1. Browse & Read\n\n### 1.1 Open Home Timeline\n\n**Goal**: Navigate to the home timeline and confirm it loaded.\n\n**Preconditions**: Logged in (Chrome CDP session with cookies).\n\n**Steps**:\n```bash\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n```\n\n**Verification**:\n```bash\n# Title should contain \"Home \u002F X\"\nagent-browser get title\n# URL should be https:\u002F\u002Fx.com\u002Fhome\nagent-browser get url\n# Snapshot should show region \"Your Home Timeline\" and tab \"For you\"\nagent-browser snapshot -i -c -s '[role=\"region\"]'\n```\n\n**Key Elements**:\n- Navigation sidebar: `navigation \"Primary\"` — contains links: Home, Search and explore, Notifications, Direct Messages, Grok, Premium, Bookmarks, Profile\n- Timeline tabs: `tab \"For you\"` (default selected), `tab \"Following\"`, possibly custom tabs\n- Compose area: `textbox \"Post text\"` — inline compose on home page\n- Account button: `button \"Account menu\"` — shows logged-in username\n- Timeline region: `region \"Your Home Timeline\"` — contains tweet `article` elements\n\n**Known Issues**:\n- None\n\n---\n\n### 1.2 Open a Specific Tweet by URL\n\n**Goal**: Navigate directly to a tweet and read its content.\n\n**Preconditions**: Have the tweet URL (e.g. `https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123456`).\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fstatus\u002F\u003Ctweet_id>\"\n```\n\n**Verification**:\n```bash\n# Title should contain the author's name and tweet content preview\nagent-browser get title\n# URL should match the tweet URL\nagent-browser get url\n# Snapshot should show the tweet article with full text and engagement buttons\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Key Elements** (tweet detail page):\n- Tweet article: `article` — contains full tweet text, author info, engagement stats\n- Author links: `link \"\u003CDisplayName> Verified account\"`, `link \"@\u003Cusername>\"`\n- Timestamp: `link \"\u003Ctime> · \u003Cdate>\"` (e.g. `\"2:30 PM · May 5, 2026\"`)\n- View count: `link \"\u003CN> Views\"`\n- Engagement buttons: `button \"N Reply. Reply\"`, `button \"N reposts. Repost\"`, `button \"N Likes. Like\"`, `button \"N Bookmarks. Bookmark\"`, `button \"Share post\"`\n- Subscribe button: `button \"Subscribe to @\u003Cusername>\"`\n\n**Known Issues**:\n- None\n\n---\n\n### 1.3 Search Tweets by Keyword\n\n**Goal**: Search for tweets matching a keyword or query, read the results.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\n# For \"Top\" results (default):\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query\"\n\n# For \"Latest\" results:\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query&f=live\"\n\n# For \"People\" results:\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query&f=user\"\n\n# For \"Media\" results:\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query&f=image\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"\u003Cquery> - Search \u002F X\"\nagent-browser get title\n# Check which tab is active\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n# Read search result tweets\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Key Elements**:\n- Search tabs: `tab \"Top\"`, `tab \"Latest\"`, `tab \"People\"`, `tab \"Media\"`, `tab \"Lists\"`\n- The `f` URL parameter controls tab: omitted = Top, `live` = Latest, `user` = People, `image` = Media\n- Back button: `button \"Back\"` — returns to previous page\n- Each result is an `article` element identical in structure to timeline tweets\n\n**Known Issues**:\n- URL-encode the query string (spaces → `%20`, etc.)\n- Search results may show \"login wall\" for non-authenticated sessions\n- X advanced search operators work: `from:user`, `since:2026-01-01`, `min_faves:100`, etc.\n\n---\n\n### 1.4 View a User Profile\n\n**Goal**: Navigate to a user's profile and read their bio and multiple recent tweets.\n\n**Preconditions**: Have the username or profile URL.\n\n**Steps**:\n```bash\n# 1. Navigate to profile\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\"\n\n# 2. Initial snapshot — typically only shows the PINNED tweet (if any)\nagent-browser snapshot -i -c -s 'article'\n# WARNING: The first article is usually the pinned tweet, NOT the latest post.\n# You MUST scroll down to see actual recent posts.\n\n# 3. Scroll down to load recent posts (past the pinned tweet and profile header)\nagent-browser scroll down 3000\nagent-browser wait 2000\nagent-browser snapshot -i -c -s 'article'\n# Now you should see the first recent (non-pinned) post\n\n# 4. Continue scrolling to load more posts — repeat as needed\nagent-browser scroll down 3000\nagent-browser wait 2000\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Verification**:\n```bash\n# Title should contain \"\u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n# URL should be https:\u002F\u002Fx.com\u002F\u003Cusername>\nagent-browser get url\n```\n\n**Key Pattern — Browsing Multiple Posts**:\n```bash\n# To browse N posts from a user's profile, use this scroll loop:\n# Each scroll+wait cycle reveals ~1 new post due to virtualized list\nfor i in $(seq 1 N); do\n  agent-browser scroll down 3000\n  sleep 2  # or: agent-browser wait 2000\n  agent-browser snapshot -i -c -s 'article'\n  # Process the visible article(s)\ndone\n```\n\n**Known Issues**:\n- **CRITICAL**: The initial page view typically only shows the pinned tweet. **You MUST scroll down to see recent posts.** Agents often mistakenly think the pinned tweet is the only content.\n- X uses a virtualized list — only 1-2 articles in the viewport are in the DOM at any time. Scrolled-past articles are removed from DOM.\n- Scroll amount of 3000px + 2 second wait reliably loads next batch\n- Pinned tweet has text `\"Pinned\"` at the beginning of its article description — use this to identify and skip it\n- Profile has tabs: Posts, Replies, Highlights, Media, Likes — default is \"Posts\" which excludes replies. Use `https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fwith_replies` for posts + replies.\n\n---\n\n### 1.5 Read Tweet Thread \u002F Replies\n\n**Goal**: Open a tweet and read the full thread and replies below it.\n\n**Preconditions**: Have the tweet URL.\n\n**Steps**:\n```bash\n# 1. Open the tweet\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fstatus\u002F\u003Ctweet_id>\"\n\n# 2. Scroll down to load replies\nagent-browser scroll down 800\n\n# 3. Read replies (they appear as additional article elements below the main tweet)\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Verification**:\n```bash\n# Multiple article elements should be present — first is the main tweet, rest are replies\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Known Issues**:\n- Replies may be paginated — look for `button \"Show more replies\"` and click it\n- \"Show probably spam\" section may appear — skip it\n- Thread context (parent tweets) appears above the main tweet\n- **Quote tweet click trap**: If a reply or timeline entry is a quote tweet, clicking the article body navigates to the quoted original post instead of the quote tweet detail page. To navigate to the correct tweet, click the **timestamp link** instead. See section 3.4 Known Issues for full details.\n\n---\n\n### 1.6 Read Notifications\n\n**Goal**: Open the notifications tab and read recent notifications.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\nagent-browser open https:\u002F\u002Fx.com\u002Fnotifications\n```\n\n**Verification**:\n```bash\n# Title should contain \"Notifications \u002F X\"\nagent-browser get title\n# URL should be https:\u002F\u002Fx.com\u002Fnotifications\nagent-browser get url\n```\n\n**Key Elements**:\n- Notification tabs: All, Verified, Mentions\n- Sidebar link shows unread count: `link \"Notifications (N unread notifications)\"`\n\n**Known Issues**:\n- Notifications have sub-tabs: All, Verified, Mentions\n\n---\n\n### 1.7 Read DMs (Direct Messages)\n\n**Goal**: Open DMs and read recent messages.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\n# Note: \u002Fmessages redirects to \u002Fi\u002Fchat\nagent-browser open https:\u002F\u002Fx.com\u002Fmessages\n```\n\n**Verification**:\n```bash\n# URL will be https:\u002F\u002Fx.com\u002Fi\u002Fchat (auto-redirect)\nagent-browser get url\n```\n\n**Known Issues**:\n- URL redirects from `\u002Fmessages` to `\u002Fi\u002Fchat`\n- DM UI is a side panel or full page depending on viewport\n- May require X Premium for some DM features\n\n---\n\n## 2. Engagement — React to Content\n\n### 2.1 Like a Tweet\n\n**Goal**: Like a specific tweet.\n\n**Preconditions**: On a page where the tweet is visible (timeline, tweet detail, search results).\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Like button for the target tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Like\" (not yet liked) inside the target article\n\n# 2. Click the Like button\nagent-browser click \u003Clike_button_ref>\n```\n\n**Verification**:\n```bash\n# Snapshot again — button text should change from \"Like\" to \"Liked\"\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Liked\"\n```\n\n**Element Identification**:\n- **Not liked**: `button \"N Likes. Like\"` — text ends with `. Like`\n- **Already liked**: `button \"N Likes. Liked\"` — text ends with `. Liked`\n- The like count N increments by 1 after liking\n\n**Known Issues**:\n- Rate limiting: X may restrict rapid likes\n- The button ref may change after state change (re-snapshot to get new ref)\n\n---\n\n### 2.2 Unlike a Tweet\n\n**Goal**: Remove a like from a previously liked tweet.\n\n**Preconditions**: Tweet is already liked.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Liked button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Liked\"\n\n# 2. Click the same button to unlike\nagent-browser click \u003Cliked_button_ref>\n```\n\n**Verification**:\n```bash\n# Button text should revert from \"Liked\" to \"Like\"\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Like\"\n```\n\n**Element Identification**:\n- Same button toggles between Like\u002FLiked states\n- Ref may change between states — always re-snapshot\n\n**Known Issues**:\n- None\n\n---\n\n### 2.3 Retweet (Repost)\n\n**Goal**: Repost a tweet to own timeline.\n\n**Preconditions**: On a page where the tweet is visible.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Repost button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N reposts. Repost\" [expanded=false]\n\n# 2. Click Repost button — this opens a DROPDOWN MENU, not the action itself\nagent-browser click \u003Crepost_button_ref>\n\n# 3. Snapshot to see the dropdown menu items\nagent-browser snapshot -i -c -s '[role=\"menuitem\"]'\n# Shows: menuitem \"Repost\" and menuitem \"Quote\"\n\n# 4. Click \"Repost\" menu item to execute the repost\nagent-browser click \u003Crepost_menuitem_ref>\n```\n\n**Verification**:\n```bash\n# Snapshot — button text should change from \"Repost\" to \"Reposted\"\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Element Identification**:\n- Repost button: `button \"N reposts. Repost\" [expanded=false]`\n- Dropdown items: `menuitem \"Repost\"` and `menuitem \"Quote\"`\n- After repost: button becomes `button \"N reposts. Reposted\"`\n\n**Known Issues**:\n- **Two-step operation**: clicking the button opens a dropdown, you must then click the menuitem\n- To cancel\u002Fclose the dropdown without acting: `agent-browser press Escape`\n\n---\n\n### 2.4 Undo Retweet\n\n**Goal**: Remove a repost.\n\n**Preconditions**: Tweet is already retweeted.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Reposted button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N reposts. Reposted\"\n\n# 2. Click — opens dropdown with \"Undo repost\" option\nagent-browser click \u003Creposted_button_ref>\n\n# 3. Find and click \"Undo repost\" menu item\nagent-browser snapshot -i -c -s '[role=\"menuitem\"]'\nagent-browser click \u003Cundo_repost_menuitem_ref>\n```\n\n**Verification**:\n```bash\n# Button text should revert to \"Repost\"\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Element Identification**:\n- Already reposted: `button \"N reposts. Reposted\"`\n- Dropdown item: `menuitem \"Undo repost\"`\n\n**Known Issues**:\n- Same two-step dropdown pattern as Repost\n\n---\n\n### 2.5 Bookmark a Tweet\n\n**Goal**: Bookmark a tweet for later reading.\n\n**Preconditions**: On a page where the tweet is visible.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Bookmark button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"Bookmark\" (on timeline) or button \"N Bookmarks. Bookmark\" (on tweet detail)\n\n# 2. Click Bookmark button — single click, no dropdown\nagent-browser click \u003Cbookmark_button_ref>\n```\n\n**Verification**:\n```bash\n# Button text should change from \"Bookmark\" to \"Bookmarked\"\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"Bookmarked\" or button \"N Bookmarks. Bookmarked\"\n```\n\n**Element Identification**:\n- **Timeline view**: `button \"Bookmark\"` → `button \"Bookmarked\"`\n- **Tweet detail view**: `button \"N Bookmarks. Bookmark\"` → `button \"N Bookmarks. Bookmarked\"`\n- Single click — no dropdown or confirmation needed\n\n**Known Issues**:\n- Bookmark button ref changes after state change (e.g. e137 → e139) — re-snapshot after clicking\n\n---\n\n### 2.6 Remove Bookmark\n\n**Goal**: Remove a previously bookmarked tweet.\n\n**Preconditions**: Tweet is already bookmarked.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Bookmarked button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"Bookmarked\"\n\n# 2. Click to remove bookmark\nagent-browser click \u003Cbookmarked_button_ref>\n```\n\n**Verification**:\n```bash\n# Button text should revert from \"Bookmarked\" to \"Bookmark\"\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Element Identification**:\n- Same toggle pattern as Like: click \"Bookmarked\" button to un-bookmark\n\n**Known Issues**:\n- None\n\n---\n\n## 3. Content Creation\n\n### 3.1 Post a New Tweet (Text Only)\n\n**Goal**: Compose and publish a new tweet with text only.\n\n**Preconditions**: Logged in, on home timeline (compose area visible).\n\n**Steps**:\n```bash\n# 1. Navigate to home (compose area is inline on home page)\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n\n# 2. Snapshot to find the compose textbox\nagent-browser snapshot -i -c\n# Look for: textbox \"Post text\"\n\n# 3. Fill the compose area with tweet text\nagent-browser fill \u003Ctextbox_ref> \"Your tweet text here\"\n\n# 4. Snapshot to confirm text is filled and Post button is enabled\nagent-browser snapshot -i -c\n# Look for: button \"Post\" (without [disabled])\n\n# 5. Click Post to send\nagent-browser click \u003Cpost_button_ref>\n```\n\n**Verification**:\n```bash\n# After posting, the compose area should be empty and the tweet should appear in timeline\nagent-browser snapshot -i -c -s 'article'\n# Look for your tweet as the first article with your username and \"Now\" timestamp\n```\n\n**Element Identification**:\n- Compose textbox: `textbox \"Post text\"` — this is a contenteditable div, NOT a standard `\u003Cinput>`\n- Post button (empty): `button \"Post\" [disabled]` — disabled when no text\n- Post button (ready): `button \"Post\"` — enabled when text is present\n- After posting: tweet appears as `article` with `\"@\u003Cyour_username> Now\"` in timeline\n\n**Known Issues**:\n- **`fill` works**, `type` and `keyboard type` do NOT work on this contenteditable div\n- **CRITICAL — beforeunload trap**: Once you `fill` text into compose, X.com registers a `beforeunload` event. If you navigate away (open, reload) WITHOUT posting or clearing, Chrome shows a \"Leave site?\" dialog that **freezes agent-browser completely**. The Playwright daemon cannot dismiss this dialog when connected via CDP.\n  - **Prevention**: Always either post the tweet or clear text before navigating. To clear: use `agent-browser eval \"const el = document.querySelector('[data-testid=\\\"tweetTextarea_0\\\"]'); if(el) { el.focus(); document.execCommand('selectAll'); document.execCommand('delete'); }\"`\n  - **Recovery**: If the dialog appears, the only option is to manually click \"Leave\" in the Chrome UI, then kill and restart the agent-browser daemon (`pkill -9 -f agent-browser && agent-browser connect 9222`)\n- 280 character limit\n- `get value` returns empty on this textbox — use snapshot to verify content\n\n---\n\n### 3.2 Post a Tweet with Image\n\n**Goal**: Compose and publish a tweet with one or more images attached.\n\n**Preconditions**: Logged in, on home timeline, image file available on local filesystem.\n\n**Steps**:\n```bash\n# 1. Navigate to home\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n\n# 2. Snapshot to find upload elements\nagent-browser snapshot -i -c\n# Look for: button \"Add photos or video\" and button \"Choose Files\"\n\n# 3. Upload image file using the hidden file input\nagent-browser upload \u003Cchoose_files_button_ref> \u002Fpath\u002Fto\u002Fimage.png\n\n# 4. Wait for image to process\nagent-browser wait 2000\n\n# 5. Fill tweet text (optional — image-only tweets are allowed)\nagent-browser fill \u003Ctextbox_ref> \"Your tweet text here\"\n\n# 6. Click Post\nagent-browser click \u003Cpost_button_ref>\n```\n\n**Element Identification**:\n- Add media button: `button \"Add photos or video\"`\n- Hidden file input: `button \"Choose Files\"` — use this with `upload` command\n- GIF button: `button \"Add a GIF\"`\n- Generate image: `button \"Generate image\"`\n\n**Known Issues**:\n- Same beforeunload trap as 3.1 applies after filling text or uploading image\n- Image processing takes time; wait before clicking Post\n- Max 4 images per tweet\n\n---\n\n### 3.3 Reply to a Tweet\n\n**Goal**: Post a reply to a specific tweet.\n\n**Preconditions**: On the tweet detail page (navigate to the tweet URL first).\n\n**Steps**:\n```bash\n# 1. Open the tweet detail page\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fstatus\u002F\u003Ctweet_id>\"\n\n# 2. Snapshot to find the reply compose area (it's below the main tweet)\nagent-browser snapshot -i -c\n# Look for: textbox \"Post text\" inside a \"Post your reply\" container\n# Also look for: button \"Reply\" [disabled]\n\n# 3. Fill the reply text\nagent-browser fill \u003Creply_textbox_ref> \"Your reply text here\"\n\n# 4. Snapshot to confirm Reply button is enabled\nagent-browser snapshot -i -c\n# Look for: button \"Reply\" (without [disabled])\n\n# 5. Click Reply to send\nagent-browser click \u003Creply_button_ref>\n```\n\n**Verification**:\n```bash\n# After replying, your reply should appear as a new article in the thread\nagent-browser snapshot -i -c -s 'article'\n# Look for article with your username and \"Now\" timestamp\n```\n\n**Element Identification**:\n- Reply compose container: `generic \"Post your replyReplyEveryone can reply\"`\n- Reply textbox: `textbox \"Post text\"` — same element type as main compose\n- Reply button (empty): `button \"Reply\" [disabled]`\n- Reply button (ready): `button \"Reply\"` — enabled when text is present\n- Note: The main tweet also has `button \"N Reply. Reply\"` (engagement stat) — this is NOT the submit button\n\n**Known Issues**:\n- **Recommended approach**: Navigate to tweet detail page first, then use the inline reply box. This is more reliable than clicking reply from timeline (which opens a modal).\n- Same beforeunload trap as 3.1 — always post or clear before navigating away\n- `fill` works on the reply textbox (same contenteditable div behavior)\n- **CRITICAL — Quote tweet navigation trap**: When browsing a timeline and you see a quote tweet (a tweet that embeds another tweet), clicking the article body navigates to the **quoted (embedded) original post**, NOT the quote tweet itself. This means if you want to reply to user A's quote tweet of user B, clicking the article takes you to user B's original post instead. See section 3.4 Known Issues for the correct approach.\n\n---\n\n### 3.4 Quote Tweet\n\n**Goal**: Quote-retweet a tweet with added commentary.\n\n**Preconditions**: On a page where the tweet is visible (timeline, search results, tweet detail).\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Repost button on the target tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N reposts. Repost\" [expanded=false]\n\n# 2. Click Repost button to open dropdown\nagent-browser click \u003Crepost_button_ref>\n\n# 3. Snapshot to find the Quote menu item\nagent-browser snapshot -i -c -s '[role=\"menu\"]'\n# Shows: menuitem \"Repost\" and menuitem \"Quote\"\n\n# 4. Click \"Quote\" menu item — opens a compose modal\nagent-browser click \u003Cquote_menuitem_ref>\n\n# 5. Snapshot the compose modal — find textbox and Post button\nagent-browser snapshot -i -c\n# Look for: textbox \"Post text\" and button \"Post\"\n# The modal also shows a preview of the quoted tweet\n\n# 6. Fill the quote text\nagent-browser fill \u003Ctextbox_ref> \"Your commentary here\"\n\n# 7. Click Post to send\nagent-browser click \u003Cpost_button_ref>\n```\n\n**Verification**:\n```bash\n# After posting, the quote tweet should appear in timeline with your text + embedded quoted tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for article containing your text + \"Quote\" + original author's content\n```\n\n**Element Identification**:\n- Repost dropdown: `menuitem \"Repost\"` and `menuitem \"Quote\"`\n- Quote compose modal: contains `textbox \"Post text\"` and `button \"Post\"` — same structure as main compose\n- The quoted tweet preview appears as embedded content below the textbox\n\n**Known Issues**:\n- Two-step process: Repost button → dropdown → Quote menuitem → compose modal\n- Same beforeunload trap as 3.1 in the compose modal\n- To cancel: press Escape to close the modal (but clear text first if you've filled any)\n- **CRITICAL — Navigating to a quote tweet from timeline**: When a quote tweet appears in a timeline or search results, the article body contains an embedded `link` element pointing to the **quoted original post**. Clicking the article's main clickable area (`generic` element) navigates to the quoted original post's URL — NOT the quote tweet's own URL. This is because the embedded quoted content is wrapped in a `link` that captures click events.\n  - **Wrong**: Clicking the article body → navigates to `https:\u002F\u002Fx.com\u002F\u003Cquoted_user>\u002Fstatus\u002F\u003Cquoted_id>` (the original post)\n  - **Correct — Option 1**: Click the quote tweet's **timestamp link** (e.g., `link \"Apr 24\"`, `link \"May 5\"`) → navigates to `https:\u002F\u002Fx.com\u002F\u003Cquoting_user>\u002Fstatus\u002F\u003Cquote_id>` (the quote tweet itself)\n  - **Correct — Option 2**: Click the **Reply button** (`button \"N Reply. Reply\"`) directly from the timeline → opens reply compose targeting the quote tweet's author (no navigation needed)\n  - **Correct — Option 3**: If you already know the quote tweet's URL, navigate directly: `agent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cquoting_user>\u002Fstatus\u002F\u003Cquote_id>\"`\n\n---\n\n### 3.5 Delete Own Tweet\n\n**Goal**: Delete a tweet posted by the agent's account.\n\n**Preconditions**: Own tweet is visible (on profile, timeline, or search results).\n\n**Steps**:\n```bash\n# 1. Find the tweet — using search is the most reliable method\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=from%3A\u003Cusername>%20\u003Ckeyword>&src=typed_query&f=live\"\n\n# 2. Snapshot to find the More button on the target tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"More\" [expanded=false] inside the target article\n\n# 3. IMPORTANT: scroll the More button into view, then click\nagent-browser scrollintoview \u003Cmore_button_ref>\nagent-browser click \u003Cmore_button_ref>\n\n# 4. Snapshot to find the Delete menu item\nagent-browser snapshot -i -c\n# Look for: menuitem \"Delete\"\n\n# 5. Click Delete\nagent-browser click \u003Cdelete_menuitem_ref>\n\n# 6. Confirmation dialog appears — click the confirm Delete button\nagent-browser snapshot -i -c\n# Look for: heading \"Delete post?\" + button \"Delete\" + button \"Cancel\"\nagent-browser click \u003Cconfirm_delete_button_ref>\n```\n\n**Verification**:\n```bash\n# The tweet should disappear from the page \u002F search results\nagent-browser snapshot -i -c -s 'article'\n# The deleted tweet should no longer be present\n```\n\n**Element Identification**:\n- More button: `button \"More\" [expanded=false]` — the \"...\" menu on each tweet\n- Menu items (own tweet): `menuitem \"Delete\"`, `menuitem \"Edit post\"`, `menuitem \"Pin to your profile\"`, `menuitem \"Add\u002Fremove from Highlights\"`, `menuitem \"Add\u002Fremove from Lists\"`, `menuitem \"Change who can reply\"`, `menuitem \"View post activity\"`, `menuitem \"Embed post\"`\n- Confirmation dialog: `heading \"Delete post?\"` + `button \"Delete\"` + `button \"Cancel\"`\n\n**Known Issues**:\n- **Three-step operation**: More button → Delete menuitem → Confirm dialog\n- **`scrollintoview` before clicking More is important** — without it the click may not trigger the dropdown (likely the button is outside the viewport or behind another element)\n- Finding own tweets: use search `from:\u003Cusername> \u003Ckeyword>` with `f=live` tab for most reliable results. Profile page may have caching delay.\n- After deletion, you may be redirected to the previous page or see a \"This post was deleted\" placeholder\n\n---\n\n## 4. Social Graph\n\n### 4.1 Follow a User\n\n**Goal**: Follow a user from their profile page.\n\n**Preconditions**: On the target user's profile page, not already following.\n\n**Steps**:\n```bash\n# 1. Navigate to the user's profile\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\"\n\n# 2. Snapshot to find the Follow button\nagent-browser snapshot -i -c\n# Look for: button \"Follow @\u003Cusername>\"\n\n# 3. Click Follow\nagent-browser click \u003Cfollow_button_ref>\n```\n\n**Verification**:\n```bash\n# Button should change from \"Follow @\u003Cusername>\" to \"Unfollow @\u003Cusername>\"\nagent-browser snapshot -i -c\n# Look for: button \"Unfollow @\u003Cusername>\" [expanded=false]\n```\n\n**Element Identification**:\n- **Not following**: `button \"Follow @\u003Cusername>\"`\n- **Already following**: `button \"Unfollow @\u003Cusername>\" [expanded=false]`\n- Note: The button text includes the `@username` — use this to distinguish from \"Who to follow\" sidebar buttons\n\n**Known Issues**:\n- Some accounts are protected; follow sends a request instead of immediately following\n- Single click — no confirmation needed\n\n---\n\n### 4.2 Unfollow a User\n\n**Goal**: Unfollow a user.\n\n**Preconditions**: On the target user's profile page, already following.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Unfollow button\nagent-browser snapshot -i -c\n# Look for: button \"Unfollow @\u003Cusername>\" [expanded=false]\n\n# 2. Click Unfollow — this opens a DROPDOWN (not direct action)\nagent-browser click \u003Cunfollow_button_ref>\n\n# 3. Snapshot to find the confirm menuitem\nagent-browser snapshot -i -c\n# Look for: menuitem \"Unfollow @\u003Cusername>\"\n\n# 4. Click the menuitem to confirm\nagent-browser click \u003Cunfollow_menuitem_ref>\n```\n\n**Verification**:\n```bash\n# Button should revert to \"Follow @\u003Cusername>\"\nagent-browser snapshot -i -c\n# Look for: button \"Follow @\u003Cusername>\"\n```\n\n**Element Identification**:\n- Unfollow button: `button \"Unfollow @\u003Cusername>\" [expanded=false]`\n- Dropdown confirm: `menuitem \"Unfollow @\u003Cusername>\"`\n- After unfollow: reverts to `button \"Follow @\u003Cusername>\"`\n\n**Known Issues**:\n- **Two-step operation**: click Unfollow button → dropdown appears → click menuitem to confirm\n- To cancel: press Escape to close dropdown\n\n---\n\n### 4.3 View Followers List\n\n**Goal**: View the followers list of a user.\n\n**Preconditions**: Have the username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Ffollowers\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"People following \u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n```\n\n**Known Issues**:\n- List is virtualized — only visible items are in DOM. Scroll to load more.\n\n---\n\n### 4.4 View Following List\n\n**Goal**: View the following list of a user.\n\n**Preconditions**: Have the username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Ffollowing\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"People followed by \u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n```\n\n**Known Issues**:\n- Same virtualization as followers list\n\n---\n\n## 5. Profile Management\n\n### 5.1 View Own Profile\n\n**Goal**: Navigate to the agent's own profile page.\n\n**Preconditions**: Logged in, know own username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cown_username>\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"\u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n```\n\n**Known Issues**:\n- None\n\n---\n\n### 5.2 Edit Bio \u002F Display Name\n\n**Goal**: Update the agent account's bio or display name.\n\n**Preconditions**: On own profile page.\n\n**Steps**:\n```bash\n# 1. Navigate to own profile\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cown_username>\"\n\n# 2. Snapshot to find Edit profile link\nagent-browser snapshot -i -c\n# Look for: link \"Edit profile\"\n\n# 3. Click Edit profile — opens a modal\nagent-browser click \u003Cedit_profile_ref>\n\n# 4. Snapshot the modal to find fields\nagent-browser snapshot -i -c\n# Look for:\n#   textbox \"Name\": current display name\n#   textbox \"Bio\": current bio\n#   textbox \"Location\": current location\n#   textbox \"Website\": current website\n#   button \"Save\"\n\n# 5. Edit the desired field(s) using fill\nagent-browser fill \u003Cbio_textbox_ref> \"New bio text here\"\n\n# 6. Click Save\nagent-browser click \u003Csave_button_ref>\n```\n\n**Verification**:\n```bash\n# Modal should close. Reload profile and check updated content.\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cown_username>\"\nagent-browser snapshot -i -c\n```\n\n**Element Identification**:\n- Edit profile link: `link \"Edit profile\"` — on own profile page only\n- Modal fields: `textbox \"Name\"`, `textbox \"Bio\"`, `textbox \"Location\"`, `textbox \"Website\"`\n- Save button: `button \"Save\"`\n- Close without saving: press Escape (may trigger beforeunload if fields were modified)\n\n**Known Issues**:\n- These are standard `textbox` elements (not contenteditable divs) — `fill` works normally\n- Bio has a 160 character limit\n- Name has a 50 character limit\n\n---\n\n### 5.3 Pin a Tweet\n\n**Goal**: Pin a tweet to the top of own profile.\n\n**Preconditions**: On own tweet (visible on profile, search results, or tweet detail page).\n\n**Steps**:\n```bash\n# 1. Find own tweet and its More button (same as 3.5 Delete flow)\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"More\" [expanded=false] on the target tweet\n\n# 2. Scroll into view and click More\nagent-browser scrollintoview \u003Cmore_button_ref>\nagent-browser click \u003Cmore_button_ref>\n\n# 3. Find and click \"Pin to your profile\"\nagent-browser snapshot -i -c\n# Look for: menuitem \"Pin to your profile\"\nagent-browser click \u003Cpin_menuitem_ref>\n\n# 4. Confirm in the dialog (if one appears)\nagent-browser snapshot -i -c\n# Look for confirmation button and click it\n```\n\n**Element Identification**:\n- Menu item: `menuitem \"Pin to your profile\"`\n- If already pinned: `menuitem \"Unpin from profile\"` appears instead\n\n**Known Issues**:\n- Same More button pattern as Delete (3.5) — use `scrollintoview` before clicking\n- Only one tweet can be pinned at a time; pinning a new one unpins the old one\n\n---\n\n## 6. Navigation & Utility\n\n### 6.1 Switch Between Tabs (For You \u002F Following)\n\n**Goal**: Switch the home timeline between \"For you\" and \"Following\" tabs.\n\n**Preconditions**: On home timeline.\n\n**Steps**:\n```bash\n# 1. Navigate to home\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n\n# 2. Snapshot the tablist to see available tabs\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n# Shows: tab \"For you\" [selected], tab \"Following\", possibly custom tabs\n\n# 3. Click the desired tab\nagent-browser click \u003Ctab_ref>\n```\n\n**Verification**:\n```bash\n# The clicked tab should now have [selected] attribute\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n```\n\n**Element Identification**:\n- Tabs are `tab` role elements inside a `tablist`\n- Selected tab has `[selected]` attribute\n- Default tabs: `tab \"For you\"`, `tab \"Following\"`\n- Users may have custom tabs (e.g. Lists)\n\n**Known Issues**:\n- Tab names may vary by locale\n- Custom tabs may be present (user-created Lists pinned to home)\n\n---\n\n### 6.2 Scroll to Load More Tweets\n\n**Goal**: Scroll down to trigger lazy-loading of additional tweets.\n\n**Preconditions**: On any timeline or search results page.\n\n**Steps**:\n```bash\n# Scroll down by pixel amount\nagent-browser scroll down 2000\n\n# Wait for new content to load\nagent-browser wait 2000\n\n# Check loaded content\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Verification**:\n```bash\n# New articles should be present in the snapshot\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Known Issues**:\n- X uses a **virtualized list** — only articles in the current viewport are in the DOM. Scrolled-past articles are removed. So `snapshot -s 'article'` always shows ~1-3 articles regardless of how many have been loaded.\n- Multiple scroll operations may be needed: `agent-browser scroll down 2000` repeated\n- Scroll amount of 2000-3000px is typically enough to trigger lazy load\n\n---\n\n### 6.3 Handle Login Popups \u002F Modals\n\n**Goal**: Dismiss the \"Sign in\" or \"Create account\" overlay that X shows to non-authenticated users or as a periodic prompt.\n\n**Preconditions**: Popup is visible. Usually only appears for non-authenticated sessions.\n\n**Steps**:\n```bash\n# Snapshot to identify the popup type and close\u002Fdismiss button\nagent-browser snapshot -i -c\n\n# Common patterns:\n# 1. Close button (X icon): look for button with close-related label\n# 2. \"Not now\" or \"Skip\" link\u002Fbutton\n# 3. Click outside the modal\n\n# Try pressing Escape first\nagent-browser press Escape\n```\n\n**Known Issues**:\n- Multiple types of login prompts exist (bottom bar, full modal, interstitial)\n- When using CDP with a logged-in profile, these should not appear\n- **A full login wall (\"Sign in\", \"Email or username\", \"Continue with…\") means the isolated\n  CDP profile is LOGGED OUT — NOT something to dismiss or work around.** Do not try to log in,\n  do not type credentials, do not open a fresh session. STOP and tell the user to log into X\n  in the isolated Chrome window (`bun run setup-chrome` reconnects without wiping; `--reset`\n  for a clean re-login). Resume only after they confirm they are logged in.\n- A small periodic in-app prompt (not a full wall) on an otherwise logged-in timeline can be\n  dismissed with `agent-browser press Escape`.\n\n---\n\n### 6.4 Handle Cookie Consent Banner\n\n**Goal**: Accept or dismiss the cookie consent banner.\n\n**Preconditions**: Banner is visible (usually first visit without saved cookies).\n\n**Steps**:\n```bash\n# Snapshot to find the consent banner\nagent-browser snapshot -i -c\n\n# Look for accept\u002Fdecline buttons — common patterns:\n# button \"Accept all cookies\"\n# button \"Refuse non-essential cookies\"\nagent-browser click \u003Caccept_button_ref>\n```\n\n**Known Issues**:\n- When using CDP with an existing Chrome profile, cookie consent is usually already accepted\n- Banner may not appear at all in CDP sessions\n\n---\n\n### 6.5 Dismiss \"Turn on notifications\" Prompt\n\n**Goal**: Close the browser notification permission prompt or X's in-app notification suggestion.\n\n**Preconditions**: Prompt is visible.\n\n**Steps**:\n```bash\n# For X's in-app prompt (DOM element):\nagent-browser snapshot -i -c\n# Look for dismiss\u002Fclose button near the notification suggestion\nagent-browser click \u003Cdismiss_button_ref>\n\n# For browser-level notification prompt:\n# This is handled automatically by agent-browser (auto-dismiss dialogs)\n# If not, use --no-auto-dialog flag to prevent it from appearing\n```\n\n**Known Issues**:\n- Browser-level notification prompt is auto-dismissed by agent-browser by default\n- X's in-app prompt is a regular DOM element — find and click the close button\n- When using CDP with existing profile, notification permissions are usually already set\n\n---\n\n## 7. Lists\n\n### 7.1 View Own Lists\n\n**Goal**: Navigate to the user's lists management page.\n\n**Preconditions**: Logged in, know own username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Flists\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"Lists created by @\u003Cusername> \u002F X\"\nagent-browser get title\n```\n\n**Key Elements**:\n- Create button: `link \"Create a new List\"`\n- Your lists section: `region \"Your Lists\"` — contains links to each list\n- Each list link: `link \"\u003CListName> N members \u003COwnerName> @\u003Cowner> Pin List\"`\n- Pin button: `button \"Pin List\"` — pins list to home timeline sidebar\n- Discover section: `heading \"Discover new Lists\"`\n\n**Known Issues**:\n- None\n\n---\n\n### 7.2 View a List Timeline\n\n**Goal**: Open a specific list and read its timeline (posts from list members).\n\n**Preconditions**: Know the list URL or navigate from lists page.\n\n**Steps**:\n```bash\n# Option A: Direct URL (list ID from the lists page)\nagent-browser open \"https:\u002F\u002Fx.com\u002Fi\u002Flists\u002F\u003Clist_id>\"\n\n# Option B: From lists page, click the list link\nagent-browser snapshot -i -c\n# Look for: link \"\u003CListName> N members ...\"\nagent-browser click \u003Clist_link_ref>\n```\n\n**Verification**:\n```bash\n# URL should be https:\u002F\u002Fx.com\u002Fi\u002Flists\u002F\u003Clist_id>\nagent-browser get url\n# Articles from list members should appear\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Key Elements** (list timeline page):\n- List header with name and member count\n- Edit link: `link \"Edit List\"` — only for own lists\n- Members link: `link \"N Members\"` — opens members modal\n- Share button: `button \"Share Menu\"`\n- More button: `button \"More\"` — additional list options\n- Timeline: same `article` structure as home timeline\n\n**Known Issues**:\n- Same virtualized list behavior as home timeline — scroll to load more posts\n- List URL format is `\u002Fi\u002Flists\u002F\u003Cnumeric_id>`, not a human-readable slug\n\n---\n\n### 7.3 Browse List Members\n\n**Goal**: View all members of a list.\n\n**Preconditions**: On the list timeline page.\n\n**Steps**:\n```bash\n# 1. On the list page, find and click the Members link\nagent-browser snapshot -i -c\n# Look for: link \"N Members\"\nagent-browser click \u003Cmembers_link_ref>\n\n# 2. Members modal opens — shows all members\nagent-browser snapshot -i -c\n# Each member has: button \"\u003CName> @\u003Cusername> Remove ...\" (for own lists)\n```\n\n**Verification**:\n```bash\n# Modal should show heading \"List members\" and list of members\nagent-browser snapshot -i -c\n# Look for: heading \"List members\" and button elements for each member\n```\n\n**Element Identification**:\n- Members modal: `heading \"List members\"`\n- Each member (own list): `button \"\u003CName> Verified account @\u003Cusername> Remove ...\"`\n- Each member has a `button \"Remove\"` to remove them from the list\n- Close modal: press Escape\n\n**Known Issues**:\n- Members list may be long — scroll to see all members\n\n---\n\n### 7.4 Create a New List\n\n**Goal**: Create a new list and optionally add initial members.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\n# 1. Navigate to lists page\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Flists\"\n\n# 2. Click \"Create a new List\"\nagent-browser snapshot -i -c\n# Look for: link \"Create a new List\"\nagent-browser click \u003Ccreate_link_ref>\n\n# 3. Fill in list details\nagent-browser snapshot -i -c\n# Modal shows: textbox \"Name\", textbox \"Description\", checkbox \"Make private\", button \"Next\" [disabled]\nagent-browser fill \u003Cname_textbox_ref> \"My List Name\"\n# Optionally: agent-browser fill \u003Cdescription_textbox_ref> \"Description\"\n# Optionally: agent-browser click \u003Cmake_private_checkbox_ref>\n\n# 4. Click Next (enabled after name is filled)\nagent-browser click \u003Cnext_button_ref>\n\n# 5. Add members page appears — search and add users\nagent-browser snapshot -i -c\n# Shows: combobox \"Search query\", tab \"Members (0)\", tab \"Suggested\", button \"Done\"\nagent-browser fill \u003Csearch_combobox_ref> \"\u003Cusername_to_search>\"\n# Wait for search results\nagent-browser wait 1000\nagent-browser snapshot -i -c\n# Look for: button \"Add\" next to the user\nagent-browser click \u003Cadd_button_ref>\n\n# 6. Click Done to finish\nagent-browser click \u003Cdone_button_ref>\n```\n\n**Verification**:\n```bash\n# Should redirect to the new list's timeline page\nagent-browser get url\n# URL should be https:\u002F\u002Fx.com\u002Fi\u002Flists\u002F\u003Cnew_list_id>\n```\n\n**Element Identification**:\n- Create modal step 1: `textbox \"Name\"`, `textbox \"Description\"`, `checkbox \"Make private\"`, `button \"Next\" [disabled]`\n- Create modal step 2: `combobox \"Search query\"`, `button \"Done\"`, `tab \"Members (N)\"`, `tab \"Suggested\"`\n- Each search result: `button \"\u003CName> @\u003Cusername> Add ...\"` with nested `button \"Add\"`\n- After adding: button changes from `\"Add\"` to `\"Remove\"`\n\n**Known Issues**:\n- List name **cannot contain special characters** like `[`, `]`, etc. — validation error: \"A list's name can't include a disallowed\"\n- Name max length: 25 characters\n- After clicking Next, there's an optional banner photo upload step (can be skipped by proceeding to add members)\n\n---\n\n### 7.5 Add Member to List\n\n**Goal**: Add a user to an existing list.\n\n**Preconditions**: On the list page (own list).\n\n**Steps**:\n```bash\n# 1. Click Edit List\nagent-browser snapshot -i -c\n# Look for: link \"Edit List\"\nagent-browser click \u003Cedit_list_ref>\n\n# 2. Click \"Manage members\" tab in the edit modal\nagent-browser snapshot -i -c\n# Look for: tab \"Manage members\"\nagent-browser click \u003Cmanage_members_tab_ref>\n\n# 3. Switch to \"Suggested\" tab to search for users\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n# Look for: tab \"Members (N)\" and tab \"Suggested\"\nagent-browser click \u003Csuggested_tab_ref>\n\n# 4. Search for the user to add\nagent-browser snapshot -i -c\n# Look for: combobox \"Search query\"\nagent-browser fill \u003Csearch_combobox_ref> \"\u003Cusername>\"\nagent-browser wait 1000\n\n# 5. Click Add on the search result\nagent-browser snapshot -i -c\n# Look for: button \"Add\" next to the user\nagent-browser click \u003Cadd_button_ref>\n```\n\n**Verification**:\n```bash\n# The button should change from \"Add\" to \"Remove\"\n# Members tab count should increment: tab \"Members (N+1)\"\nagent-browser snapshot -i -c\n```\n\n**Element Identification**:\n- Manage members modal: `heading \"Manage members\"`\n- Sub-tabs: `tab \"Members (N)\"` [selected], `tab \"Suggested\"`\n- Search: `combobox \"Search query\"`\n- Each user: `button \"Add\"` (not added) or `button \"Remove\"` (already in list)\n\n**Known Issues**:\n- None\n\n---\n\n### 7.6 Remove Member from List\n\n**Goal**: Remove a user from an existing list.\n\n**Preconditions**: On the list page (own list), user is a member.\n\n**Steps**:\n```bash\n# Option A: From Members modal (7.3)\n# Each member has a \"Remove\" button\nagent-browser click \u003Cremove_button_ref>\n\n# Option B: From Edit List → Manage members → Members tab\nagent-browser snapshot -i -c\n# Each member row has: button \"Remove\"\nagent-browser click \u003Cremove_button_ref>\n```\n\n**Verification**:\n```bash\n# Member count should decrement\n# The user should disappear from the members list\nagent-browser snapshot -i -c\n```\n\n**Known Issues**:\n- Remove is immediate — no confirmation dialog\n- Member count updates instantly in the tab label\n\n---\n\n### 7.7 Delete a List\n\n**Goal**: Delete an entire list.\n\n**Preconditions**: On the list page (own list).\n\n**Steps**:\n```bash\n# 1. Click Edit List\nagent-browser snapshot -i -c\n# Look for: link \"Edit List\"\nagent-browser click \u003Cedit_list_ref>\n\n# 2. Click Delete List\nagent-browser snapshot -i -c\n# Look for: button \"Delete List\"\nagent-browser click \u003Cdelete_list_button_ref>\n\n# 3. Confirmation dialog appears\nagent-browser snapshot -i -c\n# Look for: heading \"Delete List?\" + button \"Delete\" + button \"Cancel\"\nagent-browser click \u003Cconfirm_delete_ref>\n```\n\n**Verification**:\n```bash\n# Should redirect to lists page\nagent-browser get url\n# URL should be https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Flists\u002F\n```\n\n**Element Identification**:\n- Edit modal: `button \"Delete List\"` — red\u002Fdestructive button at bottom\n- Confirmation: `heading \"Delete List?\"` + `button \"Delete\"` + `button \"Cancel\"`\n\n**Known Issues**:\n- Deletion is permanent — no undo\n- Redirects to `\u002F\u003Cusername>\u002Flists\u002F` after successful deletion\n\n---\n\n## Testing Notes\n\n### General Approach\n\nFor each operation above:\n\n1. Preflight (`bun run doctor --check-cdp`; if down, `bun run setup-chrome`). agent-browser is pinned to the isolated CDP Chrome via `agent-browser.json`, so commands auto-attach — no `connect`\u002F`--cdp` needed. Never open a fresh `--session-name`\u002F`--headed` browser to log in.\n2. Run `agent-browser snapshot -i` to see current interactive elements\n3. Execute each step, taking snapshots between steps to verify state changes\n4. Record the working command sequence\n5. Note any element identification strategies (aria-label, role, text content)\n6. Test at least 3 times to confirm reliability\n\n### Element Identification Strategy\n\nDo NOT hardcode `@ref` numbers (e.g. `@e3`). Refs change between page loads. Instead, document:\n- The aria-label or aria-role to look for\n- The text content pattern\n- The CSS selector as fallback\n- The relative position in the accessibility tree\n\n### Session Management\n\n**There is exactly ONE authorized way to reach a logged-in X session: the isolated\nCDP Chrome on port 9222** (launched by `bun run setup-chrome`). See the\n\"Browser Connection Contract\" in the system prompt — it is binding for every operation here.\n\nagent-browser is pinned to that CDP port via `agent-browser.json`, so every command\nauto-attaches — no `connect`\u002F`--cdp` needed. Preflight, then just open:\n```bash\nbun run doctor --check-cdp        # if DOWN: bun run setup-chrome  (idempotent, never touches your normal Chrome)\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\nagent-browser snapshot -i -c      # confirm you are logged in (timeline visible, not a login wall)\n```\nA `Timeout connecting to CDP at 127.0.0.1:9222` error means the isolated Chrome is not\nrunning (run `bun run setup-chrome`) — it is NOT a login problem.\n\n**Do NOT** use `--session-name`, `--headed`, or `--profile` to open a fresh browser and\nlog in — a fresh session has no cookies and pulls you into an automated login, which gets\nthe account rate-limited (\"We've temporarily limited your login\"). **Never type credentials\nor attempt a login.** If the CDP profile is logged out, STOP and ask the user to log in once\nin the isolated Chrome window (`bun run setup-chrome --reset` for a clean slate), then resume.\n","# X.com (Twitter) — Agent Browser Playbook\n\nPlatform-specific operation sequences for agent-browser on x.com.\nEach operation documents: preconditions, step-by-step agent-browser commands, verification method, and known pitfalls.\n\n**Status**: All sections (1-7) tested and documented.\n**Tested with**: agent-browser 0.24.0, Chrome CDP on port 9222, account @mashijiann.\n**Last updated**: 2026-05-06\n\n---\n\n## Table of Contents\n\n- [1. Browse & Read](#1-browse--read)\n  - [1.1 Open Home Timeline](#11-open-home-timeline)\n  - [1.2 Open a Specific Tweet by URL](#12-open-a-specific-tweet-by-url)\n  - [1.3 Search Tweets by Keyword](#13-search-tweets-by-keyword)\n  - [1.4 View a User Profile](#14-view-a-user-profile)\n  - [1.5 Read Tweet Thread \u002F Replies](#15-read-tweet-thread--replies)\n  - [1.6 Read Notifications](#16-read-notifications)\n  - [1.7 Read DMs (Direct Messages)](#17-read-dms-direct-messages)\n- [2. Engagement — React to Content](#2-engagement--react-to-content)\n  - [2.1 Like a Tweet](#21-like-a-tweet)\n  - [2.2 Unlike a Tweet](#22-unlike-a-tweet)\n  - [2.3 Retweet (Repost)](#23-retweet-repost)\n  - [2.4 Undo Retweet](#24-undo-retweet)\n  - [2.5 Bookmark a Tweet](#25-bookmark-a-tweet)\n  - [2.6 Remove Bookmark](#26-remove-bookmark)\n- [3. Content Creation](#3-content-creation)\n  - [3.1 Post a New Tweet (Text Only)](#31-post-a-new-tweet-text-only)\n  - [3.2 Post a Tweet with Image](#32-post-a-tweet-with-image)\n  - [3.3 Reply to a Tweet](#33-reply-to-a-tweet)\n  - [3.4 Quote Tweet](#34-quote-tweet)\n  - [3.5 Delete Own Tweet](#35-delete-own-tweet)\n- [4. Social Graph](#4-social-graph)\n  - [4.1 Follow a User](#41-follow-a-user)\n  - [4.2 Unfollow a User](#42-unfollow-a-user)\n  - [4.3 View Followers List](#43-view-followers-list)\n  - [4.4 View Following List](#44-view-following-list)\n- [5. Profile Management](#5-profile-management)\n  - [5.1 View Own Profile](#51-view-own-profile)\n  - [5.2 Edit Bio \u002F Display Name](#52-edit-bio--display-name)\n  - [5.3 Pin a Tweet](#53-pin-a-tweet)\n- [6. Navigation & Utility](#6-navigation--utility)\n  - [6.1 Switch Between Tabs (For You \u002F Following)](#61-switch-between-tabs-for-you--following)\n  - [6.2 Scroll to Load More Tweets](#62-scroll-to-load-more-tweets)\n  - [6.3 Handle Login Popups \u002F Modals](#63-handle-login-popups--modals)\n  - [6.4 Handle Cookie Consent Banner](#64-handle-cookie-consent-banner)\n  - [6.5 Dismiss \"Turn on notifications\" Prompt](#65-dismiss-turn-on-notifications-prompt)\n- [7. Lists](#7-lists)\n  - [7.1 View Own Lists](#71-view-own-lists)\n  - [7.2 View a List Timeline](#72-view-a-list-timeline)\n  - [7.3 Browse List Members](#73-browse-list-members)\n  - [7.4 Create a New List](#74-create-a-new-list)\n  - [7.5 Add Member to List](#75-add-member-to-list)\n  - [7.6 Remove Member from List](#76-remove-member-from-list)\n  - [7.7 Delete a List](#77-delete-a-list)\n\n---\n\n> **Device targeting:** Operations run against desktop Chrome by default. To\n> operate the mobile web surface, set `DEVICE_PROFILE=ios|android` in `.env` or\n> prefix agent-browser commands with `-p ios|android`. When logging an action,\n> pass `--device \u003Ctarget>` for provenance (it does not change dedup — a like is\n> account-level).\n\n## 1. Browse & Read\n\n### 1.1 Open Home Timeline\n\n**Goal**: Navigate to the home timeline and confirm it loaded.\n\n**Preconditions**: Logged in (Chrome CDP session with cookies).\n\n**Steps**:\n```bash\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n```\n\n**Verification**:\n```bash\n# Title should contain \"Home \u002F X\"\nagent-browser get title\n# URL should be https:\u002F\u002Fx.com\u002Fhome\nagent-browser get url\n# Snapshot should show region \"Your Home Timeline\" and tab \"For you\"\nagent-browser snapshot -i -c -s '[role=\"region\"]'\n```\n\n**Key Elements**:\n- Navigation sidebar: `navigation \"Primary\"` — contains links: Home, Search and explore, Notifications, Direct Messages, Grok, Premium, Bookmarks, Profile\n- Timeline tabs: `tab \"For you\"` (default selected), `tab \"Following\"`, possibly custom tabs\n- Compose area: `textbox \"Post text\"` — inline compose on home page\n- Account button: `button \"Account menu\"` — shows logged-in username\n- Timeline region: `region \"Your Home Timeline\"` — contains tweet `article` elements\n\n**Known Issues**:\n- None\n\n---\n\n### 1.2 Open a Specific Tweet by URL\n\n**Goal**: Navigate directly to a tweet and read its content.\n\n**Preconditions**: Have the tweet URL (e.g. `https:\u002F\u002Fx.com\u002Fuser\u002Fstatus\u002F123456`).\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fstatus\u002F\u003Ctweet_id>\"\n```\n\n**Verification**:\n```bash\n# Title should contain the author's name and tweet content preview\nagent-browser get title\n# URL should match the tweet URL\nagent-browser get url\n# Snapshot should show the tweet article with full text and engagement buttons\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Key Elements** (tweet detail page):\n- Tweet article: `article` — contains full tweet text, author info, engagement stats\n- Author links: `link \"\u003CDisplayName> Verified account\"`, `link \"@\u003Cusername>\"`\n- Timestamp: `link \"\u003Ctime> · \u003Cdate>\"` (e.g. `\"2:30 PM · May 5, 2026\"`)\n- View count: `link \"\u003CN> Views\"`\n- Engagement buttons: `button \"N Reply. Reply\"`, `button \"N reposts. Repost\"`, `button \"N Likes. Like\"`, `button \"N Bookmarks. Bookmark\"`, `button \"Share post\"`\n- Subscribe button: `button \"Subscribe to @\u003Cusername>\"`\n\n**Known Issues**:\n- None\n\n---\n\n### 1.3 Search Tweets by Keyword\n\n**Goal**: Search for tweets matching a keyword or query, read the results.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\n# For \"Top\" results (default):\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query\"\n\n# For \"Latest\" results:\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query&f=live\"\n\n# For \"People\" results:\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query&f=user\"\n\n# For \"Media\" results:\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=\u003Curl_encoded_query>&src=typed_query&f=image\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"\u003Cquery> - Search \u002F X\"\nagent-browser get title\n# Check which tab is active\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n# Read search result tweets\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Key Elements**:\n- Search tabs: `tab \"Top\"`, `tab \"Latest\"`, `tab \"People\"`, `tab \"Media\"`, `tab \"Lists\"`\n- The `f` URL parameter controls tab: omitted = Top, `live` = Latest, `user` = People, `image` = Media\n- Back button: `button \"Back\"` — returns to previous page\n- Each result is an `article` element identical in structure to timeline tweets\n\n**Known Issues**:\n- URL-encode the query string (spaces → `%20`, etc.)\n- Search results may show \"login wall\" for non-authenticated sessions\n- X advanced search operators work: `from:user`, `since:2026-01-01`, `min_faves:100`, etc.\n\n---\n\n### 1.4 View a User Profile\n\n**Goal**: Navigate to a user's profile and read their bio and multiple recent tweets.\n\n**Preconditions**: Have the username or profile URL.\n\n**Steps**:\n```bash\n# 1. Navigate to profile\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\"\n\n# 2. Initial snapshot — typically only shows the PINNED tweet (if any)\nagent-browser snapshot -i -c -s 'article'\n# WARNING: The first article is usually the pinned tweet, NOT the latest post.\n# You MUST scroll down to see actual recent posts.\n\n# 3. Scroll down to load recent posts (past the pinned tweet and profile header)\nagent-browser scroll down 3000\nagent-browser wait 2000\nagent-browser snapshot -i -c -s 'article'\n# Now you should see the first recent (non-pinned) post\n\n# 4. Continue scrolling to load more posts — repeat as needed\nagent-browser scroll down 3000\nagent-browser wait 2000\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Verification**:\n```bash\n# Title should contain \"\u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n# URL should be https:\u002F\u002Fx.com\u002F\u003Cusername>\nagent-browser get url\n```\n\n**Key Pattern — Browsing Multiple Posts**:\n```bash\n# To browse N posts from a user's profile, use this scroll loop:\n# Each scroll+wait cycle reveals ~1 new post due to virtualized list\nfor i in $(seq 1 N); do\n  agent-browser scroll down 3000\n  sleep 2  # or: agent-browser wait 2000\n  agent-browser snapshot -i -c -s 'article'\n  # Process the visible article(s)\ndone\n```\n\n**Known Issues**:\n- **CRITICAL**: The initial page view typically only shows the pinned tweet. **You MUST scroll down to see recent posts.** Agents often mistakenly think the pinned tweet is the only content.\n- X uses a virtualized list — only 1-2 articles in the viewport are in the DOM at any time. Scrolled-past articles are removed from DOM.\n- Scroll amount of 3000px + 2 second wait reliably loads next batch\n- Pinned tweet has text `\"Pinned\"` at the beginning of its article description — use this to identify and skip it\n- Profile has tabs: Posts, Replies, Highlights, Media, Likes — default is \"Posts\" which excludes replies. Use `https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fwith_replies` for posts + replies.\n\n---\n\n### 1.5 Read Tweet Thread \u002F Replies\n\n**Goal**: Open a tweet and read the full thread and replies below it.\n\n**Preconditions**: Have the tweet URL.\n\n**Steps**:\n```bash\n# 1. Open the tweet\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fstatus\u002F\u003Ctweet_id>\"\n\n# 2. Scroll down to load replies\nagent-browser scroll down 800\n\n# 3. Read replies (they appear as additional article elements below the main tweet)\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Verification**:\n```bash\n# Multiple article elements should be present — first is the main tweet, rest are replies\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Known Issues**:\n- Replies may be paginated — look for `button \"Show more replies\"` and click it\n- \"Show probably spam\" section may appear — skip it\n- Thread context (parent tweets) appears above the main tweet\n- **Quote tweet click trap**: If a reply or timeline entry is a quote tweet, clicking the article body navigates to the quoted original post instead of the quote tweet detail page. To navigate to the correct tweet, click the **timestamp link** instead. See section 3.4 Known Issues for full details.\n\n---\n\n### 1.6 Read Notifications\n\n**Goal**: Open the notifications tab and read recent notifications.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\nagent-browser open https:\u002F\u002Fx.com\u002Fnotifications\n```\n\n**Verification**:\n```bash\n# Title should contain \"Notifications \u002F X\"\nagent-browser get title\n# URL should be https:\u002F\u002Fx.com\u002Fnotifications\nagent-browser get url\n```\n\n**Key Elements**:\n- Notification tabs: All, Verified, Mentions\n- Sidebar link shows unread count: `link \"Notifications (N unread notifications)\"`\n\n**Known Issues**:\n- Notifications have sub-tabs: All, Verified, Mentions\n\n---\n\n### 1.7 Read DMs (Direct Messages)\n\n**Goal**: Open DMs and read recent messages.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\n# Note: \u002Fmessages redirects to \u002Fi\u002Fchat\nagent-browser open https:\u002F\u002Fx.com\u002Fmessages\n```\n\n**Verification**:\n```bash\n# URL will be https:\u002F\u002Fx.com\u002Fi\u002Fchat (auto-redirect)\nagent-browser get url\n```\n\n**Known Issues**:\n- URL redirects from `\u002Fmessages` to `\u002Fi\u002Fchat`\n- DM UI is a side panel or full page depending on viewport\n- May require X Premium for some DM features\n\n---\n\n## 2. Engagement — React to Content\n\n### 2.1 Like a Tweet\n\n**Goal**: Like a specific tweet.\n\n**Preconditions**: On a page where the tweet is visible (timeline, tweet detail, search results).\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Like button for the target tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Like\" (not yet liked) inside the target article\n\n# 2. Click the Like button\nagent-browser click \u003Clike_button_ref>\n```\n\n**Verification**:\n```bash\n# Snapshot again — button text should change from \"Like\" to \"Liked\"\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Liked\"\n```\n\n**Element Identification**:\n- **Not liked**: `button \"N Likes. Like\"` — text ends with `. Like`\n- **Already liked**: `button \"N Likes. Liked\"` — text ends with `. Liked`\n- The like count N increments by 1 after liking\n\n**Known Issues**:\n- Rate limiting: X may restrict rapid likes\n- The button ref may change after state change (re-snapshot to get new ref)\n\n---\n\n### 2.2 Unlike a Tweet\n\n**Goal**: Remove a like from a previously liked tweet.\n\n**Preconditions**: Tweet is already liked.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Liked button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Liked\"\n\n# 2. Click the same button to unlike\nagent-browser click \u003Cliked_button_ref>\n```\n\n**Verification**:\n```bash\n# Button text should revert from \"Liked\" to \"Like\"\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N Likes. Like\"\n```\n\n**Element Identification**:\n- Same button toggles between Like\u002FLiked states\n- Ref may change between states — always re-snapshot\n\n**Known Issues**:\n- None\n\n---\n\n### 2.3 Retweet (Repost)\n\n**Goal**: Repost a tweet to own timeline.\n\n**Preconditions**: On a page where the tweet is visible.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Repost button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N reposts. Repost\" [expanded=false]\n\n# 2. Click Repost button — this opens a DROPDOWN MENU, not the action itself\nagent-browser click \u003Crepost_button_ref>\n\n# 3. Snapshot to see the dropdown menu items\nagent-browser snapshot -i -c -s '[role=\"menuitem\"]'\n# Shows: menuitem \"Repost\" and menuitem \"Quote\"\n\n# 4. Click \"Repost\" menu item to execute the repost\nagent-browser click \u003Crepost_menuitem_ref>\n```\n\n**Verification**:\n```bash\n# Snapshot — button text should change from \"Repost\" to \"Reposted\"\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Element Identification**:\n- Repost button: `button \"N reposts. Repost\" [expanded=false]`\n- Dropdown items: `menuitem \"Repost\"` and `menuitem \"Quote\"`\n- After repost: button becomes `button \"N reposts. Reposted\"`\n\n**Known Issues**:\n- **Two-step operation**: clicking the button opens a dropdown, you must then click the menuitem\n- To cancel\u002Fclose the dropdown without acting: `agent-browser press Escape`\n\n---\n\n### 2.4 Undo Retweet\n\n**Goal**: Remove a repost.\n\n**Preconditions**: Tweet is already retweeted.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Reposted button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N reposts. Reposted\"\n\n# 2. Click — opens dropdown with \"Undo repost\" option\nagent-browser click \u003Creposted_button_ref>\n\n# 3. Find and click \"Undo repost\" menu item\nagent-browser snapshot -i -c -s '[role=\"menuitem\"]'\nagent-browser click \u003Cundo_repost_menuitem_ref>\n```\n\n**Verification**:\n```bash\n# Button text should revert to \"Repost\"\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Element Identification**:\n- Already reposted: `button \"N reposts. Reposted\"`\n- Dropdown item: `menuitem \"Undo repost\"`\n\n**Known Issues**:\n- Same two-step dropdown pattern as Repost\n\n---\n\n### 2.5 Bookmark a Tweet\n\n**Goal**: Bookmark a tweet for later reading.\n\n**Preconditions**: On a page where the tweet is visible.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Bookmark button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"Bookmark\" (on timeline) or button \"N Bookmarks. Bookmark\" (on tweet detail)\n\n# 2. Click Bookmark button — single click, no dropdown\nagent-browser click \u003Cbookmark_button_ref>\n```\n\n**Verification**:\n```bash\n# Button text should change from \"Bookmark\" to \"Bookmarked\"\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"Bookmarked\" or button \"N Bookmarks. Bookmarked\"\n```\n\n**Element Identification**:\n- **Timeline view**: `button \"Bookmark\"` → `button \"Bookmarked\"`\n- **Tweet detail view**: `button \"N Bookmarks. Bookmark\"` → `button \"N Bookmarks. Bookmarked\"`\n- Single click — no dropdown or confirmation needed\n\n**Known Issues**:\n- Bookmark button ref changes after state change (e.g. e137 → e139) — re-snapshot after clicking\n\n---\n\n### 2.6 Remove Bookmark\n\n**Goal**: Remove a previously bookmarked tweet.\n\n**Preconditions**: Tweet is already bookmarked.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Bookmarked button\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"Bookmarked\"\n\n# 2. Click to remove bookmark\nagent-browser click \u003Cbookmarked_button_ref>\n```\n\n**Verification**:\n```bash\n# Button text should revert from \"Bookmarked\" to \"Bookmark\"\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Element Identification**:\n- Same toggle pattern as Like: click \"Bookmarked\" button to un-bookmark\n\n**Known Issues**:\n- None\n\n---\n\n## 3. Content Creation\n\n### 3.1 Post a New Tweet (Text Only)\n\n**Goal**: Compose and publish a new tweet with text only.\n\n**Preconditions**: Logged in, on home timeline (compose area visible).\n\n**Steps**:\n```bash\n# 1. Navigate to home (compose area is inline on home page)\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n\n# 2. Snapshot to find the compose textbox\nagent-browser snapshot -i -c\n# Look for: textbox \"Post text\"\n\n# 3. Fill the compose area with tweet text\nagent-browser fill \u003Ctextbox_ref> \"Your tweet text here\"\n\n# 4. Snapshot to confirm text is filled and Post button is enabled\nagent-browser snapshot -i -c\n# Look for: button \"Post\" (without [disabled])\n\n# 5. Click Post to send\nagent-browser click \u003Cpost_button_ref>\n```\n\n**Verification**:\n```bash\n# After posting, the compose area should be empty and the tweet should appear in timeline\nagent-browser snapshot -i -c -s 'article'\n# Look for your tweet as the first article with your username and \"Now\" timestamp\n```\n\n**Element Identification**:\n- Compose textbox: `textbox \"Post text\"` — this is a contenteditable div, NOT a standard `\u003Cinput>`\n- Post button (empty): `button \"Post\" [disabled]` — disabled when no text\n- Post button (ready): `button \"Post\"` — enabled when text is present\n- After posting: tweet appears as `article` with `\"@\u003Cyour_username> Now\"` in timeline\n\n**Known Issues**:\n- **`fill` works**, `type` and `keyboard type` do NOT work on this contenteditable div\n- **CRITICAL — beforeunload trap**: Once you `fill` text into compose, X.com registers a `beforeunload` event. If you navigate away (open, reload) WITHOUT posting or clearing, Chrome shows a \"Leave site?\" dialog that **freezes agent-browser completely**. The Playwright daemon cannot dismiss this dialog when connected via CDP.\n  - **Prevention**: Always either post the tweet or clear text before navigating. To clear: use `agent-browser eval \"const el = document.querySelector('[data-testid=\\\"tweetTextarea_0\\\"]'); if(el) { el.focus(); document.execCommand('selectAll'); document.execCommand('delete'); }\"`\n  - **Recovery**: If the dialog appears, the only option is to manually click \"Leave\" in the Chrome UI, then kill and restart the agent-browser daemon (`pkill -9 -f agent-browser && agent-browser connect 9222`)\n- 280 character limit\n- `get value` returns empty on this textbox — use snapshot to verify content\n\n---\n\n### 3.2 Post a Tweet with Image\n\n**Goal**: Compose and publish a tweet with one or more images attached.\n\n**Preconditions**: Logged in, on home timeline, image file available on local filesystem.\n\n**Steps**:\n```bash\n# 1. Navigate to home\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n\n# 2. Snapshot to find upload elements\nagent-browser snapshot -i -c\n# Look for: button \"Add photos or video\" and button \"Choose Files\"\n\n# 3. Upload image file using the hidden file input\nagent-browser upload \u003Cchoose_files_button_ref> \u002Fpath\u002Fto\u002Fimage.png\n\n# 4. Wait for image to process\nagent-browser wait 2000\n\n# 5. Fill tweet text (optional — image-only tweets are allowed)\nagent-browser fill \u003Ctextbox_ref> \"Your tweet text here\"\n\n# 6. Click Post\nagent-browser click \u003Cpost_button_ref>\n```\n\n**Element Identification**:\n- Add media button: `button \"Add photos or video\"`\n- Hidden file input: `button \"Choose Files\"` — use this with `upload` command\n- GIF button: `button \"Add a GIF\"`\n- Generate image: `button \"Generate image\"`\n\n**Known Issues**:\n- Same beforeunload trap as 3.1 applies after filling text or uploading image\n- Image processing takes time; wait before clicking Post\n- Max 4 images per tweet\n\n---\n\n### 3.3 Reply to a Tweet\n\n**Goal**: Post a reply to a specific tweet.\n\n**Preconditions**: On the tweet detail page (navigate to the tweet URL first).\n\n**Steps**:\n```bash\n# 1. Open the tweet detail page\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Fstatus\u002F\u003Ctweet_id>\"\n\n# 2. Snapshot to find the reply compose area (it's below the main tweet)\nagent-browser snapshot -i -c\n# Look for: textbox \"Post text\" inside a \"Post your reply\" container\n# Also look for: button \"Reply\" [disabled]\n\n# 3. Fill the reply text\nagent-browser fill \u003Creply_textbox_ref> \"Your reply text here\"\n\n# 4. Snapshot to confirm Reply button is enabled\nagent-browser snapshot -i -c\n# Look for: button \"Reply\" (without [disabled])\n\n# 5. Click Reply to send\nagent-browser click \u003Creply_button_ref>\n```\n\n**Verification**:\n```bash\n# After replying, your reply should appear as a new article in the thread\nagent-browser snapshot -i -c -s 'article'\n# Look for article with your username and \"Now\" timestamp\n```\n\n**Element Identification**:\n- Reply compose container: `generic \"Post your replyReplyEveryone can reply\"`\n- Reply textbox: `textbox \"Post text\"` — same element type as main compose\n- Reply button (empty): `button \"Reply\" [disabled]`\n- Reply button (ready): `button \"Reply\"` — enabled when text is present\n- Note: The main tweet also has `button \"N Reply. Reply\"` (engagement stat) — this is NOT the submit button\n\n**Known Issues**:\n- **Recommended approach**: Navigate to tweet detail page first, then use the inline reply box. This is more reliable than clicking reply from timeline (which opens a modal).\n- Same beforeunload trap as 3.1 — always post or clear before navigating away\n- `fill` works on the reply textbox (same contenteditable div behavior)\n- **CRITICAL — Quote tweet navigation trap**: When browsing a timeline and you see a quote tweet (a tweet that embeds another tweet), clicking the article body navigates to the **quoted (embedded) original post**, NOT the quote tweet itself. This means if you want to reply to user A's quote tweet of user B, clicking the article takes you to user B's original post instead. See section 3.4 Known Issues for the correct approach.\n\n---\n\n### 3.4 Quote Tweet\n\n**Goal**: Quote-retweet a tweet with added commentary.\n\n**Preconditions**: On a page where the tweet is visible (timeline, search results, tweet detail).\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Repost button on the target tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"N reposts. Repost\" [expanded=false]\n\n# 2. Click Repost button to open dropdown\nagent-browser click \u003Crepost_button_ref>\n\n# 3. Snapshot to find the Quote menu item\nagent-browser snapshot -i -c -s '[role=\"menu\"]'\n# Shows: menuitem \"Repost\" and menuitem \"Quote\"\n\n# 4. Click \"Quote\" menu item — opens a compose modal\nagent-browser click \u003Cquote_menuitem_ref>\n\n# 5. Snapshot the compose modal — find textbox and Post button\nagent-browser snapshot -i -c\n# Look for: textbox \"Post text\" and button \"Post\"\n# The modal also shows a preview of the quoted tweet\n\n# 6. Fill the quote text\nagent-browser fill \u003Ctextbox_ref> \"Your commentary here\"\n\n# 7. Click Post to send\nagent-browser click \u003Cpost_button_ref>\n```\n\n**Verification**:\n```bash\n# After posting, the quote tweet should appear in timeline with your text + embedded quoted tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for article containing your text + \"Quote\" + original author's content\n```\n\n**Element Identification**:\n- Repost dropdown: `menuitem \"Repost\"` and `menuitem \"Quote\"`\n- Quote compose modal: contains `textbox \"Post text\"` and `button \"Post\"` — same structure as main compose\n- The quoted tweet preview appears as embedded content below the textbox\n\n**Known Issues**:\n- Two-step process: Repost button → dropdown → Quote menuitem → compose modal\n- Same beforeunload trap as 3.1 in the compose modal\n- To cancel: press Escape to close the modal (but clear text first if you've filled any)\n- **CRITICAL — Navigating to a quote tweet from timeline**: When a quote tweet appears in a timeline or search results, the article body contains an embedded `link` element pointing to the **quoted original post**. Clicking the article's main clickable area (`generic` element) navigates to the quoted original post's URL — NOT the quote tweet's own URL. This is because the embedded quoted content is wrapped in a `link` that captures click events.\n  - **Wrong**: Clicking the article body → navigates to `https:\u002F\u002Fx.com\u002F\u003Cquoted_user>\u002Fstatus\u002F\u003Cquoted_id>` (the original post)\n  - **Correct — Option 1**: Click the quote tweet's **timestamp link** (e.g., `link \"Apr 24\"`, `link \"May 5\"`) → navigates to `https:\u002F\u002Fx.com\u002F\u003Cquoting_user>\u002Fstatus\u002F\u003Cquote_id>` (the quote tweet itself)\n  - **Correct — Option 2**: Click the **Reply button** (`button \"N Reply. Reply\"`) directly from the timeline → opens reply compose targeting the quote tweet's author (no navigation needed)\n  - **Correct — Option 3**: If you already know the quote tweet's URL, navigate directly: `agent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cquoting_user>\u002Fstatus\u002F\u003Cquote_id>\"`\n\n---\n\n### 3.5 Delete Own Tweet\n\n**Goal**: Delete a tweet posted by the agent's account.\n\n**Preconditions**: Own tweet is visible (on profile, timeline, or search results).\n\n**Steps**:\n```bash\n# 1. Find the tweet — using search is the most reliable method\nagent-browser open \"https:\u002F\u002Fx.com\u002Fsearch?q=from%3A\u003Cusername>%20\u003Ckeyword>&src=typed_query&f=live\"\n\n# 2. Snapshot to find the More button on the target tweet\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"More\" [expanded=false] inside the target article\n\n# 3. IMPORTANT: scroll the More button into view, then click\nagent-browser scrollintoview \u003Cmore_button_ref>\nagent-browser click \u003Cmore_button_ref>\n\n# 4. Snapshot to find the Delete menu item\nagent-browser snapshot -i -c\n# Look for: menuitem \"Delete\"\n\n# 5. Click Delete\nagent-browser click \u003Cdelete_menuitem_ref>\n\n# 6. Confirmation dialog appears — click the confirm Delete button\nagent-browser snapshot -i -c\n# Look for: heading \"Delete post?\" + button \"Delete\" + button \"Cancel\"\nagent-browser click \u003Cconfirm_delete_button_ref>\n```\n\n**Verification**:\n```bash\n# The tweet should disappear from the page \u002F search results\nagent-browser snapshot -i -c -s 'article'\n# The deleted tweet should no longer be present\n```\n\n**Element Identification**:\n- More button: `button \"More\" [expanded=false]` — the \"...\" menu on each tweet\n- Menu items (own tweet): `menuitem \"Delete\"`, `menuitem \"Edit post\"`, `menuitem \"Pin to your profile\"`, `menuitem \"Add\u002Fremove from Highlights\"`, `menuitem \"Add\u002Fremove from Lists\"`, `menuitem \"Change who can reply\"`, `menuitem \"View post activity\"`, `menuitem \"Embed post\"`\n- Confirmation dialog: `heading \"Delete post?\"` + `button \"Delete\"` + `button \"Cancel\"`\n\n**Known Issues**:\n- **Three-step operation**: More button → Delete menuitem → Confirm dialog\n- **`scrollintoview` before clicking More is important** — without it the click may not trigger the dropdown (likely the button is outside the viewport or behind another element)\n- Finding own tweets: use search `from:\u003Cusername> \u003Ckeyword>` with `f=live` tab for most reliable results. Profile page may have caching delay.\n- After deletion, you may be redirected to the previous page or see a \"This post was deleted\" placeholder\n\n---\n\n## 4. Social Graph\n\n### 4.1 Follow a User\n\n**Goal**: Follow a user from their profile page.\n\n**Preconditions**: On the target user's profile page, not already following.\n\n**Steps**:\n```bash\n# 1. Navigate to the user's profile\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\"\n\n# 2. Snapshot to find the Follow button\nagent-browser snapshot -i -c\n# Look for: button \"Follow @\u003Cusername>\"\n\n# 3. Click Follow\nagent-browser click \u003Cfollow_button_ref>\n```\n\n**Verification**:\n```bash\n# Button should change from \"Follow @\u003Cusername>\" to \"Unfollow @\u003Cusername>\"\nagent-browser snapshot -i -c\n# Look for: button \"Unfollow @\u003Cusername>\" [expanded=false]\n```\n\n**Element Identification**:\n- **Not following**: `button \"Follow @\u003Cusername>\"`\n- **Already following**: `button \"Unfollow @\u003Cusername>\" [expanded=false]`\n- Note: The button text includes the `@username` — use this to distinguish from \"Who to follow\" sidebar buttons\n\n**Known Issues**:\n- Some accounts are protected; follow sends a request instead of immediately following\n- Single click — no confirmation needed\n\n---\n\n### 4.2 Unfollow a User\n\n**Goal**: Unfollow a user.\n\n**Preconditions**: On the target user's profile page, already following.\n\n**Steps**:\n```bash\n# 1. Snapshot to find the Unfollow button\nagent-browser snapshot -i -c\n# Look for: button \"Unfollow @\u003Cusername>\" [expanded=false]\n\n# 2. Click Unfollow — this opens a DROPDOWN (not direct action)\nagent-browser click \u003Cunfollow_button_ref>\n\n# 3. Snapshot to find the confirm menuitem\nagent-browser snapshot -i -c\n# Look for: menuitem \"Unfollow @\u003Cusername>\"\n\n# 4. Click the menuitem to confirm\nagent-browser click \u003Cunfollow_menuitem_ref>\n```\n\n**Verification**:\n```bash\n# Button should revert to \"Follow @\u003Cusername>\"\nagent-browser snapshot -i -c\n# Look for: button \"Follow @\u003Cusername>\"\n```\n\n**Element Identification**:\n- Unfollow button: `button \"Unfollow @\u003Cusername>\" [expanded=false]`\n- Dropdown confirm: `menuitem \"Unfollow @\u003Cusername>\"`\n- After unfollow: reverts to `button \"Follow @\u003Cusername>\"`\n\n**Known Issues**:\n- **Two-step operation**: click Unfollow button → dropdown appears → click menuitem to confirm\n- To cancel: press Escape to close dropdown\n\n---\n\n### 4.3 View Followers List\n\n**Goal**: View the followers list of a user.\n\n**Preconditions**: Have the username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Ffollowers\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"People following \u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n```\n\n**Known Issues**:\n- List is virtualized — only visible items are in DOM. Scroll to load more.\n\n---\n\n### 4.4 View Following List\n\n**Goal**: View the following list of a user.\n\n**Preconditions**: Have the username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Ffollowing\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"People followed by \u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n```\n\n**Known Issues**:\n- Same virtualization as followers list\n\n---\n\n## 5. Profile Management\n\n### 5.1 View Own Profile\n\n**Goal**: Navigate to the agent's own profile page.\n\n**Preconditions**: Logged in, know own username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cown_username>\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"\u003CDisplayName> (@\u003Cusername>) \u002F X\"\nagent-browser get title\n```\n\n**Known Issues**:\n- None\n\n---\n\n### 5.2 Edit Bio \u002F Display Name\n\n**Goal**: Update the agent account's bio or display name.\n\n**Preconditions**: On own profile page.\n\n**Steps**:\n```bash\n# 1. Navigate to own profile\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cown_username>\"\n\n# 2. Snapshot to find Edit profile link\nagent-browser snapshot -i -c\n# Look for: link \"Edit profile\"\n\n# 3. Click Edit profile — opens a modal\nagent-browser click \u003Cedit_profile_ref>\n\n# 4. Snapshot the modal to find fields\nagent-browser snapshot -i -c\n# Look for:\n#   textbox \"Name\": current display name\n#   textbox \"Bio\": current bio\n#   textbox \"Location\": current location\n#   textbox \"Website\": current website\n#   button \"Save\"\n\n# 5. Edit the desired field(s) using fill\nagent-browser fill \u003Cbio_textbox_ref> \"New bio text here\"\n\n# 6. Click Save\nagent-browser click \u003Csave_button_ref>\n```\n\n**Verification**:\n```bash\n# Modal should close. Reload profile and check updated content.\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cown_username>\"\nagent-browser snapshot -i -c\n```\n\n**Element Identification**:\n- Edit profile link: `link \"Edit profile\"` — on own profile page only\n- Modal fields: `textbox \"Name\"`, `textbox \"Bio\"`, `textbox \"Location\"`, `textbox \"Website\"`\n- Save button: `button \"Save\"`\n- Close without saving: press Escape (may trigger beforeunload if fields were modified)\n\n**Known Issues**:\n- These are standard `textbox` elements (not contenteditable divs) — `fill` works normally\n- Bio has a 160 character limit\n- Name has a 50 character limit\n\n---\n\n### 5.3 Pin a Tweet\n\n**Goal**: Pin a tweet to the top of own profile.\n\n**Preconditions**: On own tweet (visible on profile, search results, or tweet detail page).\n\n**Steps**:\n```bash\n# 1. Find own tweet and its More button (same as 3.5 Delete flow)\nagent-browser snapshot -i -c -s 'article'\n# Look for: button \"More\" [expanded=false] on the target tweet\n\n# 2. Scroll into view and click More\nagent-browser scrollintoview \u003Cmore_button_ref>\nagent-browser click \u003Cmore_button_ref>\n\n# 3. Find and click \"Pin to your profile\"\nagent-browser snapshot -i -c\n# Look for: menuitem \"Pin to your profile\"\nagent-browser click \u003Cpin_menuitem_ref>\n\n# 4. Confirm in the dialog (if one appears)\nagent-browser snapshot -i -c\n# Look for confirmation button and click it\n```\n\n**Element Identification**:\n- Menu item: `menuitem \"Pin to your profile\"`\n- If already pinned: `menuitem \"Unpin from profile\"` appears instead\n\n**Known Issues**:\n- Same More button pattern as Delete (3.5) — use `scrollintoview` before clicking\n- Only one tweet can be pinned at a time; pinning a new one unpins the old one\n\n---\n\n## 6. Navigation & Utility\n\n### 6.1 Switch Between Tabs (For You \u002F Following)\n\n**Goal**: Switch the home timeline between \"For you\" and \"Following\" tabs.\n\n**Preconditions**: On home timeline.\n\n**Steps**:\n```bash\n# 1. Navigate to home\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\n\n# 2. Snapshot the tablist to see available tabs\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n# Shows: tab \"For you\" [selected], tab \"Following\", possibly custom tabs\n\n# 3. Click the desired tab\nagent-browser click \u003Ctab_ref>\n```\n\n**Verification**:\n```bash\n# The clicked tab should now have [selected] attribute\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n```\n\n**Element Identification**:\n- Tabs are `tab` role elements inside a `tablist`\n- Selected tab has `[selected]` attribute\n- Default tabs: `tab \"For you\"`, `tab \"Following\"`\n- Users may have custom tabs (e.g. Lists)\n\n**Known Issues**:\n- Tab names may vary by locale\n- Custom tabs may be present (user-created Lists pinned to home)\n\n---\n\n### 6.2 Scroll to Load More Tweets\n\n**Goal**: Scroll down to trigger lazy-loading of additional tweets.\n\n**Preconditions**: On any timeline or search results page.\n\n**Steps**:\n```bash\n# Scroll down by pixel amount\nagent-browser scroll down 2000\n\n# Wait for new content to load\nagent-browser wait 2000\n\n# Check loaded content\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Verification**:\n```bash\n# New articles should be present in the snapshot\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Known Issues**:\n- X uses a **virtualized list** — only articles in the current viewport are in the DOM. Scrolled-past articles are removed. So `snapshot -s 'article'` always shows ~1-3 articles regardless of how many have been loaded.\n- Multiple scroll operations may be needed: `agent-browser scroll down 2000` repeated\n- Scroll amount of 2000-3000px is typically enough to trigger lazy load\n\n---\n\n### 6.3 Handle Login Popups \u002F Modals\n\n**Goal**: Dismiss the \"Sign in\" or \"Create account\" overlay that X shows to non-authenticated users or as a periodic prompt.\n\n**Preconditions**: Popup is visible. Usually only appears for non-authenticated sessions.\n\n**Steps**:\n```bash\n# Snapshot to identify the popup type and close\u002Fdismiss button\nagent-browser snapshot -i -c\n\n# Common patterns:\n# 1. Close button (X icon): look for button with close-related label\n# 2. \"Not now\" or \"Skip\" link\u002Fbutton\n# 3. Click outside the modal\n\n# Try pressing Escape first\nagent-browser press Escape\n```\n\n**Known Issues**:\n- Multiple types of login prompts exist (bottom bar, full modal, interstitial)\n- When using CDP with a logged-in profile, these should not appear\n- **A full login wall (\"Sign in\", \"Email or username\", \"Continue with…\") means the isolated\n  CDP profile is LOGGED OUT — NOT something to dismiss or work around.** Do not try to log in,\n  do not type credentials, do not open a fresh session. STOP and tell the user to log into X\n  in the isolated Chrome window (`bun run setup-chrome` reconnects without wiping; `--reset`\n  for a clean re-login). Resume only after they confirm they are logged in.\n- A small periodic in-app prompt (not a full wall) on an otherwise logged-in timeline can be\n  dismissed with `agent-browser press Escape`.\n\n---\n\n### 6.4 Handle Cookie Consent Banner\n\n**Goal**: Accept or dismiss the cookie consent banner.\n\n**Preconditions**: Banner is visible (usually first visit without saved cookies).\n\n**Steps**:\n```bash\n# Snapshot to find the consent banner\nagent-browser snapshot -i -c\n\n# Look for accept\u002Fdecline buttons — common patterns:\n# button \"Accept all cookies\"\n# button \"Refuse non-essential cookies\"\nagent-browser click \u003Caccept_button_ref>\n```\n\n**Known Issues**:\n- When using CDP with an existing Chrome profile, cookie consent is usually already accepted\n- Banner may not appear at all in CDP sessions\n\n---\n\n### 6.5 Dismiss \"Turn on notifications\" Prompt\n\n**Goal**: Close the browser notification permission prompt or X's in-app notification suggestion.\n\n**Preconditions**: Prompt is visible.\n\n**Steps**:\n```bash\n# For X's in-app prompt (DOM element):\nagent-browser snapshot -i -c\n# Look for dismiss\u002Fclose button near the notification suggestion\nagent-browser click \u003Cdismiss_button_ref>\n\n# For browser-level notification prompt:\n# This is handled automatically by agent-browser (auto-dismiss dialogs)\n# If not, use --no-auto-dialog flag to prevent it from appearing\n```\n\n**Known Issues**:\n- Browser-level notification prompt is auto-dismissed by agent-browser by default\n- X's in-app prompt is a regular DOM element — find and click the close button\n- When using CDP with existing profile, notification permissions are usually already set\n\n---\n\n## 7. Lists\n\n### 7.1 View Own Lists\n\n**Goal**: Navigate to the user's lists management page.\n\n**Preconditions**: Logged in, know own username.\n\n**Steps**:\n```bash\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Flists\"\n```\n\n**Verification**:\n```bash\n# Title should contain \"Lists created by @\u003Cusername> \u002F X\"\nagent-browser get title\n```\n\n**Key Elements**:\n- Create button: `link \"Create a new List\"`\n- Your lists section: `region \"Your Lists\"` — contains links to each list\n- Each list link: `link \"\u003CListName> N members \u003COwnerName> @\u003Cowner> Pin List\"`\n- Pin button: `button \"Pin List\"` — pins list to home timeline sidebar\n- Discover section: `heading \"Discover new Lists\"`\n\n**Known Issues**:\n- None\n\n---\n\n### 7.2 View a List Timeline\n\n**Goal**: Open a specific list and read its timeline (posts from list members).\n\n**Preconditions**: Know the list URL or navigate from lists page.\n\n**Steps**:\n```bash\n# Option A: Direct URL (list ID from the lists page)\nagent-browser open \"https:\u002F\u002Fx.com\u002Fi\u002Flists\u002F\u003Clist_id>\"\n\n# Option B: From lists page, click the list link\nagent-browser snapshot -i -c\n# Look for: link \"\u003CListName> N members ...\"\nagent-browser click \u003Clist_link_ref>\n```\n\n**Verification**:\n```bash\n# URL should be https:\u002F\u002Fx.com\u002Fi\u002Flists\u002F\u003Clist_id>\nagent-browser get url\n# Articles from list members should appear\nagent-browser snapshot -i -c -s 'article'\n```\n\n**Key Elements** (list timeline page):\n- List header with name and member count\n- Edit link: `link \"Edit List\"` — only for own lists\n- Members link: `link \"N Members\"` — opens members modal\n- Share button: `button \"Share Menu\"`\n- More button: `button \"More\"` — additional list options\n- Timeline: same `article` structure as home timeline\n\n**Known Issues**:\n- Same virtualized list behavior as home timeline — scroll to load more posts\n- List URL format is `\u002Fi\u002Flists\u002F\u003Cnumeric_id>`, not a human-readable slug\n\n---\n\n### 7.3 Browse List Members\n\n**Goal**: View all members of a list.\n\n**Preconditions**: On the list timeline page.\n\n**Steps**:\n```bash\n# 1. On the list page, find and click the Members link\nagent-browser snapshot -i -c\n# Look for: link \"N Members\"\nagent-browser click \u003Cmembers_link_ref>\n\n# 2. Members modal opens — shows all members\nagent-browser snapshot -i -c\n# Each member has: button \"\u003CName> @\u003Cusername> Remove ...\" (for own lists)\n```\n\n**Verification**:\n```bash\n# Modal should show heading \"List members\" and list of members\nagent-browser snapshot -i -c\n# Look for: heading \"List members\" and button elements for each member\n```\n\n**Element Identification**:\n- Members modal: `heading \"List members\"`\n- Each member (own list): `button \"\u003CName> Verified account @\u003Cusername> Remove ...\"`\n- Each member has a `button \"Remove\"` to remove them from the list\n- Close modal: press Escape\n\n**Known Issues**:\n- Members list may be long — scroll to see all members\n\n---\n\n### 7.4 Create a New List\n\n**Goal**: Create a new list and optionally add initial members.\n\n**Preconditions**: Logged in.\n\n**Steps**:\n```bash\n# 1. Navigate to lists page\nagent-browser open \"https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Flists\"\n\n# 2. Click \"Create a new List\"\nagent-browser snapshot -i -c\n# Look for: link \"Create a new List\"\nagent-browser click \u003Ccreate_link_ref>\n\n# 3. Fill in list details\nagent-browser snapshot -i -c\n# Modal shows: textbox \"Name\", textbox \"Description\", checkbox \"Make private\", button \"Next\" [disabled]\nagent-browser fill \u003Cname_textbox_ref> \"My List Name\"\n# Optionally: agent-browser fill \u003Cdescription_textbox_ref> \"Description\"\n# Optionally: agent-browser click \u003Cmake_private_checkbox_ref>\n\n# 4. Click Next (enabled after name is filled)\nagent-browser click \u003Cnext_button_ref>\n\n# 5. Add members page appears — search and add users\nagent-browser snapshot -i -c\n# Shows: combobox \"Search query\", tab \"Members (0)\", tab \"Suggested\", button \"Done\"\nagent-browser fill \u003Csearch_combobox_ref> \"\u003Cusername_to_search>\"\n# Wait for search results\nagent-browser wait 1000\nagent-browser snapshot -i -c\n# Look for: button \"Add\" next to the user\nagent-browser click \u003Cadd_button_ref>\n\n# 6. Click Done to finish\nagent-browser click \u003Cdone_button_ref>\n```\n\n**Verification**:\n```bash\n# Should redirect to the new list's timeline page\nagent-browser get url\n# URL should be https:\u002F\u002Fx.com\u002Fi\u002Flists\u002F\u003Cnew_list_id>\n```\n\n**Element Identification**:\n- Create modal step 1: `textbox \"Name\"`, `textbox \"Description\"`, `checkbox \"Make private\"`, `button \"Next\" [disabled]`\n- Create modal step 2: `combobox \"Search query\"`, `button \"Done\"`, `tab \"Members (N)\"`, `tab \"Suggested\"`\n- Each search result: `button \"\u003CName> @\u003Cusername> Add ...\"` with nested `button \"Add\"`\n- After adding: button changes from `\"Add\"` to `\"Remove\"`\n\n**Known Issues**:\n- List name **cannot contain special characters** like `[`, `]`, etc. — validation error: \"A list's name can't include a disallowed\"\n- Name max length: 25 characters\n- After clicking Next, there's an optional banner photo upload step (can be skipped by proceeding to add members)\n\n---\n\n### 7.5 Add Member to List\n\n**Goal**: Add a user to an existing list.\n\n**Preconditions**: On the list page (own list).\n\n**Steps**:\n```bash\n# 1. Click Edit List\nagent-browser snapshot -i -c\n# Look for: link \"Edit List\"\nagent-browser click \u003Cedit_list_ref>\n\n# 2. Click \"Manage members\" tab in the edit modal\nagent-browser snapshot -i -c\n# Look for: tab \"Manage members\"\nagent-browser click \u003Cmanage_members_tab_ref>\n\n# 3. Switch to \"Suggested\" tab to search for users\nagent-browser snapshot -i -c -s '[role=\"tablist\"]'\n# Look for: tab \"Members (N)\" and tab \"Suggested\"\nagent-browser click \u003Csuggested_tab_ref>\n\n# 4. Search for the user to add\nagent-browser snapshot -i -c\n# Look for: combobox \"Search query\"\nagent-browser fill \u003Csearch_combobox_ref> \"\u003Cusername>\"\nagent-browser wait 1000\n\n# 5. Click Add on the search result\nagent-browser snapshot -i -c\n# Look for: button \"Add\" next to the user\nagent-browser click \u003Cadd_button_ref>\n```\n\n**Verification**:\n```bash\n# The button should change from \"Add\" to \"Remove\"\n# Members tab count should increment: tab \"Members (N+1)\"\nagent-browser snapshot -i -c\n```\n\n**Element Identification**:\n- Manage members modal: `heading \"Manage members\"`\n- Sub-tabs: `tab \"Members (N)\"` [selected], `tab \"Suggested\"`\n- Search: `combobox \"Search query\"`\n- Each user: `button \"Add\"` (not added) or `button \"Remove\"` (already in list)\n\n**Known Issues**:\n- None\n\n---\n\n### 7.6 Remove Member from List\n\n**Goal**: Remove a user from an existing list.\n\n**Preconditions**: On the list page (own list), user is a member.\n\n**Steps**:\n```bash\n# Option A: From Members modal (7.3)\n# Each member has a \"Remove\" button\nagent-browser click \u003Cremove_button_ref>\n\n# Option B: From Edit List → Manage members → Members tab\nagent-browser snapshot -i -c\n# Each member row has: button \"Remove\"\nagent-browser click \u003Cremove_button_ref>\n```\n\n**Verification**:\n```bash\n# Member count should decrement\n# The user should disappear from the members list\nagent-browser snapshot -i -c\n```\n\n**Known Issues**:\n- Remove is immediate — no confirmation dialog\n- Member count updates instantly in the tab label\n\n---\n\n### 7.7 Delete a List\n\n**Goal**: Delete an entire list.\n\n**Preconditions**: On the list page (own list).\n\n**Steps**:\n```bash\n# 1. Click Edit List\nagent-browser snapshot -i -c\n# Look for: link \"Edit List\"\nagent-browser click \u003Cedit_list_ref>\n\n# 2. Click Delete List\nagent-browser snapshot -i -c\n# Look for: button \"Delete List\"\nagent-browser click \u003Cdelete_list_button_ref>\n\n# 3. Confirmation dialog appears\nagent-browser snapshot -i -c\n# Look for: heading \"Delete List?\" + button \"Delete\" + button \"Cancel\"\nagent-browser click \u003Cconfirm_delete_ref>\n```\n\n**Verification**:\n```bash\n# Should redirect to lists page\nagent-browser get url\n# URL should be https:\u002F\u002Fx.com\u002F\u003Cusername>\u002Flists\u002F\n```\n\n**Element Identification**:\n- Edit modal: `button \"Delete List\"` — red\u002Fdestructive button at bottom\n- Confirmation: `heading \"Delete List?\"` + `button \"Delete\"` + `button \"Cancel\"`\n\n**Known Issues**:\n- Deletion is permanent — no undo\n- Redirects to `\u002F\u003Cusername>\u002Flists\u002F` after successful deletion\n\n---\n\n## Testing Notes\n\n### General Approach\n\nFor each operation above:\n\n1. Preflight (`bun run doctor --check-cdp`; if down, `bun run setup-chrome`). agent-browser is pinned to the isolated CDP Chrome via `agent-browser.json`, so commands auto-attach — no `connect`\u002F`--cdp` needed. Never open a fresh `--session-name`\u002F`--headed` browser to log in.\n2. Run `agent-browser snapshot -i` to see current interactive elements\n3. Execute each step, taking snapshots between steps to verify state changes\n4. Record the working command sequence\n5. Note any element identification strategies (aria-label, role, text content)\n6. Test at least 3 times to confirm reliability\n\n### Element Identification Strategy\n\nDo NOT hardcode `@ref` numbers (e.g. `@e3`). Refs change between page loads. Instead, document:\n- The aria-label or aria-role to look for\n- The text content pattern\n- The CSS selector as fallback\n- The relative position in the accessibility tree\n\n### Session Management\n\n**There is exactly ONE authorized way to reach a logged-in X session: the isolated\nCDP Chrome on port 9222** (launched by `bun run setup-chrome`). See the\n\"Browser Connection Contract\" in the system prompt — it is binding for every operation here.\n\nagent-browser is pinned to that CDP port via `agent-browser.json`, so every command\nauto-attaches — no `connect`\u002F`--cdp` needed. Preflight, then just open:\n```bash\nbun run doctor --check-cdp        # if DOWN: bun run setup-chrome  (idempotent, never touches your normal Chrome)\nagent-browser open https:\u002F\u002Fx.com\u002Fhome\nagent-browser snapshot -i -c      # confirm you are logged in (timeline visible, not a login wall)\n```\nA `Timeout connecting to CDP at 127.0.0.1:9222` error means the isolated Chrome is not\nrunning (run `bun run setup-chrome`) — it is NOT a login problem.\n\n**Do NOT** use `--session-name`, `--headed`, or `--profile` to open a fresh browser and\nlog in — a fresh session has no cookies and pulls you into an automated login, which gets\nthe account rate-limited (\"We've temporarily limited your login\"). **Never type credentials\nor attempt a login.** If the CDP profile is logged out, STOP and ask the user to log in once\nin the isolated Chrome window (`bun run setup-chrome --reset` for a clean slate), then resume.\n",{"description":7,"allowed-tools":24,"user-invocable":26},[25],"Bash",true,"main","a89ad7bce27bec4806abcdc586847bb6641b147a","src\u002Ftools\u002Flocoagent\u002Fskills\u002Fx-com",1,"https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent","https:\u002F\u002Fwww.openagent.sbs\u002F","https:\u002F\u002Fgithub.com\u002FGitCoder052023","https:\u002F\u002Fhamdankhubaib.in","Backend-first Full-Stack Developer crafting end-to-end solutions • Part-time open-source builder & contributor • 6+ years of turning ideas into reality","2026-10-20 20:03:13",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":26},[39,42,45],{"tool":40,"command":41},"npx","npx skills add GitCoder052023\u002FOpenAgent --skill x-com",{"tool":43,"command":44},"bunx","bunx skills add GitCoder052023\u002FOpenAgent --skill x-com",{"tool":46,"command":47},"pnpm","pnpm dlx skills add GitCoder052023\u002FOpenAgent --skill x-com","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fskills\u002Fx-com\u002FSKILL.md",[],[51,58,64,70,77,84],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7DDR3KM9Z48DW4B6EAJ2N8C","macos-harness","Control a whole Mac from one persistent Python session with screenshots, PID-targeted input, an animated virtual pointer, targeted Apple Accessibility, Apple Events, Browser Harness CDP, and filesystem access. Use for native, Electron, browser, dialog, file, or cross-app tasks without moving the physical cursor or forcing apps into the foreground.","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Fmacos-harness\u002Fskills\u002Fmacos-harness\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7DDR2HA04G02TD18DJR9CRE","verify","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fsrc\u002Fskills\u002Fbundled\u002Fverify\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7DDQZXQ9JFT672D149ZX4JW","claude-api","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fsrc\u002Fskills\u002Fbundled\u002Fclaude-api\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7DDQJZRPTR5KDTHTY3VW73B","threads","Meta Threads (threads.net) platform operations playbook for agent-browser. Covers feed browsing, search, engagement, posting threads, replying, and notifications on dedicated CDP port 9227.","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fskills\u002Fthreads\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7DDQDZYSBN0ZA7YTCRH26E7","reddit","Reddit platform operations playbook for agent-browser. Covers subreddit exploration, post reading, upvoting, nested commenting, post submission (title, markdown body, flairs), and anti-bot safeguards on CDP port 9224.","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fskills\u002Freddit\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7DDQASMVAB1HXN8SRSQ6DNW","linkedin","LinkedIn platform operations playbook for agent-browser. Covers feed browsing, search, engagement, posting updates, commenting, and network connection operations on CDP port 9223.","https:\u002F\u002Fgithub.com\u002FGitCoder052023\u002FOpenAgent\u002Fblob\u002Fmain\u002Fsrc\u002Ftools\u002Flocoagent\u002Fskills\u002Flinkedin\u002FSKILL.md",[],[]]