Skip to content
Back to skills

Transformers Generator

ASecurity

Design of the ejected Redocly `transformers` client generator. Read it, and update it, before changing generators/transformers/.

  • 1,567 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
developmenttypescriptnodegit

Works with

  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add Redocly/redocly-cli --skill transformers-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Transformers Generator?

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

Security grade badge for Transformers Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/redocly-transformers-generator/badge)](https://www.skillsdirectory.com/skills/redocly-transformers-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: transformers-generator
description: Design of the ejected Redocly `transformers` client generator. Read it, and update it, before changing generators/transformers/.
---

# The `transformers` generator — its skill

This file is the DESIGN of your ejected `transformers` generator (`generators/transformers/`):
**to change the generator, edit this skill first, then make the code match it** — a diff
to `generators/transformers/` that has no covering sentence here is incomplete.

## What it emits

Per-schema `to<Name>()` / `from<Name>()` converters that turn wire JSON into typed
values and back — the bridge for `dateType: Date` clients.

## Design decisions that must hold

- **Requires `dateType: Date`** (declared as `dateTypes: ['Date']`, so a mismatched
  selection fails fast): the converters assign `Date` objects to fields the sdk types as
  `Date`, which only type-checks in that mode.
- **Imports the sdk's schema TYPES** (so `typescript` is required) and nothing else.
- Converters are pure and total: every named schema gets a pair, nested structures
  recurse, and a missing optional stays missing.
- **A transform takes response data.** A response never carries `writeOnly`
  properties, so the sdk types it `Omit<Name, …>`. The transform of a schema with
  `writeOnly` properties takes that shape and returns the type it was given:
  `<T extends Omit<Name, …>>(input: T): T`. Other transforms keep `(data: Name): Name`.

## The stage files

`render.ts` holds the whole converter renderer; `index.ts` is the entry. Naming comes
from the TypeScript printer (`@redocly/client-generator/printers/typescript`).

## Ejecting it

`redocly eject-generator transformers` copies this generator's TypeScript source folder
to `generators/transformers/`, exactly as we wrote it, importing
`@redocly/client-generator` and `@redocly/client-generator/printers/typescript`. Running
a `.ts` generator uses Node's type stripping (Node 22.18, 23.6, or newer); newer built-in
versions merge in per file with `--update`. Change which fields are converted, or how,
and regenerate.

## The modify loop

1. Edit this skill: state the new behavior or decision.
2. Make `generators/transformers/` match it.
3. Run `redocly generate-client` and inspect the `git diff` of the generated output —
   generated files are never hand-edited.

Newer built-in versions merge in with `redocly eject-generator transformers --update`.

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.

View all in development →

Comments

Loading comments…

Newsletter

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