slide-dsl
它能做什么
这个技能是 OpenMAIC 中幻灯片页面如何存储的逐字段参考。适合在数据层面编辑幻灯片的人或 AI,因为一个小错误就可能破坏页面。
适用场景
- ✓当你需要直接修改幻灯片底层的内容或布局数据的时候。
- ✓当幻灯片的编辑结果与你预期不符的时候。
- ✓当你需要知道显示界面实际使用哪个字段来表示某个值的时候。
技能链接
https://github.com/THU-MAIC/OpenMAIC/blob/main/skills/agent-runtime/slide-dsl/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把这张幻灯片的背景颜色改掉,并确保修改真的显示在屏幕上?”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会读取页面的存储结构,写入显示所实际使用的准确字段,然后读回页面,确认修改已经出现。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
The slide DSL
A slide page is a JSON document. Editing it well means writing the exact field that holds the thing you want to change, in the exact shape the renderer reads, and leaving every neighbouring field byte-identical.
Read this part first, because it changes how you should use everything below.
The write path stores what you send. There is no markup allow-list, no
sanitizer, no colour or font normalisation, no geometry clamping, no house style
applied on the way in. patch_stage checks one thing — that the resulting
document still matches the DSL structure schema (field names, types, required
fields, closed objects) — and then persists your value byte for byte.
So there is nothing between you and the screen. A structurally legal page can still be an unreadable page: markup the renderer never styles, a colour on a field nothing paints, a formula snapshot that disagrees with its source. The guard rail catches shape, not meaning. This manual is the meaning. Where it tells you how the renderer behaves, that is the whole of your knowledge — write against it, then read the page back and check what you wrote is what is there.
Contents
- Reading before writing — the three read depths
- The document —
content→canvas - The canvas — viewport, theme, background, animations, paint order
- How an edit reaches the JSON — three ops, pointer rules
- What the structure schema refuses — the only hard boundary
- Two renderers paint your page — playback vs. preview
- Fields every element carries
- The ten element types — one section each
- The rendering truth of
contentHTML — the most important section - Quick reference — one row per element type
- Where this sits
- Hard rules
Reading before writing
read_stage has three depths — detail:"tree", detail:"source" and
detail:"text" — and they are not interchangeable.
detail |
What comes back | Use it for |
|---|---|---|
inventory (default) |
One compact line per element — id, type, plain-text text, left, top, width, height, src |
Finding an element. Never as a patch source. |
source |
The exact persisted page JSON — the root every patch path is written against | Every patch. Read it again after a write. |
text |
Every text-bearing element as { path, id, type, text } plus one page-wide combinedText |
Proving old copy left no residue. |
inventorystrips the markup. Itstextis the element's HTML with tags replaced by spaces and whitespace collapsed. A patch built from it invents style values that were never there and deletes the ones that were.sourcealways returns the whole page. There is no per-element projection, so array indices cannot drift between what you read and what you write. It returns the fullcontentobject —type,schemaVersionand the completecanvas, background, theme and animations included.detail:"text"gives you pointers. Eachpathis that element's own/content/canvas/elements/N, so a residue check hands you the pointer to fix. Note that itstextfor alatexelement is the LaTeX source, forcodethe lines joined by newlines, and fortablethe cells joined by|.
The document
A slide scene's content is:
{ type: 'slide', schemaVersion?: number, canvas: Slide }
type and schemaVersion sit outside /content/canvas/ and are therefore not
reachable by a slide-canvas patch path — such a pointer begins /content/canvas/. Everything you can
write lives under canvas.
The canvas
| Field | Required | Meaning |
|---|
常见问题
系统会清理我写入的 HTML 吗?
不会。技能说明,系统会原样存储你发送的内容,因此手册是判断什么有效的指南。
保存时会检查什么?
技能说明,写入只检查页面的结构,不检查含义或外观。
为什么编辑后要检查页面?
技能说明,页面在结构上可能有效,但在屏幕上看起来仍然不对。
详情
作者的原始描述
The complete slide DSL manual — the canvas and its background, the ten element types field by field with units, defaults and legal values, where each type keeps its words, which field the renderer actually paints when two disagree, exactly what happens to the HTML you put in `content`, and the structure schema that is now the ONLY thing a write is checked against. Nothing filters your markup and nothing normalises your values, so this manual is the whole of what makes a page render correctly. Load it before patching a field you have not patched before, when a patch comes back rejected, when a
repo: THU-MAIC/OpenMAIC
热度
- GitHub 星标
- 42k
- 排名
- #6410
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
build-personal-skill
42k帮你的智能体把你过去的课程制作记录和聊天内容,基于你自己历史中的规律,整理成一份可重复使用的个人技能。
curriculum-planner
42k帮你的智能体规划一系列相互关联的课程,例如七天课程或按章节拆分的书籍,并在你批准后逐一制作。
deep-interactive
42k帮你的智能体设计一门课程,让学习者在大多数页面上操作模拟、图表、代码和游戏,而不是只看幻灯片。
deep-research
42k帮你的智能体制作关于近期或事实性主题的课程,先研究实时来源,并让每项论断都对应一个已核实的来源。