Skip to content
Back to skills

Type Definition Generator

BSecurity

Convert untyped JavaScript, Python dicts, or raw JSON payloads into strict TypeScript interfaces or Type Hint annotations.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 27, 2026
developmentjavascripttypescriptpythonjavabashnodeapi

Works with

  • api

Security analysis

B84/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 27, 2026

npx -y skills add RMAzrim/opencode-artes --skill type-definition-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Type Definition Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Type Definition Generator
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/rmazrim-type-definition-generator/badge)](https://www.skillsdirectory.com/skills/rmazrim-type-definition-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Type Definition Generator
description: Convert untyped JavaScript, Python dicts, or raw JSON payloads into strict TypeScript interfaces or Type Hint annotations.
metadata:
  source: skills/type-definition-generator/type-definition-generator.md
---

# Type Definition Generator

## Prerequisites & Dependencies
- Node.js 18+ or Python 3.10+
- `npm i -g quicktype` or `pip install pydantic mypy` for code generation
- Sample untyped JSON payloads or Python dicts to generate types from
- Optional: `npm i ajv` for JSON Schema validation, `pip install marshmallow` for Python

## Execution Steps
1. Collect a representative set of JSON examples (ideally 10–20) covering all branches, nulls, nested objects, and arrays
2. Run a code generator:
   - **Quicktype**: `quicktype input.json -l typescript` → produces `.d.ts` interfaces with JSON Schema annotations
   - **Pydantic/Marshmallow**: `python generate.py` → produces `class User(BaseModel): ...` or schema fields
3. Review the generated types for correctness: verify union types, required/optional markers, enum values
4. Apply the types in the project: import interfaces in TypeScript, use Pydantic models in Python APIs
5. Run type checking: `npx tsc --noEmit` or `mypy pipeline.py` to catch mismatches early
6. Iterate: add more JSON samples or adjust generator flags (`--enum-as-string`, `--just-types`) until the output matches the project's typing style

```bash
# Quicktype: generate TypeScript interfaces from JSON
quicktype src/payloads/user.json -l typescript -o src/types/user.d.ts

# Pydantic example: from dict to typed model
from pydantic import BaseModel, EmailStr

class User(BaseModel):
    id: int
    name: str
    email: EmailStr
    is_active: bool = True

user = User(**{"id": 1, "name": "Alice", "email": "alice@example.com"})
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.