Two short AGENTS.md rules for AI coding: cut redundant UI text, fix bugs at the root cause
The author describes two short prompt rules shared by a developer on X and suggests adding them to AGENTS.md[1], a file that gives coding agents project context and working conventions. The first rule asks the agent to avoid unnecessary secondary labels and descriptions and to let the layout explain the interface, because AI-written forms often add hints that repeat controls that are already visible. The author says to keep information that helps users decide or avoid errors, as well as details about costs and irreversible actions. Field labels should not be removed to leave only a placeholder[2], since the placeholder disappears once the user starts typing.
The second rule asks the agent to fix a bug at its cause rather than patch the symptom. In the example, a list sometimes showed an old nickname after saving, and the AI added a setTimeout with a 500 ms delay. The real cause in the example was that saveProfile did not return the request's Promise, so the outer await did not wait for the save to finish; the fix is to return it and await refreshList. The author notes that other causes are also possible, such as a cache that was not invalidated, an old request overwriting a new one, or delayed backend data, so evidence should come first. Reasoning from first principles[3] here means asking where the data is saved, who waits for it, what the list reads, and which step went wrong.
The author suggests adding both rules to AGENTS.md under separate headings and asking the AI to flag repeated text and explain where each bug came from and why the fix works.
Discussion
Commenters describe practice: one team requires the agent to state the root cause and how it was verified, and reviewers check the diff against that statement. Another commenter doubts that AI truly understands such rules and asks whether writing terms instead of explanations really improves results.
Sources
-
CNJuejin ZH
AI 写页面像说明书,修 Bug 像贴膏药?把这两句话写进 AGENTS.md


