contrive

Definition

To devise or plan something in a clever or sometimes artificial way.

Example

"The author contrived an unexpected twist at the end of the story."