Heat a large skillet over medium-high heat and add the oil. Add the diced onion and sauté, stirring occasionally, until the onion begins to soften, about 5 minutes.
Add the diced chicken to the skillet and cook about 5 minutes, stirring and flipping often, until the pieces are cooked through.
Stir in the minced garlic, turmeric, ground ginger, and ground coriander; cook for about 1 minute, stirring frequently, until fragrant.
Add the yellow curry paste, coconut milk, and shredded carrots, stirring to combine. Reduce heat to medium and simmer gently for about 5 minutes, until the sauce has slightly reduced and thickened to your liking.
Add the fresh spinach and black pepper, stirring until the spinach wilts into the curry.
Taste and finish with lime juice, chopped cilantro, and optional brown sugar and salt as needed; adjust extra spices or curry paste to taste before serving.