Generate, review, refactor, test, and troubleshoot Terraform using official HashiCorp workflows. Use when writing HCL, designing reusable modules, creating `.tftest.hcl` tests, managing backends and state, or importing existing resources.
Ships in terraform-expert. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill as a single entry point for the official HashiCorp Terraform skill set. Pick the matching workflow first, then load only the local references needed for that task.
Version gates. Before recommending a feature, check the project's required_version: moved blocks need Terraform >= 1.1, import blocks >= 1.5, terraform test / .tftest.hcl >= 1.6, and Terraform Search (terraform query, list resources) >= 1.14. On older pins, either raise the pin deliberately or use the legacy equivalent (terraform state mv, terraform import CLI).
OpenTofu. If the project uses OpenTofu (tofu CLI, opentofu in lockfiles/CI), the guidance here mostly transfers — style, modules, state discipline — but verify feature availability against OpenTofu's own docs (it diverges from Terraform post-1.5: e.g. state encryption exists in OpenTofu only, and test/query features track different versions). Don't assume version gates map one-to-one.
This skill is aligned to the core Terraform skills in hashicorp/agent-skills:
terraform-style-guide -> references/style-guide.mdterraform-test -> references/testing.mdrefactor-module -> references/module-patterns.md, references/module-library.mdterraform-search-import -> references/search-import.mdDeliberately excluded:
.tf authoring or review: load references/style-guide.md, references/providers.md, and references/best-practices.md.references/module-patterns.md, references/module-library.md, and references/testing.md.references/state-management.md.references/search-import.md first, then references/style-guide.md.references/testing.md; prefer terraform test and .tftest.hcl before reaching for Terratest.moved blocks, import blocks, and .tftest.hcl tests over ad hoc shell-based fixes.description and type to every variable and output.for_each for collections and count only for optional singletons or simple conditional resources.examples/ plus focused tests..terraform.lock.hcl when provider dependencies change..terraform/, state files, plan files, or secret-bearing .tfvars files.terraform state surgery before considering moved or import blocks.moved blocks (>= 1.1) over destructive recreation.import blocks (>= 1.5); use Terraform Search and generated import configuration when Terraform >= 1.14 and the provider supports list resources.terraform test (>= 1.6); use Terratest only when you need runtime behavior, external system checks, or richer orchestration.Run the narrowest useful validation loop for the task:
terraform fmt -recursiveterraform validateterraform test for reusable modules or when .tftest.hcl is presentterraform planUse these task-specific commands when relevant:
terraform query, then terraform query -generate-config-out=...When producing Terraform changes, provide:
references/aws-modules.md (opens in a new tab)references/best-practices.md (opens in a new tab)references/module-library.md (opens in a new tab)references/module-patterns.md (opens in a new tab)references/providers.md (opens in a new tab)references/search-import.md (opens in a new tab)references/state-management.md (opens in a new tab)references/style-guide.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/terraform-expert:terraform-expertfrom terraform-expert
npx claudepluginhub rehanhaider/aiman --plugin terraform-expert