AGENT SKILL
regen-schema
Use after changing config fields, schema tags, nested types or cmd/schemagen mappings
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 27
- Forks
- 6
01 前言 Front Matter
- name
- regen-schema
- description
- Use after changing config fields, schema tags, nested types or cmd/schemagen mappings
03 SKILL.md 正文
regen-schema
The JSON Schema published at docs/schemas/config.schema.json is generated from the config.Config Go struct.
When to run
Any of:
- Changed a field on
config.Configor a type it contains, including nested types in otherinternal/config/files. - Changed a serialized name or schema constraint (
yaml:,json:,jsonschema:, orjsonschema_description:). - Changed reflection or custom type mappings in
cmd/schemagen/main.go.
Changing only the numeric config version does not itself change the reflected schema. Regenerate when its schema representation changes.
Steps
go run ./cmd/schemagenfrom the repo root.git diff docs/schemas/config.schema.jsonto confirm the change is what you intended.- Include any schema diff with the source change. CI's
Schema driftjob regenerates it and fails on a diff. A source-only change that leaves the schema identical needs no artificial schema edit.
Never hand-edit the schema file. The next regen overwrites it.