Ultron

Thread Writer

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

Next.jsTypeScriptZod

Capabilities

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
System Prompt
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.
Agent Source
import { agent, tool } from "@agent-sdk"
import { z } from "zod"

const tweetSchema = z.object({
  text: z.string().min(0).max(280),
  codeBlock: z.object({
    lang: z.string(), code: z.string(), filename: z.string().optional(),
  }).optional(),
  attachment: z.object({
    kind: z.enum(["video", "link"]),
    title: z.string().optional(),
    domain: z.string().optional(),
    url: z.string().url().optional(),
  }).optional(),
})

export default agent({
  model: "claude-sonnet-4-6",
  permissionMode: "bypassPermissions",
  systemPrompt: `...`, // see System Prompt above
  tools: {
    update_thread: tool({
      description: "Submit the complete thread",
      inputSchema: z.object({
        tweets: z.array(tweetSchema).min(1).max(20),
      }),
      execute: async (input) => ({
        content: [{ type: "text", text: JSON.stringify(input) }],
      }),
    }),
  },
})

File Structure

agents/
thread-agent.ts
app/
page.tsx
layout.tsx
globals.css
app/_components/
tweet-attachment.tsx
code-settings.tsx
app/_components/code-frame/
index.tsx
default-frame.tsx
shared.tsx
app/api/agent/
sandbox/route.ts
threads/route.ts
token/route.ts
Setup
$ npm install
$ cp .env.example .env.local
# Add AGENT_API_KEY to .env.local
$ npm run deploy
$ npm run dev

Environment Variables

AGENT_API_KEYServer-side API key for token exchange

Sell This Agent

Generate a week's worth of threads in 10 minutes. Social agencies managing 10+ accounts will 5x their output.

Setup fee
$1,500
Monthly retainer
$300/mo
Target marketCreators, Founders, Social media agencies

Included

Full agent source code
Voice matching system
Code frame components
Connect to Ultron pipelineUnlock
X API auto-postingUnlock
Turn views into income.Drop your video link, get paid as the view count climbs.
Submit a video