ash-framework

仓库创建 2026年2月12日最近提交 5 小时前SkillHot 收录 20 天前
▸ 精选理由

面向 Ash 的实践与生成示例,适合使用 Ash 的团队

▸ 风险提示

可能生成或修改代码,需代码库写入权限

这个 Skill 做什么

为 Phoenix 项目提供 Ash Framework 的参考与代码生成指导。

为 Phoenix/LiveView 项目提供 Ash Framework 的实用参考和代码生成建议,覆盖 resources、actions、policies、aggregates、AshPhoenix.Form 等常见场景。强调在 LiveView/Controller 中通过领域代码接口(domain code interfaces)而不是直接调用 Ash.create/Ash.read,保持边界和可维护性。适合用 mix ash.codegen、调整校验或写域逻辑接口时查阅和实践。

▸ 展开 SKILL.md 英文原文

Ash Framework — resources, actions, policies, aggregates, calculations, AshPhoenix.Form, LiveView, migrations. Use when generating resources via mix ash.codegen, editing changes, checks, types, validations, or domain code interfaces.

开发编程Ash框架Phoenix代码生成资源建模通用
505
Stars
34
Forks
40
仓库内 Skill
+35
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/oliver-kriska/claude-elixir-phoenix/main/plugins/elixir-phoenix/skills/ash-framework/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/oliver-kriska/claude-elixir-phoenix/main/plugins/elixir-phoenix/skills/ash-framework/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Ash Framework Reference

Reference for Ash Framework in Phoenix/LiveView projects.
Ash complements Phoenix/Ecto — LiveView, security, and OTP Iron Laws still apply.
Only data access patterns shift toward Ash actions and domain code interfaces.

## Iron Laws

1. **USE DOMAIN CODE INTERFACES** — Never call `Ash.create/Ash.read` directly in LiveViews or Controllers; use domain code interfaces: `MyApp.Accounts.register_user()` not `Ash.create(User, attrs)`
2. **SET ACTOR/SCOPE AT QUERY PREP, NOT EXECUTION** — Pass `actor:` or `scope:` to
   `for_read/for_create/for_action` (prep), NOT to `Ash.read!/Ash.create!` (execution);
   execution-level actor bypasses row-level policy evaluation. If proj
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有