Skip to content
Agentmart
Submit a tool

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…

Skill by browser-act

IndexedMIT★ 6,268
Write a review

Chalk Labs

Need help deploying x-dm-auto-chat?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/browser-act-x-dm-auto-chat

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: testing, marketing, sales

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/x-dm-auto-chat

What's inside

Skill name
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.
License
MIT
Instructions
267 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (10)

  • SKILL.md
  • check-composer.py · scripts/
  • check-page-state.py · scripts/
  • fetch-inbox-api.py · scripts/
  • open-conversation-by-user.py · scripts/
  • read-conversation.py · scripts/
  • scan-inbox-merged.py · scripts/
  • scroll-load-history.py · scripts/
  • search-users.py · scripts/
  • verify-sent.py · scripts/

SKILL.md (first lines)

# 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:
```json
{
  "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 step
- `need_passcode: true` → proceed to step 3 below
- `on_inbox: true` and `inbox_count > 0` → ready, enter business flow
- `on_inbox: true` but `inbox_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)

1. 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)
2. `browser-act --session <name> state` — find indexes of 4 `<input maxlength=1 pattern=[0-9]*>` elements (usually 4 consecutive)
3. 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
4. `browser-act --session <name> wait stable --timeout 10000`
5. Re-run `check-page-state.py`, confirm `need_passcode: false` and `on_inbox: true`
6. 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**:

1. **Scan inbox**:
   ```
   browser-act --session <name> eval "$(python scripts/scan-inbox-merged.py)"
   ```
   Returns `items[]`, each containing `conversation_id` / `conversation_url` / `peer_screen_name` / `peer_display_name` / `peer_can_dm` / `latest_message_preview` / `latest_message_from_self` / `unread`, etc.

2. **Filter pending-reply conversations**: from `items`, select conversations meeting all conditions:
   - `unread === true` (has unread) **or** `latest_message_from_self === false` (peer's latest message not yet replied)
   - `peer_can_dm === true` (recipient allows DM)
   - `is_muted !== true` and `is_deleted_by_viewer !== true`
   - Optional caller filters: only reply to specific screen_names, exclude already-replied (use external JSONL ledger)

3. **For each pending-reply conversation** (strictly serial, **random `sleep 8-15` seconds between each**):

   a. **Open conversation**:
      ```
      browser-act --session <name> navigate https://x.com<conversation_url>
      browser-act --session <name> wait stable --timeout 15000
      ```

   b. **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 with `direction` (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 with `read-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**:
      1. `browser-act --session <name> eval "$(python scripts/check-composer.py)"` → record `last_message_id`
      2. `browser-act --session <name> state` — find `<textarea placeholder=Message>` index `TA_IDX`

From browser-act/skills, MIT.

More from browser-act/skills

Signals

Stars
6,268
Forks
330
Open issues
9
Last commit (this folder)
Jun 5, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from browser-act

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get x-dm-auto-chat running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying x-dm-auto-chat?

CallGet help
Cite this page

x-dm-auto-chat skill. Agent Mart. https://agentmart.dev/skills/browser-act-x-dm-auto-chat (last updated 2026-10-24)