Comprehensive Terraform and OpenTofu best practices skill for Claude Code. Get instant guidance on module patterns, and production-ready infrastructure code.
π¦ Module Development
- Structure and naming conventions
- Versioning strategies
- Public vs private module patterns
π Security & Compliance
- Trivy, Checkov integration
- Policy-as-code patterns
- Compliance scanning workflows
git clone https://github.com/unleftie/terraform-skill ~/.claude/skills/terraform-skillAfter installation, try:
"Create a Terraform module with testing for an S3 bucket"
Claude will automatically use the skill when working with Terraform/OpenTofu code.
Create a module:
"Create a Terraform module for AWS VPC"
Review existing code:
"Review this Terraform configuration following best practices"
- Naming conventions (
terraform-<PROVIDER>-<NAME>) - Directory structure best practices
- Input variable organization
- Output value design
- Version constraint patterns
- Documentation standards
Side-by-side β DO vs β DON'T examples for:
- Variable naming
- Resource naming
- Module composition
- State management
- Provider configuration
- Claude Code or other Claude environment supporting skills
- Terraform 1.0+ or OpenTofu 1.6+
- Optional: MCP Terraform server for enhanced registry integration
Releases are automated based on conventional commits in commit messages:
| Commit Type | Version Bump | Example |
|---|---|---|
feat!: or BREAKING CHANGE: |
Major | 1.2.3 β 2.0.0 |
feat: |
Minor | 1.2.3 β 1.3.0 |
fix: |
Patch | 1.2.3 β 1.2.4 |
| Other commits | Patch (default) | 1.2.3 β 1.2.4 |
Releases are created automatically when changes are pushed to master.
- Terraform Language - HashiCorp official docs
- Terraform Testing - Native test framework
- OpenTofu Documentation - OpenTofu official docs
- HashiCorp Best Practices - Cloud best practices
- Awesome Terraform
- Terraform Best Practices - Comprehensive guide (base for this skill)
- terraform-aws-modules - Production-grade AWS modules
- Terratest - Go testing framework for Terraform
- Google Cloud Best Practices
- AWS Terraform Best Practices
- pre-commit-terraform - Pre-commit hooks for Terraform
- terraform-docs - Generate documentation from Terraform modules
- terraform-switcher - Terraform version manager
- TFLint - Terraform linter
- Trivy - Security scanner for IaC
License: Apache 2.0 - see LICENSE
Based on terraform-skill by Anton Babenko
https://github.com/antonbabenko/terraform-skill
terraform-best-practices.com | Compliance.tf