Part of Platform & Security

Claude Code Skills for Infrastructure

Infrastructure work is where small decisions have outsized consequences. A misconfigured Terraform module or an under-provisioned database doesn't just cause a bug — it causes an outage. These skills help you review infrastructure code, plan migrations, optimize cloud costs, design network topologies, and manage the Kubernetes manifests and backup strategies that keep production running.

Published by ClaudeVaultLast updated 7 skills

Key takeaway

ClaudeVault's infrastructure skills give Claude Code structured workflows for the Terraform modules, Kubernetes manifests, network topologies, cloud cost reviews, backup strategies, and database migrations that keep production stable. They cover Terraform and OpenTofu review, Kubernetes 4C security hardening, FinOps-driven cost optimization, expand-contract schema migrations, and the 3-2-1-1-0 backup rule — turning Claude into an infrastructure reviewer that catches misconfigurations before they become outages.

At a glance

  • 7 skills spanning Terraform review, Kubernetes manifest hardening, network security design, backup strategy, cloud cost optimization, migration planning, and general infrastructure review
  • Covers the Terraform and OpenTofu ecosystem, which holds roughly 32.8 percent IaC market share with 4,800-plus providers and 26 million weekly downloads
  • Applies the Kubernetes 4C security model — Cloud, Cluster, Container, Code — with CIS Benchmark and Pod Security Standards enforcement
  • Uses FinOps principles to target the 30 to 40 percent of cloud spend that most organizations waste, with structured right-sizing, reserved instance, and scheduling recommendations
  • Implements the 3-2-1-1-0 backup rule: three copies, two media types, one offsite, one immutable, zero errors in recovery testing

When you reach for these skills

  • When Terraform modules were written once, deployed, and never reviewed for drift, deprecated providers, or over-permissive resource policies

  • When Kubernetes manifests run containers as root with no resource limits, network policies, or Pod Security Standards enforcement

  • When the monthly cloud bill keeps climbing but nobody can explain which workloads are over-provisioned or which reserved instances expired

  • When a database schema change needs to roll out across services without downtime and the team has no expand-contract migration playbook

How these skills work together

A Claude Code infrastructure pass moves from broad configuration review down to cost-specific and migration-specific concerns, catching the misconfigurations that monitoring alone cannot surface.

  1. 1

    Review the infrastructure codebase for misconfigurations

    Start with the infra reviewer. Claude scans Terraform files, Dockerfiles, Kubernetes manifests, and CI configuration for common misconfigurations — public S3 buckets, missing encryption at rest, permissive security group rules — and reports findings with severity and fix suggestions.

  2. 2

    Harden Terraform modules against drift and deprecation

    The Terraform reviewer checks HCL files specifically: pinned provider versions, state locking, module composition, and the HashiCorp BSL versus OpenTofu licensing question. Claude flags deprecated resources and suggests refactored module structures that scale without copy-paste drift.

  3. 3

    Lock down Kubernetes manifests with the 4C security model

    Use the Kubernetes manifest reviewer to enforce Pod Security Standards, resource limits, RBAC scoping, and network policies. Claude applies the 4C model — Cloud, Cluster, Container, Code — and references the CIS Kubernetes Benchmark for each finding.

  4. 4

    Identify cloud cost waste and right-size workloads

    The cost optimization advisor audits cloud spend against FinOps benchmarks. Claude identifies idle resources, recommends reserved instance or savings plan commitments, flags GPU workloads that should run on spot instances, and produces a prioritized savings roadmap.

  5. 5

    Plan the database migration with expand-contract safety

    Finally, the migration writer generates expand-contract migration scripts — additive schema changes first, consumer migration second, old column removal last — so the rollout is reversible at every stage and no service sees a broken schema during the transition.

Outcome

Infrastructure code reviewed for security and configuration drift, Terraform modules hardened against deprecation, Kubernetes manifests locked to CIS benchmarks, cloud costs mapped to a savings roadmap, and database migrations planned with reversible stages.

Compare the skills

SkillBest forComplexityPrimary use case
Infra ReviewerBroad infrastructure configuration auditsIntermediateCross-tool scan of Terraform, Docker, Kubernetes, and CI files
Terraform ReviewerHCL-specific review and module healthAdvancedProvider pinning, state locking, module refactoring, license compliance
Kubernetes Manifest ReviewerCluster security and resource governanceAdvancedPod Security Standards, RBAC, CIS Benchmark enforcement
Cost Optimization AdvisorCloud spend reductionIntermediateFinOps audit, right-sizing, reserved instances, and idle resource cleanup
Migration WriterZero-downtime schema evolutionAdvancedExpand-contract migration scripts with rollback checkpoints
Backup Strategy DesignerData protection and disaster readinessIntermediate3-2-1-1-0 backup plans with recovery testing schedules
Network Security DesignerNetwork topology and perimeter designAdvancedVPC layout, subnet segmentation, firewall rules, and zero-trust architecture

