cc-changelog
CONTRIBUTOR TOOL - Track CC changelog, extract new versions since last check, analyze impact on plugin (breaking changes,…
Write or repair Elixir tests with ExUnit, sandbox isolation, async reliability, Mox, ExMachina, and LiveViewTest. Use for test files, test setup, or failing/flaky tests. NOT for investigating an application bug outside the test suite.
Claude Code
$ npx -y skills add oliver-kriska/claude-elixir-phoenix --skill testing --agent claude-code
Codex
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill testing -a codex -y
Cursor
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill testing -a cursor -y
Gemini CLI
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill testing -a gemini-cli -y
GitHub Copilot
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill testing -a github-copilot -y
OpenCode
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill testing -a opencode -y
Windsurf
$ npx skills add oliver-kriska/claude-elixir-phoenix --skill testing -a windsurf -y
name: testing description: "Write or repair Elixir tests with ExUnit, sandbox isolation, async reliability, Mox, ExMachina, and LiveViewTest. Use for test files, test setup, or failing/flaky tests. NOT for investigating an application bug outside the test suite." effort: medium user-invocable: false paths: - "test/**/*_test.exs" - "test/support/**/*.ex" - "**/*factory*.ex"
> **Ash projects**: Use `DataCase` with `Ash.Test` helpers; test actions via domain code interfaces, not direct `Repo` calls. See `ash-framework` skill.
Quick reference for Elixir testing patterns.
1. **ASYNC BY DEFAULT** — Use `async: true` unless tests modify global state 2. **SANDBOX ISOLATION** — All database tests use Ecto.Adapters.SQL.Sandbox 3. **MOCK ONLY AT BOUNDARIES** — Never mock database, internal modules, or stdlib 4. **BEHAVIOURS AS CONTRACTS** — All mocks must implement a defined `@callback` behaviour 5. **BUILD BY DEFAULT** — Use `build/2` in factories; `insert/2` only when DB needed 6. **NO PROCESS.SLEEP** — Use `assert_receive` with timeout for async operations 7. **VERIFY_ON_EXIT!** — Always call in Mox tests setup 8. **FACTORIES MATCH SCHEMA REQUIRED FIELDS** — Factory definitions must include all fields that have `validate_required` in the schema changeset. Missing fields cause cascading test failures
| Testing | Use | |---------|-----| | Controller/API | `use MyAppWeb.ConnCase` | | Context/Schema | `use MyApp.DataCase` | | LiveView | `use MyAppWeb.ConnCase` + `import Phoenix.LiveViewTest` | | Pure logic | `use ExUnit.Case, async: true` |
# Setup chain
setup [:create_user, :authenticate]
# Pattern matching assertion
assert {:ok, %User{name: name}} = create_user(attrs)
# Async message assertion
assert_receive {:user_created, _}, 5000
# Mox setup
setup :verify_on_exit!
expect(MockAPI, :call, fn _ -> {:ok, "data"} end)
# LiveView async
html = render_async(view) # MUST call for assign_async| Wrong | Right | |-------|-------| | `Process.sleep(100)` | `assert_receive {:done, _}, 5000` | | `insert(:user)` in factory | `build(:user)` in factory | | `async: true` with `set_mox_global()` | `async: false` | | Mock internal modules | Test through public API |
For detailed patterns, see:
Docs: phxagents.dev -- install guides per runtime, the runtime compatibility matrix, all 26 Iron Laws, and a browsable skill and agent catalog. Claude Code is great.
CONTRIBUTOR TOOL - Track CC changelog, extract new versions since last check, analyze impact on plugin (breaking changes,…
Run an A/B codex review experiment — holistic codex review vs 3 focused dimension passes (security, ecto, liveview) on the branch…
CONTRIBUTOR TOOL - Validate plugin against latest Claude Code documentation. Catches breaking changes, deprecations, discovers…
Guide plugin development workflow — editing skills, agents, hooks, or eval framework in this repo. Use when modifying files in…
Generate X/Twitter release promotion posts with ASCII tables and CodeSnap rendering. Use when writing release posts, promotion…
CONTRIBUTOR TOOL - Cut a plugin release: bump plugin.json version, finalize CHANGELOG, update README if needed, gate on make ci,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.