# Ash Guardrails

> Skill: ash-guardrails

- Skill: `layeddie/ash-guardrails` (Agent Skill)
- Install (CLI): `npx skillmds@latest add layeddie/ash-guardrails`
- Raw SKILL.md: https://api.skillmd.com/api/skills/layeddie/ash-guardrails/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: layeddie (https://skillmd.com/u/layeddie)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/layeddie/ash-guardrails

---

# Skill: ash-guardrails

**INVOKE BEFORE** editing Ash resources/actions/policies/notifiers.

## Use when
- Files under `*_ash/` or `lib/**/ash/**`.
- Adding actions, attributes, or policies.

## Checklist
- Keep resources thin: validations in changes, logic in actions, side-effects in notifiers.
- Authorization: define policies per action; default deny; use `bypass? false`.
- Queries: preload related data in queries to avoid N+1; use calculations instead of manual Enum maps.
- Changes: prefer `change set_attribute`/`change manage_relationship` over custom code.
- APIs: expose minimal public actions; avoid direct Repo access from controllers.

## Warnings to emit
- Direct Repo calls from controllers bypassing Ash APIs.
- Missing policy for custom actions.
- Large `after_action` blocks doing IO; move to notifiers/observers.

## References
- ai-rules patterns: `patterns/ash/` if present.

