Add a cube using scripting?

I have a game object, how can I add, for instance a cube next to it using scripting?

Thanks

also for placing the cube next to the object and for creating other things

Okay they are great, but how would I go about adding an object from my library?

prefab

var prefab : Transform;
function OnTriggerEnter () {
Instantiate (prefab);
}