terraform
/terraform
This skill should be used when writing or reviewing Terraform code, or when the project uses "Terraform", "HCL", "tfvars", "aws_iam_role", "data sources", or infrastructure-as-code patterns. Provides Terraform coding conventions, patterns, and best practices. Project-specific conventions always take priority.
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
This skill should be used when writing or reviewing Terraform code, or when the project uses "Terraform", "HCL", "tfvars", "aws_iam_role", "data sources", or infrastructure-as-code patterns. Provides Terraform coding conventions, patterns, and best practices. Project-specific conventions always take priority.
Triggers from the description
Original author description
This skill should be used when writing or reviewing Terraform code, or when the project uses "Terraform", "HCL", "tfvars", "aws_iam_role", "data sources", or infrastructure-as-code patterns. Provides Terraform coding conventions, patterns, and best practices. Project-specific conventions always take priority.
How it works
- General Conventions
- Resource Naming
- File Organization
- Variable Definitions
- Resource Arguments
- AWS-Specific
SKILL.md preview
---
name: terraform
description: This skill should be used when writing or reviewing Terraform code, or when the project uses "Terraform", "HCL", "tfvars", "aws_iam_role", "data sources", or infrastructure-as-code patterns. Provides Terraform coding conventions, patterns, and best practices. Project-specific conventions always take priority.
version: 0.1.0
---
# Terraform Conventions
Coding conventions and best practices for Terraform projects. Project-specific conventions (CLAUDE.md, style guides) always take priority over this guidance.
## General Conventions
- Prefer data sources over hardcoded values (e.g., `data.aws_region.current`, `data.aws_caller_identity.current`)
- Use locals for computed values and merging configuration
- Use `jsonencode` to compose JSON objects instead of raw string literals
## Resource Naming
- Use snake_case for all resource names and variables, with exceptions:
- Resource name in Terraform should match the actual resource name in the provider (e.g., when `name = "FooBar"`, use `resource "..." "FooBar"`)
- IAM role and policy names use PascalCase (e.g., `Ec2Bastion`, `EcsApp`)
- Use hyphenated lowercase for resource identifiers (e.g., `ec2-default`, `dns-cache`)
## File Organization
Standard file structure per Terraform directory:
- `aws.tf` — AWS provider configuration with standard data sources (`data.aws_region.current`, `data.aws_caller_identity.current`, `data.aws_default_tags.current`)
- `backend.tf` — S3 backend configuration
- `versions.tf` — Provider version constraints
- Resource-specific files: `vpc.tf`, `sg.tf`, `route53.tf`, `iam.tf`, etc.
- Multiple IAM files when needed: `iam_lambda.tf`, `iam_states.tf`, `iam_ec2_default.tf`
- `outputs.tf` — Output definitions (when needed)
- `locals.tf` — Local values (when needed)
## Variable Definitions
- Always specify `type` for variables
- Use `default = {}` for optional map variables
- Group related variables together with blank lines
## Resource Arguments
- Multi-line arguments consistently formatted
- Use trailing commas in lists
- Align equals signs for readability in blocks
## AWS-Specific
- Use `data.aws_iam_policy_document` whenever possible instead of `jsonencode`
- Use AWS managed policies via `data.aws_iam_policy` when available
### Tags and Metadata
- Use `default_tags` at provider level for Project and Component tags
- Include meaningful resource-specific tags when needed
### IAM Roles (`aws_iam_role`)
- Trust policies use separate `data.aws_iam_policy_document` with `-trust` suffix
- Split policies into multiple documents when they get large
- Use specific resource ARNs; avoid wildcards where possible
- Role names use PascalCase (e.g., `NetKea`, `NwEc2Default`)
- Include descriptive `description` field referencing the Terraform path
### IAM Instance Profiles (`aws_iam_instance_profile`)
- Name should match the associated IAM role name
- Use `aws_iam_role.Role.name` for both `name` and `role` attributes
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · sorah/config | 90 | MIT |
| magnus919/agent-skills | 100 | MIT |
| event4u-app/agent-config | 100 | MIT |
| iliaal/ai-skills | 100 | MIT |
| iuliandita/skills | 100 | MIT |
| nimadorostkar/Claude-Skills-collection | 100 | MIT |
| iliaal/whetstone | 100 | MIT |
| bendrucker/claude | 100 | MIT |
| claude-dev-suite/claude-dev-suite | 100 | MIT |
Database snapshot: 13.11.2026 · package version c67dc1af3c45 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100terraform-azure
Create or modify solutions built using Terraform on Azure. Triggers on: **/*.terraform, **/*.tf, **/*.tfvars, **/*.tflint.hcl, **/*.tfstate, **/*.tf.json, **/*.tfvars.json - 90better-terraform
Conventions and workflow for writing, refactoring, and reviewing Terraform code. Use when creating or editing .tf/.tfvars files, designing or versioning modules, deployments. - 100terraform-style-guide
Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations. - 100terraform-sap-btp
Terraform conventions and guidelines for SAP Business Technology Platform (SAP BTP). Triggers on: **/*.tf, **/*.tfvars, **/*.tflint.hcl, **/*.tf.json, **/*.tfvars.json - 100terraform-style-guide
Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations. - 100terraform-aws-modules
Terraform module creation for AWS — reusable modules, state management, and HCL best practices. Use when building or reviewing Terraform AWS infrastructure.