From e9f2e84b300ecbc9ffdb2e107e1acadb746468fc Mon Sep 17 00:00:00 2001 From: huanghaosheng <386998068@qq.com> Date: Fri, 30 Oct 2026 14:31:26 +0800 Subject: [PATCH] =?UTF-8?q?docs(agents):=20=E6=96=B0=E5=A2=9E=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E8=A7=84=E8=8C=83=EF=BC=8C=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E5=8F=A5=E5=AD=90=E7=BB=93=E6=9E=84=E4=B8=8E=E6=9C=AF?= =?UTF-8?q?=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交信息此前只靠习惯,没有成文标准。 本提交写入 ASD-STE100 的句子结构规则:一句话一个意思,动词在前,一个主题一段。 标识符原样保留。术语按代码注释和测试名的写法固定。 文档只规定怎么判断,不维护词表。 词表必然不全,读者会把"不在表里"误读成"都可以改写"。 --- AGENTS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index aa9751d..cedf680 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -243,3 +243,15 @@ Configure endpoints through env vars (`RABBITMQ_TEST_URL`, …), never hardcoded - Never weaken, skip, or delete an assertion to get a change through. If an invariant genuinely changes, change the test in the same commit and explain why in the message. - A new test that needs to reach into private fields, sleep for seconds, or start a container usually means the unit boundary is wrong — fix the design (inject the dependency) instead of adding scaffolding. - When a test starts failing "because the environment changed", check whether it was ever deterministic before editing it. + +## Commit Messages + +Commit messages are Chinese, `type(scope): subject`, and written to the structural rules of ASD-STE100 — target roughly 80 %, which means the text reads simply. This is not a certified STE document; it is a readability standard with two hard parts: short sentences, and terms kept exactly as the code spells them. + +- **One idea per sentence.** Split on `——`, `;` and `:` into separate sentences instead of chaining clauses. Aim for ≤ 30 characters; a sentence with three comma-joined clauses is a rewrite. +- **Verb first, active voice.** `只做声明` → `只声明`. No verb-less lines like `DLX 交换机 X + 唯一队列 Y parked.# 绑定`; write `包含 … 和 …` / `以 … 绑定到 …`. +- **One paragraph per topic**, opened by its claim (`每个队列必须有独立的重试入口。…`). Use `因此` / `所以` to start the conclusion sentence instead of glueing it on. +- **Identifiers stay verbatim**: exchange, queue and routing-key names, type and function names, test names. Never translate, reflow or abbreviate them. +- **A term is a fixed phrase, not a word.** A phrase that already appears in code comments or test names is project vocabulary: keep it exactly, and do not borrow one of its words to mean something else. Everything that is not a term uses plain words — do not coin new metaphors, since a metaphor that cannot be `grep`ed is one the next reader has to decode. +- When the change is verified by a command, close with a `验证:…` line naming it, e.g. `验证:go test -race -count=1 ./... 全绿`. +