From 20be0857a59dc299cc3bd4f795ce7fe1f6458636 Mon Sep 17 00:00:00 2001 From: Steffen Beyer Date: Sat, 23 May 2026 15:58:13 +0200 Subject: [PATCH] feat: expose plugin migration commands Forward ash.codegen and ecto.migration through the Aether plugin wrapper and update agent guidance to prefer AshPostgres codegen for resource-backed schema changes. --- AGENTS.md | 10 ++++++++-- scripts/plugin | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c12d1ea..4e4de53 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,8 +5,9 @@ contract, migrations, assets, and tests owned by this repo. ## Required Workflow -- Use `scripts/plugin` for plugin-aware commands: `scripts/plugin validate`, - `scripts/plugin test`, `scripts/plugin precommit`, and `scripts/plugin smoke`. +- Use `plugin` for plugin-aware commands in the devenv shell: `plugin validate`, + `plugin test`, `plugin precommit`, and `plugin smoke`. Outside the devenv + shell, use the local `scripts/plugin` wrapper. - Use `devenv shell -- ` when running repo commands from outside the devenv shell. - Raw `mix test` is not the normal entrypoint for this repo; `plugin test` @@ -14,6 +15,11 @@ contract, migrations, assets, and tests owned by this repo. plugin-manager paths. - Keep browser assets under the plugin asset pipeline and avoid host app internals unless the plugin API requires them. +- For AshPostgres resource changes, generate migrations with + `plugin ash.codegen `. Use `plugin ecto.migration ` only for rare + manual schema migrations that are not derived from Ash resources. +- Do not edit an existing migration after it may have run; add a new migration + instead. ## Plugin Contract diff --git a/scripts/plugin b/scripts/plugin index 845e19f..e170d66 100755 --- a/scripts/plugin +++ b/scripts/plugin @@ -7,6 +7,8 @@ Usage: plugin validate plugin test [mix test args...] plugin precommit [mix precommit args...] + plugin ecto.migration [mix ecto.gen.migration args...] + plugin ash.codegen [mix ash_postgres.generate_migrations args...] plugin smoke plugin shell EOF @@ -77,7 +79,7 @@ fi shift case "$command_name" in - validate | test | precommit | smoke | shell) ;; + validate | test | precommit | ecto.migration | ash.codegen | smoke | shell) ;; -h | --help | help) usage exit 0