Skip to content

Schema from existing types

  • deukpack schema = your existing types or data → a draft .deuk
deukpack schema src/types.ts --out schema/app.deuk --namespace app        # TS interface, type, enum
deukpack schema api.schema.json --out schema/api.deuk                       # JSON Schema
deukpack schema samples/*.json events.jsonl --out schema/events.deuk        # JSON samples
deukpack schema app.models:Order --out schema/order.deuk                    # pydantic v2 model

Rules

  • Several sources → one .deuk. Field ids = declaration order
  • // infer: lines = choices to review: integer width, TS number, string unions, renamed keys
  • Stops on what .deuk cannot hold: unions, one key with two types across samples
  • String-valued JSON enums stay string. dpjson carries enums as integers

Requirements

  • .ts needs typescript in your project
  • pydantic: --python <exe> picks the interpreter

Other languages

  • C#, C++, Rust and other code: the agent skill writes the .deuk, deukpack gen checks it
  • AI agents