Preheat the oven to 325F and position the rack in the center.
Cook the potatoes: In an 8-inch oven-safe skillet (see note 1), heat a little splash of olive oil, butter, or coconut oil (1 tbsp) over medium heat. Add the diced sweet potatoes and season with ¼ teaspoon salt, ¼ teaspoon pepper, and ½ teaspoon thyme. Cook, stirring occasionally, until soft and golden brown (8-10 minutes). Transfer the potatoes to a plate and set aside.
Cook the veggies: Add a little more oil (1 tbsp) to the skillet with the diced onions and mushrooms (wait to season). Cook, stirring occasionally, until the mushrooms are brown and the onions are translucent (5-8 minutes). Add kale, garlic, ¼ teaspoon salt, pepper, ½ teaspoon thyme, and chili flakes,(if using). Saute for 2-3 minutes until the garlic is fragrant and the kale has softened.
Combine and top: Turn off the heat, mix in the potatoes, and arrange in an even layer, top with chunks of cream cheese and basil pesto. (Don't mix the cheese and pesto into the veggies.)
Make the egg mixture: In a medium bowl, whisk together the egg, milk, ½ teaspoon salt, and ¼ teaspoon pepper. Gently pour egg mixture over the potato mixture.
Bake: Transfer the skillet from the stove top to the oven. Bake for 20-25 minutes or until the egg mixture is set.
Cool and serve: Cool slightly before slicing. Serve with extra pesto on top of the frittata, and your favorite hot sauce if desired.