terraform-style-guide

Installation
Summary

Generate and maintain Terraform code following HashiCorp's official style conventions.

  • Enforces two-space indentation, lowercase underscore naming, and standard file organization across terraform.tf, providers.tf, main.tf, variables.tf, outputs.tf, and locals.tf
  • Requires type and description on all variables and outputs, with validation rules and sensitive flag support for credentials
  • Prioritizes for_each over count for dynamic resources, applies security hardening (encryption, private networking, least privilege), and prevents hardcoded secrets
  • Includes version pinning strategies, provider aliasing for multi-region deployments, and validation checklist for code review
SKILL.md

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:

  1. Start with provider configuration and version constraints
  2. Create data sources before dependent resources
  3. Build resources in dependency order
  4. Add outputs for key resource attributes
  5. Use variables for all configurable values

File Organization

| File | Purpose |

Related skills

More from hashicorp/agent-skills

Installs
4.5K
GitHub Stars
613
First Seen
Jan 26, 2026