Skip to content

MiniMax-AI/mcode-stack / stacks/youfang/skills/magic-move-deck

magic-move-deck

Unverified

Build Keynote-style Magic Move slide decks as one offline 1920×1080 HTML file: every slide is an architecture / flow diagram seen through a camera, and the elements two slides share morph and fly instead of cross-fading. Four visual styles (hand-drawn, minimal, dark neon, neo-brutalist): the agent first renders one sample slide in each style, the user picks one, then the whole deck is built in that style. Also exports 4K / 1080p video. Use for 做演示 / 做 slides / 做 PPT / Magic Move / 神奇移动 / 架构图演示 / 技术分享 deck / 动画 slides / animated architecture walkthrough. Not for bullet-point decks or a single static diagram.

FileKindSize
SKILL.mdskill md10.5 KB
examples/rag-assistant/README.mdmarkdown6.1 KB
examples/rag-assistant/details/00_cover.htmlother15.5 KB
examples/rag-assistant/details/01_ingestion.htmlother21.2 KB
examples/rag-assistant/details/02_retrieval.htmlother21.2 KB
examples/rag-assistant/details/03_generation.htmlother22.1 KB
examples/rag-assistant/details/99_end.htmlother15.6 KB
examples/rag-assistant/diagram-binding.mdmarkdown2.8 KB
examples/rag-assistant/overview.htmlother23.5 KB
examples/rag-assistant/previews/00_cover.jpgbinary80.6 KB
examples/rag-assistant/previews/01_ingestion.jpgbinary175.3 KB
examples/rag-assistant/previews/02_retrieval.jpgbinary184.5 KB
examples/rag-assistant/previews/03_generation.jpgbinary187.1 KB
examples/rag-assistant/previews/99_end.jpgbinary86.6 KB
examples/rag-assistant/previews/overview.jpgbinary163.2 KB
examples/rag-assistant/previews/trans_d1_to_spot.jpgbinary133.6 KB
examples/rag-assistant/previews/trans_overview_to_d1.jpgbinary78.5 KB
references/bilingual-layout.mdmarkdown2.6 KB
references/cards.mdmarkdown5.0 KB
references/diagram-rules.mdmarkdown4.9 KB
references/magic-move-contract.mdmarkdown7.4 KB
references/styles.mdmarkdown4.3 KB
references/verification.mdmarkdown4.8 KB
scripts/build_deck.pyscript15.8 KB
scripts/render_video.pyscript6.7 KB
scripts/snapshot_deck.pyscript5.0 KB
scripts/styles.pyscript7.3 KB
styles/brutalist/STYLE.mdmarkdown2.1 KB
styles/brutalist/diagram.htmlother12.5 KB
styles/brutalist/preview.pngbinary221.2 KB
styles/handdrawn/STYLE.mdmarkdown2.1 KB
styles/handdrawn/diagram.htmlother14.6 KB
styles/handdrawn/preview.pngbinary302.9 KB
styles/minimal/STYLE.mdmarkdown2.0 KB
styles/minimal/diagram.htmlother12.6 KB
styles/minimal/preview.pngbinary226.2 KB
styles/neon/STYLE.mdmarkdown1.9 KB
styles/neon/diagram.htmlother13.4 KB
styles/neon/preview.pngbinary280.1 KB
templates/card-main.jsscript2.9 KB
templates/detail-main.jsscript4.3 KB
templates/diagram-binding.mdmarkdown1.2 KB
templates/keynote.htmlother38.7 KB

references/magic-move-contract.md

View on GitHub
# Magic Move 原则与命名契约

deck 引擎 `keynote.html` 不读图的语义,只靠 `build_deck.py` 导出的几何与文字判断「两页上是不是同一个概念」。图怎么画,决定了转场能不能变形过去。

## Deck 生成原则

