phoenix-generator

Generate Phoenix contexts, schemas, LiveViews, and controllers via mix phx.gen commands.

10|2|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/mkreyman/bmad-elixir --skill phoenix-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-generator
Source: https://github.com/mkreyman/bmad-elixir/tree/main/priv/skills/phoenix-generator
Command: npx skills add https://github.com/mkreyman/bmad-elixir --skill phoenix-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates Phoenix resource scaffolding using mix phx.gen.* commands, aligning generated code with recommended patterns and testing.

Core Features & Use Cases

  • Context & Schema Generation: Create contexts, schemas, and migrations with sensible defaults.
  • LiveView & API Generators: Scaffold LiveView CRUD or JSON/HTML resources.
  • Guided Customization: Provides guidance on tailoring generated code to fit architecture.

Quick Start

Generate a new Accounts context with a User schema using mix phx.gen.context Accounts User users name:string email:string:unique.

Frequently Asked Questions about phoenix-generator

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

FAQPage Schema
How do I generate Phoenix resources like contexts and schemas?

Use mix phx.gen.context to scaffold a new context with schema and migrations. The command generates context, schema, and migration files with sensible defaults aligned to Phoenix conventions.

Can I scaffold LiveView CRUD interfaces in Phoenix?

Yes, mix phx.gen.live creates LiveView components and routes for CRUD operations. It generates the full interface, templates, and test files following Phoenix best practices.

What's the best way to customize generated migrations and validations?

Specify field types, associations, and constraints directly in the generator command—use name:string email:string:unique decimal:decimal to apply decimal precision and validations before generation.

Does Phoenix scaffolding work for JSON APIs?

Yes, mix phx.gen.json generates JSON resources with controllers and migrations. It produces the same schema and migration structure as HTML generators but returns JSON responses.

Can I add schemas to an existing Phoenix context?

Use mix phx.gen.schema to add a new schema and migration to an existing context. This adds the resource without recreating the context or its other schemas.

What Phoenix conventions does the generator apply?

The generator enforces field types, decimal precision handling, associations, and validation patterns. It also creates test stubs and routes following Phoenix standards for consistency.