# Learn From Fix

Capture Elixir/Ecto/LiveView lessons and Hex API rules.

- Repository: https://github.com/oliver-kriska/claude-elixir-phoenix (572 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add oliver-kriska/claude-elixir-phoenix --skill learn-from-fix -g -a claude-code -y`
Codex: `npx skills add oliver-kriska/claude-elixir-phoenix --skill learn-from-fix -g -a codex -y`
Cursor: `npx skills add oliver-kriska/claude-elixir-phoenix --skill learn-from-fix -g -a cursor -y`
Gemini CLI: `npx skills add oliver-kriska/claude-elixir-phoenix --skill learn-from-fix -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add oliver-kriska/claude-elixir-phoenix`

## Description

Capture Elixir/Ecto/LiveView lessons and Hex API rules. Use after corrections or when asked to document learning, record a lesson, prevent a fixed mistake, or remember package guidance with --library.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Learn From Fix

After fixing a bug or receiving a correction, capture the lesson
to prevent future mistakes.

## Usage

```
/phx:learn-from-fix Fixed N+1 query in user listing - was missing preload
/phx:learn-from-fix String vs atom key mismatch in params handling
/phx:learn-from-fix LiveView assign_async needs render_async in tests
/phx:learn-from-fix --library ical --scope personal ICal.to_ics output needs CRLF line endings
/phx:learn-from-fix --library ical --scope project Use method: "PUBLISH" for calendar feeds
```

## Workflow

### Step 1: Verify the Lesson

Persist only one of:

- A completed fix verified by tests, reproduction, or user confirmation
- An explicit rule the user taught or asked to save

Stop without writing if neither condition is met.
Do not save a hypothesis, unverified workaround, investigation narrative, or
unsolved error. Use `/phx:compound` for a detailed completed investigation.
Capture the root cause as a concise actionable rule, not the symptom.

### Step 2: Select the Route

When both `--library <package>` and `--scope personal|project` are present,
use the [Library Route](#library-route). Require both flags; do not guess scope.
For the skill directory only, trim surrounding whitespace and lowercase the
package name. Preserve underscores when forming directory names
(`phoenix_live_view` becomes `hex-phoenix_live_view`).
Validate the normalized name against `^[a-z][a-z0-9_]+$`. If it does not match,
ask for a valid Hex package identifier instead of replacing characters or
inventing a name. Use the trimmed original identifier, not the normalized
directory name, to look up `mix.lock`.

Without `--library`, use the [General Correction Route](#general-correction-route).

### Step 3: Check Existing Knowledge

Check if already documented:

The rest: https://github.com/oliver-kriska/claude-elixir-phoenix/blob/HEAD/plugins/elixir-phoenix/skills/learn-from-fix/SKILL.md
