Skip to content

Commit ed53a34

Browse files
committed
Refine developer comment guidance
Signed-off-by: realAsma <akuriparambi@nvidia.com>
1 parent 85fd1fb commit ed53a34

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.agents/developer-guidelines.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ and elegance.
2929
make intent clear. Keep high-level orchestration clear, move low-level
3030
mechanics into well-named helpers when helpful, and put critical code before
3131
helper details when local conventions allow it.
32-
- **Validate at boundaries.** Check user input, files, network responses, and
33-
external API results at the edge. Keep internal code simple by trusting types
34-
and invariants instead of repeatedly checking for impossible states.
35-
- **Comment cautiously.** Code is the source of truth for what happens and how.
36-
Add comments only when the reason is not obvious. Apply this guidance to new
37-
comments only; do not rewrite or delete existing comments as cleanup.
32+
- **Comment cautiously.** Code should be clear and be the source of truth
33+
for what happens, how it happens, and why; use comments only when the why is
34+
not obvious from the code. First ask whether better names, clearer structure,
35+
or simpler code can explain the intent without a comment. (Apply this guidance
36+
to new comments only; do not rewrite or delete existing comments.)
3837
- **Scale documentation to the API.** Higher-level and user-visible APIs deserve
3938
useful docstrings, including examples when helpful. Lower-level internals need
4039
docstrings only when names, types, and structure are not enough.
40+
- **Validate at boundaries.** Check user input, files, network responses, and
41+
external API results at the edge. Keep internal code simple by trusting types
42+
and invariants instead of repeatedly checking for impossible states.
4143
- **Remove touched dead code.** Delete unused imports, unreachable branches,
4244
obsolete placeholders, stale TODOs, and debug code when they are part of the
4345
behavior you are already touching.

0 commit comments

Comments
 (0)