Agent skill · Audited from source
Ecto Constraint Debug
skill · oliver-kriska/claude-elixir-phoenixMIT licenceAudited 18 Oct 2026 · source 492f17636999
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 492f17636999 and found no filesystem, network or shell access and no hard-coded secrets. What it does: Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data. Use when seeing unique_constraint, foreign_key_constraint, or check_constraint errors.
Cite
Cite this page
ModelsAtlas. “Ecto Constraint Debug (oliver-kriska/claude-elixir-phoenix)”. Retrieved 18 Oct 2026. https://modelsatlas.com/skills/oliver-kriska/ecto-constraint-debug
Trust audit
Audit 0.4.1 · source read 18 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 16,667 of 17,602 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha 492f17636999 · 18 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisheroliver-kriska GitHub userOwner of the repository this skill is read from
- Source folderoliver-kriska/claude-elixir-phoenix/plugins/elixir-phoenix/skills/ecto-constraint-debugThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdict492f17636999A new audit runs when the source changes
- Repository statusNot archivedLast push 2 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data. Use when seeing unique_constraint, foreign_key_constraint, or check_constraint errors.
---
name: ecto-constraint-debug
description: Debug Ecto constraint violations - trace triggers, check migrations, find duplicate data. Use when seeing unique_constraint, foreign_key_constraint, or check_constraint errors.
effort: medium
---
# Ecto Constraint Debugging
> **Ash projects**: Ash surfaces DB constraints through its own error DSL. Use the `ash-framework` skill — `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.
## Iron Laws
1. **READ THE CONSTRAINT NAME** — The constraint name (e.g., `links_url_index`) tells you exactly which index/constraint failed. Parse it from the error message first
2. **CHECK MIGRATION BEFORE CODE** — Verify the constraint definition in `priv/repo/migrations/` matches what the schema expects
3. **TRACE ALL INSERT PATHS** — Find every code path that inserts into the constrained table. The bug is often in a path you didn't consider
4. **RACE CONDITION UNTIL PROVEN OTHERWISE** — If validation passes but constraint fails, assume concurrent inserts until you prove a single-request cause
## Step-by-Step Debugging
### Step 1: Parse the Error
Extract from the error message:
- **Constraint name** (e.g., `users_email_index`)
- **Table name** (e.g., `users`)
- **Operation** (insert, update, or delete)
- **Conflicting values** (if available in logs)
### Step 2: Find the Migration
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?
### Step 3: Find the Schema
Use Grep to find constraint handling in changesets (`unique_constraint`, `foreign_key_constraint`, `check_constraint`) in `lib/`.
### Step 4: Trace Insert Paths
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/`.
### Step 5: Identify the Cause
| Symptom | Likely Cause | Fix Pattern |
|---------|-------------|-------------|
| Same user triggers twice | Race condition (double-click, retry) | Upsert with `on_conflict` |
| Multiple parents share child | `cast_assoc` doesn't dedup across changesets | Dedup before building changesets |
| Concurrent API requests | Missing transaction isolation | Wrap in `Repo.transaction` or use upsert |
| Migration added constraint to existing data | Data violates new constraint | Backfill or clean data first |
### Step 6: Apply Fix
See `${CLAUDE_SKILL_DIR}/references/constraint-patterns.md` for detailed fix patterns.
## Quick Fixes by Constraint Type
**Unique violation** → Upsert: `Repo.insert(changeset, on_conflict: :replace_all, conflict_target: [:field])`
**Foreign key violation** → Check: Does the referenced record exist? Was it deleted concurrently?
**Check constraint** → Validate: Does the value satisfy the constraint condition?
## References
- `${CLAUDE_SKILL_DIR}/references/constraint-patterns.md` - Detailed patterns for each constraint typeExcerpt, first 3,243 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 492f176
git clone https://github.com/oliver-kriska/claude-elixir-phoenix git -C claude-elixir-phoenix checkout 492f17636999
The author documents no install command, so this uses the repository directly. Our verdict covers commit 492f17636999 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
492f17636999
Similar skills
All automation skills →oliver-kriska/claude-elixir-phoenix
Inspect LiveView socket assigns for memory bloat — missing temporary_assigns, unused assigns, unbounded lists needing streams, memory estimates. Use when LiveView memory grows or you need to add temporary_assigns.
oliver-kriska/claude-elixir-phoenix
Project health audit and health check — architecture, performance, tests, dependencies, code quality. Use when assessing overall project health, before releases, or after refactors.
oliver-kriska/claude-elixir-phoenix
Analyze Phoenix context boundaries and module coupling via mix xref. Use when checking cross-context calls, validating dependencies, before splitting modules, or reviewing architecture.
oliver-kriska/claude-elixir-phoenix
Brainstorm Elixir/Phoenix features — explore ideas, compare approaches, gather requirements. Use when vague idea, not sure how to approach, or want to discuss before plan.
oliver-kriska/claude-elixir-phoenix
Interactive briefing of a plan file — explains reasoning, schema decisions, component choices. Use when developers need to understand a plan before approving.
oliver-kriska/claude-elixir-phoenix
Claude Code plugin for Elixir/Phoenix/LiveView — 26 specialist agents, Iron Laws enforcement, and Tidewave MCP integration. Plan features with parallel research agents, execute with automatic verification, review with…
Questions about Ecto Constraint Debug
What does the Ecto Constraint Debug skill do?
Is Ecto Constraint Debug safe to install?
What can Ecto Constraint Debug access on my machine?
How current is this page?
Sources
- github.com/oliver-kriska/claude-elixir-phoenix/tree/main/plugins — the audited source at commit 492f17636999 and every finding aboveObserved · 18 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Ecto Constraint Debug skill do?
- Is Ecto Constraint Debug safe to install?
- What can Ecto Constraint Debug access on my machine?