원클릭으로
tgc-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 | tgc-sync-provider |
| description | Synchronize a downstream Terraform provider repository with Magic Modules by aligning commit history and verifying parity. |
tgc-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.Before proceeding, determine which synchronization method you need:
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, always clean the uncommitted and untracked files in the downstream repository using git reset --hard and git clean -fd.
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 the automation script from tgc-build-skill to generate code and verify parity:
./.agents/skills/tgc/tgc-build-skill/scripts/build_tgc.sh <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 tgc command succeeded without unexpected diffs. Return to the workflow that invoked this skill to proceed.
If your goal is to bring both repositories to their most recent remote commits rather than aligning to an older base:
Fetch the latest changes from the canonical remote (e.g., upstream or origin) and rebase your feature branch on it. This avoids failures if main is already checked out in another worktree:
git fetch <canonical-remote> main
git rebase <canonical-remote>/main
Downstream is generated, so clean local changes first to avoid conflicts. Then fetch the latest commit from the remote main branch:
cd <downstream-provider-path>
git reset --hard
git clean -fd
git fetch origin main
Return to magic-modules and run the build script to project all changes to the latest downstream state:
./.agents/skills/tgc/tgc-build-skill/scripts/build_tgc.sh <downstream-provider-path>
If you are confident that the downstream repository and Magic Modules are already synchronized, or you explicitly wish to bypass this phase:
Briefly check the status of both repositories to ensure there are no uncommitted or conflicting changes:
git status
cd <downstream-provider-path>
git status
Skip all checkout/sync steps and directly proceed to the next phase of the workflow.