Skip to content

MiniMax-AI/mcode-stack / stacks/jiachen/skills/making-content

making-content

Unverified

Content production in three modes: rewrite, Xiaohongshu (小红书) image post, short video. Rewrite (default): turns an AI-sounding Chinese or mixed Chinese-English draft (post, newsletter, engineering blog, commentary) into the author's restrained style: few emoji, short paragraphs, hedged claims, neutral wording, English terms split by spaces. Triggers: 按我的风格改, 去 AI 味, 润色, 改改这篇, or a vague 帮我改改 when the context is a structured draft. Also for a Xiaohongshu image post from scratch (title, cover, cards, body, hooks); read references/xhs-post.md first. Also turns a document, research, notes or an article into a 60-180 s vertical video (抖音, 小红书, 视频号, B站: real sources, voice-over, captions, cover). Triggers: 做成视频, 做个短视频, 剪个 90 秒版本, 配音, 换成我的声音, or complaints of 字太密, AI 味太重, 容易走神; read references/video-pipeline.md first.

scripts/render.py

View on GitHub
#!/usr/bin/env python3
"""Render the compositor page frame by frame into an H.264 mp4 (or preview stills).

    python3 render.py --stills            # the settled last frame of every shot + sheet.jpg contact sheet
    python3 render.py --stills 0.5 12 40  # specific times
    python3 render.py --out final.mp4     # full video with mix.wav, loudness-normalised
    python3 render.py --cover cover.html --out cover.png   # screenshot a static cover page

The compositor is copied into the project dir on first run (compositor.html) so a project can
tweak layouts without touching the skill. Run from the project dir (fonts/, logos/, shots/ live there).
"""
import argparse, glob, json, os, shutil, subprocess, sys
from playwright.sync_api import sync_playwright

FPS = 30               # platform-native frame rate; 60 doubles render time for no visible gain on slides and zooms
JPEG_Q = 92            # frames travel as JPEG to ffmpeg; 92 is visually lossless for flat graphics
CRF = 21               # ~10-20 MB for 90 s of 1080x1920 graphics; chat uploads cap at 30 MB
LOUDNESS = 'loudnorm=I=-14:TP=-1.5:LRA=11'   # common short-video target (-14 LUFS)
HERE = os.path.dirname(os.path.abspath(__file__))


def open_page(p, page, tl, idx):
    b = p.chromium.launch(args=['--allow-file-access-from-files'])
    pg = b.new_page(viewport={'width': 1080, 'height': 1920})
    errors = []; pg.on('pageerror', lambda e: errors.append(str(e)))
    pg.goto('file://' + os.path.abspath(page))
    try:
        pg.evaluate('([tl, idx]) => setup(tl, idx)', [tl, idx])
    except Exception as e:
        sys.exit(f'compositor setup failed: {e}\n{errors}')
    return b, pg


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('--page', default='compositor.html'); ap.add_argument('--timeline', default='timeline.json')
    ap.add_argument('--captures', default='shots/index.json'); ap.add_argument('--audio', default='mix.wav')
    ap.add_argument('--out', default='video.mp4'); ap.add_argument('--stills', nargs='*', type=float)
    ap.add_argument('--cover', help='static HTML page to screenshot at 1080x1920 (see templates/cover.html)')
    a = ap.parse_args()
    if a.cover:
        with sync_playwright() as p:
            b = p.chromium.launch(args=['--allow-file-access-from-files']); pg = b.new_page(viewport={'width': 1080, 'height': 1920})
            pg.goto('file://' + os.path.abspath(a.cover)); pg.evaluate('document.fonts.ready'); pg.wait_for_timeout(300)
            pg.screenshot(path=a.out); b.close()
        print('->', a.out); return
    if not os.path.exists(a.page):
        shutil.copy(os.path.join(HERE, 'compositor.html'), a.page); print('copied compositor.html into the project')
    tl = json.load(open(a.timeline)); idx = json.load(open(a.captures)) if os.path.exists(a.captures) else {}
    with sync_playwright() as p:
        b, pg = open_page(p, a.page, tl, idx)
        if a.stills is not None:
            ts = a.stills or [s['end'] - 0.35 for s in tl['shots']]   # settled end state of every shot
            os.makedirs('stills', exist_ok=True)
            for f in glob.glob('stills/*.png'):
                os.remove(f)
            for k, t in enumerate(ts):
                pg.evaluate(f'render({t})'); pg.screenshot(path=f'stills/{k:02d}.png')
            b.close()
            from PIL import Image
            fs = sorted(glob.glob('stills/*.png')); W, H, cols = 240, 427, min(9, len(fs)); rows = -(-len(fs) // cols)
            sheet = Image.new('RGB', (W * cols, H * rows), 'white')
            for k, f in enumerate(fs):
                sheet.paste(Image.open(f).convert('RGB').resize((W, H)), ((k % cols) * W, (k // cols) * H))
            sheet.save('sheet.jpg', quality=88); print(f'{len(fs)} stills -> stills/, sheet.jpg')
            return
        n = int(tl['total'] * FPS)
        ff = subprocess.Popen(['ffmpeg', '-y', '-v', 'error', '-f', 'image2pipe', '-framerate', str(FPS), '-c:v', 'mjpeg', '-i', '-',
                               '-i', a.audio, '-af', LOUDNESS, '-c:v', 'libx264', '-preset', 'medium', '-crf', str(CRF), '-pix_fmt', 'yuv420p',
                               '-r', str(FPS), '-c:a', 'aac', '-b:a', '192k', '-ar', '48000', '-shortest', '-movflags', '+faststart', a.out],
                              stdin=subprocess.PIPE)
        for i in range(n):
            pg.evaluate(f'render({i / FPS})'); ff.stdin.write(pg.screenshot(type='jpeg', quality=JPEG_Q))
            if i % (FPS * 20) == 0:
                print(f'{i}/{n} frames', flush=True)
        ff.stdin.close(); code = ff.wait(); b.close()
        if code:
            sys.exit(f'ffmpeg exited {code}')
        print('->', a.out, f'{os.path.getsize(a.out) / 1e6:.1f} MB')


if __name__ == '__main__':
    main()
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: 195kUpdated 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: 118kUpdated 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: 117kUpdated Claude CodeCodexUnverifiedInstall
paperclip-pagepaperclipai/paperclipPublish static HTML pages and asset folders to the Paperclip S3/CloudFront page host. Use when asked to deploy, host, or share a persistent page, viewer, prototype, report, or static site without here.now.Stars: 114kUpdated Claude CodeCodexVerifiedInstall