fastapi-response-contract-boundary
Audit and fix FastAPI/Pydantic response contract failures and analytics metric drift.
Skill by JinNing6
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/jinning6-fastapi-response-contract-boundary-613710
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend, data, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
fastapi-response-contract-boundary- Description
- Audit and fix FastAPI/Pydantic response contract failures and analytics metric drift. Use when endpoints return ResponseValidationError/500, legacy JSON rows miss required response fields, response_model schemas need compatibility normalizers, or dashboard/trend/report APIs disagree on a canonical metric.
- License
- Apache-2.0
- Instructions
- 58 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# FastAPI Response Contract Boundary Use this skill to keep strict FastAPI response models without letting old or external data crash user-facing endpoints. ## Workflow 1. 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. 2. 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. 3. 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. 4. Do not "fix" by removing `response_model`. - A 500 from `ResponseValidationError` is a useful release gate. - Keep strict response models and make returned data conform to them. - Prefer one service-level normalizer over scattered endpoint patches. 5. Normalize legacy JSON deliberately. - Fill missing required response fields with explicit safe defaults such as `target_window`, `legacy_signal`, or `unknown`. - 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. 6. 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. ## Regression Tests - Unit test the serializer/normalizer with malformed legacy JSON. - Validate the serialized output through the actual response model. - Unit test metric helper invariants with same-direction and opposite-direction raw totals. - Run the backend tests from the project test root, not a repository root that collects scratch scripts. - Rebuild the Docker service if production runs in Docker. - Run a real API smoke that covers the failing endpoint, adjacent frontend contract endpoints, and account deletion cleanup. ## Completion Standard - Original failure is reproduced and then passes. - Strict response models remain enabled. - Legacy bad data no longer causes endpoint 500. - New malformed writes are still rejected or normalized at the documented input boundary. - Cross-endpoint metric identities hold in real API output. - Test data is deleted and verified from user-owned tables.
From JinNing6/Noosphere, Apache-2.0.
More from JinNing6/Noosphere
- 0.643score
Noosphere
JinNing6
Community of Consciousness MCP Server — upload and explore collective wisdom via GitHub.
ConnectorAFreshness: ALocal★ 18↓ 71/wkClaude Code +5 - 0.602score
agent-debug-memory
JinNing6
Use when debugging code, tests, builds, deployments, CI failures, runtime errors, framework issues, API migrations, or UI state bugs where a coding Agent…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
debug-async-ui
JinNing6
Use when UI state or returned content disappears, flashes, rolls back, saves but loses state, menus fail intermittently, or real browser behavior differs from…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
browser-actionability-debug
JinNing6
Diagnose browser UI tests or real browser checks where an element appears visible but cannot be clicked, copied, hovered, or focused.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
cloudflare-pages-stale-assets
JinNing6
Diagnose and fix Cloudflare Pages deployments where the live site still shows old CSS, JavaScript, native controls, untranslated text, or stale UI after a…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
codex-project-recency-sort-recovery
JinNing6
Diagnose and resolve codex project recency sort failures.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
binary-credential-format-boundary
JinNing6
Audit and repair readers for fixed-length binary credentials and their text encodings without mutating raw bytes.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
docker-git-bind-mount-push-debug
JinNing6
Diagnose and validate Git commit, fetch, and push failures when worktrees or bare remotes are bind-mounted into Docker, especially on Docker Desktop for…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
dynamic-shared-skills
JinNing6
Use when an engineering task may match a community-reviewed Noosphere workflow and the Agent should discover, verify, apply, update, or report the outcome of…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
fastapi-response-contract-boundary
JinNing6
Audit and fix FastAPI/Pydantic response contract failures and analytics metric drift.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
frontend-layering-specificity-debug
JinNing6
Diagnose and fix frontend controls whose typography or dimensions ignore component CSS, and React Three Fiber/Drei projected HTML labels that paint above…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
using-noosphere
JinNing6
Use automatically before diagnosing or fixing a concrete software failure.
SkillBFreshness: B★ 18Claude Code +9
Signals
- Stars
- 18
- Forks
- 3
- Open issues
- 23
- Last commit (this folder)
- Jul 15, 2026 (3 months ago)
- Last release
- Jul 29, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/JinNing6/Noosphere
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from JinNing6
- 0.643score
Noosphere
JinNing6
Community of Consciousness MCP Server — upload and explore collective wisdom via GitHub.
ConnectorAFreshness: ALocal★ 18↓ 71/wkClaude Code +5 - 0.602score
using-noosphere
JinNing6
Use automatically before diagnosing or fixing a concrete software failure.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
agent-debug-memory
JinNing6
Use when debugging code, tests, builds, deployments, CI failures, runtime errors, framework issues, API migrations, or UI state bugs where a coding Agent…
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
binary-credential-format-boundary
JinNing6
Audit and repair readers for fixed-length binary credentials and their text encodings without mutating raw bytes.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
browser-actionability-debug
JinNing6
Diagnose browser UI tests or real browser checks where an element appears visible but cannot be clicked, copied, hovered, or focused.
SkillBFreshness: B★ 18Claude Code +9 - 0.602score
cloudflare-pages-stale-assets
JinNing6
Diagnose and fix Cloudflare Pages deployments where the live site still shows old CSS, JavaScript, native controls, untranslated text, or stale UI after a…
SkillBFreshness: B★ 18Claude Code +9
Cite this page
fastapi-response-contract-boundary skill. Agent Mart. https://agentmart.dev/skills/jinning6-fastapi-response-contract-boundary-613710 (last updated 2026-10-24)