Awesome Reviewers

Reviewer · Documentation

Keep comments synced with behavior

When code changes, immediately audit the surrounding comments and docstrings so they describe what the code actually does now, not what it used to do. This covers several recurring failure modes:

Instruction

When code changes, immediately audit the surrounding comments and docstrings so they describe what the code actually does now, not what it used to do. This covers several recurring failure modes:

  1. Orphaned section comments: when entries under a comment header are moved or deleted, remove or update the header too. For example, a # System shutdown / reboot comment left above an unrelated # Privilege escalation block after its four entries were relocated elsewhere is actively misleading to the next reader.

  2. Undocumented limitations/scope: if a parameter or flag (e.g. strict=True) only guarantees behavior for a subset of cases (own attributes and nested mixin objects, but not arbitrary third-party to_dict() results), spell that scope out explicitly in the docstring’s Args/Returns section rather than letting the name imply a broader guarantee.

  3. Undocumented side effects: if a method mutates caller-owned state in a way that persists beyond the call (e.g. permanently rewriting agent.system_prompt instead of restoring it), document this clearly on the class/method docstring so callers know not to pass shared instances, or fix the side effect instead of only documenting it.

  4. Rationale for non-obvious code: if a method appears unused by production code but is intentionally retained (e.g., a write-only audit-log accessor kept for future/manual use), add a short docstring note explaining why it exists, so it isn’t mistakenly deleted as dead code by a future contributor or linter-driven cleanup.

As a rule: every code change that alters behavior, removes functionality, or introduces a persistent side effect should be accompanied by a corresponding update to the nearest comment or docstring, and any comment that no longer matches the code it sits above/describes must be deleted or rewritten in the same change.</description> </invoke>