In many of my talks, you'll hear me say that the API is the most important part of a codebase. That is true, because it's the most primary part of the UX of the code itself.
When it comes to the project as a whole though, beyond just the codebase, there are many other places were UX opportunities are surfaced, and one of the biggest ones is documentation.
Documentation is incredibly important for doing a handful of things:
- Communicating with your userbase the expectations and tone of the project
- Explaining how to use it (e.g. a quickstart) in simple terms
- Explaining how to get really deep into it (e.g. an advanced section)
- API reference
As a bonus, it also helps you, as a developer, explain your crazy technical ideas in layman's terms. Sometimes, this may prove to be a difficult task, which may lead you to re-visit the code you are attempting to document.
All of the above things make writing documentation a very important part of writing any library that will have a userbase (which is ideally, all of them), in my opinion. There's tons of motivation there. Why are you writing the code in the first place?