Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

Terraform Skill (Terraform/OpenTofu Diagnostics)

A diagnose-first Terraform/OpenTofu companion that classifies the failure mode, applies version-aware guards, and always ships validation commands plus rollback notes.

Dev & CodingIntermediate2,254199AI score 9/10Last updated: Jul 3, 2026

What it does

This skill rewires how Claude handles infrastructure-as-code work: diagnose first, then generate, with explicit risk controls.

  • Failure-mode routing table: maps symptoms into 13 categories — identity churn (addresses shifting after refactor), secret exposure, blast radius, destroy cascade, CI drift, compliance gaps, testing blind spots, state corruption/recovery, provider upgrade and lifecycle risk, provisioner misuse, cross-cloud mapping — and loads only the matching reference file.
  • Response contract on every answer: (1) assumptions and version floor (runtime, providers, backend, execution path: local/CI/Cloud/Atlantis), (2) risk category addressed, (3) chosen remediation and tradeoffs, (4) exact validation commands (fmt -check, validate, plan -out, policy checks), (5) rollback notes for anything destructive or state-mutating.
  • Hard safety rails: never recommends production apply without a reviewed plan artifact and approval; requires terraform plan -destroy plus an enumerated deletion list (including implicit dependents pulled in via locals or for_each) and explicit confirmation before any destroy — and never -auto-approve on destroy.
  • Version-aware feature guards: moved (1.1+), optional() (1.3+), import/check (1.5+), native terraform test (1.6+), mock providers (1.7+), removed (1.7+), cross-variable validation (1.9+), S3 native lockfile (1.10+), write_only args (1.11+).
  • Opinionated structure: module hierarchy (resource → resource module → infrastructure module → composition), directory layout, naming and block-ordering rules, variable/output contracts, state-splitting heuristics (split above ~500 resources, combine below ~100), version pinning matrix, trivy/checkov security stage.
  • terraform-ls code intelligence: position-anchored goToDefinition/findReferences, manual rename discipline for value symbols, moved blocks instead of blind text renames, and a degradation gate before claiming LSP is broken.

Who it's for

  • Platform and DevOps engineers authoring or reviewing shared Terraform modules
  • Teams organizing multi-environment layouts and remote state backends
  • Anyone building IaC pipelines in GitHub Actions, GitLab CI, or Atlantis, or chasing local-vs-CI plan mismatches
  • Engineers designing a test strategy with native terraform test, Terratest, or mock providers
  • Teams migrating to OpenTofu or planning a major provider bump

Overkill for basic HCL syntax questions or plain provider API lookups.

Example uses

  1. countfor_each migration: "Deleting one subnet in the middle recreated all of them." It diagnoses identity churn, produces the for_each = toset(...) rewrite plus the matching moved blocks, and requires a plan showing zero destroys.
  2. Fixing CI drift: "My local plan differs from the CI plan." It pins runtime and providers, commits .terraform.lock.hcl, and restructures the pipeline so the apply job consumes the reviewed plan artifact instead of re-running plan.
  3. Secrets leaking into state: "Is sensitive = true enough?" It explains that this only masks display, then offers write_only/*_wo on 1.11+ or runtime lookups from Secrets Manager / Key Vault below that, with tradeoffs.
  4. Stuck lock or backend migration: walks through unlocking safely, choosing S3 use_lockfile (1.10+) over DynamoDB, and keeping backups plus evidence with clear rollback notes.

· · · Install guide · · ·

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude 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 && mkdir -p ~/.claude/skills && cp -r terraform-skill/skills/terraform-skill ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and create the skills directory if needed: mkdir -p ~/.claude/skills
  2. Clone the repository: git clone https://github.com/antonbabenko/terraform-skill.git
  3. Copy the whole skill folder, including its references/ docs: cp -r terraform-skill/skills/terraform-skill ~/.claude/skills/
  4. Verify the install: ls ~/.claude/skills/terraform-skill — you should see SKILL.md and a references/ directory.
  5. (Recommended) Make sure terraform or tofu is on your PATH and run terraform init once in your project so the terraform-ls navigation features work.
  6. Restart Claude Code, then ask something like "review this Terraform module" or "migrate count to for_each safely" — the skill activates automatically.
  7. You can delete the temporary clone: rm -rf terraform-skill
  8. Safety note: always read the plan output yourself before running any apply, destroy, or state-mutating command the skill suggests.
View source on GitHubLicense: NOASSERTION