Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/j-morgan6/elixir-phoenix-guide/phoenix-json-apinpx skills add j-morgan6/elixir-phoenix-guide --skill phoenix-json-apigit clone --depth 1 https://github.com/j-morgan6/elixir-phoenix-guideWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/j-morgan6/elixir-phoenix-guide/phoenix-json-api)<a href="https://agentmods.dev/skills/j-morgan6/elixir-phoenix-guide/phoenix-json-api"><img src="https://agentmods.dev/badge/skills/j-morgan6/elixir-phoenix-guide/phoenix-json-api.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00032 | $0.03197 |
| Opus 5 | $0.00016 | $0.01598 |
| Sonnet 5 | $0.00006 | $0.00639 |
| Haiku 4.5 | $0.00003 | $0.00320 |
Grade A, and why
phoenix-json-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 453 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Phoenix JSON API
RULES — Follow these with no exceptions
- Use the
:apipipeline — don't mix HTML and JSON pipelines; API routes skip CSRF, sessions, and browser headers - Render errors as structured JSON —
{:error, changeset}must become{"errors": {...}}; never return raw text or HTML errors - Use offset/limit for pagination — never return unbounded collections; default to a sensible limit (e.g., 20)
- Version APIs via URL prefix (
/api/v1/) — not headers; URL versioning is visible, cacheable, and debuggable - Use
FallbackControllerfor consistent error handling — every action returns{:ok, result}or{:error, reason}; the fallback renders errors - Authenticate via Bearer tokens in
Authorizationheader — not cookies; API clients don't have browser sessions - Use
json/2helper — ensuresContent-Type: application/json; avoidrenderfor simple JSON responses
API Pipeline Setup
# lib/my_app_web/router.ex
defmodule MyAppWeb.Router do
use MyAppWeb, :router
pipeline :api do
plug :accepts, ["json"]
# No :fetch_session, :protect_from_forgery, :put_secure_browser_headers
# APIs use tokens, not sessions
end
pipeline :api_auth do
plug MyAppWeb.Plugs.ApiAuth
end
# Public endpoints (no auth required)
scope "/api/v1", MyAppWeb.API.V1, as: :api_v1 do
pipe_through :api
post "/auth/login", AuthController, :login
post "/auth/register", AuthController, :register
end
# Protected endpoints
scope "/api/v1", MyAppWeb.API.V1, as: :api_v1 do
pipe_through [:api, :api_auth]
resources "/posts", PostController, except: [:new, :edit]
resources "/users", UserController, only: [:index, :show, :update]
end
end
Controller Pattern
Controllers return {:ok, result} or {:error, reason} — the FallbackController handles error rendering.
defmodule MyAppWeb.API.V1.PostController do
use MyAppWeb, :controller
alias MyApp.Blog
alias MyApp.Blog.Post
action_fallback MyAppWeb.FallbackController
def index(conn, params) do
page =
case Integer.parse(params["page"] || "1") do
{n, ""} when n > 0 -> n
_ -> 1
end
per_page = Map.get(params, "per_page", "20") |> String.to_integer() |> min(100)
{posts, total} = Blog.list_posts(page: page, per_page: per_page)
conn
|> put_resp_header("x-total-count", to_string(total))
|> json(%{
data: Enum.map(posts, &post_json/1),
meta: %{page: page, per_page: per_page, total: total}
})
end
def show(conn, %{"id" => id}) do
with {:ok, post} <- Blog.get_post(id) do
json(conn, %{data: post_json(post)})
end
end
def create(conn, %{"post" => post_params}) do
with {:ok, %Post{} = post} <- Blog.create_post(post_params) do
conn
|> put_status(:created)
|> put_resp_header("location", ~p"/api/v1/posts/#{post}")
|> json(%{data: post_json(post)})
end
end
def update(conn, %{"id" => id, "post" => post_params}) do
with {:ok, post} <- Blog.get_post(id),
{:ok, %Post{} = updated} <- Blog.update_post(post, post_params) do
json(conn, %{data: post_json(updated)})
end
end
def delete(conn, %{"id" => id}) do
with {:ok, post} <- Blog.get_post(id),
{:ok, _} <- Blog.delete_post(post) do
send_resp(conn, :no_content, "")
end
end
defp post_json(%Post{} = post) do
%{
id: post.id,
title: post.title,
body: post.body,
inserted_at: post.inserted_at,
updated_at: post.updated_at
}
end
end
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 453 lines · 32 tokens per session scan A 6683343652c7
phoenix-json-api is a skill published in the GitHub repository j-morgan6/elixir-phoenix-guide (159 stars, last pushed 2mo ago), licensed MIT. It adds 32 tokens to every session and 3,197 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…