Skip to content

Guide · Agent skill

How to use the Terraform Module Library agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The terraform-module-library skill teaches an AI agent a consistent way to write Terraform modules, which are reusable packages of cloud infrastructure code for AWS, Azure, GCP and OCI. It is aimed at platform and DevOps engineers who want to standardize how their team provisions cloud resources. After this guide you will know what the skill changes, how to install it, how to ask for module work in plain language, and what to check before running any generated code.

Terraform Module Librarywshobson/agents · MIT

Quick start

  1. 1Download and unzip the skill. Download the ZIP from the skill page. Unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder for one project.
  2. 2Or upload it in the Claude apps. If you use the Claude apps, open Settings, go to Capabilities, then Skills, and upload the ZIP.
  3. 3Install Terraform. Install Terraform if you do not already have it. The skill's examples are written in HCL, so Terraform is required to use them.
  4. 4Describe the module you need. Ask the agent in plain language, naming the cloud provider and the resource, for example an AWS VPC with private subnets.
  5. 5Review the generated folder structure. Check that the module has main.tf, variables.tf, outputs.tf, versions.tf, a README and an examples folder, and that variables have descriptions and validation.
  6. 6Compose modules. Call the module from a root configuration using its source path and pass outputs such as vpc_id from one module to another.
  7. 7Test in a safe account. If you run the Terratest files, install Go and Terratest and use a sandbox account, because the tests apply and destroy real resources.

What the terraform-module-library skill does

Terraform describes cloud infrastructure such as networks, databases, Kubernetes clusters and storage as code. A Terraform module is a packaged block of that code that you can reuse across projects. This skill tells the agent how to build such modules well: a standard folder layout, input validation, outputs, pinned provider versions, usage examples and Terratest tests.

The skill includes sample code for an AWS VPC module and reference notes covering module patterns for AWS and OCI, including VPCs, Kubernetes clusters, databases, object storage and load balancers. It focuses on authoring modules, not on operating live infrastructure.

  • Suggests a consistent folder layout for each module (main.tf, variables.tf, outputs.tf, versions.tf, README.md, examples/, tests/)
  • Adds input validation blocks and documented variables
  • Exposes outputs for module composition and pins provider versions
  • Writes examples and Terratest tests

Install the skill from a ZIP file

Download the ZIP for the skill from the directory page. Then choose one of two ways to install it. You can unzip it into your personal skills folder, ~/.claude/skills/, so the skill is available across your projects. Or you can unzip it into a project's .claude/skills/ folder so it applies only to that project.

If you use the Claude apps instead, you can upload the ZIP there. Open Settings, go to Capabilities, then Skills, and upload the file.

  • Personal install: unzip into ~/.claude/skills/
  • Project install: unzip into the project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Trigger the skill with a natural request

You do not need a special command. Describe the module work you want in ordinary language. The skill's description covers requests about creating infrastructure modules, standardizing cloud provisioning, and implementing reusable infrastructure-as-code components, so phrasing close to those topics is the most reliable way to trigger it.

Name the cloud and the resource where you can. Specific requests get output that fits your setup better than vague ones.

  • Create a reusable Terraform module for an AWS VPC with public and private subnets
  • Standardize how our team provisions Azure storage accounts using a reusable module
  • Write a GCP Terraform module for a GKE cluster with an examples/complete folder
  • Build an OCI object storage module with lifecycle rules and a Terratest file
  • Help me set up a new internal Terraform module library with a consistent structure

What the agent produces: a module structure

The skill's standard pattern puts each module in its own folder. Core resources go in main.tf, inputs in variables.tf, outputs in outputs.tf, and provider versions in versions.tf. Each module also has a README.md, an examples/ folder with a complete usage example, and a tests/ folder with Terratest files.

The skill also suggests organizing a whole library by cloud provider and service, for example aws/vpc, aws/eks, azure/vnet, gcp/gke and oci/oke.

  • Use semantic versioning for modules
  • Document every variable with a description
  • Use validation blocks for inputs
  • Output attributes that other modules need
  • Use locals for computed values
  • Use count or for_each for conditional resources
  • Tag all resources consistently
module-name/ ├── main.tf ├── variables.tf ├── outputs.tf ├── versions.tf ├── README.md ├── examples/ │ └── complete/ │ ├── main.tf │ └── variables.tf └── tests/ └── module_test.go

Example: a reusable AWS VPC module and how to compose it

The skill's AWS VPC example defines a VPC, private subnets and an optional internet gateway. Input validation checks that the CIDR block is valid IPv4 notation. Outputs expose the VPC ID, private subnet IDs and VPC CIDR block so other modules can use them.

Other modules can then call the VPC module by its source path and pass in its outputs. The skill's composition example creates a VPC module and passes its vpc_id and private_subnet_ids into an RDS module.

  • The VPC module takes name, cidr_block, availability_zones, private_subnet_cidrs, enable_dns_hostnames and tags
  • The RDS module in the example takes vpc_id and subnet_ids from the VPC module's outputs
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"] }

Test modules with Terratest, and read the safety notes first

The skill recommends testing modules with Terratest, a Go testing library. The sample test points at the examples/complete folder, runs an init and apply, reads the vpc_id output and checks that it is not empty, and then runs destroy.

Important: this test runs terraform apply and terraform destroy against real cloud resources. That can incur cost, and if it is pointed at production it can cause outages. Run it only in a sandbox account you control. The skill itself does not run scripts and does not use the network, but the tests it describes create real infrastructure.

  • Requires Terraform, and Go with Terratest if you want to run the tests
  • Cloud credentials and accounts are needed only if you actually apply the examples
  • Use a non-production account or project for any test run
  • Review the plan and the resources before applying
terraform.Options{ TerraformDir: "../examples/complete" }

What people use it for

  • Building a standard AWS VPC module with public and private subnets that every team project reuses
  • Creating an RDS module that takes VPC and subnet IDs from a network module
  • Writing an OCI object storage module with lifecycle rules and versioning
  • Starting a new internal module library organized by cloud provider and service
  • Adding Terratest checks to an existing module to confirm an output is set after apply

Frequently asked questions

How do I install the terraform-module-library skill?

Download the ZIP from the skill page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder for one project. In the Claude apps, you can instead upload the ZIP under Settings, Capabilities, Skills.

What do I need to use this skill?

You need Terraform, since the examples use HCL. If you want to run the included tests, you also need Go and Terratest. Cloud provider accounts for AWS, Azure, GCP or OCI are needed only if you actually apply the examples.

Is the terraform-module-library skill free?

The skill is released under the MIT licence. The source page does not list prices, so check the licence text on the repository for the terms that apply to you.

Does this skill run scripts or use the network?

According to the skill's listing, it runs no scripts and uses no network. However, the example tests run terraform apply and destroy against real cloud resources, which can cost money and affect live systems.

Can the skill apply changes to my cloud account safely?

Not by itself. The skill focuses on writing modules. Its example tests create and destroy real resources, so run them only in a sandbox account and review what Terraform plans to do before applying anything.

Does it work for Azure and GCP as well as AWS and OCI?

The skill's description covers AWS, Azure, GCP and OCI, and its suggested library layout includes Azure and GCP folders. The detailed reference notes and sample code in the source cover AWS and OCI, so expect more guidance for those two clouds.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits platform and DevOps engineers who want a consistent structure, validation and test pattern for reusable Terraform modules. It is not a good fit if you only need to run existing Terraform configurations or want an agent to change live infrastructure, since it focuses on authoring modules and its tests touch real resources.

Download the skill