Preheat the oven to 375°F (190°C).
Heat the olive oil in a large 12-inch (or larger) oven-safe skillet or saucepan over medium heat.
Add the minced garlic, dried oregano, dried basil, dried parsley, and crushed red pepper flakes and cook, stirring often, until the garlic is golden and fragrant, about 4–5 minutes.
Carefully stir in the marinara sauce, 2 cups of water, and season with kosher salt and pepper to taste.
Add the dry spaghetti, breaking it in half if needed to fit, and increase the heat to high.
Bring the mixture to a boil, then stir frequently and cook until the spaghetti is al dente and most of the liquid is absorbed, about 8–10 minutes.
While the pasta cooks, whisk together the eggs, ricotta, and grated Parmesan in a medium bowl until smooth.
Remove the pan from the heat and quickly stir the ricotta–egg mixture into the hot pasta until combined.
Evenly sprinkle the shredded mozzarella over the top.
Transfer the skillet to the preheated oven and bake until the cheese is melted and bubbly, 20–25 minutes.
Remove from the oven, top with fresh basil and/or oregano, slice, and serve.