Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sync-schema-descriptions

БесплатноБез исполняемых скриптовНе проверен

Sources Terraform schema descriptions from the pinned oxide.go SDK's Go doc comments, which already mirror the OpenAPI spec. Adapts the text to the TF surface…

oxidecomputerот oxidecomputer★ 34 звезды на GitHub

Об этом скилле

Sync Schema Descriptions

Overview

Terraform schema Description / MarkdownDescription strings are hand-written and drift from the canonical descriptions in the OpenAPI spec. The oxide.go SDK, pinned via go.mod, has the same descriptions baked into Go doc comments on each field. This skill walks through sourcing the right description, adapting it, and applying the change.

Not every TF attribute maps 1:1 to a single SDK field (e.g. TF's boot_disk_id corresponds to the SDK's richer boot_disk), so blind copying is wrong. The skill codifies the adaptation process rather than automating it blindly.

Workflow

1. Resolve the SDK source

go list -m -f '{{.Dir}}' github.com/oxidecomputer/oxide.go

Descriptions live in <dir>/oxide/types.go. Do not use a local checkout of the SDK, which might not match the pinned version.

2. Identify scope

The user will usually ask about one attribute (e.g. instance.ssh_public_keys), a whole resource, or all resources. For each in-scope attribute, work through steps 3–8.

3. Locate the TF attribute

In internal/provider/<resource>/resource.go (or data_source.go), find the schema block and note the current Description / MarkdownDescription. Find the TF model struct field via its tfsdk:"<attr_name>" tag.

Do not touch schema-version-compat files (resource_v0.go, resource_v1.go, …). They represent frozen prior schemas kept for state upgrades; descriptions there are not rendered to current docs, so the files should stay as they were when that version shipped.

4. Find the matching SDK field

Input attributes (set in Create/Update): grep the Create method for the model field. You'll see a line like params.Body.SshPublicKeys = .... The SDK struct is the type of params.Body (e.g. oxide.InstanceCreate); the SDK field is the LHS accessor.

Computed/output attributes (populated in Read): grep the Read method for how state.<Field> is set from the API response — e.g. state.TimeCreated = types.StringValue(resp.TimeCreated.String()). The SDK struct is the response type (e.g. oxide.Instance), the field is the resp.<X> accessor.

If the TF attribute has no clean 1:1 SDK counterpart (flattened, split, or composed from multiple API fields), stop and surface this to the user — it needs a hand-written description, not an adaptation.

5. Read the SDK doc comment

Open <sdk_dir>/oxide/types.go, find type <StructName> struct, and read the Go doc comment on the field. Comments are hard-wrapped; reflow them into a single logical description.

Also note the field's Go type — it drives adaptation rule (b) below.

6. Adapt

The default is verbatim. Copy the SDK doc comment's prose into the TF description word-for-word. Do not insert em dashes, merge sentences, paraphrase verbs, or restructure for flow. The value of sourcing from the SDK is fidelity to a single maintained source of truth; editorial drift reintroduces exactly the hand-written divergence the skill is meant to eliminate.

Only deviate when one of the rules below applies, and only to the extent the rule requires. If you aren't sure whether a change is required, keep the source wording and ask the operator.

Do not invent text from sibling attributes. If the SDK has no usable description for a given TF attribute (e.g. the SDK doc comment is a tautology like "X is a variant of Y", or the corresponding SDK type/field is internal wrapping with no prose), the skill's job is done — the attribute needs a hand-written description, which is outside this skill's scope. Surface the gap to the operator. Never copy text from a TF sibling (v4 → v6, ephemeral → floating, etc.) and pass it off as adapted; it is still hand-written, just plagiarized.

a. Translate field-name references. If the comment references an API field name that differs in TF (e.g. "set the boot_disk attribute"), rewrite it to the TF name (boot_disk_id). Same for any other cross-referenced field.

b. NameOrId phrasing. The API accepts both names and IDs for NameOrId / []NameOrId inputs. The right phrasing depends on what the TF attribute represents:

  • If the attribute is the resource's own name (typically a required top-level attribute on a resource or data source), it stores the name. Describe as "Name of …".
  • If the attribute is a reference to another resource (e.g. vpc_id, disk_attachments, boot_disk_id), the provider writes the resolved ID back into state on Read, so a user who supplies a name will see a perpetual diff (or recreate) on the next plan. Until the provider preserves the user-supplied form, keep descriptions honest: say "ID of …" / "IDs of …" regardless of whether the SDK field type is string or NameOrId. If the source SDK comment says "name or ID", rewrite to "ID".

c. Trim non-user-facing paragraphs. Drop:

  • internal API behavior the TF user can't observe
  • roadmap/hedging language ("currently, …", "in the future, …")
Полный SKILL.md на GitHub

Установить sync-schema-descriptions в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл sync-schema-descriptions?

Sources Terraform schema descriptions from the pinned oxide.go SDK's Go doc comments, which already mirror the OpenAPI spec. Adapts the text to the TF surface (translating reshaped attribute names, clarifying NameOrId inputs, trimming API-internal paragraphs, and reconciling any divergence between provider and API default behavior) so the descriptions stay accurate and aligned with the version of the SDK the provider actually calls into.

Как установить скилл sync-schema-descriptions?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sync-schema-descriptions запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sync-schema-descriptions с