Is there a code of ethics for Ph.D. supervisors? I'm a Ph.D. student in Germany, I got my M.Sc. degree in Finland, I have friends in different countries doing their Ph.D.s, especially in the US, and there are also my fellow students in our group. So I have had the chance to learn about people's experience with their Ph.D. And there's one thing I see frequently which is annoying and frustrating: Ph.D. supervisors (people on tenure track/group leaders/senior researchers/...) are apparently not trained for this job and the job happens to be a very difficult one. 

It seems that it's quite common to hear terms like arrogance, micro-management, exploitation of students' capacity, lack of respect, etc. attributed to a supervisor. I'm personally living with it, but I would like to be able to formulate all these thoughts in a meaningful and mature way. I need to have a clear understanding of what I'm going through. 

Now I have one specific question (but I'd also appreciate knowing other ways of approaching it): is there a worked and published text on the supervisor-student relationship? like a code of ethics? I don't really know what to name it.
There is nothing commonly accepted. And you are right that nobody receives formal training in how to supervise a Ph.D. Academia is really still very much in a medieval mode here, where you learn from your master (your own supervisor), potentially work under other masters (changing labs) and then are deemed worthy to have apprentices of your own, who you will treat roughly as your master treated you.

However, if you Google for "Betreuungsvertrag Promotion" or "Doktoranden-Betreuungsvertrag", you will find quite a few templates for formal agreements the supervisor needs to sign in some German universities. The key word being "needs to" - this is compulsory for the supervisors.

Unfortunately, these agreements only cover things like regular meetings between the candidate and the supervisor, and that the supervisor will give good advice and in general ensure that the Ph.D. can be attained within n years. This is all very nice, and any decent human being should already be doing all that is in there, but it's all rather vague. In addition, I seriously doubt that anything like this would be taken seriously in a potential lawsuit.

Bottom line: the good supervisors already do everything that's in these agreements, and the bad ones won't start once they have signed this.