git-agent for ElixirConventional commits for Elixir and Phoenix projects
git-agent understands Phoenix context boundaries, Ecto query and schema changes, and OTP GenServer patterns, producing atomic conventional commits for Elixir's functional, actor-based architecture.
diff example
diff --git a/lib/my_app/accounts/account.ex b/lib/my_app/accounts/account.ex
index 2c4f1a3..8b7d9e5 100644
--- a/lib/my_app/accounts/account.ex
+++ b/lib/my_app/accounts/account.ex
@@ -1,14 +1,22 @@
defmodule MyApp.Accounts.Account do
use Ecto.Schema
+ import Ecto.Changeset
schema "accounts" do
field :email, :string
field :name, :string
+ field :role, Ecto.Enum, values: [:user, :admin, :moderator]
+ field :status, Ecto.Enum, values: [:active, :suspended, :archived]
+ field :last_login_at, :utc_datetime
timestamps()
end
- def changeset(account, attrs) do
- cast(account, attrs, [:email, :name])
+ def changeset(account, attrs) do
+ account
+ |> cast(attrs, [:email, :name, :role])
+ |> validate_required([:email, :role])
+ |> validate_format(:email, ~r/^[^\s@]+@[^\s@]+$/)
+ |> unique_constraint(:email)
end
endgit-agent output
feat(accounts): add role-based access control and account status tracking
- add role field with user/admin/moderator enum values for authorization
- add status field with active/suspended/archived lifecycle states
- add last_login_at timestamp for audit and idle account detection
- strengthen changeset with email format validation and unique constraint
- add role to allowed cast fields while keeping name as optional
Previously all accounts were treated equally with no access control
granularity; the role enum enables middleware-level authorization checks
while the status field supports account lifecycle management without
hard deletes.Why it works for Elixir
- Understands Phoenix Context boundaries and suggests scope names per context
- Separates Ecto schema changes from migration files into distinct commits
- Recognises OTP supervision tree changes and GenServer lifecycle modifications
- Handles Phoenix LiveView mount, handle_event, and render changes appropriately
install
brew install gitagenthq/tap/git-agent
# inside your Elixir project
git-agent init # detects Phoenix context structure and suggests scopesFAQ
Does git-agent handle Phoenix LiveView diffs correctly?Yes. The LLM understands LiveView lifecycle (mount, handle_event, handle_info, render) and will commit changes across these callbacks together when they are part of the same feature.
How does git-agent handle Ecto migration files?Migration files in priv/repo/migrations/ are always committed separately from schema changes. The LLM generates accurate db scope messages describing the schema evolution.
Can git-agent work with umbrella applications?Yes. Elixir umbrella applications are fully supported. Each child app is treated as a separate scope, and changes across multiple apps in the same commit are split into per-app commits.