Writing good documentation for OTP servers

Are there any patterns for the correct documentation of OTP servers? Can someone advise some resources, tutorials for this?

You mean like GenServers?

If so, then I think the common pattern is to document their public API, i.e. functions that wrap GenServer.call/cast, and treat the internal message format GenServer receives as private API that does not need public documentation.

And you document public API the same way you’d do with any other public function, using @doc syntax