Skip to content

jianshuo/claude-skills / wjs-converting-text-to-video

wjs-converting-text-to-video

Verified

Use when the user wants a 王建硕-style WeChat article (article.md) turned into a narrated short MP4 video — TTS voiceover via 火山引擎 Volcano TTS, HyperFrames CSS/GSAP animation per scene, subtle SFX, abstract watercolor background, full pipeline rendering to 1080×1920 portrait MP4 (30-90s). Triggers — "把这篇文章做成视频", "做一个解说视频", "讲解视频", "/wjs-converting-text-to-video".

FileKindSize
SKILL.mdskill md29.8 KB
scripts/bootstrap-project.shexecutablescript2.5 KB
scripts/daily-upload-batch.shexecutablescript2.5 KB
scripts/generate-bg.shexecutablescript2.1 KB
scripts/publish-to-youtube.pyexecutablescript8.4 KB
scripts/retrofit-bg-image.pyexecutablescript3.9 KB
scripts/strip-dark-scene-bgs.pyexecutablescript3.4 KB
scripts/synth-sfx.shexecutablescript1.4 KB
scripts/tts.pyexecutablescript5.7 KB

scripts/strip-dark-scene-bgs.py

View on GitHub
#!/usr/bin/env python3
"""Strip dark scene-level background colors so bg-image (watercolor) shows through.

Keeps:
- Bright color-flip bgs (lightness ≥ 0.35 in HSL) — those are intentional A3 punches
- flash overlays, body bg, bg-image, bg-overlay, etc.

Strips:
- Dark scene bg tints (#0e0b08 family, #1a1208, #0a1428, etc.) — those cover bg-image

Also updates filter/overlay CSS values to the tuned ones (blur30 / brightness0.65 / alpha0.28).

Usage:
  strip-dark-scene-bgs.py <article-folder> [<article-folder>...]
"""
import sys, re, colorsys
from pathlib import Path

def hex_to_lightness(hex_str: str) -> float:
    h = hex_str.lstrip('#')
    if len(h) == 3:
        h = ''.join(c*2 for c in h)
    if len(h) != 6:
        return 0.0
    try:
        r = int(h[0:2], 16) / 255
        g = int(h[2:4], 16) / 255
        b = int(h[4:6], 16) / 255
    except ValueError:
        return 0.0
    _, l, _ = colorsys.rgb_to_hls(r, g, b)
    return l

def find_video_dir(arg: str) -> Path:
    p = Path(arg).resolve()
    if (p / "index.html").exists():
        return p
    if (p / "video" / "index.html").exists():
        return p / "video"
    sys.exit(f"No index.html found at {p} or {p}/video")

def strip(video_dir: Path) -> int:
    """Returns number of scene bgs stripped."""
    html_path = video_dir / "index.html"
    html = html_path.read_text()
    stripped = 0
    kept = 0

    # Find scene CSS blocks: matches `#sN { ... background: #XYZ; ... }` or similar
    # Pattern: #s<digits> with possible class/pseudo, then { stuff }
    # We only modify background declarations INSIDE these blocks.
    def process_block(match: re.Match) -> str:
        nonlocal stripped, kept
        selector = match.group(1)
        body = match.group(2)
        # Find background: #XXX; declarations
        def maybe_strip(m: re.Match) -> str:
            nonlocal stripped, kept
            hex_color = m.group(1)
            lightness = hex_to_lightness(hex_color)
            if lightness >= 0.35:
                # Bright — keep (color-flip)
                kept += 1
                return m.group(0)
            else:
                # Dark — strip
                stripped += 1
                return ''  # remove
        body = re.sub(r"background:\s*(#[0-9a-fA-F]{3,6});", maybe_strip, body)
        return f"{selector}{{{body}}}"

    # Match #s<num> [optional sub-selectors] { body }
    # Careful: body may contain nested { } — for CSS we don't expect nested
    pattern = re.compile(r"(#s\d+\b[^{]*)\{([^}]*)\}", re.MULTILINE)
    new_html = pattern.sub(process_block, html)

    # Also update tuned CSS values for bg-image / bg-overlay
    new_html = re.sub(
        r"filter:\s*blur\([^)]+\)\s*brightness\([^)]+\)\s*saturate\([^)]+\);",
        "filter: blur(30px) brightness(0.65) saturate(0.85);",
        new_html,
        count=1,
    )
    new_html = re.sub(
        r"background:\s*rgba\(14,\s*11,\s*8,\s*[\d.]+\);",
        "background: rgba(14, 11, 8, 0.28);",
        new_html,
        count=1,
    )

    if new_html != html:
        html_path.write_text(new_html)
        print(f"  ✓ {html_path}  stripped {stripped} dark bg, kept {kept} bright (color-flip)")
    else:
        print(f"  · {html_path}  no changes")
    return stripped

def main():
    if len(sys.argv) < 2:
        sys.exit(__doc__)
    for arg in sys.argv[1:]:
        vd = find_video_dir(arg)
        print(f"[strip] {vd}")
        strip(vd)

if __name__ == "__main__":
    main()
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall