config-schema-sync
Use when reviewing, writing, or committing changes that touch model/config.go or any TOML config struct in this repo. Verifies that every added, renamed, or removed TOML field has a matching update in sesh.schema.json so the JSON schema used by TOML editors (via `#:schema` directive) stays in sync with the Go config model. Trigger whenever a diff touches files under model/, configurator/, or any struct tagged with `toml:"..."`.
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 2832
- Лиценз
- MIT
- Последна проверка на записа
- 22.09.2026 г.
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add joshmedeski/seshСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от SKILL.md
Началото на файла на автора, без превод.
Config ↔ Schema Sync Check
The sesh.schema.json file at the repo root is the public JSON Schema that TOML editors load via #:schema https://github.com/joshmedeski/sesh/raw/main/sesh.schema.json. Any config field that exists in Go but is missing from the schema produces "Additional properties are not allowed" errors for users (see issue #367 for precedent).
When to run this check
Run whenever a change touches any of:
model/config.go- Any Go struct with
toml:"..."tags - Files under
configurator/
Procedure
-
List the TOML fields added/renamed/removed in the diff:
git diff --unified=0 -- model/config.go configurator/ | rg 'toml:"[^"]+"' -
For every changed field, verify
sesh.schema.jsonmatches. Map the Go struct to its schema location:Go struct Schema path Configtop-level propertiesDefaultSessionConfigproperties.default_session.propertiesSessionConfigproperties.session.items.propertiesWindowConfigproperties.window.items.propertiesWildcardConfigproperties.wildcard.items.propertiesCheck each changed field:
rg '"<field_name>"' sesh.schema.json -
Report discrepancies. For each field present in Go but missing (or stale) in the schema, either:
- Add it to the schema with an appropriate
type,description, anddefaultwhere applicable, or - Flag it in the review output so the author can decide.
- Add it to the schema with an appropriate
-
Preserve schema conventions when editing:
additionalProperties: falseon nested objects — keep it.descriptionis required and should mirror the field's purpose (not just restate the name).- Include
defaultwhen the Go zero-value is meaningful. - Use
type: "string" | "boolean" | "integer" | "array"matching the Go type.
Quick diff-check one-liner
# Extract TOML field names from Go, compare against schema
comm -23 \
<(rg -o 'toml:"([^,"]+)' -r '$1' model/config.go | sort -u) \
<(rg -o '"([a-z_]+)":\s*\{' -r '$1' sesh.schema.json | sort -u)
Any field printed is in Go but not in the schema — investigate.
Do not
- Do not bump the schema
$idURL. - Do not remove
additionalProperties: falseto "fix" a missing field — add the field instead. - Do not add fields to the schema that are not yet merged in Go; the schema should track
main.