Skip to main content
MindStudio
Pricing
Blog About
My Workspace
ClaudeWorkflowsContent Creation

How to Build a LinkedIn Content Agent with Claude Code, Imagen 3, and ClickUp

Build an AI agent that researches a topic, writes a LinkedIn post, generates an infographic, and delivers everything to ClickUp in under 3 minutes.

MindStudio Team
How to Build a LinkedIn Content Agent with Claude Code, Imagen 3, and ClickUp

The LinkedIn Content Problem Worth Solving

LinkedIn has become a critical channel for B2B brands and professionals — but keeping up with it is exhausting. A single quality post takes research, writing, and often a visual. Do that three or four times a week and you’ve burned hours that could go toward actual work.

This guide walks through building a Claude content agent that takes a topic as input, researches it on the web, writes a LinkedIn post, generates an infographic using Imagen 3, and drops everything into ClickUp as a ready-to-review task — in under three minutes.

The stack: Claude Code for AI reasoning and writing, Imagen 3 for visual generation, and ClickUp for task delivery. To wire them together without reinventing the wheel for each API, we’ll use the MindStudio Agent Skills Plugin.


What This Agent Does, End to End

Before writing a line of code, it helps to see the whole workflow:

  1. You provide a topic (e.g., “the business case for async work”)
  2. The agent searches the web for recent, relevant content on that topic
  3. Claude synthesizes the research into a properly formatted LinkedIn post
  4. Imagen 3 generates an infographic based on the post’s key points
  5. The agent creates a ClickUp task with the draft copy and image attached

The result: a complete, review-ready content package delivered automatically.

Each step depends on the previous one, and the agent handles the handoffs. No human needs to be in the loop until it’s time to review and approve.


Prerequisites

Tools and Accounts

  • Claude Code — Anthropic’s agentic coding assistant; install via npm install -g @anthropic-ai/claude-code
  • Node.js 18+ — The runtime for your agent script
  • MindStudio account — Free tier works for this project
  • ClickUp account — Where your content tasks will land; you’ll need an API token and a list ID

API Keys

  • MindStudio API key (from your workspace settings)
  • ClickUp API token (from ClickUp Settings → Apps)

You don’t need a separate Imagen 3 API key. The MindStudio Agent Skills Plugin gives you access to Imagen 3 — and 200+ other AI models — through a single credential. That’s one of the practical advantages of this approach.


Step 1: Set Up the Project

Create a new directory and initialize a Node.js project:

mkdir linkedin-content-agent
cd linkedin-content-agent
npm init -y
npm install @mindstudio-ai/agent @anthropic-ai/sdk dotenv

Create a .env file at the root:

MINDSTUDIO_API_KEY=your_mindstudio_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
CLICKUP_API_TOKEN=your_clickup_token_here
CLICKUP_LIST_ID=your_target_list_id_here

Create your main agent file:

touch agent.mjs

The .mjs extension lets you use ES module syntax cleanly. CommonJS with .js works too.


Step 2: Research the Topic

Without a research step, Claude writes from training data alone. That’s fine, but not great when you want posts that reference current trends or recent statistics.

The MindStudio Agent Skills Plugin provides a searchGoogle() method that returns structured search results. Here’s how to use it:

import MindStudio from '@mindstudio-ai/agent';
import 'dotenv/config';

const agent = new MindStudio({ apiKey: process.env.MINDSTUDIO_API_KEY });

async function researchTopic(topic) {
  const results = await agent.searchGoogle({
    query: `${topic} 2024 statistics trends insights`,
    numResults: 5
  });

  const brief = results.map(r => `- ${r.title}: ${r.snippet}`).join('\n');
  return brief;
}

This produces a compact research brief — titles and snippets from the top five results — that Claude can use as context.

For better output, run two searches: one broad and one specific. Merge both briefs before passing to Claude. For example, “async work benefits” and “async work productivity data 2024” together give the model much more to work with than either search alone.


Step 3: Write the LinkedIn Post with Claude

Now Claude writes the post. You’ll pass the research brief and a detailed system prompt specifying what a good LinkedIn post looks like.

LinkedIn has its own formatting conventions: a short punchy opener, line breaks between each idea, no walls of text, and a clear question or call to action at the end.

import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });

async function writeLinkedInPost(topic, researchBrief) {
  const prompt = `
You are writing a LinkedIn post for a B2B professional audience.

Topic: ${topic}

Research context:
${researchBrief}

Requirements:
- Start with a short, attention-grabbing first line (under 15 words)
- Use single-sentence paragraphs separated by blank lines
- Include 3-5 key insights or data points from the research
- End with an open question to encourage comments
- Add 3-5 relevant hashtags at the end
- Total length: 150-250 words

Write the post now. No preamble — just the post itself.
  `;

  const message = await anthropic.messages.create({
    model: 'claude-opus-4-5',
    max_tokens: 1024,
    messages: [{ role: 'user', content: prompt }]
  });

  return message.content[0].text;
}

