Add repo state util fns
Implement ensure-repo, and check before any task