Skip to content

Jackywxsz/Jacky-motion

jacky-motion2-0

Verified

Jacky Motion 2.2 Hybrid:把中文口播稿变成可录屏的信息动画单文件 HTML。可选纯 HTML 手动推进(16:9 或 3:4)或配合 SRT 自动播放(16:9,含 B-roll 录屏画框)。流程为审稿、分镜、锁风格、装配与视觉验收;七种重点风格共享同一套版式、动效与质量门禁。

FileKindSize
SKILL.mdskill md9.0 KB
agents/openai.yamlconfig299 B
assets/base-template-portrait.htmlother15.5 KB
assets/base-template-srt.htmlother23.3 KB
assets/base-template.htmlother14.4 KB
assets/creator-ai-course.jpgbinary186.4 KB
assets/styles/apple-light-blue-glass.cssother3.3 KB
assets/styles/apple-tech-gradient.cssother2.9 KB
assets/styles/editorial-magazine.cssother2.8 KB
assets/styles/finance-studio-cards.cssother2.9 KB
assets/styles/ink-framework.cssother3.6 KB
assets/styles/manifesto-poster.cssother2.9 KB
assets/styles/newspaper-evidence.cssother3.5 KB
assets/styles/paper-collage.cssother3.8 KB
assets/styles/paper-craft-studio.cssother4.9 KB
assets/styles/sketch-note.cssother3.5 KB
references/beat-contract.mdmarkdown4.8 KB
references/html-production.mdmarkdown9.8 KB
references/hybrid-quality-gate.mdmarkdown7.5 KB
references/information-primitives.mdmarkdown2.3 KB
references/layout-skeletons-portrait.mdmarkdown11.6 KB
references/layout-skeletons.mdmarkdown17.4 KB
references/motion-language.mdmarkdown9.4 KB
references/portrait-adaptation.mdmarkdown4.9 KB
references/quality-check.mdmarkdown6.3 KB
references/script-audit.mdmarkdown1.9 KB
references/srt-autoplay.mdmarkdown4.6 KB
references/srt-beat-contract.mdmarkdown1.3 KB
references/srt-production.mdmarkdown2.2 KB
references/srt-quality-check.mdmarkdown1.6 KB
references/storyboard.mdmarkdown6.6 KB
scripts/check-layout-browser-srt.mjsexecutablescript6.2 KB
scripts/check-layout-browser.mjsexecutablescript8.6 KB
scripts/parse-srt.mjsexecutablescript2.2 KB
scripts/validate-motion-html-srt.mjsexecutablescript11.6 KB
scripts/validate-motion-html.mjsexecutablescript10.2 KB

scripts/validate-motion-html.mjs

View on GitHub
#!/usr/bin/env node
// Jacky Motion 2.1 静态校验:登记表 / beat 属性 / step 契约 / 运行时完整性 / 排版红线
import fs from "node:fs";

const file = process.argv[2];
if (!file) {
  console.error("Usage: node validate-motion-html.mjs path/to/output.html");
  process.exit(2);
}

const html = fs.readFileSync(file, "utf8");
const failures = [];
const warnings = [];
const fail = (m) => failures.push(m);
const warn = (m) => warnings.push(m);
const declaredAspect = html.match(/<html\b[^>]*\bdata-aspect=["']([^"']+)["']/i)?.[1] || "16:9";
const isPortrait = declaredAspect === "3:4";

if (!["16:9", "3:4"].includes(declaredAspect)) {
  fail(`Unsupported data-aspect="${declaredAspect}". Use 16:9 or 3:4.`);
}

/* ── 0. 装配占位检查 ── */
const unresolved = [...html.matchAll(/\{\{([A-Z_]+)\}\}/g)].map((m) => m[1]);
if (unresolved.length) {
  fail(`Unresolved base-template placeholder(s): ${[...new Set(unresolved)].join(", ")}.`);
}

