ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

exunit-code-review

Reviews ExUnit test code for proper patterns, boundary mocking with Mox, and test adapter usage. Use when reviewing _test.exs files or test helper configurations.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/anderskev/exunit-code-review
Or

What This Skill Does

The exunit-code-review skill is a specialized static analysis tool for the OpenClaw AI agent, specifically engineered to audit Elixir test suites. It enforces best practices for ExUnit, the default test framework in Elixir, by evaluating code against established architectural patterns. It ensures that developers utilize Mox for boundary mocking, implement proper test adapters for side-effect-heavy dependencies like email (Swoosh) or job queues (Oban), and verify that developers do not mistakenly mock internal domain logic. By following the integrated checklist, the skill identifies structural issues, improper database sandbox usage, and violations of the 'mock-at-the-edge' philosophy.

Installation

To integrate this skill into your OpenClaw environment, execute the following command in your terminal: clawhub install openclaw/skills/skills/anderskev/exunit-code-review Ensure you have the latest version of the OpenClaw CLI installed and your repository permissions configured to access the openclaw/skills registry.

Use Cases

  • Continuous Integration Reviews: Automatically comment on pull requests containing _test.exs files to ensure new tests follow project standards.
  • Refactoring Support: Use the agent to analyze legacy test suites where mocks are currently polluting the internal business logic.
  • Learning & Onboarding: Provide junior developers with immediate, context-aware feedback on why their approach to mocking external HTTP services might be brittle.
  • Architecture Audits: Quickly identify which tests are marked as async: true while unintentionally sharing global database state.

Example Prompts

  1. "Review the file test/my_app/services/payment_processor_test.exs for mock-at-boundary compliance and suggest improvements to the setup block."
  2. "Why is the agent flagging my test in test/my_app/contexts/user_test.exs? I am mocking the User schema module."
  3. "Can you help me refactor this test helper to correctly use Swoosh.TestAdapter and Mox for the payment gateway service?"

Tips & Limitations

  • Context Awareness: The tool is highly sensitive to the difference between unit and integration tests. If you are writing integration tests, the agent will correctly avoid forcing you to mock database interactions.
  • False Positives: If you have custom boundary abstractions, ensure your module naming conventions align with the agent's expectations to avoid flagging internal code.
  • Proactive Verification: Always run mix test after applying suggestions to verify that the generated mock expectations satisfy your verify_on_exit! triggers.

Metadata

Author@anderskev
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-anderskev-exunit-code-review": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#elixir#exunit#testing#mox#code-review
Safety Score: 5/5

Flags: file-read