Java to TypeScript Interface Generator
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, andtokenfrom Header-injected fields to keep request types clean. - Type mapping: handles
Long,BigDecimal,Date,Map,Optional, andMultipartFileusing a mapping table. - Recursive expansion: creates separate
interfacedefinitions for nestedBO/VO/DTOtypes and merges inherited fields into the current type. - Assembly: emits request body, query params, result, and page types, with
JSDocnotes 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
Related Skills
Analyzes code to extract control and data flow, then outputs Markdown with Mermaid source and high-resolution PNG diagrams.
For development and programming scenarios around VSCode and TypeScript IDE.
A TypeScript-oriented Windmill Wrap development reference.
A Python-based Selenium wrapper for engineering browser automation workflows.