e2e-typesafety
Skill by BerriAI
Keeps the Python API and the native/web frontend type-safe, from Pydantic models through OpenAPI to a generated client. Written for developers adding or changing FastAPI routes, payloads or /api calls.
Install e2e-typesafety
Built from the published package, never by AI.
git clone --depth 1 https://github.com/BerriAI/moyai /tmp/moyai && mkdir -p ~/.claude/skills && cp -r /tmp/moyai/.agents/skills/e2e-typesafety ~/.claude/skills/e2e-typesafetyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/BerriAI/moyai /tmp/moyai && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/moyai/.agents/skills/e2e-typesafety ~/.gemini/antigravity-cli/skills/e2e-typesafetyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The e2e-typesafety skill guides an assistant through keeping the Python API and the native/web frontend type-safe. Pydantic models feed FastAPI routes, which produce an OpenAPI document. That document is used by @hey-api/openapi-ts to generate a client, and the frontend imports its types and SDK functions instead of writing them by hand.
The skill sets backend rules, such as returning Pydantic models from every JSON route, setting explicit operation IDs and reporting failures as ApiError. It also lists frontend rules, a migration path for legacy routes, and a done checklist that runs npm run api:check, npm run typecheck and a contract test. It is written for developers working on the BerriAI repository.
Written from the project's SKILL.md and checked against it.
What it can do
- Pydantic response modelsRequires every JSON route to return a Pydantic model declared as the handler's return annotation.
- Explicit operation IDsSets camelCase operation IDs so generated SDK function names stay stable and unique.
- Client generation workflowRuns npm run api:generate to write openapi.json and the typed client from the FastAPI app.
- Contract test checkstest_api_contract.py fails on missing response schemas, shadowed handlers or new api<T> calls.
- Frontend type rulesFrontend code imports generated types and calls SDK functions instead of hand-written payload types.
- Legacy route migrationGives a step-by-step path from unannotated dict responses to typed Pydantic models.
- Optional and nullable guidanceExplains how x: str | None and default values produce different TypeScript types.
- Done checklistLists the checks to pass: api:check, typecheck and the contract pytest run.
What you need
- Python with uv
- Node.js with npm
- FastAPI and Pydantic backend
- The BerriAI repository layout (native/web, native/src)
Try asking
- Add a GET route for listing sessions with a typed response model
- Migrate the /api/settings route from a dict response to a Pydantic model
- Check whether my frontend still uses hand-written types for API payloads
Good to know
- Files in native/web/generated are never edited by hand and must be regenerated.
- Allowlists in the contract test only shrink and should not be extended to pass a test.
- Non-JSON routes such as downloads and redirects are listed separately as NOT_JSON.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/e2e-typesafety/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to e2e-typesafety
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
e2e-typesafety: common questions
Why use generated SDK functions instead of api<T>?
api<T> is a cast that compiles whatever the server sends. Generated functions check paths, params, bodies and responses against the Pydantic models.
What happens if a backend field is renamed?
The change should make npm run typecheck fail at every frontend call site that depends on that field, before review.
Which commands regenerate the API client?
npm run api:generate writes the OpenAPI file and the client, and npm run api:check fails if the generated output changed. CI runs it before typecheck.
How do I install e2e-typesafety?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is e2e-typesafety free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is e2e-typesafety safe to use?
It scores 75 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to e2e-typesafety?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
