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/robhowley/py-pit-skills/fastapi-errorsnpx skills add robhowley/py-pit-skills --skill fastapi-errorsgit clone --depth 1 https://github.com/robhowley/py-pit-skillsWhat 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.00037 | $0.02075 |
| Opus 5 | $0.00018 | $0.01038 |
| Sonnet 5 | $0.00007 | $0.00415 |
| Haiku 4.5 | $0.00004 | $0.00208 |
Grade A, and why
fastapi-errors 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 — 341 lines — stays where its author put it; the contents beside it link to each section on GitHub.
fastapi-errors
Defines a simple, consistent error architecture for FastAPI backend services.
This skill standardizes the flow:
service/domain failure
→ application exception
→ global FastAPI exception handler
→ consistent JSON response
The goal is to prevent common FastAPI problems:
HTTPExceptionraised deep in service logic- inconsistent error response formats
- duplicated status code logic
- domain failures implemented with builtin exceptions
- unexpected exceptions leaking poor diagnostics
Apply this Skill When
Apply when the user:
- asks how to structure FastAPI error handling
- is adding domain exceptions
- is designing service-layer failures
- is implementing API error responses
- is building a new FastAPI service
- is adding new domain errors in an existing repo
Do not apply when:
- the task is unrelated to application error handling
- the user explicitly wants a different architecture
Base Exception
The fastapi-init skill scaffolds a minimal version of this class. This skill defines the complete pattern. If both are present, this skill's version is authoritative.
The service defines one base exception for intentional application failures.
Preferred naming pattern:
<PackageName>Error
Examples:
BillingError
UserServiceError
InventoryError
If the package name cannot be determined, use:
AppError
Define all exceptions in a single module. In fastapi-init projects this is core/exceptions.py. In other layouts, exceptions.py at the package root is typical. Do not scatter them across feature files.
Example base implementation:
class AppError(Exception):
status_code = 500
detail: str = "An unexpected error occurred."
def __init__(self, detail: str | None = None, status_code: int | None = None, **context):
self.detail = detail if detail is not None else self.__class__.detail
self.status_code = status_code if status_code is not None else self.__class__.status_code
self.context = context
super().__init__(self.detail)
def __str__(self) -> str:
return self.detail
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 · 341 lines · 37 tokens per session scan A 789ac9f64f50
fastapi-errors is a skill published in the GitHub repository robhowley/py-pit-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 37 tokens to every session and 2,075 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-31.
Other skills, from other repositories
database
Relational database authority — PostgreSQL, async ORM (SQLAlchemy 2 / asyncpg), Alembic schema migrations, Supabase Python and JS clients, query optimisation, index strategy, connection pooling, transaction patterns, and bulk operations across Python and Node stacks.
FastAPI Customer Support Tech Enablement
Comprehensive FastAPI skill for building modern Python web APIs with focus on customer support systems, ticket management, real-time chat, and backend operations.
SQLAlchemy ORM Expert
Comprehensive SQLAlchemy skill for customer support tech enablement, covering ORM patterns, session management, query optimization, async operations, and PostgreSQL integration.
fastapi-endpoint
Plan and build production-ready FastAPI endpoints with async SQLAlchemy, Pydantic v2 models, dependency injection for auth, and pytest tests. Uses interview-driven planning to clarify data models, authentication method, pagination strategy, and caching before writing any code.
load-github-action-thread
Download retained Codex GitHub Action thread artifacts and load their rollout history into the local Codex app. Use when asked to open, load, import, resume, or inspect a Codex automation thread from a GitHub Actions run or a related GitHub issue or pull request.
datamodel-code-generator
Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…