1. **素材只来自图。** 每页 = 某张图(同一风格模板画的)+ 一个相机取景(`SECTIONS` 里的 `ov` / `spots`,单位是该图的画布像素)。
   - 不加额外 slide(黑底开场页、纯文字过渡页等)。
   - 不在图上叠卡片、提示或页码。要说的话画进图里。
2. **前后页相关的元素变形 / 移动过去,不复制一份,也不整图交叉淡化。**
   - 为讲清概念而重画元素是允许的,也是必须的(细节图会比总览多出内容)。
   - 同一概念在简略和详细之间过渡时,必须是已有元素变形、移动成新元素:用相同的名字画它。
3. **简略 → 详细:** 概念框放大,原来没有的细节从框里长出来。**详细 → 简略:** 细节淡出,主题信息缩回所属概念。整体信息量变大时,具体某个模块的信息量就要变少。
4. **封面 / 结束页:** 见 [cards.md](cards.md)。
5. **故事线固定:** `[cv] → ov → (ov 聚焦该区域 → 细节图全图 → 3 个聚光点) × N → ov → [end]`。N 个主题时共 `5N + 2` 页,加封面、结束页各 +1。
   - 新增主题:图加进 `build_deck.py` 的 `SOURCES`,再在 `SECTIONS` 里写总览区域和聚光点。
   - 每个聚光点后面用注释写一句它要讲的结论;写不出结论的聚光点删掉。

## 三类转场(引擎自动选择)

| 前后页 | 转场 | 时长 |
|---|---|---|
| 同一张图(全图 ↔ 聚光点、聚光点 ↔ 聚光点) | `cameraTrans`:相机平移缩放,焦点外元素压暗到 13% | 1050 ms |
| 不同图(总览 ↔ 细节) | `magicTrans`:按下面的契约配对,配上的元素飞过去、变形;配不上的淡入淡出或跟随所属框 | 1350 ms |
| 卡片 ↔ 总览 | `coverTrans`:标题逐词飞行 + 毛玻璃擦开;结束页是它的倒放 | 2200 ms |

## 命名契约(`match()` 的配对规则)

- **节点。** 节点 = 闭合形状(rectangle / polygon / ellipse / circle,或以 `Z` 结尾的 path,如圆角框)+ 画在它里面(形状之后绘制、中心落在框内)的文字。节点名取框里第一行**加粗的中文**(字重 ≥ 600);没有加粗中文行时取第一行文字。
  - 英文名和中文名要画在同一个闭合形状里,中文名加粗、且是框里第一个加粗的中文行。页面上先显示哪种语言不影响配对。`btext` / `bnode`(见 `templates/detail-main.js`)已满足。
  - 名字去掉「 · 」或「 (」之后的部分后相同即配对:「向量库 · 按租户分片 · 如 HNSW」↔「向量库」。
  - 一边的名字是另一边的后缀(至少 2 个字)也能配对(代价更高,优先完全同名)。
  - 同一位置连续画的同色、高度重叠的框(堆叠框 = 多实例;新野兽派的硬投影也属于这种)算同一个节点。
- **分区框。** 必须用 `frame()` 画、标签用 `fl()`。`build_deck.py` 的 `zh_first()` 按全角空格拆开标签,中文段排前作为分区名;配对看中文段「 · 」之前的部分:`Public access ① 公网接入区` ↔「公网接入区」。纯英文标签取「 · 」之前的部分并去掉末尾圈号:`Worker pool ②` ↔ `Worker pool`。
- **分区关键词(`ZONES`)。** 分区标签里要带 `keynote.html` CONFIG 中 `ZONES` 列出的关键词之一,引擎用它判断元素属于哪个区。同名元素分在不同区时,只有它在两页上都唯一才配对(受信区里的 Worker 不会被当成沙箱里那个)。新项目先按自己的分区改 `ZONES`;更具体的关键词放前面。
- **框 ↔ 分区。** 一页上的方框遇到另一页上同名的分区时,放大成那个分区(「出口代理」框 → 出口代理分区);框里的文字落到分区里的同名文字上。
- **一个 ↔ 多个。** 一页画一次、另一页画多份的同名概念:多出来的几份从那个框里分裂出来(有堆叠副本时先用副本),倒放时合并回去。
- **步骤编号不影响配对。** 「1 · 识别沙箱身份」≈「识别沙箱身份」。
- **细节图大标题**恰好两次 `title()`:先英文,以总览原则的圈号开头(①–⑳);再中文。英文行从总览上对应原则小标题(以同一圈号开头的最大那行)放大而来;中文行来自小标题正下方那行。一个标题里有两个圈号时,两个小标题都会并进来。单语 deck 可以只调一次 `title()`。
  - 中文行与总览小标题下方那行文字完全相同才是同一行文字的移动;不同时两段文字交叉淡化,p≈0.5 像重影。
  - 原则小标题放在总览上该主题的 `ov` 区域之外(如区域上方的标题带);放在区域内时,提早落位的中文行会从下方横穿放大中的英文行。
  - 副标题跟着标题:标题落位后再出现,离开时先走。
  - 中文行有独立时间窗(`keynote.html` 2c 的 `tw`):总览 → 细节 `[0, .6]` 提早落位;细节 → 总览 `[.4, 1]` 晚些起飞。和英文行共用时钟会在 p≈0.5 被放大中的英文行压住。
- **只在一页出现的细节**从包住它的最小的移动框里长出来 / 缩回去;周围没有移动框时跟着两页共同描述的区域(总览的 `ov` 区域 ↔ 细节图全图)一起缩放。所以细节要画在所属概念框的范围内。
- **完全相同的文字行**也会配对移动;图例只和图例配对。
- **想让某个元素在转场时消失**,就让两页上的名字不同。
- **图片**(`<img>`)不参与配对,只淡入淡出。

## build_deck.py 的挂钩(为什么 helper 不能改)

`build_deck.py` 在每张图的 `main()` 前注入脚本:

- `rc.line / rectangle / ellipse / circle / linearPath / polygon / arc / curve / path` 的每次调用同时镜像成一个 SVG 组 → 可移动的形状。模板有 `restyle(args, method)` 时(非手绘风格),镜像用它归一化后的参数,与 canvas 上看到的一致。
- `plain` / `lbl` 生成的 HTML label 打上绘制序号;多行 label 按 `<br>` / 块级子元素拆成一行一个可移动原子。
- `title()` / `subtitle()` 本来画在 canvas 上,被改写成 HTML 文字,才能飞行;`title()` 文本含全角空格时拆成两个原子。
- `arrow / frame / timeline / taskCard / bubble / legend` 的多笔画合成一个形状整体移动。
- 每张图导出 `theme`(纸色、`.ti` / `.bd` 字体、`C.glow`、`C.card`),`keynote.html` 据此设置底色、标题光晕、形状发光和封面毛玻璃。

直接用 `ctx` 画的东西不进 deck;改了 helper 的名字或签名,挂钩就失效。deck 只读图,不修改图。各风格模板的接口约定见 [styles.md](styles.md)。

## 引擎可调参数

| 参数 | 位置 | 作用 |
|---|---|---|
| `DIM = 0.13` | Geometry | 聚光点焦点外元素的不透明度 |
| `PAD = 28` | Geometry | 取景框外扩 |
| `MAX_ZOOM = 1.75` | Geometry | 聚光点相对全图适配的最大放大倍数(小区域不会放得过大) |
| `COVER_ZOOM = 1.06` / `SOFT = 520` | Cover | 封面下总览的推近倍数 / 毛玻璃擦除的羽化宽度 |
| `dur` | 各 `*Trans` | 转场时长 |

改时间窗前先读对应注释:多数窗口是为了避开某个具体的压字问题定下来的。
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 196kUpdated Claude CodeCodexVerifiedInstall