Place spaghetti squash on a microwave-safe plate and cut small slits in it with a knife. Cook in the microwave on high, about 5 minutes. Cut squash in half lengthwise and scoop out seeds. Place cut-side down on a microwave-safe plate and cook until slightly softened, about 5 minutes more.
Drizzle 1 tablespoon olive oil over squash and place cut-side down on a baking sheet.
Bake in the preheated oven until easily pierced with a fork, about 20 minutes. Use a fork to scrape insides of squash into spaghetti strands. Spread evenly in a casserole dish.
Season chicken breasts with salt, black pepper, oregano, and garlic powder.
Heat remaining 1 tablespoon olive oil in a large skillet over medium heat. Add chicken; cook until browned and an instant-read thermometer inserted into the center reads at least 165 degrees F (74 degrees C), about 6 minutes per side.
Cut cooked chicken into 1/2-inch cubes and toss with pesto in a bowl.
Combine ricotta cheese, egg yolk, and Italian seasoning in a small bowl.
Layer half the marinara sauce, ricotta mixture, and pesto chicken on top of squash in the casserole dish. Repeat layers once more. Sprinkle mozzarella cheese on top. Cover with aluminum foil.
Bake in the preheated oven until bubbly and cheese is melted, about 30 minutes. Remove aluminum foil and broil until golden brown, about 5 minutes.