push-to-registry — Claude Code skill: what it does, how to install
Teaches AI assistants how to register Packer build details in HCP. Useful for tracking machine image lifecycles and linking artifacts directly to Terraform.
npx skills add hashicorp/agent-skills --skill push-to-registry -a claude-codeWhat push-to-registry does
This skill explains how to embed the hcp_packer_registry block inside template files. Instead of uploading entire virtual machine disks, the process transmits lightweight records, which takes under 1 minute. Heavy disk images stay in place.
The configuration separates static project information from run-specific properties. The bucket_name argument acts as a permanent handle and must not contain timestamps. In contrast, bucket_labels capture mutable attributes, while build_labels store frozen details such as Git commit hashes. Downstream provisioning files can look up these images with the hcp_packer_artifact data block in Terraform.
Executing these workflows requires Packer 1.7.7 or newer along with an HCP service principal granted Contributor permissions. You must export four values: HCP_CLIENT_ID, HCP_CLIENT_SECRET, HCP_ORGANIZATION_ID, and HCP_PROJECT_ID. If the API connection fails, Packer halts the build right away so that your cloud inventory matches the registry state.
What it helps with
- configure
hcp_packer_registryblocks in HCL templates - attach commit hashes and timestamps to iteration metadata
- pass service account credentials to Packer via environment variables
- query generated build artifacts inside Terraform configurations
Example prompts for the agent
- Add an
hcp_packer_registryblock to myubuntu.pkr.hcltemplate - Configure the GitHub Actions workflow to run Packer and register metadata in HCP
- Write a Terraform data source to fetch the latest AMI published to HCP Packer
How to install push-to-registry
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill push-to-registry -a claude-code2Manually: put the files in place
~/.claude/skills/push-to-registry/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/push-to-registry/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill push-to-registry -a codex2Manually: put the files in place
.agents/skills/push-to-registry/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill push-to-registry -a cursor2Manually: put the files in place
.cursor/skills/push-to-registry/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hashicorp/agent-skills push-to-registry2Manually: put the files in place
.github/skills/push-to-registry/SKILL.md1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill push-to-registry -a gemini-cli2Platform CLI
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/packer/skills/push-to-registryManually: put the files in place
.devin/skills/push-to-registry/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill push-to-registry -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about push-to-registry
How do I install push-to-registry in Claude Code?
Run npx skills add hashicorp/agent-skills --skill push-to-registry -a claude-code in your terminal.
What does push-to-registry do?
It configures Packer to register image metadata in HCP Packer, enabling automated lifecycle tracking and integration with Terraform data sources.
What happens if Packer cannot reach the HCP registry?
The build process aborts immediately. This safety behavior stops resources from diverging between your cloud provider and the HCP catalog.