A few notes on this prompt:

  • “Single-sentence paragraphs separated by blank lines” mimics LinkedIn’s native formatting
  • Ending with an open question is proven to increase comment rates
  • “No preamble — just the post itself” prevents Claude from starting with “Here’s a LinkedIn post about…”
  • Telling Claude to use the research context avoids generic output

You can swap claude-opus-4-5 for claude-sonnet-4-5 for faster, cheaper writes. For a content agent running multiple times per day, the cost difference adds up quickly.


Step 4: Generate the Infographic with Imagen 3

Once you have the post, generate a visual to go with it. A clean infographic performs better on LinkedIn than a generic image — it gives people a reason to stop scrolling.

Use Imagen 3 through the MindStudio plugin:

async function generateInfographic(topic) {
  const imagePrompt = `
    A clean, professional infographic about "${topic}".
    Style: modern, flat design, dark navy and white color scheme.
    Layout: 3-4 key points shown as icons with short labels.
    Include a small chart or graph visual and bold typography.
    Format: square 1:1 aspect ratio, suitable for LinkedIn.
    No people, no faces, no photography, no gradients.
  `;

  const result = await agent.generateImage({
    prompt: imagePrompt,
    model: 'imagen-3',
    width: 1080,
    height: 1080
  });

  return result.url;
}

Two things worth emphasizing here:

Be directive, not descriptive. Don’t say “a professional infographic about remote work.” Say “flat vector design, icons, white background, dark blue text, no photography, no people.” Negative constraints do a lot of work.

Square format is safe. LinkedIn handles 1:1 images well across mobile and desktop. You can go 1200×627 for link previews, but square is cleaner for standalone posts.

The returned result.url is a hosted URL you’ll pass directly to ClickUp.


Step 5: Deliver Everything to ClickUp

Create a ClickUp task with the post copy in the description and the infographic embedded:

