Generate and maintain Terraform code following HashiCorp's official style conventions.
Works with
Enforces two-space indentation, lowercase underscore naming, and standard file organization across terraform.tf , providers.tf , main.tf , variables.tf , outputs.tf , and locals.tf
Requires type and description on all variables and outputs, with validation rules and sensitive flag support for credentials
Prioritizes for_each over count for dynamic resources, applies security hardening (encryption,
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionterraform-style-guideExecute the skills CLI command in your project's root directory to begin installation:
Fetches terraform-style-guide from hashicorp/agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate terraform-style-guide. Access via /terraform-style-guide in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
522
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
522
stars
Generate and maintain Terraform code following HashiCorp's official style conventions and best practices.
Reference: HashiCorp Terraform Style Guide
When generating Terraform code:
| 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 |
# 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
}
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
subnet_id = "subnet-12345678"
tags = {
Name = "web-server"
Environment = "production"
}
}
Arguments precede blocks, with meta-arguments first:
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
}
}
main for resources where a specific descriptive name is redundant or unavailable, provided only one instance exists# Bad
resource "aws_instance" "webAPI-aws-instance" {}
resource "aws_instance" "web_apis" {}
variable "name" {}
# Good
resource "aws_instance" "web_api" {}
resource "aws_vpc" "main" {}
variable "application_name" {}
Every variable must include type and description:
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
}
Every output must include description:
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
}
# 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 }
}
resource "aws_cloudwatch_metric_alarm" "cpu" {
count = var.enable_monitoring ? 1 : 0
alarm_name = "high-cpu-usage"
threshold = 80
}
When generating code, apply security hardening:
sensitive = trueresource "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" Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
terraform-skill
2antonbabenko/terraform-skill
Cloudtag: terraformterraform-skill
2sickn33/antigravity-awesome-skills
Cloudtag: terraformpython-code-style
9wshobson/agents
Backendtag: stylelogo-design-guide
4inference-sh/skills
Frontendtag: guidenovel-writer-workflow-guide
4wordflowlab/novel-writer-skills
Frontendtag: guidevideo-prompting-guide
4inferen-sh/skills
Frontendtag: guideReviews
4.7★★★★★26 reviews- SShikha Mishra★★★★★Dec 28, 2024
terraform-style-guide has been reliable in day-to-day use. Documentation quality is above average for community skills.
- CCamila Thompson★★★★★Dec 28, 2024
terraform-style-guide fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- YYash Thakker★★★★★Nov 19, 2024
Solid pick for teams standardizing on skills: terraform-style-guide is focused, and the summary matches what you get after install.
- OOmar Robinson★★★★★Nov 19, 2024
Registry listing for terraform-style-guide matched our evaluation — installs cleanly and behaves as described in the markdown.
- SSakshi Patil★★★★★Nov 15, 2024
terraform-style-guide reduced setup friction for our internal harness; good balance of opinion and flexibility.
- DDhruvi Jain★★★★★Oct 10, 2024
We added terraform-style-guide from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- LLuis Chen★★★★★Oct 10, 2024
Keeps context tight: terraform-style-guide is the kind of skill you can hand to a new teammate without a long onboarding doc.
- CChaitanya Patil★★★★★Oct 6, 2024
I recommend terraform-style-guide for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- KKofi Tandon★★★★★Sep 5, 2024
terraform-style-guide fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- KKofi Nasser★★★★★Aug 24, 2024
terraform-style-guide is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
showing 1-10 of 26
1 / 3Discussion
Comments — not star reviews- No comments yet — start the thread.