Agent skill

Terraform Module Library

by wshobson in wshobson/agents

Build reusable, tested Terraform modules for AWS, Azure, GCP and OCI, with a standard file layout, an AWS VPC example, versioning rules and Terratest checks.

MITAuto-check passedDevOps & Cloud

Install Terraform Module Library

skills CLI
$ npx skills add wshobson/agents --skill terraform-module-library -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install wshobson/agents terraform-module-library --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/wshobson/agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/cloud-infrastructure/skills/terraform-module-library .claude/skills/terraform-module-library && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
terraform-module-library
GitHub stars
40k
Used in
11 other repos
Token cost
~1.3k tokens
SKILL.md length
146 words
Files
3 (incl. references)
Skills in repo
142
Repo updated
First seen
Licence
MIT

At a glance

Build reusable, tested Terraform modules for AWS, Azure, GCP and OCI, with a standard file layout, an AWS VPC example, versioning rules and Terratest checks.

  • Works in 10 steps: Use semantic versioning for modules → Document all variables with descriptions → Provide examples in examples/ directory → …
  • Creating reusable Terraform modules for a cloud platform
  • SKILL.md covers Purpose, When to Use, Module Structure and Standard Module Pattern, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill lays out how to organize a library of Terraform modules across several cloud providers, with a folder per provider and a standard module pattern of main.tf, variables.tf, outputs.tf and related files. A worked AWS VPC module shows the resource definition, documented input variables and outputs, and a composition example that wires the VPC module into an environment.

Ten practices cover semantic versioning, describing every variable, examples in an examples/ directory, validation blocks, useful outputs, pinned provider versions in versions.tf, locals, conditional resources with count or for_each, Terratest tests written in Go, and consistent tagging. Separate reference files cover AWS modules and OCI modules.

When your agent uses it

  • Creating reusable Terraform modules for a cloud platform
  • Standardizing how a team provisions common infrastructure
  • Writing a VPC module with documented variables and outputs
  • Adding Terratest checks to existing modules

Example prompts

  • “Create a Terraform VPC module for AWS with a configurable CIDR block and DNS settings.”
  • “Refactor our copy-pasted Terraform into a modules folder with versioned, documented modules.”
  • “Add input validation blocks and a Terratest test to the vpc module.”

Requirements

  • Terraform

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Use semantic versioning for modules
  2. Document all variables with descriptions
  3. Provide examples in examples/ directory
  4. Use validation blocks for input validation
  5. Output important attributes for module composition
  6. Pin provider versions in versions.tf
  7. Use locals for computed values
  8. Implement conditional resources with count/for_each
  9. Test modules with Terratest
  10. Tag all resources consistently

What it can do on your machine

Read from SKILL.md and the folder at commit 46891e7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are hcl and go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Terraform Module Library loads about 1.3k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 146 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from wshobson/agents at commit 46891e7, republished under its MIT licence (© wshobson). 146 words, ~1,349 tokens.

Download SKILL.mdSave it as .claude/skills/terraform-module-library/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
terraform-module-library
description
Build reusable Terraform modules for AWS, Azure, GCP, and OCI infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

Terraform Module Library

Production-ready Terraform module patterns for AWS, Azure, GCP, and OCI infrastructure.

Purpose

Create reusable, well-tested Terraform modules for common cloud infrastructure patterns across multiple cloud providers.

When to Use

  • Build reusable infrastructure components
  • Standardize cloud resource provisioning
  • Implement infrastructure as code best practices
  • Create multi-cloud compatible modules
  • Establish organizational Terraform standards

Module Structure

terraform-modules/
├── aws/
│   ├── vpc/
│   ├── eks/
│   ├── rds/
│   └── s3/
├── azure/
│   ├── vnet/
│   ├── aks/
│   └── storage/
├── gcp/
│   ├── vpc/
│   ├── gke/
│   └── cloud-sql/
└── oci/
    ├── vcn/
    ├── oke/
    └── object-storage/

Standard Module Pattern

module-name/
├── main.tf          # Main resources
├── variables.tf     # Input variables
├── outputs.tf       # Output values
├── versions.tf      # Provider versions
├── README.md        # Documentation
├── examples/        # Usage examples
│   └── complete/
│       ├── main.tf
│       └── variables.tf
└── tests/           # Terratest files
    └── module_test.go

AWS VPC Module Example

main.tf:

hcl
resource "aws_vpc" "main" {
  cidr_block           = var.cidr_block
  enable_dns_hostnames = var.enable_dns_hostnames
  enable_dns_support   = var.enable_dns_support

  tags = merge(
    {
      Name = var.name
    },
    var.tags
  )
}

resource "aws_subnet" "private" {
  count             = length(var.private_subnet_cidrs)
  vpc_id            = aws_vpc.main.id
  cidr_block        = var.private_subnet_cidrs[count.index]
  availability_zone = var.availability_zones[count.index]

  tags = merge(
    {
      Name = "${var.name}-private-${count.index + 1}"
      Tier = "private"
    },
    var.tags
  )
}

resource "aws_internet_gateway" "main" {
  count  = var.create_internet_gateway ? 1 : 0
  vpc_id = aws_vpc.main.id

  tags = merge(
    {
      Name = "${var.name}-igw"
    },
    var.tags
  )
}

variables.tf:

hcl
variable "name" {
  description = "Name of the VPC"
  type        = string
}

variable "cidr_block" {
  description = "CIDR block for VPC"
  type        = string
  validation {
    condition     = can(regex("^([0-9]{1,3}\\.){3}[0-9]{1,3}/[0-9]{1,2}$", var.cidr_block))
    error_message = "CIDR block must be valid IPv4 CIDR notation."
  }
}

variable "availability_zones" {
  description = "List of availability zones"
  type        = list(string)
}

variable "private_subnet_cidrs" {
  description = "CIDR blocks for private subnets"
  type        = list(string)
  default     = []
}

variable "enable_dns_hostnames" {
  description = "Enable DNS hostnames in VPC"
  type        = bool
  default     = true
}

variable "tags" {
  description = "Additional tags"
  type        = map(string)
  default     = {}
}

outputs.tf:

hcl
output "vpc_id" {
  description = "ID of the VPC"
  value       = aws_vpc.main.id
}

output "private_subnet_ids" {
  description = "IDs of private subnets"
  value       = aws_subnet.private[*].id
}

output "vpc_cidr_block" {
  description = "CIDR block of VPC"
  value       = aws_vpc.main.cidr_block
}

Best Practices

  1. Use semantic versioning for modules
  2. Document all variables with descriptions
  3. Provide examples in examples/ directory
  4. Use validation blocks for input validation
  5. Output important attributes for module composition
  6. Pin provider versions in versions.tf
  7. Use locals for computed values
  8. Implement conditional resources with count/for_each
  9. Test modules with Terratest
  10. Tag all resources consistently

Reference: See references/aws-modules.md and references/oci-modules.md

Module Composition

hcl
module "vpc" {
  source = "../../modules/aws/vpc"

  name               = "production"
  cidr_block         = "10.0.0.0/16"
  availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"]

  private_subnet_cidrs = [
    "10.0.1.0/24",
    "10.0.2.0/24",
    "10.0.3.0/24"
  ]

  tags = {
    Environment = "production"
    ManagedBy   = "terraform"
  }
}

module "rds" {
  source = "../../modules/aws/rds"

  identifier     = "production-db"
  engine         = "postgres"
  engine_version = "15.3"
  instance_class = "db.t3.large"

  vpc_id     = module.vpc.vpc_id
  subnet_ids = module.vpc.private_subnet_ids

  tags = {
    Environment = "production"
  }
}

Testing

go
// tests/vpc_test.go
package test

import (
    "testing"
    "github.com/gruntwork-io/terratest/modules/terraform"
    "github.com/stretchr/testify/assert"
)

func TestVPCModule(t *testing.T) {
    terraformOptions := &terraform.Options{
        TerraformDir: "../examples/complete",
    }

    defer terraform.Destroy(t, terraformOptions)
    terraform.InitAndApply(t, terraformOptions)

    vpcID := terraform.Output(t, terraformOptions, "vpc_id")
    assert.NotEmpty(t, vpcID)
}
  • multi-cloud-architecture - For architectural decisions
  • cost-optimization - For cost-effective designs

© wshobson, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/cloud-infrastructure/skills/terraform-module-library of wshobson/agents.

  • SKILL.md
  • references/aws-modules.md
  • references/oci-modules.md

Open the folder on GitHubat commit 46891e7

Used in 11 other repositories

We found 29 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 11 other GitHub owners. This page covers the copy in wshobson/agents, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Terraform Module Library next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Terraform Module Library compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Terraform Module Library this skillwshobson/agents40k11 repos~1.3kAutomated safety check: PassMIT
Cloud Architectdavila7/claude-code-templates32k8 repos~1.9kAutomated safety check: PassMIT
Terraform EngineerJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
Oma Tf Infrafirst-fluke/oh-my-agent1.3k—~2.8kAutomated safety check: PassMIT
Heroku To AWSaws/agent-toolkit-for-aws2.8k—~7.2kAutomated safety check: PassApache-2.0
Azure To AWSaws/agent-toolkit-for-aws2.8k—~4.6kAutomated safety check: PassApache-2.0

Similar skills

  • Cloud Architect

    davila7/claude-code-templates

    Expert cloud architect specializing in AWS/Azure/GCP multi-cloud infrastructure design, advanced IaC (Terraform/OpenTofu/CDK), FinOps cost optimization, and modern architectural patterns.

    32k GitHub starsUsed in 8 repos~1.9k tokens
    DevOps & CloudAuto-check passed
  • Terraform Engineer

    Jeffallan/claude-skills

    Writes reusable Terraform modules and manages state, providers and environments across AWS, Azure and GCP, with validation, plan review and explicit apply approval.

    12k GitHub stars~1.4k tokensUpdated 6 days ago
    DevOps & CloudAuto-check passed
  • Oma Tf Infra

    first-fluke/oh-my-agent

    Infrastructure-as-code specialist for multi-cloud provisioning using Terraform across any provider (AWS, GCP, Azure, Oracle Cloud).

    1.3k GitHub stars~2.8k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Heroku To AWS

    aws/agent-toolkit-for-aws

    Official

    Migrate workloads from Heroku to AWS. An agent skill from aws/agent-toolkit-for-aws.

    2.8k GitHub stars~7.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Azure To AWS

    aws/agent-toolkit-for-aws

    Official

    Migrate workloads from Microsoft Azure to AWS. An agent skill from aws/agent-toolkit-for-aws.

    2.8k GitHub stars~4.6k tokensUpdated today
    DevOps & CloudAuto-check passed
  • GCP To AWS

    aws/agent-toolkit-for-aws

    Official

    Migrate workloads from Google Cloud Platform to AWS — plus AI and agentic workloads from any provider.

    2.8k GitHub stars~15k tokensUpdated today
    DevOps & CloudAuto-check passed

More from wshobson/agents

All 142 skills in this repo
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 14 repos~1.7k tokens
    Auto-check passed
  • Billing Automation

    wshobson/agents

    Covers building subscription billing: billing cycles, subscription states, invoice generation, proration, tax handling and dunning for failed payments.

    40k GitHub starsUsed in 13 repos~473 tokens
    Auto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 13 repos~814 tokens
    Auto-check passed
  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 12 repos~1.3k tokens
    Auto-check passed
  • Distributed Tracing

    wshobson/agents

    Implement distributed tracing with Jaeger and Tempo to track requests across microservices and identify performance bottlenecks.

    40k GitHub starsUsed in 12 repos~527 tokens
    Auto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 4 days ago
    Auto-check passed

Categories

Questions about Terraform Module Library

What does Terraform Module Library do?

Build reusable, tested Terraform modules for AWS, Azure, GCP and OCI, with a standard file layout, an AWS VPC example, versioning rules and Terratest checks. tf and related files. A worked AWS VPC module shows the resource definition, documented input variables and outputs, and a composition example that wires the VPC module into an environment.

When should I use Terraform Module Library?

Terraform Module Library fits situations like: creating reusable Terraform modules for a cloud platform; standardizing how a team provisions common infrastructure; writing a VPC module with documented variables and outputs; adding Terratest checks to existing modules.

How do I install Terraform Module Library in Claude Code?

Run `npx skills add wshobson/agents --skill terraform-module-library -a claude-code`. Or copy the skill folder (plugins/cloud-infrastructure/skills/terraform-module-library in wshobson/agents) into .claude/skills/terraform-module-library in your project. Claude Code loads it when a task matches its description.

How do I install Terraform Module Library in Codex?

Run `npx skills add wshobson/agents --skill terraform-module-library -a codex`. Or copy the skill folder (plugins/cloud-infrastructure/skills/terraform-module-library in wshobson/agents) into .agents/skills/terraform-module-library in your project. Codex loads it when a task matches its description.

Can I use Terraform Module Library in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add wshobson/agents --skill terraform-module-library -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/terraform-module-library, .gemini/skills/terraform-module-library, .github/skills/terraform-module-library and .opencode/skills/terraform-module-library in your project.

What does Terraform Module Library need to run?

SKILL.md names no scripts, command-line tools or credentials: Terraform Module Library is instructions for the agent only. Our summary lists: Terraform.

Does Terraform Module Library access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Terraform Module Library safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Terraform Module Library use?

Terraform Module Library is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Terraform Module Library use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 697 tokens, read only when the agent opens those files.

What are the alternatives to Terraform Module Library?

Skills that share tags, products or a category with Terraform Module Library: Cloud Architect (davila7/claude-code-templates, 32k stars), Terraform Engineer (Jeffallan/claude-skills, 12k stars), Oma Tf Infra (first-fluke/oh-my-agent, 1.3k stars) and Heroku To AWS (aws/agent-toolkit-for-aws, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Terraform Module Library?

wshobson (a GitHub user) maintains it in wshobson/agents, which has 40,305 GitHub stars. The repository holds 142 skills in this directory. The repository was last updated on October 5, 2026.

Source: wshobson/agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.