Is a badly-written book a book [which has been] badly written?

Solution 1:

In the first case, you need the hyphen to assure that badly modifies written into one adjective, describing book. Otherwise it could be a badly book, which makes no sense.