Skip to content
Skill

Fastapi response contract boundary

Guides fixing FastAPI response validation errors and analytics metric drift

Fastapi response contract boundary is an open-source agent skill for analytics and data. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
18
Last commit
License
Apache-2.0
Listing updated

Similar skills

About Fastapi response contract boundary

This skill helps an agent keep strict FastAPI and Pydantic response models while stopping old or externally written JSON from crashing user-facing endpoints. It walks through reproducing the failing call against the real API, locating where the contract breaks between input schema, stored data, service serializer and response schema, and adding a single service-level normalizer rather than patching endpoints one by one.

The workflow also covers analytics endpoints where dashboard, trend and report APIs disagree. It asks the agent to pick one canonical metric, derive secondary totals from it, and test that cross-endpoint identities hold in real output. Regression guidance covers unit tests for malformed legacy JSON, validating serialized output through the actual response model, and a smoke run that includes test-data cleanup.

The skill is written for Python backends using FastAPI and Pydantic v2 and tells the agent to consult the official docs before editing code. It bundles no scripts and expects a working backend test suite and, where production runs in Docker, access to rebuild that service.

When your agent uses it

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.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (3 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/fastapi-response-contract-boundary to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/fastapi-response-contract-boundary &&
cp -R "$tmp/shared_skills/active/fastapi-response-contract-boundary" ~/.claude/skills/fastapi-response-contract-boundary &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/fastapi-response-contract-boundary inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/fastapi-response-contract-boundary to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/fastapi-response-contract-boundary &&
cp -R "$tmp/shared_skills/active/fastapi-response-contract-boundary" ~/.agents/skills/fastapi-response-contract-boundary &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/fastapi-response-contract-boundary inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/fastapi-response-contract-boundary to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/fastapi-response-contract-boundary &&
cp -R "$tmp/shared_skills/active/fastapi-response-contract-boundary" ~/.cursor/skills/fastapi-response-contract-boundary &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/fastapi-response-contract-boundary inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/JinNing6/Noosphere.git --path shared_skills/active/fastapi-response-contract-boundary

Or copy the folder to ~/.gemini/skills/fastapi-response-contract-boundary yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/fastapi-response-contract-boundary:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JinNing6/Noosphere.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/fastapi-response-contract-boundary &&
cp -R "$tmp/shared_skills/active/fastapi-response-contract-boundary" ~/.copilot/skills/fastapi-response-contract-boundary &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/fastapi-response-contract-boundary inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/JinNing6/Noosphere.git

Then copy Noosphere/shared_skills/active/fastapi-response-contract-boundary into your agent's skills folder as fastapi-response-contract-boundary. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Response model boundary
Explains where strict validation should sit between input schemas, stored data and the serializer.
Legacy JSON normalization
Fills missing required fields with explicit safe defaults and coerces or drops invalid optional values.
Keep strict models
Warns against removing response_model and treats ResponseValidationError as a release gate.
Canonical metric rules
Defines one source of truth for analytics totals and derives other figures from it.
Regression test checklist
Lists unit, response-model and real API smoke checks, including test data cleanup.

Good for

  • Fix a 500 ResponseValidationError on an endpoint returning old database rows
  • Add a normalizer so legacy JSON validates against a Pydantic response model
  • Make dashboard and trend API totals agree on the same metric
  • Write regression tests for malformed stored JSON in a FastAPI service
  • Smoke-test an API after a fix and verify test data is removed

Fastapi response contract boundary FAQ

When does Fastapi response contract boundary trigger?

It is meant for cases where endpoints return ResponseValidationError or 500, legacy JSON rows miss required response fields, response_model schemas need compatibility normalizers, or dashboard, trend or report APIs disagree on a canonical metric.

Should I remove response_model to stop the errors?

No. The skill says to keep strict response models and make the returned data conform to them, using a service-level normalizer.

Does Fastapi response contract boundary include scripts?

No. The skill folder contains only its SKILL.md and no scripts or reference files.

Does Fastapi response contract boundary change new write validation?

It says to preserve new-write validation so malformed new payloads are still rejected at the input boundary.

How do I install Fastapi response contract boundary in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/fastapi-response-contract-boundary to use it in all your projects, or to .claude/skills/fastapi-response-contract-boundary in one project.

Does Fastapi response contract boundary run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Fastapi response contract boundary?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Fastapi response contract boundary?

The closest alternatives to Fastapi response contract boundary are Python backend, Testing conventions, API integration, Backend repo architecture and API design.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from JinNing6/Noosphere

  1. Checks a shared Noosphere skill registry before debugging a concrete software failure

    • Open source
    • 18 GitHub stars
    • Developer tools
  2. Has the agent check Noosphere shared debugging memory before fixing bugs and upload

    • Open source
    • 18 GitHub stars
    • Knowledge and memory
  3. Diagnoses browser clicks, hover and focus that fail though elements look visible

    • Open source
    • 18 GitHub stars
    • Browser automation
  4. Diagnoses why a Cloudflare Pages site still serves old assets after a deploy

    • Open source
    • 18 GitHub stars
    • Cloud and infrastructure