Agent Wranglers

Comments Recommended

Keep change history out of comments

Keep change logs, author names, dates and ticket histories out of the code. Version control records who changed what and why.

How to do it

Write the reason in the commit message and link the ticket there. Use git blame or git log to find the author and the history of a line. Remove file headers that only list authors and edits.

Example

// Bad
// 2026-03-02 (Anna): fixed rounding for EUR
// 2026-04-11 (Ben): added SEK, see ticket SHOP-412
function roundPrice(amount, currency) { /* ... */ }

// Good: the history is in git, the code shows the rule
function roundPrice(amount, currency) { /* ... */ }
grep -rnE '(@author|Changed by|Modified (on|by)|//\s*[0-9]{4}-[0-9]{2}-[0-9]{2})' src/ && exit 1 || exit 0
# Bad
# 2026-03-02 (Anna): fixed rounding for EUR
def round_price(amount, currency): ...

# Good: the history is in git, the code shows the rule
def round_price(amount, currency): ...

How to check

A script or linter rule fails on comments such as @author, Changed by, Modified on or a date at the start of a comment.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/comments/no-journal-comments.