terraform-style-guide

Generate Terraform HCL following HashiCorp style conventions.

47|5|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/Cloudgeni-ai/opengeni --skill terraform-style-guide-cloudgeni-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/Cloudgeni-ai/opengeni/tree/main/packages/runtime/src/bundled_hashicorp_terraform_skills/terraform-style-guide
Command: npx skills add https://github.com/Cloudgeni-ai/opengeni --skill terraform-style-guide-cloudgeni-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of inconsistent, hard-to-review Terraform code by providing a reliable, HashiCorp-aligned style and structure you can follow every time.

Core Features & Use Cases

  • Consistent code layout: Produces a predictable file organization (terraform.tf, providers.tf, main.tf, variables.tf, outputs.tf, locals.tf) to improve readability and collaboration.
  • Idiomatic conventions: Enforces naming, indentation, block ordering, and formatting patterns that match common Terraform best practices.
  • Practical safety defaults: Encourages secure handling (no hardcoded secrets, sensitive outputs, principle of least privilege) and promotes validation for variables.

Quick Start

Use the terraform-style-guide skill to generate Terraform HCL for a new deployment following HashiCorp style conventions.

Frequently Asked Questions about terraform-style-guide

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

FAQPage Schema
How do I structure Terraform modules to follow HashiCorp style conventions?

Terraform modules following HashiCorp style conventions use a predictable file organization, separating providers, data sources, resources, variables, locals, and outputs into distinct files like main.tf and variables.tf to improve readability and collaboration.

What are the best practices for writing secure Terraform HCL configurations?

Secure Terraform HCL configurations enforce the principle of least privilege, avoid hardcoded secrets, mark sensitive outputs appropriately, and implement variable validation to prevent insecure deployments.

How do I enforce consistent naming and formatting rules in Terraform code?

Consistent Terraform code relies on enforcing idiomatic naming conventions, indentation, and block ordering that match common infrastructure as code best practices, reducing the risk of inconsistent and hard-to-review configurations.

Does this style guide apply to generating Terraform for existing infrastructure?

The style guide applies when writing, reviewing, or generating Terraform HCL for modules, ensuring any new deployment or refactored infrastructure matches HashiCorp's formatting rules and security best practices.

Why does my Terraform code require variable descriptions and validation?

Terraform code requires variable descriptions and validation to enforce security best practices and ensure correct inputs, producing predictable, reliable infrastructure as code deployments that align with HashiCorp style conventions.

What is the best way to organize Terraform files for improved collaboration?

The best way to organize Terraform files is using a standard layout like terraform.tf, providers.tf, main.tf, variables.tf, and outputs.tf, which enforces predictable module structure and enhances team collaboration.