Full script generation pipeline — researches topics per channel, checks for duplicates, selects optimal hooks based on retention data, and generates production-ready scripts with strong hooks and retention structure.
Resources
1Install
npx skillscat add lumeierecollection-blip/youtube/script-pipeline Install via the SkillsCat registry.
SKILL.md
Script Pipeline Skill
Purpose
End-to-end script generation that ensures every video has:
- A unique, researched topic (never repeated on the same channel)
- A hook optimized for 30-second retention (using ranked formulas)
- A structure that maximizes watch time (micro-loops, pattern interrupts, strategic silence)
When to Use
- Before rendering any video (this is the first step in the pipeline)
- When the user asks to "generate a script" or "make a video for channel X"
- As part of the automated pipeline (scheduled or manual trigger)
Prerequisites
config/channels.jsonmust exist with channel configurationsdata/topic-log.jsonmust exist (deduplication tracking)data/hook-templates.jsonmust exist (hook formulas)- Internet access for web research
Process
Phase 1: Topic Research
- Read
config/channels.jsonto get channel niche, style, and tone - Read
data/topic-log.jsonto get previously used topics for this channel - Run 3-4 search passes per the
deep-researchskill:- Pass 1: Broad web search on the niche
- Pass 2: Narrow/factual pass with specific terms
- Pass 3: Practitioner pass (what other YouTube channels in this niche are covering)
- Pass 4: Social/community pass (Reddit, forums, trending discussions)
- Filter out any topics that overlap with
used_topicsin the topic log - Rank remaining topics by: trending potential, freshness, RPM alignment, hook potential
Phase 2: Topic Selection & Deduplication
- From researched topics, select the top candidate
- Check against
data/topic-log.jsonfor semantic duplicates (not just exact matches) — use the code-level check:node src/utils/topic-log.cjs <channel-id> list— show every already-used topicnode src/utils/topic-log.cjs <channel-id> pick "<candidate>"— exits non-zero if the candidate is a duplicate- Also honor
data/research/<channel-id>/next-topic.jsonif it exists (the pipeline already reserved that topic as the next one)
- If topic is too similar to an existing one, reject and try next candidate
- Once confirmed unique, reserve it:
node src/utils/topic-log.cjs <channel-id> reserve "<topic>".script-writer/run.jsdoes this automatically every time it writes a script — never skip that step.
Phase 3: Hook Optimization
- Read
data/hook-templates.json→niche_hook_mappingfor this channel ID - Select the primary hook type for this niche
- Generate 3 hook variations using the ranked formulas
- Pick the hook with highest expected retention (specific-result > contrarian > direct-promise)
- Ensure hook follows rules:
- Under 15 seconds spoken
- Opens with number, name, or strong action verb
- No "welcome to" or channel name
- No questions as openers (make statements)
Phase 4: Script Generation
- Read channel config for style, tone, pacing
- Load the appropriate template (cinematic-documentary, minimal, or motion-graphics)
- Generate script following the
script-writerskill's workflow - Apply retention techniques:
- Micro-loops at end of each section
- Pattern interrupts every 60-90 seconds
- Strategic silence after reveals (750-1500ms)
- Callback close to hook
- Statistics with context
- Output the full script JSON per the schema
Phase 5: Update Tracking
- Add the topic to
data/topic-log.jsonunder the channel'sused_topics - Update
last_generatedtimestamp - Save the script to
data/scripts/{channel_id}/{topic-slug}.json
Output
- Script JSON file at
data/scripts/{channel_id}/{topic-slug}.json - Updated
data/topic-log.jsonwith the new topic logged - Summary to user with: topic, hook, word count, estimated duration, sections
Rules
- Never generate a topic that's already in the channel's
used_topicslist (check vianode src/utils/topic-log.cjs <channel-id> list) - Every script written must be registered in
data/topic-log.json(script-writer does this; verify withnode src/utils/topic-log.cjs <channel-id> list) - Every fact in the script must come from actual web research (not general knowledge)
- Hook must be from the ranked formulas — don't invent new hook styles
- Follow the channel's style template exactly (pacing, transitions, SFX)
- If research doesn't support a needed claim, flag the gap — don't invent