Skip to content

The Claude Agent Skill for Terraform and OpenTofu - testing, modules, CI/CD, and production patterns

License

Notifications You must be signed in to change notification settings

antonbabenko/terraform-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Terraform Skill for Claude

Claude Skill Terraform OpenTofu License

Comprehensive Terraform and OpenTofu best practices skill for Claude Code. Get instant guidance on testing strategies, module patterns, CI/CD workflows, and production-ready infrastructure code.

What This Skill Provides

πŸ§ͺ Testing Frameworks

  • Decision matrix for choosing between native tests and Terratest
  • Testing strategy workflows (static β†’ integration β†’ E2E)
  • Real-world examples and patterns

πŸ“¦ Module Development

  • Structure and naming conventions
  • Versioning strategies
  • Public vs private module patterns

πŸ”„ CI/CD Integration

  • GitHub Actions workflows
  • GitLab CI examples
  • Cost optimization patterns
  • Compliance automation

πŸ”’ Security & Compliance

  • Trivy, Checkov integration
  • Policy-as-code patterns
  • Compliance scanning workflows

πŸ“‹ Quick Reference

  • Decision flowcharts
  • Common patterns (βœ… DO vs ❌ DON'T)
  • Cheat sheets for rapid consultation

Installation

This plugin is distributed via Claude Code marketplace using .claude-plugin/marketplace.json.

Claude Code (Recommended)

/plugin marketplace add antonbabenko/terraform-skill
/plugin install terraform-skill@antonbabenko

Manual Installation

# Clone to Claude skills directory
git clone https://github.com/antonbabenko/terraform-skill ~/.claude/skills/terraform-skill

Private Testing

While the repository is private, you can test locally:

git clone git@github.com:antonbabenko/terraform-skill.git ~/.claude/skills/terraform-skill
# Claude Code will load it from the local filesystem

Verify Installation

After installation, try:

"Create a Terraform module with testing for an S3 bucket"

Claude will automatically use the skill when working with Terraform/OpenTofu code.

Quick Start Examples

Create a module with tests:

"Create a Terraform module for AWS VPC with native tests"

Review existing code:

"Review this Terraform configuration following best practices"

Generate CI/CD workflow:

"Create a GitHub Actions workflow for Terraform with cost estimation"

Testing strategy:

"Help me choose between native tests and Terratest for my modules"

What It Covers

Testing Strategy Framework

Decision matrices for:

  • When to use native tests (Terraform 1.6+)
  • When to use Terratest (Go-based)
  • Multi-environment testing patterns

Module Development Patterns

  • Naming conventions (terraform-<PROVIDER>-<NAME>)
  • Directory structure best practices
  • Input variable organization
  • Output value design
  • Version constraint patterns
  • Documentation standards

CI/CD Workflows

  • GitHub Actions examples
  • GitLab CI templates
  • Atlantis integration
  • Cost estimation (Infracost)
  • Security scanning (Trivy, Checkov)
  • Compliance checking

Security & Compliance

  • Static analysis integration
  • Policy-as-code patterns
  • Secrets management
  • State file security
  • Compliance scanning workflows

Common Patterns & Anti-patterns

Side-by-side βœ… DO vs ❌ DON'T examples for:

  • Variable naming
  • Resource naming
  • Module composition
  • State management
  • Provider configuration

Why This Skill?

Based on Production Experience:

  • Patterns from terraform-best-practices.com
  • Community-tested approaches from terraform-aws-modules
  • AWS Hero expertise in enterprise IaC
  • Real-world usage across 100+ modules

Version-Specific Guidance:

  • Terraform 1.0+ features
  • OpenTofu 1.6+ compatibility
  • Native test framework (1.6+)
  • Current tooling ecosystem (2024-2026)

Decision Frameworks: Not just "what to do" but "when and why" - helping you make informed architecture decisions.

Requirements

  • Claude Code or other Claude environment supporting skills
  • Terraform 1.0+ or OpenTofu 1.6+
  • Optional: MCP Terraform server for enhanced registry integration

Contributing

See CLAUDE.md for:

  • Skill development guidelines
  • Content structure philosophy
  • How to propose improvements
  • Testing and validation approach

Issues & Feedback: GitHub Issues

Releases

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.

Related Resources

Official Documentation

Community Resources

Development Tools

License & Attribution

License: Apache 2.0 - see LICENSE

If you create derivative works or skills based on this skill, please include:

Based on terraform-skill by Anton Babenko
https://github.com/antonbabenko/terraform-skill
terraform-best-practices.com | Compliance.tf

About

The Claude Agent Skill for Terraform and OpenTofu - testing, modules, CI/CD, and production patterns

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •