跳到主要内容
知仓学习社ZHICANG

phx-examples

Provide Phoenix, LiveView, Ecto, OTP, or Oban examples. Use when asked

不碰外部(只输出文字)无严重或高危命中oliver-kriska/claude-elixir-phoenix

它会碰到什么

扫了多少1 个文本文件,4 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Examples & Walkthroughs

Official Phoenix Guides (Reference)

For standard implementation patterns, always check official guides first:

| Topic | Guide |

|-------|-------|

| Contexts | hexdocs.pm/phoenix/contexts |

| Ecto Basics | hexdocs.pm/phoenix/ecto |

| LiveView | hexdocs.pm/phoenix_live_view |

| Authentication | mix phx.gen.auth |

| Channels | hexdocs.pm/phoenix/channels |

| Testing | hexdocs.pm/phoenix/testing |

| Deployment | hexdocs.pm/phoenix/deployment |

Plugin-Specific Patterns

Patterns NOT in official guides (unique to this plugin):

Tidewave Integration Workflow

# Requires connected mcp__tidewave__* tools

# Get exact docs for YOUR dependency versions
mcp__tidewave__get_docs "Ecto.Query"

# Execute code in running app
mcp__tidewave__project_eval "MyApp.Accounts.list_users() |> length()"

# Query database directly
mcp__tidewave__execute_sql_query "SELECT count(*) FROM users"

Multi-Agent Review Workflow

# 1. Plan feature with specialist agents
/phx-plan Add user avatars with S3 upload

# 2. After implementation, review with multiple perspectives
/phx-review lib/my_app/accounts.ex  # Elixir idioms
# Security analyzer runs automatically on auth code

# 3. Before deployment
# Deployment validator checks production readiness

Iron Laws Enforcement

This plugin enforces non-negotiable rules across all agents:

Elixir Idioms:

  • NO process without runtime reason
  • Messages are copied (keep small)
  • Changesets for external data

LiveView:

  • NEVER query DB in mount
  • ALWAYS use streams for lists
  • RE-AUTHORIZE in every handle_event

Oban:

  • Jobs MUST be idempotent
  • ALWAYS handle {:error, _} returns
  • Use unique keys for deduplication

Security:

  • Validate at boundaries
  • Never interpolate user input in queries
  • Authorize everywhere (not just mount)

Example Workflows

Bug Investigation

# 1. Start with obvious checks
/phx-investigate Login failing after password reset

# 2. Agent checks Ralph Wiggum list:
#    - File saved? Compiled? Migrated?
#    - Atom vs string keys?
#    - Data preloaded?

# 3. If complex, escalate to Ralph Wiggum Loop (if installed)
/ralph-loop:ralph-loop "Fix login tests. Output <promise>DONE</promise> when green."

Feature Planning

# 1. Research phase
/phx-research Oban unique jobs best practices

# 2. Plan with context analysis
/phx-plan Add daily digest email job

# 3. Agents coordinate:
#    - hex-library-researcher evaluates deps
#    - oban-specialist designs worker
#    - ecto-schema-designer plans data model

Security Audit

# 1. Run security analyzer on auth code
/phx-review lib/my_app_web/controllers/session_controller.ex

# 2. Check for common vulnerabilities:
#    - SQL injection (parameterized queries?)
#    - XSS (proper escaping?)
#    - CSRF (tokens present?)
#    - Authorization (re-checked in events?)

When to Use Official Docs vs Plugin

| Situation | Use |

|-----------|-----|

| "How do I create a context?" | Official Phoenix guides |

| "Is my context design idiomatic?" | Plugin's /phx-review |

| "How do I add LiveView?" | Official LiveView guides |

| "Does my LiveView have memory issues?" | Plugin's Iron Laws |

| "How do I deploy to Fly.io?" | Official deployment guide |

| "Is my release config production-ready?" | Plugin's deployment-validator |

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 553
本站分层T2
该仓技能数322
原文件路径targets/dsh/skills/phx-examples/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 322 个技能

同名技能的其他版本

有 5 个不同仓库或目录里都有叫 phx-examples 的技能。它们内容并不相同,别混用: