Imported from WillAbides/jsonschematogo (
AGENTS.md). Install upstream withnpx skills add WillAbides/jsonschematogo. Copyright stays with the author.
AGENTS.md
Project Overview
jsonschematogo is a CLI tool that converts JSON Schema definitions into Go
struct types. It intentionally focuses on type generation only — validation is
considered a separate concern.
Status: Early development.
Build & Test
All automation is via shell scripts in script/. There is no Makefile.
script/test # Run tests (race detector, coverage)
script/lint # Run golangci-lint and shellcheck
script/fmt # Format Go code and shell scripts
script/generate # Run all generators (go generate, go mod tidy, update docs)
script/generate --check # Verify generated files are up to date (used in CI)
script/cibuild # Full CI suite (test + lint + generate check + snapshot build)
Tool dependencies (golangci-lint, goreleaser, etc.) are managed by
bindown via script/bindown and
.bindown.yaml.
Testing
- Tests use golden files in
internal/codegen/testdata/golden/. - Test schemas are in
internal/codegen/testdata/schemas/. - Set
UPDATE_GOLDEN=1to update golden files:UPDATE_GOLDEN=1 script/test - Golden file assertion utility is in
internal/testutil/golden.go. - After making changes, run
script/testfor the relevant packages — avoidgo test ./...unless necessary.
Code Style
- Go 1.24
- Strict linting via
.golangci.yml(50+ linters, max line length 120). - Formatting:
gofumpt+golines+gci(run viascript/fmt). - Shell scripts: formatted with
shfmt -i 2 -ci -sr.
Project Structure
cmd/jsonschematogo/ CLI entry point
internal/
codegen/ Code generation engine
run/ CLI command handler (uses kong)
testdata/ Golden files and test schemas
schema/ JSON Schema model and loading
schemaloader/ URL/file/YAML schema loader
testutil/ Golden file test helpers
script/ Shell automation scripts
Key Dependencies
santhosh-tekuri/jsonschema/v6— JSON Schema parsingdave/jennifer— Go code generationalecthomas/kong— CLI framework
Releases
Automated with release-train. All PRs must have a release label. Cross-platform binaries are built with goreleaser.
Generated Files
Some sections in README.md and CONTRIBUTING.md are auto-generated by
script/update-docs. Look for <!--- start ... ---> / <!--- end ... --->
markers. Run script/generate after changes that affect these sections.
