terraform-style-guide

Generate Terraform HCL code following HashiCorp style conventions.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/benonions/dotfiles --skill terraform-style-guide-benonions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/benonions/dotfiles/tree/main/codex/.codex/skills/community/hashicorp-agent-skills/terraform/code-generation/skills/terraform-style-guide
Command: npx skills add https://github.com/benonions/dotfiles --skill terraform-style-guide-benonions

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 maintainable, readable, and robust infrastructure as code.

Core Features & Use Cases

  • Code Generation: Generates Terraform HCL code following established style guides.
  • Best Practice Enforcement: Provides guidance on file organization, naming conventions, variable usage, and security.
  • Use Case: When starting a new Terraform module or refactoring an existing one, use this Skill to generate a well-structured and compliant configuration file.

Quick Start

Generate a Terraform HCL configuration for an AWS VPC following HashiCorp style guidelines.

Frequently Asked Questions about terraform-style-guide

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

FAQPage Schema
How do I generate Terraform HCL code that follows HashiCorp style conventions?

Generate Terraform HCL code that follows HashiCorp style conventions by applying established rules for provider configuration, resource definition, variable and output declaration, dynamic resource creation, security hardening, and version pinning. This ensures your infrastructure as code remains maintainable and robust.

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

Best practices for organizing Terraform modules involve following official style guidelines for variable and output declaration, file organization, and naming conventions. Adhering to these standards improves code readability and facilitates easier code review and validation.

How do I apply security hardening and version pinning when writing infrastructure as code?

Apply security hardening and version pinning in infrastructure as code by generating Terraform configurations that explicitly lock provider versions and enforce secure resource definitions. This protects your cloud resources and prevents unexpected breaking changes from upstream updates.

Can I use this approach to refactor an existing Terraform configuration file?

You can refactor an existing Terraform configuration file by regenerating the code to align with official HashiCorp style guidelines. This process restructures file organization, naming conventions, and variable usage to produce a well-structured and compliant module.

What is the best way to validate Terraform code formatting against established style guides?

The best way to validate Terraform code formatting against style guides is to use established formatting and linting tools during code review. This ensures your generated HCL code adheres to official conventions and maintains high quality infrastructure as code.