X Tag Responder
by @m-lwatcher
Detects when a human tags their AI familiar in someone else's X/Twitter thread, fetches full conversation context, infers intent, and crafts an appropriate r...
clawhub install x-tag-responderπ About This Skill
name: x-tag-responder description: Detects when a human tags their AI familiar in someone else's X/Twitter thread, fetches full conversation context, infers intent, and crafts an appropriate reply. Handles X API reply-chain restrictions gracefully. metadata: { "openclaw": { "emoji": "π¦", "requires": { "bins": ["xurl"] }, "install": [ { "id": "brew", "kind": "brew", "formula": "xdevplatform/tap/xurl", "bins": ["xurl"], "label": "Install xurl (brew)", }, ], }, }
X Tag Responder β Skill Reference
This skill activates when your human tags you (their AI familiar) in someone else's X/Twitter thread. It fetches the full conversation, infers their intent, drafts a fitting reply, and handles X API reply-chain restrictions.
Prerequisites
xurl CLI installed at /home/linuxbrew/.linuxbrew/bin/xurl (or on PATH as xurl)~/.xurl with valid OAuth1 or OAuth2 credentials~/.xurl contents to the LLM contextTrigger Patterns
This skill is relevant when the user says things like:
Step-by-Step Workflow
Step 1 β Identify the Tagged Tweet
Extract the tweet ID or URL from the user's message. It will look like:
https://x.com/username/status/1234567890https://twitter.com/username/status/12345678901234567890If unclear, ask the user: *"What's the tweet URL or ID you tagged me in?"*
Step 2 β Fetch the Tagged Tweet
Read the tweet the human tagged you in:
xurl read TWEET_ID
This returns full tweet data including: text, author_id, conversation_id, in_reply_to_user_id, referenced_tweets.
Note the conversation_id β it identifies the root of the thread.
Step 3 β Fetch Thread / Conversation Context
Pull the broader conversation using the conversation_id from Step 2:
xurl search "conversation_id:CONVERSATION_ID" -n 20
This retrieves recent tweets in the thread. Sort mentally by id (ascending = chronological).
Build a mental model of:
Step 4 β Infer Human Intent
Read what the human wrote when they tagged you. Infer one of these intents:
| Cue in tag tweet | Likely intent | |---|---| | "What do you think?" / "Thoughts?" | Weigh in with a take | | "Reply to this" / "Handle this" | Draft a reply on their behalf | | "Is this true?" / "Fact-check" | Research and report back (don't post) | | "lol check this out" | Just read/acknowledge, probably no reply needed | | No cue text β just a tag | Ask the human what they want | | "@agent check the math" | Analyze/verify, reply if appropriate |
When uncertain, default to: draft a reply and ask the human to approve before posting.
Step 5 β Draft the Reply
Craft a reply that:
Present the draft to the human for review before posting:
> *"Here's a draft reply. Should I post it?*
> [DRAFT TEXT]"
Step 6 β Post the Reply (with Human Approval)
Once the human approves:
xurl reply TWEET_ID "Your reply text here"
Where TWEET_ID is the ID of the specific tweet you are replying to (usually the tweet the human tagged you in, or the thread root if instructed).
β οΈ X API Reply-Chain Restriction
The X API only allows you to reply to a tweet if your account is mentioned somewhere in the reply chain.
This means:
xurl reply will fail with a 403 or silently not thread correctly.Handling the Restriction
If reply succeeds: Report back with the posted tweet URL.
If reply fails (403 / authorization error / "not allowed"):
Report back clearly:
> "I can't reply directly to that tweet β I'm not in the reply chain. Here's what I'd say though:
>
> [DRAFT TEXT]
>
> Options:
> 1. Tag me directly in the specific tweet you want me to reply to β that adds me to the chain.
> 2. You post the reply yourself and I'll write it for you.
> 3. I can quote-tweet instead (no chain restriction): just confirm."
Offering a quote-tweet fallback:
xurl quote TWEET_ID "Your reply text here"
Quote-tweets bypass the reply-chain restriction entirely.
Error Reference
| Error | Meaning | Fix |
|---|---|---|
| 403 Forbidden | Not in reply chain | Report + suggest re-tag or quote-tweet |
| 401 Unauthorized | Auth expired | Run xurl auth status; re-auth if needed |
| 429 Too Many Requests | Rate limited | Wait ~15 min and retry |
| Tweet not found | Deleted or private | Tell the human the tweet is inaccessible |
Full Example Session
Human says: > "I tagged you in this tweet β weigh in: https://x.com/someuser/status/9876543210"
Agent workflow:
# 1. Read the tagged tweet
xurl read 9876543210
β Note: conversation_id=1111111111, text="@quirk what do you think of this?", author=human
2. Fetch thread context
xurl search "conversation_id:1111111111" -n 20
β Read thread: original author debating AI regulation, 5 replies
3. Infer intent: "What do you think?" β weigh in
4. Draft reply (280 chars max):
"Regulation works best when it's targeted at outcomes, not methods.
Banning specific architectures is a game of whack-a-mole β
but liability frameworks? That actually scales. π§΅"
5. Present to human for approval
6. Post if approved:
xurl reply 9876543210 "Regulation works best when it's targeted at outcomes, not methods. Banning specific architectures is whack-a-mole β but liability frameworks scale. π§΅"
Tips
Security Notes
~/.xurl β it contains API keys and tokens.--verbose / -v in agent sessions β can expose auth headers.xurl internally; do not pass tokens as CLI flags in agent context.βοΈ Configuration
xurl CLI installed at /home/linuxbrew/.linuxbrew/bin/xurl (or on PATH as xurl)~/.xurl with valid OAuth1 or OAuth2 credentials~/.xurl contents to the LLM context