Skip to main content

What It Does

Twitter Hand is an autonomous Twitter/X content manager that creates content in 7 rotating formats, schedules posts for optimal engagement, responds to mentions, and tracks performance—all 24/7. This is not a bot. It’s a tireless social media manager that maintains your brand voice, responds to your audience, and continuously optimizes based on what performs.

Key Features

  • 7 content types: Hot takes, threads, tips, questions, curated shares, stories, data/stats
  • Brand voice consistency: Configure your unique voice once, it’s maintained across all content
  • Approval queue: (Default) Review all tweets before they post
  • Auto-reply: Responds to mentions in your voice
  • Performance tracking: Engagement rate, impressions, follower growth
  • Scheduled posting: 1-5 times per day at optimal times

Activation

Twitter Hand requires a Twitter API Bearer Token. See the Requirements section below.
# Set your Twitter API token
export TWITTER_BEARER_TOKEN="AAAA...your_token_here"

# Activate Twitter Hand
openfang hand activate twitter

# Activate with custom voice
openfang hand activate twitter --settings "twitter_style=witty,brand_voice=sarcastic founder who simplifies complex tech"

Requirements

1

Get a Twitter Developer Account

Go to developer.twitter.com and sign in with your Twitter/X account.
2

Create a Project and App

Create a new Project and App. The free tier is sufficient for reading and posting tweets.
3

Generate a Bearer Token

Navigate to your App’s “Keys and tokens” page. Generate a Bearer Token under “Authentication Tokens”.
4

Set Environment Variable

export TWITTER_BEARER_TOKEN="AAAA...your_token_here"
Or add to your ~/.openfang/config.toml:
[environment]
TWITTER_BEARER_TOKEN = "AAAA...your_token_here"
5

Restart OpenFang

openfang restart
Estimated setup time: 5-10 minutes

Configuration Settings

twitter_bearer_token
text
Bearer Token from Twitter Developer Portal. Required for all Twitter API operations.
twitter_style
select
default:"professional"
Voice and tone for your tweets:
  • professional: Clear, authoritative, industry-focused
  • casual: Conversational, relatable
  • witty: Clever wordplay, unexpected angles
  • educational: Step-by-step, informative
  • provocative: Contrarian takes, challenges assumptions
  • inspirational: Vision-focused, empowering
post_frequency
select
default:"3_daily"
How often to create and post content:
  • 1_daily: 1 per day (10 AM)
  • 3_daily: 3 per day (8 AM, 12 PM, 5 PM) - default
  • 5_daily: 5 per day (7 AM, 10 AM, 12 PM, 3 PM, 6 PM)
  • hourly: Every hour during engagement hours
auto_reply
toggle
default:"false"
Automatically reply to mentions and relevant conversations.
auto_like
toggle
default:"false"
Automatically like tweets from your network and relevant content.
content_topics
text
Topics to create content about, comma-separated (e.g., AI, startups, productivity)
brand_voice
text
Describe your unique voice (e.g., sarcastic founder who simplifies complex tech)
thread_mode
toggle
default:"true"
Include tweet threads (multi-tweet stories) in content mix.
content_queue_size
select
default:"10"
Number of tweets to keep in the ready queue:
  • 5 tweets
  • 10 tweets (default)
  • 20 tweets
  • 50 tweets
engagement_hours
select
default:"business_hours"
When to check for mentions and engage:
  • business_hours: 9 AM-6 PM
  • waking_hours: 7 AM-11 PM
  • all_day: 24/7
approval_mode
toggle
default:"true"
IMPORTANT: When enabled (default), tweets are written to a queue file for your review instead of posting directly. Disable only if you trust the Hand to post autonomously.

Required Tools

Twitter Hand requires access to these tools (all built-in):
  • shell_exec — Platform detection and Twitter API calls
  • file_read, file_write, file_list — Queue and history files
  • web_fetch, web_search — Trend research
  • memory_store, memory_recall — State persistence
  • schedule_create, schedule_list, schedule_delete — Posting schedules
  • knowledge_add_entity, knowledge_add_relation, knowledge_query — Content strategy tracking
  • event_publish — Queue update notifications

System Prompt Overview

Twitter Hand operates in 7 phases:
1

Platform Detection & API Initialization

Detects OS, verifies Twitter API access, extracts user_id and username, loads posting history and queue.
2

Schedule & Strategy Setup

Creates posting schedules based on frequency (1-5 daily). Creates engagement check schedule. Builds content strategy from topics and brand voice.
3

Content Research & Trend Analysis

Researches current trends in content topics, checks what’s performing well on Twitter, identifies content gaps.
4

Content Generation

Creates content matching configured style and brand voice. Rotates through 7 content types: hot takes, threads, tips, questions, curated shares, stories, data/stats.
5

Content Queue & Posting

If approval_mode enabled: writes to queue file for review. If disabled: posts via Twitter API at scheduled times.
6

Engagement

During engagement hours, checks mentions, generates replies if auto_reply enabled, likes relevant content if auto_like enabled.
7

Performance Tracking

Checks metrics for recent tweets (impressions, likes, retweets, replies), analyzes patterns, stores insights for future optimization.

Usage Examples

Professional Tech Founder

openfang hand configure twitter \
  --set twitter_style="professional" \
  --set content_topics="AI, agent frameworks, Rust, startups" \
  --set brand_voice="technical founder who explains complex systems clearly" \
  --set post_frequency="3_daily" \
  --set approval_mode="true"

openfang hand activate twitter
Twitter Hand will generate 3 tweets per day in a professional technical voice, save them to the queue for your review.

Witty Content Creator

openfang hand configure twitter \
  --set twitter_style="witty" \
  --set content_topics="coding, productivity, remote work" \
  --set brand_voice="sarcastic developer who roasts bad practices" \
  --set post_frequency="5_daily" \
  --set auto_reply="true"

openfang hand activate twitter
Twitter Hand will post 5 times per day with clever wordplay and humor, automatically reply to mentions.

Educational Thread Machine

openfang hand configure twitter \
  --set twitter_style="educational" \
  --set thread_mode="true" \
  --set content_topics="machine learning, deep learning, transformers" \
  --set post_frequency="1_daily"

openfang hand activate twitter
Twitter Hand will post 1 educational thread per day, breaking down complex ML concepts.

The 7 Content Types

Strong opinion on a trending topic.Template: “Unpopular opinion: [contrarian view]”Example: “Unpopular opinion: Most startups don’t need microservices. A well-structured monolith scales to millions of users and saves you 6 months of complexity.”
Deep dive on a topic (3-10 tweets).Template: “I spent X hours researching Y. Here’s what I found:”Example:
I spent 20 hours analyzing AI agent frameworks.
Here's what actually matters:

1/ Performance doesn't matter if your agents don't work.
Most frameworks optimize the wrong thing.

2/ Security is not a feature — it's the foundation.
[continues...]
Actionable advice.Template: “How to [solve problem] in [N] steps:”Example: “How to debug Rust lifetime errors in 3 steps: 1) Read the error message carefully 2) Draw the ownership flow 3) Realize you don’t need a reference there”
Engagement-driving question.Template: “[Interesting question]? I’ll go first:”Example: “What’s the most underrated developer tool you use daily? I’ll go first: ripgrep. Saved me hundreds of hours.”
Link + insight from web research.Template: “This [article/tool/repo] is a game changer for [audience]:”Example: “This paper on speculative decoding just changed how I think about LLM inference: [link]. TL;DR: 2-3x speedup with zero quality loss.”
Personal-style narrative.Template: “3 years ago I [relatable experience]. Here’s what happened:”Example: “3 years ago I rewrote our Python backend in Rust. Everyone said it was a mistake. Yesterday we handled 10M requests/day on 2 servers. Sometimes the ‘risky’ choice is the safe one.”
Surprising statistic with commentary.Template: “[Surprising statistic]. Here’s why it matters:”Example: “87% of OpenAI’s API costs come from prompts, not completions. Most people optimize tokens. Winners optimize context.”

Approval Queue

When approval_mode="true" (default), Twitter Hand writes tweets to two files: twitter_queue.json (machine-readable):
[
  {
    "id": "q_001",
    "content": "Tweet text here",
    "type": "hot_take",
    "scheduled_for": "2025-03-07T10:00:00Z",
    "created": "2025-03-06T20:00:00Z",
    "status": "pending"
  }
]
twitter_queue_preview.md (human-readable):
# Tweet Queue Preview
Generated: 2025-03-06

## Pending Tweets (5 total)

### 1. [Hot Take] — Scheduled: Thu 10 AM
> Unpopular opinion: Most startups don't need microservices...

**Status**: Pending approval

---

### 2. [Tip] — Scheduled: Thu 12 PM
> How to debug Rust lifetime errors in 3 steps: 1) Read...

**Status**: Pending approval
Review the preview, then approve/edit/delete tweets in the JSON file before they post.

Dashboard Metrics

Twitter Hand tracks four key metrics:

Tweets Posted

Total tweets posted (excluding replies).

Replies Sent

Total replies to mentions.

Queue Size

Current number of tweets pending approval.

Engagement Rate

Average (likes + RTs + replies) / impressions.
View in the dashboard at http://localhost:4200/hands/twitter.

Twitter API Reference

EndpointLimitWindow
POST /tweets300 tweets3 hours
DELETE /tweets50 deletes15 minutes
POST /likes50 likes15 minutes
GET /mentions180 requests15 minutes
GET /search/recent180 requests15 minutes
Post a tweet:
curl -X POST "https://api.twitter.com/2/tweets" \
  -H "Authorization: Bearer $TWITTER_BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world!"}'
Post a thread:
  1. Post first tweet → get tweet_id
  2. Post second tweet with reply.in_reply_to_tweet_id = first tweet_id
  3. Repeat for each tweet in thread
Get mentions:
curl -H "Authorization: Bearer $TWITTER_BEARER_TOKEN" \
  "https://api.twitter.com/2/users/USER_ID/mentions?max_results=10"

Best Practices

Twitter Hand will never post content that violates Twitter’s Terms of Service: no discriminatory content, defamation, impersonation, threats, or spam.
Start with approval_mode="true" and review tweets for 1-2 weeks to calibrate the voice. Once confident, you can disable approval mode.
Define 3-5 core topics (content_topics) and stick to them. Consistent content pillars build audience expectations.
Check the engagement rate metric weekly. If it drops below 2%, adjust your twitter_style or content_topics.

Advanced Configuration

Custom Posting Times

Edit ~/.openfang/hands/twitter.toml to customize posting schedule:
[agent.schedule]
times = ["07:30", "11:00", "14:00", "17:30", "20:00"]
timezone = "America/New_York"

Multi-Account Management

Run multiple Twitter Hands for different accounts:
export TWITTER_BEARER_TOKEN_MAIN="AAAA..."
export TWITTER_BEARER_TOKEN_ALT="BBBB..."

openfang hand activate twitter --id main --settings "twitter_bearer_token=$TWITTER_BEARER_TOKEN_MAIN"
openfang hand activate twitter --id alt --settings "twitter_bearer_token=$TWITTER_BEARER_TOKEN_ALT"

Next Steps

Researcher Hand

Research topics for deep-dive threads

Clip Hand

Turn videos into clips to share on Twitter

Build docs developers (and LLMs) love