x-dm-auto-chat
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
Install / Use
npx skills add browser-act/skills --skill x-dm-auto-chatInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Tags
Our assessment of x-dm-auto-chat
x-dm-auto-chat scores 94/100 on our quality scale, 396th of 2,790 Automation skills we index (top 15%).
Its SKILL.md is 15 KB long, well organised into 27 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.
With 6,001 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 3 months ago, so x-dm-auto-chat is actively maintained.
- Our last check on 2026-11-16 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-06. Automated pattern scan on 2026-10-06. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
x-dm-auto-chat compared with similar skills
All 4 of these similar skills score higher than x-dm-auto-chat; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| x-dm-auto-chat (this skill)by browser-act | 94 | 6.0k | 3mo ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 103.6k | 2d ago | MCP Server |
Frequently asked questions
- How do I install x-dm-auto-chat?
- Run
npx skills add browser-act/skills --skill x-dm-auto-chat. The install tabs above show the steps for each supported agent. - Which AI agents does x-dm-auto-chat work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is x-dm-auto-chat safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is x-dm-auto-chat still maintained?
- The repository was last updated about 3 months ago, so x-dm-auto-chat is actively maintained.
Skill content
View source on GitHubname: x-dm-auto-chat description: "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."
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. If passcode re-triggered → re-unlock (usually won't re-trigger within same session)
c. Read context:
browser-act --session <name> eval "$(python scripts/read-conversation.py)"Returns
messages[], each withdirection(self/peer),text,timestamp_text,links,images.d. (Optional) Load full history: If caller needs longer context, loop:
browser-act --session <name> eval "$(python scripts/scroll-load-history.py)"Until
reached_top: true, then re-read withread-conversation.py.e. Generate reply: Calling Agent combines persona, message history to generate reply text. Reply content is entirely the caller's decision; this Skill does not participate in generation. Suggested inputs:
- Persona prompt (provided by caller)
- Recent N messages (typically
messages.slice(-6)) - Peer name (
peer_display_name/peer_screen_name) for address - Return one string
reply_text, length < 10,000 characters
f. Send reply:
browser-act --session <name> eval "$(python scripts/check-composer.py)"→ recordlast_message_idbrowser-act --session <name> state— find<textarea placeholder=Message>indexTA_IDXbrowser-act --session <name> input <TA_IDX> "<reply_text>"(must use CDP real keyboard, cannot use eval)browser-act --session <name> wait --selector '[data-testid="dm-composer-send-button"]' --state attached --timeout 5000browser-act --session <name> eval "document.querySelector('[data-testid=\"dm-composer-send-button\"]').click(); 'clicked'"browser-act --session <name> wait stable --timeout 15000- Verify:
browser-act --session <name> eval "$(python scripts/verify-sent.py '<reply_text>' --prev-last-id <last_message_id from step f1>)"sent: trueandcomposer_cleared: true→ success, record resultsent: false→ record failure, do not retry (prevents duplicate sends); proceed to next conversation
g. Random delay:
sleep 8-15seconds (avoid anti-abuse limits) -
Batch completion: Summarize results (success count / failure count / conversation_id per item); return or write to external log file.
Scenario B: Search users → Start new conversation → Send first message
Flow: Search candidates → Filter sendable → Enter conversation → Generate first message → Send
Steps:
-
Search target users (one search per target, 1-2 second interval between searches):
browser-act --session <name> eval "$(python scripts/search-users.py '<search_query>')"Returns
users[], each withuser_id/name/screen_name/can_dm/can_dm_reason/ verification fields. -
Filter users who can receive DMs:
can_dm === true and !suspended and !protectedcan_dm_reason === "Allowed"- If
screen_nameis already in send history → skip (deduplication)
-
For each target user (strictly serial,
sleep 10-20seconds between each):a. Calculate conversation URL:
browser-act --session <name> eval "$(python scripts/open-conversation-by-user.py '<user_id>')"Returns
conversation_url(e.g.,/i/chat/{smaller_id}-{larger_id}).b. Navigate to conversation:
browser-act --session <name> navigate https://x.com<conversation_url> browser-act --session <name> wait stable --timeout 15000c. Handle passcode (may appear on first DM entry) → unlock
d. Verify composer ready:
browser-act --session <name> eval "$(python scripts/check-composer.py)"composer_ready: true→ recordlast_message_id;false→ skip this usere. Generate first message: Calling Agent generates first outreach text
first_textbased on persona + target user info (screen_name / name / verification type). Suggested content:- Brief self-introduction (caller identity)
- Personalized reason for reaching out to this specific user
- Clear call-to-action
- Keep length < 500 characters (first messages that are too long are more likely to be flagged as spam)
f. Send: Follow the 7 sub-steps in "Scenario A step 3f", substituting
first_textforreply_text.g. Random delay:
sleep 10-20seconds -
Batch completion: Summarize results.
Capability Components (callable individually)
In addition to the Scenario A / B end-to-end flows, the following components can also be called directly:
Composite: Inbox scan (API + DOM merged)
browser-act --session <name> eval "$(python scripts/scan-inbox-merged.py)"
Returns merged conversation list with peer screen_name + message preview + unread flag.
API: Fetch inbox from API only (with pagination)
browser-act --session <name> eval "$(python scripts/fetch-inbox-api.py --cursor-id {cursor_id} --graph-snapshot-id {snap} --limit {N})"
DOM: Read current conversation messages
browser-act --session <name> eval "$(python scripts/read-conversation.py)"
DOM: Scroll to load message history
browser-act --session <name> eval "$(python scripts/scroll-load-history.py)"
DOM: Check composer state
browser-act --session <name> eval "$(python scripts/check-composer.py)"
DOM: Verify message was sent
browser-act --session <name> eval "$(python scripts/verify-sent.py '<expected_text>' --prev-last-id <last_id>)"
API: Search X users (with DM permission)
browser-act --session <name> eval "$(python scripts/search-users.py '<query>')"
JS: Calculate conversation URL from user_id
browser-act --session <name> eval "$(python scripts/open-conversation-by-user.py '<user_id>')"
JS: Comprehensive page state check
browser-act --session <name> eval "$(python scripts/check-page-state.py)"
Success Criteria
End-to-end Scenario A:
sent: truerate >= 90% for each pending-reply conversation- Failed conversations have clear reason recorded (wrong passcode, composer unavailable, 429, etc.)
End-to-end Scenario B:
- All filtered sendable users enter conversation page (
composer_ready: true) - First message
sent: truerate >= 90%
Atomic components: see success criteria in each atomic Skill (scripts in this directory fully reuse the atomic implementations).
Known Limitations
X Platform DM Limits (verified through exploration)
- E2E encryption passcode required: Must enter 4-digit passcode to unlock DMs; wrong or disconnected passcode loses message history. Passcode input only works via
browser-act input(CDP real keyboard); eval setting value does not work - Message bodies are E2E encrypted: GraphQL API response message events are base64 T-protocol encrypted binary; plaintext is only readable from the browse
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Scrapling
103.6k🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
