For any AI:
First play as the AI yourself.
Take note of any decision point where you have to make an input.
Record the reason you made any input as conditions to trigger an action. Also identify any conditions that would influence to take another action.
Translate these into events triggered by whatever triggered you into making an input in the first place.
It is normally extremely difficult to account for all possible conditions to make actions, so you'll often want the AI take advantage of random or pseudorandom decisions to choose from available actions. You can also utilize conditions to narrow down available actions for the AI to take.
Depending on your game, it can also be difficult to take into account all available actions in any given scenario as well, so you're just going to have to keep adding to and refining your AI as you go.
There will never be a template for AI as the conditions and actions available for each game will usually be different.