跳到正文
Skillpedia
通用编程42k · #6412

stage-dsl

它能做什么

这个技能是 OpenMAIC 课堂背后结构的地图,说明哪一部分保存哪个值。适合直接读取或编辑课堂的人或 AI。

适用场景

  • ✓当你需要找到某个值在课堂中的存储位置的时候。
  • ✓当课堂的编辑被拒绝,你需要了解原因的时候。
  • ✓当你需要在课堂的所有页面中搜索文字的时候。

技能链接

https://github.com/THU-MAIC/OpenMAIC/blob/main/skills/agent-runtime/stage-dsl/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/THU-MAIC/OpenMAIC/blob/main/skills/agent-runtime/stage-dsl/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请找出这间课堂中所有提到“预算”一词的页面,并告诉我每一处存储在哪里?”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会使用课堂的读取、编辑和搜索工具,并依照这份地图,在写入前选择结构中正确的部分。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

The stage document map

This is a map, not the field manual.

Use it to decide which subtree owns a value, which path to read, and which reference chapter to load. Then read the exact source before writing.

The document model

The durable structure is:

stage
├── outline
└── scenes[]                    ordered by scene.order, shown as pages 1..N
    ├── id                     stable scene identity
    ├── order                  1-based page position
    ├── type                   slide | quiz | interactive | pbl
    ├── content                shape selected by scene.type
    │   ├── slide.canvas
    │   ├── quiz.questions[]
    │   ├── interactive.html / widgetConfig
    │   └── pbl.projectV2
    └── actions[]              ordered playback verbs

stage is the stage's metadata. outline is the generation plan. A persisted page is a scene. Its type and content.type must agree.

The three generic tools do not replace page-list operations. Insert, delete, reorder, and retitle pages with edit_deck.

Tool vocabulary

Need Tool How
Read a scene read_stage `path:/scenes/<order
Edit scene content or actions patch_stage `target:/scenes/<order
Search visible text or source grep_stage literal search over the whole stage
List stages in folders list_folder_stages returns the explicit stageId required by every stage tool
Insert, delete, reorder, or retitle pages edit_deck page-list operations stay outside the document patcher
Plan and build a new stage conversation + create_stage + generate_scene settle the page plan in conversation, then call generate_scene once per page with an explicit brief
Set the classroom cast set_roster write the settled roster before page generation

Addressing with read_stage

Path Resolves to
"" or omitted the whole stage
/outline the persisted outline snapshot
/scenes/3 the scene whose order is 3
/scenes/scene_abc the scene with that stable id
/scenes/scene-abc the historical hyphenated scene-id form
/scenes/3/actions only scene 3's action array

Orders are 1-based. Array indices inside source JSON are 0-based.

detail:"tree" is the compact structural inventory. It reports scene id, order, type, title, element/question/project counts, and action counts. It is for finding a target, never for reconstructing a write value.

detail:"source" is the exact JSON at the selected path. A scene source is the persisted scene object, so writable pointers begin /content/... or /actions/.... Inline media bytes larger than 2 KiB are replaced in this read projection by a read-only placeholder. The stored document is unchanged.

detail:"text" is the visible-text projection. Use it to find learner-facing copy or prove that old wording no longer remains. It deliberately omits known internal PBL prompts and runtime state.

Source and text responses are character-paged after 12,000 characters. Pass the returned nextOffset back as offset until it disappears.

Writing with patch_stage

target is one scene path: /scenes/<order|sceneId>.

Every call carries a human intent and one or more ops. The ops are atomic: the server applies them to a clone, validates the resulting scene, and writes once. If op 2 fails, op 1 is not persisted.

Op Fields Meaning
set path, value replace an existing leaf or add an optional object key
remove path delete an existing object key or splice an array index
str_replace path, oldText, newText, optional replaceAll replace one exact occurrence of oldText inside the string field at path; replaceAll:true replaces every occurrence
add_element element, optional afterId or index add one complete id-less slide element
delete_element elementId delete one slide element by stable id

Set/remove/str_replace paths are JSON Pointers rooted at the scene source:

/content/canvas/elements/0/content
/content/questions/1/options/0/label
/content/widgetConfig/description
/content/projectV2/milestones/0/title
/actions/2/text

Escape / in an object key as ~1 and ~ as ~0. Array indices are canonical zero-based integers: 0, 1, 2, never 03, -1, or +1.

Every intermediate segment must exi

常见问题

有哪些页面类型?

技能列出幻灯片、测验、互动和 PBL 等页面类型。

如何添加或删除页面?

技能说明,插入、删除、重新排序和重命名页面应使用页面列表工具。

这是完整的字段指南吗?

不是。技能是一张地图,指向更详细的参考章节。

详情

作者的原始描述

The map for reading and editing an OpenMAIC stage document with read_stage, patch_stage, and grep_stage. Load it before patching a structure you have not patched before, when patch_stage rejects an operation, or whenever the path from a stage, outline, scene, content object, or action to the field you need is uncertain. It routes to field-level references for quizzes, interactive widgets, actions, and PBL projects; the installed slide-dsl skill remains the complete slide canvas manual.

repo: THU-MAIC/OpenMAIC

热度

GitHub 星标
42k
排名
#6412
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能