Set up AI-assisted dev tooling (usage_rules, Tidewave, domain MCP, Ash AI, CLAUDE.md, skills, logging, browser testing) for Ash/Phoenix projects. Use when creating a new Ash/Phoenix project or adding AI tooling to an existing one.
You are setting up the AI-assisted development environment for an Ash/Phoenix project. This includes: usage_rules, Tidewave MCP, domain MCP (dev), Ash AI, CLAUDE.md, Claude Code skills, the logging-best-practices skill, and optionally browser testing and dev environment setup (devenv/flake/devbox).
Before doing anything, read the full setup guide and defaults:
Read skills/ash-kindle/references/setup-guide.md
Read skills/ash-kindle/defaults.md
Determine:
mix.exs in the directory)my_app)MyAppWebash_domains in config)devenv.nix, flake.nix, or devbox.json)AshAi.Mcp.Dev in endpoint.ex, "/dev/mcp" in router.ex, @mcp_tools module attribute in router.ex, and a non-tidewave entry in .mcp.json — if all four present, skip; if partially configured, warn the user and offer to complete setup).claude/skills/browser-testing/SKILL.md)Use mix.exs, config/config.exs, and the project file structure to answer these.
If the directory has no mix.exs, offer to create a new Phoenix project:
mix archive.install hex phx_new --forceyes | mix phx.new . --app <app_name>
yes | prefix is needed to auto-confirm the existing directory promptPresent the user with what you'll set up:
I'll configure the following AI dev tooling for your Ash/Phoenix project:
- usage_rules — CLAUDE.md generation + doc search from deps
- Tidewave — dev MCP server for runtime introspection (eval, logs, schemas)
- Domain MCP — dev-only MCP server exposing your Ash domain tools (requires Ash domains with resources)
- Ash AI — usage rules and MCP tooling for Ash resources
- CLAUDE.md — project instructions (Ash First, MCP Usage, Feedback Loop, Logging)
- Claude Code skills — auto-generated from usage_rules config
- logging-best-practices — external skill for wide events pattern
- Browser testing — optional GIF-recorded browser walkthrough skill (requires Claude-in-Chrome)
- Dev environment — optional setup for devenv, flake, or devbox with PostgreSQL
Want to customize any of these, or are defaults fine?
If the user says defaults are fine, proceed with all defaults from defaults.md.
Default for Domain MCP: yes if Ash domains with resources are detected, no otherwise.
Default for Browser testing: no (opt-in only).
Default for Dev environment: skip if no config file detected, otherwise default to detected tool.
If the user wants to customize, ask about each piece one at a time:
:elixir, :otp, :phoenix, others?)ash-framework; suggest others based on detected deps)plug dependency conflictWhen tidewave (only: :dev) and ash_ai (which brings in ash_json_api) are
both present, there is a :only env conflict on the plug dependency. You must
add an explicit plug dependency to resolve this:
{:plug, "~> 1.19"}
# Add to deps in root mix.exs
{:plug, "~> 1.19"},
{:usage_rules, "~> 1.2", only: :dev, runtime: false}
Note: The
plugdep may not be needed in umbrella projects iftidewaveandash_ailive in separate child apps. Only add it ifmix deps.getreports an:onlyoption conflict onplug.
# Add to deps
{:tidewave, "~> 0.5", only: :dev}
# Add to deps
{:ash_ai, "~> 0.5"}
mix.exs:{:plug, "~> 1.19"},
{:ash, "~> 3.0"},
{:ash_phoenix, "~> 2.0"},
{:ash_postgres, "~> 2.0"},
{:ash_ai, "~> 0.5"},
{:usage_rules, "~> 1.2", only: :dev, runtime: false},
{:tidewave, "~> 0.5", only: :dev}
Then run:
mix deps.get
Add the usage_rules() function and reference it in the project config.
See defaults.md for the default configuration. Adapt based on:
usage_rules goes in root mix.exs.claude/skillsIn the project/0 function, add:
# listeners required for usage_rules to auto-regenerate on code changes