I've used what I consider the golden guide of salary negotiation for a software engineer that has been linked on HackerNews[1].
I've applied these guidelines in my own negotiations and it worked very well for me. I would've undersold myself by at least 15% if I went ahead and answered the salary question first. I declined politely to give a number first—even saying "it's not in my interest to answer that first, as you most likely understand".
Those guidelines work for all jobs that have high added value, I would say.
[1]: https://www.kalzumeus.com/2012/01/23/salary-negotiation/