Best use case
packer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
HashiCorp Packer image building. Use for machine images.
Teams using packer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/packer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How packer Compares
| Feature / Agent | packer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
HashiCorp Packer image building. Use for machine images.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Packer
Packer automates the creation of Machine Images (AMI, VMDK, ISO) for multiple platforms from a single configuration. In 2025, **HCL2** is the standard for configuration.
## When to Use
- **Immutable Infrastructure**: Bake your app code into the OS image. Booting a pre-baked AMI is faster than running Ansible on boot.
- **Golden Images**: Create hardened, secure base images for your organization.
- **Multi-Cloud**: Build an AMI for AWS and a VHD for Azure from the same script.
## Quick Start (HCL2)
```hcl
source "amazon-ebs" "ubuntu" {
ami_name = "my-app-{{timestamp}}"
instance_type = "t3.micro"
region = "us-west-2"
source_ami_filter {
filters = {
name = "ubuntu/images/*ubuntu-jammy-22.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"] # Canonical
}
ssh_username = "ubuntu"
}
build {
sources = ["source.amazon-ebs.ubuntu"]
provisioner "shell" {
inline = ["sudo apt-get update", "sudo apt-get install -y nginx"]
}
}
```
## Core Concepts
### Builders
Cloud-specific components (e.g., `amazon-ebs`, `azure-arm`) that launch a VM.
### Provisioners
Tools to configure the VM (Shell, Ansible, Chef) before it is turned into an image.
### Post-Processors
What to do with the image (Upload to S3, Vagrant Box, Docker Push).
## Best Practices (2025)
**Do**:
- **Use HCL2**: JSON templates are legacy. HCL2 supports variables and logic.
- **CI Integration**: Run Packer in CI pipeline to produce new AMIs on every release.
- **Cleanup**: Ensure Packer cleans up temporary resources (Security Groups, Key Pairs) after build.
**Don't**:
- **Don't bake secrets**: Never put passwords in the image. Use Cloud-init or User Data to inject them at runtime.
## References
- [Packer Documentation](https://developer.hashicorp.com/packer)Related Skills
template
Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].
zsh
Zsh shell with oh-my-zsh. Use for terminal shell.
zed
Zed high-performance collaborative editor. Use for fast editing.
xcode
Xcode Apple development IDE with simulators. Use for iOS/macOS development.
webstorm
WebStorm JavaScript IDE with debugging. Use for web development.
webpack
Webpack module bundler with loaders and plugins. Use for bundling.
warp
Warp modern terminal with AI. Use for terminal work.
vscode
Visual Studio Code editor with extensions and debugging. Use for code editing.
vite
Vite fast build tool with HMR. Use for modern frontend builds.
visual-studio
Visual Studio IDE for Windows with debugging and profiling. Use for .NET development.
vim
Vim text editor with motions, macros, and plugins. Use for terminal editing.
turbopack
Turbopack Rust-powered bundler. Use for fast builds.