Forced to flee, she doesn’t even have time to change out of her Pajamas.
Luckily, she and her friends find one of the villain’s ships unguarded outside and commandeer it as a means to escape.
Onboard, she finds some extra clothing and determine that the assailants are some sort of pirates.
In a moment of inspiration, and a need for something warmer to wear than just pajamas, Twilight makes a few stylish alterations to the clothing and dons it over her night wear. Also she adds her alicorn feathers to the hat.
(thanks to the Hatter’s Lye for writting the text description)