# Stock generators overview



The stock generators demonstrate the major SKMTC patterns at
production-realistic complexity. Most users will pick one or two as
templates, clone them via `skmtc clone`, and edit the source to fit
their own conventions (output paths, naming, peer libraries,
rendered style).

## What stock generators are [#what-stock-generators-are]

A stock generator is a published `@skmtc/gen-*` package on JSR. Each
ships:

* An `Entry` (`toOasOperationEntry` / `toModelEntry` /
  `toGqlOperationEntry`) exported from `src/mod.ts`
* One or more `Projection` classes (`src/<Name>.ts`)
* An optional enrichment schema (`src/enrichments.ts`)
* A `deno.json` declaring its peer dependencies

Their license (MIT) is deliberately fork-friendly. The engine
(`@skmtc/core`) is Apache 2.0; the templates are MIT.

## Catalog [#catalog]

### Schemas and types (model generators) [#schemas-and-types-model-generators]

Run per OAS schema component. The four below have **near-identical
entry shape** — they differ only in the Projection class. Together
they're the strongest demonstration of the clone-to-customize
philosophy.

| Generator               | Output                     | Reference                                                         |
| ----------------------- | -------------------------- | ----------------------------------------------------------------- |
| `@skmtc/gen-typescript` | TypeScript type aliases    | [gen-typescript](/docs/reference/stock-generators/gen-typescript) |
| `@skmtc/gen-zod`        | Zod validation schemas     | [gen-zod](/docs/reference/stock-generators/gen-zod)               |
| `@skmtc/gen-valibot`    | Valibot validation schemas | [gen-valibot](/docs/reference/stock-generators/gen-valibot)       |
| `@skmtc/gen-arktype`    | ArkType validation schemas | [gen-arktype](/docs/reference/stock-generators/gen-arktype)       |

### Client-side (data fetching, mocks) [#client-side-data-fetching-mocks]

Run per OAS operation.

| Generator                                | Output                                              | Reference                                                                                           |
| ---------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `@skmtc/gen-tanstack-query-fetch-zod`    | Tanstack Query hooks (fetch transport)              | [gen-tanstack-query-fetch-zod](/docs/reference/stock-generators/gen-tanstack-query-fetch-zod)       |
| `@skmtc/gen-tanstack-query-supabase-zod` | Tanstack Query hooks (Supabase Postgrest transport) | [gen-tanstack-query-supabase-zod](/docs/reference/stock-generators/gen-tanstack-query-supabase-zod) |
| `@skmtc/gen-msw`                         | MSW mock handlers + a shared route list             | [gen-msw](/docs/reference/stock-generators/gen-msw)                                                 |

### UI (React, requires composition) [#ui-react-requires-composition]

Run per OAS operation. Compose with one of the model generators
above for type-safe inputs.

| Generator                  | Output                      | Reference                                                               |
| -------------------------- | --------------------------- | ----------------------------------------------------------------------- |
| `@skmtc/gen-shadcn-form`   | React form using shadcn/ui  | [gen-shadcn-form](/docs/reference/stock-generators/gen-shadcn-form)     |
| `@skmtc/gen-shadcn-select` | Searchable select component | [gen-shadcn-select](/docs/reference/stock-generators/gen-shadcn-select) |
| `@skmtc/gen-shadcn-table`  | Data table component        | [gen-shadcn-table](/docs/reference/stock-generators/gen-shadcn-table)   |

### Server-side [#server-side]

Run per OAS operation. Aggregate per-operation handlers into a single
app/router Projection.

| Generator                  | Output                                  | Reference                                                               |
| -------------------------- | --------------------------------------- | ----------------------------------------------------------------------- |
| `@skmtc/gen-express`       | Express route registration              | [gen-express](/docs/reference/stock-generators/gen-express)             |
| `@skmtc/gen-supabase-hono` | Hono routes for Supabase Edge Functions | [gen-supabase-hono](/docs/reference/stock-generators/gen-supabase-hono) |

## Typical combinations [#typical-combinations]

### Full-stack TypeScript app (REST) [#full-stack-typescript-app-rest]

```
@skmtc/gen-typescript           ← static types
@skmtc/gen-zod                  ← runtime validation
@skmtc/gen-tanstack-query-fetch-zod  ← hooks
@skmtc/gen-shadcn-form          ← forms for mutations
```

The three downstream generators (`tanstack-query-*`, `shadcn-form`)
compose with `gen-zod` via `insertNormalizedModel` — the engine
produces a single `userBody` Zod schema even when multiple
generators need it.

### MSW-driven dev workflow [#msw-driven-dev-workflow]

```
@skmtc/gen-typescript
@skmtc/gen-zod
@skmtc/gen-msw                  ← mock handlers
@skmtc/gen-tanstack-query-fetch-zod
```

The form/table generators are optional in this combo — MSW gives
you a backend, the hooks give you fetching, types give you safety.
Add the UI generators when you start prototyping screens.

### Supabase + UI combo [#supabase--ui-combo]

```
@skmtc/gen-typescript
@skmtc/gen-zod
@skmtc/gen-tanstack-query-supabase-zod
@skmtc/gen-shadcn-form
@skmtc/gen-shadcn-select
@skmtc/gen-shadcn-table
```

The UI select/table generators import `isListResponse` directly
from `@skmtc/gen-tanstack-query-supabase-zod` — they're designed to
go together.

## How to use these docs [#how-to-use-these-docs]

Each per-generator doc is **light by design**. The goal isn't to
exhaustively document every method — the source is short and worth
reading. The docs focus on:

* What it generates (one or two output examples)
* Key decisions and assumptions baked into the source
* What patterns it demonstrates well
* Typical customizations when cloned

When you're considering cloning a generator, read its per-doc page
*and* its `src/mod.ts` together. The doc gives orientation; the
source is authoritative.

## See also [#see-also]

* [Clone vs install concept](/docs/concepts/clone-vs-install) —
  decision tree for whether to clone or install
* [Generators as packages concept](/docs/concepts/generators-as-packages) —
  package shape and lifecycle
* [Projections and Snippets concept](/docs/concepts/projections-and-snippets) —
  the underlying DSL
* [Cross-generator coordination concept](/docs/concepts/cross-generator-coordination) —
  how the composition cases work
* `skmtc-generator` skill —
  operational guide for authoring or cloning
