给 AI Agent 的 Mod 开发指引Mod development guide for AI agents
一份自包含的 Markdown 文档,把本站的规则、模板、接口速查和自检清单压缩在一起。让 AI 编码代理先读它,再动手写 Mod。 One self-contained Markdown document that condenses this site's rules, templates, API cheat sheet and checklist. Have your AI coding agent read it before it writes a mod.
怎么用How to use it
| 你的 AgentYour agent | 做法What to do |
|---|---|
| 能联网读取网页Can fetch web pages | 把下面的文档地址发给它。文档里的相对链接指向同目录的数据文件,Agent 可以继续读取表和字段。Give it the document URL below. Relative links in the document point at the data files next to it, so the agent can go on to read tables and fields. |
| 只能读本地文件Reads local files only | 下载 agent-guide.md 放进工作目录;需要查字段时再下载 数据文件放在它旁边的 data/ 目录。Download agent-guide.md into the working folder; when fields need looking up, also download the data files into a data/ folder next to it. |
| 聊天窗口A chat window | 点“复制全文”,粘贴到对话开头,再描述你想做的 Mod。Click “Copy document”, paste it at the start of the conversation, then describe the mod you want. |
agent-guide.md
你正在从本地文件打开本站,上面是本地路径。站点部署后,这里会显示可以发给 Agent 的网址。 You opened this site from local files, so the above is a local path. Once the site is deployed, this shows the URL to give to an agent.
Agent 可读取的数据文件Data files agents can read
这些文件都是 window.X = <JSON>; 形式,取等号后的内容即严格 JSON。文档第 11 节有结构说明和读取示例。
Each file has the form window.X = <JSON>;; the part after the equals sign is strict JSON. Section 11 of the document explains the structure and shows how to read it.
| 文件File | 内容Contents |
|---|---|
| data/api-data.js | 全部配置表与字段、Mod 相关 C# 类型的签名、XML 结构、Lua 绑定配置Every table and field, signatures of mod-related C# types, XML schemas, Lua binding configuration |
| data/def-samples.js | 每张表的中文分类、行数、原版 ID 示例、首行字段值Each table's category, row count, sample built-in IDs and first-row values |
| data/script-api.js | 剧情脚本 mission 对象的全部方法Every method of the story-script mission object |
| data/meta.js | 数据对应的游戏版本与代码提交Game version and commit the data came from |
| llms.txt | 给自动发现文档的 Agent 用的入口索引Entry index for agents that discover documentation automatically |
文档内容The document
下面显示的就是 agent-guide.md 的内容。文档正文为中文,AI 代理可以直接阅读。
Below is the content of agent-guide.md. The document body is written in Chinese; AI agents read it directly.