Agent skill

Terraform Style Check

by warpdotdev in warpdotdev/oz-skills

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

MITAuto-check passedDevOps & Cloud

Install Terraform Style Check

skills CLI
$ npx skills add warpdotdev/oz-skills --skill terraform-style-check -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install warpdotdev/oz-skills terraform-style-check --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/warpdotdev/oz-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/terraform-style-check .claude/skills/terraform-style-check && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
terraform-style-check
GitHub stars
825
Token cost
~1.9k tokens
SKILL.md length
343 words
Files
1
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 5 steps: Start with provider configuration and… → Create data sources before dependent… → Build resources in dependency order → …
  • Generating Terraform configurations
  • SKILL.md covers Code Generation Strategy, File Organization, Code Formatting and Naming Conventions, plus 9 more sections
  • Calls terraform

What it does

Terraform Style Check is an agent skill from warpdotdev/oz-skills. Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Infrastructure as code. It works with Terraform. The licence is MIT.

When your agent uses it

  • Generating Terraform configurations
  • Tasks that involve Infrastructure as code

Example prompts

  • “/terraform-style-check”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  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

What it can do on your machine

Read from SKILL.md and the folder at commit 6c08c49. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • terraform

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.hashicorp.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Terraform Style Check loads about 1.9k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 343 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from warpdotdev/oz-skills at commit 6c08c49, republished under its MIT licence (© warpdotdev). 343 words, ~1,871 tokens.

Download SKILL.mdSave it as .claude/skills/terraform-style-check/SKILL.md (or your agent's skills folder).
name
terraform-style-check
description
Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.
license
MIT

Terraform Style Guide

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

Reference: HashiCorp Terraform Style Guide

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

FilePurpose
terraform.tfTerraform and provider version requirements
providers.tfProvider configurations
main.tfPrimary resources and data sources
variables.tfInput variable declarations (alphabetical)
outputs.tfOutput value declarations (alphabetical)
locals.tfLocal value declarations
Example Structure
hcl
# terraform.tf
terraform {
  required_version = ">= 1.7"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

# variables.tf
variable "environment" {
  description = "Target deployment environment"
  type        = string

  validation {
    condition     = contains(["dev", "staging", "prod"], var.environment)
    error_message = "Environment must be dev, staging, or prod."
  }
}

# locals.tf
locals {
  common_tags = {
    Environment = var.environment
    ManagedBy   = "Terraform"
  }
}

# main.tf
resource "aws_vpc" "main" {
  cidr_block           = var.vpc_cidr
  enable_dns_hostnames = true

  tags = merge(local.common_tags, {
    Name = "${var.project_name}-${var.environment}-vpc"
  })
}

# outputs.tf
output "vpc_id" {
  description = "ID of the created VPC"
  value       = aws_vpc.main.id
}

Code Formatting

Indentation and Alignment
  • Use two spaces per nesting level (no tabs)
  • Align equals signs for consecutive arguments
hcl
resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
  subnet_id     = "subnet-12345678"

  tags = {
    Name        = "web-server"
    Environment = "production"
  }
}
Block Organization

Arguments precede blocks, with meta-arguments first:

hcl
resource "aws_instance" "example" {
  # Meta-arguments
  count = 3

  # Arguments
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"

  # Blocks
  root_block_device {
    volume_size = 20
  }

  # Lifecycle last
  lifecycle {
    create_before_destroy = true
  }
}

Naming Conventions

  • Use lowercase with underscores for all names
  • Use descriptive nouns excluding the resource type
  • Be specific and meaningful
hcl
# Bad
resource "aws_instance" "webAPI-aws-instance" {}
variable "name" {}

# Good
resource "aws_instance" "web_api" {}
variable "application_name" {}

Variables

Every variable must include type and description:

hcl
variable "instance_type" {
  description = "EC2 instance type for the web server"
  type        = string
  default     = "t2.micro"

  validation {
    condition     = contains(["t2.micro", "t2.small", "t2.medium"], var.instance_type)
    error_message = "Instance type must be t2.micro, t2.small, or t2.medium."
  }
}

variable "database_password" {
  description = "Password for the database admin user"
  type        = string
  sensitive   = true
}

Outputs

Every output must include description:

hcl
output "instance_id" {
  description = "ID of the EC2 instance"
  value       = aws_instance.web.id
}

output "database_password" {
  description = "Database administrator password"
  value       = aws_db_instance.main.password
  sensitive   = true
}

Dynamic Resource Creation

Prefer for_each over count
hcl
# Bad - count for multiple resources
resource "aws_instance" "web" {
  count = var.instance_count
  tags  = { Name = "web-${count.index}" }
}

# Good - for_each with named instances
variable "instance_names" {
  type    = set(string)
  default = ["web-1", "web-2", "web-3"]
}

resource "aws_instance" "web" {
  for_each = var.instance_names
  tags     = { Name = each.key }
}
count for Conditional Creation
hcl
resource "aws_cloudwatch_metric_alarm" "cpu" {
  count = var.enable_monitoring ? 1 : 0

  alarm_name = "high-cpu-usage"
  threshold  = 80
}

Security Best Practices

When generating code, apply security hardening:

  • Enable encryption at rest by default
  • Configure private networking where applicable
  • Apply principle of least privilege for security groups
  • Enable logging and monitoring
  • Never hardcode credentials or secrets
  • Mark sensitive outputs with sensitive = true
Example: Secure S3 Bucket
hcl
resource "aws_s3_bucket" "data" {
  bucket = "${var.project}-${var.environment}-data"
  tags   = local.common_tags
}

resource "aws_s3_bucket_versioning" "data" {
  bucket = aws_s3_bucket.data.id

  versioning_configuration {
    status = "Enabled"
  }
}

resource "aws_s3_bucket_server_side_encryption_configuration" "data" {
  bucket = aws_s3_bucket.data.id

  rule {
    apply_server_side_encryption_by_default {
      sse_algorithm     = "aws:kms"
      kms_master_key_id = aws_kms_key.s3.arn
    }
  }
}

resource "aws_s3_bucket_public_access_block" "data" {
  bucket = aws_s3_bucket.data.id

  block_public_acls       = true
  block_public_policy     = true
  ignore_public_acls      = true
  restrict_public_buckets = true
}

Version Pinning

hcl
terraform {
  required_version = ">= 1.7"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"  # Allow minor updates
    }
  }
}

