Documenting your software architecture through Architecture Decision Records (ADR) seems to be regarded as a best practice in software development.
Influential content on the topic includes the folling:
The why and how are pretty clear to me. My question is "When should you write an ADR?" Or in slightly different words, "What should you capture in an ADR?"
Well, there are different opinions how ADR process should look like.
I have found the following the most useful one:
ADR is all about to make concise decision by capturing why did you choose X and why did you exclude Y and Z. These decisions can't be read from your code, so that's why it is essential to document them.
And don't forget that they are living documents. It is in iterative process to make them up-to-date and valuable.