Thread Writer

Turn ideas into viral X/Twitter threads with voice matching, code blocks, and media attachments.

Turn ideas into viral X/Twitter threads with voice matching, code blocks, and media attachments. Generate a week's worth of threads in 10 minutes. Social agencies managing 10+ accounts will 5x their output.

This is the whole blueprint, nothing held back: the model, the tools, the exact prompt, the source on disk, and the setup. Everything you need to run Thread Writer yourself is on this page, and it deploys in an afternoon.

What it does

Thread Writer handles the work end to end:

  • Generate 6-12 tweet threads from any topic or brief
  • Voice matching: clone any creator's style from 3+ sample tweets
  • Support code blocks and media attachments per tweet
  • Three style presets: Punchy, Thoughtful, and Meme

The anatomy

An agent is a composition, not a prompt: a model, the tools it is allowed to call, the integrations that give those tools reach, and the rules that keep it honest. Here is Thread Writer on one card.

Thread Writerblueprint
Model
claude-sonnet-4-6
Tools
update_thread
Integrations
Zod
Guardrails
analyze: average length, opener patterns, rhythm, punctuation, emoji, register.; match those habits. do not copy topics or quote samples

The instructions

Every run is governed by this prompt. It is short on purpose: enough to make Thread Writer reliable, not so much that it can misread itself. Copy it as a starting point for any agent you build.

Thread Writer
You write X (Twitter) threads. Sharp, skimmable, shareable. Each user message may be prefixed with: [[[SYSTEM NOTE: CURRENT_THREAD: [<tweets>] | STYLE: "punchy"|"thoughtful"|"meme" | AUTHOR_STYLE: {"handle": "...", "samples": ["...", "..."]} ]]] Voice matching (if AUTHOR_STYLE has 3+ samples): - Analyze: average length, opener patterns, rhythm, punctuation, emoji, register. - Match those habits. Do NOT copy topics or quote samples. Thread rules: 1. Produce 6-12 tweets. Aim for 7-9. 2. Each tweet MUST be <= 280 chars. Most should sit 120-220 range. 3. Do NOT prefix tweets with "1/", "2/" etc. 4. Hook tweet: must be scroll-stopping. No "Thread:" or emoji openers. 5. Call update_thread ONCE with the complete array.

The source, on disk

Three files carry the whole agent: the definition with its tools, the environment it expects, and the setup. Walk them.

thread-writer/thread-writer.ts0.9 KB
1import { agent, tool } from "@agent-sdk"
2import { z } from "zod"
3
4const tweetSchema = z.object({
5 text: z.string().min(0).max(280),
6 codeBlock: z.object({
7 lang: z.string(), code: z.string(), filename: z.string().optional(),
8 }).optional(),
9 attachment: z.object({
10 kind: z.enum(["video", "link"]),
11 title: z.string().optional(),
12 domain: z.string().optional(),
13 url: z.string().url().optional(),
14 }).optional(),
15})
16
17export default agent({
18 model: "claude-sonnet-4-6",
19 permissionMode: "bypassPermissions",
20 systemPrompt: `...`, // see System Prompt above
21 tools: {
22 update_thread: tool({
23 description: "Submit the complete thread",
24 inputSchema: z.object({
25 tweets: z.array(tweetSchema).min(1).max(20),
26 }),
27 execute: async (input) => ({
28 content: [{ type: "text", text: JSON.stringify(input) }],
29 }),
30 }),
31 },
32})

The business case

If you run an agency, Thread Writer is also a product. It sells into creators, founders, social media agencies, and the numbers work at very small scale.

$1,500

setup you can charge

$300/mo

monthly retainer

1

jobs off your plate

Ship it

The whole install is a handful of commands and the keys from the env file. Run the list, then point Thread Writer at real work.

Deploy checklist

0 of 5

That is the entire blueprint: one model, 1 tools, and a prompt. Built by hand it costs you an afternoon. Inside Ultron it costs you a sentence, because you can build this exact agent in the workforce and watch it run before you commit to anything.

Build Thread Writer in Ultron

1
Describe what you want

Start from this blueprint or your own words. Ultron reads the intent and picks the tools.

2
It builds the agent

The model, the tools, the prompt, the console. Assembled in front of you, nothing to wire.

3
Watch it run

Test it live in the chat, then put it to work. You review what it does, it does the rest.

Keep reading