| name | marketing-pipeline-automation |
| description | Automated AI content pipeline from research to video generation using Claude, OpenAI, and Remotion |
| triggers | ["how do I automate content creation with AI","help me set up the marketing pipeline project","generate video content from text automatically","crawl news and create content with Claude","automate research to video workflow","build AI content generation pipeline","create automated marketing content system","set up remotion video rendering for content"] |
Marketing Pipeline Automation Skill
Skill by ara.so — Marketing Skills collection.
This skill enables AI coding agents to help developers use the Ultimate AI Content Pipeline - an automated system that takes a keyword and produces complete content pieces including research, written articles, and rendered videos. The pipeline integrates Claude 3, OpenAI, web scraping, and Remotion for video generation.
What This Project Does
The Marketing Pipeline automates the entire content creation workflow:
- Auto-Research: Crawls recent news from TechCrunch, a16z, Twitter/X, LinkedIn (last 24h)
- AI Content Generation: Creates articles in multiple formats (toplist, POV, case study, how-to) using Claude/OpenAI
- Multi-language: Generates content in English and Vietnamese simultaneously
- Video Rendering: Automatically creates infographics and short videos using Remotion
- Platform Optimization: Exports videos for Reels, TikTok, Shorts
Installation
Prerequisites
node --version
git clone https://github.com/pennydinh/marketing-pineline-share.git
cd marketing-pineline-share
npm install
yarn install
Environment Configuration
Create a .env.local file in the project root:
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
RAPIDAPI_KEY=
DATABASE_URL=
REMOTION_LICENSE_KEY=
NEXT_PUBLIC_APP_URL=http://localhost:3000
Development Server
npm run dev
yarn dev
Core Architecture
Project Structure
marketing-pineline-share/
├── app/ # Next.js app directory
├── components/ # React components
├── lib/ # Core utilities
│ ├── ai/ # AI integrations
│ ├── scraper/ # Web scraping modules
│ └── video/ # Remotion video generation
├── remotion/ # Video templates
└── public/ # Static assets
Key Components and Usage
1. Content Research Module
import { fetchNewsFromSources } from '@/lib/scraper/news-crawler';
interface NewsSource {
name: string;
url: string;
selector: string;
}
async function gatherResearch(keyword: string) {
const sources: NewsSource[] = [
{ name: 'TechCrunch', url: 'https://techcrunch.com', selector: '.post-block' },
{ name: 'a16z', url: 'https://a16z.com/posts', selector: '.article' }
];
const results = await fetchNewsFromSources(keyword, sources, {
timeRange: '24h',
maxResults: 20
});
return results;
}
const research = await gatherResearch('AI automation');
console.log(research.articles);
2. AI Content Generation
import Anthropic from '@anthropic-ai/sdk';
import OpenAI from 'openai';
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
interface ContentRequest {
keyword: string;
format: 'toplist' | 'pov' | 'case-study' | 'how-to';
language: 'en' | 'vi';
tone: 'expert' | 'friendly' | 'humorous';
researchData: any[];
}
async function generateContentWithClaude(request: ContentRequest) {
const prompt = buildPrompt(request);
const message = await anthropic.messages.create({
model: 'claude-3-5-sonnet-20241022',
: ,
: [{
: ,
: prompt
}]
});
message.[].;
}
() {
prompt = (request);
completion = openai...({
: ,
: [
{ : , : },
{ : , : prompt }
],
:
});
completion.[]..;
}
(): {
{ keyword, format, language, tone, researchData } = request;
;
}
3. Video Generation with Remotion
import { bundle } from '@remotion/bundler';
import { renderMedia, selectComposition } from '@remotion/renderer';
import path from 'path';
interface VideoConfig {
title: string;
content: string[];
style: 'infographic' | 'text-animation' | 'slideshow';
platform: 'reels' | 'tiktok' | 'shorts';
}
async function renderContentVideo(config: VideoConfig) {
const { title, content, style, platform } = config;
const dimensions = {
reels: { width: 1080, height: 1920 },
tiktok: { width: 1080, height: 1920 },
shorts: { width: 1080, height: 1920 }
};
const { width, height } = dimensions[platform];
const bundleLocation = ({
: path.(process.(), ),
: config,
});
composition = ({
: bundleLocation,
: style,
: {
title,
content,
width,
height
}
});
outputPath = path.(process.(), , );
({
composition,
: bundleLocation,
: ,
: outputPath,
: {
title,
content
}
});
outputPath;
}
4. Remotion Video Template
import { AbsoluteFill, useCurrentFrame, useVideoConfig, interpolate } from 'remotion';
interface InfographicProps {
title: string;
content: string[];
}
export const Infographic: React.FC<InfographicProps> = ({ title, content }) => {
const frame = useCurrentFrame();
const { fps, durationInFrames } = useVideoConfig();
const titleOpacity = interpolate(
frame,
[0, 30],
[0, 1],
{ extrapolateRight: 'clamp' }
);
const titleScale = interpolate(
frame,
[0, 30],
[0.8, 1],
{ extrapolateRight: 'clamp' }
);
return (
<AbsoluteFill style={{ backgroundColor: '#1a1a1a' }}>
<div style={{
display: '',
'',
'',
'',
'',
'%'
}}>
{title}
{content.map((item, index) => {
const itemFrame = 40 + (index * 20);
const itemOpacity = interpolate(
frame,
[itemFrame, itemFrame + 15],
[0, 1],
{ extrapolateRight: 'clamp' }
);
return (
{item}
);
})}
);
};
5. Complete Pipeline Example
import { NextRequest, NextResponse } from 'next/server';
import { gatherResearch } from '@/lib/scraper/news-crawler';
import { generateContentWithClaude } from '@/lib/ai/content-generator';
import { renderContentVideo } from '@/lib/video/render-video';
export async function POST(request: NextRequest) {
try {
const { keyword, format, language, platform } = await request.json();
console.log('🔍 Gathering research...');
const research = await gatherResearch(keyword);
console.log('✍️ Generating content...');
const content = await generateContentWithClaude({
keyword,
format,
language,
tone: 'expert',
researchData: research.articles
});
const contentLines = content.().( line.());
.();
videoPath = ({
: keyword,
: contentLines.(, ),
: ,
platform
});
.({
: ,
: {
content,
: videoPath.(process.() + , )
}
});
} (error) {
.(, error);
.(
{ : , : error. },
{ : }
);
}
}
6. Frontend Component
'use client';
import { useState } from 'react';
export function ContentPipeline() {
const [keyword, setKeyword] = useState('');
const [loading, setLoading] = useState(false);
const [result, setResult] = useState<any>(null);
const handleGenerate = async () => {
setLoading(true);
try {
const response = await fetch('/api/generate-content', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
keyword,
format: 'toplist',
language: 'vi',
platform: 'reels'
})
});
const data = await response.json();
setResult(data);
} catch (error) {
console.(, error);
} {
();
}
};
(
);
}
Configuration Options
AI Model Selection
export const AI_CONFIG = {
primaryModel: 'claude',
models: {
claude: {
model: 'claude-3-5-sonnet-20241022',
maxTokens: 4096
},
openai: {
model: 'gpt-4-turbo-preview',
maxTokens: 4096
}
}
};
Scraper Configuration
export const SCRAPER_CONFIG = {
sources: [
{ name: 'TechCrunch', url: 'https://techcrunch.com', enabled: true },
{ name: 'a16z', url: 'https://a16z.com/posts', enabled: true },
{ name: 'Twitter', url: 'https://twitter.com', enabled: false }
],
timeRange: '24h',
maxArticles: 20,
timeout: 30000
};
Video Configuration
export const VIDEO_CONFIG = {
defaultStyle: 'infographic',
fps: 30,
platforms: {
reels: { width: 1080, height: 1920, duration: 30 },
tiktok: { width: 1080, height: 1920, duration: 60 },
shorts: { width: 1080, height: 1920, duration: 60 }
}
};
Common Patterns
Batch Content Generation
async function generateBatchContent(keywords: string[]) {
const results = await Promise.all(
keywords.map(async (keyword) => {
const research = await gatherResearch(keyword);
const content = await generateContentWithClaude({
keyword,
format: 'toplist',
language: 'vi',
tone: 'expert',
researchData: research.articles
});
return { keyword, content };
})
);
return results;
}
Multi-language Generation
async function generateMultiLanguage(keyword: string) {
const research = await gatherResearch(keyword);
const [english, vietnamese] = await Promise.all([
generateContentWithClaude({
keyword,
format: 'toplist',
language: 'en',
tone: 'expert',
researchData: research.articles
}),
generateContentWithClaude({
keyword,
format: 'toplist',
language: 'vi',
tone: 'expert',
researchData: research.articles
})
]);
return { english, vietnamese };
}
Troubleshooting
API Rate Limits
class RateLimiter {
private queue: Promise<any> = Promise.resolve();
async throttle<T>(fn: () => Promise<T>, delay: number = 1000): Promise<T> {
this.queue = this.queue.then(() =>
new Promise(resolve => setTimeout(resolve, delay))
);
await this.queue;
return fn();
}
}
const limiter = new RateLimiter();
const content = await limiter.throttle(() =>
generateContentWithClaude(request)
);
Video Rendering Memory Issues
NODE_OPTIONS="--max-old-space-size=4096" npm run dev
Scraper Blocked
const USER_AGENTS = [
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36'
];
function getRandomUserAgent() {
return USER_AGENTS[Math.floor(Math.random() * USER_AGENTS.length)];
}
Environment Variables Not Loading
if (!process.env.OPENAI_API_KEY) {
throw new Error('OPENAI_API_KEY not found in environment variables');
}
CLI Commands
npm run dev
npm run build
npm run start
npm run remotion
npm run render
npm run test
npm run lint