agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/packer-cli/SKILL.md

packer-cli

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Perform HashiCorp Packer operations using the packer CLI. Use for validating, formatting, and building machine images from templates.

  • Installs packages

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the template table and rules below when constructing all packer commands.

    line 8
  2. Distinctive:

    Update the table below with your Packer template files and target build environments:

    line 12
  3. Distinctive:

    If the target environment is unclear, ask the user before running any command.

    line 19
  4. Very specific:

    If packer is not installed, inform the user that setup is required and ask them to complete the following steps manually.

    line 23
  5. Distinctive:

    NEVER target a template or vars file not listed in the configuration table above.

    line 75
  6. Very specific:

    Always run packer validate and packer fmt -check -diff before ever suggesting a build — never build blind.

    line 76
  7. Very specific:

    NEVER run packer build against a production template without explicit user instruction — builds provision real, billable cloud resources …

    line 77
  8. Distinctive:

    NEVER print, display, or store cloud provider credentials embedded in variables files — treat any credential-like variable as sensitive.

    line 78
  9. Distinctive:

    If a build fails partway, inform the user that orphaned temporary resources (instances, snapshots) may need manual cleanup in the cloud …

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Packer CLI Skill

Use the template table and rules below when constructing all packer commands.

Configuration

Update the table below with your Packer template files and target build environments:

EnvironmentTemplate FileVariables File
Production<your-prod-template>.pkr.hcl<your-prod.pkrvars.hcl>
Staging / Non-Prod<your-nonprod-template>.pkr.hcl<your-nonprod.pkrvars.hcl>

If the target environment is unclear, ask the user before running any command.

Prerequisites (one-time setup by user)

If packer is not installed, inform the user that setup is required and ask them to complete the following steps manually. Do not perform these steps yourself.

brew install packer
packer init <template.pkr.hcl>

Command Format

packer <command> -var-file=<vars-file> <template.pkr.hcl>

Examples

# Non-Prod — validate before building
packer validate -var-file=<your-nonprod.pkrvars.hcl> <your-nonprod-template>.pkr.hcl

# Non-Prod — build (only with user confirmation)
packer build -var-file=<your-nonprod.pkrvars.hcl> <your-nonprod-template>.pkr.hcl

Available Commands

Read-only (safe, no confirmation needed)

CommandDescription
packer validate -var-file=<file> <template>Validate template syntax and configuration
packer fmt -check -diff <template>Check formatting without modifying the file
packer inspect <template>Show builders, provisioners, and variables defined
packer consoleOpen an interactive expression evaluator
packer versionShow Packer version

Mutating operations (confirm with user before running)

CommandDescription
packer build -var-file=<file> <template>Build a new machine image — provisions real cloud/VM resources during the build
packer fmt <template>Reformat a template file in place
packer init <template>Install required plugins

Never run — requires explicit human approval

CommandReason
packer build against a production template/vars fileBuilds and may publish a production-bound image, consuming real cloud resources and cost
packer build -forceOverwrites an existing image artifact, potentially breaking references to it

Rules

  • NEVER target a template or vars file not listed in the configuration table above. If a command references an unfamiliar template, stop and ask the user to confirm.
  • Always run packer validate and packer fmt -check -diff before ever suggesting a build — never build blind.
  • NEVER run packer build against a production template without explicit user instruction — builds provision real, billable cloud resources and can publish images used by production infrastructure.
  • NEVER print, display, or store cloud provider credentials embedded in variables files — treat any credential-like variable as sensitive.
  • If a build fails partway, inform the user that orphaned temporary resources (instances, snapshots) may need manual cleanup in the cloud provider console — do not attempt automated cleanup yourself.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.