switch-resource-to-generated
Use when a handwritten resource that users already have becomes generated code (tools/iac-codegen existing-resource mode). Pin the released behavior with…
от coralogix★ 22 звезды на GitHub
Установить switch-resource-to-generated в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Switch a handwritten resource to generated code
Trigger: A released resource moves to tools/iac-codegen, and its users must see no change.
Recipe:
- Pin released behavior first. Before any change, write migration tests: create with the released provider, switch to the new code, and check that Terraform plans no change, then test update, unset, and import. Read the handwritten schema (descriptions, validators, defaults, plan modifiers) and expand/flatten, and plan the applied config again after each refresh to catch perpetual diffs. Check raw request bodies where it matters:
alertUniqueIds: {}and{"value": []}parse alike but are different requests. The protocol harness (internal/provider/protocol_harness_test.go) drives a resource against an in-memory backend. A fake that is built from notes hides real behavior, so compare it with a real API recording. - Write
behavior-overrides.yamlin the output directory: one line per released field behavior. Runtfgen check --overrides. AddPINNED-SDKlines for facts the pinned SDK lacks. When the API holds a value in a one-property object and the released schema shows the plain value ({"query": {"value": "x"}}asquery = "x"), list the component inunwrap. Read the handwritten expand and flatten for each one-property object first: many stay objects, and one component can collapse in one place only (anunwrap: trueorunwrap: falsefield line). - Generate, register, delete the handwritten code. The migration tests must show only wording changes in messages. Put the four operation ids under
api.operations. Then runtfgen generate --resource <Name> --out <dir>with no operation flags. The diff must be empty, includingExactlyOneOfand other schema validators. - Fix confirmed bugs in a separate step. The tests must show only the fixes. Do not keep a bug with an override line.
- Later API changes. A new optional scalar field generates without a line unless it has a default that is not its zero value and no
x-coralogix-presence: true; then the generator stops, so ask for the annotation or probe a read and write a line. A new enum value needs no line: every contract value is accepted except the zero value andrejected. A line withnamesand notrimPrefixnames it by the style of thenamesentries, or stops withENUM_NAME_UNDECIDEDuntil anamesentry is added. - Generated acceptance test: never skip it. An existing resource gets
acceptance_test.goandTestFailurePaths<Name>Generatedonly whenacceptance.yamlsits next to the overrides, so a migration without the file has no generated e2e test at all. Add it in the migration PR (prerequisite HCL, real values,skip,minimal,upgradeFrom), runtfgen generate, and check that the PR's directory list inls internal/provider/generated/*/acceptance_test.gohas no gap. A value the tenant must already hold (an AI application) comes fromenv, which the workflow step sets; a real fixture name that is a secret is built there. Make values safe for an account-wide resource (IP access: disabled entries only) and put the test name in that resource's serial shard. Keep the hand test until the generated one has passed on a tenant. - Data source. Add
dataSource: {}(or its lines) to the overrides, regenerate, and keep a one-line domain constructor that passes the resource hooks toNewDataSource.
Why: Terraform plan modifiers, defaults, and null/empty reads decide whether an upgrade is silent. A second plan after apply and a migration test catch what a compile cannot.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл switch-resource-to-generated?
Use when a handwritten resource that users already have becomes generated code (tools/iac-codegen existing-resource mode). Pin the released behavior with migration tests first. Do NOT use for a new resource.
Как установить скилл switch-resource-to-generated?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл switch-resource-to-generated запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…