Skip to content

go-gen-jsonschema

Go types in. LLM-ready JSON Schema out.

Agent quickstart

Install the skill, then tell your agent what to build

terminal
npx skills add tylergannon/go-gen-jsonschema

Generate your first schema

Pin the Go tool, register a type, generate, validate, and commit the outputs.

Model missing and null

Choose ordinary fields, Optional[T], or Nullable[T] without guessing.

Enums and interfaces

Teach tool schemas named values and discriminated implementations.

Validate and prevent drift

Validate LLM output and make CI reject stale generated schemas.

  • Property order follows Go struct field order, producing deterministic prompts.
  • Unknown properties are rejected with additionalProperties: false.
  • Go doc comments become LLM-facing schema descriptions.
  • Ordinary and nullable fields are required; only Optional[T] removes a property from required.
  • Generated schema files and Go accessors are safe to commit and verify in CI.
  • Optionality, enums, discriminated interfaces, shared $defs, providers, and validation use explicit APIs.

Need exact exported signatures? The generated Go API reference is available, but most integrations should begin with Getting started.