Auto-Shrinking All Databases Files To Their Minimum Size In Sql Server
My question is about how i can shrink all database files to their minimum size after truncating related tables


To answer your question directly, this is done using DBCC SHRINKFILE command - 

DBCC SHRINKFILE (YourDatabaseLogicalFileName,&lt;desired size in MB&gt;)


Here you can read more information on how to use this commnand
https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-shrinkfile-transact-sql?view=sql-server-ver15

But, as other comments already mentioned, the reason of poor performance lies somewhere else and you need to start a methodical process of collecting and analyzing performance information (Performance Counters, Waits, Top heaviest queries, etc.)

Among other reasons, possible that poor performance in your Dev environment could be simply because system specification of Dev environment (CPU, RAM, Storage, Network etc.) is much weaker/worse than your Production; or Developers could be running some heavy and not tuned queries in Dev environment, that they do not run on Production