terraform-style

Enforce Terraform HCL coding and formatting standards for shared modules.

1|Updated Mar 20, 2025
One-click install
npx skills add https://github.com/asanexample/platform --skill terraform-style-asanexample
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-style
Source: https://github.com/asanexample/platform/tree/main/.claude/skills/terraform-style
Command: npx skills add https://github.com/asanexample/platform --skill terraform-style-asanexample

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tofu, terragrunt, tofu fmt, terragrunt hcl fmt, and includes scripts (resource) components.

What problem does it solve?

This Skill enforces consistent coding conventions and style guidelines for Terraform HCL code in shared modules, ensuring code quality and maintainability.

Core Features & Use Cases

  • Code Formatting: Standardizes code layout, naming conventions, and formatting rules.
  • Resource Organization: Groups resources under clear section headers for better readability.
  • Provider Configuration: Ensures proper version pinning and configuration management.
  • Use Case: When developing a large Terraform-based infrastructure, use this Skill to maintain consistent coding standards across your team.

Quick Start

Use the terraform-style skill to check the formatting of your Terraform code in the 'main.tf' file.

Frequently Asked Questions about terraform-style

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

FAQPage Schema
How do I enforce consistent Terraform HCL code style for shared modules?

To enforce consistent Terraform HCL code style for shared modules, standardize your resource organization, provider configuration, and code formatting rules. This ensures infrastructure as code maintainability and readability across your team.

How do I format and validate Terraform infrastructure as code automatically?

You format and validate Terraform infrastructure as code automatically by running tofu fmt, terragrunt hcl fmt, and tofu validate. This sequence checks code layout, enforces formatting rules, and validates your configuration.

Does this Terraform formatting approach work with Terragrunt and OpenTofu?

Yes, this Terraform formatting approach works with Terragrunt and OpenTofu. It explicitly requires terragrunt hcl fmt, tofu fmt, and tofu validate as dependencies to enforce coding conventions and standardize infrastructure as code.

What is the best way to organize resources in Terraform shared modules?

The best way to organize resources in Terraform shared modules is grouping them under clear section headers for better readability. Standardizing code layout and provider configuration ensures consistent coding conventions.

Why do I need tofu fmt and terragrunt hcl fmt for Terraform code style?

You need tofu fmt and terragrunt hcl fmt for Terraform code style because they standardize code layout and enforce formatting rules. Using these tools ensures proper version pinning and consistent configuration management.

When should I standardize Terraform provider configuration and version pinning?

You should standardize Terraform provider configuration and version pinning when developing large Terraform-based infrastructure for shared modules. This ensures code quality, maintainability, and consistent infrastructure as code deployment.