add pre-commit template, and refactor init.sh.