terraform-style-guide

Generates Terraform HCL code following HashiCorp style conventions and security practices.

1|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/anyscale/terraform-provider-anyscale --skill terraform-style-guide-anyscale
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terraform-style-guide
Source: https://github.com/anyscale/terraform-provider-anyscale/tree/main/.claude/skills/terraform-style-guide
Command: npx skills add https://github.com/anyscale/terraform-provider-anyscale --skill terraform-style-guide-anyscale

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Terraform configurations that are inconsistent, insecure, or hard to maintain is a common problem for infrastructure teams. This Skill enforces HashiCorp's official style conventions and security best practices whenever Terraform HCL code is written, reviewed, or generated. ## Core Features & Use Cases - Standardized Code Generation: Produces Terraform code with correct file organization (terraform.tf, providers.tf, main.tf, variables.tf, outputs.tf), two-space indentation, aligned equals signs, and proper block ordering. - Naming and Structure Conventions: Enforces lowercase-with-underscores naming, singular descriptive resource names, required type and description fields on variables, and for_each over count for multiple resources. - Security Hardening: Applies encryption at rest, private networking, least-privilege access, sensitive output marking, and ephemeral resources with write-only attributes to keep secrets out of state. - Use Case: When asked to create an AWS VPC with Terraform, the Skill generates version-pinned provider configuration, validated input variables, tagged resources, and described outputs that pass terraform fmt and terraform validate. ## Quick Start Ask the AI to generate a Terraform configuration for an AWS VPC with an EKS cluster following the HashiCorp style guide.

Frequently Asked Questions about terraform-style-guide

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

FAQPage Schema
How do I write Terraform code following HashiCorp style conventions?▼

Use two-space indentation, align equals signs, place meta-arguments first and lifecycle blocks last, and organize files into terraform.tf, providers.tf, main.tf, variables.tf, and outputs.tf. Run terraform fmt and terraform validate before committing.

How to keep secrets out of Terraform state files?▼

Prefer native secrets manager integration like RDS manage_master_user_password. Otherwise use ephemeral resources with write-only attributes such as password_wo, which requires Terraform 1.11 or newer. Mark sensitive outputs with sensitive = true as a baseline.

Should I use count or for_each in Terraform resources?▼

Use for_each with a set or map when creating multiple named resources, since it tracks instances by key and avoids reordering issues. Reserve count for conditional creation, such as count = var.enable_monitoring ? 1 : 0.

What Terraform version is required for ephemeral resources?▼

Ephemeral resources require Terraform version 1.11.0 or newer. Before generating ephemeral resource code, verify the Terraform version constraint, and fall back to regular resources with sensitive flags on older versions.

What files should never be committed to Terraform version control?▼

Never commit terraform.tfstate, terraform.tfstate.backup, the .terraform directory, .tfplan files, or .tfvars files containing sensitive data. Always commit .tf configuration files and the .terraform.lock.hcl dependency lock file.