elixir-antipatterns

Identify and correct Elixir and Phoenix anti-patterns in code reviews.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/JFEspanolito/Template_FrontEnd_NextJS_JF --skill elixir-antipatterns-jfespanolito
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elixir-antipatterns
Source: https://github.com/JFEspanolito/Template_FrontEnd_NextJS_JF/tree/main/AI/skills/community/elixir-antipatterns
Command: npx skills add https://github.com/JFEspanolito/Template_FrontEnd_NextJS_JF --skill elixir-antipatterns-jfespanolito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps Elixir developers identify and fix common anti-patterns that lead to bugs, performance issues, and maintainability problems in Phoenix applications.

Core Features & Use Cases

  • Code Review Assistant: Automatically flags critical anti-patterns during code reviews.
  • Refactoring Guide: Provides clear examples of problematic code and its correct Elixir/Phoenix equivalent.
  • Use Case: When reviewing a Pull Request for a Phoenix LiveView component, this Skill can highlight if business logic is being placed directly in the view instead of a context module, suggesting a refactor for better separation of concerns.

Quick Start

Review the provided Elixir code for common anti-patterns.

Frequently Asked Questions about elixir-antipatterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 queries and other Elixir anti-patterns in my code?

To fix Elixir anti-patterns like N+1 database queries, review your Phoenix application code to identify inefficient data fetching and apply correct query implementations. Refactoring these problematic patterns optimizes database interactions and improves application performance.

What is the best way to handle business errors in Phoenix LiveView without using raise?

The best way to handle business errors in Phoenix is to avoid using `raise` for expected business logic failures. Instead, return explicit error tuples and pattern match them in your LiveView, ensuring proper separation of concerns between view rendering and business logic.

Why should business logic be moved out of Phoenix LiveView components?

Business logic should be moved out of Phoenix LiveView components to ensure proper separation of concerns. Placing application logic directly in views creates maintainability problems and anti-patterns; refactoring it into dedicated context modules makes the Elixir code more robust and testable.

How do I review Elixir code for common Phoenix anti-patterns?

To review Elixir code for Phoenix anti-patterns, systematically check for common pitfalls like using `raise` for business errors, N+1 database queries, and misplaced logic in LiveViews. Compare problematic implementations against correct refactoring examples to ensure robust application architecture and proper error handling.

Can this Skill detect architecture anti-patterns in Elixir applications?

Yes, this Skill can detect architecture anti-patterns in Elixir applications. It identifies critical architectural issues across error handling, database queries, and testing, providing clear examples of incorrect versus correct implementations to facilitate effective code review and refactoring.