Former PI lists a non-contributor as first author on a manuscript for which I did all the work. Next steps? I finished my master's degree several years ago, where I was responsible for developing/programming algorithms for a biochemistry lab. I have since successfully transitioned into industry and have been working ever since. I also have a very good relationship with my former PI.
Some time ago, my former PI contacted me and I did some work for him, pro-bono, and he was interested in publishing the results. I personally had no interest in the actual publication, but I did this work more so because it allowed me to explore an area of mathematics in which I had limited experience.
Lo and behold, I receive the manuscript for edits, and a student completely unrelated to this work was listed as the first author!
Under normal circumstances, I wouldn't care. Academia was only a stepping stone in my life and a publication doesn't benefit me in any way. However, something feels &quot;wrong&quot; about just listing someone who has not contributed to this work in any way as the first author. I would like to be listed as the first author. At the same time, I want to keep a good relationship with my former PI. What are my next steps? How do I go about this?
Edit: Based on the feedback so far, I think the next best step would be to follow up with the PI and determine what the student's contribution was. Perhaps the student did indeed use the results I obtained to actually write the manuscript, in which case I would have no problem letting the student take first authorship. Again, as of right now, I only see work that my former PI has done, so I want to clarify.
Edit 2: I think there is some confusion about how many authors there are in this paper. There is me, who wrote the algorithm and there is my PI, who wrote the paper based on my results. Would I deserve first authorship if this a multi-author publication? Absolutely not. But by default, since myself and my PI are the only persons who have worked on this, either one of us can take first author role.
I received an update from the PI. The student was placed on the paper because the student was &quot;supposed to contribute&quot; but they did not want to learn how to use git (which is how I initially decided to version any manuscripts I worked on). The PI has made a promise to make sure the student takes the lead in terms of writing the paper and learning how to use git.
Before you get upset, I think it would be important to learn more about the actual circumstances of the publication.  I say this because, based on your description of the situation in your post you haven't been acting like a first author.
You may indeed have done all of the initial work on which the manuscript was based, but based on what you have written, you don't seem to have been particularly involved in interpreting the results or writing them up (beyond the methods section).
The first author of a paper, in typical usage for the field, should be involved in every stage of the project and the production of the manuscript. From what you have written, it appears that you haven't been, and so you may not even be properly aware of what the other student may or may not have done for the project. Maybe your speculation is correct; maybe it is not. Ultimately, however, authorship order isn't really your call, because you have chosen not to lead work on the paper.
If you want to be first author on a paper, you need to involve yourself more deeply with the project, including the actual scientific interpretation of the results.
Now, if you are concerned that your former PI may be acting unethically, you can ask for a description of the work that the other student has done. Do this from a perspective of curiosity and surprise, rather than accusation.  Once their work has been described, if you disagree with your former PI's judgement, then voice your concerns. If your PI doesn't make a change after that, you can withdraw yourself from the paper --- you should not lend your name to something that you consider unethical.  But based on what you described, it's not really your paper, and in the end your choice is primarily about whether or not to be associated with it.