Heat the butter in a medium-sized skillet over medium heat until melted. Sauté the onion for 2 minutes until it softens, then add the spinach, season with salt and pepper, and cook until the spinach is cooked and most of the moisture is evaporated, about 4 minutes. Add the red pepper flakes, if desired, and the cream cheese and cook for another few minutes until well combined and the cream cheese has melted and is well incorporated into the spinach, and slightly evaporated, about 3 minutes. Stir in the Parmesan, and cool so that it’s just slightly warm or room temperature, and check for seasoning.
Loosen the skin from each thigh, and place a couple of tablespoons of the spinach mixture under the skin, spreading it out beneath the skin, dividing it evenly between the thighs. Brush the skin with the olive oil, and season with salt and pepper.
Roast for about 45 minutes, or until the chicken is cooked through (an internal temperature of 165°F). Serve hot or warm.