Skip to main content
skill CX Codex

terraform — Claude Code skill: what it does, how to install

Guides the agent on writing clean Terraform configurations, managing remote state locks, and storing secrets across cloud environments.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill terraform -a claude-code
Open on GitHub

What terraform does

This skill establishes strict infrastructure-as-code guidelines for the agent. It instructs the model to split manifests across main.tf, variables.tf, and outputs.tf. Code belongs in reusable modules with pinned provider versions.

State files require remote backends such as S3 or Azure Blob with active encryption and lock mechanisms. Hardcoded passwords or tokens are forbidden: secrets must come from Vault, AWS Secrets Manager, or Azure Key Vault. Without local linters like tflint or terrascan, you will have to run security checks manually.

What it helps with

  • organize Terraform files into main.tf, variables.tf, and modules
  • configure remote state storage in S3 or GCS with locking
  • pull credentials from AWS Secrets Manager or Vault
  • prepare IAM roles following least privilege access

Example prompts for the agent

  • Generate an S3 bucket module structured into main.tf and variables.tf
  • Configure an Azure Blob remote backend with state locking and encryption
  • Audit this Terraform resource using tflint rules and extract secrets into Vault

How to install terraform

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill terraform -a claude-code

2Manually: put the files in place

~/.claude/skills/terraform/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/terraform/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about terraform

How to install terraform in Claude Code?

Run npx skills add Mindrally/skills --skill terraform -a claude-code. Alternatively, place the file directly at ~/.claude/skills/terraform/SKILL.md.

What does the terraform skill do?

It instructs your AI coding agent to enforce module modularity, remote backend encryption, and IAM least-privilege policies.

Which cloud platforms does this skill support?

The instructions cover configurations and security guidelines for AWS, Azure, and GCP.

Source text

SKILL.md · Apache-2.0
---
name: terraform
description: Expert in Terraform infrastructure-as-code with cloud deployment patterns
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# Terraform

You are an expert in Terraform and infrastructure-as-code with deep knowledge of cloud providers and deployment patterns.

## Core Principles

- Write concise, well-structured Terraform code with accurate examples
- Organize infrastructure into reusable modules
- Use versioned modules and provider version locks for consistent deployments
- Avoid hardcoded values; leverage variables for flexibility

## Code Structure

- Structure configurations into logical sections:
  - main.tf - Primary resource definitions
  - variables.tf - Input variable declarations
  - outputs.tf - Output values
  - modules/ - Reusable modules

## State Management

- Implement remote backends (S3, Azure Blob, GCS) for state management
- Enable state locking to prevent concurrent modifications
- Enable encryption for state files
- Separate state files across environments using workspaces or different backends
- Maintain backup procedures for state files
- Use `terraform state` commands for resource inspection and migration

## Best Practices

- Run `terraform fmt` for consistent formatting
- Use validation tools like `tflint` or `terrascan`
- Store secrets in Vault, AWS Secrets Manager, or Azure Key Vault
- Use data sources for dynamic values
- Implement proper tagging strategies

## Security

- Define access controls and security groups for resources
- Follow cloud-provider security guidelines for AWS, Azure, and GCP
- Encrypt state at rest
- Use IAM roles and policies appropriately
- Implement least privilege access

## Collaboration & Production

- Implement rollback mechanisms
- Use approval workflows for production deployments
- Monitor state consistency and address drift issues
- Use resource targeting to optimize changes
- Reference official Terraform Cloud documentation for enterprise workflows

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

All skills for DevOps and infrastructure →

From the same set214

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor