Guide · Agent skill
How to use the Terraform Infrastructure Expert agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains how to install and use the Terraform Infrastructure Expert skill, a set of expert instructions that helps an AI agent write, review and manage Terraform configurations. It is written for people who have never used an agent skill before. By the end you will know what the skill changes about the agent's behaviour, how to add it to Claude, and how to ask for help in a way that triggers it.
Quick start
- 1Download the ZIP. Download the skill ZIP from this page.
- 2Unzip the skill. Unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder.
- 3Or upload it in Claude. In the Claude apps, go to Settings → Capabilities → Skills and upload the ZIP.
- 4Check your tools. Install Terraform or OpenTofu if you want the agent to run commands, and confirm access to your project and state backend.
- 5Ask in plain language. Describe your Terraform task and mention Terraform or OpenTofu.
- 6Review before applying. Read the plan output yourself before any apply, as the skill recommends.
What the Terraform skill makes the agent do
Terraform is a tool that defines cloud infrastructure such as servers, networks and databases as code. This skill gives the agent expert guidelines for working with Terraform and OpenTofu. Once installed, the agent follows safer habits: running a plan before applying changes, using remote state with locking, pinning provider versions, designing reusable modules and avoiding hardcoded secrets.
- Reviews plan output for unexpected changes before any apply
- Recommends remote state backends with state locking instead of local state for shared infrastructure
- Pins Terraform and provider versions with required_providers
- Suggests focused, reusable modules with typed, documented variables and outputs
- Advises on state tasks such as state list, state show, import and state mv
- Recommends tagging, for_each over count, locals and data sources
What the skill does not do
The skill is written as instructions and reference advice, not as a tool that changes your infrastructure by itself. It only contains guidance, so the agent still needs its own access and tools to run Terraform. It covers general principles rather than specific cloud APIs, so provider-specific details may need to come from elsewhere.
Install the Terraform skill
Download the skill ZIP from this page. The skill is a single file named SKILL.md. Unzip it into one of these locations, depending on whether you want it for all projects or one project:
- Personal: ~/.claude/skills/ (available across your projects)
- Project: a project's .claude/skills/ folder (available only in that project)
- Claude apps: upload the ZIP under Settings → Capabilities → Skills
Trigger the skill with natural requests
You do not need a special command. Describe the Terraform task in plain language and mention Terraform or OpenTofu. The skill is meant for writing, planning, reviewing and managing state, so requests along those lines are the ones it is built for.
- Review this Terraform config for hardcoded secrets and missing version pins
- Help me move an existing S3 bucket into Terraform with an import
- Refactor this module so the resource address changes without recreating the resource
- Suggest a module layout for networking and compute in separate modules
- Check whether my plan output shows anything risky before I apply
Before you start: what you need
The skill needs different things depending on what you ask the agent to do. Reading and reviewing code needs only the files. Running commands needs more.
- Terraform or OpenTofu installed, if the agent is to run commands
- Access to the target project and state backend, if the agent is to plan or apply
- Cloud provider credentials, only if you choose to run plans or applies against real infrastructure
Safety notes on scripts and network
This skill runs no scripts and uses no network. It is a text file of guidance. Any commands the agent runs come from Terraform itself and from the access you have given the agent, so limit that access to what you intend. The skill also advises against running terraform destroy in production without explicit confirmation and a reviewed plan, and against storing secrets in .tf files.
Tips for getting good results
The advice assumes working knowledge of cloud infrastructure, so give the agent real context: your provider, your backend and the environments you run. Paste the plan output when you want it reviewed. Treat the answers as a starting point and check them against your own provider documentation.
- Include the plan output and the relevant .tf files in your request
- Say which backend you use, such as S3 with DynamoDB or Terraform Cloud
- Ask for one concern at a time, such as state or module design
What people use it for
- Reviewing a Terraform configuration for hardcoded secrets, unpinned providers and missing tags
- Planning a safe refactor with terraform state mv so resources are not destroyed and recreated
- Importing existing resources into Terraform with terraform import
- Designing a module structure that separates networking from compute
- Setting up a CI check that runs terraform fmt and terraform validate before merge
Frequently asked questions
How do I install the Terraform agent skill?
Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. In the Claude apps you can instead upload the ZIP under Settings → Capabilities → Skills.
Is the Terraform skill free to use?
The source does not state pricing or licence terms beyond the listed licence, which is Apache-2.0. Check the repository licence for the terms that apply to you.
Does the Terraform skill run Terraform for me?
No. The skill is guidance only and does not change your infrastructure by itself. The agent needs its own access and tools, such as Terraform or OpenTofu installed, to run commands.
What do I need to use the Terraform skill?
For advice and code review you only need the files. To have the agent run commands you need Terraform or OpenTofu installed, plus access to the project and state backend. Cloud credentials are needed only if you choose to plan or apply against real infrastructure.
Does the skill work with OpenTofu as well as Terraform?
Yes. The skill is described as helping with Terraform and OpenTofu, and it is aimed at engineers writing or reviewing either configuration.
Is the Terraform skill safe to run?
The skill runs no scripts and uses no network. It contains only instructions. Any commands the agent runs come from Terraform and the access you grant, so keep that access limited and review every plan before applying.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits engineers writing or reviewing Terraform or OpenTofu who want consistent habits around plans, remote state, modules and tagging, and people learning state management. It is not a way to provision infrastructure on its own, and it will not give provider-specific API detail, so pick a provider-focused resource if you need that.
Download the skill