/* ── 1. beat 登记与属性 ── */
const LAYOUT_IDS = /^(L0[1-9]|L10|LX-[\w-]+|V0[1-9]|V10|VX-[\w-]+)$/;
// 剥离注释后再匹配,避免把基座模板里的示例注释当成真实 beat
const htmlNoComments = html.replace(/<!--[\s\S]*?-->/g, "");
const beatMatches = [...htmlNoComments.matchAll(/<section[^>]*class=["'][^"']*\bbeat\b[^"']*["'][^>]*>/gi)];
if (beatMatches.length === 0) fail("No .beat sections found.");

for (let i = 0; i < beatMatches.length; i += 1) {
  const tag = beatMatches[i][0];
  const id = tag.match(/\bid=["']([^"']+)["']/i)?.[1] || `beat#${i + 1}`;
  const body = htmlNoComments.slice(beatMatches[i].index, beatMatches[i + 1]?.index ?? htmlNoComments.length);
  const layout = tag.match(/\bdata-layout=["']([^"']+)["']/i)?.[1];
  const primitive = tag.match(/\bdata-primitive=["']([^"']+)["']/i)?.[1] || "";
  const steps = Number(tag.match(/\bdata-steps=["'](\d+)["']/i)?.[1] || 1);

  if (!layout) fail(`${id}: missing data-layout.`);
  else if (!LAYOUT_IDS.test(layout)) fail(`${id}: data-layout "${layout}" is not registered (L01-L10/LX-* or V01-V10/VX-*).`);
  else if (isPortrait && !/^V(?:0[1-9]|10|X-)/.test(layout)) {
    fail(`${id}: 3:4 output must use a portrait V layout, not "${layout}".`);
  } else if (!isPortrait && /^V(?:0[1-9]|10|X-)/.test(layout)) {
    fail(`${id}: V layouts require <html data-aspect="3:4"> and the portrait base template.`);
  }
  if (!/\bdata-core=["'][^"']+["']/i.test(tag)) fail(`${id}: missing data-core.`);
  if (!primitive) fail(`${id}: missing data-primitive.`);
  if (/\bdata-portrait-airy=["']true["']/i.test(tag) && !/^Claim$/i.test(primitive)) {
    fail(`${id}: data-portrait-airy="true" is only allowed for Claim beats.`);
  }

  const isCPSE = /^(Contrast|Path|System|Evidence)$/i.test(primitive);
  if (isCPSE && !/\bdata-visual-demo=["'][^"']+["']/i.test(tag)) {
    warn(`${id}: ${primitive} beat should declare data-visual-demo (real visual demonstration, not text reveal).`);
  }
  if (isCPSE && steps < 2) {
    fail(`${id}: ${primitive} beat must have data-steps >= 2 to show a relation change.`);
  }

  if (steps > 1) {
    const stepNums = [...body.matchAll(/\bdata-step=["'](\d+)["']/gi)].map((m) => Number(m[1]));
    if (stepNums.length === 0) {
      fail(`${id}: data-steps=${steps} but no [data-step] elements found.`);
    } else {
      const max = Math.max(...stepNums);
      if (max !== steps) fail(`${id}: data-steps=${steps} but max data-step element is ${max}. They must match.`);
      if (stepNums.some((n) => n < 2)) warn(`${id}: data-step="1" found. Step-1 content should be unmarked (always visible / default enter).`);
    }
  }
  if (steps > 4) fail(`${id}: data-steps=${steps} exceeds the max of 4. Merge steps or split the beat.`);
}

/* ── 2. 运行时完整性(基座不可改) ── */
for (const marker of ["scaleStage", "applyState", "enterBeat", "toggleFullscreen", "replayBeat", "const TL"]) {
  if (!html.includes(marker)) fail(`Runtime integrity: "${marker}" missing. Do not modify/strip the base-template runtime.`);
}
if (!/#stage\b/i.test(html)) fail("Missing #stage.");
if (!/documentElement\.classList\.add\(['"]js['"]\)/.test(html)) {
  warn("JS-ready class hook not found; no-JS degradation may be broken.");
}
if (!/--stage-w|1920px|1440px/i.test(html)) warn("No fixed stage size token detected.");
if (isPortrait) {
  const portraitLock = html.match(/PORTRAIT FRAME LOCK[\s\S]*?END PORTRAIT FRAME LOCK/)?.[0] || "";
  if (!portraitLock) fail("3:4 output is missing the PORTRAIT FRAME LOCK block. Start from assets/base-template-portrait.html.");
  if (!/--stage-w\s*:\s*1080px\s*!important/i.test(portraitLock)) fail("3:4 frame must lock --stage-w to 1080px.");
  if (!/--stage-h\s*:\s*1440px\s*!important/i.test(portraitLock)) fail("3:4 frame must lock --stage-h to 1440px.");
} else if (/PORTRAIT FRAME LOCK/.test(html)) {
  fail("PORTRAIT FRAME LOCK found without <html data-aspect=\"3:4\">. Keep one aspect ratio per output.");
}
const headHtml = html.match(/<head[\s\S]*?<\/head>/i)?.[0] || "";
const headLinks = headHtml
  .replace(/<style[\s\S]*?<\/style>/gi, "")
  .replace(/<!--[\s\S]*?-->/g, "");
if (!/<link\b[^>]+href=["'][^"']*(fonts\.googleapis\.com|cdn\.jsdelivr\.net)[^"']*["']/i.test(headLinks)) {
  warn("No webfont <link> found. Did you insert the style's FONT_LINKS into <head>?");
}
if (!/--surface\s*:|--accent\s*:/.test(html)) fail("Style layer tokens missing. Inject assets/styles/{id}.css into the STYLE LAYER block.");

/* ── 3. 时间线纪律 ── */
const gsapTo = [...html.matchAll(/gsap\.to\s*\(/g)];
// 允许 counter 对象补间(gsap.to({...} 或 gsap.to(o,);对元素目标的 to 提示检查
for (const m of gsapTo) {
  const ctx = html.slice(m.index, m.index + 60);
  if (!/gsap\.to\s*\(\s*(\{|o\b|obj\b|counter\b)/.test(ctx)) {
    warn(`gsap.to(...) on element target found (${ctx.split("\n")[0].trim()}…). Prefer gsap.from/fromTo so the CSS resting state stays the final frame.`);
    break;
  }
}
if (/(setTimeout|setInterval)\s*\(\s*[^)]{0,80}(anim|play|reveal|show|step)/i.test(html)) {
  warn("Timer-driven animation detected. Use TL registry timelines, not setTimeout chains.");
}

/* ── 4. 内容红线 ── */
// 运行时核心区(#stage 自身的 fixed 居中)不参与内容红线检查
const contentHtml = html.replace(/RUNTIME CORE(不可修改)[\s\S]*?STYLE LAYER/, "STYLE LAYER");
if (/position\s*:\s*fixed/i.test(contentHtml)) fail("position:fixed found in content. All controls must live inside #stage.");
if (/\b(tts|voice|speechSynthesis|utterance|\.mp3|\.wav)\b/i.test(html)) {
  fail("Audio/TTS related code found. Pipeline ends at visual acceptance.");
}
const visible = html.replace(/<script[\s\S]*?<\/script>/gi, "").replace(/<!--[\s\S]*?-->/g, "");
if (/(B-roll|旁白窗口|可配口播|适合插入)/i.test(visible.replace(/<style[\s\S]*?<\/style>/gi, ""))) {
  fail("Editing hints (B-roll/旁白窗口/…) leaked into visible content.");
}

/* ── 5. 排版红线 ── */
if (/letter-spacing\s*:\s*-/i.test(html)) fail("Negative letter-spacing found. Use size/weight/breaks/whitespace instead.");
for (const m of html.matchAll(/line-height\s*:\s*([0-9]*\.?[0-9]+)(?![0-9%p])/gi)) {
  const v = Number(m[1]);
  if (!Number.isFinite(v) || v <= 0 || v > 3) continue;
  if (v < 1) fail(`line-height ${v} too tight for recorded Chinese text.`);
  else if (v > 1 && v < 1.06) warn(`line-height ${v} below Chinese hero breathing range (1.06+).`);
  // 恰好 1 视为大数字/hero-num 的合法设定
}
const negMargin = html.match(/margin(?:-[a-z]+)?\s*:\s*-[0-9.]+/gi) || [];
if (negMargin.length) fail("Negative margin found. Fix layout with grid/flex zones, not overlap patches.");
const centerHits = contentHtml.match(/(?:left|top)\s*:\s*50%/gi) || [];
if (centerHits.length >= 4) fail(`${centerHits.length} absolute 50% centering declarations — center-clustering risk. Use grid zones.`);
else if (centerHits.length >= 2) warn(`${centerHits.length} absolute 50% centering declarations. Check for center clustering.`);

// 中文标题单字孤行(显式 <br> 断行检查)
for (const [, tagName, inner] of html.matchAll(/<(h1|h2|div|span)[^>]*(?:hero-title|quote)[^>]*>([\s\S]*?)<\/\1>/gi)) {
  const lines = String(inner).split(/<br\s*\/?>/i)
    .map((l) => l.replace(/<[^>]+>/g, "").replace(/\s+/g, "").trim())
    .filter(Boolean);
  for (const line of lines) {
    const cjk = line.match(/[一-鿿]/g) || [];
    if (cjk.length === 1) fail(`Title has a one-character Chinese line: "${line}".`);
    if (isPortrait && cjk.length === 2) warn(`Portrait title has a two-character line: "${line}". Rebalance the phrase break before shrinking type.`);
  }
}

// beat CSS 区硬编码颜色(token 纪律)
const beatCss = html.match(/════ BEAT CSS[\s\S]*?════ END BEAT CSS/)?.[0] || "";
const hexHits = beatCss.match(/#[0-9a-f]{3,8}\b/gi) || [];
if (hexHits.length) warn(`${hexHits.length} hardcoded hex color(s) in BEAT CSS (${[...new Set(hexHits)].slice(0, 5).join(", ")}…). Use style-layer tokens.`);

/* ── 6. 结构提示 ── */
const safeBoxCount = (html.match(/\bdata-safe-box=["'][^"']+["']/gi) || []).length;
if (beatMatches.length > 0 && safeBoxCount < beatMatches.length) {
  fail(`Only ${safeBoxCount} data-safe-box marker(s) for ${beatMatches.length} beat(s). Mark every primary title/visual/card/screenshot/node.`);
}
if ((html.match(/<svg[\s\S]*?<text[\s\S]*?<\/svg>/gi) || []).length) {
  warn("SVG <text> found. Prefer HTML labels for layout and validation.");
}
const shotCoverRule = /\.shot[^{]*\{[^}]*object-fit\s*:\s*cover/i.test(html)
  || /\.shot[^{]*img[^{]*\{[^}]*object-fit\s*:\s*cover/i.test(html)
  || /data-safe-box=["']shot["'][\s\S]{0,240}object-fit\s*:\s*cover/i.test(html);
if (shotCoverRule) {
  warn("object-fit:cover found on information screenshots (.shot). Use contain/max dimensions instead.");
}
const tlCount = (html.match(/TL\.(b\w+)\s*=/g) || []).length;
if (beatMatches.length >= 3 && tlCount < Math.ceil(beatMatches.length / 3)) {
  warn(`Only ${tlCount} custom TL timeline(s) for ${beatMatches.length} beats. Core beats need signature motion, not just the default enter.`);
}

/* ── 输出 ── */
for (const m of failures) console.error(`FAIL ${m}`);
for (const m of warnings) console.warn(`WARN ${m}`);
if (failures.length) process.exit(1);
console.log(`PASS ${file}`);
if (warnings.length) console.log(`${warnings.length} warning(s). Review before delivery.`);
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall