phoenix-thinking

Review Phoenix LiveView apps to prevent database queries in mount.

167|14|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/georgeguimaraes/claude-code-elixir --skill phoenix-thinking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-thinking
Source: https://github.com/georgeguimaraes/claude-code-elixir/tree/main/plugins/elixir/skills/phoenix-thinking
Command: npx skills add https://github.com/georgeguimaraes/claude-code-elixir --skill phoenix-thinking

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps Elixir developers design Phoenix LiveView apps with correct lifecycle patterns, preventing mount-time queries and improving maintainability.

Core Features & Use Cases

  • Enforces the Iron Law that mount/3 should not perform database queries.
  • Guides scope-based data access and PubSub usage to keep multi-tenant apps secure.
  • Provides practical patterns for data loading with handle_params, subscriptions, and component design (LiveComponent vs LiveView).

Quick Start

Use the phoenix-thinking skill to review a LiveView page that initializes subscriptions in mount and loads data in handle_params.

Frequently Asked Questions about phoenix-thinking

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

FAQPage Schema
Why should I avoid database queries in the Phoenix LiveView mount callback?

Avoiding database queries in the Phoenix LiveView mount callback prevents unnecessary load on connected mounts and ensures data is loaded safely during handle_params. This pattern maintains app stability and improves maintainability across lifecycle stages.

How do I structure data loading in Phoenix LiveView using handle_params?

Data loading in Phoenix LiveView should be structured within handle_params rather than mount. This skill guides you through practical patterns for fetching data, scoping access, and managing subscriptions securely within the handle_params lifecycle callback.

What is the best way to manage PubSub and scopes in multi-tenant Phoenix LiveView apps?

Managing PubSub and scopes in multi-tenant Phoenix LiveView apps requires well-scoped data access patterns to keep environments secure. This involves initializing subscriptions correctly and ensuring data boundaries are respected during lifecycle callbacks.

When do I use LiveComponent versus LiveView for safe component design in Phoenix?

Choosing between LiveComponent and LiveView for safe component design in Phoenix depends on your data isolation needs. This skill provides mental models for structuring components to ensure well-scoped data access and maintain robust application architecture.

Does this Phoenix LiveView lifecycle pattern work for channel interactions and subscriptions?

Yes, the Phoenix LiveView lifecycle patterns apply across channel interactions and PubSub subscriptions. They enforce safe data loading and subscription initialization to prevent mount-time queries and ensure secure multi-tenant channel communication.