Duyi Stage logo

Duyi Stage

Community
duyi2076
duyi-stage

给横屏中文口播成片加左上信息卡与可选右侧素材层。22 种信息卡舞台保持原样;另外接受图片、横屏视频和竖屏视频,按真实比例自动落在右侧安全位。内容与时刻由上游给,版式与动效固定,产出带 alpha 的 overlay 再与成片合成。触发:横屏加信息卡、右侧放录屏、右侧放图片、口播加动画、duyi-stage。不用于竖屏底片、不做调色变速配乐、不改口播文字。

Overview

Publisherduyi2076
Repositoryduyi-scripted-video-edit
Skill nameduyi-stage
Stars
39
Forks
5
Bundled files
12
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by duyi2076 on GitHub. Read the source before you install it.

Installation

Install the Duyi Stage AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/duyi2076/duyi-scripted-video-edit/tree/main/duyi-stage
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/duyi2076/duyi-scripted-video-edit.git /tmp/duyi-scripted-video-edit
mkdir -p .claude/skills
cp -r /tmp/duyi-scripted-video-edit/duyi-stage .claude/skills/duyi-stage
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Duyi Stage in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Duyi Stage on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Duyi Stage is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

横屏口播的信息卡与右侧素材舞台

成片已经剪好之后,在画面左上加信息卡;需要展示证据时,再在右侧加一段图片或静音视频。 只做视觉层,不碰剪辑、不碰文字、不改变原口播音轨。

渲染交给 HyperFrames,不自己写截帧器。视觉规格、布局门禁与动效参数都随本目录版本化。

一条视频一次渲染

bash
STAGE=~/.agents/skills/duyi-stage

# 1. 你写 plan.json:每张卡用哪种舞台、写什么字、什么时候出现
# 2. 生成 composition(一条视频一个,每张卡是一个 clip)
#    plan 里的 width / height 必须来自即将承载卡片的成片
python3 "$STAGE/build.py" --plan plan.json --out work/stage

# 3. 校验契约。任何真实文字越界都会触发 DUYI_LAYOUT_GATE 并返回非零
(cd work/stage && npx --yes hyperframes@0.7.94 check)

# 4. 渲染带 alpha 的 overlay。必须 mov(webm 实测出来是 yuv420p,没有透明通道)
(cd work/stage && npx --yes hyperframes@0.7.94 render --format mov -o overlay.mov)

# 5. 与成片合成。正常情况下尺寸已经一致;这里再做一次真实文件兜底检查
python3 "$STAGE/compose.py" --base 成片.mp4 --overlay work/stage/overlay.mov \
  --out 带卡成片.mp4

build.py 会按计划里的目标尺寸直接渲染,所以 2560×1440 底片会得到 2560×1440 overlay, 不会先做成 1920×1080 再放大。compose.py 的基准仍是此刻真正要承载卡片的底片,不是 最初导入的原视频;它负责最后一道兜底:

  • 尺寸相同:直接叠加
  • 尺寸不同、画幅比例相同:把 overlay 缩放到底片尺寸后叠加
  • 画幅比例不同:停止,禁止拉伸
  • overlay 小于底片:默认停止,避免放大后文字变糊;确认接受时才加 --allow-upscale
  • 299/12 对 25fps 这类不超过 0.5fps 的小数差异:按底片时间轴重采样 overlay;差异更大则停止

合成后脚本会重新读取输出文件,核对输出尺寸、帧率、时长和音频包哈希。重新运行且确认覆盖时 显式加 --force。

预览时加 --preview 某一帧.jpg,卡片会压在真实画面上,用来判断可读性。 交付渲染不要带这个参数 —— 带了会渲出不透明的实心画面,不是 overlay。

plan.json 写什么

json
{
  "duration": 104.5,          // 成片总时长
  "fps": 60,                  // 必须跟随源片,读 ffprobe 的 r_frame_rate
  "width": 2560,              // 必须跟随最终底片,不按“2K”等名字猜
  "height": 1440,
  "cards": [
    { "id": "c01", "kind": "flow", "start": 12.4, "end": 19.0,
      "accent": "gold",                                   // 省略即蓝色
      "chapter": { "en": "THE LOOP", "zh": "每天在跑的那一圈" },
      "data": { "title": "录完就发,*中间不碰*", "items": ["录素材", "自动粗剪", "发布"] },
      "reveals": [13.5, 15.0, 16.4] }                     // 逐条显形时刻
  ],
  "media": [
    { "id": "m01", "source": "/绝对路径/录屏.mp4",
      "start": 22.4, "end": 28.4, "media_start": 8.0 }
  ]
}
  • *星号* 包住标题里那一个词,渲染成强调色。一张卡只允许一处。
  • chapter 可省略。同一帧里章节头与卡内 kicker 互斥,别同时写。
  • reveals 的个数对应 items 的个数,少写就只出前几条。
  • width / height 由上游从最终底片读取。旧 plan 不写时兼容为 1920×1080,但新任务禁止省略。
  • media 可省略。source 是图片或视频绝对路径;start/end 必须由上游证据词算法生成, 不由执行者手填;视频可用 media_start 指定源片起点。
  • build.py 会重新探测媒体尺寸和旋转方向、核对视频剩余时长,再把文件复制到输出目录。 右侧一次只允许一段素材,视频永远静音。

