Skip to main content

Overview

The system comes with built-in content types (Tutorial, Explainer, List, Review, Story), but you can easily add your own custom formats.

Understanding Content Type Templates

Template Structure

Content type templates are defined in agents/script-writer-agent.js:16-44:
loadTemplates() {
  return {
    tutorial: {
      structure: ['hook', 'introduction', 'problem', 'solution_steps', 
                  'demonstration', 'recap', 'cta'],
      tone: 'educational',
      pacing: 'moderate'
    },
    explainer: {
      structure: ['hook', 'question', 'background', 'explanation', 
                  'examples', 'implications', 'summary', 'cta'],
      tone: 'informative',
      pacing: 'steady'
    },
    // Add more templates...
  };
}

Template Components

Defines the sections in order. Each section is generated separately and assembled into the final script.Common sections:
  • hook - Opening attention grabber (required)
  • introduction - Video introduction (required)
  • problem - Problem statement
  • solution_steps - Step-by-step solution
  • demonstration - Live demo or walkthrough
  • explanation - Detailed explanation
  • examples - Real-world examples
  • list_items - Numbered or bulleted list
  • comparison - Comparison with alternatives
  • recap - Summary of key points
  • cta - Call to action (required)
The overall voice and style of the content:
  • educational - Teaching and instructional
  • informative - Fact-based and neutral
  • engaging - Entertaining and dynamic
  • analytical - In-depth and thoughtful
  • narrative - Story-driven
  • conversational - Casual and friendly
Content delivery speed:
  • quick - Fast-paced, energetic
  • moderate - Balanced pace
  • steady - Consistent, measured
  • detailed - Slower, comprehensive
  • dynamic - Varied pace throughout

Creating Custom Content Types

Example: Product Showcase Template

Let’s create a “Product Showcase” content type for reviewing products:
agents/script-writer-agent.js
loadTemplates() {
  return {
    // Existing templates...
    
    showcase: {
      structure: [
        'hook',
        'introduction',
        'product_overview',
        'unboxing',
        'features',
        'demonstration',
        'pros',
        'cons',
        'price_value',
        'verdict',
        'cta'
      ],
      tone: 'enthusiastic',
      pacing: 'dynamic'
    },
    
    interview: {
      structure: [
        'hook',
        'introduction',
        'guest_intro',
        'background',
        'questions',
        'key_insights',
        'advice',
        'summary',
        'cta'
      ],
      tone: 'conversational',
      pacing: 'moderate'
    },
    
    challenge: {
      structure: [
        'hook',
        'introduction',
        'challenge_rules',
        'preparation',
        'attempt',
        'results',
        'lessons_learned',
        'recap',
        'cta'
      ],
      tone: 'exciting',
      pacing: 'quick'
    }
  };
}

Implementing Section Generators

Add generators for custom sections in agents/script-writer-agent.js:221-476:
async generateSection(sectionType, strategy) {
  const sectionGenerators = {
    // Existing generators...
    
    product_overview: () => this.generateProductOverview(strategy),
    unboxing: () => this.generateUnboxing(strategy),
    features: () => this.generateFeatures(strategy),
    price_value: () => this.generatePriceValue(strategy),
    verdict: () => this.generateVerdict(strategy),
    
    guest_intro: () => this.generateGuestIntro(strategy),
    questions: () => this.generateQuestions(strategy),
    key_insights: () => this.generateKeyInsights(strategy),
    
    challenge_rules: () => this.generateChallengeRules(strategy),
    preparation: () => this.generatePreparation(strategy),
    attempt: () => this.generateAttempt(strategy),
    results: () => this.generateResults(strategy),
    lessons_learned: () => this.generateLessonsLearned(strategy)
  };

  const generator = sectionGenerators[sectionType];
  
  if (generator) {
    return await generator();
  }
  
  return this.generateGenericSection(sectionType, strategy);
}

// Implement the custom section generators
async generateProductOverview(strategy) {
  return {
    type: 'product_overview',
    title: 'What Is It?',
    content: [
      `Today we're taking a detailed look at ${strategy.topic}.`,
      `This product has been making waves in the market.`,
      `Let me give you the complete overview of what it offers.`,
      `[Show product on camera]`
    ],
    visuals: ['Product beauty shots', 'Brand logo'],
    duration: 45
  };
}

async generateUnboxing(strategy) {
  return {
    type: 'unboxing',
    title: 'Unboxing Experience',
    content: [
      `Let's start with the unboxing experience.`,
      `First impressions matter, and the packaging is impressive.`,
      `[Open box and reveal contents]`,
      `Here's what you get in the box...`,
      `The presentation definitely feels premium.`
    ],
    visuals: ['Unboxing footage', 'Contents laid out'],
    duration: 60
  };
}

async generateFeatures(strategy) {
  const features = [
    'Innovative design and build quality',
    'Advanced performance capabilities',
    'User-friendly interface',
    'Excellent connectivity options',
    'Long battery life'
  ];
  
  return {
    type: 'features',
    title: 'Key Features',
    content: [
      `Now let's dive into the features that make this special.`,
      ...features.map((f, i) => `Feature ${i + 1}: ${f}`),
      `Each of these features adds real value.`
    ],
    features: features,
    visuals: ['Feature demonstrations', 'Close-up shots'],
    duration: 90
  };
}

async generatePriceValue(strategy) {
  return {
    type: 'price_value',
    title: 'Is It Worth The Price?',
    content: [
      `Let's talk about the price and value proposition.`,
      `At the current price point, you're getting a lot.`,
      `Compared to similar products in this category...`,
      `The value here is definitely competitive.`
    ],
    visuals: ['Price comparison chart'],
    duration: 30
  };
}

async generateVerdict(strategy) {
  return {
    type: 'verdict',
    title: 'Final Verdict',
    content: [
      `So here's my final verdict on ${strategy.topic}.`,
      `Who should buy this?`,
      `Who should skip it?`,
      `Overall, I'd rate this [X/10].`,
      `For the right person, this is absolutely worth it.`
    ],
    visuals: ['Rating graphic', 'Summary card'],
    duration: 45
  };
}

Configuring Content Strategy

Adding Content Type to Strategy Agent

Update the content type selection in agents/content-strategy-agent.js:312-331:
selectContentType(topic) {
  const types = [
    // Existing types...
    { type: 'Tutorial', suitableFor: ['how to', 'guide', 'learn'] },
    { type: 'List', suitableFor: ['best', 'top', 'worst'] },
    { type: 'Review', suitableFor: ['review', 'vs', 'comparison'] },
    { type: 'Explainer', suitableFor: ['what is', 'why', 'explained'] },
    
    // Add custom types
    { type: 'Showcase', suitableFor: ['product', 'showcase', 'unboxing'] },
    { type: 'Interview', suitableFor: ['interview', 'conversation', 'talk'] },
    { type: 'Challenge', suitableFor: ['challenge', 'attempt', 'trying'] }
  ];

  const topicLower = topic.toLowerCase();
  
  for (const contentType of types) {
    if (contentType.suitableFor.some(keyword => topicLower.includes(keyword))) {
      return contentType.type;
    }
  }

  return 'Explainer';
}

Configuring Available Content Types

Update your credentials configuration to enable custom types:
config/credentials.json
{
  "content": {
    "contentTypes": [
      "tutorial",
      "explainer",
      "list",
      "review",
      "story",
      "showcase",
      "interview",
      "challenge"
    ],
    "postingFrequency": "daily",
    "preferredPostTime": "14:00"
  }
}

Advanced Template Customization

Dynamic Section Generation

Create templates that adapt based on topic:
loadTemplates() {
  return {
    adaptive: {
      structure: (topic) => {
        const base = ['hook', 'introduction'];
        
        // Add sections based on topic
        if (topic.includes('tutorial')) {
          base.push('problem', 'solution_steps', 'demonstration');
        } else if (topic.includes('review')) {
          base.push('overview', 'pros', 'cons', 'verdict');
        } else {
          base.push('explanation', 'examples');
        }
        
        base.push('recap', 'cta');
        return base;
      },
      tone: 'adaptive',
      pacing: 'moderate'
    }
  };
}

Template Variants

Create variants for different video lengths:
loadTemplates() {
  return {
    'tutorial-short': {
      structure: ['hook', 'introduction', 'quick_steps', 'recap', 'cta'],
      tone: 'educational',
      pacing: 'quick',
      targetDuration: '3-5 minutes'
    },
    'tutorial-long': {
      structure: ['hook', 'introduction', 'problem', 'theory',
                  'detailed_steps', 'demonstration', 'common_mistakes',
                  'advanced_tips', 'recap', 'cta'],
      tone: 'educational',
      pacing: 'detailed',
      targetDuration: '15-20 minutes'
    }
  };
}

SEO Optimization for Custom Types

Custom Title Patterns

Add title patterns for your content types in agents/script-writer-agent.js:92-113:
async generateTitle(strategy) {
  // Custom titles for custom content types
  const customTitles = {
    Showcase: [
      `${strategy.topic}: Complete Unboxing & Review`,
      `Is ${strategy.topic} Worth It? Honest Review`,
      `${strategy.topic} - Everything You Need to Know`
    ],
    Interview: [
      `Expert Insights: ${strategy.topic}`,
      `In Conversation: ${strategy.topic}`,
      `${strategy.topic} - Behind the Scenes`
    ],
    Challenge: [
      `I Tried ${strategy.topic} for 30 Days`,
      `${strategy.topic} Challenge - The Results`,
      `Can I ${strategy.topic}? The Ultimate Test`
    ]
  };

  if (customTitles[strategy.contentType]) {
    const titles = customTitles[strategy.contentType];
    return titles[Math.floor(Math.random() * titles.length)];
  }

  // Fall back to default title generation
  return `${strategy.angle}`;
}
Custom content types should align with your channel’s niche and audience expectations. Test new formats gradually before automating them.

Testing Custom Content Types

Manual Generation

Test your custom content type:
test-custom-type.js
const { YouTubeAutomationAgent } = require('./index');

async function testCustomContentType() {
  const agent = new YouTubeAutomationAgent();
  await agent.initialize();
  
  // Generate content with custom type
  const result = await agent.generateContent(
    'Best Wireless Headphones 2025',
    'showcase',
    'medium'
  );
  
  console.log('Generated content:', result);
  console.log('Content ID:', result.contentId);
}

testCustomContentType().catch(console.error);

Validation

node test-custom-type.js
Before deploying custom content types to production:
  • Generate at least 3-5 test videos
  • Review script quality and coherence
  • Check SEO optimization effectiveness
  • Validate thumbnail generation compatibility
  • Ensure proper database storage

Database Schema Extensions

Store custom content type metadata:
// Add to database/db.js
async createContentTypeMetadata() {
  await this.executeQuery(`
    CREATE TABLE IF NOT EXISTS content_type_metadata (
      id TEXT PRIMARY KEY,
      content_type TEXT NOT NULL,
      performance_score REAL DEFAULT 0,
      total_uses INTEGER DEFAULT 0,
      average_views INTEGER DEFAULT 0,
      average_retention REAL DEFAULT 0,
      best_performing_video TEXT,
      configuration TEXT,
      created_at TEXT DEFAULT CURRENT_TIMESTAMP
    )
  `);
}

async trackContentTypePerformance(contentType, videoId, metrics) {
  const existing = await this.getRow(
    'SELECT * FROM content_type_metadata WHERE content_type = ?',
    [contentType]
  );
  
  if (existing) {
    // Update existing metrics
    await this.executeQuery(`
      UPDATE content_type_metadata SET
        total_uses = total_uses + 1,
        average_views = (average_views * total_uses + ?) / (total_uses + 1),
        average_retention = (average_retention * total_uses + ?) / (total_uses + 1),
        performance_score = (average_views / 1000) * average_retention
      WHERE content_type = ?
    `, [metrics.views, metrics.retention, contentType]);
  } else {
    // Insert new record
    await this.executeQuery(`
      INSERT INTO content_type_metadata (
        id, content_type, total_uses, average_views, 
        average_retention, best_performing_video
      ) VALUES (?, ?, 1, ?, ?, ?)
    `, [
      this.generateId('ct_meta'),
      contentType,
      metrics.views,
      metrics.retention,
      videoId
    ]);
  }
}

Next Steps

Customization

More customization options

Troubleshooting

Debug and resolve issues