Measure across the top of the bookcase, from the inside of each upper corner. Mark that measurement on a piece of trim that has the same width as the front edge of the bookcase. Put two marks on its bottom edge with the measured span between them.
Set the trim face up on a miter saw, with the marked bottom edge running along the back rail of the saw. Turn the blade to point 45 degrees outward, away from the piece. Cut it to the length you measured in Step 1.
Move the trim so the second mark is under the blade. Turn the blade 45 degrees in the opposite direction, again pointing away from the piece. Make the cut.
Hold the cut trim along the top of the bookcase so it covers the whole edge. The two angled cuts should rise out and up at the upper corners. Secure the piece with a pin nailer, shooting the pins every 10 inches along the upper and lower edges of the trim.
Measure one vertical side of the bookcase. Cut the end of the trim that faces upward with a 45-degree miter, as before. Cut the other end at 90 degrees, straight across. Secure the trim to the bookcase front with the mitered end butting to the mitered end of the top span at the corner, and the flat bottom end sitting on the floor.
Repeat the process for the other vertical side.