phoenix-code-review
Skill91 starsChanged 4 days agoApache-2.0View on GitHub
Reviews Phoenix code for controller patterns, context boundaries, Phoenix 1.8 scopes, routing, and plugs. Use when reviewing Phoenix apps, checking controllers, routers, or context modules.
In this repository85 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- agent-architecture-analysisSkill
- app-intents-code-reviewSkill
- artifact-analysisSkill
- axum-code-reviewSkill
- brainstorm-beagleSkill
- bubbletea-code-reviewSkill
- cloudkit-code-reviewSkill
- elixir-performance-reviewSkill
- elixir-security-reviewSkill
- elixir-writing-docsSkill
- exdoc-configSkill
- exunit-code-reviewSkill
- fastapi-code-reviewSkill
- fetch-pr-feedbackSkill
- ffi-code-reviewSkill
- fix-llm-artifactsSkill
- fowler-refactoringSkill
- gen-test-planSkill
- go-architectSkill
- go-code-reviewSkill
- go-data-persistenceSkill
- go-testing-code-reviewSkill
- healthkit-code-reviewSkill
- humanize-beagleSkill
- improve-docSkill
- ios-animation-code-reviewSkill
- liveview-code-reviewSkill
- llm-artifacts-detectionSkill
- llm-judgeSkill
- macros-code-reviewSkill
- postgres-code-reviewSkill
- prfaq-beagleSkill
- prometheus-go-code-reviewSkill
- pytest-code-reviewSkill
- quick-planSkill
- react-flow-code-reviewSkill
- react-flowSkill
- react-router-code-reviewSkill
- react-router-v7Skill
- receive-feedbackSkill
- refactor-repoSkill
- resolve-beagleSkill
- respond-pr-feedbackSkill
- review-ai-writingSkill
- review-elixirSkill
- review-frontendSkill
- review-goSkill
- review-iosSkill
- review-llm-artifactsSkill
- review-planSkill
- review-pythonSkill
- review-remix-v2Skill
- review-rustSkill
- review-skillSkill
- review-structureSkill
- review-tuiSkill
- review-verification-protocolSkill
- run-test-planSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 75
Do not report until Gates above pass.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Phoenix Code Review
Quick Reference
| Issue Type | Reference |
| Bounded contexts, Scopes, Ecto integration | references/contexts.md |
| Actions, params, error handling | references/controllers.md |
| Pipelines, scopes, verified routes | references/routing.md |
| Custom plugs, authentication | references/plugs.md |
Review Checklist
Controllers
- Business logic in contexts, not controllers
- Controllers return proper HTTP status codes (
:unprocessable_contentor legacy:unprocessable_entityfor 422) - Action clauses handle all expected patterns
- Fallback controllers handle errors consistently (using Phoenix 1.7+
put_view(json: ...)/put_view(html: ...))
Contexts
- Contexts are bounded by domain, not technical layer
- Public functions have clear, domain-focused names
- Phoenix 1.8+ Scopes (
%Scope{},current_scope) passed to scoped context functions (Posts.list_posts(scope)) - Changesets validate all user input
- No Ecto queries in controllers
Routing
- Verified routes (
~psigil) used, not string paths - Pipelines group related plugs
- Resources use only needed actions
- Scopes group related routes
Plugs
- Authentication/authorization via plugs (using non-bang lookups for session/token hydration)
- Plugs are composable and single-purpose
Plug.Conn.halt/1called after sending response in plugs
JSON APIs
- Proper content negotiation
- Consistent error response format
- Pagination for list endpoints
Valid Patterns (Do NOT Flag)
- Controller calling multiple contexts - Valid for orchestration
- Inline Ecto query in context - Context owns its data access
- Context functions taking
scopeas first argument (%Scope{}) - Standard Phoenix 1.8+ authorization/tenancy boundary - Using
action_fallback- Centralized error handling pattern - Multiple pipelines per route - Composition is intentional
Plug.Conn.halt/1without send - May be handled by fallback- Both
:unprocessable_contentand:unprocessable_entityfor 422 -:unprocessable_contentis modern Plug 1.16+/RFC 9110;:unprocessable_entityis a valid legacy alias
Context-Sensitive Rules
| Issue | Flag ONLY IF |
| Missing changeset validation | Field accepts user input AND no validation exists |
| Controller too large | More than 7 actions OR actions > 20 lines |
| Missing authorization | Route is not public AND no auth plug / scope check exists |
Gates (run in order; each step has a pass condition)
- Anchored evidence — For every planned finding, open the source and note file path + line number from that read (not from memory or diff snippets alone). Pass: each finding cites
path:linethat you opened. - “Handled elsewhere” sweep — Before reporting “missing validation,” “missing auth,” or “wrong status,” search the router (pipelines/scopes), controller (
action_fallback,plug), and relevant context for existing checks. Pass: you recorded whether handling exists elsewhere (yes + where, or no after search). - Verification protocol — Load and apply the
review-verification-protocolskill (review-verification-protocol) for the issue type. Pass: that skill’s pre-report checks for that finding class are satisfied before you write the finding. - Finding shape — Emit each issue as
[FILE:LINE] ISSUE_TITLEwith a one-line rationale tied to the cited code. Pass: every line matches that pattern.
Before Submitting Findings
Do not report until Gates above pass. For full anti-false-positive steps, follow the review-verification-protocol skill (review-verification-protocol).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

