in a mixing bowl combine together the ricotta cheese, egg, garlic, lemon zest, fresh herbs and olive oil. Season with a pinch of sea salt and refrigerate until needed.
Meanwhile bring a large pot of salted water to a boil. (It should taste like sea water). Cook the gnocchi for a couple of minutes until they float to the top. Drain well and toss with 1 cup of marinara sauce.
Use a 10 inch round baking dish ( 2- 3 inches deep) and spoon 1/2 cup of sauce on the bottom. Top with half of the gnocchi and spoon the herbed ricotta mixture on top.
Layer half of the mozzarella cheese on top and a few slices go heirloom tomatoes. Sprinkle with a pinch of sea salt, black pepper and half of the basil leaves.
Add the remaining gnocchi and spoon 1/2 cup of sauce on top. Follow with the mozzarella and tomato slices.
Sprinkle with a pinch of sea salt and red pepper flakes, loosely cover wit aluminum foil and bake in the preheated oven for 10-15 minutes, just until the cheese has melted.
Optional: transfer the baked gnocchi under the broiler uncovered, for a about 3 minutes until the cheese is golden brown and bubbly. Allow to cool for a few minutes for the cheese to set. Serve with the remaining fresh basil and herbs on top.