SuperAPI AI Directory

tts-script-generator

Writing & research

View repository

Updated 10-16 05:54

About this skill

TTS Script Generator

Intelligently compress and rewrite documents into a script suitable for TTS reading.

Core Capabilities

  • 🤖 AI Intelligent Analysis: Claude analyzes the article content and determines the optimal video duration and illustration style
  • ⏱️ Intelligent Duration Decision: Automatically determines the appropriate duration based on the content (3-8 minutes)
  • 🎨 Intelligent Style Decision: Automatically selects the illustration style based on the topic (New Yorker/Ukiyo-e/Flat/Realistic, etc.)
  • 📉 Intelligent Compression: Compresses content to the optimal duration (e.g., 19 minutes → 5 minutes)
  • 💬 Colloquial Conversion: Written language → natural spoken language
  • 😊 Emotional Optimization: Adds emotional words to make TTS more vivid
  • 🎯 Automatic Segmentation: Automatically determines the optimal number of segments based on the content (10-20 seconds per segment)
  • 📊 Duration Estimation: Precisely calculates the reading duration of each segment

How It Works

Execute in the Claude conversation:

  1. Claude reads the original document
  2. Claude analyzes the content:
    • Article topic and structure
    • Number of core viewpoints
    • Content density
    • Determines the optimal video duration (3-8 minutes)
    • Determines the most suitable illustration style (e.g., historical → Ukiyo-e, tech → flat, humanities → New Yorker)
  3. Claude intelligently rewrites:
    • Extracts core viewpoints
    • Compresses to the optimal duration
    • Converts to colloquial expression
    • Adds emotional words and pauses
  4. Claude automatically segments (each segment suitable for one illustration)
  5. Determines the most suitable illustration style based on the article topic
  6. Generates an illustration description for each segment (using the determined style)
  7. Outputs two files:
    • tts_script.json (TTS text script + animation markers)
    • visual_config.json (illustration descriptions, for use by illustration-generator)

tts_script.json format (newly added animation markers):

[
  {
    "segment": 1,
    "text": "今天聊聊唐朝真实生活。想穿越?先等等!",
    "duration": 15,
    "animation_style": "fade_in",
    "emphasis": true
  },
  {
    "segment": 2,
    "text": "唐朝可没卫生纸,上厕所用什么?",
    "duration": 12,
    "animation_style": "none",
    "emphasis": false
  }
]

Animation marker rules (Claude intelligent decision-making):

  • animation_style:
    • "fade_in" - Title, opening, key emphasis
    • "write" - Core viewpoints, key conclusions
    • "typewriter" - Data, factual statements
    • "none" - Regular content (uses ASS subtitles)
  • emphasis: Whether it is a key segment (true/false)

Decision principles:

  1. Segment 1 (opening) → fade_in
  2. Core viewpoints (the 1st segment of each chapter) → write
  3. Data/facts → typewriter
  4. Other content → none(ASS subtitles)
  5. Suggestion: Out of 24 segments, 3-5 segments using animation is sufficient

Execute Script

generate.py - generates the TTS script

python ~/.claude/skills/tts-script-generator/scripts/generate.py <markdown文件>
  • Reads the Markdown file
  • Extracts H2 chapters
  • Converts to colloquial language
  • Splits by duration
  • Outputs tts_script.json

Use Cases

  1. Video voiceover: Works with image-to-video (primary use)
  2. Podcast generation: Works with podcast-generator

Output Description

This skill outputs:

  • ✅ tts_script.json - TTS text script
  • ✅ visual_config.json - Illustration descriptions

Does not include:

  • ❌ TTS audio generation (handled by the image-to-video skill)
  • ❌ Illustration generation (requires calling the illustration-generator skill)
  • ❌ Video composition (requires calling the image-to-video skill)

How to Invoke

Automatically invoked by the image-to-video skill:

image-to-video 检测到长文档 
  → 调用 tts-script-generator
  → Claude 在对话中改写
  → 输出压缩后的 TTS 脚本
  → image-to-video 继续处理

Manual invocation (in a Claude conversation):

用户: "请用 tts-script-generator 改写这篇文章"

Claude: 
1. 读取文档(5947 字,19 分钟)
2. 分析内容:
   - 主题:唐朝生活科普(历史人文类)
   - 核心观点:4个(卫生、饮食、管制、阶级)
   - 判断最佳时长:5 分钟(内容密度适中)
   - 判断配图风格:浮世绘风格(历史题材,东方古典美学)
3. 改写为 1350 字
4. 分成 20 段(每段 15 秒)
5. 为每段生成浮世绘风格配图描述
6. 保存 tts_script.json + visual_config.json

Output Format

tts_script.json

[
  {
    "segment": 1,
    "text": "今天聊聊唐朝真实生活。想穿越?先等等!唐朝可没卫生纸...",
    "duration": 15
  }
]

visual_config.json

{
  "article_title": "穿越唐朝的真相",
  "style": "ukiyo-e",
  "sections": [
    {
      "section": 1,
      "visual_description": "A person standing at a crossroads between modern city and ancient Tang Dynasty palace, looking confused, ukiyo-e style with traditional Japanese woodblock print aesthetics"
    }
  ]
}

Illustration Style Decision Rules

Claude will automatically choose the most suitable style based on the article's topic:

  • History/Classical → ukiyo-e(ukiyo-e): Tang Dynasty, Song Dynasty, Japanese history, etc.
  • Humanities/Society → new-yorker(New Yorker): social observation, personal stories, etc.
  • Technology/Business → flat(flat style): tech products, business analysis, etc.
  • Nature/Travel → realistic(realistic style): landscapes, animals, travel, etc.
  • Art/Creativity → abstract(abstract style): art criticism, creative thinking, etc.

Rewriting Principles

  1. Preserve the core: keep the most important viewpoints and stories
  2. Colloquialize:
    • "但是" → "但是呢"
    • "因为...所以..." → "为什么呢?因为..."
    • Add modal particles: "啊", "呢", "吧"
  3. Emotional words:
    • Emphasis: "真的", "非常", "特别"
    • Exclamation: "哇", "天哪", "想象一下"
  4. Pacing control:
    • Mainly short sentences
    • Appropriate pauses
    • One core point per paragraph

Can Be Invoked By

  • image-to-video skill (primary)
  • podcast-generator skill
  • Other skills that need TTS