Preheat the oven to 375°F (190°C). Lightly grease a 13x9-inch baking dish.
Cook the jumbo pasta shells according to package directions until al dente, drain, and set aside to cool so they can be handled.
Steam the fresh spinach just until wilted, squeeze out excess moisture with paper towels, and chop finely.
In a mixing bowl, combine the ricotta and the egg with a fork until smooth.
Stir in the chopped basil, chopped oregano or thyme, minced garlic, 2 cups of the shredded mozzarella, and the shredded Parmesan. Fold in the prepared spinach and season with salt and pepper to taste.
Spread about 1/3 cup of marinara sauce in an even layer on the bottom of the prepared baking dish.
Using about 2 tablespoons of the cheese mixture per shell, stuff each cooked shell and arrange them seam-side up in the baking dish.
If using, stir red pepper flakes into the remaining marinara to taste. Pour the remaining marinara evenly over the arranged shells.
Sprinkle the remaining 1 cup of shredded mozzarella evenly over the top, cover the dish with aluminum foil, and bake for 30 minutes.
Remove the foil and serve the stuffed shells warm.