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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/anderskev/exunit-code-reviewWhat 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.exsfiles 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: truewhile unintentionally sharing global database state.
Example Prompts
- "Review the file
test/my_app/services/payment_processor_test.exsfor mock-at-boundary compliance and suggest improvements to the setup block." - "Why is the agent flagging my test in
test/my_app/contexts/user_test.exs? I am mocking the User schema module." - "Can you help me refactor this test helper to correctly use
Swoosh.TestAdapterandMoxfor 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 testafter applying suggestions to verify that the generated mock expectations satisfy yourverify_on_exit!triggers.
Metadata
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-anderskev-exunit-code-review": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read
Related Skills
tutorial-docs
Tutorial patterns for documentation - learning-oriented guides that teach through guided doing
fetch-pr-feedback
Fetch review comments from a PR and evaluate with receive-feedback skill
swift-testing-code-review
Reviews Swift Testing code for proper use of
rust-testing-code-review
Reviews Rust test code for unit test patterns, integration test structure, async testing, mocking approaches, and property-based testing. Covers Rust 2024 edition changes including async fn in traits for mocks,
explanation-docs
Explanation documentation patterns for understanding-oriented content - conceptual guides that explain why things work the way they do