constraint-debug

Diagnoses Ecto database constraint errors by delegating to the canonical constraint debugger.

537|38|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill constraint-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: constraint-debug
Source: https://github.com/oliver-kriska/claude-elixir-phoenix/tree/main/plugins/ecto/skills/constraint-debug
Command: npx skills add https://github.com/oliver-kriska/claude-elixir-phoenix --skill constraint-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ecto database operations can fail with cryptic constraint violation errors (unique indexes, foreign keys, check constraints) that are hard to map back to the changeset or migration that caused them. This Skill routes your error, file, or scope to the canonical Ecto constraint debugger so you get a consistent diagnosis without duplicating analysis logic.

Core Features & Use Cases

  • Compatibility Alias: Acts as a stable entry point that forwards the full request to the canonical phx:ecto-constraint-debug skill, keeping older invocations working.
  • Flexible Input: Accepts an error message, a file path, or a code scope as its argument to focus the debugging session.
  • Use Case: You hit a unique_constraint violation when inserting a user record. Invoke the alias with the error output, and it loads the canonical debugger which walks you through identifying the conflicting constraint and fixing the changeset.

Quick Start

Invoke /ecto:constraint-debug with the Ecto constraint error message or the file you want diagnosed.

Frequently Asked Questions about constraint-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug an Ecto constraint violation error?

Invoke /ecto:constraint-debug with the error message, file, or scope you want analyzed. The alias forwards your request to the canonical phx:ecto-constraint-debug skill, which performs the actual diagnosis of the constraint failure.

What arguments does the Ecto constraint debugger accept?

It accepts an error message, a file path, or a code scope as its argument hint. Passing the raw database error output gives the debugger the most context to identify the violated constraint.

Is constraint-debug different from phx:ecto-constraint-debug?

No, it is a compatibility alias. It does not perform its own analysis; it loads the canonical phx:ecto-constraint-debug skill and instructs you to follow that skill exactly.

Why does my Ecto insert fail with a unique constraint error?

A unique constraint error means the database rejected a duplicate value for a unique-indexed column. Pass the full error to this skill so the canonical debugger can trace it back to the changeset or migration responsible.

Can I invoke this skill automatically through the model?

No, model invocation is disabled for this alias. You must invoke it explicitly with /ecto:constraint-debug in the Elixir/Phoenix plugin.