Design your layout and where you want to put the closet. This example will use a closet measurement of wall height before slope at 36 inches. The extension out to the closet front edge is 48 inches. The width of the closet is 60 inches. Place a 4-by-8-foot plywood sheet upright from the 48-inch mark closet edge. The top of the plywood sheet should butt right up to the slope where the closet edge on the slope will end. On the plywood sheet, mark from 36 inches up one side, lay the yardstick to hit at the corner on a diagonal and draw the diagonal chalk line. Repeat this on the other plywood sheet too. This should be a perfect 45-degree angle to match the slope.
Lay your first set of framing studs on the floor with the chalk line sitting outside the frame edge. Two 2-by-2-inch framing studs will lie exactly vertically from the wall on the floor. Screw each stud into the floor every 3 inches down the length. Add one 56-inch long 2-by-2-inch framing stud across the front where the door will go. This sits inside the vertical side studs and is secured with two from the outside studs into the two ends of the front floor stud. Now screw the front stud into the floor the same way as the side studs. Screw two studs on the back wall to fit on top, one on each side of the floor frame at the wall, and ending at the slant.
Measure the framing studs for the slope and take off 2 inches from the measured length to accommodate the wall stud interference. You could also do miter cuts on the ends of both sets to match them flush with each other. Add glue before slotting together. Cut the same length for the width across the top. If feeling energetic, do a miter cut on the stud. You might need a band saw to do this part. The miter will accommodate the slope so your front frame sit correctly for bracing the plywood wall to it later.
Saw your plywood sheets to the correct size of the depth -- 48 inches -- the vertical height -- 36 inches -- and the 45-degree angle to the opposite corner, making a total of 96 inches to the corner. Set up one plywood sheet and screw into place at the two ends and one in the middle for both upper and lower stud sets. Set up the other side the same way.
Add two 2-by-2-inch framing studs to fit between the ceiling and floor corner studs at the front corners. Tap lightly into place so the studs are exactly vertical. Add a shim at the top end to take up diagonal space left by the ceiling slant. Screw the plywood siding to the framing stud. Repeat this on the other side. Now you have a secure front corner. Cut two sheets of plywood down to 30 inches wide for each door. Add hidden hinges inside the cabinet and then attach to the doors to install them.
Add a center stile where the two doors meet, which will add more bracing from the top to bottom frame work. The stile would be a 1-by-2-inch framing stud measure to slot between the upper and lower centered studs. Push it to the back so one inch is left free for the door to shut flush against the frame work. Paint or stain your wood closet and use a finishing coat of polyurethane to finish off the stain. Add knobs or pulls and a closing latch and you are ready to build inside the closet.