Usage rules task not found

Hi! Did something break in usage_rules? I'm getting this all of a sudden: ** (Mix) The task "usage_rules.sync" could not be found It's in a clean new project. After running ash.setup, the next thing I always do before starting to work on the project is generating the AGENTS.md file. Always worked fine until now
3 Replies
barnabasj
barnabasj5d ago
Are you sure the usage_rules package is installed? It could be if you installed igniter later that you need to rm -rf _build and compile again
Gonzalo Muñoz
Gonzalo MuñozOP5d ago
IDK, I have everything setup in a bash script so my new projects are all identical at the beginning. The idea is to build deterministic and reproducible starting points. I didn't change anything pertaining to dependencies, so that's why I'm asking if anything changed all of a sudden Relevant snippet:
mix archive.install hex igniter_new --force
mix archive.install hex phx_new 1.8.1 --force

mix igniter.new "$PROJECT_NAME" --with phx.new --install ash,ash_phoenix \
--install ash_postgres,ash_authentication \
--install ash_authentication_phoenix,ash_admin \
--install ash_oban,oban_web --install ash_state_machine,live_debugger \
--install tidewave --install ash_ai \
--auth-strategy password --auth-strategy magic_link --yes

cd "$PROJECT_NAME"
set -a && source .env && set +a

mix ash.setup
mix usage_rules.sync AGENTS-complete.md --all --yes
mix usage_rules.sync ASH_USAGE_RULES.md $(mix deps | grep -E '^\* ash' | awk '{print $2}') --yes
mix usage_rules.sync AGENTS.md --all --inline usage_rules:all --link-to-folder deps --yes
mix archive.install hex igniter_new --force
mix archive.install hex phx_new 1.8.1 --force

mix igniter.new "$PROJECT_NAME" --with phx.new --install ash,ash_phoenix \
--install ash_postgres,ash_authentication \
--install ash_authentication_phoenix,ash_admin \
--install ash_oban,oban_web --install ash_state_machine,live_debugger \
--install tidewave --install ash_ai \
--auth-strategy password --auth-strategy magic_link --yes

cd "$PROJECT_NAME"
set -a && source .env && set +a

mix ash.setup
mix usage_rules.sync AGENTS-complete.md --all --yes
mix usage_rules.sync ASH_USAGE_RULES.md $(mix deps | grep -E '^\* ash' | awk '{print $2}') --yes
mix usage_rules.sync AGENTS.md --all --inline usage_rules:all --link-to-folder deps --yes
I don't manually install usage_rules, never have. But it was always there, I guess as a dependency of Ash
barnabasj
barnabasj5d ago
hmm, yeah it's possible that it was a dependency somewhere at some point.

Did you find this page helpful?