twitter-account-manager
EDUCATIONAL / RESEARCH ONLY — Single-account always-on Twitter/X manager driven by cookies + headless Playwright. Runs a 10-minute scheduler that drafts posts, engages with timeline/search results, and queues anything risky for Telegram human approval. Hard daily ceilings, structural prompt-injection defenses, and DM auto-reply permanently disabled. Accounts WILL be terminated — we do not encourage use.
cosmicstack-labs · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add cosmicstack-labs/mercury-agent-skills --skill twitter-account-manager技能说明
name: twitter-account-manager description: 'EDUCATIONAL / RESEARCH ONLY — Single-account always-on Twitter/X manager driven by cookies + headless Playwright. Runs a 10-minute scheduler that drafts posts, engages with timeline/search results, and queues anything risky for Telegram human approval. Hard daily ceilings, structural prompt-injection defenses, and DM auto-reply permanently disabled. Accounts WILL be terminated — we do not encourage use.' metadata: author: hotheadhacker version: 0.1.0 category: automation tags: - twitter - x - social-media - account-manager - playwright - cookies - scheduler - telegram-approval - prompt-injection-defense - educational - research
Twitter Account Manager 🧪
⛔ EDUCATIONAL / RESEARCH USE ONLY
Twitter/X's Developer Agreement and Terms of Service prohibit automated account access outside of the official API. This skill drives a real browser session with the user's own cookies. Twitter's automation-detection stack is aggressive and continuously updated.
Accounts running this WILL be rate-limited, shadow-banned, suspended, or permanently terminated. That is not a maybe — it is the expected outcome. The only question is how quickly.
We do not encourage use of this skill. It exists as a reference implementation for research into:
- browser-automation detection surfaces
- prompt-injection defenses on hostile, attacker-controlled inputs (replies, DMs, quote-tweets, bios, search results)
- human-in-the-loop approval patterns for autonomous agents
- rate-limit / safety-rail design for always-on agents
If you run this against a real account, that is your decision and your loss. Use a throwaway account on a throwaway number. Do not run this for commercial purposes, spam, harassment, astroturfing, or any activity that would violate platform rules or local law.
Overview
A single-account, single-process Twitter/X manager. One Python daemon → one Twitter account → one cookie jar → one SQLite store. If you want multiple accounts, run multiple isolated copies under different config directories — multi-account orbit is intentionally out of scope.
The daemon wakes on a configurable heartbeat (default 10 minutes, minimum 5 minutes — enforced at startup), runs a small set of read-only sensing tasks, drafts candidate actions, runs them through safety rails + fact-check + prompt-injection defenses, and either executes the safe ones directly or queues the rest to Telegram for human approval.
Distinct from automation/x-twitter-automation
That skill (Xquik-dev) is API-based via Hermes Tweet. This skill is browser-based, always-on, single-account, and never touches the official API.
Approval channel — Mercury vs everything else
On Mercury, the human-in-the-loop approval flow uses Mercury's built-in Telegram (and CLI / web) channels. You do not configure a bot token or chat id — if you've activated Telegram in Mercury, this skill uses it; if you haven't, the skill will offer to fall back to CLI prompts or ask you to enable Telegram.
On other agents (Claude Code, Codex CLI, Hermes, etc.) without a built-in chat channel, you provide your own Telegram bot in config. See Approval Channel Resolution below.
Architecture
┌────────────────────────────────────────────────────────────────┐
│ twitter-account-manager (single process) │
│ │
│ APScheduler (heartbeat ≥ 5min) │
│ │ │
│ ├─► Sense (timeline, search, mentions — read-only) │
│ ├─► Draft (LLM L2 generates candidate actions) │
│ ├─► Defend (regex deny-list + EXTERNAL_UNTRUSTED wrap) │
│ ├─► Fact-check (LLM L1 self-check on drafts) │
│ ├─► Gate (hard daily ceilings, dedup, intent check) │
│ ├─► Approve (Telegram for risky → human ✅/❌) │
│ └─► Execute (Playwright headless writes) │
│ │
│ Storage: ~/.mercury/twitter-account-manager/ │
│ ├── config.yaml (user) │
│ ├── persona.md (user, free-form) │
│ ├── cookies.json (captured at login, refreshed) │
│ ├── state.db (SQLite: dedup, counters, history) │
│ └── logs/ │
└────────────────────────────────────────────────────────────────┘
Installation
# Python 3.11+
pip install playwright apscheduler pyyaml httpx aiosqlite python-telegram-bot rich
playwright install chromium
# Clone skill scaffold (or copy the reference impl from this SKILL.md)
mkdir -p ~/.mercury/twitter-account-manager
cd ~/.mercury/twitter-account-manager
Configuration
~/.mercury/twitter-account-manager/config.yaml:
# Heartbeat — how often the scheduler wakes.
# Format: "<int><s|m|h>" e.g. "10m", "30m", "1h"
# HARD MINIMUM: 5m. Lower values cause startup error.
heartbeat: "10m"
# Daily hard ceilings (NON-OVERRIDABLE at runtime).
# These are enforced regardless of config edits.
# Listed for transparency only.
limits:
posts_per_day: 50 # ceiling — actual usage should be far lower
follows_per_day: 100
likes_per_day: 500
search_engage_per_day: 200
replies_per_day: 30
retweets_per_day: 20
# Approval channel.
#
# On Mercury: leave this block empty / omit it. The skill auto-detects
# Mercury's built-in Telegram layer (`agent.has_channel("telegram")`)
# and routes approvals through `agent.send_message()` + reply polling.
# No bot token,
阅读完整来源 ↗