AI Agent Hub
Back to skills
Java to TypeScript Interface Generator icon

Java to TypeScript Interface Generator

Development Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @user_1d8afadc/sc-java-to-ts-interface.

About this skill

Problem

Backend Java API docs often mix RequestBody, nested VO, PageResult, enums, dates, and monetary fields. Manually converting them into TypeScript can drop fields, rename fields, or include gateway-injected parameters in request types. This skill targets cross-language type contract generation, turning API notes into stable, clearly named interface definitions.

How It Works

  • Parsing: identifies endpoint name, path, method, parameter location, and response shape.
  • Filtering: excludes LoginUser, userId, and token from Header-injected fields to keep request types clean.
  • Type mapping: handles Long, BigDecimal, Date, Map, Optional, and MultipartFile using a mapping table.
  • Recursive expansion: creates separate interface definitions for nested BO/VO/DTO types and merges inherited fields into the current type.
  • Assembly: emits request body, query params, result, and page types, with JSDoc notes for enum values, date formats, and optional fields.

Boundaries

It fits type contract generation, not runtime integration, validation, or backend changes. If optionality is unclear, it defaults to required and flags the question. Existing shared types such as ApiResponse are not redefined, and the output relies on lists and code blocks rather than tables. It is useful for turning backend field notes into shared frontend types.

Use Cases

  • Backend provides Java API docs and frontend needs reusable TypeScript request and response types.
  • Endpoints include nested BO and page results that should be expanded into separate interfaces.
  • Fields contain enums, dates, and amounts that need JSDoc format notes.
  • A batch of endpoint docs should be exported as Markdown for frontend reuse.

Best For

  • Frontend engineers maintaining admin consoles who need shared types from backend field notes
  • Full-stack engineers integrating payment or benefit APIs who need clear request, query, and page types
  • QA engineers testing API integrations who need to verify field names, enum values, and date formats
  • Architects organizing API docs who need consistent, reviewable interface definitions