Skip to content

norahe0304-art/30x-video / cli/skill

30x-web-to-video

Flagged

Use when a user gives a brand URL and wants a premium launch, demo, or marketing video. Zero-manual workflow — Claude runs the V2 orchestrator itself (scrapes brand evidence, auto-installs missing tools, generates the first-cut Remotion project). User only sees the URL and the Studio preview.

FileKindSize
.gitignoreother103 B
AGENTS.mdmarkdown2.5 KB
FUSION-REPORT.mdmarkdown12.3 KB
README.mdmarkdown3.6 KB
SKILL.mdskill md30.7 KB
benchmarks/AGENTS.mdmarkdown773 B
benchmarks/README.mdmarkdown2.8 KB
benchmarks/manifest.jsonconfig5.9 KB
examples/INDEX.mdmarkdown1.8 KB
examples/caylent/MainVideo.tsxother6.0 KB
examples/caylent/scenes-v2/Act1V2.tsxother1.9 KB
examples/caylent/scenes-v2/Act2V2.tsxother2.5 KB
examples/caylent/scenes-v2/Act3V2.tsxother11.3 KB
examples/caylent/scenes-v2/Act4V2.tsxother8.6 KB
examples/caylent/scenes-v2/Act5V2.tsxother1.0 KB
examples/caylent/scenes/Act1.tsxother6.0 KB
examples/caylent/scenes/Act2.tsxother2.5 KB
examples/caylent/scenes/Act3.tsxother7.4 KB
examples/caylent/scenes/Act4.tsxother7.1 KB
examples/caylent/scenes/Act5.tsxother2.2 KB
examples/caylent/theme.tsscript1.2 KB
examples/cofounder/MainVideo.tsxother5.5 KB
examples/cofounder/scenes/AGENTS.mdmarkdown1.4 KB
examples/cofounder/scenes/Act1.tsxother2.3 KB
examples/cofounder/scenes/Act2.tsxother2.4 KB
examples/cofounder/scenes/Act3a.tsxother6.7 KB
examples/cofounder/scenes/Act3b.tsxother8.5 KB
examples/cofounder/scenes/Act3c.tsxother6.8 KB
examples/cofounder/scenes/Act4.tsxother4.4 KB
examples/cofounder/scenes/Act5.tsxother3.3 KB
examples/cofounder/scenes/World.tsxother4.0 KB
examples/cofounder/theme.tsscript1.5 KB
examples/happy-model/MainVideo.tsxother6.8 KB
examples/happy-model/scenes/AGENTS.mdmarkdown1.7 KB
examples/happy-model/scenes/Act1.tsxother7.9 KB
examples/happy-model/scenes/Act2.tsxother10.2 KB
examples/happy-model/scenes/Act3.tsxother15.6 KB
examples/happy-model/scenes/Act4.tsxother16.9 KB
examples/happy-model/scenes/Act5.tsxother9.0 KB
examples/happy-model/scenes/copy.tsscript588 B
examples/happy-model/theme.tsscript1.2 KB
examples/mana/MainVideo.tsxother4.9 KB
examples/mana/scenes/AGENTS.mdmarkdown926 B
examples/mana/scenes/Act1Open.tsxother2.8 KB
examples/mana/scenes/Act2Hero.tsxother3.3 KB
examples/mana/scenes/Act3Flavors.tsxother9.0 KB
examples/mana/scenes/Act4Label.tsxother7.3 KB
examples/mana/scenes/Act5Close.tsxother4.7 KB
examples/mana/scenes/World.tsxother7.2 KB
examples/mana/theme.tsscript2.6 KB
examples/parker/MainVideo.tsxother6.2 KB
examples/parker/scenes/AGENTS.mdmarkdown1.1 KB
examples/parker/scenes/Act1Hook.tsxother3.2 KB
examples/parker/scenes/Act2Meet.tsxother2.3 KB
examples/parker/scenes/Act2Problem.tsxother3.6 KB
examples/parker/scenes/Act3Steps.tsxother4.7 KB
examples/parker/scenes/Act4Proof.tsxother3.2 KB
examples/parker/scenes/Act5Close.tsxother2.6 KB
examples/parker/scenes/PaperWorld.tsxother6.8 KB
examples/parker/theme.tsscript1.6 KB
examples/perplexity-pc/MainVideo.tsxother4.5 KB
examples/perplexity-pc/scenes/Act1.tsxother2.1 KB
examples/perplexity-pc/scenes/Act2.tsxother2.7 KB
examples/perplexity-pc/scenes/Act3.tsxother3.1 KB
examples/perplexity-pc/scenes/Act4.tsxother1.6 KB
examples/perplexity-pc/scenes/Act5.tsxother2.0 KB
examples/perplexity-pc/theme.tsscript2.5 KB
references/AGENTS.mdmarkdown767 B
references/animations.mdmarkdown15.1 KB
references/audio.mdmarkdown8.6 KB
references/components.mdmarkdown9.5 KB
references/lottie.mdmarkdown5.1 KB
references/visual-effects.mdmarkdown5.0 KB
rules/AGENTS.mdmarkdown3.0 KB
rules/archetypes.mdmarkdown6.0 KB
rules/artifact-catalog.mdmarkdown10.8 KB
rules/beat-sync.mdmarkdown5.7 KB
rules/cards.mdmarkdown2.5 KB
rules/cinematic.mdmarkdown6.7 KB
rules/color.mdmarkdown2.2 KB
rules/composition.mdmarkdown13.2 KB
rules/creative-moves.mdmarkdown3.8 KB
rules/data-viz.mdmarkdown1.9 KB
rules/finish-gate.mdmarkdown5.2 KB
rules/layout.mdmarkdown6.6 KB
rules/media-resolve.mdmarkdown7.1 KB
rules/motion.mdmarkdown9.5 KB
rules/narration-sync.mdmarkdown5.5 KB
rules/narrative-templates.mdmarkdown10.4 KB
rules/narrative.mdmarkdown7.3 KB
rules/qc-gates.mdmarkdown11.3 KB
rules/taste.mdmarkdown12.6 KB
rules/transitions.mdmarkdown2.7 KB
rules/typography.mdmarkdown4.1 KB
rules/ui-mockups.mdmarkdown5.6 KB
rules/workflow.mdmarkdown53.2 KB
scaffold/.prettierrcother66 B
scaffold/AGENTS.mdmarkdown1.1 KB
scaffold/eslint.config.mjsscript79 B
scaffold/package-lock.jsonmanifest186.3 KB
scaffold/package.jsonmanifest1.5 KB
scaffold/remotion.config.tsscript219 B
scaffold/src/AGENTS.mdmarkdown831 B
scaffold/src/MainVideo.tsxother41.7 KB
scaffold/src/Root.tsxother2.3 KB
scaffold/src/components/AGENTS.mdmarkdown1.5 KB
scaffold/src/components/Animations.tsxother6.8 KB
scaffold/src/components/Atmosphere.tsxother8.1 KB
scaffold/src/components/Background.tsxother4.5 KB
scaffold/src/components/Captions.tsxother6.4 KB
scaffold/src/components/LogoEntrance.tsxother15.2 KB
scaffold/src/components/MockupTemplates.tsxother19.0 KB
scaffold/src/components/PhoneFrame.tsxother3.6 KB
scaffold/src/components/ShaderFX.tsxother5.3 KB
scaffold/src/components/Transitions.tsxother8.4 KB
scaffold/src/components/UI.tsxother3.0 KB
scaffold/src/components/VisualEffects.tsxother10.7 KB
scaffold/src/generated/AGENTS.mdmarkdown508 B
scaffold/src/generated/beat-map.tsscript1.1 KB
scaffold/src/generated/project-data.tsscript5.2 KB
scaffold/src/index.cssother576 B
scaffold/src/index.tsscript400 B
scaffold/src/lib/AGENTS.mdmarkdown411 B
scaffold/src/lib/fonts.tsscript867 B
scaffold/src/lib/modes.tsscript2.2 KB
scaffold/src/lib/utils.tsscript352 B
scaffold/src/theme.tsscript2.5 KB
scaffold/tsconfig.jsonconfig333 B
scripts/AGENTS.mdmarkdown2.4 KB
scripts/analyze-audiomap.pyscript13.3 KB
scripts/beat-sync.tsscript12.1 KB
scripts/benchmark-suite.tsscript17.8 KB
scripts/critique-scenes.tsscript10.1 KB
scripts/evidence-model.tsscript9.4 KB
scripts/generate-bgm.pyscript10.5 KB
scripts/iterate.tsscript4.0 KB
scripts/project-blueprint.tsscript12.1 KB
scripts/regenerate-scene.tsscript7.4 KB
scripts/render-qa.tsscript9.0 KB
scripts/scene-constitution.tsscript13.4 KB
scripts/timing-audit.tsscript9.5 KB
scripts/url-to-video.tsscript68.6 KB
scripts/visual-audit.tsscript26.5 KB

