terraform-style-guide

Standardize Terraform formatting, naming, and module organization with AVM requirements.

2|3|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/panchal-ravi/ai-iac-consumer-template --skill terraform-style-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/panchal-ravi/ai-iac-consumer-template/tree/main/.claude/skills/terraform-style-guide
Command: npx skills add https://github.com/panchal-ravi/ai-iac-consumer-template --skill terraform-style-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent Terraform code leads to reduced readability, increased maintenance overhead, and slower development cycles. This skill provides a comprehensive style guide, ensuring all your Terraform configurations adhere to best practices, improving collaboration, and maintaining high code quality across your infrastructure projects.

Core Features & Use Cases

  • Standardized Formatting: Apply consistent indentation, alignment, and block organization using terraform fmt.
  • Clear Naming Conventions: Follow best practices for naming resources, variables, and outputs for enhanced readability.
  • Structured File Organization: Organize your Terraform files logically for easy navigation and maintainability.
  • AVM Compliance: Adhere to Azure Verified Modules (AVM) requirements for robust Azure-specific module development.
  • Use Case: During a code review, use this skill to identify and correct naming inconsistencies in resource blocks, ensuring all names are descriptive, lowercase, and use underscores, aligning with team standards.

Quick Start

I need to format my Terraform code. Guide me on the best practices for indentation and alignment, and remind me of the command to automatically apply these formatting standards.

Frequently Asked Questions about terraform-style-guide

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

FAQPage Schema
How do I standardize Terraform code formatting across my team?

Terraform code formatting is standardized using `terraform fmt` to enforce consistent indentation, alignment, and block organization. This command automatically applies formatting standards across all configuration files, ensuring uniform style and improving readability for team collaboration.

What naming conventions should I follow for Terraform resources and variables?

Terraform naming conventions use lower_snake_case for all resources, variables, and outputs. This approach enhances readability and maintainability, ensuring descriptive names that clearly identify each component's purpose across your infrastructure projects.

How do I organize Terraform files for better maintainability?

Structured file organization groups Terraform configurations logically by function and environment, improving navigation and reducing maintenance overhead. Consistent organization supports easier code reviews, faster onboarding, and clearer separation between providers, resources, variables, and outputs.

What are the AVM requirements for Azure Terraform modules?

Azure Verified Modules (AVM) requires adherence to specific provider and module constraints, standardized metadata for variables and outputs, and consistent naming patterns. AVM compliance ensures robust, production-ready Azure modules that meet enterprise standards and integrate seamlessly across teams.

Can I validate my Terraform code quality automatically?

Terraform code quality is validated using `terraform validate` to check syntax and configuration correctness. Combined with formatting standards and naming conventions, automated validation catches errors early, reduces review cycles, and maintains consistent quality across multi-environment deployments.

Do I need style guides when working with infrastructure-as-code across multiple teams?

Infrastructure-as-code style guides are essential for multi-team environments because they reduce inconsistency, accelerate code reviews, and lower maintenance overhead. A comprehensive style guide ensures all team members follow the same standards for formatting, naming, file organization, and documentation.