Hello
Are you getting the production code (Master) and develop code branches mixed up with develop mode which is the mode you require to make a custom module? ‘Develop’ is used for these two different cases quite separately. There are actually 4 uses environments. ie you can be in Develop model ‘mode’ ie developing code in the ‘develop’ github code instance and also develop mode in the ‘master’ ie production code branch instance.
see https://discuss.frappe.io/t/breaking-down-environment-and-branch-develop-master/20603/3
for an explanation, as it is confusing