scripts/analyze-audiomap.py

View on GitHub
#!/usr/bin/env python3
"""Music-map analyzer — BGM → audiomap.json (the one canonical timing analysis).

[INPUT]: BGM audio file (anything ffmpeg decodes); librosa+numpy+soundfile (self-installed
         via pip preflight); aubiotrack as the degraded fallback when install fails
[OUTPUT]: audiomap.json at the project root — bpm, beats_sec, energy curve, onsets,
          silences, energy_phases (+density), key_moments, hard_stops, rolls, and a
          rhythmic true/false verdict with its evidence
[POS]: scripts/ 的音乐地图分析器 — beat-sync.ts (脉冲常量) 的上游真相源;
       rules/beat-sync.md 消费本输出决定转场落点; 从 hyperframes music-to-video
       的 analyze-beatgrid.py 移植 (见 FUSION-REPORT.md)
[PROTOCOL]: 变更时更新此头部,然后检查 AGENTS.md

Usage:
    python3 scripts/analyze-audiomap.py <audio> [--output audiomap.json] [--print] [--no-install]

Design law (inherited from the source skill, verbatim in spirit):
  ONE analyzer, and you trust it. Never re-measure beats with another tool or by ear.
  energy / density / onsets / silences are reliable on ANY music; bpm / beats_sec are
  reliable ONLY when `rhythmic: true` — on calm music the beat grid is a metronome the
  tracker imposed, so pace by energy phases and silences instead and never hard-cut to it.

Degraded mode (librosa unavailable, aubiotrack present):
  audiomap carries bpm + beats_sec only; every other field is null and `rhythmic` is
  false — downstream must treat the grid as untrusted.
"""

from __future__ import annotations

import argparse
import importlib
import json
import subprocess
import sys
import tempfile
from pathlib import Path

SR = 22050
HOP = 512  # ~23 ms frames
AUDIOMAP_VERSION = 1

# ── 节奏可信判定阈值 (源 skill "genuinely rhythmic" 思路的量化) ──────────────
RHYTHM_MAX_BEAT_CV = 0.12        # 拍间隔变异系数: 稳定网格才可信
RHYTHM_MIN_BEAT_SUPPORT = 0.50   # ≥50% 的拍点附近有真实 onset (70ms 窗)
RHYTHM_MIN_ONSET_RATE = 0.8      # onset/秒: 太稀疏 = 平缓音乐
BEAT_SUPPORT_WINDOW = 0.07


# ── preflight: 自装依赖, 装不上走 aubiotrack 降级 ────────────────────────────
def ensure_librosa(allow_install: bool) -> bool:
    try:
        import librosa  # noqa: F401
        return True
    except ImportError:
        pass
    if not allow_install:
        return False
    pkgs = ["librosa", "numpy", "soundfile"]
    for extra in ([], ["--break-system-packages"], ["--user"]):
        try:
            subprocess.run(
                [sys.executable, "-m", "pip", "install", "--quiet", *extra, *pkgs],
                check=True, capture_output=True,
            )
            importlib.invalidate_caches()
            import librosa  # noqa: F401
            return True
        except Exception:
            continue
    return False


