terraform-style-guide

Generate and maintain Terraform HCL code following HashiCorp style conventions.

3|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/MehdiRtal/dotfiles --skill terraform-style-guide-mehdirtal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/MehdiRtal/dotfiles/tree/main/dot_agents/skills/terraform-style-guide
Command: npx skills add https://github.com/MehdiRtal/dotfiles --skill terraform-style-guide-mehdirtal

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 error-free infrastructure as code.

Core Features & Use Cases

  • Code Generation: Provides guidelines and examples for structuring and formatting Terraform configurations.
  • Best Practice Enforcement: Details naming conventions, variable usage, output definitions, and security considerations.
  • Use Case: When starting a new Terraform project or refactoring existing code, use this Skill to ensure consistency and adherence to industry standards.

Quick Start

Use the terraform-style-guide skill to generate a basic Terraform configuration for an AWS VPC.

Frequently Asked Questions about terraform-style-guide

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

FAQPage Schema
What are the best practices for structuring and formatting Terraform HCL code?

Terraform HCL code best practices involve following HashiCorp's official style conventions for code structure, naming, variable definitions, and provider configuration to ensure readable and maintainable infrastructure as code.

How do I write clean and consistent Terraform configurations for a new project?

Write clean Terraform configurations by applying guidelines for code generation, output definitions, dynamic resource creation, and security hardening to maintain consistency and adhere to industry standards.

Does this style guide cover security hardening and version pinning for infrastructure as code?

Yes, this Terraform style guide covers security hardening, version pinning, and provider configuration guidelines to satisfy requirements for secure and stable infrastructure as code deployments.

What is the best way to enforce naming conventions and variable usage in Terraform?

The best way to enforce Terraform naming conventions and variable usage is to apply detailed best practice rules during code generation and refactoring to maintain error-free infrastructure as code.

Can I use this style guide to refactor existing Terraform code?

Yes, you can use this style guide when refactoring existing Terraform code to ensure consistency, align with HashiCorp style conventions, and improve overall maintainability of your configurations.