‹ 首页

examples

@oliver-kriska · 收录于 4 天前 · 上游提交 4 天前

Provide Phoenix, LiveView, Ecto, OTP, or Oban examples. Use when asked for sample code, a walkthrough, a proper implementation, or expected workflow output. Pair with domain skills. NOT for debugging, direct changes, best-practice advice, or audits.

适合你,如果你需要 Phoenix、Ecto 等框架的示例和最佳实践

/ 通过 npx 安装 校验哈希
npx oh-my-skill add oliver-kriska/claude-elixir-phoenix/examples
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- oliver-kriska/claude-elixir-phoenix/examples
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify oliver-kriska/claude-elixir-phoenix/examples
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
503GitHub stars
~825上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 88c1194 · 表述以原文为准
它做什么

装上后,当被问到Phoenix、LiveView、Ecto、OTP或Oban的示例代码、操作步骤或正确实现时,Claude会提供相应的代码片段和演练,并参考官方指南和插件特有的规则与工作流。

什么时候触发

当你询问Phoenix、LiveView、Ecto、OTP或Oban的示例代码、操作演练、正确实现或预期工作流输出时触发。

装好后可以这样说
Claude会展示代码和步骤。
Claude会提供作业定义和调用示例。
Claude会给出查询代码和解释。
技能原文 SKILL.md作者撰写 · MIT · 88c1194

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
# 1. Check if Tidewave is running
/mcp

# 2. If connected, debug with runtime 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 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。