# ── degraded path: aubiotrack → bpm + beats only, rhythm untrusted ──────────
def analyze_fallback(path: str) -> dict:
    raw = subprocess.run(
        ["aubiotrack", "-i", path], capture_output=True, text=True, check=True
    ).stdout
    beats = [float(x) for x in raw.split() if x.strip()]
    beats = [b for b in beats if b > 0]
    if len(beats) < 4:
        raise SystemExit("aubiotrack fallback found <4 beats — no usable analysis")
    diffs = [b - a for a, b in zip(beats, beats[1:]) if 0.25 <= b - a <= 1.2]
    interval = sorted(diffs)[len(diffs) // 2] if diffs else 0.5
    dur = float(subprocess.run(
        ["ffprobe", "-v", "quiet", "-show_entries", "format=duration", "-of", "csv=p=0", path],
        capture_output=True, text=True, check=True,
    ).stdout.strip())
    return {
        "version": AUDIOMAP_VERSION,
        "source": "aubiotrack-fallback",
        "audio": {"path": path, "duration_sec": round(dur, 3), "sr": None},
        "bpm": round(60.0 / interval, 1),
        "beats_sec": [round(b, 3) for b in beats],
        "downbeats_sec": None,
        "rhythmic": False,
        "rhythm": {
            "beat_cv": None, "beat_onset_support": None, "onset_rate": None,
            "reason": "degraded: librosa unavailable — grid from aubiotrack only, rhythm untrusted",
        },
        "energy": None,
        "energy_phases": None,
        "key_moments": None,
        "hard_stops": None,
        "rolls": None,
        "silences": None,
        "onsets_sec": None,
        "summary": f"DEGRADED · {round(60.0 / interval)} BPM · {len(beats)} beats · {dur:.1f}s · rhythm untrusted",
    }


# ── full path (librosa) ──────────────────────────────────────────────────────
def load_audio(path: str):
    import librosa  # local import: only reached after preflight
    import soundfile as sf
    with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
        wav = tmp.name
    subprocess.run(
        ["ffmpeg", "-y", "-i", path, "-ac", "1", "-ar", str(SR), wav],
        capture_output=True, check=True,
    )
    y, sr = sf.read(wav, dtype="float32")
    Path(wav).unlink(missing_ok=True)
    if y.ndim > 1:
        y = y.mean(axis=1)
    return y, sr, len(y) / sr


def energy_structure(y, sr, dur: float) -> dict:
    """RMS @1s → normalized curve, level phases, SURGE/DROP moments, hard stops."""
    import librosa
    import numpy as np
    rms = librosa.feature.rms(y=y, hop_length=sr)[0]
    norms = (rms / (rms.max() + 1e-9)).tolist()

    def lvl(n):
        return "VOID" if n < 0.2 else "LOW" if n < 0.4 else "MEDIUM" if n < 0.65 else "HIGH"

    phases, cur, cs = [], None, 0
    for i, n in enumerate(norms):
        l = lvl(n)
        if l != cur:
            if cur:
                phases.append({"s": cs, "e": i, "lvl": cur})
            cur, cs = l, i
    if cur:
        phases.append({"s": cs, "e": len(norms), "lvl": cur})

    moments = []
    for i in range(1, len(norms)):
        d = norms[i] - norms[i - 1]
        if abs(d) > 0.12:
            moments.append({"t": i, "kind": "DROP" if d < 0 else "SURGE", "delta": round(d, 2)})
    moments.sort(key=lambda m: abs(m["delta"]), reverse=True)
    hard_stops = [m for m in moments if m["kind"] == "DROP" and m["t"] > dur * 0.6 and m["delta"] < -0.25]

    phases_sec = []
    for p in phases:
        seg = norms[p["s"]:max(p["s"] + 1, p["e"])]
        phases_sec.append({
            "start": float(p["s"]),
            "end": float(min(p["e"], round(dur, 1))),
            "level": p["lvl"],
            "energy": round(float(np.mean(seg)) if seg else 0.0, 2),
        })
    return {"norms": [round(n, 2) for n in norms], "phases": phases_sec,
            "moments": moments[:8], "hard_stops": hard_stops}


ROLL_MIN_HITS = 4
ROLL_CONT = 0.55    # × beat_dur: gap up to ~half a beat keeps a run alive
ROLL_ACCEPT = 0.42  # × beat_dur: mean spacing denser than an 8th note counts
ROLL_DEDUP = 0.08   # merge onsets closer than a 32nd (double-trigger)
ROLL_MAX_BEATS = 8  # a run longer than 2 bars is the groove itself, not a fill


def detect_rolls(onsets: list, beat_dur: float) -> list:
    """Localized runs of >=4 onsets whose MEAN spacing beats an 8th note — cascade/stagger
    cues. A run spanning more than ~2 bars is the track's own groove, not a fill: discard."""
    times = []
    for t in onsets:
        if times and t - times[-1] <= ROLL_DEDUP:
            continue
        times.append(t)
    cont, accept = beat_dur * ROLL_CONT, beat_dur * ROLL_ACCEPT
    rolls, i, n = [], 0, len(times)
    while i < n - 1:
        j = i
        while j + 1 < n and (times[j + 1] - times[j]) <= cont:
            j += 1
        if j - i + 1 >= ROLL_MIN_HITS:
            gaps = [times[k + 1] - times[k] for k in range(i, j)]
            t0, t1 = times[i], times[j]
            if sum(gaps) / len(gaps) <= accept and (t1 - t0) <= beat_dur * ROLL_MAX_BEATS:
                rolls.append({
                    "start": round(t0, 3), "end": round(t1, 3),
                    "hits": j - i + 1,
                    "rate_per_min": round((j - i) / max(t1 - t0, 1e-6) * 60),
                    "kind": "sustained-fill" if t1 - t0 > 1.2 else "fill",
                })
        i = j + 1
    return rolls


def phase_density(phases: list, onsets: list) -> None:
    """Attach onset count + density verdict to each energy phase (facts, not timing)."""
    for s in phases:
        cnt = sum(1 for t in onsets if s["start"] <= t < s["end"])
        span = max(1e-6, s["end"] - s["start"])
        s["onsets"] = cnt
        s["onset_rate"] = round(cnt / span, 1)
        s["density"] = ("sparse" if s.get("energy", 0) < 0.2 or cnt < 6
                        else "dense" if cnt >= 18 else "medium")


def judge_rhythm(beats, onsets, dur: float) -> dict:
    """Is the beat grid REAL, or a metronome the tracker imposed on calm music?"""
    import numpy as np
    diffs = np.diff(beats) if len(beats) > 2 else np.array([])
    beat_cv = float(np.std(diffs) / (np.mean(diffs) + 1e-9)) if len(diffs) else 1.0
    supported = sum(
        1 for b in beats if any(abs(b - t) <= BEAT_SUPPORT_WINDOW for t in onsets)
    )
    support = supported / max(1, len(beats))
    onset_rate = len(onsets) / max(1e-6, dur)

    checks = {
        "steady grid": beat_cv <= RHYTHM_MAX_BEAT_CV,
        "onsets back the grid": support >= RHYTHM_MIN_BEAT_SUPPORT,
        "enough events": onset_rate >= RHYTHM_MIN_ONSET_RATE,
    }
    failed = [k for k, ok in checks.items() if not ok]
    return {
        "rhythmic": not failed,
        "beat_cv": round(beat_cv, 3),
        "beat_onset_support": round(support, 2),
        "onset_rate": round(onset_rate, 2),
        "reason": "all checks passed" if not failed else "failed: " + ", ".join(failed),
    }


def analyze(path: str) -> dict:
    import librosa
    import numpy as np
    y, sr, dur = load_audio(path)
    tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr, hop_length=HOP, units="frames")
    beats = librosa.frames_to_time(beat_frames, sr=sr, hop_length=HOP).tolist()
    bpm = float(np.atleast_1d(tempo)[0])
    onsets = librosa.onset.onset_detect(
        y=y, sr=sr, hop_length=HOP, units="time", backtrack=True
    ).tolist()

    es = energy_structure(y, sr, dur)
    phase_density(es["phases"], onsets)
    silences = [{"start": p["start"], "end": p["end"]} for p in es["phases"] if p["level"] == "VOID"]
    beat_dur = float(np.median(np.diff(beats))) if len(beats) > 1 else 60.0 / max(bpm, 1e-6)
    rolls = detect_rolls(onsets, beat_dur)
    rhythm = judge_rhythm(beats, onsets, dur)
    downbeats = [round(float(beats[i]), 3) for i in range(0, len(beats), 4)]

    verdict = "rhythmic" if rhythm["rhythmic"] else "NOT rhythmic (pace by energy/silence)"
    return {
        "version": AUDIOMAP_VERSION,
        "source": "librosa",
        "audio": {"path": path, "duration_sec": round(dur, 3), "sr": sr},
        "bpm": round(bpm, 1),
        "beats_sec": [round(float(b), 3) for b in beats],
        "downbeats_sec": downbeats,
        "rhythmic": rhythm["rhythmic"],
        "rhythm": rhythm,
        "energy": es["norms"],
        "energy_phases": es["phases"],
        "key_moments": es["moments"],
        "hard_stops": es["hard_stops"],
        "rolls": rolls,
        "silences": silences,
        "onsets_sec": [round(float(t), 3) for t in onsets],
        "summary": (f"{bpm:.0f} BPM · {len(beats)} beats · {len(onsets)} onsets · "
                    f"{len(es['phases'])} energy phases · {len(silences)} silences · "
                    f"{dur:.1f}s · {verdict}"),
    }


