auto genrate rules