terraform-style-guide

Enforce HashiCorp style conventions on Terraform HCL code.

4|8|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/pascalvanderheiden/code-under-construction-hackathon --skill terraform-style-guide-pascalvanderheiden
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/pascalvanderheiden/code-under-construction-hackathon/tree/main/.github/skills/terraform-style-guide
Command: npx skills add https://github.com/pascalvanderheiden/code-under-construction-hackathon --skill terraform-style-guide-pascalvanderheiden

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

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

Core Features & Use Cases

  • Style Enforcement: Provides guidelines and examples for consistent Terraform code formatting, organization, and naming.
  • Best Practice Integration: Incorporates security hardening, version pinning, and dynamic resource creation strategies.
  • Use Case: When generating new Terraform modules or reviewing existing configurations, use this Skill to ensure compliance with established standards, reducing the likelihood of errors and security vulnerabilities.

Quick Start

Review the provided Terraform code snippet for adherence to the HashiCorp style guide.

Frequently Asked Questions about terraform-style-guide

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

FAQPage Schema
How do I enforce HashiCorp style conventions when writing Terraform HCL code?

Enforce Terraform HCL style by applying guidelines for file organization, naming conventions, and formatting. Validate your infrastructure as code using built-in checks like `terraform fmt` and `terraform validate` to ensure compliance and reduce errors.

What are the best practices for organizing variables and outputs in Terraform modules?

Terraform module best practices involve structuring variables and outputs clearly, implementing security hardening, and using dynamic resource creation strategies. Adhering to these standards ensures your infrastructure as code remains maintainable, readable, and secure.

Can I use this style guide to review existing Terraform configurations?

Yes, you can review existing Terraform configurations against this style guide. It checks your HCL code for adherence to official standards, validating formatting and pinpointing areas where security hardening or version pinning is needed.

Does this Terraform style guide cover security hardening and version pinning?

Yes, this Terraform style guide covers security hardening and version pinning. It incorporates these best practices into your infrastructure as code generation to reduce the likelihood of errors and security vulnerabilities.

What is the best way to validate Terraform code formatting before deployment?

The best way to validate Terraform code formatting is by running `terraform fmt` and `terraform validate`. These tools enforce official HCL style conventions, ensuring your infrastructure as code is syntactically correct and consistently organized.