api-module

Generate type-safe TypeScript API client modules from OpenAPI schemas.

2.3k|559|Updated Jun 20, 2021
One-click install
npx skills add https://github.com/modrinth/code --skill api-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-module
Source: https://github.com/modrinth/code/tree/main/.claude/skills/api-module
Command: npx skills add https://github.com/modrinth/code --skill api-module

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the process of adding new API endpoint modules to the packages/api-client based on an OpenAPI schema, streamlining backend integration.

Core Features & Use Cases

  • Automated Module Generation: Creates TypeScript modules for new API endpoints.
  • Type Safety: Ensures generated types precisely match the OpenAPI schema.
  • Standardized Integration: Follows established conventions for naming, typing, and module registration.
  • Use Case: When a new set of backend endpoints is added to the /v3/projects path, this Skill can automatically generate the corresponding client-side module in @modrinth/api-client.

Quick Start

Use the api-module skill to add a new API endpoint module from the file 'openapi.yml'.

Frequently Asked Questions about api-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a TypeScript API client from an OpenAPI schema?

To generate a TypeScript API client from an OpenAPI schema, use this Skill to parse the schema file and automatically create type-safe modules that match your backend endpoints exactly.

How do I add a new API module to an existing TypeScript client?

Add a new API module by providing your OpenAPI schema file to this Skill, which generates the TypeScript code and registers the new endpoint module within the client directory automatically.

Does the generated TypeScript API client ensure type safety for backend endpoints?

Yes, the generated TypeScript API client ensures type safety by creating type definitions that precisely match the structures and responses defined in your OpenAPI schema.

What naming and structure standards are required for OpenAPI code generation?

OpenAPI code generation requires adherence to predefined conventions for naming, type definitions, and module structure to ensure standardized integration and registration within the client.

Can I integrate new backend service versions using an OpenAPI schema?

Yes, you can integrate new backend service versions by passing the updated OpenAPI schema to generate corresponding type-safe TypeScript modules and register them in your client.