Agent skill

Building Terraform Modules

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Execute this skill empowers AI assistant to build reusable terraform modules based on user specifications.

MITAuto-check passedDevOps & Cloud

Install Building Terraform Modules

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-terraform-modules -a claude-code

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace building-terraform-modules --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/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/building-terraform-modules .claude/skills/building-terraform-modules && 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
building-terraform-modules
GitHub stars
2.8k
Token cost
~1.1k tokens
SKILL.md length
445 words
Files
5 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Execute this skill empowers AI assistant to build reusable terraform modules based on user specifications.

  • Works in 10 steps: Define the module scope: determine which… → Create the standard module file… → Write versions.tf with required_version… → …
  • Appropriate context detected
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Calls terraform

What it does

Building Terraform Modules is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute this skill empowers AI assistant to build reusable terraform modules based on user specifications. it leverages the terraform-module-builder plugin to generate production-ready, well-documented terraform module code, incorporating best practices for sec... Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts, reference files and assets (for example `assets/README.md`, `assets/validation_rules.json` and `references/README.md`). Compatibility notes: Designed for Claude Code

It sits in DevOps & Cloud, covering Infrastructure as code. It works with Terraform. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Appropriate context detected
  • With relevant phrases based on skill purpose

Example prompts

  • “/building-terraform-modules”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(cmd:*)

Workflow steps

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

  1. Define the module scope: determine which cloud resources the module manages and its input/output contract
  2. Create the standard module file structure: main.tf, variables.tf, outputs.tf, versions.tf, locals.tf
  3. Write versions.tf with required_version and required_providers blocks pinned to stable versions
  4. Define input variables in variables.tf with descriptions, types, defaults, and validation rules
  5. Implement resources in main.tf using variables for all configurable values; use locals for computed values
  6. Add meaningful outputs in outputs.tf for resource IDs, ARNs, endpoints, and connection strings
  7. Implement security defaults: encryption enabled, public access blocked, least-privilege IAM, logging enabled
  8. Create an examples/ directory with at least one complete usage example showing module invocation
  9. Generate documentation with terraform-docs markdown table . > README.md
  10. Validate the module with terraform init && terraform validate and test with terraform plan using the example

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(cmd:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • terraform

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

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.hashicorp.com
    • registry.terraform.io
    • terraform-docs.io

    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.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Building Terraform Modules loads about 1.1k tokens when it runs, and up to ~1.1k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 445 words of instructions outside code blocks.

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

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); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 445 words, ~1,113 tokens.

Download SKILL.mdSave it as .claude/skills/building-terraform-modules/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
building-terraform-modules
description
Execute this skill empowers AI assistant to build reusable terraform modules based on user specifications. it leverages the terraform-module-builder plugin to generate production-ready, well-documented terraform module code, incorporating best practices for sec... Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(cmd:*)
compatibility
Designed for Claude Code
version
1.23.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
devops, terraform, terraform-modules

Building Terraform Modules

Overview

Build reusable, production-ready Terraform modules with proper variable definitions, outputs, validation rules, documentation, and examples. Generate modules following HashiCorp's standard module structure for AWS, GCP, and Azure resources with security best practices, tagging conventions, and lifecycle management.

Prerequisites

  • Terraform 1.0+ installed (terraform version)
  • Cloud provider credentials configured for the target platform
  • Understanding of the infrastructure resources the module will manage
  • Familiarity with HCL syntax and Terraform module conventions
  • terraform-docs installed for automated documentation generation (optional)

Instructions

  1. Define the module scope: determine which cloud resources the module manages and its input/output contract
  2. Create the standard module file structure: main.tf, variables.tf, outputs.tf, versions.tf, locals.tf
  3. Write versions.tf with required_version and required_providers blocks pinned to stable versions
  4. Define input variables in variables.tf with descriptions, types, defaults, and validation rules
  5. Implement resources in main.tf using variables for all configurable values; use locals for computed values
  6. Add meaningful outputs in outputs.tf for resource IDs, ARNs, endpoints, and connection strings
  7. Implement security defaults: encryption enabled, public access blocked, least-privilege IAM, logging enabled
  8. Create an examples/ directory with at least one complete usage example showing module invocation
  9. Generate documentation with terraform-docs markdown table . > README.md
  10. Validate the module with terraform init && terraform validate and test with terraform plan using the example

Output

  • Module files: main.tf, variables.tf, outputs.tf, versions.tf, locals.tf
  • Example usage in examples/basic/main.tf with realistic variable values
  • Auto-generated README.md with inputs, outputs, and usage documentation
  • .terraform-docs.yml configuration for documentation generation
  • Optional: test files using Terratest or terraform test (HCL-based)
Show full SKILL.md (191 more words)Show less

Error Handling

ErrorCauseSolution
variable validation failedInput value does not meet validation ruleCheck the validation block in variables.tf; adjust the value or the validation regex
provider not foundMissing or wrong provider source in versions.tfAdd the provider to required_providers with correct source and version constraint
circular dependencyResources referencing each other in a loopRefactor to break the cycle; use depends_on or separate into sub-modules
output references undeclared resourceTypo in resource name or resource removedVerify resource names in main.tf match output references exactly
module source not foundIncorrect module path or registry referenceVerify the source path is relative (e.g., ./modules/vpc) or a valid registry address

