add check_args to generate template
write_file_safe knos how to create directory if necessary
add error to constraint check if no clause