Skip to content

Hook Generation

Hook workflows generate viral opening lines grounded in real competitor data, trend signals, and seasonal context. They can scrape creator channels, classify hook patterns, cluster by similarity, and score for estimated virality.

Workflow: hooks/generate

Generates viral hooks for a niche, grounded in up to 6 data sources: competitor insights, workspace strategy, trend signals, audience context, event/seasonal context, and user overrides.

Terminal window
fab-workflow hooks/generate \
--input niche="AI productivity" \
--input platform="TikTok" \
--input num_hooks=15

The full pipeline gathers intelligence in parallel before generating hooks:

┌─ gather_competitor_insights ─┐
├─ gather_trend_signals ───────┤ → merge_intel → generate_hook_ideas
└─ gather_event_context ───────┘

When competitor data is pre-scraped:

scrape_creator_hooks → extract_hook_features → cluster_hooks →
gather_competitor_insights → generate_hook_ideas

The system prompt assembles context from 6 sources:

SourceDescription
Competitor insightsHook type + trigger distributions from scraped or LLM-analyzed competitor data
Workspace strategyNiche, content pillars, brand tone, keywords
Trend signalsTrending topics and viral hook patterns for the niche
Audience contextTarget audience, pain points, desires (ICP)
Event & seasonal contextUpcoming holidays, awareness days, cultural moments relevant to the niche
User overridesFocus hook types, triggers, specific topic angle
ParameterTypeDefaultDescription
nichestringrequiredContent niche
competitorslist[str][]Channel URLs/handles to scrape
platformstring"YouTube"Target platform
trendsdict{}Trend signals from research
event_contextdict{}Event/seasonal context (auto-gathered if empty)
num_hooksint15Number of hooks to generate
{
"hook_ideas": [
{
"hook_text": "Stop building AI features nobody asked for",
"hook_type": "controversial_take",
"emotional_trigger": "frustration",
"estimated_strength": 0.89,
"tone": "authoritative",
"video_angle": "expose common mistake"
}
]
}

Output aliases (for workflow-set chaining)

Section titled “Output aliases (for workflow-set chaining)”

HookGenerationOutput declares public aliases so downstream stages in a workflow set can reference its output without walking the schema:

AliasResolves toUse
hookhook_ideas.0.hookTop-ranked hook text — the canonical handle for chaining into a video workflow
all_hookshook_ideasThe full list of hook ideas
# In a workflow-set manifest:
- name: short
workflow: video/quick-shorts
inputs_from:
- { source: hooks.0.hook, map: topic } # uses the `hook` alias

The system classifies hooks into these patterns:

TypeExample
controversial_take”Most productivity advice is wrong”
surprising_stat”90% of startups fail because of this”
story_hook”I spent $50K on AI tools last year. Here’s what happened.”
question”Why do the best developers avoid frameworks?”
challenge”Try this for 30 days and your code will improve”
fear_based”Your job is about to change forever”
curiosity_gap”The one thing nobody tells you about AI”

Workflow: hooks/scrape

Scrapes video openers from YouTube or TikTok channels to build a hook corpus.

Terminal window
fabric run hooks/scrape \
--input channels='["@fireship", "@mkbhd"]' \
--input platform="youtube" \
--input max_per_channel=20
ParameterTypeDefaultDescription
channelslist[str]requiredChannel URLs or handles
platformstring"youtube"Platform to scrape
max_per_channelint20Videos per channel
shorts_onlyboolfalseOnly scrape Shorts
{
"scraped_hooks": [
{
"channel": "@fireship",
"video_id": "abc123",
"hook_text": "This new JavaScript framework is wild",
"transcript_excerpt": "..."
}
]
}

Workflow: global/event-context

Identifies upcoming events, holidays, awareness days, and cultural moments relevant to a niche. Used as a context source in hook generation (runs as a parallel branch in the pipeline fork) or standalone for content planning.

Terminal window
fab-workflow global/event-context \
--input niche="fitness" \
--input lookahead_days=30
ParameterTypeDefaultDescription
nichestringrequiredContent niche
lookahead_daysint30How far ahead to look
platformstring""Target platform for context
{
"event_context": {
"events": [
{
"name": "Global Running Day",
"date": "2026-06-03",
"relevance": "Perfect tie-in for cardio content",
"content_angle": "Share your most unconventional running tip",
"urgency": "high"
}
],
"seasonal_themes": [
{
"theme": "Summer body prep",
"window": "May-June",
"hooks": ["Summer starts in the gym, not on the beach", "The 6-week myth about summer bodies"]
}
],
"content_angles": [
"Tie fitness content to outdoor season transition"
]
}
}

The hook generator uses a structured variant strategy to balance proven patterns with creative exploration:

SplitStrategyDescription
70%EXPLOITHooks that follow proven patterns from competitor data
20%EXPLOREHooks using underused hook types or triggers competitors aren’t leveraging
10%WILDCreative, unexpected, pattern-breaking hooks

This ensures most hooks are grounded in what works, while always testing new approaches.


Workflow: hooks/cluster

Embeds hooks using OpenAI (or Gemini fallback) and clusters them with K-means to find recurring hook patterns and archetypes. Useful for analyzing which hook types and emotional triggers dominate a corpus.

Terminal window
# Cluster hooks from a prior scrape or generation
fab-workflow hooks/cluster \
--input-file output/scraped-hooks.json
embed_hooks → cluster_hooks
ParameterTypeDefaultDescription
classified_hookslist[dict]requiredHooks with hook_text field (from scrape or generate)
openai_api_keystringenvOpenAI API key (falls back to Gemini embedding)
{
"clusters": [
{
"cluster_id": 0,
"size": 12,
"dominant_hook_type": "controversial_take",
"dominant_trigger": "frustration",
"dominant_tone": "authoritative",
"avg_engagement": 0.85,
"top_examples": [
{"hook_text": "Stop building AI features nobody asked for", "estimated_strength": 0.89}
]
}
]
}

Workflow task: hooks/from_research

Transforms deep research output into the format expected by hook generation. Used internally by composed pipelines.

# Bridges research synthesis → hook generation context
# Maps synthesis themes → trends
# Maps raw sources → competitor insights