Schema to go
Skill kilianpaquier/ai-integration/plugins/skills/schema-converter/skills/schema-to-go
A skill that converts JSON Schema to Go struct definitions.From its SKILL.md
npx -y skills add kilianpaquier/ai-integration --skill schema-to-goAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 28 days oldThe repository was created 28 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.7 KB, 589 tokens by cl100k_base, as published. Nobody here has run it
Generate inside $package-path in the file $package-name.go the Golang structures according to the local JSON Schema $schema-path.
The generation must follow the coding structure provided below.
Code structure
// Code generated by AI ({ModelVersion}).
package $package-name
// ObjectName <object description>.
type ObjectName struct {
// PropertyName <the property description>.
PropertyName <the property type> `json:"propertyName,omitempty" yaml:"property_name,omitempty"`
// EnumName <the enum description>.
//
// Enums:
// - <value>
// - <value>
//
// Examples:
// - <value>
// - <value>
EnumName <the enum type> `json:"enumName,omitempty" yaml:"enum_name,omitempty"`
// ChildObject <object description>.
ChildObject *ChildObject `json:"childObject,omitempty" yaml:"child_object,omitempty"`
// ArrayName <array description>.
ArrayName []<the array type> `json:"arrayName,omitempty" yaml:"array_name,omitempty"`
}
// ChildObject <object description>.
type ChildObject struct {
...
}
- In case of
allOfwith$ref, merge both objects into the samestruct(fields must be sorted alphabetically). - Respect the GoDoc format: A GoDoc comment always start with the property name, field name, struct name and ends with a dot.
- Respect the GoDoc format: Adapt the first word(s) of descriptions to avoid repetitions or non-conjugated (third singular person) sentences.
- Struct fields must be sorted exactly as ordered in the schema.
- Add newlines between
structfields. - Add newlines when a description has newlines (same places).
- No need to create method for 'default' or 'enum' to verify the validity of fields.
- No need to parse conditions 'if', 'else'.
- Replace
{ModelVersion}by the current AI model and version used to generate the files (e.g. 'Claude Sonnet 4.6', etc.).
Constants
For all 'enums' values, the available values must be created as const inside constants.go with below code structure.
// Code generated by AI ({ModelVersion}).
package $package-name
const (
EnumName<Option Name> = <value>
)
const (
AnotherEnumName<Option Name> = <value>
)
- All constants must be sorted alphabetically within a
const (...)section. - Never add unnecessary prefixes (e.g. 'CI...').
- Replace
{ModelVersion}by the current AI model and version used to generate the files (e.g. 'GPT-5-Codex', 'Claude Sonnet 4.0', etc.).
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.