terraform-best-practices
Skill by terramate-io
Gives an AI assistant Terraform and OpenTofu best practice guidelines for writing, reviewing, and refactoring infrastructure code. Published by Terramate for teams working on modules, state, and IaC optimization.
Install terraform-best-practices
Built from the published package, never by AI.
git clone --depth 1 https://github.com/terramate-io/agent-skills /tmp/agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agent-skills/skills/terraform-best-practices ~/.claude/skills/terraform-best-practicesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install terraform-best-practices in Claude Code
git clone --depth 1 https://github.com/terramate-io/agent-skills /tmp/agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agent-skills/skills/terraform-best-practices ~/.gemini/antigravity-cli/skills/terraform-best-practicesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install terraform-best-practices in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill is a set of Terraform and Infrastructure as Code optimization guidelines published by Terramate. It contains 37 rules across 10 categories, ranked by impact. The categories cover organization and workflow, state management, security, module design, resource organization, variables and outputs, language practices, provider configuration, performance, and testing.
The skill is meant to guide an assistant when it writes, reviews, or refactors Terraform and OpenTofu code, and when it works on modules, infrastructure provisioning, state management, or IaC optimization. Each rule has its own file with an incorrect and a correct code example. A full compiled document with all rules expanded is provided as AGENTS.md. The skill is licensed under MIT.
Written from the project's SKILL.md and checked against it.
What it can do
- Organization and workflow rulesCovers version control, workspaces per environment, access control, change workflow and audit logging.
- State management rulesCovers remote backends, state locking and importing existing infrastructure into Terraform.
- Security rulesCovers no hardcoded secrets, credential management with OIDC or Vault, and least privilege IAM.
- Module design rulesCovers single responsibility, naming conventions, module versioning, composition and registry use.
- Resource organization rulesCovers naming, tagging for cost tracking, lifecycle blocks, for_each over count and immutable patterns.
- Variable and output rulesCovers typed variables, validation, sensitive values, descriptions and not outputting secrets.
- Language and provider rulesCovers jsonencode over HEREDOC, locals, terraform fmt and tflint, data sources, and pinned provider versions.
- Performance and testing rulesCovers parallelism tuning, debug logging, a testing pyramid and policy-as-code checks such as OPA or Checkov.
Try asking
- Review this Terraform module for security issues and hardcoded secrets
- Refactor this main.tf to use for_each instead of count
- Suggest a remote state backend setup with state locking
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/terraform-best-practices/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to terraform-best-practices
All alternatives →Runs the full Next.js deployment test suite for an internal vercel/next.js pull request. It validates the commit's preview package, then dispatches the test_e2e_deploy_release.yml workflow. Meant for maintainers who explicitly ask for the entire suite.
Instruments Python AI applications with DeepEval's native tracing so their execution appears span by span in Confident AI's Observatory. It is for developers building LLM apps, agents, RAG pipelines and chatbots.
Manages Azure Container Registry through the az acr Azure CLI command group. It covers registries, images, cloud builds, ACR Tasks, tokens, geo-replication and networking. Built for developers and operators who work with ACR in Azure.
Opens, runs, and shows apps on a temporary Crabbox machine, including native desktops and web previews. It is for OpenClaw users who want an app running and visible in their chat side panel.
Runs batch and HPC workloads on GKE using job queues and parallel processing. Aimed at teams running batch pipelines, HPC simulations, or ML training jobs on Google Kubernetes Engine.
Answers questions about GKE cluster and workload costs using BigQuery billing exports and live cluster metrics. Built for platform engineers and cloud teams who need to analyze and diagnose GKE spend.
Compare with deploy-release-test, deepeval-tracing or azure-container-registry-cli
terraform-best-practices: common questions
What does terraform-best-practices cover?
It covers 37 rules in 10 categories, from organization and workflow to security, modules, variables, language, providers, performance and testing. The rules are ranked by impact.
Does it work with OpenTofu?
The skill description says it is for writing, reviewing, or refactoring Terraform/OpenTofu code. It targets both tools.
Where are the full rule details?
Each rule has its own file under the rules folder, and the full compiled guide with all rules expanded is in AGENTS.md.
How do I install terraform-best-practices?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is terraform-best-practices free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is terraform-best-practices safe to use?
It scores 72 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to terraform-best-practices?
Similar skills: deploy-release-test, deepeval-tracing, azure-container-registry-cli, crabbox-apps.
