The spec documents linked from there are the most canonical documentation, though the gitweb link will probably be deprecated soon in favor of gitlab. https://gitlab.torproject.org/tpo/core/torspec
As always it's probably a good idea to reach out to chat about what you have in mind before getting too far with implementation. #tor-dev on OFTC IRC (bridged to Matrix)
https://www.torproject.org/contact/ https://blog.torproject.org/entering-the-matrix/