Stand the prehung unit in the door opening, with the front edge of the casing lined up with the front edge of the wall frame.
Set your level against an inner edge of the casing. Shim around the outside of the casing, inserting the shims between the casing and the wall frame, until the door is square.
Set your level vertically against the front-facing surface of the door. Determine if the door is leaning forward or back, based on the slant of the wall. Tap gently at the face of the casing with your hammer, from whichever side of the door needs to go back. Take readings with your level and continue tapping until the door is straight up and down from all sides. Add more shim to hold it tightly in that position.
Secure the casing of the door to the wall frame, driving screws through the casing every foot or so.
Measure each span around the doorway and cut corresponding pieces of trim on your miter saw, mitering the upper corners at 45 degrees and cutting the lower ends at 90 degrees. Install the trim with a trim nailer so it spans both the casing and the space between the casing and the wall.
Caulk around the trim on all sides, using the caulk to hide any gaps between the straight doorway and the crooked wall.