Terraform & OpenTofu Skill for AI Agents

A best-practices skill for Terraform and OpenTofu, for AI coding agents (Claude Code, Cursor, Copilot, Gemini CLI, OpenCode, Codex, Kiro, and more). It helps the agent test code, structure modules, set up CI/CD, and write production infrastructure code.
AWS, Azure, and GCP are all first-class. AWS stays the default in examples, but the same backend, auth, security, and resource guidance applies to all three - ask for the Azure or GCP equivalent of any pattern and the skill maps it.
What this skill provides
Testing frameworks
- Decision matrix for native tests vs Terratest
- Testing workflows (static, integration, E2E)
- Examples and patterns
Module development
- Structure and naming conventions
- Versioning strategies
- Public vs private module patterns
State management
- Remote backends (S3, Azure, GCS, Terraform Cloud)
- Locking and security
- Multi-team state isolation
- Migration and recovery procedures
CI/CD integration
- GitHub Actions workflows
- GitLab CI examples
- Cost optimization
- Compliance automation
Security and compliance
- Trivy and Checkov integration
- Policy-as-code patterns
- Compliance scanning workflows
Quick reference
- Decision flowcharts
- Common patterns (DO vs DON'T)
- Cheat sheets
Installation
Installed through one Claude Code marketplace, antonbabenko/agent-plugins
(terraform-skill is listed there as an external plugin). Do not also add
antonbabenko/terraform-skill as a marketplace - both use the same marketplace
name and will clash.
Quick install (any agent)
Works with any Agent Skills-compatible tool:
npx skills add https://github.com/antonbabenko/terraform-skill
Per-host instructions
Claude Code
/plugin marketplace add antonbabenko/agent-plugins
/plugin install terraform-skill@antonbabenko
Gemini CLI
gemini extensions install https://github.com/antonbabenko/terraform-skill
Update with gemini extensions update terraform-skill.
Cursor
git clone https://github.com/antonbabenko/terraform-skill.git ~/.cursor/skills/terraform-skill
Cursor auto-discovers skills from .agents/skills/ and .cursor/skills/.
Copilot
/plugin install https://github.com/antonbabenko/terraform-skill
# or
git clone https://github.com/antonbabenko/terraform-skill.git ~/.copilot/skills/terraform-skill
Copilot auto-discovers skills from .copilot/skills/.
OpenCode
git clone https://github.com/antonbabenko/terraform-skill.git ~/.agents/skills/terraform-skill
OpenCode auto-discovers skills from .agents/skills/, .opencode/skills/, and .claude/skills/.
Codex (OpenAI)
git clone https://github.com/antonbabenko/terraform-skill.git ~/.agents/skills/terraform-skill
Codex auto-discovers skills from ~/.agents/skills/ and .agents/skills/. Update with cd ~/.agents/skills/terraform-skill && git pull.
For a managed Codex plugin install, use the antonbabenko/agent-plugins
marketplace (codex plugin marketplace add antonbabenko/agent-plugins, then
install terraform-skill). Do not add antonbabenko/terraform-skill as a
separate marketplace - it clashes by name with agent-plugins.
Autohand Code
Install the skill globally:
git clone https://github.com/antonbabenko/terraform-skill.git
mkdir -p ~/.autohand/skills
cp -R terraform-skill/skills/terraform-skill ~/.autohand/skills/
Or install it only for the current project:
git clone https://github.com/antonbabenko/terraform-skill.git
mkdir -p .autohand/skills
cp -R terraform-skill/skills/terraform-skill .autohand/skills/
Autohand Code discovers skills from ~/.autohand/skills/ and .autohand/skills/.
Kiro
git clone https://github.com/antonbabenko/terraform-skill.git ~/.kiro/skills/terraform-skill
Kiro auto-discovers skills from .kiro/skills/ (workspace) and ~/.kiro/skills/ (global).
Antigravity/Antigravity IDE/Antigravity CLI
git clone https://github.com/antonbabenko/terraform-skill.git
ln -s "$(pwd)/terraform-skill/skills/terraform-skill" ~/.gemini/config/skills/terraform-skill
Update with git pull.