Version constraint operators:

  • = 1.0.0 - Exact version
  • >= 1.0.0 - Greater than or equal
  • ~> 1.0 - Allow rightmost component to increment
  • >= 1.0, < 2.0 - Version range

Provider Configuration

hcl
provider "aws" {
  region = "us-west-2"

  default_tags {
    tags = {
      ManagedBy = "Terraform"
      Project   = var.project_name
    }
  }
}

# Aliased provider for multi-region
provider "aws" {
  alias  = "east"
  region = "us-east-1"
}

Version Control

Never commit:

  • terraform.tfstate, terraform.tfstate.backup
  • .terraform/ directory
  • *.tfplan
  • .tfvars files with sensitive data

Always commit:

  • All .tf configuration files
  • .terraform.lock.hcl (dependency lock file)

Validation Tools

Run before committing:

bash
terraform fmt -recursive
terraform validate

Additional tools:

  • tflint - Linting and best practices
  • checkov / tfsec - Security scanning

Code Review Checklist

  • Code formatted with terraform fmt
  • Configuration validated with terraform validate
  • Files organized according to standard structure
  • All variables have type and description
  • All outputs have descriptions
  • Resource names use descriptive nouns with underscores
  • Version constraints pinned explicitly
  • Sensitive values marked with sensitive = true
  • No hardcoded credentials or secrets
  • Security best practices applied

Based on: HashiCorp Terraform Style Guide

© warpdotdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/terraform-style-check of warpdotdev/oz-skills.

Open the folder on GitHubat commit 6c08c49

Compare with similar skills

Terraform Style Check next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Terraform Style Check compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Terraform Style Check this skillwarpdotdev/oz-skills825—~1.9kAutomated safety check: PassMIT
Terraform and OpenTofu Guideagentscope-ai/QwenPaw36k6 repos~4.2kAutomated safety check: PassApache-2.0
Terraform Skillantonbabenko/terraform-skill2.4k1 repos~5.1kAutomated safety check: PassApache-2.0
Review Docshashicorp/terraform-provider-aws11k—~1.3kAutomated safety check: PassMPL-2.0
Senior DevOps Toolkitmaslennikov-ig/claude-code-orchestrator-kit2606 repos~1.1kAutomated safety check: NotesCustom licence
Cloudflarehodgef/apiker1277 repos~2.2kAutomated safety check: PassMIT

