Browser & automation
dev-generate-types
Use when integrating with an API endpoint and need TypeScript types, contracts, and adapters generated automatically.
herbert-julio-azion · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add HerbertJulio/specialist-agent --skill dev-generate-typesAbout this skill
name: dev-generate-types description: "Use when integrating with an API endpoint and need TypeScript types, contracts, and adapters generated automatically." user-invocable: true argument-hint: "[endpoint-or-json]" allowed-tools: Read, Write, Edit, Bash, Glob, Grep
Generate types, contracts and adapter for an API endpoint following docs/ARCHITECTURE.md sections 4.2-4.3.
Endpoint or example JSON: $ARGUMENTS
Steps
-
Read
docs/ARCHITECTURE.mdsections 4.2 and 4.3. -
If the user provided an example JSON, use it. If they provided an endpoint:
- Search existing code for calls to that endpoint
- Ask the user for an example response JSON
-
From the JSON, create:
a.
[resource].types.ts- types that mirror the API exactly:- snake_case, string dates, IDs as string
- Include request payloads and list response (with pagination)
b.
[resource].contracts.ts- clean app contracts:- camelCase, Date objects, derived booleans
- No internal API fields (tokens, metadata)
c.
[resource]-adapter.ts- pure functions:toXxx(response)- inbound (API -> App)toXxxList(response)- inbound for listtoCreatePayload(input)- outbound (App -> API)- Conversions: snake->camel, string->Date, cents->decimal
-
Validate:
npx astro check