Agent skill

OpenMAIC Stage Document Map

by THU-MAIC in THU-MAIC/OpenMAIC

Maps the structure of an OpenMAIC stage document so an agent can find the right path, read it and patch quizzes, widgets, actions and project pages without guessing.

MITAuto-check passedEducation

Install OpenMAIC Stage Document Map

skills CLI
$ npx skills add THU-MAIC/OpenMAIC --skill stage-dsl -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install THU-MAIC/OpenMAIC stage-dsl --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/THU-MAIC/OpenMAIC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/agent-runtime/stage-dsl .claude/skills/stage-dsl && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stage-dsl
GitHub stars
40k
Token cost
~2.4k tokens
SKILL.md length
1,133 words
Files
5 (incl. references)
Skills in repo
25
Repo updated
First seen
Licence
MIT

At a glance

Maps the structure of an OpenMAIC stage document so an agent can find the right path, read it and patch quizzes, widgets, actions and project pages without guessing.

  • Works in 6 steps: Read the target scene with… → Locate the exact field and array index… → Load the matching field-reference… → …
  • Patching a part of a stage you have not edited before
  • SKILL.md covers The document model, Tool vocabulary, Addressing with read_stage and Writing with patch_stage, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

A stage holds metadata, an outline that records the generation plan, and an ordered list of scenes shown as pages. Each scene's `type` must match its `content.type`. The skill is a map, not a field manual: it explains which subtree owns a value, which path to read, and which reference chapter to load before writing anything.

It lays out the tool vocabulary: `read_stage` to inspect a path, `patch_stage` to edit scene content or actions with JSON Pointer operations, `grep_stage` for literal search, `list_folder_stages` for stage ids, `edit_deck` for inserting, deleting, reordering or retitling pages, and `create_stage`, `generate_scene` and `set_roster` for building a new stage. Scenes can be addressed by order or id, and a compact tree view helps find a target while the source view gives the exact JSON.

Field-level references cover actions, project-based learning, quizzes and interactive widgets. Orders are counted from one while array indices inside source JSON start at zero, and large inline media is shown as a read-only placeholder when reading. The separate slide-dsl skill remains the full manual for slide canvases.

When your agent uses it

  • Patching a part of a stage you have not edited before
  • Recovering after patch_stage rejects an operation
  • Locating the field that holds a quiz question, widget or action
  • Deciding whether a change needs edit_deck instead of patch_stage

Example prompts

  • “Read scene 3 of this stage and change the wording of its first quiz question.”
  • “patch_stage rejected my last edit. Work out the right path and retry.”
  • “Search the whole stage for the word photosynthesis and list which scenes mention it.”
  • “Move the quiz scene so it becomes the last page of the lesson.”

Requirements

  • An OpenMAIC stage with the read_stage, patch_stage and grep_stage tools available

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Read the target scene with detail:"source".
  2. Locate the exact field and array index in that source.
  3. Load the matching field-reference chapter below if this structure is new to
  4. Patch the smallest leaf that expresses the intent.
  5. Read the same source path again and verify the stored value.
  6. Use detail:"text" or grep_stage when the check is “no old copy remains.”

What it can do on your machine

Read from SKILL.md and the folder at commit 7d324aa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

OpenMAIC Stage Document Map loads about 2.4k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 125 tokens; SKILL.md has 1,133 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~125
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from THU-MAIC/OpenMAIC at commit 7d324aa, republished under its MIT licence (© THU-MAIC). 1,133 words, ~2,358 tokens.

Download SKILL.mdSave it as .claude/skills/stage-dsl/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
stage-dsl
description
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.
title
课堂文档结构

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:

text
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

NeedToolHow
Read a sceneread_stage`path:/scenes/<order
Edit scene content or actionspatch_stage`target:/scenes/<order
Search visible text or sourcegrep_stageliteral search over the whole stage
List stages in folderslist_folder_stagesreturns the explicit stageId required by every stage tool
Insert, delete, reorder, or retitle pagesedit_deckpage-list operations stay outside the document patcher
Plan and build a new stageconversation + create_stage + generate_scenesettle the page plan in conversation, then call generate_scene once per page with an explicit brief
Set the classroom castset_rosterwrite the settled roster before page generation

Addressing with read_stage

PathResolves to
"" or omittedthe whole stage
/outlinethe persisted outline snapshot
/scenes/3the scene whose order is 3
/scenes/scene_abcthe scene with that stable id
/scenes/scene-abcthe historical hyphenated scene-id form
/scenes/3/actionsonly 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.

OpFieldsMeaning
setpath, valuereplace an existing leaf or add an optional object key
removepathdelete an existing object key or splice an array index
str_replacepath, oldText, newText, optional replaceAllreplace one exact occurrence of oldText inside the string field at path; replaceAll:true replaces every occurrence
add_elementelement, optional afterId or indexadd one complete id-less slide element
delete_elementelementIddelete one slide element by stable id

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

text
/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 exist. set may create only the final object key. remove requires the final key or array slot to exist.

For a change inside a large HTML document or long text field, prefer str_replace over rewriting the whole field with set: transcribing 27 KB of HTML to change one number is expensive, and any transcription error silently corrupts the page. Read detail:"source", pick a short unique anchor, replace it, then read back and grep_stage to verify. oldText must appear exactly once in the stored string; on multiple matches extend the anchor or set replaceAll:true. Neither oldText nor newText may contain a read-side media omission placeholder; newText may be empty to delete the anchor.

Scene metadata is not writable here. Paths must begin /content/ or /actions/; use edit_deck for page metadata and page-list changes.

Show full SKILL.md (482 more words)Show less

Finding with grep_stage

scope:"text" searches the visible-text projection. scope:"source" searches serialized scene JSON, including field names and internal data.

Search is literal, case-insensitive, and applies NFKC to both query and source. Thus half-width AI finds full-width AI. Result start and end still slice the original, unnormalized scene string correctly.

A call returns at most 10 matches per scene and 30 overall, within its time and character budget. truncated:true always includes an opaque cursor. Repeat the same query, scope, and stage with that cursor to continue.

Read before write

For every edit:

  1. Read the target scene with detail:"source".
  2. Locate the exact field and array index in that source.
  3. Load the matching field-reference chapter below if this structure is new to you or a previous patch was rejected.
  4. Patch the smallest leaf that expresses the intent.
  5. Read the same source path again and verify the stored value.
  6. Use detail:"text" or grep_stage when the check is “no old copy remains.”

Never build a patch from tree; it intentionally omits neighbouring fields.

Never copy a <… bytes omitted: …> media placeholder into a write. Supply a new real URL/src or leave that field untouched.

Route to the field manual

What you need to writeRead this first
Slide canvas, background, theme, any of the ten slide element typesRead the installed slide-dsl skill at the location shown in <available_skills>. It is the complete manual and its examples already use scene-root /content/canvas/... pointers.
Quiz questions, options, answers, grading fieldsreferences/quiz.md
Interactive HTML or typed widget configurationreferences/widget.md
Narration, spotlight, whiteboard, video, discussion, or widget playback actionsreferences/actions.md
PBL projectV2 roles, milestones, microtasks, packaged design, or runtime-owned fieldsreferences/pbl.md

Validation boundary

Slides use the closed slide element schema and reject unknown fields, wrong types, missing required fields, id changes, and element-type changes.

Quiz writes add a closed question/option check around the current document validator. Interactive content is closed at its content root, but historical widgetConfig objects remain intentionally tolerant below that root. PBL is closed at its content root, while the existing projectV2 validator requires its core containers and deliberately tolerates historical runtime extension fields.

That difference matters: “accepted” means the current persisted contract accepted the shape, not that every value is pedagogically sound or every renderer consumes it. The reference chapters name the hard boundary and the known semantic boundary separately.

Hard rules

  • Read source before every patch and read it again afterward.
  • Patch one leaf when one leaf is enough.
  • Use scene-root paths: /content/... and /actions/....
  • For a change inside a large HTML or long text field, use str_replace with a short unique anchor instead of rewriting the whole field.
  • Use add_element and delete_element for slide element identity changes.
  • Do not use patch_stage for page insertion, deletion, reordering, or titles.
  • Do not write media omission placeholders.
  • A rejected atomic batch changed nothing.
  • When uncertain, stop guessing and read the matching reference chapter.

© THU-MAIC, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/agent-runtime/stage-dsl of THU-MAIC/OpenMAIC.

  • SKILL.md
  • references/actions.md
  • references/pbl.md
  • references/quiz.md
  • references/widget.md

Open the folder on GitHubat commit 7d324aa

Compare with similar skills

OpenMAIC Stage Document Map next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

OpenMAIC Stage Document Map compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
OpenMAIC Stage Document Map this skillTHU-MAIC/OpenMAIC40k—~2.4kAutomated safety check: PassMIT
Codebase to Coursezarazhangrui/codebase-to-course5.7k—~4.4kAutomated safety check: PassNone
Claude Code Self-Assessment Advisorlhfer/claude-howto-zh-cn2.3k—~1.7kAutomated safety check: PassMIT
Lesson Generatordair-ai/dair-academy-plugins6142 repos~1.1kAutomated safety check: PassMIT
Canvas Reading AnnotationX-isdoingreat/canvas-pilot125—~8.4kAutomated safety check: NotesAGPL-3.0
Content Evaluation Frameworkaiskillstore/marketplace433—~3kAutomated safety check: PassNone