async function createClickUpTask(topic, postContent, imageUrl) {
  const taskData = {
    name: `LinkedIn Post: ${topic}`,
    description: `## LinkedIn Draft\n\n${postContent}\n\n## Infographic\n![Infographic](${imageUrl})`,
    status: 'to review',
    tags: ['linkedin', 'content'],
    priority: 3
  };

  const response = await fetch(
    `https://api.clickup.com/api/v2/list/${process.env.CLICKUP_LIST_ID}/task`,
    {
      method: 'POST',
      headers: {
        'Authorization': process.env.CLICKUP_API_TOKEN,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(taskData)
    }
  );

  const task = await response.json();
  return task.url;
}

Setting the status to "to review" keeps content in a staged state — the agent handles production, humans handle judgment. Make sure the status string matches an actual status in your ClickUp list, or the API will reject the request.


Step 6: Wire It All Together

Now connect the four functions into a single runnable agent:

async function runContentAgent(topic) {
  console.log(`Running content agent for: "${topic}"`);

  console.log('Researching...');
  const research = await researchTopic(topic);

  console.log('Writing LinkedIn post...');
  const post = await writeLinkedInPost(topic, research);

  console.log('Generating infographic...');
  const imageUrl = await generateInfographic(topic);

  console.log('Creating ClickUp task...');
  const taskUrl = await createClickUpTask(topic, post, imageUrl);

  console.log(`Done. Task created: ${taskUrl}`);
  return { post, imageUrl, taskUrl };
}

const topic = process.argv[2] || 'the business case for remote work';
runContentAgent(topic);

Run it with:

node agent.mjs "AI adoption in small business"

The full pipeline completes in two to three minutes. Most of that time is image generation. The Claude writing step typically finishes in under ten seconds.


How MindStudio Fits Into This Stack

One of the messier parts of building multi-tool agents is managing multiple APIs. Imagen 3 has its own authentication. Web search requires either a Google Custom Search API setup or a third-party service. Each integration has its own rate limiting and error handling patterns.

The MindStudio Agent Skills Plugin (@mindstudio-ai/agent) collapses this into a single SDK. One credential gives you:

  • agent.searchGoogle() — structured web search results
  • agent.generateImage() — access to Imagen 3, FLUX.1, DALL-E 3, and 15+ other image models
  • agent.sendEmail() — notify stakeholders when a task is created
  • agent.runWorkflow() — trigger other MindStudio automations

The plugin handles rate limiting, retries, and auth refresh automatically. When you’re building an agent, you want the reasoning layer doing reasoning — not managing HTTP errors and token refresh logic.

If you’d rather build the same workflow visually without writing code, MindStudio’s no-code builder supports the exact same stack: Claude, Imagen 3, and ClickUp integrations, connected through a visual editor. The average build takes under an hour. Teams managing AI-powered content workflows at scale often find the no-code route faster to maintain than custom scripts.

You can try MindStudio free at mindstudio.ai.


Common Mistakes and How to Fix Them

The post sounds generic

This usually means the research brief is too thin. Five snippets from Google don’t give Claude much to synthesize. Try fetching the full text of the top result using a page reader, or run more targeted searches — “async work productivity data McKinsey” instead of just “async work.”

Also audit your prompt. If you’re not specifying audience, tone, and format constraints explicitly, Claude defaults to safe and bland.

Imagen 3 generates the wrong style

Vague prompts produce vague results. Add explicit negative constraints: “no people, no faces, no photography, no gradients, no 3D effects.” Positive constraints should be just as specific: name the color palette, the layout type, and the visual elements you want.

The ClickUp task creation fails

Common causes:

  • The list ID doesn’t match your workspace — check it from the ClickUp URL
  • The status string doesn’t match an existing status in your list — ClickUp rejects unknown statuses silently
  • Rate limiting — add a short delay between calls if you’re batching multiple topics

The agent works locally but fails in production

Check that your .env variables are set in whatever runtime environment you’re deploying to. If you’re running this on a schedule via a cron job or cloud function, each execution needs fresh access to all credentials.


Frequently Asked Questions

What is Claude Code and how does it differ from just calling the Claude API?

Claude Code is Anthropic’s agentic coding assistant — a terminal-based tool that can read files, run code, and invoke external tools autonomously. The Claude API is the underlying model API for integrating Claude into your own applications. This guide uses both: Claude Code as the environment and orchestration layer, and the Claude API (via @anthropic-ai/sdk) for the actual text generation calls.

Can I use a different image model instead of Imagen 3?

Yes. The agent.generateImage() method via the MindStudio Agent Skills Plugin supports Imagen 3, FLUX.1, DALL-E 3, Stable Diffusion, and others. Change the model parameter to switch. Imagen 3 tends to produce cleaner infographic-style visuals, but FLUX.1 is a strong alternative for more stylistic flexibility.

How do I enforce brand voice consistency?

Add a brand guidelines section to your Claude prompt. Something like: “Write in a direct, pragmatic tone. Avoid marketing language. Do not use the words ‘revolutionize,’ ‘game-changing,’ or ‘empower.’” You can also add a second Claude call after the first to check the draft against a style checklist before the ClickUp task is created.

Can this agent run on a schedule automatically?

Yes. A cron job that calls the agent with a rotating topic list is the simplest approach. Pre-load topics into a JSON file and pop the next one on each run. For a more managed setup, MindStudio’s scheduled agents handle the scheduling infrastructure without you needing to configure cron or a cloud function.

Is this cost-effective at scale?

At low volume — five to ten posts per week — costs are minimal, typically under a dollar per week across Claude API calls and image generation. At higher volume, Claude Sonnet is significantly cheaper than Opus for the writing step. If you’re running this for an agency managing multiple LinkedIn accounts, the Agent Skills Plugin’s pooled rate limits help avoid hitting per-key API caps.

What’s the best way to handle review before anything goes live?

The ClickUp task is a staging area, not a publish queue. Setting the status to “to review” ensures a human sees every draft before it moves forward. You can extend this by adding a ClickUp automation that pings a Slack channel when a task lands in “to review,” or add an agent.sendEmail() call at the end of the pipeline to notify the reviewer directly.


Key Takeaways

  • A LinkedIn content agent built on Claude, Imagen 3, and ClickUp produces a research-backed post and matching infographic in under three minutes.
  • The four-step pipeline — research, write, generate image, create task — maps cleanly to API calls; no complex orchestration framework required.
  • The MindStudio Agent Skills Plugin (@mindstudio-ai/agent) handles multi-API complexity so your agent logic stays focused on reasoning, not infrastructure.
  • Prompt specificity drives output quality at both the Claude writing step and the Imagen 3 generation step — invest time here first.
  • ClickUp as the delivery target keeps content in a reviewable, assignable state; the agent handles production, humans handle judgment.

The hardest part of building this isn’t the code — it’s getting the prompts right. Once the LinkedIn format prompt and the infographic style prompt are dialed in, the rest is plumbing. This agent handles a workload that would otherwise take a content team 30–60 minutes per post, every time you run it.

If you want to skip the setup and start with a working version you can customize visually, MindStudio has Claude, Imagen 3, and ClickUp integrations ready to connect without writing a line of code.

Presented by MindStudio

No spam. Unsubscribe anytime.