You can specify the package you want in the hook…
I’m just not sure it’s “safe” to build AUR package as i think the hook command will be lunched as root. But to advertise user that a package should be rebuilt should not pose problem
The hook will be part of the package… but it can be triggered by another package.
Hooks are installed in /usr/share/libalpm/hooks/
if you look at the
99-grub.hook that is part of grub package you can see that it will be triggered when a kernel is installed, removed or upgraded to call update-grub.