शासनात् त्राणात् शास्त्रम् । That which controls us from pitfalls, through educating us about the universal rules...
शासनात् त्राणात् शास्त्रम् । That which controls us from pitfalls, through educating us about the universal rules and as a result protects us is shastra - this is Vyakarana definition of shastra. The tattva definition of shastra is चतुर्वर्गफलप्रदायकं शास्त्रम् उच्यते - that which gives us the fruit of chaturvarga. Chaturvarga means Dharma-Artha-Kaama-Moksha. Shastra gives us regulated methods of fulfilling our Kaama (desires) through Artha (Means) with Dharma (Meta Rules based on Universal Order) as the foundation and ultimately attain Moksha or Yoga (Liberation) not just through one but multiple paths. How to use a particular path for Moksha is the subject of Shastra. One can choose a path that is most suitable based on one's disposition. The path of Karma, Saankhya, Music, Performing arts, and even Vaak (speech) etc. can be used for this. Shastra gives a methodical step by step path from Dharma first and to finally Yoga or Moksha ultimately. Paatanjala Ashtanga yoga of Bhagavan ...