Temple and idol construction and Vastu requirements have been elaborately defined in the Matsya Purana, Brihat Samhita and Vishwakarma Prakasha. In addition it also depends on the chief deity to whom the temple is built.
For temples where the presiding deity is Ganapathi, Shiva, Subrahmanya (Karthikeya), Shakti and Dharma Shaashta, the main reference point is the Shaiva Aagama and for Vishnu, Surya and other forms of Narayana and Lakshmi, Vaishnava Aagama is referred to. Additionally, for certain forms of Devi, Tantra Shastra is also brought in for Yantra sthaapana and uddhaara.
Also, Shilpa shastra deals with the construction and sculpting of statues/idols and Vastu shastra deals with the construction of the temple complex and the inner sanctum.
Vishwakarma (who is attributed as the "Purusha" (or the Brahman itself) in the Rig Veda) is the presiding deity for all construction engineering and related crafts.