Agent Wranglers

ARC-25Recommended

Link every TODO to a ticket

A TODO or FIXME comment names a ticket, or it is not merged. Loose notes in the code are never planned and never found.

How to do it

Open a ticket for the work and write its ID in the comment, such as TODO(SHOP-512). If the work is not worth a ticket, delete the note. Remove the comment in the change that closes the ticket.

Examples

JavaScript example

// Bad: nobody owns it, so it stays forever
// TODO: handle refunds in other currencies
// Good: the ticket holds the plan and the owner
// TODO(SHOP-512): handle refunds in other currencies

Python example

# Bad
# TODO: handle refunds in other currencies
# Good
# TODO(SHOP-512): handle refunds in other currencies

Shell example

grep -rnE '\b(TODO|FIXME)\b' src/ | grep -vE '(TODO|FIXME)\([A-Z]+-[0-9]+\)' && exit 1 || exit 0

How to check

The build fails on a TODO or FIXME without a ticket ID. Examples are Ruff TD003 for Python, or the grep below for any language.

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/architecture/comments/todos-with-tickets">Agent Wranglers clean code and architecture playbook</a>. In code you write, add a comment next to it with the same link.