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/muhammadusmangm/claude-code-best-practices/api-endpointnpx skills add MuhammadUsmanGM/claude-code-best-practices --skill api-endpointgit clone --depth 1 https://github.com/MuhammadUsmanGM/claude-code-best-practicesWrote 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/muhammadusmangm/claude-code-best-practices/api-endpoint)<a href="https://agentmods.dev/skills/muhammadusmangm/claude-code-best-practices/api-endpoint"><img src="https://agentmods.dev/badge/skills/muhammadusmangm/claude-code-best-practices/api-endpoint.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.00052 | $0.00713 |
| Opus 5 | $0.00026 | $0.00357 |
| Sonnet 5 | $0.00010 | $0.00143 |
| Haiku 4.5 | $0.00005 | $0.00071 |
Grade A, and why
api-endpoint 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 — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API Endpoint
Scaffold one new endpoint across the layers the project already uses. Don't invent a layer the codebase doesn't have.
Steps
- Ask once (if not already specified): method + path (e.g.
POST /users), what it does, and the response shape. Do not guess. - Read a sibling endpoint in
app/api/(or the project's equivalent) to match: router setup, dependency injection, error handling, test file layout. If no sibling exists, use the shape below. - Create or edit these files, in order:
app/schemas/<resource>.py— request + response Pydantic models. If the file exists, add the new models; do not rewrite it.app/services/<resource>.py— the pure-ish function that does the work. No request/response handling here.app/api/<resource>.py— the route handler. Call the service, map domain exceptions to HTTP codes.tests/api/test_<resource>.py— one happy-path test and one failure test (invalid input → 422, or domain error → mapped status).
- Register the router in
app/api/__init__.py(or the project's equivalent) only if adding a new resource file. - Run
ruff formatandruff checkon the files you touched. Report any remaining lint errors; do not auto-fix mypy errors without showing the user the diff.
Default shape (FastAPI)
# app/schemas/widget.py
from pydantic import BaseModel, Field
class WidgetCreate(BaseModel):
name: str = Field(min_length=1, max_length=80)
class WidgetOut(BaseModel):
id: int
name: str
# app/services/widgets.py
from app.schemas.widget import WidgetCreate, WidgetOut
def create_widget(db, payload: WidgetCreate) -> WidgetOut:
widget = Widget(name=payload.name)
db.add(widget); db.flush()
return WidgetOut(id=widget.id, name=widget.name)
# app/api/widgets.py
from fastapi import APIRouter, Depends
from app.schemas.widget import WidgetCreate, WidgetOut
from app.services import widgets as service
router = APIRouter(prefix="/widgets", tags=["widgets"])
@router.post("", response_model=WidgetOut, status_code=201)
def create(payload: WidgetCreate, db = Depends(get_db)) -> WidgetOut:
return service.create_widget(db, payload)
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 · 79 lines · 52 tokens per session scan A c5c0f5ac2cb8
api-endpoint is a skill published in the GitHub repository MuhammadUsmanGM/claude-code-best-practices (76 stars, last pushed 2mo ago), licensed MIT. It adds 52 tokens to every session and 713 once invoked, about $0.0003 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
weather-fetcher
Instructions for fetching current weather temperature data for Dubai, UAE from Open-Meteo API.
claude-md-review
Audit a CLAUDE.md file for the patterns that actually degrade Claude Code's output — vagueness, unnamed files, stale facts, and bloat. Use when asked to review, audit, improve, shrink, or fix a CLAUDE.md, and when a project's results feel inconsistent or Claude keeps rediscovering the same context.
best-practices
Searchable knowledge base of 152+ programming best practices across 30+ languages and frameworks. BM25-powered search over curated resources from industry leaders (Google, Airbnb, Uber, Mozilla, Shopify, OWASP).
brainstorm-feature
Clarify a rough product or engineering idea into a BRD-lite brief (Why) with measurable business value.
implementation-readiness
Verify BRD-lite, PRD, SRS/FRS, UX, and test prerequisites before implementation starts.
incident-hotfix
Mitigate a production incident or urgent regression first, then route to root-cause remediation and a postmortem.