improovisation
improve + improvisation. The act of making up a plan on the spot and it resulting in something good.
Dude1: Whoa! That totally worked! How did you do that?
Dude2: I don't know.
Dude1: Nice improovisation!
Dude2: I don't know.
Dude1: Nice improovisation!