Similar skills

  • Codebase to Course

    zarazhangrui/codebase-to-course

    Turns a codebase into an interactive single-page HTML course for non-technical learners, with scroll modules, animated diagrams, quizzes and plain-English code translations.

    5.7k GitHub stars~4.4k tokensUpdated 6 mo ago
    EducationAuto-check passed
  • Claude Code Self-Assessment Advisor

    lhfer/claude-howto-zh-cn

    Quizzes you on Claude Code in a quick or deep mode, scores your level across 10 topics and recommends what to learn next, in Chinese.

    2.3k GitHub stars~1.7k tokensUpdated 2 mo ago
    EducationAuto-check passed
  • Lesson Generator

    dair-ai/dair-academy-plugins

    Builds a self-contained multi-lesson course page with lesson navigation, objectives, flashcards, quizzes and source links, as plain HTML, CSS and JavaScript.

    614 GitHub starsUsed in 2 repos~1.1k tokens
    EducationAuto-check passed
  • Canvas Reading Annotation

    X-isdoingreat/canvas-pilot

    Generic reading-annotation handler for academic-writing courses — annotates reading PDFs with color-coded highlights + margin notes + filled answer blanks per the instructor's rubric.

    125 GitHub stars~8.4k tokensUpdated 2 mo ago
    EducationAuto-check: notes
  • Content Evaluation Framework

    aiskillstore/marketplace

    This skill should be used when evaluating the quality of book chapters, lessons, or educational content.

    433 GitHub stars~3k tokensUpdated yesterday
    EducationAuto-check passed
  • DeepTutor CLI

    HKUDS/DeepTutor

    Teaches the agent to set up and run DeepTutor from the command line: chat and capabilities, knowledge bases, partners, memory, sessions, notebooks and the server or Web app.

    41k GitHub stars~2.8k tokensUpdated 3 days ago
    EducationAuto-check passed

More from THU-MAIC/OpenMAIC

All 25 skills in this repo
  • Guides setup, classroom generation and secondary development for OpenMAIC, the multi-agent interactive classroom, one confirmed phase at a time.

    40k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check: notes
  • Designs a Chinese K-12 classroom for one OpenMAIC stage around the core-literacy model, using authentic tasks, performance assessment and observable evidence.

    40k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Designs a review-and-practice lesson around an independent first attempt, targeted feedback, supported practice, a fresh independent check and a next step.

    40k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Derives a reusable personal skill for course-making from a representative sample of the user's own past classrooms and chat history, confirmed with them before saving.

    40k GitHub stars~678 tokensUpdated yesterday
    Auto-check passed
  • Curriculum Planner

    THU-MAIC/OpenMAIC

    Plans a multi-classroom series such as a seven-day course, clarifies the brief in rounds, gets sign-off on the full lesson list, then builds each stage in a shared folder.

    40k GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Plans online courses so learners manipulate simulations, diagrams, code, games or 3D scenes on most pages, with slides only for the opening and the close.

    40k GitHub stars~681 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about OpenMAIC Stage Document Map

What does OpenMAIC Stage Document Map do?

Maps the structure of an OpenMAIC stage document so an agent can find the right path, read it and patch quizzes, widgets, actions and project pages without guessing. A stage holds metadata, an outline that records the generation plan, and an ordered list of scenes shown as pages.type`.

When should I use OpenMAIC Stage Document Map?

OpenMAIC Stage Document Map fits situations like: patching a part of a stage you have not edited before; recovering after patch_stage rejects an operation; locating the field that holds a quiz question, widget or action; deciding whether a change needs edit_deck instead of patch_stage.

How do I install OpenMAIC Stage Document Map in Claude Code?

Run `npx skills add THU-MAIC/OpenMAIC --skill stage-dsl -a claude-code`. Or copy the skill folder (skills/agent-runtime/stage-dsl in THU-MAIC/OpenMAIC) into .claude/skills/stage-dsl in your project. Claude Code loads it when a task matches its description.

How do I install OpenMAIC Stage Document Map in Codex?

Run `npx skills add THU-MAIC/OpenMAIC --skill stage-dsl -a codex`. Or copy the skill folder (skills/agent-runtime/stage-dsl in THU-MAIC/OpenMAIC) into .agents/skills/stage-dsl in your project. Codex loads it when a task matches its description.

Can I use OpenMAIC Stage Document Map in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add THU-MAIC/OpenMAIC --skill stage-dsl -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stage-dsl, .gemini/skills/stage-dsl, .github/skills/stage-dsl and .opencode/skills/stage-dsl in your project.

What does OpenMAIC Stage Document Map need to run?

SKILL.md names no scripts, command-line tools or credentials: OpenMAIC Stage Document Map is instructions for the agent only. Our summary lists: An OpenMAIC stage with the read_stage, patch_stage and grep_stage tools available.

Does OpenMAIC Stage Document Map access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is OpenMAIC Stage Document Map safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does OpenMAIC Stage Document Map use?

OpenMAIC Stage Document Map is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does OpenMAIC Stage Document Map use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to OpenMAIC Stage Document Map?

Skills that share tags, products or a category with OpenMAIC Stage Document Map: Codebase to Course (zarazhangrui/codebase-to-course, 5.7k stars), Claude Code Self-Assessment Advisor (lhfer/claude-howto-zh-cn, 2.3k stars), Lesson Generator (dair-ai/dair-academy-plugins, 614 stars) and Canvas Reading Annotation (X-isdoingreat/canvas-pilot, 125 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains OpenMAIC Stage Document Map?

THU-MAIC (a GitHub organization) maintains it in THU-MAIC/OpenMAIC, which has 40,274 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 10, 2026.

Source: THU-MAIC/OpenMAIC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.