Add pre-commit hook installation to onboarding and upgrade processes
CI / build (push) Has been cancelled

- prompts/onboarding.md: Step 2c installs git pre-commit hook for new projects
- scripts/upgrade.sh: Installs pre-commit hook during upgrade (with symlink detection)
- scripts/install.sh: Mentions hook installation in post-install next steps
This commit is contained in:
2026-06-15 14:20:52 -04:00
parent 05c76852a2
commit 06e47c5503
6 changed files with 63 additions and 2 deletions
+9
View File
@@ -66,6 +66,15 @@ Verify that the project is set up for v2.0 state enforcement:
3. If the project has existing tasks, run `python ~/.automaton/scripts/status.py --audit --project {project}` to check for violations or manually created tasks that need `.state` files.
4. If the project has existing tasks without `.state` files, run `python ~/.automaton/scripts/status.py --upgrade --project {project}` to bootstrap `.state` files from artifact heuristics.
### Step 2c: Pre-Commit Hook Installation
Install the automaton pre-commit hook to block commits when no task is in an edit-allowed phase:
1. Check if `{project}/.git/hooks/` exists (the project uses git).
2. If it does, create a symlink: `ln -sf ~/.automaton/scripts/git-hooks/pre-commit {project}/.git/hooks/pre-commit`
3. If `{project}/.git/hooks/pre-commit` already exists and is not our symlink, warn the user and ask whether to replace it.
4. Verify the hook: `python ~/.automaton/scripts/status.py --can-edit --project {project}` should return exit code 1 (DENIED) since no tasks exist yet.
5. Note in the onboarding report whether the hook was installed.
## Output
Create or update the following inside {project}/.automaton/: