terraform-infrastructure — Claude Code skill: how to install
Guides the agent in configuring cloud infrastructure with Terraform modules and remote state. Useful when managing dev, staging, and prod environments.
npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a claude-codeWhat terraform-infrastructure does
This skill guides AI coding assistants to write declarative Terraform configurations for AWS, Azure, GCP, and on-premise setups. It enforces modular project organization rather than placing all resources into the root module. Instructions cover backend definitions, such as S3 remote state paired with DynamoDB state locking.
The bundled references detail AWS infrastructure modules, input variables, outputs, and deployment scripts. The instructions strictly rule out keeping plaintext secrets in code or checking .tfstate files into Git. You need Terraform version 1.0 or higher. Running deployments without environment workspaces risks colliding state across teams.
What it helps with
- configure S3 remote state backend with DynamoDB locking
- organize Terraform infrastructure into reusable modules
- manage isolated configurations for dev, staging, and prod
- prepare deployment scripts with mandatory terraform plan review
Example prompts for the agent
- Set up an AWS Terraform module with an S3 backend and DynamoDB lock table.
- Generate variable definitions and outputs for separate dev and prod workspaces.
- Write a main.tf configuration requiring Terraform 1.0 and AWS provider 5.0.
How to install terraform-infrastructure
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a claude-code2Manually: put the files in place
~/.claude/skills/terraform-infrastructure/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/terraform-infrastructure/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a codex2Manually: put the files in place
.agents/skills/terraform-infrastructure/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a cursor2Manually: put the files in place
.cursor/skills/terraform-infrastructure/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts terraform-infrastructure2Manually: put the files in place
.github/skills/terraform-infrastructure/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/terraform-infrastructureManually: put the files in place
.devin/skills/terraform-infrastructure/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about terraform-infrastructure
How to install terraform-infrastructure in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill terraform-infrastructure -a claude-code. The skill file will be placed in ~/.claude/skills/terraform-infrastructure/SKILL.md.
What does terraform-infrastructure do?
It teaches your AI assistant best practices for Infrastructure as Code using Terraform. It provides patterns for multi-cloud deployments, remote state locking, and modular component structures.
What Terraform version is required?
The configuration requires Terraform version 1.0 or newer and HashiCorp AWS provider version ~> 5.0.
Source text
SKILL.md · MIT
---
name: terraform-infrastructure
description: >
Infrastructure as Code using Terraform with modular components, state
management, and multi-cloud deployments. Use for provisioning and managing
cloud resources.
---
# Terraform Infrastructure
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Build scalable infrastructure as code with Terraform, managing AWS, Azure, GCP, and on-premise resources through declarative configuration, remote state, and automated provisioning.
## When to Use
- Cloud infrastructure provisioning
- Multi-environment management (dev, staging, prod)
- Infrastructure versioning and code review
- Cost tracking and resource optimization
- Disaster recovery and environment replication
- Automated infrastructure testing
- Cross-region deployments
## Quick Start
Minimal working example:
```hcl
# terraform/main.tf
terraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
# Remote state configuration
backend "s3" {
bucket = "terraform-state-prod"
key = "prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
provider "aws" {
region = var.aws_region
default_tags {
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [AWS Infrastructure Module](references/aws-infrastructure-module.md) | AWS Infrastructure Module |
| [Variables and Outputs](references/variables-and-outputs.md) | Variables and Outputs |
| [Terraform Deployment Script](references/terraform-deployment-script.md) | Terraform Deployment Script |
## Best Practices
### ✅ DO
- Use remote state (S3, Terraform Cloud)
- Implement state locking (DynamoDB)
- Organize code into modules
- Use workspaces for environments
- Apply tags consistently
- Use variables for flexibility
- Implement code review before apply
- Keep sensitive data in separate variable files
### ❌ DON'T
- Store state files locally in git
- Use hardcoded values
- Mix environments in single state
- Skip terraform plan review
- Use root module for everything
- Store secrets in code
- Disable state locking
© aj-geddes · MIT · aj-geddes/useful-ai-prompts