terraform-style-guide

Generate and review Terraform HCL code following HashiCorp style conventions.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/digitalhand/claude-skills-agents --skill terraform-style-guide-digitalhand
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/digitalhand/claude-skills-agents/tree/main/skills/terraform-style-guide
Command: npx skills add https://github.com/digitalhand/claude-skills-agents --skill terraform-style-guide-digitalhand

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures your Terraform HCL code adheres to HashiCorp's official style conventions and best practices, leading to more readable, maintainable, and secure infrastructure as code.

Core Features & Use Cases

  • Code Generation Guidance: Provides a structured approach to writing Terraform configurations, from provider setup to resource definition.
  • Style Enforcement: Details best practices for indentation, alignment, naming conventions, and block organization.
  • Security Best Practices: Highlights essential security measures like encryption, least privilege, and avoiding hardcoded secrets.
  • Use Case: When writing a new Terraform module for an AWS VPC, use this Skill to ensure all resources, variables, and outputs follow the recommended structure and naming conventions.

Quick Start

Generate Terraform HCL code for an AWS S3 bucket following HashiCorp's style guide.

Frequently Asked Questions about terraform-style-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for structuring Terraform HCL code?▼

Terraform HCL best practices include following official style conventions for code structure, formatting, naming, variable and output definitions, and block organization to ensure readable and maintainable infrastructure as code.

How do I enforce naming conventions in Terraform modules?▼

Enforce Terraform naming conventions by applying HashiCorp's official style guide rules for resource definitions, variables, and outputs, ensuring consistent indentation, alignment, and block organization across your modules.

How do I secure Terraform configurations and avoid hardcoded secrets?▼

Secure Terraform configurations by applying security best practices like encryption, least privilege access, and avoiding hardcoded secrets, ensuring your infrastructure as code remains protected and compliant.

Does this style guide cover dynamic resource creation and provider pinning in HCL?▼

Yes, this Terraform style guide covers dynamic resource creation, version pinning, and provider configuration, validating your HCL code structure against HashiCorp's official conventions using formatting and validation checks.

What is the best way to validate Terraform code formatting and syntax?▼

The best way to validate Terraform code is by running `terraform fmt` for formatting and `terraform validate` for syntax checks, ensuring your HCL adheres to official style conventions and best practices.

Can I generate new AWS resources following HashiCorp's Terraform style guide?▼

Yes, you can generate Terraform HCL code for AWS resources like S3 buckets or VPCs, ensuring all resources, variables, and outputs follow the recommended structure and naming conventions from the style guide.