Community contribution for Gentleman-Skills: Core catalog of 8 critical anti-patterns for Elixir/Phoenix applications.
This skill uses a hybrid approach to balance LLM context limits with comprehensive documentation:
elixir-antipatterns/
├── SKILL.md # Core 8 patterns (322 lines as of v1.0)
├── README.md # This file
├── assets/
│ ├── extended.md # Complete 40+ patterns (706 lines)
Optimized for code review and refactoring sessions
Contains the top 8 most critical anti-patterns:
- Use
raisefor business errors - Return
nilfor errors - Business logic in LiveView
- N+1 queries
=insidewithfor failable operations- Query without indexes
- Tests without assertions
- Long
withchains (>4 steps)
Why separate files?
- SKILL.md fits within LLM context windows
- Aligns with Gentleman-Skills standard (150-388 line target)
- Includes ASCII diagram for Phoenix architecture visualization
- extended.md preserves all knowledge with advanced Ecto patterns
- Error Handling: Tagged tuples vs exceptions vs nil
- Separation of Concerns: Phoenix contexts vs business logic in views
- Database Performance: N+1 queries, indexing, transactions
- Testing Best Practices: Independent tests, assertions, async execution
- Comprehensive Elixir/Phoenix skill: Covers error handling, contexts, Ecto, testing
- Code review optimized: Trigger designed for PR reviews and refactoring
- Visual aids: ASCII diagrams for Phoenix Context Separation architecture
- Advanced techniques: extended.md documents 3 Ecto preload strategies
The AI will automatically load SKILL.md when working with Elixir code. For deeper reference:
## Skills
When working with Elixir/Phoenix code, load the `elixir-antipatterns` skill.
For comprehensive patterns, reference `extended.md`.Validated with:
- ✅ Cursor on Elixir/Phoenix projects
- ✅ Production applications (2+ years)
- ✅ Mix format + Credo compliance
Created for Gentleman-Skills.
MIT License - Free to use and modify