22 种舞台

kind用在什么话术data 字段
hook开场头 3 秒eyebrow · big
thesis抛观点title · sub
term「所谓 X 就是」kicker · title · body
ask抛问题question
quote引书、引名人text · source
book讲某本书cover · name · author · note
list枚举title · items[]
flow「先 A 再 B」,≤3;短项横排,放不下自动转为向下流程title · items[]
blocks多项集合,三列title · items[]
parallel两项对照title · items[]
hierarchy上位带下位title · top · items[]
number单个数值value · unit · sub
versus前后对比items[{label,value,cls}]
bars三项以上的量title · items[{label,value,pct,cls}]
timeline「几月发生了什么」items[{when,what,cls}]
dialog「有人跟我说」items[{side,text}],side 取 them/me
graph一个点长出周边hub · items[{x,y,text}] · edges[{x,y}]
media给看截图title · items[{cls}] · spot · caption
annotate指着画面里的东西x · y · note
progress第几步title · items[{cls}] · label
termbar名词解释term · desc
cta结尾行动t1 · t2

cls 是状态类名:hi 高亮、on 已完成、now 当前、dim 降级。 dim 只是 cls 的取值,不是 kind —— 当成舞台写会直接 KeyError。

舞台的横向标准

这是全套的骨架,任何舞台都不能越过。规格使用 1280×720 参考坐标,渲染倍率为 目标宽度 ÷ 1280:1440×810 是 ×1.125,1920×1080 是 ×1.5,2560×1440 是 ×2。

  • 左立柱 x=38,章节头、所有卡片、所有文字块的左缘都在这条线上,永不移动
  • 右侧硬上限 x=442,即画面宽的 34.5%
  • 卡片只有两档:284 / 404,由内容自动吸附,同一 clip 内多卡等宽

宽度是舞台的秩序,不是每张卡自己的事。三档里的 202 已经废弃 —— 实测短内容吸到 202 后卡片小得像残件,和同屏其它元素的重量对不上。

flow 横排放不下时保留流程语义并自动切成向下箭头。除此之外,超出最宽档会在 data-over 记录所需宽度并触发 DUYI_LAYOUT_GATE,hyperframes check 必须失败, 禁止继续渲染。不能用裁字、缩字号或自动折行糊过去。

纵向由内容自然撑开,只约束间距节奏与总高上限 345;超出同样由布局门禁阻断。

视觉数值

项值为什么
底板rgba(11,18,24,.50)实测标题对比度 5.2:1,副题小字也达标;更黑会像贴上去的砖
描边一条 1px rgba(255,255,255,.14) 发丝线六档掺色描边是廉价感的直接来源,已全删
阴影0 10px 30px rgba(0,0,0,.42)不加则卡片与画面零深度分离
文字保护0 1px 3px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.55)底板只有 50%,文字必须自带保护,两件事必须一起做
字阶30 / 23 / 22 / 16 / 11(数字卡 56 例外)22 与 23 差 4.3% 人眼分不出,别再新增
强调色蓝 #4C8DF6 默认,金 #E0B44C 给引用/人声/数值绿色已砍。三色没有语义规律时,颜色就只是装饰
强调色用量一帧 ≤2 处,且至少一处落在语义词上出现 5 次就不再是强调

字体必须用 assets/ 里自带的 Noto Sans CJK + Space Mono。禁止系统字体回退 —— 渲染机上 PingFang 会变成别的字,字宽全变,宽度吸档全部作废。

字体是子集后的 WOFF2,并作为可复现渲染所需资产随仓库分发。若要从上游字体重新生成:

bash
cd ~/.agents/skills/duyi-stage/assets
# 先从 Noto CJK 与 Space Mono 官方仓库取得对应版本的源字体
python3 -c "
from fontTools import subset
chars=''.join(chr(c) for c in list(range(0x4E00,0x9FA6))+list(range(0x20,0x7F)))+',。、;:?!()《》【】—…·%「」'
for src,dst in [('NotoSansCJKsc-Bold.otf','cn-bold.woff2'),
                ('NotoSansCJKsc-Medium.otf','cn-medium.woff2'),
                ('NotoSansCJKsc-Regular.otf','cn-regular.woff2')]:
    subset.main([src,f'--text={chars}','--flavor=woff2',f'--output-file={dst}',
                 '--no-hinting','--desubroutinize','--layout-features='])
