x-engage
Skill18 starsChanged 6 months agoMITView on GitHub
Drafts X (Twitter) replies in your voice and queues them for in-chat approval before publishing. Also includes autopilot mode (autonomous scan+draft+publish daemon, no approval, 50/day target, auto-stops at configurable time). Triggers on "/x-engage", "x-engage", "x comment", "reply on x", "draft x replies", "scan x for replies", "review x drafts", "approve x drafts", "publish x replies", "x reply status", "background scan", "run x in background", "stop x daemon", "x background status", "verify x-engage", "x-engage health", "autopilot", "x autopilot", "start autopilot", "stop autopilot", "autopilot status", "run x autonomously".
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jared833/claude-code-hookstheir own version, first seen Oct 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jared833/claude-code-hooks★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 6 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Run /x-engage verify after any change to catch bloat or staleness early.
- Very specific: line 28
If the user says vaguely "start the daemon" / "start the bot" / "run x", default to autopilot start since it auto-launches the scan-bg pool …
- Very specific: line 30
Only route to run-bg (advanced) if the user explicitly says "scan only" / "pool only" / "no publishing" / "don't auto-reply".
- Very specific: line 84
When review returns rows, render them in this exact format so the user can act fast:
- Distinctive: line 118
Add a "don't do this" instruction to the prompt or voice-profile.personal.md (Pink Elephant — re-anchors the model on the forbidden …
- Distinctive: line 119
Add a new template, register quota, or shape steer.
- Very specific: line 124
Run /x-engage good <id> — pins into good-drafts.md.
- Very specific: line 125
If the draft demonstrates a NEW pattern (new register, new POV, new receipt shape), also append manually to voice-corpus.md so future …
- Very specific: line 182
How to verify it's actually alive (not just "installed"): run /x-engage status — the heartbeat: Xs ago [ALIVE] line proves the tick fired …
- Very specific: line 186
If output contains ACCOUNT_PAUSED, RESTRICTION, CAPTCHA, LOGIN_REQUIRED, or exit code 2 (from publish):
- Distinctive: line 187
DO NOT retry. Halt.
- Distinctive: line 189
Do not run any further X-touching commands until the user explicitly resumes.
- Very specific: line 191
If output contains COOKIES_EXPIRED (from fetch, exit code 2):
- Very specific: line 197
Delete ~/.x-engage/PAUSED to resume.
- Distinctive: line 199
Do not run any further X-touching commands until the user has updated cookies and removed the PAUSED file.
- Distinctive: line 203
If arg is not in the table above, print:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/x-engage
Thin wrapper over the local x-engage checkout.
Set X_ENGAGE_DIR in your environment (or this skill's caller config) to the absolute path of your local clone. Defaults to ~/Work/x-engage if unset.
Architecture (May 2026 rebuild)
Drafts are produced by corpus retrieval + minimal positive-spec prompt + post-filter lint, not by stacking rules in the prompt. Key components:
voice-profile.personal.md(~80 lines) — six positive specs + confirmed your voice patternsvoice-corpus.md— tagged voice-matched reply examples, top-3 retrieved by source-post keywordvoice-receipts.md— static verifiable user facts (your GitHub stats, your company numbers), top-2 retrieved by keywordscripts/lib/safety.py— deterministic post-filter lint (em-dash ban, aphorism patterns, AI-stock phrases, tbh/kinda cadence gate)scripts/lib/voice.py— drafter orchestrator + Claude CLI invocationSKILL_DISCIPLINE.md— anti-bloat guardrails (read this before adding rules)
Run /x-engage verify after any change to catch bloat or staleness early.
Disambiguation (read before routing)
If the user says vaguely "start the daemon" / "start the bot" / "run x", default to autopilot start since it auto-launches the scan-bg pool feeder too — one command covers the full autonomous mode.
Only route to run-bg (advanced) if the user explicitly says "scan only" / "pool only" / "no publishing" / "don't auto-reply". run-bg does NOT publish — it just feeds the pool for later manual fetch.
autopilot start is a one-way door for the day's account safety. If unsure whether the user wants autonomous publishing vs. manual review, ASK.
Examples
Map user phrasings to subcommands:
"/x-engage"or"draft some x replies"or"scan x"→fetch"draft 30 replies"or"fetch 25"→fetch 30/fetch 25(count arg)"show me the x queue"or"review x drafts"→review"approve 1, 3, 5"or"approve all"→approve 1,3,5/approve all"redraft 2 shorter, drop the question"→redraft 2: shorter, drop the question"kill #4"or"drop draft 4"→kill 4"save #5 as a good one"or"mark 5 good"→good 5"ship it"or"publish approved"→publish"x status"or"how many replies left today"or"how is autopilot doing"or"is the daemon running"→status(unified — covers queue, scan-bg, autopilot)"verify x-engage"or"is the skill healthy"or"check for bloat"→verify"start autopilot"or"run x autonomously"or"autopilot start"→autopilot start(auto-starts scan-bg)"stop autopilot"or"kill autopilot"→autopilot stop"start autopilot target=30 until=17:00"→autopilot start target=30 until=17:00"start autopilot don't sleep"/"start autopilot stay awake"→autopilot start --keep-awake"show me today's replies"/"list published"/"what did autopilot send"→autopilot list"show me the last 50 replies"→autopilot list 50- (advanced)
"start scan-bg only"/"pool only no publish"→run-bg - (advanced)
"stop scan-bg"→stop-bg
Subcommands
Parse the first word of the user's input as the subcommand, then run the matching command via Bash. All commands start with cd "$X_ENGAGE_DIR" && python3 -m scripts.x_engage — shown abbreviated as … below.
| Subcommand | What it does | Command |
fetch [N] (default) | Fetch candidates + score + draft + store in SQLite. Optional count: fetch 30 drafts up to 30 (default 15). | … fetch [N] |
review | Show pending drafts inline in chat for the user to act on. | … review |
approve <ids|all> | Mark drafts approved (e.g. approve 1, 3, 5 or approve all). | … approve <ids> |
redraft <id>: <feedback> | Re-run drafter for one row with the user's steer (e.g. redraft 2: shorter, drop the question). | … redraft <id> "<feedback>" |
kill <id> | Reject and remove from queue. | … kill <id> |
good <id> | Promote a draft to good-drafts.md as a vibe reference. Consider also adding to voice-corpus.md if it demonstrates a new pattern. | … good <id> |
publish | Ship every draft with status=approved via Playwright. | … publish |
status | Unified snapshot — queue counts, today's published, scan-bg state + pool size, autopilot state + target/stop_at, paused/halt flags. Replaces the old bg-status and autopilot status (those still work as aliases). | … status |
setup | First-time install: verify xurl auth, claude CLI, log into X via Playwright. | … setup |
verify | Skill health check: line counts, lint pattern totals, stale file detection, SKILL.md staleness vs code. Exit 1 if warnings. | … verify |
autopilot start [target=N] [until=HH:MM] | Install + load com.x-engage.autopilot launchd plist. Daemon ticks every 60s: scan → draft 1 → lint+score → auto-approve → publish via Playwright. Bypasses manual approval. Auto-starts scan-bg if not running. Stops on target hit, time reached, or safety signal. Defaults: target=50, until=18:00. | … autopilot start [target=N] [until=HH:MM] |
autopilot start --keep-awake | Same as autopilot start but blocks idle sleep for as long as autopilot is ticking. Each tick renews a short caffeinate -i lease (3x the tick interval); the lease expires by itself if the daemon crashes or is unloaded, and autopilot stop kills it immediately. | … autopilot start --keep-awake |
autopilot stop | Unload autopilot plist + drop the sleep block. Pool + queue stay. scan-bg keeps running unless you also stop-bg. | … autopilot stop |
autopilot list [N] | Print today's published replies (default 20, max 200) — author, score, parent URL, source post, draft text, time. On-demand audit of what shipped. | … autopilot list [N] |
(advanced) run-bg | Install + load scan-bg launchd plist (every 10 min, pool feeder only — no drafts, no publishes). Normally not needed since autopilot start auto-launches this. Use only for pool-only / manual workflow. | … run-bg |
(advanced) stop-bg | Unload scan-bg daemon. Pool stays. | … stop-bg |
Stream output to the user. Use long timeout (600000ms) for fetch and publish.
Review-phase rendering
When review returns rows, render them in this exact format so the user can act fast:
#<id> @<author> (<follower_count> followers) · <age_min>min ago · score <score>
Source: "<first 140 chars of source post>"
Draft: "<draft text>"After listing, prompt:
Reply with: approve <ids|all>, redraft <id>: <feedback>, kill <id>, good <id>, or publishAfter completion
fetch: pulled / drafted / skipped counts.review: show drafts as above; do not summarize.approve / redraft / kill / good: confirm action in 1 line ("Approved #1, #3", "Redrafting #2…", "Killed #4", "Saved #5 as vibe reference")publish: published / failed / deferred counts. Surface any safety signals.status: phase, today's published count, paused state, queue counts.verify: relay the report verbatim. If warnings, suggest concrete next action.
When user flags a draft as "not my voice"
The protocol (full details in SKILL_DISCIPLINE.md):
- Identify the failure — which specific phrase / shape / register collision is wrong?
- Add to
BANNED_ANYWHERE(orBANNED_OPENERSif position-specific) inscripts/lib/safety.py. Comment with date + draft ID. - Test the lint — verify the failed draft rejects + a clean voice-matched variant still passes.
- Kill the draft in the live queue.
- Run
/x-engage verifyto confirm bloat is in check.
Do NOT:
- Add a "don't do this" instruction to the prompt or voice-profile.personal.md (Pink Elephant — re-anchors the model on the forbidden pattern).
- Add a new template, register quota, or shape steer.
- Lower the post-filter threshold to "give the model more room."
When user flags a draft as "yes, this is me"
- Run
/x-engage good <id>— pins intogood-drafts.md. - If the draft demonstrates a NEW pattern (new register, new POV, new receipt shape), also append manually to
voice-corpus.mdso future retrieval picks it up.
References
The references that the drafter actually reads at runtime:
voice-corpus.md— tagged voice-matched replies. Top-3 retrieved per draft.voice-receipts.md— verifiable static facts. Top-2 retrieved per draft.voice-profile.personal.md— six positive specs + anti-pattern reminders.references/guardrails.md— human-readable rate-limit doc (operational caps, cooldown reasoning). The executable rules are inscripts/lib/safety.py+state.py.
Anti-bloat: references/_archive/ holds legacy files from the pre-rebuild architecture (T1-T7 templates etc.). Not loaded. Don't restore.
Autopilot mode
/x-engage autopilot start boots an autonomous loop that drafts AND publishes replies without per-draft approval. Designed for fire-and-forget engagement velocity.
How it works:
- launchd plist
com.x-engage.autopilotfiresautopilot-tickevery 60s - Each tick: check halt conditions → pull 1 fresh candidate from pool → draft → lint+score (same bar as manual: ≥0.45) → insert as approved → publish via Playwright
- Tick is idempotent — safe to crash and resume
- Requires
scan-bgdaemon running in parallel to keep the pool fresh. Autopilot warns if it's not. Start it with/x-engage run-bg. - Does NOT auto-publish pre-existing pending drafts. The
pendingqueue from manual mode is untouched — autopilot only ships drafts it created in the current tick. To clear a stale manual queue, use/x-engage review+killorapprove+publishas normal.
Stop conditions (any triggers self-unload):
- Daily target hit (default 50, panic ceiling 50)
stop_attime reached (default 18:00 local, usestzfromsettings.yml)~/.x-engage/PAUSEDflag exists (any safety signal writes this)X_ENGAGE_HALT=1env var
What it does NOT bypass:
- 90s min gap between publishes
- Per-handle 24h cooldown
- 4 replies / 30d lifetime cap per author
- Voice-match threshold (0.45)
- Safety lint
- CAPTCHA / ACCOUNT_PAUSED / RESTRICTION → writes PAUSED, auto-unloads daemon, exit 2
Args:
target=N— override daily target (1 ≤ N ≤ 50). Panic ceiling refuses higher.until=HH:MM— override stop time (local TZ from settings.yml).
Manual /x-engage publish is unaffected — it still requires require_explicit_approval=true.
Resilience contract (what survives what)
| Failure | Behavior | Action needed |
| Process crash mid-tick | launchd restarts via KeepAlive{SuccessfulExit=false} + retries in ≥30s (ThrottleInterval) | None — auto-heals |
| Machine reboot | Plist is in ~/Library/LaunchAgents/ → auto-loads on next login. RunAtLoad=true fires immediately. | None — log back in |
| User-account logout | Daemon stops (LaunchAgent runs in user session). Resumes on next login. | None |
| System sleep / lid close | launchd PAUSES. Ticks stop. Time spent asleep is LOST (no backfill). | Use autopilot start --keep-awake — a per-tick caffeinate -i lease that only lives while autopilot runs |
| Network blip | Tick exception logged, next tick retries in 60s | None |
| X cookie expiry | Writes PAUSED, self-unloads (COOKIES_EXPIRED halt) | Refresh cookies in .env, delete PAUSED, re-run autopilot start |
| X safety signal | Writes PAUSED, self-unloads. Screenshot in ~/Downloads/x-incident-*.png | Verify account healthy, delete PAUSED, re-run autopilot start |
| New day | Yesterday's daemon self-stopped at stop_at. Today's plist isn't loaded. | Re-run autopilot start each morning (intentional — enforces calibration gate) |
How to verify it's actually alive (not just "installed"): run /x-engage status — the heartbeat: Xs ago [ALIVE] line proves the tick fired recently. Anything over 120s = STALE = something's wrong; over 600s = DEAD = check tail logs/autopilot.err.
Critical: safety + auth signals
If output contains ACCOUNT_PAUSED, RESTRICTION, CAPTCHA, LOGIN_REQUIRED, or exit code 2 (from publish):
- DO NOT retry. Halt.
- Tell the user: "X account safety check failed. Open the screenshot at
~/Downloads/x-incident-*.png. After confirming the account is healthy, delete~/.x-engage/PAUSEDto resume." - Do not run any further X-touching commands until the user explicitly resumes.
If output contains COOKIES_EXPIRED (from fetch, exit code 2):
- DO NOT retry. Halt.
- Tell the user: "Your X session cookies expired. To fix:
- Open x.com in Chrome, log out, log back in.
- DevTools (Cmd+Opt+I) → Application → Cookies → https://x.com
- Copy
auth_tokenandct0values into.env(replace oldAUTH_TOKEN=andCT0=lines). - Delete
~/.x-engage/PAUSEDto resume. Then run/x-engage setupto verify, and re-run fetch."
- Do not run any further X-touching commands until the user has updated cookies and removed the PAUSED file.
Unknown args
If arg is not in the table above, print:
Usage: /x-engage [fetch|review|approve|redraft|kill|good|publish|status|setup|verify|autopilot]
fetch [N] — fetch candidates + draft + queue (default 15)
review — show pending drafts in chat
approve <ids> — mark drafts approved (e.g. "approve 1, 3" or "approve all")
redraft <id> — re-draft one with feedback (e.g. "redraft 2: shorter")
kill <id> — reject a draft
good <id> — save a draft as a vibe reference for future drafting
publish — ship approved drafts via Playwright
status — unified snapshot (queue + scan-bg + autopilot + flags)
setup — first-time setup
verify — skill health check (line counts, bloat, staleness)
autopilot start [target=N] [until=HH:MM]
— autonomous publish daemon (bypasses approval, auto-starts scan-bg)
autopilot stop — stop autonomous daemon
Advanced (rarely needed — autopilot manages scan-bg automatically):
run-bg — install scan-bg pool feeder only (no publishing)
stop-bg — unload scan-bg daemonDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

