一键导入
sync-provider
Synchronize a downstream Terraform provider repository with Magic Modules by aligning commit history and verifying parity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Synchronize a downstream Terraform provider repository with Magic Modules by aligning commit history and verifying parity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Skill for reviewing Magic Modules schemas. Currently covers the Enum vs. String decision via the knowledge base.
Opt resource into MMv1 list-resource generation by setting `generate_list_resource: true`, validate it locally, and open a one-resource PR against GoogleCloudPlatform/magic-modules. Invoke when the user asks to add list-resource support for a specific MMv1 resource or to enable `generate_list_resource` for an eligible resource.
Fallback workflow for general implementation and debugging tasks that do not involve creating a new resource.
Workflow specifically for creating a new resource, supporting both autogen and manual generation.
Create a Pull Request (PR) against GoogleCloudPlatform/magic-modules following repository standards, including branch management, commit formatting, mandatory release notes, pre-PR verification checks, and gh CLI commands.
Validate that changes to the generated providers don't introduce breaking changes or fields with missing tests or missing documentation. Use this skill when the user wants to check for breaking changes, missing tests, or missing documentation, or other problems in the downstream providers.
| name | sync-provider |
| description | Synchronize a downstream Terraform provider repository with Magic Modules by aligning commit history and verifying parity. |
sync-providerNote to AI Agents: You MUST read the YAML frontmatter above first. Only read the rest of this file if the
descriptionmatches your required task. This skill is designed to be completely self-contained and unambiguous for a fresh agent without prior context.
magic-modules and downstream provider repositories.terraform-provider-google-beta).Check if the magic-modules repository is a fork or has multiple remotes:
git remote -v
Identify the official googleapis/magic-modules remote (e.g., origin or upstream).
If it is ambiguous, ask the user which remote is the canonical upstream.
Then calculate the target base commit:
main (of the upstream): Use the current commit (HEAD).main:
git merge-base HEAD <canonical-remote>/main
Record the base commit hash and date. This hash will be used to find the matching commit in the downstream repository.
Before checking out older commits, check if there are local modifications in the downstream repository:
cd <downstream-provider-path>
git status
If changes exist, point them out to the user and ask if they wish to save/stash them. Do not proceed without consent. If consent is given, you can stash or reset them.
Search for a commit in the downstream repository that corresponds to the Magic Modules base commit hash:
cd <downstream-provider-path>
git log -n 50 --grep="[upstream:<MM-hash>]"
If not found, search origin/main (in case your local main is behind):
git log -n 50 --grep="[upstream:<MM-hash>]" origin/main
If found, pull your main or checkout the specific commit. If not found, try history traversal before falling back to date-based matching.
If the exact base hash is not found, it is likely because the specific magic-modules commit did not generate code changes for this specific provider (resulting in no downstream generation commit).
Walk backwards through the magic-modules commit history from your base commit. For each parent commit:
git log -n 10 --format="%H %s"git log --grep="[upstream:<parent-hash>]"If no commit message contains the hash, find the commit in the downstream repository that is closest to the date/timestamp of the MM base commit:
git log --since="<date-of-base-minus-2-days>" --until="<date-of-base-plus-2-days>"
Select the commit that appears to be the matching nightly or generation commit. If ambiguous, ask the user for clarification.
Checkout the matching commit in the downstream repository:
git checkout <matching-commit-hash>
Return to magic-modules and run code generation to verify that there are no unexpected diffs:
cd <magic-modules-path>
make provider VERSION=<beta|ga> OUTPUT_PATH="<downstream-provider-path>"
Verify the output of git status in the downstream repository. It should be clean or only contain changes from our specific branch.
Verify that the make provider command succeeded without unexpected diffs. Return to the workflow that invoked this skill to proceed.