MiniMax-AI/mcode-stack / stacks/jiachen/skills/making-content
making-content
UnverifiedContent 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.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 167 B |
| SKILL.md | skill md | 25.6 KB |
| evals/evals.json | config | 4.5 KB |
| references/layouts.md | markdown | 8.5 KB |
| references/text-density-lint.md | markdown | 4.2 KB |
| references/video-pipeline.md | markdown | 12.5 KB |
| references/voice-and-music.md | markdown | 5.5 KB |
| references/xhs-post.md | markdown | 9.0 KB |
| requirements.txt | manifest | 233 B |
| scripts/capture.py | script | 6.4 KB |
| scripts/compositor.html | other | 27.8 KB |
| scripts/fetch_assets.py | script | 4.0 KB |
| scripts/lint.py | script | 8.6 KB |
| scripts/render.py | script | 4.6 KB |
| scripts/timeline.py | script | 8.7 KB |
| scripts/tts.py | script | 5.5 KB |
| templates/cover.html | other | 2.9 KB |
| templates/script.example.json | config | 5.0 KB |
| templates/sources.example.json | config | 58 B |
scripts/lint.py
View on GitHub#!/usr/bin/env python3
"""Text-density lint for 1080x1920 vertical video, run against the real rendered frames.
python3 lint.py # exit 1 if anything fails
python3 lint.py --page compositor.html --timeline timeline.json --captures shots/index.json
Each shot is rendered twice (≈1 s in, and settled near its end); every visible text node is
measured. Captions are checked one by one. Thresholds and their sources are in RULES.
Text dimmed to <= 35% opacity counts as texture (code context lines, background copy) and is
skipped; an element with a data-lint-group attribute (a diagram, a list) counts as one block.
"""
import argparse, json, os, re, shutil, sys
from collections import Counter
from playwright.sync_api import sync_playwright
RULES = dict(
SAFE_L=60, SAFE_T=180, SAFE_B=1920 - 320, # TikTok/Douyin UI: 60 px edge, top tabs, bottom 320 px (caption/music/name)
SAFE_R_LOW=1080 - 120, RIGHT_RAIL_Y=850, # the like/comment/share rail covers the right 120 px of the lower half only
SAFE_R_HIGH=1020, # above the rail only the 60 px edge margin applies
CAP_TOP_MIN=1380, # captions sit low, inside the 1200-1550 band, clear of the bottom overlay
CAP_MAX_LINE=16, CAP_MAX_LINES=1, # Netflix zh-CN: 16 chars/line; short video: one line
CAP_MAX_CPS=9.0, CAP_MIN_DUR=0.6, # Netflix adult reading speed; anything shorter than 0.6 s flickers
CAP_CLEAR=60, # px of empty space above the caption
MIN_FONT=34, MIN_FONT_LABEL=26, LABEL_MAX=24, # body >= 34 px on a 1080 frame; small labels allowed if short
MAX_BLOCKS=4, # text blocks on screen besides the caption
MAX_LOAD=36, # reading load besides the caption (汉字 1, latin char 0.5)
MAX_LEVELS=3, LEVEL_STEP=1.15, # font-size levels per screen; sizes within 15% read as one level
LINE_MAX=14, # load per line for on-screen text
ORPHAN=2.6, # last line narrower than 2.6 em = a widowed character or two
TEXTURE_OPACITY=0.35, # dimmer than this is texture, not text to read
)
JS = r'''(texture) => {
const out = [], w = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT); let n;
const alpha = el => { let a = 1; for (let e = el; e && e !== document.body; e = e.parentElement) { const s = getComputedStyle(e);
if (s.display === 'none' || s.visibility === 'hidden') return 0; a *= parseFloat(s.opacity); } return a; };
while ((n = w.nextNode())) {
const t = n.data.replace(/\s+/g, ' ').trim(); if (!t) continue;
const el = n.parentElement, a = alpha(el); if (a < 0.05) continue;
const r = document.createRange(); r.selectNodeContents(n);
const rs = [...r.getClientRects()].filter(x => x.width > 1 && x.height > 1); if (!rs.length) continue;
let blk = el.closest('[data-lint-group]');
if (!blk) { blk = el; while (blk && ['inline', 'inline-block'].includes(getComputedStyle(blk).display)) blk = blk.parentElement; }
if (!blk.dataset.bid) blk.dataset.bid = Math.random().toString(36).slice(2, 8);
let sc = 1; for (let e = el; e && e !== document.body; e = e.parentElement) { const m = getComputedStyle(e).transform.match(/matrix\(([^)]+)\)/);
if (m) sc *= Math.hypot(...m[1].split(',').slice(0, 2).map(Number)); }
const top = Math.max(...rs.map(x => x.top)), earlier = rs.filter(x => x.top < top - 4);
out.push({ t, bid: blk.dataset.bid, cap: !!el.closest('#cap'), texture: a <= texture, fs: Math.round(parseFloat(getComputedStyle(el).fontSize) * sc),
x0: Math.min(...rs.map(x => x.left)), y0: Math.min(...rs.map(x => x.top)), x1: Math.max(...rs.map(x => x.right)), y1: Math.max(...rs.map(x => x.bottom)),
lines: new Set(rs.map(x => Math.round(x.top / 8))).size,
lastw: earlier.length ? rs.filter(x => x.top >= top - 4).reduce((s, x) => s + x.width, 0) : 1e9 });
}
return out;
}'''
def load(s):
return sum(1 if ord(ch) > 0x2e80 else 0.5 for ch in s if not ch.isspace() and ch not in ',。、:;?!,.:;?!“”"')
def check_screen(items, R):
screen = [i for i in items if not i['cap'] and not i['texture']]
blocks = {i['bid'] for i in screen}; total = sum(load(i['t']) for i in screen); levels = []
for s in sorted({i['fs'] for i in screen}):
if not levels or s > levels[-1] * R['LEVEL_STEP']:
levels.append(s)
v = []
if len(blocks) > R['MAX_BLOCKS']: v.append(f"{len(blocks)} text blocks > {R['MAX_BLOCKS']}")
if total > R['MAX_LOAD']: v.append(f"reading load {total:.0f} > {R['MAX_LOAD']}")
if len(levels) > R['MAX_LEVELS']: v.append(f"{len(levels)} font-size levels > {R['MAX_LEVELS']} {levels}")
for i in screen:
tag = f"「{i['t'][:12]}」"
if i['fs'] < R['MIN_FONT'] and (i['fs'] < R['MIN_FONT_LABEL'] or load(i['t']) > R['LABEL_MAX']): v.append(f"too small {i['fs']}px {tag}")
right = R['SAFE_R_LOW'] if i['y1'] > R['RIGHT_RAIL_Y'] else R['SAFE_R_HIGH']
if i['x1'] > 0 and i['x0'] < 1080 and (i['x0'] < R['SAFE_L'] - 1 or i['x1'] > right + 1 or i['y0'] < R['SAFE_T'] - 1 or i['y1'] > R['SAFE_B'] + 1):
v.append(f"outside safe zone ({i['x0']:.0f},{i['y0']:.0f})-({i['x1']:.0f},{i['y1']:.0f}) {tag}")
if i['fs'] >= R['MIN_FONT'] and i['lastw'] < R['ORPHAN'] * i['fs']: v.append(f"orphan last line …{i['t'][-6:]}")
if i['fs'] >= R['MIN_FONT'] and load(i['t']) / i['lines'] > R['LINE_MAX']: v.append(f"line too long {load(i['t']) / i['lines']:.0f}/line {tag}")
return len(blocks), total, levels, v
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')
a = ap.parse_args(); R = RULES
if not os.path.exists(a.page): # same first-run copy as render.py
shutil.copy(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'compositor.html'), a.page)
tl = json.load(open(a.timeline)); idx = json.load(open(a.captures)) if os.path.exists(a.captures) else {}
issues = []
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.page)); pg.evaluate('([tl, idx]) => setup(tl, idx)', [tl, idx])
for k, sh in enumerate(tl['shots']):
d = sh['end'] - sh['start']; worst = None
for t in sorted({sh['start'] + min(1.0, d / 2), sh['start'] + max(0.3, min(d - 0.25, 2.6))}):
pg.evaluate(f'render({t})'); res = check_screen(pg.evaluate(JS, R['TEXTURE_OPACITY']), R)
if worst is None or len(res[3]) > len(worst[3]): worst = res
nb, total, levels, v = worst
print(f"#{k:02d} {sh['type']:<7} {sh['start']:6.1f}s blocks={nb} load={total:4.0f} sizes={levels} {'OK' if not v else '✗ ' + '; '.join(dict.fromkeys(v))}")
issues += [(f'shot {k}', x) for x in dict.fromkeys(v)]
for c in tl['cues']:
pg.evaluate(f"render({(c['s'] + c['e']) / 2})"); items = pg.evaluate(JS, R['TEXTURE_OPACITY'])
cap = [i for i in items if i['cap']]
if not cap:
continue
y0, y1 = min(i['y0'] for i in cap), max(i['y1'] for i in cap); lines = max(i['lines'] for i in cap)
dur, n, v = c['e'] - c['s'], load(c['text']), []
if y0 < R['CAP_TOP_MIN']: v.append(f'caption too high y={y0:.0f}')
if y1 > R['SAFE_B']: v.append(f'caption too low y={y1:.0f}')
if lines > R['CAP_MAX_LINES']: v.append(f'caption wraps to {lines} lines')
if n > R['CAP_MAX_LINE']: v.append(f'caption {n:.0f} chars')
if dur < R['CAP_MIN_DUR']: v.append(f'caption shown {dur:.2f}s')
elif n / dur > R['CAP_MAX_CPS']: v.append(f'caption {n / dur:.1f} chars/s')
near = [i for i in items if not i['cap'] and not i['texture'] and i['y1'] > y0 - R['CAP_CLEAR'] and i['y0'] < y1]
if near: v.append(f"text crowding the caption 「{near[0]['t'][:8]}」")
issues += [(f"caption {c['s']:.1f}s「{c['text']}」", x) for x in v]
b.close()
caps = [x for x in issues if x[0].startswith('caption')]
if caps:
print(f'\n{len(caps)} caption issue(s):', Counter(re.sub(r'[\d.]+.*', '', v).strip() for _, v in caps).most_common())
for x in caps[:10]: print(' ', *x)
print(f'\n{len(issues)} issue(s)')
sys.exit(1 if issues else 0)
if __name__ == '__main__':
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 195k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |
| 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: 117k | Updated | Claude CodeCodex | Unverified | Install |
| 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: 114k | Updated | Claude CodeCodex | Verified | Install |