apply-comments
它能做什么
这个技能会读取 open-slide 编辑器在幻灯片文件中留下的评论标记,然后逐条完成所需修改。适合在 open-slide 编辑器中审阅幻灯片,并希望反馈被落实的人。
适用场景
- ✓当你请智能体应用幻灯片编辑器中留下的评论时。
- ✓当你希望处理并清除幻灯片文件中的检查器评论时。
- ✓当你希望根据页面上的评论完成颜色或文字修改时。
技能链接
https://github.com/open-slide/open-slide/blob/main/packages/core/skills/apply-comments/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请应用我在编辑器中对第 3 张幻灯片留下的评论,完成后删除标记。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会在幻灯片文件中找到每个评论标记,读取备注以及它指向的元素或区域,按照幻灯片编写规则进行修改,然后删除该标记。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Apply slide comments
The open-slide editor has a comment mode that lets the user click a rendered page element, or drag across a region of the page, and attach a textual comment (e.g. "make this red", "change to 'Open Slide Rocks'"). Each comment is persisted as an in-source JSX marker inside slides/<slideId>/index.tsx.
Your job: read those markers, perform the described edits, and delete the markers.
Before making any page edit, consult the
slide-authoringskill — it is the technical reference for howslides/<id>/index.tsxis structured (canvas, type scale, palette, assets, file contract). A comment like "make this bigger" or "change the accent colour" should be applied in a way that stays consistent with those rules.
Marker format
{/* @slide-comment id="c-<8hex>" ts="<ISO>" text="<base64url(JSON)>" */}
Sits as the first child inside the JSX element it refers to (i.e. between that element's opening
>and its other children). The marker is dropped into its target, not floated above it. Newly written markers get a line of their own; older ones may share a line with the content that follows them.textis base64url-encoded JSON:{"note": "...", "hint"?: "...", "rect"?: {"x", "y", "w", "h"}, "page"?: n}.rectis present when the comment was left on a dragged region rather than on an element. Values are pixels on the 1920×1080 page canvas, measured from the page's top-left corner. The marker still sits inside the deepest element that contains the region, but the note refers to what is inside that region — possibly several children, or only part of the enclosing element.pageis the 0-based index (into the default export array) of the page the comment was left on.
Detection regex (authoritative — use exactly this):
/\{\/\*\s*@slide-comment\s+id="(c-[a-f0-9]+)"\s+ts="([^"]+)"\s+text="([A-Za-z0-9_\-]+={0,2})"\s*\*\/\}/g
Procedure
Identify the target slide(s).
- If the user names one (
getting-started,q2-roadmap, etc.), work on that singleslides/<slideId>/index.tsx. - If they say "all" or don't specify, scan every
slides/*/index.tsx. Process each slide one at a time.
- If the user names one (
Read the file and find all markers.
- Run the regex above against the whole file.
- For each match, base64url-decode
textandJSON.parseit to get{ note, hint?, rect?, page? }. - Record each hit as
{ id, lineIndex (0-based), note, hint, rect, page }. - If there are no markers, tell the user and stop.
Understand each comment in context.
- The targeted JSX element is the enclosing element of the marker — i.e. read upward from the marker line until you reach the unclosed JSX opening tag whose body the marker lives in. That element is the target. (For self-closing elements like
<img />, the inspector hoists the marker to the nearest non-self-closing ancestor; in that case the comment usually refers to a child of the enclosing element rather than the enclosing element itself — use thenotetext to disambiguate.) - Read enough surrounding code (parent element, sibling elements, inline styles) to apply the change faithfully. A comment inside a
<div>with an inlinebackgroundstyle usually refers to that element's styling, for example. - When the payload has a
rect, work out which children of the enclosing element fall inside that region (compare their positions and sizes against the rect on the 1920×1080 canvas) and apply the note to those — not to the whole enclosing element. - If the
noteis ambiguous, do the smallest reasonable interpretation and mention the assumption in your summary.
- The targeted JSX element is the enclosing element of the marker — i.e. read upward from the marker line until you reach the unclosed JSX opening tag whose body the marker lives in. That element is the target. (For self-closing elements like
Apply edits in reverse line order.
- Sort markers by descending
lineIndexand process one at a time, using theEdittool. - Processing top-down would invalidate line numbers for later markers as the file shrinks/grows.
- Sort markers by descending
Remove each marker after applying its edit.
- Delete the marker token. If nothing else is left on that line, delete the whole line including its trailing
\n; if content shares the line, keep that content. - Never leave a marker behind for an edit you applied — that signals a failure. Markers deliberately skipped per the edge cases below stay in place.
- Delete the marker token. If nothing else is left on that line, delete the whole line including its trailing
Verify.
- After all edits, re-read the file and confirm the only remaining markers are ones you reported as skipped.
- Confirm the edited JSX is well-formed (balanced tags, no dangling attributes).
常见问题
评论存放在哪里?
以小段标记行的形式存放在幻灯片的索引文件中,位于每条评论所指的元素内。
修改会遵循幻灯片的风格吗?
会。技能会按照 open-slide 的编写规则进行每项修改,因此保持一致。
标记会被删除吗?
会。每个标记在其评论应用后都会被删除。
详情
作者的原始描述
Apply pending @slide-comment markers written by the open-slide inspector tool. Use when the user asks to "apply comments", "process slide comments", "apply the inspector comments", or references markers left inside `slides/<id>/index.tsx`.
repo: open-slide/open-slide
热度
- GitHub 星标
- 9.6k
- 排名
- #12218
- 许可证
- MIT
- 更新时间
- 2026/10/29
评论
- …
同一仓库的更多技能
create-slide
9.6k帮你的智能体在 open-slide 项目中起草新的幻灯片或演示文稿,选择主题并为你编写页面文件。
create-theme
9.6k帮你的智能体为 open-slide 项目创建可复用的幻灯片主题,包括配色、字体和版式,并附上实时预览文件。
current-slide
9.6k帮你的智能体找出你在 open-slide 查看器中正在看的幻灯片、页面和元素,让“这一页”指向正确的内容。
slide-authoring
9.6k为你的智能体提供编写 open-slide 页面的技术规则,包括画布尺寸、字号比例、颜色、图片、备注和过渡效果。