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 JinNing6/Noosphere --skill fastapi-response-contract-boundarygit clone --depth 1 https://github.com/JinNing6/NoosphereWrote 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/jinning6/noosphere/fastapi-response-contract-boundary)<a href="https://agentmods.dev/skills/jinning6/noosphere/fastapi-response-contract-boundary"><img src="https://agentmods.dev/badge/skills/jinning6/noosphere/fastapi-response-contract-boundary.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.1 | $0.00061 | $0.00651 |
| Opus 5 | $0.00030 | $0.00326 |
| Sonnet 5 | $0.00012 | $0.00130 |
| Haiku 4.5 | $0.00006 | $0.00065 |
Grade A, and why
fastapi-response-contract-boundary 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 7d 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 — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
FastAPI Response Contract Boundary
Use this skill to keep strict FastAPI response models without letting old or external data crash user-facing endpoints.
Workflow
-
Reproduce with the real API first.
- Create or identify a real row that triggers the endpoint.
- Capture the HTTP status and backend traceback.
- If test data is created, clean it through the public deletion path and verify database counts.
-
Check official docs before code edits.
- FastAPI response model validation/filtering behavior.
- Pydantic v2 model validation, field defaults, and validators.
- SQLAlchemy/ORM serialization docs only when the fix touches ORM loading or mapped attributes.
-
Locate the contract boundary.
- Input schema: rejects invalid new writes.
- Stored data: may contain legacy or externally written JSON.
- Service serializer: should normalize legacy stored data before FastAPI validates the response.
- Response schema: should remain strict unless the product contract truly changed.
-
Do not "fix" by removing
response_model.- A 500 from
ResponseValidationErroris a useful release gate. - Keep strict response models and make returned data conform to them.
- Prefer one service-level normalizer over scattered endpoint patches.
- A 500 from
-
Normalize legacy JSON deliberately.
- Fill missing required response fields with explicit safe defaults such as
target_window,legacy_signal, orunknown. - Drop or coerce invalid optional fields such as weights outside accepted ranges.
- Preserve new-write validation so malformed new payloads are still rejected.
- Add regression tests that validate the final dict with the response Pydantic model.
- Fill missing required response fields with explicit safe defaults such as
-
For analytics metrics, define one canonical source.
- Identify the invariant, for example
net_balance == -life_hours_delta. - Derive secondary totals from the canonical metric, not from a competing raw sum.
- Keep explanatory category fields separate from canonical totals when schemas have legacy display fields.
- Test cross-endpoint identity, not only each endpoint shape.
- Identify the invariant, for example
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.
- 7d ago First seen · 62 lines · 61 tokens per session scan A 97170e446bdc
fastapi-response-contract-boundary is a skill published in the GitHub repository JinNing6/Noosphere (18 stars, last pushed 7d ago), licensed Apache-2.0. It adds 61 tokens to every session and 651 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
add-backend
Guide for adding a backend (Rust or Python) to the agent-sec-core security middleware. Use when creating new backends, integrating Rust or Python code into the security middleware, or extending with new backend actions.
claude-api
Build, debug, and optimize Claude API / Anthropic SDK apps. Apps built with this skill should include prompt caching. Also handles migrating existing Claude API code between Claude model versions (4.5 → 4.6, 4.6 → 4.7, retired-model replacements). TRIGGER when: code imports anthropic/@anthropic-ai/sdk; user asks for…
csharp-patterns
C#/.NET: LINQ, async/await, DI, records, nullable refs, ASP.NET Core, EF Core, MediatR. Triggers: C#, .NET, dotnet, ASP.NET, EF Core, LINQ, record type, IServiceCollection.
java-patterns
Java: Spring Boot, CompletableFuture, records, sealed types, JPA/Hibernate, virtual threads. Triggers: Java, Spring, JPA, Hibernate, Maven, Gradle, virtual thread, sealed class.
api-patterns
API design: naming, versioning, pagination, idempotency, OpenAPI, error contracts and safe retries. Triggers: API design, REST, GraphQL, OpenAPI, Swagger, error response, HTTP status, rate limit.
verify
Build, launch, and drive a local Honcho stack to verify a change at its runtime surface (the /v3 HTTP API and the deriver queue). Use when verifying a diff or confirming a change works in the running app.