elixir-ecto

Build Elixir data layers with Ecto schemas, changesets, and migrations.

Updated Jan 15, 2026
One-click install
npx skills add https://github.com/vircung/opencode-config --skill elixir-ecto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elixir-ecto
Source: https://github.com/vircung/opencode-config/tree/main/skill/elixir-ecto
Command: npx skills add https://github.com/vircung/opencode-config --skill elixir-ecto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ecto patterns provide a cohesive approach to modeling data, validating input, and migrating schemas in Elixir apps, reducing boilerplate and errors.

Core Features & Use Cases

  • Ecto schemas and changesets for data modeling and validation.
  • Queries, associations, embedding, and migrations to evolve the data layer.
  • Real-world patterns: preloads, nested changesets, and migration strategies.

Quick Start

Create a minimal Ecto User schema with a changeset that validates required fields and hashes a password.

Frequently Asked Questions about elixir-ecto

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

FAQPage Schema
How do I build an Ecto schema with changesets for data validation in Elixir?

Build an Ecto schema by defining fields and a changeset function to validate required inputs and cast data. This enforces data validation and reduces input errors in Elixir applications.

What is the best way to manage Ecto migrations and associations in Phoenix?

The best way to manage Ecto migrations and associations is using standard Ecto patterns for schema evolution and preloads. This handles complex queries and nested data structures across Phoenix or non-Phoenix contexts.

Can I use Ecto queries and embedded schemas outside of a Phoenix application?

Yes, Ecto queries and embedded schemas work outside of Phoenix applications. Ecto enforces schemas, changesets, and complex query patterns in any Elixir context, reducing boilerplate and data errors.

How do I handle nested changesets and preloads for complex Ecto associations?

Handle nested changesets and preloads by applying standard Ecto patterns for complex associations. This validates nested input data and efficiently loads related records, preventing N+1 query issues.

When do I need embedded schemas instead of standard associations in Ecto?

Use embedded schemas in Ecto when you need to store nested data structures within a single record rather than using separate database tables. This enforces data validation for embedded maps and reduces migration complexity.