Build a software that solves a problem you have. Preferably a single problem. Then make it good. Give it out to people you know in the same field or post it to relevant forums online.
After that, "open source" it. (You can put the code publicly on Github from the beginning but here I mean start promoting it to get users and collaborators.)
The motivation behind this sentiment is that all the extra stuff around this (maintaining the community of collaborators, replying to bug tickets, checking out pull requests) takes a lot of time that you should use in building the library first.
That seems to do the trick! I would also advise sharing it with your research colleagues, and those at other institutions. Consult them for feedback particularly because they have domain-specific knowledge.