In a large oven-safe skillet, heat the olive oil over medium-high heat and add the garlic. Cook for 2 minutes.
Add the marinara sauce to the skillet. Add the gnocchi straight from the package, separating any gnocchi that are stuck together. DO NOT COOK the gnocchi first, it will cook right in the sauce. Season with salt and pepper.
Cook until the gnocchi are soft and cooked through, about 5 to 6 minutes. Stir occasionally to make sure the gnocchi doesn't stick to the skillet.
Place slices of fresh mozzarella cheese evenly on top of the gnocchi. Preheat the broiler. When the broiler is hot, place the skillet in the oven under the broiler until the cheese melts, about 2 to 3 minutes.
Remove and garnish with fresh basil and crushed red pepper flakes, if using. Serve immediately.