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.
npx skills add Mindrally/skills --skill terraform -a claude-codeWhat 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.tfandvariables.tf - Configure an Azure Blob remote backend with state locking and encryption
- Audit this Terraform resource using
tflintrules and extract secrets into Vault
How to install terraform
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill terraform -a claude-code2Manually: put the files in place
~/.claude/skills/terraform/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/terraform/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill terraform -a codex2Manually: put the files in place
.agents/skills/terraform/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill terraform -a cursor2Manually: put the files in place
.cursor/skills/terraform/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills terraform2Manually: put the files in place
.github/skills/terraform/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill terraform -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path terraformManually: put the files in place
.devin/skills/terraform/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill terraform -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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