I regularly write Terraform modules as part of my work. This is why I wrote a Terraform module template some time ago to speed up my writing process.
I just published a new version of my template: https://github.com/SkypLabs/terraform-module-template.
It follows the standard module structure described in the Terraform documentation and contains some non-standard but commonly used files and folders as well as a pre-commit configuration file to automatically format and validate the code and update the readme file upon Git commits.
If you are a GitHub user, just click on "Use this template" and you are ready to go!