Skip to main content
Guide9 min read·Updated July 11, 2026
🧩

Best AI Agent Skills for Infrastructure as Code in 2026

B

A. Frans

Published July 11, 2026

AI Agent SkillsInfrastructure as CodeTerraformDevOpsClaude Code

A Terraform plan that looks clean can still wreck an environment: a renamed resource that forces a replace, a module input that quietly drifts from the state, a for_each that expands to the wrong set of instances. The slow part of infrastructure work isn't writing HCL — it's reading the plan carefully enough to catch the one change that shouldn't be there. That review, cross-checking intent against what the plan actually does, is work an agent can take on if you give it the right context. The skills below do that. They teach an agent Terraform and OpenTofu conventions, wire it into HashiCorp's own provider and module data, and cover the surrounding DevOps surface so the agent understands the pipeline the code runs through, not just the syntax.

If you manage infrastructure as code in 2026, here are the skills worth installing. They run in Claude Code or as an MCP server, and I've flagged trust tier and license for each — IaC tooling sits close to production credentials and cloud state, so scope matters more here than with a typical coding helper.

The short list

SkillBest forTrust tierLicenseInstall target
HashiCorp Terraform MCPLive provider/module data from the sourceOfficialMPL-2.0MCP server
Terraform SkillModules, testing, and CI/CD conventionsVerifiedOtherClaude Code
DevOps SkillsDocker, K8s, CI/CD, and cloud togetherCommunityApache-2.0Claude Code
PigstyPostgres-as-IaC with HA and monitoringVerifiedApache-2.0Claude Code
DevOps ExercisesFoundations and interview-grade depthVerifiedOtherClaude Code

HashiCorp Terraform MCP — data straight from the source

Start here if you write Terraform daily. HashiCorp Terraform MCP (hashicorp/terraform-mcp-server, official, MPL-2.0, ~1.5k stars) is HashiCorp's own MCP server, so the agent pulls provider schemas, resource arguments, and module details from the canonical registry instead of guessing from whatever it saw in training.

claude mcp add terraform -- npx -y @hashicorp/terraform-mcp-server

The reason it's the first install is provider drift. Terraform providers ship breaking changes and new arguments constantly, and a model working from memory will confidently write a resource block for last year's schema. With the MCP server connected, the agent looks up the actual argument it needs for the version you're on — which nested block a aws_instance expects now, whether an argument moved or got deprecated. Being official also matters here in a way it doesn't everywhere: this is the vendor grounding its own tool in its own registry, which is about as trustworthy as source data gets.

Terraform Skill — modules, testing, and the CI/CD path

When you want the agent to reason about structure and not just single resources, Terraform Skill (antonbabenko/terraform-skill, verified, ~2.2k stars) is the pick. It's maintained by Anton Babenko, whose Terraform AWS modules the community has leaned on for years, and it covers testing, module design, and CI/CD patterns for both Terraform and OpenTofu.

claude skill add antonbabenko/terraform-skill

This is the one that changes how the agent writes, not just what it looks up. Left alone, a model tends to inline everything into one flat config; this skill pushes it toward composable modules, terraform test coverage, and the review habits that keep a codebase from rotting. The OpenTofu coverage matters too — plenty of teams moved off Terraform after the license change, and a skill that treats both as first-class saves you from advice that only applies to one. Check the repo's license file before you vendor it into a company project; it's listed as Other rather than a standard SPDX tag.

DevOps Skills — the whole pipeline in one install

IaC rarely lives alone. DevOps Skills (akin-ozer/cc-devops-skills, community, Apache-2.0, ~270 stars) bundles Docker, Kubernetes, CI/CD, and cloud guidance so the agent understands the environment your Terraform provisions, not only the HCL itself.

claude skill add akin-ozer/cc-devops-skills

Think of this as context for the blast radius. Terraform that stands up a cluster is only useful if the agent also grasps what runs on it — the container build, the pipeline that applies the plan, the cloud primitives underneath. This skill gives it that surrounding knowledge in one place, which is handy for the common case where one person owns provisioning and deployment both. It's community-tier and smaller than the featured picks, so treat its guidance as a solid default rather than gospel, and lean on the Terraform-specific skills above for the parts where precision counts.

Pigsty — Postgres as infrastructure, not an afterthought

Databases are where IaC gets scary, because a bad apply can mean data loss, not just a rebuild. Pigsty (pgsty/pigsty, verified, Apache-2.0, ~5.2k stars) is an enterprise-grade PostgreSQL distribution built the IaC way — high availability, point-in-time recovery, and monitoring declared as config the agent can read and reason about.

claude skill add pgsty/pigsty

This is the specialist pick, and it earns the slot because generic Terraform advice runs thin exactly where Postgres gets hard: failover, PITR, replication topology. Pigsty encodes those as a declarative stack, so the agent can help you stand up or adjust a production-grade database without you hand-assembling the HA and backup pieces from scratch. If your infrastructure includes a Postgres you care about, this is the difference between IaC that provisions a database and IaC that provisions one you'd trust on call.