Similar skills

  • Terraform and OpenTofu Guide

    agentscope-ai/QwenPaw

    Guidance for writing and testing Terraform and OpenTofu code: module structure, naming, test approaches, CI/CD workflows, state handling and security scanning.

    36k GitHub starsUsed in 6 repos~4.2k tokens
    DevOps & CloudAuto-check passed
  • Terraform Skill

    antonbabenko/terraform-skill

    A skill your agent uses when writing, reviewing, or debugging Terraform/OpenTofu modules, tests, CI, scans, or state ops - diagnoses failure mode (identity churn, secrets, blast radius, CI drift…

    2.4k GitHub starsUsed in 1 repo~5.1k tokens
    DevOps & CloudAuto-check passed
  • Review Docs

    hashicorp/terraform-provider-aws

    Official

    Review a Terraform AWS Provider PR's end-user documentation (website/docs//.markdown): whether docs are needed, description openings, argument/attribute style, section structure, tags wording, code…

    11k GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Senior DevOps Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…

    260 GitHub starsUsed in 6 repos~1.1k tokens
    DevOps & CloudAuto-check: notes
  • Cloudflare

    hodgef/apiker

    Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF…

    127 GitHub starsUsed in 7 repos~2.2k tokens
    DevOps & CloudAuto-check passed
  • Terravision Cloud Diagrams

    patrickchugh/terravision

    Draw cloud architecture diagrams for AWS, Azure or GCP with the official provider icon sets, using TerraVision.

    1.6k GitHub stars~5.6k tokensUpdated 3 days ago
    DevOps & CloudAuto-check: notes

More from warpdotdev/oz-skills

All 13 skills in this repo
  • SEO Aeo Audit

    warpdotdev/oz-skills

    Optimize for search engine visibility, ranking, and AI citations.

    825 GitHub stars~4.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Web Accessibility Audit

    warpdotdev/oz-skills

    Audit web applications for WCAG accessibility compliance. An agent skill from warpdotdev/oz-skills.

    825 GitHub stars~3.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Webapp Testing

    warpdotdev/oz-skills

    Test local web applications with Playwright. An agent skill from warpdotdev/oz-skills.

    825 GitHub stars~914 tokensUpdated 1 mo ago
    Auto-check passed
  • GitHub Bug Report Triage

    warpdotdev/oz-skills

    Triage GitHub bug reports for actionability. An agent skill from warpdotdev/oz-skills.

    825 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Analysis Artifacts

    warpdotdev/oz-skills

    Generate reproducible analysis artifacts — SQL queries, Python visualizations, and summary tables — as you work through a BigQuery data analysis.

    825 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed
  • CI Fix

    warpdotdev/oz-skills

    Diagnose and fix GitHub Actions CI failures. An agent skill from warpdotdev/oz-skills.

    825 GitHub stars~790 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Terraform Style Check

What does Terraform Style Check do?

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Terraform Style Check is an agent skill from warpdotdev/oz-skills. Generate Terraform HCL code following HashiCorp's official style conventions and best practices.

When should I use Terraform Style Check?

Terraform Style Check fits situations like: generating Terraform configurations; tasks that involve Infrastructure as code.

How do I install Terraform Style Check in Claude Code?

Run `npx skills add warpdotdev/oz-skills --skill terraform-style-check -a claude-code`. Or copy the skill folder (.agents/skills/terraform-style-check in warpdotdev/oz-skills) into .claude/skills/terraform-style-check in your project. Claude Code loads it when a task matches its description.

How do I install Terraform Style Check in Codex?

Run `npx skills add warpdotdev/oz-skills --skill terraform-style-check -a codex`. Or copy the skill folder (.agents/skills/terraform-style-check in warpdotdev/oz-skills) into .agents/skills/terraform-style-check in your project. Codex loads it when a task matches its description.

Can I use Terraform Style Check in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add warpdotdev/oz-skills --skill terraform-style-check -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/terraform-style-check, .gemini/skills/terraform-style-check, .github/skills/terraform-style-check and .opencode/skills/terraform-style-check in your project.

What does Terraform Style Check need to run?

Going by SKILL.md and its folder, Terraform Style Check needs the command-line tools its instructions call (terraform).

Does Terraform Style Check access the network?

SKILL.md names 1 domain. As links in the text: developer.hashicorp.com. This is read from the text; nothing was executed.

Is Terraform Style Check safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Terraform Style Check use?

Terraform Style Check is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Terraform Style Check use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Terraform Style Check?

Skills that share tags, products or a category with Terraform Style Check: Terraform and OpenTofu Guide (agentscope-ai/QwenPaw, 36k stars), Terraform Skill (antonbabenko/terraform-skill, 2.4k stars), Review Docs (hashicorp/terraform-provider-aws, 11k stars) and Senior DevOps Toolkit (maslennikov-ig/claude-code-orchestrator-kit, 260 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Terraform Style Check?

warpdotdev (a GitHub organization) maintains it in warpdotdev/oz-skills, which has 825 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on August 15, 2026.

Source: warpdotdev/oz-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.