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 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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.1 | $0.00052 | $0.00713 |
| Opus 5.5 | $0.00021 | $0.00285 |
| Sonnet 5.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 3mo 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.
- 3mo 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 (119 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 713 once invoked, about $0.0002 per session on Opus 5.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.
api-endpoint compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| api-endpointMuhammadUsmanGM/claude-code-best-practices | Skill | 119 | 1mo ago | MIT | A | 52 | Claude Code |
| architecture-patternswshobson/agents | Skill | 43k | 3d ago | MIT | A | 65 | Claude Code |
| saga-orchestrationwshobson/agents | Skill | 43k | 3d ago | MIT | A | 91 | Claude Code |
| fastapi-templateswshobson/agents | Skill | 43k | 3d ago | MIT | A | 37 | Claude Code |
| event-store-designwshobson/agents | Skill | 43k | 3d ago | MIT | A | 33 | Claude Code |
| error-handling-patternswshobson/agents | Skill | 43k | 3d ago | MIT | A | 43 | Claude Code |
| api-design-principleswshobson/agents | Skill | 43k | 3d ago | MIT | A | 44 | Claude Code |