Ash/Ecto Essentials

Enforce Ash Framework and Ecto database interaction best practices in Elixir applications.

24|4|Updated Nov 15, 2023
One-click install
npx skills add https://github.com/matthewsinclair/intent --skill ash-ecto-essentials
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Ash/Ecto Essentials
Source: https://github.com/matthewsinclair/intent/tree/main/intent/plugins/claude/skills/in-ash-ecto-essentials
Command: npx skills add https://github.com/matthewsinclair/intent --skill ash-ecto-essentials

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces best practices for interacting with databases in Ash Framework projects, preventing common anti-patterns and ensuring maintainable, robust code.

Core Features & Use Cases

  • Domain Code Interfaces: Ensures all database operations are routed through defined interfaces, not direct Ash calls.
  • Migration Strategy: Mandates mix ash.codegen for migrations, avoiding manual Ecto migration pitfalls.
  • Actor Management: Guides correct actor assignment for authorization within queries and changesets.
  • Use Case: A new developer joins a project and is unsure about the correct way to fetch data or perform updates. This Skill provides clear, actionable rules to guide them, preventing them from making costly mistakes.

Quick Start

Follow the rules in this skill to ensure all database access goes through domain code interfaces.

Frequently Asked Questions about Ash/Ecto Essentials

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

FAQPage Schema
How do I manage Ash Framework database access rules in Elixir?

Manage Ash Framework database access by routing all database operations through defined domain code interfaces instead of making direct Ash calls, ensuring maintainability and security.

What's the best way to generate Ecto migrations in an Ash Framework project?

The best way to generate Ecto migrations in an Ash Framework project is using the `mix ash.codegen` command, which avoids manual Ecto migration pitfalls and ensures proper schema synchronization.

How does actor authorization work for Ecto queries and changesets in Ash?

Actor authorization in Ash works by correctly assigning the actor to queries and changesets before execution, which enforces domain-level permissions and prevents unauthorized data modifications.

Do I need to use domain code interfaces for all Ash Framework database interactions?

Yes, you need to use domain code interfaces for all Ash Framework database interactions because direct Ash calls bypass authorization rules and create maintenance issues within Elixir applications.

Why does directly calling Ash functions create anti-patterns in Elixir applications?

Directly calling Ash functions creates anti-patterns because it bypasses domain code interfaces, skipping actor authorization checks and atomic changes enforcement, which leads to robust code violations.