Skills in this topic

Migration Writer

Generates safe, reversible migration scripts with rollback plans and lock-time estimates. Use when writing schema changes, data transformations, or infrastructure transitions. Expand-contract, idempotent, batched backfill, pg_repack.

Write migration scripts as the engineer who has been paged at 2 AM because a migration dropped a column with live traffic.

Backup Strategy Designer

Designs backup systems with verification, retention schedules, and cross-region replication. Use when setting up backups, planning recovery testing, or implementing the 3-2-1 rule. RPO, snapshots, WAL archiving, restore drills.

Design backup systems assuming you will need to restore at the worst possible moment — during a cascading failure, with the senior DBA on vacation, at 2 AM.

Cost Optimization Advisor

Analyzes cloud spend to identify waste and right-size resources. Use when reviewing AWS/GCP/Azure bills, evaluating reserved instances vs spot, or finding idle infrastructure. FinOps, right-sizing, savings plans.

Analyze cloud spending to find the 20% of resources that account for 80% of waste.

Infra Reviewer

Reviews infrastructure-as-code for security, correctness, reliability, cost, and maintainability. Use when auditing Terraform, Kubernetes manifests, CloudFormation, or Helm charts. Public S3 buckets, IAM wildcards, missing health checks.

Audit IaC configurations to catch the S3 bucket with public ACLs before it reaches production.

Kubernetes Manifest Reviewer

Reviews Kubernetes manifests for production readiness. Use when auditing resource limits, health checks, security contexts, rolling update configs, or PodDisruptionBudgets. K8s YAML, Helm charts, Kustomize overlays.

Review K8s manifests assuming every missing configuration will eventually cause an outage.

Terraform Reviewer

Reviews Terraform code for security misconfigurations, state management risks, and module design anti-patterns. Use when auditing IAM policies, verifying remote state locking, or checking for drift-prone patterns. S3 backend, prevent_destroy, permission boundaries, provider pinning.

Review Terraform code as if a misconfiguration will cost the team a weekend of incident response.

Network Security Designer

Designs defense-in-depth network topologies with VPC segmentation, firewall rules, and zero-trust controls. Use when laying out subnet tiers, restricting east-west traffic, or hardening developer access paths. Security groups, mTLS, microsegmentation, VPC flow logs.

Design networks as if every internal service is one misconfiguration away from the internet.

Frequently asked questions

Can Claude Code review Terraform configurations?

Yes. The Terraform reviewer skill checks HCL files for pinned provider versions, state locking, deprecated resources, and module composition issues. Claude flags security misconfigurations, suggests refactored structures, and notes the Terraform BSL versus OpenTofu licensing distinction when it affects toolchain choices.

How does Claude Code handle Kubernetes security?

The Kubernetes manifest reviewer applies the 4C security model — Cloud, Cluster, Container, Code — and checks manifests against the CIS Kubernetes Benchmark. Claude enforces Pod Security Standards, flags containers running as root, verifies resource limits and network policies, and scopes RBAC to least privilege.

What is the difference between Terraform, OpenTofu, and Pulumi?

Terraform has the largest ecosystem at roughly 32.8 percent IaC market share and 4,800-plus providers. OpenTofu is a Linux Foundation fork under MPL 2.0, created after Terraform's 2023 BSL license change. Pulumi uses general-purpose programming languages like TypeScript and Python instead of HCL. The infrastructure skills work with all three.

How do I reduce cloud costs with Claude Code?

The cost optimization advisor runs a FinOps audit that identifies idle resources, recommends reserved instance commitments for 40 to 72 percent savings, right-sizes over-provisioned workloads for 15 to 25 percent savings, and schedules non-production environments to shut down outside business hours.

What is the 3-2-1-1-0 backup rule?

It extends the classic 3-2-1 rule with two additions: one immutable copy that ransomware cannot encrypt or delete, and zero errors verified through regular recovery testing. The backup strategy designer uses this framework to generate backup plans with explicit recovery time and recovery point objectives.

What is an expand-contract database migration?

A pattern that makes schema changes reversible. First, add the new column or table alongside the old one. Then migrate consumers one by one to use the new schema. Finally, remove the old column once all services have migrated. The migration writer generates scripts for each phase with explicit rollback steps.