Howto Extensions

Hi,
iam really new to add own extensions to the toolkit. Can someone explain how it works?
My Problem is that i have an function in but in this function there Variables are not avaiable for the DeployApplication Script.