Terraform Skill (diagnose-first Terraform/OpenTofu guide)
A diagnose-first skill for writing, reviewing and debugging Terraform/OpenTofu code, tests, CI pipelines and state operations with version-aware guardrails.
Dev & CodingIntermediate★ 2,455⑂ 227AI score 9/10Last updated: Oct 24, 2026
What it does
- Captures execution context first:
terraformvstofu, exact version, providers, state backend, execution path (local/CI/Cloud/Atlantis), environment criticality. - Classifies the symptom via a failure-mode routing table: identity churn, secret exposure, blast radius, destroy cascade, CI drift, compliance gaps, testing blind spots, state corruption, provider upgrade/lifecycle risk, provisioner misuse.
- Loads only the matching reference file (
code-patterns.md,state-management.md,testing-frameworks.md,ci-cd-workflows.md,security-compliance.md,code-intelligence-lsp.md,quick-reference.md) instead of dumping everything. - Ends every answer with a Response Contract: assumptions & version floor, risk category addressed, chosen remediation & tradeoffs, exact validation commands, rollback notes.
- Applies feature guards by version:
moved(1.1+),import(1.5+), nativetest(1.6+), mock providers (1.7+), S3 native lockfile (1.10+),write_only(1.11+). - Hard safety rules: never apply to prod without a reviewed plan artifact; never
destroywithoutplan -destroyplus explicit confirmation; never-auto-approvea destroy.
Who it's for
- DevOps and platform engineers running AWS/Azure/GCP infrastructure as code.
- Module authors who need consistent variable/output contracts, naming and release checklists.
- Teams building IaC pipelines in GitHub Actions, GitLab CI or Atlantis.
- Operators about to migrate backends, split state, or recover from a stuck lock.
Example uses
- "My refactor makes plan recreate 10 resources" → diagnosed as identity churn; migrates
counttofor_each, generatesmovedblocks, and verifies a 0-destroy plan. - "Move production state to S3" → recommends
use_lockfileon 1.10+ or DynamoDB locking below it, with backup, validation and rollback steps. - "My tftest for S3 encryption rules keeps failing" → explains that set-type blocks can't be indexed with
[0]and computed values needcommand = apply. - "CI plan differs from my local plan" → pins runtime/providers, commits
.terraform.lock.hcl, and applies the reviewed plan artifact instead of re-planning.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/antonbabenko/terraform-skill/HEAD/skills/terraform-skill/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on AI Skill Mart. Copy the skills/terraform-skill folder from the GitHub repo antonbabenko/terraform-skill into my ~/.claude/skills/antonbabenko-terraform-skill/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/antonbabenko/terraform-skill.git /tmp/terraform-skill && mkdir -p ~/.claude/skills && cp -r /tmp/terraform-skill/skills/terraform-skill ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/antonbabenko/terraform-skill.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy the whole folder so the reference docs come along:
cp -r terraform-skill/skills/terraform-skill ~/.claude/skills/ - Verify:
ls ~/.claude/skills/terraform-skill— you should seeSKILL.mdand areferences/directory. - Restart Claude Code, then ask something like "review this Terraform module" to trigger the skill.
- (Optional) Have
terraformortofuon PATH withterraform initrun, plustflint,trivyandcheckovinstalled for the validation and security stages.
View source on GitHub ↗License: NOASSERTION