Prep the basics. Set your oven to broil on high (or preheat to 450°F/230°C if you don’t have a broiler). Bring a large pot of salted water to a boil for the gnocchi.
Have a large oven-safe skillet ready.
Start the sauce. Warm the olive oil in the skillet over medium heat. Add onion and a pinch of salt. Cook 4–5 minutes until soft and translucent.
Stir in garlic and cook 30 seconds until fragrant.
Build flavor. Add tomato paste (if using) and cook for 1 minute, stirring. Pour in the crushed tomatoes. Season with oregano, basil, red pepper flakes (if using), 1/2 tsp salt, and a few grinds of pepper.
Add a pinch of sugar if the tomatoes taste sharp.
Simmer. Let the sauce bubble gently for 8–10 minutes, stirring occasionally. You want it slightly thickened. Taste and adjust salt and pepper.
If using fresh basil, fold it in now.
Cook the gnocchi. Drop the gnocchi into the boiling water. They’re done when they float—usually 2–3 minutes. Use a slotted spoon to transfer them directly to the sauce.
It’s fine if a little pasta water comes along; it helps the sauce cling.
Add the cheeses. Gently fold the gnocchi into the sauce. Dot with spoonfuls of ricotta (if using), then sprinkle the mozzarella evenly over the top. Finish with the Parmesan.
Broil to finish. Move the skillet to the oven and broil 2–4 minutes, until the cheese is melted, bubbling, and lightly golden.
Watch closely—broilers vary and cheese can burn fast.
Rest and garnish. Let the dish sit 2–3 minutes so the sauce settles and the cheese firms slightly. Sprinkle with fresh basil or parsley. Serve hot.