x-dm-auto-chat
What it does
This skill manages X direct messages, from scanning the inbox to sending replies. It is for people who want help answering DMs in a consistent tone and who want to start a few new chats.
When to use it
- βWhen you have many unread X direct messages that need a reply.
- βWhen you want replies to follow a set tone and purpose for your brand.
- βWhen you want to start a few new conversations on X with people you choose.
Skill link
https://github.com/browser-act/skills/blob/main/solutions/social-listening/x-dm-auto-chat/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCheck my X inbox for unread messages, read each chat, and send friendly replies that match our brand voice.β
5 new skills a week. 1 minute to read.
How it works
The skill opens your X messages, finds the chats that need a reply, and reads the history. It then sends a reply written in the persona you set, and it applies rate limits and permission filters.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
X (Twitter) β DM Auto Chat (End-to-End)
Full X DM automation Skill: inbox scan β conversation read β persona-based reply β send; also supports search-and-outreach. The calling Agent generates reply text based on persona; this Skill handles all mechanical operations.
Language
All process output to user (progress updates, process notifications) follows the user's language.
Objective
Encapsulate "refresh DM list β identify pending replies β read context β reply with persona β send" and "search user β enter chat β send first message" into callable end-to-end capabilities.
Prerequisites
- Browser is open at X site, logged into X account (
[aria-label="Account menu"]present) - The 4-digit DM passcode for the current account is available (required for E2E encryption)
- Caller has prepared a "persona description" (used to generate replies), e.g.:
"You are BrowserAct outreach team. Tone: friendly, concise, professional. Goal: invite creators to collaborate."
- Optional: list of target user search queries (for outreach scenario)
Pre-execution Checks
1. Tool Readiness
If browser-act has been confirmed available in the current session β skip.
Invoke browser-act via Skill tool to load usage. If installation or configuration issues arise, follow its guidance to resolve then retry.
2. Open DM Entry + Comprehensive State Check
browser-act --session <name> navigate https://x.com/i/chat
browser-act --session <name> wait stable --timeout 15000
browser-act --session <name> eval "$(python scripts/check-page-state.py)"
Return format:
{
"url": "https://x.com/i/chat/pin/recovery?from=%2Fi%2Fchat",
"logged_in": true,
"need_passcode": true,
"on_inbox": false,
"on_conversation": false,
"has_panel": false,
"has_composer": false,
"inbox_count": 0
}
Decision matrix:
logged_in: falseβ inform user to log in first; wait; retry this stepneed_passcode: trueβ proceed to step 3 belowon_inbox: trueandinbox_count > 0β ready, enter business flowon_inbox: truebutinbox_count === 0β account has no DM conversations; outreach scenario can still proceed, pending-reply scenario has nothing to do
3. DM Passcode Unlock (when need_passcode is true)
- If caller has provided passcode in advance β use it directly; otherwise ask user for 4-digit DM passcode via AskUserQuestion tool (do not use plain text prompt β must call AskUserQuestion)
browser-act --session <name> stateβ find indexes of 4<input maxlength=1 pattern=[0-9]*>elements (usually 4 consecutive)- Enter each digit:
browser-act --session <name> input <idx1> "<d1>",<idx2> "<d2>",<idx3> "<d3>",<idx4> "<d4>"- Must use
browser-act input(CDP real keyboard events), cannot use eval to set value β X ignores non-real keyboard input
- Must use
browser-act --session <name> wait stable --timeout 10000- Re-run
check-page-state.py, confirmneed_passcode: falseandon_inbox: true - 3 consecutive failures still showing
need_passcode: trueβ inform user passcode may be wrong; terminate
Business Flows
Choose Scenario A, Scenario B, or both. Each scenario is an ordered AI Workflow (not a single JS).
Scenario A: Scan unread DMs β Persona-based reply
Flow: Scan inbox β Filter unread & latest peer messages β Per-conversation: read context β Generate reply with persona β Send β Next
Steps:
Scan inbox:
browser-act --session <name> eval "$(python scripts/scan-inbox-merged.py)"Returns
items[], each containingconversation_id/conversation_url/peer_screen_name/peer_display_name/peer_can_dm/latest_message_preview/latest_message_from_self/unread, etc.Filter pending-reply conversations: from
items, select conversations meeting all conditions:unread === true(has unread) orlatest_message_from_self === false(peer's latest message not yet replied)peer_can_dm === true(recipient allows DM)is_muted !== trueandis_deleted_by_viewer !== true- Optional caller filters: only reply to specific screen_names, exclude already-replied (use external JSONL ledger)
For each pending-reply conversation (strictly serial, random
sleep 8-15seconds between each):a. Open conversation:
browser-act --session <name> navigate https://x.com<conversation_url> browser-act --session <name> wait stable --timeout 15000b
FAQ
Does it need my X passcode?
Yes, the description says the 4-digit DM passcode for the account is needed for the encrypted messages.
Can it message people who have not contacted me?
It can start new conversations, and it includes permission filtering, so you control who it contacts.
Who writes the replies?
Your agent writes the reply text based on the persona you give, and the skill handles the sending steps.
Details
Original description by the author
X (Twitter) DM automated chat end-to-end Skill: scan DM inbox to identify pending-reply conversations, read message history, generate persona-based replies and send; also supports searching users and starting new conversations. Built-in E2E passcode unlock, DM permission filtering, and rate control. Use when user mentions X auto-reply DMs, Twitter DM automated chat, auto-handle unread DMs, reply to X private messages with persona, X DM outreach campaign, batch send DMs to Twitter users, auto-process pending DM replies, Twitter DM bot, automated Twitter outreach, X direct message automation.
repo: browser-act/skills
Popularity
- GitHub stars
- 6.3k
- Ranking position
- #14317
- License
- MIT
- Updated
- 8/24/2026
Comments
- β¦
More skills from this repository
browser-act-skill-forge
6.3kHelps your agent explore a website once and save a reusable skill with scripts, so later data pulls from that site are faster.
browser-act
6.3kHelps your agent run a browser automation tool to open pages, read rendered content, fill forms, take screenshots and manage logged-in sessions.
1688-product-detail
6.3kHelps your agent pull product details from a 1688.com wholesale page, such as price tiers, variants, seller stats and attributes.
airbnb-listing-detail
6.3kHelps your agent fetch the public details of an Airbnb listing by its ID, such as photos, amenities, ratings and house rules.
Similar skills
xurl
394kHelps your agent post, reply, search, and read on X, send direct messages, and upload media, using the authenticated xurl tool.
connections-optimizer
280kImproves your social network connections. It suggests who to follow or unfollow and helps create personalized messages to expand your network.
content-engine
280kCreates content for different platforms. It helps produce posts, scripts, and content calendars that work well on networks like X, LinkedIn, and YouTube.