subset.main(['SpaceMono-Bold.ttf','--unicodes=U+0000-00FF,U+2000-206F',
             '--flavor=woff2','--output-file=en-bold.woff2'])"

全量 CJK otf 单个 17MB、三个 48MB,无头浏览器加载会超时,渲染管线里不可用,必须子集。

动效

固定坐标的透明度渐显。禁止平移、缩放、弹跳、呼吸、循环。

元素时长说明
容器(底板)0.26s
容器内首屏文字0.18s,比容器晚 0.06s不错开的话白字会和半透明底板同时停在 20–60%,此时底板有效遮罩只有 0.16,白字直接压画面出现灰糊
逐条显形0.18s,stagger 0.045
连接线0.22s,比目标节点早 0.08s用 clip-path 擦除,不用 scaleX(scaleX 会把箭头字形压扁)
退场0.28s

曲线用 CustomEase 精确复刻 cubic-bezier。GSAP 不解析 "cubic-bezier(...)" 字符串, 直接写会静默回落到 power1.out —— 正是造成中段灰糊的那条曲线。这个坑踩过一次。

GSAP 的位置参数用 "<0.08"(相对上一 tween 起点)。"+=" 是相对时间轴末端, 会把间隔累加成漂移,实测把 0.08s 的间隔拉成 0.30s。

data-fps 必须跟随源片。不写的话 HyperFrames 默认 30,源片 60 时动画时间分辨率直接减半。

时机:算法算,AI 不许自填

AI 只写卡片文字与证据区间,start / reveals 由触发点算法从逐词稿推导。

做法:把卡片文字切成语义 token,与本章逐词流做单调对齐,取所有 token 的最晚必要词下标, 触发时刻不得早于它。对齐不上的抽象词写进 unaligned_tokens 交人眼看。

不这么做的后果有实测反例:语音「数据涨了三倍」,卡片写「数据涨了三倍」,触发词设在「数据」—— 「三倍」这个数字在被说出前 1.13 秒就完全显形,剧透了。而门禁只检查 AI 自填的布尔字段, 0 error 通过。

导演规则不在这里

节奏由上游判定(duyi-koubo-wide/references/11-节奏.md),本 skill 不重复定义、 也不允许在这里改。这里曾经写过「开头 8 秒不上卡」「相邻视觉 ≥6 秒」—— 前一条上游已经明确推翻(信息流场景下开头空着就是把人放走),后一条与上游的 5s 打架, 而 build.py 一条都没有实现。三层各说各话,执行者读到哪层算哪层。

build.py 只查一件它查得了的事:相邻卡片时间重叠(同屏会挤在一起)。警告不阻断。

硬边界

  • 只做视觉层。不剪辑、不改口播文字、不做调色变速配乐多机位
  • 只有一套深色皮肤。白底卡片已被明令禁止
  • items 与正文是原话的子序列、evidence 是连续原话、title 可概括但数量要对上 (三种严格程度不同,见 duyi-koubo-wide/SKILL.md)
  • 舞台固定左上,不因人物位置换边。检测到与人脸重叠时标记 conflict 但继续产出
  • 右侧素材位固定在右边,不因人物位置换边;按竖屏、横屏、近方形三档保持原比例,底边避开字幕区
  • overlay 与底片必须通过 compose.py 合成,禁止直接用 overlay=0:0 跳过尺寸适配
  • 截图卡在 404px 宽里只能给"视觉证据 + 圈出一个点",让观众读清界面属于剪辑层的画面切换

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Duyi Stage AI skill do?

给横屏中文口播成片加左上信息卡与可选右侧素材层。22 种信息卡舞台保持原样;另外接受图片、横屏视频和竖屏视频,按真实比例自动落在右侧安全位。内容与时刻由上游给,版式与动效固定,产出带 alpha 的 overlay 再与成片合成。触发:横屏加信息卡、右侧放录屏、右侧放图片、口播加动画、duyi-stage。不用于竖屏底片、不做调色变速配乐、不改口播文字。

Why use Duyi Stage on TypingMind?

Because you install it once and use it with any model. Duyi Stage is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Duyi Stage in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/duyi2076/duyi-scripted-video-edit/tree/main/duyi-stage. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Duyi Stage?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Duyi Stage?

As many as you like. As long as a model supports skills, you can use Duyi Stage with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Duyi Stage AI skill free?

It is published on GitHub by duyi2076. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