| name | discover-viral-posts |
| description | Daily discovery of viral and rising X posts relevant to <BRAND>'s product and <PRODUCT_CATEGORY>. Searches curated thought leader feeds, filters for relevance first, then ranks by engagement. Surfaces top posts to #social-swarm with engagement recommendations. Use when the user asks for a "viral post roundup", "what's trending in <PRODUCT_CATEGORY>", "social swarm digest", or "find posts to engage with".
|
Discover Viral Posts
Find posts from curated thought leaders that are relevant to what does and where <PRODUCT_CATEGORY> is going. Surface the best engagement opportunities with concrete strategies.
This is outbound discovery (finding conversations to join), not inbound tracking (that's daily-mentions-summary).
Inputs
None required. Optionally the user may specify:
- A date range (defaults to last 24 hours)
- Additional accounts to include
- A lower or higher engagement threshold
What we're looking for
Every post must pass a relevance filter before engagement numbers matter. There are three categories of relevant posts:
Category 1: Posts describing pain points solves
Someone wants or is building something already does — one of your <FEATURE> areas, or a workflow your product handles well.
Examples (replace with calibration posts from your own space):
Category 2: Thought leadership on <PRODUCT_CATEGORY>
Big-picture takes on where <PRODUCT_CATEGORY> is going — trends, workflow shifts, and where the market is heading.
Examples (replace with calibration posts from your own space):
Category 3: Shifts that expand or threaten <PRODUCT_CATEGORY>
Companies or people changing how they work in ways that create an opening (or a threat) for your product.
Examples (replace with calibration posts from your own space):
What to skip
- General AI corporate news (funding rounds, foundation announcements, leadership changes)
- Personal posts, jokes, food, sports with no product angle
- Reply fragments and conversational chatter
- Generic hype that doesn't touch <PRODUCT_CATEGORY>
Workflow
Step 1: Read the account list
Read .agents/skills/discover-viral-posts/followed-accounts.md to get the list of accounts to query.
Step 2: Fetch recent original posts
Use the X API recent-search endpoint (with your X_API_KEY bearer token) to fetch recent posts. See /read-tweet for reading individual tweets.
Build the query from every account in the Monitor list using from: operators joined by OR. Always append -is:retweet -is:reply to get original posts only. Use -n 30 for max results.
Split into batches of ~25 accounts per query to avoid hitting URL length limits. Request up to ~30 results per query.
Example request
curl -s -H "Authorization: Bearer $X_API_KEY" \
--get "https://api.x.com/2/tweets/search/recent" \
--data-urlencode "query=(from:example_account_1 OR from:example_account_2 OR from:example_account_3) -is:retweet -is:reply" \
--data-urlencode "max_results=30"
Step 3: Filter for relevance, then engagement for the top 3
Read every post and ask: does this fit Category 1, 2, or 3? If not, drop it. Use the example posts above as calibration. Be strict — a post with 2000 likes about unrelated corporate news is not relevant. A post with 50 likes about a specific <PRODUCT_CATEGORY> pain point is.
Tag each post with its category (1, 2, or 3) for use in the engagement strategy.
- Pick the top 3 results. Bias towards recency. If fewer than 3 posts passed filtering, report what you found. Don't pad with irrelevant posts.
Step 4: Generate engagement strategy for each post
For each post, decide who should post and what they should say. Fetch the most recent 3 posts using the X API from the following accounts to get a feel for their tone.
Account selection (configure these for your own team):
- Brand account (
@your-brand): product demos, official amplification, support-like clarification
- Founder account: founder voice, category framing, vision-setting
- Developer-advocate account: product-builder credibility, hands-on usage, builder-to-builder replies
- Engineer swarm: multiple teammates adding distinct, non-duplicative perspectives
You can use some or multiple accounts to engage with a post. Bias towards the simplest plan.
When drafting copy, follow the Principles, AI writing tells, and Hard constraints from draft-brand-reply.
Step 5: Format the summary
Plain text, no markdown, no emojis. One block per post:
Daily Viral Post Roundup -- <date>
1. https://x.com/<username>/status/<id>
Why: <one sentence on why this is worth engaging with>
Strategy: <who posts> <action type (reply / QT / RT / independent tweet)>
Draft: <exact copy they can post>
2. ...
3. ...
Step 6: Post to Slack (optional)
Only post to Slack if the user explicitly asks to "send", "post to Slack", or "share in social-swarm".
- Check
$BUZZ_SLACK_TOKEN exists.
- Post to
#social-swarm using Python urllib.request (not curl, to avoid sandboxing restrictions):
import json, os, urllib.request
token = os.environ["BUZZ_SLACK_TOKEN"]
channel = os.environ["SOCIAL_SWARM_CHANNEL_ID"]
payload = json.dumps({
"channel": channel,
"text": formatted_summary,
"unfurl_links": False,
"unfurl_media": False,
}).encode()
req = urllib.request.Request(
"https://slack.com/api/chat.postMessage",
data=payload,
headers={
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(req) as resp:
result = json.loads(resp.read())
print(result)
- If
BUZZ_SLACK_TOKEN is not set, refuse to send.
Step 8: Save report (optional)
Only if Step 7 was performed (Slack post succeeded):
- Save to
reports/daily-viral/<YYYY-MM-DD>.md in standard Markdown format.
- Commit and push to the current branch:
mkdir -p reports/daily-viral
git add reports/daily-viral/<YYYY-MM-DD>.md
git commit -m "Add daily viral post roundup for <date>
Co-Authored-By: <your-agent> <agent@your-brand.example>"
git push
Edge Cases
- No relevant posts: Report "quiet day". Don't pad with off-topic high-engagement posts.
- API rate limit hit: Work with whatever results are available. Note incomplete coverage.
- Missing
X_API_KEY: Stop and report that it is not set.
Dependencies
/read-tweet skill — canonical instructions for reading tweets via the X API
/draft-brand-reply skill — principles, AI writing tells, and hard constraints for all community copy
$X_API_KEY environment variable — X API bearer token
$BUZZ_SLACK_TOKEN environment variable — Slack bot token (only for posting)