current-slide
它能做什么
这个技能会读取 open-slide 查看器中的实时位置,例如你所在的幻灯片和页面,以及你选中的任何元素。适合用指向查看器中的内容、而不是用名称来指代它们的人。
适用场景
- ✓当你没有说出幻灯片名称,只说“修改这一页”或“改这个标题”时。
- ✓当你询问你现在正在看的幻灯片时。
- ✓当你在查看器中选中某个元素,并希望对其进行修改时。
技能链接
https://github.com/open-slide/open-slide/blob/main/packages/core/skills/current-slide/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我正在看的这张幻灯片上的这个标题改大一点。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会读取一个小文件,open-slide 开发服务器会在每次页面切换和选择变化时更新该文件。你的智能体每次请求时都会重新读取,因为自上次检查以来你可能已经切换到其他幻灯片。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Where is the user right now?
When the user says "fix this page", "tweak this heading", or "the slide I'm looking at", they almost never name the slide id, page number, or element — they mean wherever they are in the dev viewer. Before asking "which slide?" or "which element?", check the file the dev server writes on every navigation and inspector pick.
Re-read on every deictic turn — never reuse a prior read
current.json is a live cursor, not a fact about the conversation. The user moves between slides, pages, and elements freely between your turns — including while you were doing other work. Read the file fresh at the start of every new turn that uses a deictic reference, even if:
- you already read it earlier in this same conversation,
- you just finished editing the slide it pointed to,
- the user's new message sounds like a continuation ("now make it bigger", "also fix this one", "keep going").
A "continue editing" follow-up is exactly the case where the user has likely just navigated to a different slide or picked a different element. Trusting your last read here will silently edit the wrong file. Re-read, compare slideId / pageIndex / selection against what you used last time, and act on the new values.
How to read it
node_modules/.open-slide/current.json
Path is relative to the project root (the user's cwd, the directory that contains slides/ and package.json). Use the Read tool. The file is JSON.
What you get
{
"slideId": "q2-roadmap",
"pageIndex": 2,
"pageNumber": 3,
"totalPages": 8,
"slideTitle": "Q2 Roadmap",
"view": "slides",
"pagePath": "slides/q2-roadmap/index.tsx",
"selection": {
"line": 42,
"column": 6,
"tagName": "h1",
"text": "Q2 Roadmap"
},
"updatedAt": "2026-05-09T14:32:11.123Z"
}
slideId— folder name underslides/. Use as-is for any/__slides/<id>/...API or as the URL segment.pageIndex— 0-based, for use with the page array inindex.tsx(export default [Cover, Body, ...]).pageNumber— 1-based, for use in messages to the user ("page 3 of 8") and for the URL?p=N.pagePath— relative path to the slide source. Hand straight toRead/Edit.view—"slides"(canvas view) or"assets"(asset manager). If"assets", the user is browsing files for that slide rather than viewing a page.selection—nullif nothing is selected. Otherwise, the JSX element the user picked in the inspector overlay:line(1-indexed) andcolumn(0-indexed) point to the JSX opening tag insidepagePath. This is the canonical handle — match against the source line, not the rendered DOM.tagNameis the rendered DOM tag, lowercased ("h1","div","img").textis a trimmed text snippet (≤120 chars) from the element'stextContent, useful as a sanity check that you're looking at the right node.- Selection auto-clears whenever the user navigates to a different slide or page.
updatedAt— ISO timestamp of the last navigation or selection change. Use it to detect staleness.
When to use this
- The user references the current slide/page deictically: "this", "here", "the page I'm on", "the slide I'm looking at", "what I'm working on".
- The user references a specific element: "this heading", "this image", "the button I just clicked", "tighten this", "change the color of this". If
selectionis non-null, that's the element they mean. - Before asking "which slide?" or "which element?" as a clarifying question — check this file first.
- Before guessing from
git log, recently-edited files, or the most recent slide folder.
When NOT to use this
- The user names a slide explicitly ("edit
q2-roadmap") — use that name directly. - The
apply-commentsworkflow already finds the right file via@slide-commentmarkers; it doesn't need this skill. - For listing or discovering slides — read
slides/directly.
Staleness — verify before acting
updatedAt is the last time the user navigated. Treat it like a cache:
- Fresh (under ~5 minutes old): trust it. Open
pagePath, do the work. - Older than ~5 minutes: confirm with the user before editing. The dev server may not be running; the user may have switched contexts.
- Hours/days old: ignore it. Ask the user which slide they mean.
A newer updatedAt than the one you saw last turn is the normal signal that the user has moved — switch to the new slideId / pageIndex / selection without as
常见问题
为什么每次都要读取文件?
你可能已经切换到了另一张幻灯片或元素,旧的读数可能会修改错误的幻灯片。
这个文件在哪里?
在项目 node_modules 文件夹中的隐藏 open-slide 文件夹里。
开发服务器需要正在运行吗?
需要。该文件是 open-slide 开发服务器在运行期间写入的。
详情
作者的原始描述
Resolve which slide, page, and (optionally) selected element the user is currently viewing in the open-slide dev server. Consult this whenever the user references "this page", "this slide", "this element", "the slide I'm on", "the current page", or any deictic reference to slide content without naming it. Re-read `node_modules/.open-slide/current.json` at the start of every such turn — the user navigates between turns, so a value you read earlier in the conversation is almost certainly stale.
repo: open-slide/open-slide
热度
- GitHub 星标
- 9.6k
- 排名
- #12221
- 许可证
- MIT
- 更新时间
- 2026/10/29
评论
- …
同一仓库的更多技能
apply-comments
9.6k帮你的智能体应用你在 open-slide 编辑器中对幻灯片留下的评论,逐条完成所需修改,并删除标记。
create-slide
9.6k帮你的智能体在 open-slide 项目中起草新的幻灯片或演示文稿,选择主题并为你编写页面文件。
create-theme
9.6k帮你的智能体为 open-slide 项目创建可复用的幻灯片主题,包括配色、字体和版式,并附上实时预览文件。
slide-authoring
9.6k为你的智能体提供编写 open-slide 页面的技术规则,包括画布尺寸、字号比例、颜色、图片、备注和过渡效果。