Terraform Style Guide

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

910 stars 134 forksDevOps & CloudOfficial

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add hashicorp/agent-skills --skill terraform-style-guide
Manual install
git clone --depth 1 https://github.com/hashicorp/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/plugins/terraform/skills/terraform-style-guide ~/.claude/skills/terraform-style-guide

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Terraform Style Guide

Generate and maintain Terraform code following HashiCorp's official style conventions and best practices.

**Reference:** [HashiCorp Terraform Style Guide](https://developer.hashicorp.com/terraform/language/style)

## Code Generation Strategy

When generating Terraform code:

1. Start with provider configuration and version constraints
2. Create data sources before dependent resources
3. Build resources in dependency order
4. Add outputs for key resource attributes
5. Use variables for all configurable values

## File Organization

| File | Purpose |
|------|---------|
| `terraform.tf` | Terraform and provider version requirements |
| `providers.tf` | Provider configurations |
| `main.tf` | Primary resources and data sources |
| `variables.tf` | Input variable declarations (alphabetical) |
| `outputs.tf` | Output value declarations (alphabetical) |
| `locals.tf` | Local value declarations |

### Example Structure
Read the full skill on GitHub

Details

Skill name
terraform-style-guide
Path
plugins/terraform/skills/terraform-style-guide/SKILL.md
License
MPL-2.0
Repo updated
28 October 2026

FAQ

What does the Terraform Style Guide skill do?

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

How do I install the Terraform Style Guide skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add hashicorp/agent-skills --skill terraform-style-guide. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Terraform Style Guide popular?

It lives in hashicorp/agent-skills, which has 910 GitHub stars and 134 forks, and is included in 2 curated skill lists.

Related skills

New Terraform Provider

910

hashicorp/agent-skills

Use this when scaffolding a new Terraform provider with the Plugin Framework: workspace layout, go module setup, provider server main.go, and a provider.go with schema and Configure. Also use when a user wants to start building a provider for a new API or asks how to begin a terraform-provider-* project.

DevOps & CloudIn 2 lists134

Provider Resources

910

hashicorp/agent-skills

Implement Terraform Provider resources and data sources using the Plugin Framework: CRUD operations, schema design, plan modifiers and validators, not-found handling, waiters for eventually consistent APIs, import support, resource design principles, and required acceptance test coverage. Use when adding or changing a resource or data source, deciding whether an API concept should be a resource, wiring a resource to the provider's configured client, handling drift or resource-not-found, or reviewing a resource implementation before submission.

Software DevelopmentIn 2 lists134

Provider Test Patterns

910

hashicorp/agent-skills

Terraform provider acceptance test patterns using terraform-plugin-testing with the Plugin Framework. Covers test structure, TestCase/TestStep fields, ConfigStateChecks with custom statecheck.StateCheck implementations, plan checks, CompareValue for cross-step assertions, config helpers, import testing with ImportStateKind, sweepers, and scenario patterns (basic, update, disappears, validation, regression), and ephemeral resource testing with the echoprovider package. Use when writing, reviewing, or debugging provider acceptance tests, including questions about statecheck, plancheck, TestCheck

Testing & QAIn 2 lists134

Drawthe.net

1.2k

cidrblock/drawthe.net

Draw network/architecture diagrams (AWS, Azure, Cisco) from a natural-language description or from a proposed system architecture, using the drawthe.net MCP server's YAML DSL and icon tools. Use this skill whenever the user asks to "draw a diagram", "create an architecture diagram", "visualize this infrastructure", "sketch the network", or asks you to propose/illustrate a system design.

DevOps & Cloud134

Terraform Stacks

910

hashicorp/agent-skills

Comprehensive guide for working with HashiCorp Terraform Stacks. Use when creating, modifying, or validating Terraform Stack configurations (.tfcomponent.hcl, .tfdeploy.hcl files), working with stack components and deployments from local modules, public registry, or private registry sources, managing multi-region or multi-environment infrastructure, or troubleshooting Terraform Stacks syntax and structure.

DevOps & CloudIn 2 lists134

Assessment Validity Checker

932

GarethManning/education-agent-skills

Audit a proposed assessment for construct validity, reliability, and alignment to learning objectives. Use when reviewing or quality-assuring assessments before deployment.

DevOps & CloudIn 1 list131

Browse the most popular Claude skills, all devops & cloud skills, or write your own with the skills generator.