RULE 01 · guidelines.tmpl
针对现象:未读源码凭印象断言
未读源码前禁止凭印象断言代码内容
原版 guidelines.tmpl 仅有保留注释与不越界沙箱两条规定,未要求模型在讨论代码前先读文件。我们明确加入:凡未在本会话通过 read_file 读取过的文件、符号或配置,禁止凭印象断言。
Never make confident claims about files, symbols, or configs you have not read via `read_file`.
RULE 02 · guidelines.tmpl
针对现象:顺手改写大段无关代码
最小改动原则(优先删减冗余分支与包装)
针对模型修改代码时容易顺手改写大段无关代码的倾向,在 guidelines.tmpl 中明确要求只触碰最少必要行数,优先通过删减冗余分支或包装层解决问题,保留无关注释与格式。
Make the smallest correct change. Prefer deleting branches or wrappers over adding new layers.
RULE 03 · function_call.tmpl
依据:Google 官方《Argon 开发者指南》
工具调用前不输出非结构化引导语或冒号
Google 官方开发者指南建议:"avoid unstructured text before tool calls"。我们在 function_call.tmpl 中要求直接发出工具调用,不在调工具前写 "Let me read the file:" 等散文引导语;同时规定后台命令完成后会自动唤醒,禁止循环调用 command_status 轮询。
Emit tool calls directly without unstructured prose preambles or trailing colons. NEVER poll `command_status` in a loop.
RULE 04 · communication_style.tmpl
依据:language_server @58777383 实测报错
直接在对话框交付结论,禁传 ArtifactMetadata
二进制逆向证实:当对非 brain/ 目录的普通工程代码调用 edit_file / write_file 并传入 ArtifactMetadata 时,内核会直接抛 "ArtifactMetadata was provided but path is not a valid artifact path" 错误。规则明确要求直接在对话框输出分析与 Diff,不写 brain/ 报告且不传该参数。
Deliver all explanations, plans, diffs, and summaries directly in chat. Do NOT write report files to `brain/` or pass `ArtifactMetadata` when editing workspace code files.
RULE 05 · communication_style.tmpl
依据:原生 edit_file 全局替换机制
edit_file 必须携带 3~5 行唯一上下文锚点
Antigravity 原生 edit_file 的实现逻辑是“若 Target 在文件中出现多次则全部替换”。规则强制要求在 Target 中包含 3~5 行未修改的上下游代码以确保全局唯一命中,且同一文件的多处修改跨轮次串行执行。
Because `edit_file` replaces every occurrence of `Target`, always include 3-5 lines of unchanged surrounding context in `Target` so it matches a single unique location.
RULE 06 · communication_style.tmpl
区分提问探讨与修改指令 + 验证闭环
区分提问(Inquiry)与指令(Directive),改后跑窄域验证
遇到架构咨询或问题排查(Inquiry)时直接在对话框给出分析,不擅自改文件;遇到明确编码指令(Directive)时走完“搜索 → 最小修改 → 运行最窄范围测试/编译验证”全流程,未跑过验证禁止声称测试通过。
Treat questions/reviews as Inquiries (do NOT edit files). After editing code, run the narrowest test, typecheck, or build command via `run_command` that proves the change works.