Install any skill in seconds. Free to start, no credit card required.
Get Started Free →oliver-kriska/ecto-constraint-debug
Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data.
Passed 21 of 22 test cases with the skill, and 16 of 22 without it.
and 2 more in the full report
5 fixed16 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
A database constraint named orders_reference_code_index is failing in production. What file path pattern and grep search terms should we use to locate where this constraint was declared?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends searching inside priv/repo/migrations/ for the constraint name or index creation statements. | Missed | Passed |
The instructions your model reads when the skill loads.
Ash projects: Ash surfaces DB constraints through its own error DSL. Use the
ash-frameworkskill —mix usage_rules.search_docs "constraint" -p ash_postgres.
Systematic approach to diagnosing constraint violations. Load when you see Ecto.ConstraintError, unique_constraint, foreign_key_constraint, or constraint-related changeset errors.
links_url_index) tells you exactly which index/constraint failed. Parse it from the error message firstpriv/repo/migrations/ matches what the schema expectsExtract from the error message:
users_email_index)users)Use Grep to search for the constraint name in priv/repo/migrations/. Also check for create unique_index, create index, add constraint.
Verify: Does the migration constraint match the schema's unique_constraint/3 or foreign_key_constraint/3 call?
Use Grep to find constraint handling in changesets (unique_constraint, foreign_key_constraint, check_constraint) in lib/.
Find ALL callers that insert/update this schema:
Use Grep to find all insert/update paths (Repo.insert, Repo.update, Repo.insert_all, cast_assoc) in lib/.
test cases passed, vs 16 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.