slide-craft
它能做什么
这个技能提供 OpenMAIC 幻灯片页面背后的设计规则,包括边距、文字大小、对比度和间距。适合编辑幻灯片、希望修改与原设计相符的人。
适用场景
- ✓当你要修改幻灯片上的某个元素,并希望它能合适地放入的时候。
- ✓当幻灯片的文字对其文本框来说太大或太小的时候。
- ✓当幻灯片显得拥挤或空旷,需要更好的间距的时候。
技能链接
https://github.com/THU-MAIC/OpenMAIC/blob/main/skills/agent-runtime/slide-craft/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“这张幻灯片的文字溢出了文本框。请修正,让它放得下,并与其他幻灯片保持一致?”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会使用一套针对幻灯片画布、文字高度和颜色对比度的测量值与规则,做出适合页面设计的修改。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
The design law of a slide page
Every slide in this runtime was drawn under a long set of rules — the canvas, the height table, the type scale, the spacing standards. The generator that drew the page had all of them in front of it. When you patch one element, you have the page's numbers and nothing else, and the rules are the only way to tell a repair from a dent.
This is that rule set, restated for editing. It is about the page, not the process: which numbers a change has to stay consistent with, and which fields actually reach the screen.
The canvas you are editing inside
The canvas is 1000 × 562.5. All elements respect a 50px margin, so the
live area is left ∈ [50, 950], top ∈ [50, 512.5], and an element's right
edge (left + width) stays ≤ 950, its bottom edge ≤ 512.5.
The page's own alignment grid, which existing elements are already on:
- Left-aligned content sits at
left = 60orleft = 80. - Centred content is
left = (1000 - width) / 2— recomputed, never guessed. - Right-aligned content is
left = 1000 - width - 60.
Changing width on centred content changes left too, and they are two separate
writes. Read the neighbours' boxes first and land on the column they are already
using; a lone element 8px off the shared left edge reads as a mistake even though
nothing overflows.
There is no alignment operation. Every position is an explicit number you
write to that element's own left / top / width / height, one path per call,
computed from the neighbours you read. Aligning a row means giving each element the
number the row already uses — not asking the page to tidy itself.
Text is sized by table, not by eye
A text element has 10px padding on all four sides, so its usable area is
(width - 20) × (height - 20), and heights come from one table
(line-height 1.5, padding included):
| Font size | 1 line | 2 lines | 3 lines | 4 lines | 5 lines |
|---|---|---|---|---|---|
| 14px | 43 | 64 | 85 | 106 | 127 |
| 16px | 46 | 70 | 94 | 118 | 142 |
| 18px | 49 | 76 | 103 | 130 | 157 |
| 20px | 52 | 82 | 112 | 142 | 172 |
| 24px | 58 | 94 | 130 | 166 | 202 |
| 28px | 64 | 106 | 148 | 190 | 232 |
| 32px | 70 | 118 | 166 | 214 | 262 |
| 36px | 76 | 130 | 184 | 238 | 292 |
When you replace an element's words, re-derive its height instead of keeping the old one:
characters_per_line = (width - 20) / font_size. Keep the longest line at ≤ 75% of that; past 100% the text wraps and takes a row you did not budget.- Count the lines your new content needs — one per
<p>, plus a wrap for every paragraph overcharacters_per_line— then add ~0.8 of a line of slack and round up. - Look the height up against the largest font size present in the content, not the average.
Height is a container, not a clamp: overflowing text spills past the box rather than shrinking, and the page shows the spill. The fix order is shorten the words, then step to the next table row, then widen the box — in that order, because a slide that needs a bigger box usually needs fewer words.
The type scale
| Content | Size |
|---|---|
| Main title | 32-36px |
| Subtitle | 24-28px |
| Key points | 18-20px |
| Body | 16-18px |
| Caption | 14-16px |
Levels stay 2-4px apart and everything at one level uses one size. When you touch an element, take its size from the siblings that share its role on that page rather than from this table fresh — the page's own scale wins, and this table is how you recognise which level an element belongs to.
Size lives in the content HTML, as inline font-size on the <p> — there is
no font-size field to write. So changing a size means writing the whole content
string back, which means you have to know the markup you are replacing.
What the renderer really does with your HTML
The content of a text element is an HTML string, and this page's CSS resets
most tag semantics. Four consequences decide how you write rich text:
<ul>/<ol>render without markers. The stylesheet's reset stripslist-styleand the indent, and the rule that puts them back is scoped to the browser editor — not to classroom playback. A list sent as<ul><li>…</li></ul>
常见问题
幻灯片画布的尺寸是多少?
技能说明,画布为 1000 × 562.5 单位,每边留有 50 单位的边距。
它涵盖颜色修正吗?
涵盖。技能包含对比色组合以及颜色修正的规则。
它会自动对齐元素吗?
不会。技能说明,没有对齐操作,因此每个位置都必须明确设置。
详情
作者的原始描述
The design law of a slide page — canvas geometry, the text height table, the type scale, contrast pairs, spacing rhythm, and which element type carries which content. Load it when patching slide elements one at a time, when a fix is about colour or contrast, when text has to grow or shrink inside a box, when a page feels crowded or empty, or when replacement content needs real rich-text structure. It is the standard `page-clone` and `pro-editing` edit against, not a procedure of its own — those two decide which pages to touch and in what order, this one decides what a good page looks like when
repo: THU-MAIC/OpenMAIC
热度
- GitHub 星标
- 42k
- 排名
- #6409
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
build-personal-skill
42k帮你的智能体把你过去的课程制作记录和聊天内容,基于你自己历史中的规律,整理成一份可重复使用的个人技能。
curriculum-planner
42k帮你的智能体规划一系列相互关联的课程,例如七天课程或按章节拆分的书籍,并在你批准后逐一制作。
deep-interactive
42k帮你的智能体设计一门课程,让学习者在大多数页面上操作模拟、图表、代码和游戏,而不是只看幻灯片。
deep-research
42k帮你的智能体制作关于近期或事实性主题的课程,先研究实时来源,并让每项论断都对应一个已核实的来源。