As this seems to be the focus of the question, I will only talk about the documentation of engineering software and not documentation of use of the software.
Your observation that the documentation aims at communication in the team is correct by accepting the premise that the client (or the customer representative) is part of the team. That is: documentation aims at communication client <-> team <-> team.
There are those who write documentation to even let other teams take over the system in the future and benefit from this documentation.
But writing a lot of documentation trying to secure the future is an increasingly disused practice in our industry. Because after so many decades of writing tons of documentation we’re learning that it never helped much [1].
We are trying to bring to software development [2][8] the Lean thinking [3] that made the Japanese automotive industry a fabulous success and that after that has been helping in several areas of activity around the world [4].
According to Lean thinking, it is essential to eliminate all waste. All activity that does not add value to the customer needs to be eliminated. So according to this current, you should only write documents that add value to the customer.
In addition, the second principle of Agile Development [5] says:
"We value more software running than comprehensive documentation."
And Agile is becoming the industry standard [9] to the detriment of other models that require a lot of documentation.
How to know if a document adds value?
Questions that help identify whether a document has the potential to add healthy value:
To whom this document aims to help?
Someone will read this document?
If you cannot identify the direct beneficiary of the document or have great doubts whether this document will even be read, it is best not to write it; at least not now.
When it’s worth writing a document even if no one will read it later?
Writing helps structure ideas and make discoveries.
So writing class diagrams, sequence diagrams and use cases help deepen the understanding of requirements and figure out how to solve the problem.
But documents to this end should not be seen as system documentation, need not be formal and should not be kept longer than the duration of the task of implementing that particular piece of software (that’s right, throw it in the trash after using).
Documentation of software requirements
You spoke of user Stories - they are excellent for describing requirements. @Luiz Vieira has already made a beautiful description of them in his indispensable answer. What I have to add is that they should be thrown out as soon as the project ends or even sooner as the Feature is delivered. They should not be seen as perennial documentation of the software otherwise they lose their flexibility and simplicity indispensable for success in its use.
In time: a user story can perfectly be accompanied by additional documents. For example, a user story requesting a report may be accompanied by a page simulating an example of a report.
One user story can also be accompanied by your acceptance tests, which describe how the completeness of the history implementation will be verified.
So though user Stories are in fact software requirements, they do not necessarily exempt other documents, which will only be added if there is clear utility.
After all, working alone what documents should I write?
Some documents that add value to both teams and solo projects are:
Project vision: [6][7] what problem will be solved and how it will be solved and what value this solution will be to the customer. This is very important to stay focused and not be distracted by what is not a priority or divert the project from its primary objective. This document is very short and the simple act of writing it, as I said, helps to deepen the understanding of the problem and the solution.
User Stories: [10] As they are written, they help to understand each piece of the problem and the desired solution. After writing, they help prioritize resources to be implemented.
In an agile project, solo or in a team, these are the longest-lived formal documents. The first being the only one born quite complete already at the beginning of the project. User Stories will be written throughout the project. Other documents will be used to help develop the ideas but are very informal and will be dispensed quickly.
Other documents should only be written by specific project demand. If the customer makes a point of paying not only for working software but also for class diagrams and use cases, of course you will have to. In this case, preferably hire a trainee to do them - a good part of it can even be generated automatically by various tools available around [11].
Fantastic answer. By the way, in my opinion you hit the nail on the head with "[...] user story requesting a report may be accompanied by a page simulating an example of a report.". After all, since the construction of the pyramids it is already known that prototypes help a lot and are certainly more efficient in producing a good understanding of what the customer wants/needs than any document (whether the customer is a Pharaoh or not). :)
– Luiz Vieira