# push-to-registry

Teaches AI assistants how to register Packer build details in HCP. Useful for tracking machine image lifecycles and linking artifacts directly to Terraform.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3000 installs · ★ 909
- Author: hashicorp
- License: MPL-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/packer/skills/push-to-registry/SKILL.md
- Updated: 2026-10-05
- HTML: https://affpapa.org/en/nevibecode/skills/push-to-registry

## What it 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.

## Requirements
- Works with: AWS, Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill push-to-registry -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/push-to-registry/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/push-to-registry/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill push-to-registry -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/push-to-registry/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill push-to-registry -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/push-to-registry/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hashicorp/agent-skills push-to-registry
```

2. **Manually: put the files in place**
- File: `.github/skills/push-to-registry/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill push-to-registry -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/packer/skills/push-to-registry
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/push-to-registry/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill push-to-registry -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/packer/skills/push-to-registry/SKILL.md

## When to use it
- configure `hcp_packer_registry` blocks 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
- Add an `hcp_packer_registry` block to my `ubuntu.pkr.hcl` template
- 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

## Similar
- [aws-iam](https://affpapa.org/en/nevibecode/skills/aws-iam.md) — skill · 10200 installs
- [terraform-engineer](https://affpapa.org/en/nevibecode/skills/terraform-engineer.md) — skill · 5400 installs
- [iac-terraform-data-engineering](https://affpapa.org/en/nevibecode/skills/iac-terraform-data-engineering.md) — skill · 1800 installs
- [iac-data-engineering-terraform](https://affpapa.org/en/nevibecode/skills/iac-data-engineering-terraform.md) — skill · 1800 installs
- [gcp-to-aws](https://affpapa.org/en/nevibecode/skills/gcp-to-aws.md) — skill · 647 installs
- [firewall-config](https://affpapa.org/en/nevibecode/skills/firewall-config.md) — skill · 458 installs

From the same set: [hashicorp/agent-skills](https://affpapa.org/en/nevibecode/by/hashicorp/agent-skills.md) — 20 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
