You can
ein Buch schreiben
that denotes the whole work, from start to finish.
And if you say
ich habe ein Buch geschreiben
we know you have finished the book.
And you can
an einem Buch schreiben
which denotes being busy working on a book.
And if you say
ich habe an einem Buch geschrieben
then we know you have been working on a book, but whether you have finished it or not is not said (most probably you have not, otherwise you'd been using the first phrase).
The same is obviously valid for any kind if book, including autobiographies.