Preheat the oven to 425° with a rack in the center position. In a large bowl, combine the pesto, Italian seasoning, salt, garlic powder, crushed red pepper flakes, and a few grinds of black pepper.
Pat the chicken thighs dry with a paper towel. Transfer to the bowl with pesto mixture and toss to coat.
Transfer the potatoes to a rimmed baking sheet. Drizzle potatoes with the olive oil and season with salt and pepper. Add the chicken to the same baking sheet, skin-side up.
Bake on the center rack of the oven until the potatoes are tender and the chicken has an internal temperature of 165°F, and the chicken skin is starting to get crispy, about 45 minutes. (For extra crispy skin, preheat the broiler on high. Broil on the top rack until the skin is crispy, 2 to 3 minutes.)
Squeeze lemon wedges over top, then garnish with fresh basil, if using.
Pro tip! Chicken thighs can be tossed with the pesto mixture and then refrigerated overnight. Place chicken thighs on top of the potatoes and roast as directed.