Skip to main content
skill CX Codex

terraform-style-guide — Claude Code skill: HashiCorp Terraform

A skill that generates and validates Terraform code according to HashiCorp's official standards. Ensures consistent, secure, and readable HCL across your configurations.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hashicorp/agent-skills --skill terraform-style-guide -a claude-code
Open on GitHub

What terraform-style-guide does

terraform-style-guide provides a complete ruleset for organizing Terraform configs: file structure, code formatting, resource and variable naming, version management, and sensitive data handling. The skill draws from HashiCorp recommendations and includes examples for common scenarios—from basic AWS resources to dynamic creation with for_each and conditional deployments using count.

It covers file organization (Terraform, providers, variables, outputs in separate files), two-space indentation, equals-sign alignment, lowercase with underscores for all names. Examples show provider versioning, multi-region setup, and validation checks. Security guidance includes what to commit (.tf files and .terraform.lock.hcl), what to ignore (tfstate, .tfvars with secrets), and how to mark sensitive values.

Code quality relies on terraform fmt and terraform validate—the skill includes these in its review checklist.

What it helps with

  • Align existing Terraform code with HashiCorp standards
  • Generate a new configuration with proper file structure and formatting
  • Verify resource, variable, and output naming conventions
  • Set up provider and Terraform version constraints following best practices
  • Ensure sensitive data does not leak into version control

Example prompts for the agent

  • Generate a Terraform config for AWS VPC with two subnets following the style guide
  • Help me reformat this terraform.tf to match HashiCorp standards
  • Review my variables and outputs in main.tf: do they meet the recommendations for types and descriptions?

How to install terraform-style-guide

1Skills CLI (Vercel)

npx skills add hashicorp/agent-skills --skill terraform-style-guide -a claude-code

2Manually: put the files in place

~/.claude/skills/terraform-style-guide/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/terraform-style-guide/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about terraform-style-guide

How do I install terraform-style-guide in Claude Code?

Run npx skills add hashicorp/agent-skills --skill terraform-style-guide -a claude-code. The skill will load into ~/.claude/skills/terraform-style-guide/SKILL.md and be available in Claude Code.

What does terraform-style-guide do?

The skill helps you write Terraform configs according to HashiCorp's official standards: proper file organization, formatting, naming conventions, provider versioning, and security best practices.

Do I need additional tools for this skill to work?

The skill itself is a code generator and reference. For quality checks, run terraform fmt -recursive and terraform validate. You can also use tflint, checkov, or tfsec for linting and security scanning.

Similar skills

All skills for DevOps and infrastructure →

From the same set20

terraform-test Guides an agent through Terraform test files, scenarios, assertions, and plan or apply runs. Use it when checking modules, resources, and outputs. CX Codex +1 8,800installs refactor-module This skill turns a monolithic Terraform configuration into reusable modules with clear variables and outputs. Useful when one main.tf has grown too risky to touch. CX Codex +1 6,400installs terraform-stacks Guides AI coding assistants through HashiCorp Terraform Stacks syntax, component definitions, and multi-environment deployment configs. CX Codex +1 5,600installs terraform-search-import Discovers untracked cloud assets and sets up Terraform configuration for bulk state imports. Helpful during infrastructure migrations and audits. CX Codex +1 4,900installs provider-resources This skill guides Terraform resource and data source work with the Plugin Framework. Use it when adding resources, handling drift, or reviewing provider code. CX Codex +1 4,100installs provider-actions Guides implementation of Terraform Actions with the Plugin Framework for operations run around resource create, update, and destroy events. CX Codex +1 3,900installs new-terraform-provider A skill that walks the agent through bootstrapping a Terraform provider on the Plugin Framework, from directory layout to a passing build. CX Codex +1 3,900installs run-acceptance-tests Runs and investigates Terraform provider acceptance tests with the TestAcc prefix. Use it for missing environment variables, failed runs, or tests that pass when they should not. CX Codex +1 3,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor