Skip to Content
New FeaturesContent Repurposing Engine - Quick Reference

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.tsx

New Database Tables

  • RepurposingTemplate - Customizable prompts per repurposing path
  • RepurposingAnalytics - 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

ActionCreditsSavings
Create blog from scratch2.0-
Create social from scratch1.0-
Create email from scratch2.0-
Repurpose blog → social0.550%
Repurpose blog → email0.575%
Batch: 1 blog → 5 derivatives2.575%

🚀 User Workflow

  1. Create & Approve Content

    • Write a blog post (or have agent generate it)
    • Go through DM review → Client approval
  2. Repurpose

    • Click “Repurpose Content” button on approved post
    • Select target formats (checkboxes)
    • Choose platforms for social posts
    • See credit cost estimate
    • Click “Repurpose Content”
  3. Review Derivatives

    • Each derivative appears as a new Activity
    • Goes through DM review (Gate 1)
    • Then Client review (Gate 2)
    • Can edit before approval
  4. 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

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:failed

Database 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 cost

Or set in RepurposingTemplate table per path.

Customize Prompts

  1. Quick: Edit prompts in getDefaultSystemPrompt() function
  2. Scalable: Create tenant-specific templates in RepurposingTemplate table
  3. 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() and consumeCredits() calls
  • Check credit_ledger table

🎨 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

  1. Identify top paths - See what’s working for your workflow
  2. Track ROI - Monitor credits saved vs creating content separately
  3. Optimize templates - Focus on high-usage paths
  4. Plan automation - Automate most-used paths in future
  5. 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());


🎉 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!

© 2026 Leadmetrics — Internal use only