# 让 LLM 编写 XML 森空岛 Wiki XML 相比原始 Wiki JSON 节省约 75% 原始字节和 87% 行数,显著降低了大语言模型(LLM)读写条目时的上下文消耗。但模型仍容易产生 HTML 习惯迁移错误(例如写 `

`、`` 或把 `` 当作普通图片)。本指南提供精简、可直接复用的约束清单。 ## 目标与前置 阅读本页后,你可以为任意 LLM 构造精简的系统提示词,把一次生成成功率最大化,并在输出后用转换器拦截常见幻觉错误。本指南面向 `@eihrteam/xml` v1.0.0。 ## 给 LLM 的精简格式速查 可直接将以下结构摘要放入提示词上下文中,只保留模型必须遵守的硬性约束: ```text root: required_children: - string - ......... - mixed_blocks optional_children: - ... - JSON object - ... chapter_modes (mutually exclusive): - common: mixed_blocks OR 1+ [] mixed_blocks - table="true": text|
text|
- audio="true": OR 1+ ... - dialog="true": 1+ of (plain||
| )*
| me..other messages | plain blocks: plain line,

..

, , ,
    /
      /
    1. ,