From elixir-phoenix
Captures lessons from bug fixes and corrections in Phoenix/Elixir projects — Ecto, LiveView, Oban, iron law mistakes. Documents rules in CLAUDE.md or MEMORY.md to prevent repeats.
How this skill is triggered — by the user, by Claude, or both
Slash command
/elixir-phoenix:learn-from-fixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
After fixing a bug or receiving a correction, capture the lesson
After fixing a bug or receiving a correction, capture the lesson to prevent future mistakes.
/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
Look at recent conversation context. Ask yourself:
Check if already documented:
${CLAUDE_SKILL_DIR}/references/common-mistakes.md (READ-ONLY plugin
reference — do NOT edit this file)If already documented, tell the user and stop.
CRITICAL: NEVER edit plugin files. Files under
~/.claude/plugins/ are cached and get overwritten on updates.
Always write to project or memory locations.
| Scope | Write to | Example |
|---|---|---|
| This project only | Project CLAUDE.md | "Never use raw SQL in this app" |
| All Elixir projects | Auto-memory MEMORY.md | "jsonb always uses string keys" |
| Detailed fix with context | .claude/solutions/ via /phx:compound | Complex debugging story |
For project CLAUDE.md — append a concise rule:
### [Category] Iron Laws (continued)
N. **[SHORT RULE NAME]** — Do NOT [bad pattern]. Instead [good pattern]
For auto-memory — append to
~/.claude/projects/{project-hash}/memory/MEMORY.md:
### Lesson: [Title]
- **Pattern**: Do NOT [bad] — instead [good]
- **Why**: [root cause explanation]
If the lesson is significant enough to be an Iron Law:
After capturing, confirm:
Lesson captured in [location]
Pattern: Do NOT [bad pattern] — instead [good pattern]
Category: [Ecto/LiveView/OTP/Testing/etc]
~/.claude/plugins/ are cached and overwritten on updates${CLAUDE_SKILL_DIR}/references/common-mistakes.md — Common Elixir mistakes
reference. Consult when checking for duplicates. Ships with
the plugin — NEVER modify.npx claudepluginhub oliver-kriska/claude-elixir-phoenix --plugin elixir-phoenixRecords reusable lessons from resolved bug fixes, architectural changes, interface updates, or recurring pitfalls into project memory docs, anchored to git commits.
Records project-specific learnings on gotchas, bugs, and unexpected behaviors into LEARNINGS.md via ctx CLI. Prompts for context, lesson, and application; checks for novelty before adding.
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the memory skill — they share sage-memory but serve different purposes (memory = codebase knowledge, self-learning = agent mistakes and gotchas). Also trigger on "sage review" or "review learnings" to curate and improve the learning database.