Command Palette

Search for a command to run...

Назад к скиллам
скилл № 65913

fix-api-pr-iac-gap

Use when you are given an API PR (a PR URL from the management API repo) whose Terraform preview is red, or that needs provider work before Terraform can…

БесплатноБез исполняемых скриптов
coralogixот coralogix★ 22 звезды на GitHub

Установить fix-api-pr-iac-gap в Claude Code и Claude Desktop

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

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

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

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

Fix an IaC gap for an API PR

Trigger: someone gives you an API PR URL. Its Terraform preview failed (cheap tier: tfgen check; full tier: generate, unit tests, or staging tests), or the field cannot reach Terraform without provider work.

Input: the API PR URL. Take the repository and the number only from that URL. Never write the URL, the PR number, a Jira key, or a DEV field name into this repository: no code, comment, commit message, changelog line, or provider PR body. This repository is public, and the API repository is private.

Steps

  1. Read the failure. gh pr view <API PR URL> --comments. Use the newest comment that has the marker <!-- terraform-dev-preview-comment -->. Note the resource, the tier, the failing stage (check, generate, unit tests, or staging tests), and the failure codes (CONTRACT_MISMATCH, IAC_HINT_INVALID, READ_DROPS_VALUE, ...).

  2. Decide who owns the fix. Use the owner column of the failure lines and the knobs on the proto field, both in tools/iac-codegen/README.md.

    • The API proto is wrong or missing a fact (a missing knob, a server default, a field the API drops): stop. The backend fixes it in the proto. Tell the user which code and field, and post nothing.
    • Our pipeline in the API repository is wrong (OpenAPI generator, lint, preview script): stop here too, and tell the user. That fix happens in the API repository, and it posts its own marker there.
    • The provider is wrong or lacks support (generator, behavior-overrides.yaml, acceptance.yaml, a hook, resource code): continue.
  3. Reproduce locally. Build the candidate spec of the API PR head as the API repository's Terraform preview does. Run go run ./cmd/tfgen check --resource <r> --openapi <candidate> from tools/iac-codegen first. Then reproduce the failure at the stage that the preview reported. It must fail the same way:

    • check (cheap tier): tfgen check fails.
    • Generate: tfgen generate for the resource fails. When generation needs SDK symbols that no release has, use the tfgen-generate-against-candidate-sdk skill.
    • Unit tests: go build ./... && go vet ./... or the resource's unit tests fail after generation.
    • Staging tests: the targeted make testacc TESTARGS='-run=<test of the resource>' fails.

    A later stage can fail while tfgen check passes. That is expected.

  4. Fix it in the provider. Prefer a generator change that works for every resource over an override line for one resource. Follow CLAUDE.md and the other skills.

  5. Prove it passes locally. All of these must pass:

    • tfgen check on the candidate spec.
    • tfgen generate for the resource, then go build ./... && go vet ./....
    • go test ./... in tools/iac-codegen when the generator changed, and the golden diff check of its README.
    • The targeted make testacc TESTARGS='-run=<test of the resource>'. Record test names and pass/fail only.
  6. Open the provider PR. Use the create-pr skill. The body describes the provider change in provider words, with nothing from the API PR (see Input).

  7. Post one marker comment on the API PR. See Marker. Show the comment to the user and wait for approval before you post it.

Marker

Pick where from the files that the provider PR changes. If more than one applies, use the first one in this list:

where Files
generator tools/iac-codegen/**, except testdata/, golden output, and README.md
overrides A file in internal/provider/generated/<r>/ that has no Code generated ... DO NOT EDIT. header (behavior-overrides.yaml, acceptance.yaml, upgrade-attributes.yaml), a hook, or other handwritten code under internal/provider/

A PR that changes only generated files (files with the header), go.mod, go.sum, CHANGELOG.md, or docs gets no marker. That delivery needed no code change by us.

Post exactly this shape, with gh pr comment <API PR URL> --body-file <file>:

<!-- iac-gap-fix:v1 {"tool":"terraform","pr":1044,"where":"generator","codes":["CONTRACT_MISMATCH"]} -->
IaC follow-up: terraform-provider-coralogix#1044 changes the generator so this change generates (CONTRACT_MISMATCH).
  • One comment per provider PR. A second provider PR for the same API PR gets its own comment. The tracking counts all markers of one API PR and tool as one delivery, and takes the biggest where (generator before overrides).
  • Post it when the provider PR opens. The merge time is read from GitHub later.
  • No @ mentions.

Why: the team tracks which API changes reached Terraform with no provider work, and which needed a generator or override change. Only the person who fixed the gap knows the cause for sure. The marker records it on the API PR, so this public repository holds nothing from that PR.

Полный SKILL.md на GitHub

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

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

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

FAQ

Что делает скилл fix-api-pr-iac-gap?

Use when you are given an API PR (a PR URL from the management API repo) whose Terraform preview is red, or that needs provider work before Terraform can generate it: make it pass tfgen check, generate, and the targeted acceptance tests locally, open the provider PR, then post one gap-fix marker comment on the API PR. Do NOT use when the fix belongs in the API proto (the backend owns that).

Как установить скилл fix-api-pr-iac-gap?

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

Скилл fix-api-pr-iac-gap запускает скрипты?

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

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

Сравнить fix-api-pr-iac-gap с