How to Use Claude Code Skills to Automate Social Media Content Repurposing
Learn how to build a Claude Code skill that takes a YouTube video URL and outputs ready-to-post LinkedIn, Instagram, and X content with visuals.
From Long-Form Video to Ready-to-Post Content in Minutes
Content repurposing is one of those tasks that sounds simple but eats hours every week. You record a podcast, publish a YouTube video, or film a webinar — and then you’re supposed to turn that into a LinkedIn post, an Instagram caption, a thread for X, and a graphic or two. Most teams either skip it entirely or pay someone to do it manually.
Claude Code skills change the math here. With the right setup, you can point Claude Code at a YouTube URL and get back platform-ready content for LinkedIn, Instagram, and X — including visuals — without doing the work yourself.
This guide walks through exactly how to build that automation, step by step.
What Claude Code Skills Are (and Why They Matter for Content Work)
Claude Code is Anthropic’s agentic coding tool. It runs in your terminal, writes and edits code, executes commands, and calls external APIs. Unlike a chat interface, Claude Code can take multi-step tasks and carry them through to completion — reading files, running scripts, checking outputs, and iterating until the job is done.
“Skills” in the Claude Code context are callable tools or functions you expose to the agent. When Claude Code has a skill available, it can decide to call it at the right moment — like calling a transcription function when it encounters a video URL, or calling an image generation function when it needs a visual.
The MindStudio Agent Skills Plugin takes this further. It’s an npm package (@mindstudio-ai/agent) that exposes 120+ pre-built capabilities — image generation, web search, email sending, workflow triggering — as typed method calls that Claude Code can invoke directly. Instead of wiring up your own API integrations for each tool, you get a library of ready-made calls.
For content repurposing, the relevant capabilities include:
- Transcription and processing — Handle video content at scale
agent.generateImage()— Create visuals from a text promptagent.runWorkflow()— Trigger multi-step MindStudio automations for more complex processing stepsagent.sendEmail()— Deliver finished content packages to your inbox automatically
What You’ll Need Before You Start
Getting this running requires a few things in place.
Tools and accounts:
- Claude Code installed (requires an Anthropic account)
- Node.js v18 or higher
- A MindStudio account (free tier works to get started)
- The
@mindstudio-ai/agentnpm package - The
youtube-transcriptnpm package for fetching video captions
Skills you’ll need:
- Basic comfort with the terminal
- Light JavaScript familiarity — you don’t need to be a developer, but you should be able to read and modify a script
If you haven’t used Claude Code before, Anthropic’s documentation is a solid starting point. Setup takes 10–15 minutes.
How the Repurposing Pipeline Works
Before getting into the build, it helps to understand the full flow. Here’s what the finished skill does:
- Input: You provide a YouTube video URL
- Transcription: The skill fetches the video’s transcript
- Content extraction: Claude analyzes the transcript and pulls out key themes, quotes, and the core message
- Content generation: Claude writes platform-specific posts for LinkedIn, Instagram, and X, formatted correctly for each
- Visual generation: The skill calls
agent.generateImage()to create a shareable graphic based on the video’s core message - Output: You get a ready-to-use content package with all four outputs
Each step is a distinct function. Claude Code orchestrates them in sequence, making decisions along the way — like what image prompt to write based on the video’s content.
Step 1: Install and Configure the Plugin
Start by creating a new project directory and installing the dependencies:
mkdir content-repurposing-skill
cd content-repurposing-skill
npm init -y
npm install @mindstudio-ai/agent youtube-transcript dotenv
Create a .env file and add your MindStudio API key. You can find this in your MindStudio dashboard under Settings → API Keys.
MINDSTUDIO_API_KEY=your_key_here
Now create an index.js file. This is where the skill lives.
require('dotenv').config();
const { MindStudioAgent } = require('@mindstudio-ai/agent');
const { YoutubeTranscript } = require('youtube-transcript');
const agent = new MindStudioAgent({ apiKey: process.env.MINDSTUDIO_API_KEY });
This gives you the agent object with access to all the typed method calls you’ll use throughout the skill.
Step 2: Fetch and Process the Video Transcript
The first real task is getting the transcript. The youtube-transcript package handles this without requiring full YouTube API credentials:
async function getTranscript(videoUrl) {
const videoId = videoUrl.match(/(?:v=|youtu\.be\/)([^&\s]+)/)?.[1];
if (!videoId) throw new Error('Invalid YouTube URL');
const transcriptItems = await YoutubeTranscript.fetchTranscript(videoId);
const fullText = transcriptItems.map(item => item.text).join(' ');
return fullText;
}
This returns the full transcript as a single string. For longer videos, very long transcripts can consume significant tokens — more on that in the troubleshooting section below.
Step 3: Extract Key Themes and Insights
Once you have the transcript, the next step is identifying what’s actually worth turning into content. This is where Claude’s reasoning earns its place — you’re not just summarizing, you’re finding the most quotable, shareable moments.
You can run this extraction as a call to a MindStudio workflow, or handle it directly in Claude Code’s task context:
async function extractInsights(transcript) {
const response = await agent.runWorkflow({
workflowId: 'your-extraction-workflow-id',
input: {
transcript: transcript,
task: `Extract 5 key insights, 3 quotable moments, and the single core message
from this transcript. Include specific statistics and concrete examples
mentioned. Return as JSON.`
}
});
return JSON.parse(response.output);
}
If you prefer to keep everything within Claude Code without a separate workflow, you can pass the transcript directly in the agent’s task prompt and ask for structured JSON output before proceeding. Both approaches work — the workflow option is better if you want a reusable extraction step you can share across projects.
Step 4: Generate Platform-Specific Content
This is the core of the skill. Each platform has different conventions, character limits, and audience expectations. Here’s how to generate content for all three.
LinkedIn posts that get engagement tend to be 150–300 words, lead with a strong hook, use generous line breaks, and end with a question or call to action. They’re professional but not dry.
async function generateLinkedInPost(insights) {
const prompt = `
Write a LinkedIn post based on these insights: ${JSON.stringify(insights)}
Requirements:
- Open with a bold one-line hook (avoid starting with "I")
- 150–250 words total
- Use single-sentence paragraphs with line breaks
- Include 3–5 relevant hashtags at the end
- End with a question that invites comments
- Tone: direct, professional, conversational
`;
return prompt; // Claude Code executes this generation step in context
}
Instagram captions work differently. The first line needs to stop the scroll. The body can run longer than most people expect — up to 2,200 characters — but front-loading the hook is essential since only the first line shows before “more.”
async function generateInstagramCaption(insights) {
const prompt = `
Write an Instagram caption based on these insights: ${JSON.stringify(insights)}
Requirements:
- First line: 8 words max, scroll-stopping hook
- Body: 100–200 words in a storytelling format
- 15–20 hashtags at the end (mix of popular and niche)
- Use emoji sparingly but effectively
- End with a simple CTA (save this, share this, tag someone, etc.)
`;
return prompt;
}
X (Twitter)
For X, you have two options: a single punchy post under 280 characters, or a thread that unpacks the video’s ideas in sequence. Threads tend to get more reach when the content has enough depth to carry multiple posts.
async function generateXThread(insights) {
const prompt = `
Write an X (Twitter) thread based on these insights: ${JSON.stringify(insights)}
Requirements:
- 5–7 posts in the thread
- First post: hook that makes people want to keep reading (under 280 chars)
- Each subsequent post: one clear idea (under 280 chars each)
- Last post: summary + link prompt ("Full video in bio")
- Number each post (1/, 2/, etc.)
`;
return prompt;
}
Step 5: Generate Visuals with agent.generateImage()
Text content is useful, but a graphic makes everything more shareable — especially on LinkedIn and Instagram. The agent.generateImage() method handles this as a single call:
async function generateVisual(insights) {
const imagePrompt = `
Create a clean, professional social media graphic.
Main text overlay: "${insights.coreMessage}"
Style: Minimal, modern, bold sans-serif typography on a solid or gradient background.
No photography. No faces. Brand palette: deep navy and white.
Aspect ratio: square (1:1 for Instagram and LinkedIn).
`;
const result = await agent.generateImage({
prompt: imagePrompt,
width: 1080,
height: 1080,
model: 'flux'
});
return result.imageUrl;
}
The method returns a URL to the generated image. You can include it directly in your output package or download it to a local file.
For more polished visuals, MindStudio’s AI Media Workbench includes additional tools — upscaling, background removal, text overlay, and subtitle generation — useful if you want to brand the graphic with a logo or apply consistent styling across every piece.
Step 6: Wire Everything Together
Now bring all the pieces into a single function that Claude Code can run end-to-end:
async function repurposeVideo(videoUrl) {
console.log('Fetching transcript...');
const transcript = await getTranscript(videoUrl);
console.log('Extracting insights...');
const insights = await extractInsights(transcript);
console.log('Generating LinkedIn post...');
const linkedInPost = await generateLinkedInPost(insights);
console.log('Generating Instagram caption...');
const instagramCaption = await generateInstagramCaption(insights);
console.log('Generating X thread...');
const xThread = await generateXThread(insights);
console.log('Generating visual...');
const visualUrl = await generateVisual(insights);
return {
linkedIn: linkedInPost,
instagram: instagramCaption,
x: xThread,
visual: visualUrl,
insights: insights
};
}
// Entry point
const videoUrl = process.argv[2];
if (!videoUrl) {
console.error('Usage: node index.js <youtube-url>');
process.exit(1);
}
repurposeVideo(videoUrl)
.then(result => {
console.log('\n=== CONTENT PACKAGE ===\n');
console.log('LINKEDIN:\n', result.linkedIn);
console.log('\nINSTAGRAM:\n', result.instagram);
console.log('\nX THREAD:\n', result.x);
console.log('\nVISUAL URL:', result.visual);
})
.catch(console.error);
To run it:
node index.js "https://www.youtube.com/watch?v=example"
Within a couple of minutes, you get a complete content package ready to copy and post.
How MindStudio Makes This Significantly Easier
The script above works as a standalone tool, but the MindStudio Agent Skills Plugin does something important that’s worth naming explicitly: it handles the infrastructure that would otherwise take days to build.
Without it, you’d need to:
- Set up and manage API credentials for each image generation provider
- Handle rate limiting and retries on every external call
- Build separate integrations for each tool you want the agent to use
- Manage authentication across multiple providers
The @mindstudio-ai/agent package abstracts all of that. You call agent.generateImage() and the SDK handles model selection, rate limiting, retries, and error handling. The same applies to agent.sendEmail() if you want to deliver the content package to your inbox automatically, or agent.runWorkflow() if you want to trigger more complex downstream automations.
For teams who want to go beyond a script — building a web app with a UI, running the workflow on a schedule, or connecting the output to a CMS or social scheduling tool — MindStudio’s no-code workflow builder lets you add that layer visually. You can connect the output directly to tools like Buffer, Notion, or Airtable using MindStudio’s 1,000+ pre-built integrations, without writing additional code.
You can try MindStudio free at mindstudio.ai.
Common Mistakes and How to Fix Them
The transcript comes back empty
Some YouTube videos don’t have transcripts enabled, or the creator has disabled auto-captions. If fetchTranscript() returns nothing, check whether captions are visible in YouTube’s player. You can use OpenAI’s Whisper as a fallback — download the audio separately and run it through transcription before continuing.
The generated content sounds generic
This happens when the extraction step doesn’t pull specific enough details from the transcript. Add explicit instructions to the extraction prompt: “Include specific statistics mentioned, exact quotes from the speaker, and concrete examples used in the video.” Specific inputs produce specific outputs — this is the most common lever you can pull.
Image generation returns an error
The most frequent cause is a prompt that violates content policy or is too vague for the model. Keep image prompts focused on typography, color, and layout rather than complex scenes or faces. When using FLUX through MindStudio, overly abstract prompts tend to fail — be explicit about what visual elements you want.
Output formatting is inconsistent across runs
If you’re running the skill repeatedly and getting different JSON structures, add a schema definition to the extraction prompt and validate the output before passing it downstream. A simple JSON.parse() wrapped in a try/catch catches most formatting issues early and prevents silent failures in later steps.
The workflow is slow on longer videos
Long transcripts slow everything down and can hit context window limits. For videos over 30 minutes, chunk the transcript into sections and extract insights from each section separately, then merge the results. This keeps individual calls fast and gives you better control over token usage.
Expanding the Skill Further
Once the basic workflow runs reliably, there are natural ways to extend it.
Add a brand voice layer. Store your brand’s tone guidelines in a constants file and inject them into every content generation prompt. This keeps output consistent across different videos, topics, and team members running the skill.
Connect to a scheduling tool. Use agent.runWorkflow() to pass the finished content into a MindStudio workflow that posts directly to Buffer, Later, or another scheduling platform. The content goes from YouTube to your scheduling queue without manual steps.
Build a team-facing UI. If non-technical teammates need to use this, MindStudio’s visual builder lets you wrap the same logic in a clean web interface — URL input field, formatted output display — without additional code. The average MindStudio build takes 15 minutes to an hour.
Add newsletter or blog output. The same transcript can generate a weekly newsletter section or a short blog post summary. Add a prompt that formats the insights as a written article block and you have a fifth content format with minimal extra work.
For more on building AI-powered content workflows, the MindStudio blog covers related use cases including email automation, research pipelines, and document processing.
Frequently Asked Questions
What exactly is a Claude Code skill?
A Claude Code skill is a tool or function you make available to Claude Code so it can call it during an agentic task. Skills extend what Claude Code can do beyond writing and editing code — they let it interact with external APIs, run specific processes, or call platform capabilities like image generation or web search. In the context of the MindStudio Agent Skills Plugin, skills are typed method calls in an npm SDK that Claude Code can invoke as part of a larger workflow.
Do I need to know how to code to build this?
Some basic JavaScript familiarity helps. You don’t need to be a developer, but you should be comfortable reading code, modifying strings and variables, and running commands in a terminal. If you want to skip the coding entirely, MindStudio’s no-code workflow builder can handle most of this pipeline visually — you build the same logic using a drag-and-drop interface instead of writing JavaScript.
How do I get a transcript from a YouTube video?
The youtube-transcript npm package fetches publicly available transcripts from YouTube without requiring a full YouTube Data API setup. It works for any video that has captions enabled — auto-generated or manually added. For videos without captions, download the audio and run it through a transcription model like Whisper before continuing.
Which social media platforms does this workflow support?
The example in this article covers LinkedIn, Instagram, and X. But the same architecture supports any text-based platform. Add a function for each additional output (TikTok captions, YouTube Shorts descriptions, newsletter sections) following the same pattern — each one just needs its own prompt with the right format and length requirements.
How much does it cost to run this automation?
Costs depend on how often you run it and which models you use. Claude Code usage is billed based on tokens consumed. MindStudio Agent Skills Plugin calls are billed through your MindStudio account — the free tier covers a limited number of runs per month, and paid plans start at $20/month. For most teams repurposing a handful of videos per week, the total cost stays low.
Can I customize the output for my brand’s voice and tone?
Yes, and it’s worth doing early. Add a brand voice description to each content generation prompt — something like: “Write in a direct, no-fluff tone. Avoid corporate language. Use short sentences. Don’t use the word ‘leverage.’” The more specific you are about tone, vocabulary preferences, and things to avoid, the more consistent the output will be across different videos and topics. Store this as a constant at the top of your script and inject it into every prompt automatically.
Key Takeaways
- Claude Code skills let you build agentic workflows that handle multi-step tasks — like social media content repurposing — from start to finish without manual intervention.
- The MindStudio Agent Skills Plugin (
@mindstudio-ai/agent) adds 120+ typed capabilities to Claude Code, including image generation, workflow triggering, and email delivery, as simple method calls. - A complete repurposing workflow covers transcript fetching, insight extraction, platform-specific content generation, and visual creation — each as a distinct, composable function.
- LinkedIn, Instagram, and X each need tailored prompts: character limits, tone, formatting, and hashtag conventions differ significantly across platforms.
- You can extend the skill to additional platforms, add brand voice layers, or connect the output to scheduling tools with minimal extra work.
If you want to build this without writing any code — or wrap it in a UI so your whole team can use it — MindStudio’s visual workflow builder is worth a look. You can start free at mindstudio.ai.