DevOps Exercises — the foundations under all of it

Sometimes the gap isn't a missing tool, it's missing depth. DevOps Exercises (bregman-arie/devops-exercises, verified, ~83k stars) is a huge, well-worn collection covering Linux, AWS, Terraform, Ansible, Kubernetes, and the rest of the stack — the kind of reference that turns a vague answer into a correct one.

claude skill add bregman-arie/devops-exercises

It's the least flashy install here and arguably the most broadly useful. When the agent reaches the edge of what it knows — an Ansible idempotency question, a Linux permission quirk, the actual meaning of a Terraform state lock — this gives it a deep, battle-tested well to draw from. At ~83k stars it's one of the most starred DevOps resources anywhere, and pointing an agent at it is a cheap way to raise the floor on every ops answer it gives. Its license is tagged Other, so read the repo terms before redistribution.

How to choose

Match the install to what you're actually running:

  • Writing Terraform or OpenTofu daily: HashiCorp Terraform MCP for live schema data, add Terraform Skill for structure.
  • Building reusable modules with real test coverage: Terraform Skill first.
  • One person owning provisioning through deployment: DevOps Skills for the whole-pipeline context.
  • Running production PostgreSQL as code: Pigsty.
  • Raising the general depth of the agent's ops answers: DevOps Exercises.

If your remit is wider than IaC, our agent skills for DevOps engineers roundup covers the broader toolchain, agent skills for Kubernetes goes deep on the cluster side, and agent skills for incident response is the one to read for the on-call half of the job.

Plan and review before you ever apply

There's one operating rule that outranks tool choice: keep the agent on the read-and-propose side of the workflow, not the apply side. Let it write HCL, run terraform plan, and explain the diff — then a human reads the plan and runs the apply. IaC changes are not like editing a file you can undo; a terraform apply against production can destroy and recreate resources, drop a database, or rotate credentials, and some of that is irreversible. The safe pattern is credentials scoped to plan-and-read for the agent's phase, with apply gated behind human review and, ideally, a CI pipeline that requires approval. The MCP server and skills here are useful precisely because they make the plan trustworthy — treat that as the goal, and keep the destructive verb in human hands.

Trust notes for a category that touches production

IaC tooling operates next to cloud credentials and live state, so the trust bar sits high. The lineup reflects it: the anchor is HashiCorp's own official server, and the featured Terraform and Postgres picks are verified-tier with real maintainers behind them — Anton Babenko on the Terraform side, the Pigsty team on the database side. Two of the licenses (MPL-2.0, Apache-2.0) are clean permissive tags; two others (Terraform Skill, DevOps Exercises) are marked Other, which just means you should open the license file before bringing them into a commercial repo, not that anything's wrong.

The control that matters most isn't the tier, though — it's the credential. Whatever you install, the cloud provider's own IAM is the real seatbelt. Give the agent a role scoped to read and plan, keep apply behind review, and never hand it standing production write access as a convenience. A verified skill with an admin-scoped cloud token is still an admin-scoped cloud token. Let IAM, not the trust tier, be the thing standing between the agent and a bad apply.

FAQ

Skill or MCP server for Terraform — which do I need? A skill (claude skill add) teaches the agent conventions and patterns, like Terraform Skill's module and testing habits. An MCP server (claude mcp add) connects it live to a data source — HashiCorp's server pulls current provider and module schemas from the registry. Most setups want both: the MCP server for accurate resource arguments, a skill for how to structure the code.

Does this cover OpenTofu, not just Terraform? Yes. Terraform Skill treats OpenTofu as a first-class target alongside Terraform, which matters if your team migrated after the license change. The HashiCorp MCP server is Terraform-registry-focused, but the HCL and module concepts transfer directly to OpenTofu.

Can I stop the agent from applying changes to production? Yes, and you should. Give it cloud credentials scoped to read and plan only, so its IAM role physically can't apply. Let it generate the plan and explain the diff, then a human reviews and applies — ideally through a CI pipeline that requires approval.

Why is a PostgreSQL tool in an IaC roundup? Because Pigsty treats a production database as declarative infrastructure — HA, point-in-time recovery, and monitoring as config rather than a hand-built afterthought. Databases are the highest-stakes thing IaC provisions, and generic Terraform advice runs thin exactly where Postgres gets hard.

Are these safe to use with a company cloud account? The tools are, if you scope the access. Check each repo's license before vendoring (two here are tagged Other), run the agent under a plan-and-read IAM role, and keep apply behind human review. The risk in this category is almost never the skill itself — it's an over-broad cloud credential handed to any automated actor.

Share this article

📬

Get More AI Tool Guides

New comparisons and guides every week. Join thousands of professionals staying ahead of the AI curve.