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 instructions/nanotaboada/python-samples-fastapi-restful/claude-mdgit clone --depth 1 https://github.com/nanotaboada/python-samples-fastapi-restfulWhat 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.02459 | $0.02459 |
| Opus 5 | $0.01229 | $0.01229 |
| Sonnet 5 | $0.00492 | $0.00492 |
| Haiku 4.5 | $0.00246 | $0.00246 |
Grade A, and why
python-samples-fastapi-restful CLAUDE.md 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 2d 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 — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Claude Code
- Run
/pre-committo execute the full pre-commit checklist for this project.
Overview
REST API for managing football players built with Python and FastAPI. Implements async CRUD operations with SQLAlchemy 2.0 (async), SQLite, Pydantic validation, and in-memory caching.
Tech Stack
- Language: Python 3.13
- Framework: FastAPI + Uvicorn
- ORM: SQLAlchemy 2.0 (async) + aiosqlite
- Database: SQLite (local/test), PostgreSQL-compatible
- Migrations: Alembic (async,
render_as_batch=True) - Validation: Pydantic
- Caching: aiocache (in-memory, 10-minute TTL)
- Testing: pytest + pytest-cov + httpx
- Linting/Formatting: Flake8 + Black
- Containerization: Docker
Structure
main.py — application entry point: FastAPI setup, router registration
alembic.ini — Alembic configuration (sqlalchemy.url set dynamically)
alembic/ — Alembic migration environment and version scripts
routes/ — HTTP route definitions, caching + dependency injection [HTTP layer]
services/ — async business logic [business layer]
schemas/ — SQLAlchemy ORM models (database schema) [data layer]
databases/ — async SQLAlchemy session setup + get_database_url()
models/ — Pydantic models for request/response validation
scripts/ — shell scripts for Docker (entrypoint.sh, healthcheck.sh)
tools/ — legacy standalone seed scripts (superseded by Alembic migrations)
rest/ — HTTP request file (players.rest) for manual API testing
gunicorn.conf.py — production WSGI worker config (used by Docker entrypoint)
tests/ — pytest integration tests
Layer rule: Routes → Services → SQLAlchemy → SQLite. Routes handle HTTP
concerns only; business logic belongs in services. Never skip a layer.
Coding Guidelines
- Naming: snake_case (files, functions, variables), PascalCase (classes)
- Type hints: Required everywhere — functions, variables, return types
- Async: All routes and service functions must be
async def; useAsyncSession(neverSession); useaiosqlite(neversqlite3); use SQLAlchemy 2.0select()(neversession.query()) - API contract: camelCase JSON via Pydantic
alias_generator=to_camel; Python internals stay snake_case - Models:
PlayerRequestModel(noid, used for POST/PUT) andPlayerResponseModel(includesid: UUID, used for GET/POST responses). One request model intentionally covers both POST and PUT — per-operation differences (conflict check on POST, mismatch guard on PUT) are handled at the route layer, not by duplicating the model. Never reintroduce the removedPlayerModel; it was removed because a single flat model conflated ORM, request, and response concerns. - Primary key: UUID surrogate key (
id) — opaque, internal, used for GET by id only. UUID v4 for API-created records; UUID v5 (deterministic) for migration-seeded records.squad_numberis the natural key — human-readable, domain-meaningful, used for all mutation endpoints (PUT, DELETE) and preferred for all external consumers - Caching: cache key
"players"(hardcoded); clear on POST/PUT/DELETE;X-Cacheheader (HIT/MISS) - Errors: Catch specific exceptions with rollback in services; Pydantic validation returns 422 (not 400); squad number mismatch on PUT returns 400 (not 422 — it is a semantic error, not a validation failure)
- Logging:
loggingmodule only; neverprint() - Line length: 88; complexity ≤ 10
- Import order: stdlib → third-party → local
- Tests: integration tests against the real SQLite DB (seeded via
Alembic migrations) via
TestClient— no mocking. Naming patterntest_request_{method}_{resource}_{context}_response_{outcome}; docstrings single-line, concise;tests/player_fake.pyfor test data;tests/conftest.pyprovides afunction-scopedclientfixture for isolation;tests/test_main.pyexcluded from Black;tests/test_migrations.pycovers Alembic downgrade paths - Decisions: justify every decision on its own technical merits; never use "another project does it this way" as a reason — that explains nothing and may mean replicating a mistake
- Avoid: sync DB access, mixing sync/async,
print(), missing type hints, unhandled exceptions
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.
- 2d ago First seen · 227 lines · 2,459 tokens per session scan A 06cec1727910
python-samples-fastapi-restful CLAUDE.md is an instructions file published in the GitHub repository nanotaboada/python-samples-fastapi-restful (137 stars, last pushed 2d ago), licensed MIT. It adds 2,459 tokens to every session, about $0.0123 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 instructions, from other repositories
receipts-api-mcp global-skills.instructions.md
Instructions for chf3198/receipts-api-mcp: Global skills routing contract for this repository (standard).
receipts-api-mcp skill-routing.instructions.md
Instructions for chf3198/receipts-api-mcp: Use repository and global customization layers together for every task.
receipts-api-mcp openclaw-universal.instructions.md
Instructions for chf3198/receipts-api-mcp: Use the machine-global OpenClaw system as the baseline for this repository.
agentic-travel-recommendations-api CLAUDE.md
Claude Code instructions for andypnguyen11-gif/agentic-travel-recommendations-api, covering claude.md — agentic travel recommendations service, what this project is, core principles (the whole design hangs on these), constraints from the assignment (do not violate) and fixtures must match the assignment prompt exactly.
pydantic-ai AGENTS.md
Instructions for pydantic/pydantic-ai, covering your primary responsibility is to the project and its users, gathering context on the task, ensuring the task is ready for implementation, philosophy and requirements of all contributions.
full-stack-ai-agent-template CLAUDE.md
Instructions for vstorm-co/full-stack-ai-agent-template, covering claude.md, project overview, commands, install dependencies and run tests.