def print_brief(d: dict) -> None:
    print(f"\n{d['summary']}\n{'=' * 70}")
    r = d.get("rhythm") or {}
    print(f"RHYTHM  rhythmic={d['rhythmic']}  cv={r.get('beat_cv')}  "
          f"support={r.get('beat_onset_support')}  onset_rate={r.get('onset_rate')}  ({r.get('reason')})")
    for s in d.get("energy_phases") or []:
        print(f"  {s['start']:5.1f}-{s['end']:5.1f}s  {s['level']:6s}  "
              f"energy={s['energy']}  {s.get('density', '?')} ({s.get('onsets', '?')} onsets)")
    print(f"KEY MOMENTS: {[(m['t'], m['kind'], m['delta']) for m in d.get('key_moments') or []]}")
    print(f"HARD STOPS:  {[h['t'] for h in d.get('hard_stops') or []]}")
    print(f"ROLLS:       {[(x['start'], x['end'], x['kind']) for x in d.get('rolls') or []]}")
    print(f"SILENCES:    {[(s['start'], s['end']) for s in d.get('silences') or []]}")


def main() -> None:
    ap = argparse.ArgumentParser(description="BGM → audiomap.json (one analyzer, trust it)")
    ap.add_argument("audio")
    ap.add_argument("-o", "--output", default="audiomap.json")
    ap.add_argument("--print", action="store_true", dest="do_print")
    ap.add_argument("--no-install", action="store_true", help="skip pip preflight; degrade to aubiotrack")
    a = ap.parse_args()

    if not Path(a.audio).exists():
        raise SystemExit(f"audio file not found: {a.audio}")

    if ensure_librosa(allow_install=not a.no_install):
        d = analyze(a.audio)
    else:
        print("[analyze-audiomap] librosa unavailable — degrading to aubiotrack "
              "(bpm+beats only, rhythm untrusted)", file=sys.stderr)
        d = analyze_fallback(a.audio)

    Path(a.output).write_text(json.dumps(d, ensure_ascii=False, indent=2))
    print(f"[analyze-audiomap] wrote {a.output} · {d['summary']}", file=sys.stderr)
    if a.do_print:
        print_brief(d)


if __name__ == "__main__":
    main()
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall