
Terraform Style Guide
hashicorp/agent-skillsOfficial
Style guide that generates and reviews Terraform HCL following HashiCorp's official conventions and best practices.
- CCM score
- 70 of 100
- skills.sh installs
- 13.8K
- GitHub stars
- 941
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers file organization, formatting, naming, variables, outputs, dynamic resources, version pinning, and provider configuration
- Includes a standard file layout (
terraform.tf,providers.tf,main.tf,variables.tf,outputs.tf,locals.tf) with example HCL for each - Enforces
for_eachovercountfor multiple resources, and requires type, description, and sensitive markings on variables and outputs - Designed for writing, reviewing, or generating Terraform configurations, with a pre-commit checklist using
terraform fmtandterraform validate
Install
$ npx -y skills add hashicorp/agent-skills --skill terraform-style-guide -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Terraform Style Guide
Generate and maintain Terraform code following HashiCorp's official style conventions and best practices.
Reference: HashiCorp Terraform Style Guide
Code Generation Strategy
When generating Terraform code:
- Start with provider configuration and version constraints
- Create data sources before dependent resources
- Build resources in dependency order
- Add outputs for key resource attributes
- Use variables for all configurable values
File Organization
| File | Purpose |
|---|---|
terraform.tf | Terraform and provider version requirements |
providers.tf | Provider configurations |
main.tf | Primary resources and data sources |
variables.tf | Input variable declarations (alphabetical) |
outputs.tf | Output value declarations (alphabetical) |
locals.tf | Local value declarations |
Example Structure
# terraform.tf
terraform {
required_version = ">= 1.14"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
}
Details
- Repository
- github.com/hashicorp/agent-skills
- Category
- DevOps & Cloud
More from hashicorp/agent-skills
All 16- Terraform Test9.5K
- Refactor Module6.9K
- Terraform Stacks5.9K
- Terraform Search Import5.2K
- Provider Resources4.3K
- New Terraform Provider4.1K
- Provider Actions4.1K
- Run Acceptance Tests3.9K
- Azure Verified Modules3.5K
- Provider Test Patterns3.5K
- Provider Docs3.4K
- Aws Ami Builder3.4K
- Push To Registry3.2K
- Azure Image Builder2.9K
- Windows Builder2.9K
Similar to Terraform Style Guide
More DevOps & Cloud
terraform-stackshashicorp/agent-skills5.9K installsComprehensive guide for authoring HashiCorp Terraform Stacks configuration files, components, and deployments.
terraform-generatorakin-ozer/cc-devops-skills726 installsGenerates validated Terraform HCL for resources, modules, providers, variables, and outputs with a mandatory validation loop.
terraform-infrastructuremanutej/luxor-claude-marketplace440 installsComprehensive Terraform guide covering providers, modules, state, and multi-cloud infrastructure-as-code patterns.
terraform-validatorakin-ozer/cc-devops-skills723 installsValidates Terraform/HCL files through formatting, linting, syntax, security scanning, and regression checks.
terraform-module-librarywshobson/agents16.4K installsReusable Terraform module patterns for AWS, Azure, GCP, and OCI with a standard file layout and tests.