Skip to content

Commit 91d2e53

Browse files
authored
docs: add code reuse and naming conventions to AGENTS.md (#12998)
Add a code reuse policy section instructing agents and contributors to reuse existing functions instead of duplicating logic, and to use descriptive variable and function names. Signed-off-by: Jaison Paul <paul.jaison@gmail.com>
1 parent 6ac5124 commit 91d2e53

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
- If you come across new common errors or fixes, extend "Common error patterns and quick fixes".
1919
- Always bump the "Last updated" date above when you make substantive changes.
2020

21+
### Code reuse policy (agents and contributors)
22+
23+
- Always reuse existing functions, helpers, and utilities before writing new code. Search the codebase for existing implementations that accomplish the same goal.
24+
- Do not duplicate logic that already exists elsewhere in the repo. If a function, method, or pattern is already implemented, import and call it rather than reimplementing it.
25+
- When adding new functionality, check related packages and modules for shared code that can be leveraged.
26+
- If existing code needs slight modifications to be reusable, prefer refactoring the existing code to be more general over duplicating it with changes.
27+
- Use descriptive variable and function names. Avoid abbreviations or single-letter names — prefer full, meaningful names that clearly convey purpose (e.g., `executionID` over `execID`, `fingerPrint` over `fp`).
28+
2129
### Commit policy (agents and contributors)
2230

2331
- Always sign off on commits with `git commit -s` (adds a `Signed-off-by:` trailer).

0 commit comments

Comments
 (0)