Content Repurposing Engine - Quick Reference
📋 Feature Overview
Transform approved content into multiple platform-optimized derivatives with a single click.
Benefits:
- ⚡ Save 3-5 hours per content piece
- 💰 50% cheaper than creating from scratch (0.5 credits vs 2.0)
- 🎯 Platform-optimized content
- 📊 Full analytics tracking
- ✅ Quality maintained via 2-gate approval
🎯 Supported Repurposing Paths
From Blog Posts → Everything
- Social Posts (LinkedIn, Instagram, Facebook, X)
- Email Newsletters
- Ad Copy
- Twitter Threads
- Instagram Carousels
- Landing Pages
From Reports → Most
- Social Posts
- Email Newsletters
- Twitter Threads
- Instagram Carousels
From Social Posts → Short Form
- Ad Copy
- Twitter Threads
From Newsletters → Promotion
- Social Posts
- Ad Copy
🔧 Technical Implementation
Files Modified
packages/db/prisma/schema.prisma # Activity + 2 new tables
packages/queue/src/types.ts # ContentRepurposerJobData
packages/queue/src/queues.ts # enqueueContentRepurposer()
packages/agents/src/workers/ # content-repurposer.worker.ts
apps/dashboard/src/app/(dashboard)/blog/ # Repurpose UI + actions
apps/dashboard/src/app/(dashboard)/analytics/repurposing/ # Analytics dashboard
apps/manage/src/app/(manage)/templates/repurposing/ # Template management portal
apps/dashboard/src/components/ # LineageBadge.tsxNew Database Tables
RepurposingTemplate- Customizable prompts per repurposing pathRepurposingAnalytics- Usage tracking for product insights
New Worker Queue
- Queue Name:
agent__content-repurposer - Concurrency: 3 jobs parallel
- Rate Limit: 10 jobs/minute
- Retry: 2 attempts with exponential backoff
📊 Credit Economics
| Action | Credits | Savings |
|---|---|---|
| Create blog from scratch | 2.0 | - |
| Create social from scratch | 1.0 | - |
| Create email from scratch | 2.0 | - |
| Repurpose blog → social | 0.5 | 50% |
| Repurpose blog → email | 0.5 | 75% |
| Batch: 1 blog → 5 derivatives | 2.5 | 75% |
🚀 User Workflow
-
Create & Approve Content
- Write a blog post (or have agent generate it)
- Go through DM review → Client approval
-
Repurpose
- Click “Repurpose Content” button on approved post
- Select target formats (checkboxes)
- Choose platforms for social posts
- See credit cost estimate
- Click “Repurpose Content”
-
Review Derivatives
- Each derivative appears as a new Activity
- Goes through DM review (Gate 1)
- Then Client review (Gate 2)
- Can edit before approval
-
Publish
- Approve derivatives individually
- Publish to connected channels
- Track performance
🎨 UI Components
RepurposeModal
- Location: Approved blog detail page
- Trigger: “Repurpose Content” button
- Features:
- Visual format cards with icons
- Platform selector for social posts
- Real-time credit calculation
- Error handling
- Success confirmation
LineageBadge
- Shows on: Derivative content pages
- Format: “Derived from Blog Post: [Title]”
- Clickable: Links to source content
- Colored: Different colors per source type
DerivativeCountBadge
- Shows on: Source content pages
- Format: ”🎨 X derivatives created”
- Clickable: Filters activities to show derivatives
📈 Analytics Queries
Most Popular Repurposing Paths
SELECT
sourceType,
targetType,
COUNT(*) as count
FROM repurposing_analytics
GROUP BY sourceType, targetType
ORDER BY count DESC;Credits Saved
SELECT
tenantId,
SUM(derivativeCount * 0.5) as spent_on_repurposing,
SUM(derivativeCount * 2.0) as would_have_spent,
SUM(derivativeCount * 1.5) as savings
FROM repurposing_analytics
GROUP BY tenantId;Success Rate
SELECT
COUNT(CASE WHEN completedAt IS NOT NULL THEN 1 END)::float / COUNT(*) * 100 as success_rate
FROM repurposing_analytics
WHERE createdAt > NOW() - INTERVAL '30 days';🔍 Monitoring
Worker Health
# Check running workers
ps aux | grep content-repurposer
# Check Redis queues
redis-cli LLEN agent__content-repurposer:waiting
redis-cli LLEN agent__content-repurposer:active
redis-cli LLEN agent__content-repurposer:completed
redis-cli LLEN agent__content-repurposer:failedDatabase Queries
-- Recent repurposing batches
SELECT * FROM repurposing_analytics
ORDER BY createdAt DESC LIMIT 10;
-- Pending derivatives
SELECT * FROM activity
WHERE agentQueue = 'content-repurposer'
AND status = 'pending';
-- Failed derivatives
SELECT * FROM activity
WHERE agentQueue = 'content-repurposer'
AND status = 'failed';⚙️ Configuration
Adjust Credit Costs
Edit content-repurposer.worker.ts:
const totalCreditsNeeded = targetFormats.length * 0.5; // Change 0.5 to desired costOr set in RepurposingTemplate table per path.
Customize Prompts
- Quick: Edit prompts in
getDefaultSystemPrompt()function - Scalable: Create tenant-specific templates in
RepurposingTemplatetable - Portal: Use template management portal at
/templates/repurposing(✅ implemented)
Worker Tuning
const worker = new Worker<ContentRepurposerJobData>(queueName, processJob, {
concurrency: 3, // Parallel jobs
limiter: {
max: 10, // Max jobs per window
duration: 60000, // Window duration (ms)
},
});🐛 Common Issues
”Only approved blog posts can be repurposed”
- Check
post.status === 'client_approved' - Button only appears after client approval
Worker not processing
- Verify worker is running
- Check Redis connection
- Check credits balance
Derivatives not appearing
- Check Activity table for
agentQueue = 'content-repurposer' - Check worker logs for errors
- Verify Claude API is responding
Credits not deducted
- Check billing package integration
- Verify
reserveCredits()andconsumeCredits()calls - Check
credit_ledgertable
🎨 Template Management Portal
URL: https://manage.yourdomain.com/templates/repurposing
Features
- List all templates - View global and tenant-specific templates
- Create templates - Define custom prompts for any repurposing path
- Edit templates - Modify tenant-specific templates (global templates read-only)
- Clone templates - Create tenant copy from global template
- Delete templates - Remove tenant-specific templates
- Toggle status - Activate/deactivate templates
- Search & filter - Find templates by source, target, scope, or text search
- Stats dashboard - View template counts and usage
Template Variables
Use these in prompt templates:
{{tenantName}}- Tenant company name{{sourceContent}}- The content to repurpose{{targetFormat}}- The target format (e.g., “social_post”){{platform}}- Platform for social posts (e.g., “linkedin”){{clientContext}}- Business context from tenant profile{{brandVoice}}- Brand voice guidelines{{targetKeywords}}- Keywords from source content
Quick Actions
# Create tenant-specific template
1. Go to Template Portal
2. Find global template for desired path
3. Click "Clone"
4. Edit prompt, adjust credit cost
5. Save
# Deactivate template
1. Find template in list
2. Click toggle switch
3. Template hidden from users
# Reset to global
1. Delete tenant-specific template
2. System falls back to global template📊 Analytics Dashboard
URL: https://dashboard.yourdomain.com/analytics/repurposing
Key Metrics
- Total Repurposings - Number of batches processed
- Derivatives Created - Total content pieces generated
- Credits Saved - Savings vs creating separately (typically 75%)
- Credits Used - Actual credits spent on repurposing
- Avg Derivatives/Batch - Efficiency metric
Visualizations
- Timeline Chart - Daily repurposing activity (last 30 days)
- Source Breakdown - Which content types get repurposed most
- Target Breakdown - Most popular derivative formats
- Top Paths - Most-used repurposing combinations
- ROI Insights - Credits saved, efficiency gains, recommendations
Using Analytics
- Identify top paths - See what’s working for your workflow
- Track ROI - Monitor credits saved vs creating content separately
- Optimize templates - Focus on high-usage paths
- Plan automation - Automate most-used paths in future
- Report to clients - Show content leverage and efficiency
Custom Queries
-- My top repurposing path
SELECT sourceType, targetType, COUNT(*) as uses
FROM repurposing_analytics
WHERE tenantId = 'YOUR_TENANT_ID'
GROUP BY sourceType, targetType
ORDER BY uses DESC
LIMIT 1;
-- Credits saved this month
SELECT
SUM(derivativeCount * 1.5) as credits_saved
FROM repurposing_analytics
WHERE tenantId = 'YOUR_TENANT_ID'
AND createdAt > DATE_TRUNC('month', NOW());📚 Related Documentation
🎉 Success Metrics
After launch, track:
- Repurposing adoption rate (% of approved posts that get repurposed)
- Average derivatives per source
- Most popular repurposing paths
- Time saved (hours)
- Credits saved (vs creating separately)
- Derivative approval rate
- User satisfaction (NPS surveys)
Target KPIs:
- 40% of approved blogs get repurposed
- 4.5 avg derivatives per blog
- 80% derivative approval rate
- 15 hours saved per tenant per month
Questions? Check the implementation summary or migration guide!