That all leads always to the same imperative, namely Kant’s Categorical Imperative.

The first formulation: “Act only according to that maxim whereby you can at the same time will that it should become a universal law without contradiction.”
The second formulation: “Act in such a way that you treat humanity, whether in your own person or in the person of any other, never merely as a means to an end, but always at the same time as an end.”
The thrid formulation: “Therefore, every rational being must so act as if he were through his maxim always a legislating member in the universal kingdom of ends.”

The first formulation of the Categorical Imperative appears similar to the Golden Rule. The Golden Rule or ethic of reciprocity is a maxim, ethical code or morality.

The Golden Rule (in its positive form) says: “Treat others how you wish to be treated.” One should treat others as one would like others to treat oneself (directive form).
The Golden Rule (in its negative form) says: “Do not impose on others what you do not wish for yourself.” One should not treat others in ways that one would not like to be treated (cautionary form, also known as the Silver Rule).