Examples

  • "Build a Terraform module for an AWS VPC with configurable CIDR, public/private subnets across 3 AZs, NAT gateway, and flow logs."
  • "Create a GCP Cloud Run module with custom domain, IAM bindings, and auto-scaling configuration as input variables."
  • "Generate a Terraform module for an S3 bucket with versioning, encryption, lifecycle rules, and access logging, with all settings as optional variables with secure defaults."

Resources

© jeremylongshore, 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 4 other files (scripts, references, assets) in skills/.curated/building-terraform-modules of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • assets/validation_rules.json
  • references/README.md
  • scripts/README.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Building Terraform Modules 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.

Building Terraform Modules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Building Terraform Modules this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.1kAutomated safety check: PassMIT
Terraform and OpenTofu Guideagentscope-ai/QwenPaw36k6 repos~4.2kAutomated safety check: PassApache-2.0
Terraform Skillantonbabenko/terraform-skill2.4k1 repos~5.1kAutomated safety check: PassApache-2.0
Review Docshashicorp/terraform-provider-aws11k—~1.3kAutomated safety check: PassMPL-2.0
Senior DevOps Toolkitmaslennikov-ig/claude-code-orchestrator-kit2606 repos~1.1kAutomated safety check: NotesCustom licence
Cloudflarehodgef/apiker1277 repos~2.2kAutomated safety check: PassMIT

Similar skills

  • Terraform and OpenTofu Guide

    agentscope-ai/QwenPaw

    Guidance for writing and testing Terraform and OpenTofu code: module structure, naming, test approaches, CI/CD workflows, state handling and security scanning.

    36k GitHub starsUsed in 6 repos~4.2k tokens
    DevOps & CloudAuto-check passed
  • Terraform Skill

    antonbabenko/terraform-skill

    A skill your agent uses when writing, reviewing, or debugging Terraform/OpenTofu modules, tests, CI, scans, or state ops - diagnoses failure mode (identity churn, secrets, blast radius, CI drift…

    2.4k GitHub starsUsed in 1 repo~5.1k tokens
    DevOps & CloudAuto-check passed
  • Review Docs

    hashicorp/terraform-provider-aws

    Official

    Review a Terraform AWS Provider PR's end-user documentation (website/docs//.markdown): whether docs are needed, description openings, argument/attribute style, section structure, tags wording, code…

    11k GitHub stars~1.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Senior DevOps Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…

    260 GitHub starsUsed in 6 repos~1.1k tokens
    DevOps & CloudAuto-check: notes
  • Cloudflare

    hodgef/apiker

    Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), feature flags (Flagship), networking (Tunnel, Spectrum), security (WAF…

    127 GitHub starsUsed in 7 repos~2.2k tokens
    DevOps & CloudAuto-check passed
  • Terravision Cloud Diagrams

    patrickchugh/terravision

    Draw cloud architecture diagrams for AWS, Azure or GCP with the official provider icon sets, using TerraVision.

    1.6k GitHub stars~5.6k tokensUpdated 4 days ago
    DevOps & CloudAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Building Terraform Modules

What does Building Terraform Modules do?

Execute this skill empowers AI assistant to build reusable terraform modules based on user specifications. Building Terraform Modules is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute this skill empowers AI assistant to build reusable terraform modules based on user specifications.

When should I use Building Terraform Modules?

Building Terraform Modules fits situations like: appropriate context detected; with relevant phrases based on skill purpose.

How do I install Building Terraform Modules in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-terraform-modules -a claude-code`. Or copy the skill folder (skills/.curated/building-terraform-modules in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/building-terraform-modules in your project. Claude Code loads it when a task matches its description.

How do I install Building Terraform Modules in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-terraform-modules -a codex`. Or copy the skill folder (skills/.curated/building-terraform-modules in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/building-terraform-modules in your project. Codex loads it when a task matches its description.

Can I use Building Terraform Modules 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 jeremylongshore/tons-of-skills-marketplace --skill building-terraform-modules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/building-terraform-modules, .gemini/skills/building-terraform-modules, .github/skills/building-terraform-modules and .opencode/skills/building-terraform-modules in your project.

What does Building Terraform Modules need to run?

Going by SKILL.md and its folder, Building Terraform Modules needs the command-line tools its instructions call (terraform). Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Building Terraform Modules access the network?

SKILL.md names 3 domains. As links in the text: developer.hashicorp.com, registry.terraform.io and terraform-docs.io. This is read from the text; nothing was executed.

Is Building Terraform Modules 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Building Terraform Modules use?

Building Terraform Modules is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Building Terraform Modules use?

About 1.1k tokens (SKILL.md is roughly 4.5k 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 17 tokens, read only when the agent opens those files.

What are the alternatives to Building Terraform Modules?

Skills that share tags, products or a category with Building Terraform Modules: Terraform and OpenTofu Guide (agentscope-ai/QwenPaw, 36k stars), Terraform Skill (antonbabenko/terraform-skill, 2.4k stars), Review Docs (hashicorp/terraform-provider-aws, 11k stars) and Senior DevOps Toolkit (maslennikov-ig/claude-code-orchestrator-kit, 260 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Building Terraform Modules?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.