Every songwriter needs a work for hire agreement. Here is one you can use.
A Collaborators Agreement is a fundamental part of any songwriters toolbox.
Almost every songwriter collaborates to some degree and the Collaborators Agreement is the easiest way to make sure that any contributions to a song are duly noted. It is also important to have a document that spells out what happens if you or your co-writer can’t be found, or you decide to add some foreign language lyrics and etc.