swe-programming-elixir
Elixir, Phoenix Framework, and Phoenix LiveView coding standards from authoritative docs/explanation/ documentation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Elixir, Phoenix Framework, and Phoenix LiveView coding standards from authoritative docs/explanation/ documentation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
AI agent development standards including frontmatter structure, naming conventions, tool access patterns, model selection, and reference documentation structure
Comprehensive project planning standards for plans/ directory including folder structure (ideas/, backlog/, in-progress/, done/), stage-aware naming convention (done uses YYYY-MM-DD__identifier/; backlog and in-progress use identifier/ with no date prefix), five-document file organization (README.md, brd.md, prd.md, tech-docs.md, delivery.md for multi-file default; single README.md for trivially-small single-file exception), BRD/PRD content-placement rules, Gherkin acceptance criteria, and the mandatory structured multiple-choice grilling gates (pre-write and post-write) for resolving design decisions with the user. Essential for creating structured, executable project plans.
Trunk Based Development workflow - all development on main branch with small frequent commits, minimal branching, and continuous integration. Covers when branches are justified (exceptional cases only), commit patterns, feature flag usage for incomplete work, environment branch rules (deployment only), and AI agent default behavior (the repo-wide default delivery mode is `worktree-to-pr` -- a short-lived plan branch in a disposable worktree pushed to a draft PR; direct push to main remains available as an explicit selection). Essential for understanding repository git workflow and keeping branches short-lived
Workflow pattern standards for creating multi-agent orchestrations including YAML frontmatter (name, description, tags, status, agents, parameters), execution phases (sequential/parallel/conditional), agent coordination patterns, and Gherkin success criteria. Essential for defining reusable, validated workflow processes.
Common software development workflow patterns shared across all language developer agents
Three-stage content quality workflow pattern (Maker creates, Checker validates, Fixer remediates) with detailed execution workflows. Use when working with content quality workflows, validation processes, audit reports, or implementing maker/checker/fixer agent roles.
| name | swe-programming-elixir |
| description | Elixir, Phoenix Framework, and Phoenix LiveView coding standards from authoritative docs/explanation/ documentation |
Progressive disclosure of Elixir stack coding standards for agents writing Elixir code.
Coverage: Elixir language → Phoenix Framework → Phoenix LiveView (full technology stack)
Usage: Auto-loaded for agents when writing any Elixir/Phoenix code. Provides quick reference to idioms, best practices, and antipatterns across the full stack.
Authoritative Source: docs/explanation/software-engineering/programming-languages/elixir/README.md
Modules: PascalCase
UserAccount, PaymentProcessorFunctions and Variables: snake_case
calculate_total/1, find_user_by_id/1user_name, total_amountAtoms: lowercase with underscores
:ok, :error, :not_foundPrivate Functions: Prefix with def (not defp for documentation)
@doc false for private but need to documentPattern Matching: Use extensively
case result do
{:ok, value} -> process_value(value)
{:error, reason} -> handle_error(reason)
_ -> :unknown
end
Pipe Operator: Chain transformations
data
|> parse()
|> validate()
|> process()
|> format()
With Statement: Handle multiple operations
with {:ok, user} <- find_user(id),
{:ok, account} <- find_account(user.account_id),
{:ok, balance} <- get_balance(account) do
{:ok, balance}
end
Protocols: Use for polymorphism
defprotocol Validator do
def validate(data)
end
Tagged Tuples: Use for results
{:ok, result} | {:error, reason}
Exceptions: Only for exceptional cases
raise ArgumentError, "invalid input"
With Else: Handle error cases
with {:ok, result} <- do_something() do
result
else
{:error, :not_found} -> default_value()
error -> handle_error(error)
end
GenServer: Use for stateful processes
defmodule Counter do
use GenServer
def init(initial_value) do
{:ok, initial_value}
end
def handle_call(:get, _from, state) do
{:reply, state, state}
end
end
Task: Use for async operations
task = Task.async(fn -> expensive_operation() end)
result = Task.await(task)
Supervision: Always supervise processes
children = [
{Counter, 0},
{Worker, []}
]
Supervisor.start_link(children, strategy: :one_for_one)
ExUnit: Built-in testing framework
defmodule UserTest do
use ExUnit.Case
test "creates user with valid data" do
assert {:ok, user} = User.create(%{name: "John"})
assert user.name == "John"
end
end
Doctests: Test examples in documentation
@doc """
Doubles a number.
## Examples
iex> double(5)
10
"""
def double(n), do: n * 2
Input Validation: Validate all external input
SQL Injection: Use Ecto queries
from(u in User, where: u.id == ^user_id)
Secrets Management: Use runtime configuration
# config/runtime.exs
config :my_app, api_key: System.get_env("API_KEY")
Authoritative Source: docs/explanation/software-engineering/platform-web/tools/elixir-phoenix/README.md
Foundation: Builds on Elixir language standards above.
Core Patterns:
Architecture & Configuration:
Data & Web:
Quality & Operations:
Authoritative Source: docs/explanation/software-engineering/platform-web/tools/elixir-phoenix/liveview.md
Foundation: Builds on Phoenix Framework standards above.
mount/3 — Initialize socket state on first loadhandle_params/3 — Handle URL parameter changeshandle_event/3 — Process client eventshandle_info/2 — Handle process messagesrender/1 — Generate HTML templateassign/3 to update socket statePhoenix.Component.update/2 for derived statephx-click, phx-submit, phx-change for user eventsphx-debouncephx-throttlephx-hook for JavaScript interopPhoenix.PubSub for broadcasting updatesmount/3, unsubscribe automaticallypush_event/3 for client-side JavaScriptPhoenix.Component.form/1 for formsphx-changeallow_upload/3temporary_assigns for large datasetsPhoenix.LiveView.JS for client-side DOM manipulationPhoenix.LiveViewTest for integration tests