Custom extension

I have an idea to create custom extension and use as an example the homeassistant one. Are there any guides for similar task or maybe someone has already made some custom extension.