ecto-migrator
Generate Ecto migrations from natural language or schema descriptions. Handles tables, columns, indexes, constraints, references, enums, and partitioning. Supports reversible migrations, data migrations, and multi-tenant patterns. Use when creating or modifying database schemas, adding indexes, altering tables, creating enums, or performing data migrations in an Elixir project.
Why use this skill?
Automate your Elixir database schema changes with the Ecto Migrator skill. Generate accurate, index-ready, and reversible migrations from natural language.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/gchapim/ecto-migratorWhat This Skill Does
The ecto-migrator skill is a specialized AI agent tool designed to streamline the database schema evolution process for Elixir applications using Ecto. It bridges the gap between natural language intent and syntactically correct Ecto migration files. By understanding database design patterns, naming conventions, and standard Ecto best practices, the agent can translate simple user requests into structured Elixir code, ensuring that migrations are safe, reversible, and follow industry standards like using binary_id, utc_datetime_usec for timestamps, and appropriate indexing strategies for high-performance PostgreSQL operations.
Installation
To integrate this skill into your OpenClaw agent environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/gchapim/ecto-migrator
Use Cases
This skill is ideal for teams building scalable Elixir applications. It is particularly effective when:
- Bootstrapping new database tables from feature specifications.
- Adding new functionality requiring schema changes, such as new columns or complex constraints.
- Implementing multi-tenant architecture by automating the insertion of
tenant_idcolumns and corresponding composite indexes. - Refactoring existing database structures, such as renaming columns or splitting tables, while ensuring data integrity.
- Defining GIN indexes for complex JSONB metadata or array-based data fields.
Example Prompts
- "Create a new table for posts with title, body, and a reference to the users table. Make sure the user_id is indexed and timestamps are included."
- "Add a status column to the orders table with a default value of 'pending' and create a partial index for all rows where status is not completed."
- "Refactor the products table: add a price column as an integer to store cents, and create a unique index on the sku column."
Tips & Limitations
- Type Safety: Always rely on standard Ecto types. The agent is configured to prioritize
:binary_idand:mapover custom database types to ensure portability and easier migrations. - Constraint Awareness: Remember that the agent can handle complex check constraints; explicitly mention any business rules (e.g., 'amount must be greater than zero') to have the agent generate the corresponding
create constraintstatement. - Reversibility: While the agent generates
changeblocks which are automatically reversible for most operations, complex data migrations may require manual review. Always inspect the generated migration files before runningmix ecto.migrate. - Performance: The agent follows strict indexing patterns. It automatically suggests GIN indexes for JSONB, but if you have specific performance requirements, be sure to mention them in the prompt.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-gchapim-ecto-migrator": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, code-execution
Related Skills
readwise
Manage Readwise highlights, books, daily review, and Reader documents (save-for-later / read-it-later). Use when the user wants to save articles or URLs to Reader, browse their reading list, search saved documents, review highlights, create or manage highlights and notes, check their daily review, list books/sources, or interact with Readwise/Reader in any way.
oban-designer
Design and implement Oban background job workers for Elixir. Configure queues, retry strategies, uniqueness constraints, cron scheduling, and error handling. Generate Oban workers, queue config, and test setups. Use when adding background jobs, async processing, scheduled tasks, or recurring cron jobs to an Elixir project using Oban.
elixir-dev
Elixir/Phoenix development companion. Run and interpret mix test, mix credo, mix dialyzer, mix format. Generate modules following OTP conventions: contexts, schemas, GenServers, supervisors, tasks. Debug compilation errors and warnings. Help with Ecto migrations, queries, changesets, and associations. Use for any Elixir or Phoenix development task including writing modules, fixing tests, refactoring code, or understanding OTP patterns.
oban-designer
Design and implement Oban background job workers for Elixir. Configure queues, retry strategies, uniqueness constraints, cron scheduling, and error handling. Generate Oban workers, queue config, and test setups. Use when adding background jobs, async processing, scheduled tasks, or recurring cron jobs to an Elixir project using Oban.
phoenix-api-gen
Generate a full Phoenix JSON API from an OpenAPI spec or natural language description. Creates contexts, Ecto schemas, migrations, controllers, JSON views/renderers, router entries, ExUnit tests with factories, auth plugs, and tenant scoping. Use when building a new Phoenix REST API, adding CRUD endpoints, scaffolding resources, or converting an OpenAPI YAML into a Phoenix project.