nexu-io/openmotion / library/design/skills/chat-motion-overlay
chat-motion-overlay
VerifiedGenerate configurable chat motion overlays from a transcript or screenshot, including plain bubble scenes, app-style chat containers, optional device frames, preset or uploaded avatars, nickname display rules, and transparent-video-ready Remotion bundles. Use when Codex needs to create reusable short-form chat clips for Douyin, demo videos, story reenactments, social-message proof scenes, or embeddable alpha overlays for Hyperframe and Remotion workflows.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.7 KB |
| agents/openai.yaml | config | 315 B |
| assets/examples/chat-transcript.txt | markdown | 273 B |
| assets/examples/config-wechat-phone.json | config | 363 B |
| assets/remotion-template/package.json | manifest | 689 B |
| assets/remotion-template/remotion.config.ts | script | 180 B |
| assets/remotion-template/src/chatSpec.ts | script | 426 B |
| assets/remotion-template/src/components/types.ts | script | 1.1 KB |
| assets/remotion-template/src/index.ts | script | 105 B |
| assets/remotion-template/tsconfig.json | config | 307 B |
| references/config-schema.md | markdown | 2.2 KB |
| references/input-format.md | markdown | 2.9 KB |
| references/output-modes.md | markdown | 1.6 KB |
| references/question-strategy.md | markdown | 2.5 KB |
| references/test-matrix.md | markdown | 6.5 KB |
| references/test-report.md | markdown | 7.1 KB |
| scripts/build_chat_overlay_spec.py | script | 10.4 KB |
| scripts/prepare_chat_overlay_bundle.py | script | 4.4 KB |
| scripts/run_test_matrix.py | script | 21.5 KB |
scripts/prepare_chat_overlay_bundle.py
View on GitHub#!/usr/bin/env python3
from __future__ import annotations
import argparse
import json
import shutil
from pathlib import Path
from build_chat_overlay_spec import build_spec, load_config, parse_transcript
BUNDLE_MARKER = ".chat-motion-overlay-bundle"
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Prepare a renderable Remotion chat overlay bundle.")
parser.add_argument("--transcript", required=True, help="Path to transcript text file")
parser.add_argument("--config", help="Path to scene config JSON")
parser.add_argument("--output-dir", required=True, help="Directory to create the Remotion bundle in")
parser.add_argument("--force", action="store_true", help="Overwrite the output directory if it exists")
return parser.parse_args()
def script_dir() -> Path:
return Path(__file__).resolve().parent
def skill_root() -> Path:
return script_dir().parent
def template_dir() -> Path:
return skill_root() / "assets" / "remotion-template"
def avatar_library_dir() -> Path:
return skill_root() / "assets" / "avatar-library"
def repo_root() -> Path:
return skill_root().parent.parent
def bundle_marker_path(output_dir: Path) -> Path:
return output_dir / BUNDLE_MARKER
def validate_output_dir(output_dir: Path, force: bool) -> None:
dangerous_targets = {
Path.cwd().resolve(),
Path.home().resolve(),
repo_root(),
skill_root(),
template_dir(),
}
if output_dir in dangerous_targets:
raise SystemExit(
f"Refusing to use dangerous output directory: {output_dir}. "
"Choose a dedicated generated-bundle directory instead."
)
if output_dir.exists() and force and not bundle_marker_path(output_dir).exists():
raise SystemExit(
f"Refusing to overwrite unmanaged output directory: {output_dir}. "
f"Only directories containing {BUNDLE_MARKER} can be replaced with --force."
)
def copy_template(output_dir: Path, force: bool) -> None:
validate_output_dir(output_dir, force)
if output_dir.exists():
if not force:
raise SystemExit(f"Output directory already exists: {output_dir}. Use --force to overwrite.")
shutil.rmtree(output_dir)
shutil.copytree(template_dir(), output_dir)
bundle_marker_path(output_dir).write_text("generated by chat-motion-overlay\n", encoding="utf-8")
def write_chat_spec_ts(spec: dict, output_dir: Path) -> None:
target = output_dir / "src" / "chatSpec.ts"
content = "export const chatSpec = " + json.dumps(spec, ensure_ascii=False, indent=2) + " as const;\n"
target.write_text(content, encoding="utf-8")
def remove_local_upload_paths(spec: dict) -> None:
for participant in spec["participants"]:
participant.pop("uploadPath", None)
def copy_avatar_assets(spec: dict, output_dir: Path) -> dict:
upload_sources: list[tuple[dict, Path]] = []
for participant in spec["participants"]:
upload_path = participant.get("uploadPath")
if upload_path:
source = Path(upload_path).expanduser().resolve()
if not source.exists():
raise SystemExit(
f"Configured uploadPath for participant {participant['name']} does not exist: {source}. "
"Fix the upload avatar path before preparing the bundle."
)
upload_sources.append((participant, source))
public_dir = output_dir / "public"
public_dir.mkdir(parents=True, exist_ok=True)
for preset_file in avatar_library_dir().glob("*.png"):
shutil.copy2(preset_file, public_dir / preset_file.name)
for participant, source in upload_sources:
target_name = f"{participant['id']}-upload{source.suffix.lower()}"
shutil.copy2(source, public_dir / target_name)
participant["uploadAsset"] = target_name
remove_local_upload_paths(spec)
return spec
def main() -> None:
args = parse_args()
parsed = parse_transcript(Path(args.transcript))
config = load_config(args.config)
spec = build_spec(parsed, config)
out_dir = Path(args.output_dir).resolve()
copy_template(out_dir, args.force)
try:
sanitized_spec = copy_avatar_assets(spec, out_dir)
write_chat_spec_ts(sanitized_spec, out_dir)
except BaseException:
if out_dir.exists():
shutil.rmtree(out_dir)
raise
print(f"Prepared Remotion bundle at {out_dir}")
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |