Skip to main content

Overview

The ScriptWriterAgent generates complete, production-ready video scripts based on content strategies. It creates structured scripts with hooks, introductions, main content, conclusions, and calls-to-action, following proven content templates.

Constructor

Database
required
Database instance for storing scripts
Credentials
required
Credentials manager for external services

Properties

Object
Script templates for different content types (tutorial, explainer, list, review, story)
Logger
Logger instance for tracking script generation

Script Templates

The agent includes built-in templates for five content types:

Methods

initialize()

Initializes the script writer agent.
Promise<boolean>
Returns true when initialization is complete

generateScript(strategy)

Generates a complete video script based on content strategy.
Object
required
Content strategy object from ContentStrategyAgent
string
required
Content topic
string
required
Content angle/approach
string
required
Content type (Tutorial, Explainer, List, Review, Story)
Array<string>
required
SEO keywords
Promise<Object>
Complete script object
string
Generated video title
Object
Opening hook (0:00-0:05) with type and text
Object
Introduction section (0:05-0:20) with greeting, topic intro, value proposition, credibility
Object
Main content sections with type-specific structure
Object
Conclusion with recap and final thought
Object
Call-to-action with subscribe, like, comment prompts
string
Estimated video duration (MM:SS format)
string
Formatted full script text ready for production

generateTitle(strategy)

Generates an optimized video title.
Object
required
Content strategy object
Promise<string>
Generated title

generateHook(strategy)

Generates an attention-grabbing opening hook.
Object
required
Content strategy
Promise<Object>
Hook object with type, text, and duration
string
Hook type: question, statistic, statement, challenge, or promise
string
Hook text content
string
Time range for hook (0:00-0:05)

generateIntroduction(strategy)

Generates the introduction section.
Object
required
Content strategy
Promise<Object>
Introduction with greeting, topic intro, value proposition, credibility

generateMainContent(strategy, template)

Generates structured main content based on template.
Object
required
Content strategy
Object
required
Script template with structure array
Promise<Object>
Main content with sections array and total duration

generateSolutionSteps(strategy)

Generates step-by-step solution section for tutorials.
Object
required
Content strategy
Promise<Object>
Solution steps section with 3-5 detailed steps

generateListItems(strategy)

Generates countdown list items for list-style content.
Object
required
Content strategy
Promise<Object>
List items section with 5-10 items in countdown format

generateConclusion(strategy)

Generates conclusion with recap and final thought.
Object
required
Content strategy
Promise<Object>
Conclusion with recap points and final message

generateCTA(strategy)

Generates call-to-action section.
Object
required
Content strategy
Promise<Object>
CTA with subscribe, like, comment, and next video prompts

formatFullScript(script)

Formats the complete script for production use.
Object
required
Complete script object
string
Formatted script text with sections, timestamps, and metadata

estimateDuration(mainContent)

Calculates total video duration.
Object
required
Main content object with sections
string
Duration in MM:SS format

Usage Example

Section Types

The agent generates different section types based on content template:
Identifies challenges and pain points related to the topic.
Provides 3-5 step-by-step instructions with pro tips.
Live demo or walkthrough section with visual cues.
Deep dive into concepts with detailed breakdown.
Real-world examples and case studies (usually 3).
Countdown-style list items (5-10 items).
Benefits and drawbacks for review content.
Comparative analysis with alternatives.

Best Practices

Choose appropriate content types: Tutorials for how-to topics, Lists for compilation content, Reviews for product/service evaluation.
While scripts are production-ready, always review for brand voice alignment and technical accuracy.
Modify the built-in templates to match your channel’s unique style and pacing preferences.
The estimated duration helps with production planning, but actual video length may vary based on delivery speed.