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.
Detailed guide on Terraform module design patterns, directory structures, state management, and environment separation strategies.
$ npx skills add revfactory/harness-100 --skill terraform-module-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install revfactory/harness-100 terraform-module-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .claude/skills && cp -r skills-src/en/26-infra-as-code/.claude/skills/terraform-module-patterns .claude/skills/terraform-module-patterns && rm -rf skills-srcUse ~/.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/
Install the "terraform-module-patterns" agent skill from https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patterns into .claude/skills/terraform-module-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "terraform-module-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add revfactory/harness-100 --skill terraform-module-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install revfactory/harness-100 terraform-module-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .agents/skills && cp -r skills-src/en/26-infra-as-code/.claude/skills/terraform-module-patterns .agents/skills/terraform-module-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "terraform-module-patterns" agent skill from https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patterns into .agents/skills/terraform-module-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "terraform-module-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add revfactory/harness-100 --skill terraform-module-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install revfactory/harness-100 terraform-module-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/en/26-infra-as-code/.claude/skills/terraform-module-patterns .cursor/skills/terraform-module-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "terraform-module-patterns" agent skill from https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patterns into .cursor/skills/terraform-module-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "terraform-module-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/revfactory/harness-100.git --path en/26-infra-as-code/.claude/skills/terraform-module-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add revfactory/harness-100 --skill terraform-module-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install revfactory/harness-100 terraform-module-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/en/26-infra-as-code/.claude/skills/terraform-module-patterns .gemini/skills/terraform-module-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "terraform-module-patterns" agent skill from https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patterns into .gemini/skills/terraform-module-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "terraform-module-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install revfactory/harness-100 terraform-module-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add revfactory/harness-100 --skill terraform-module-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .github/skills && cp -r skills-src/en/26-infra-as-code/.claude/skills/terraform-module-patterns .github/skills/terraform-module-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "terraform-module-patterns" agent skill from https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patterns into .github/skills/terraform-module-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "terraform-module-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add revfactory/harness-100 --skill terraform-module-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install revfactory/harness-100 terraform-module-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/revfactory/harness-100.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/en/26-infra-as-code/.claude/skills/terraform-module-patterns .opencode/skills/terraform-module-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "terraform-module-patterns" agent skill from https://github.com/revfactory/harness-100/tree/main/en/26-infra-as-code/.claude/skills/terraform-module-patterns into .opencode/skills/terraform-module-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "terraform-module-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
terraform-module-patternsDetailed guide on Terraform module design patterns, directory structures, state management, and environment separation strategies.
Terraform Module Patterns is an agent skill from revfactory/harness-100. Detailed guide on Terraform module design patterns, directory structures, state management, and environment separation strategies. Use this skill for 'Terraform modules', 'module structure', 'state management', 'remote state', 'environment separation', 'workspace', 'terragrunt', 'module patterns', and other Terraform module design tasks. Enhances the IaC design capabilities of infra-architect and drift-detector. Note: actual terraform apply and infrastructure provisioning execution are outside the scope of this…
Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in DevOps & Cloud, covering Infrastructure as code. It works with Terraform. The licence is Apache-2.0.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 8e8d35c. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are hcl).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Terraform Module Patterns loads about 1.4k tokens when it runs. Until then it costs about 137 tokens; SKILL.md has 150 words of instructions outside code blocks.
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.
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.
The full file from revfactory/harness-100 at commit 8e8d35c, republished under its Apache-2.0 licence (© revfactory). 150 words, ~1,360 tokens.
.claude/skills/terraform-module-patterns/SKILL.md (or your agent's skills folder).Patterns and best practices for designing reusable and maintainable Terraform modules.
infrastructure/
├── modules/ # Reusable modules
│ ├── networking/
│ │ ├── vpc/
│ │ │ ├── main.tf
│ │ │ ├── variables.tf
│ │ │ ├── outputs.tf
│ │ │ └── README.md
│ │ ├── security-group/
│ │ └── load-balancer/
│ ├── compute/
│ │ ├── ecs-service/
│ │ ├── lambda/
│ │ └── ec2-asg/
│ └── data/
│ ├── rds/
│ ├── elasticache/
│ └── s3/
├── environments/ # Per-environment configuration
│ ├── dev/
│ │ ├── main.tf # Module invocations
│ │ ├── terraform.tfvars # Environment variables
│ │ └── backend.tf # State storage
│ ├── staging/
│ └── prod/
└── global/ # Cross-environment (IAM, DNS)
├── iam/
└── route53/infrastructure/
├── modules/ # Same as above
├── terragrunt.hcl # Root config (backend, provider)
└── environments/
├── terragrunt.hcl # Common variables
├── dev/
│ ├── terragrunt.hcl # include root + env vars
│ ├── vpc/
│ │ └── terragrunt.hcl # module source + inputs
│ ├── ecs/
│ └── rds/
└── prod/# Good: VPC module handles only VPC
module "vpc" {
source = "./modules/networking/vpc"
cidr_block = "10.0.0.0/16"
az_count = 3
}
# Bad: One module for all infrastructure
module "everything" { # Anti-pattern!
source = "./modules/full-stack"
}# variables.tf — Validation required
variable "instance_type" {
type = string
description = "EC2 instance type"
default = "t3.medium"
validation {
condition = can(regex("^t3\\.", var.instance_type))
error_message = "Only t3 family is allowed."
}
}
variable "environment" {
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Must be one of dev, staging, prod."
}
}
# outputs.tf — Expose only values needed by other modules
output "vpc_id" {
value = aws_vpc.main.id
description = "ID of the created VPC"
}variable "enable_monitoring" {
type = bool
default = true
}
resource "aws_cloudwatch_metric_alarm" "cpu" {
count = var.enable_monitoring ? 1 : 0
# ...
}# backend.tf
terraform {
backend "s3" {
bucket = "company-terraform-state"
key = "environments/prod/vpc/terraform.tfstate"
region = "ap-northeast-2"
dynamodb_table = "terraform-locks"
encrypt = true
}
}| Strategy | Separation Basis | Pros | Cons |
|---|---|---|---|
| Per-environment | dev/staging/prod | Environment isolation, independent deployment | Need data source for cross-env references |
| Per-layer | network/compute/data | Reduced blast radius | Complex reference management |
| Per-team | Team-owned resources | Autonomy | Shared resource management difficulty |
| Per-lifecycle | Change frequency | Stable resource protection | Boundary definition difficulty |
# Read VPC ID from network state
data "terraform_remote_state" "network" {
backend = "s3"
config = {
bucket = "company-terraform-state"
key = "environments/prod/network/terraform.tfstate"
region = "ap-northeast-2"
}
}
# Usage
resource "aws_ecs_service" "app" {
network_configuration {
subnets = data.terraform_remote_state.network.outputs.private_subnet_ids
}
}locals {
common_tags = {
Environment = var.environment
Project = var.project_name
ManagedBy = "terraform"
Team = var.team_name
CostCenter = var.cost_center
}
}
resource "aws_instance" "app" {
tags = merge(local.common_tags, {
Name = "${var.project_name}-${var.environment}-app"
Role = "application"
})
}| Anti-pattern | Problem | Solution |
|---|---|---|
| Giant state file | Slow plan/apply, large blast radius | Split by layer |
| Hardcoded values | Cannot reuse across environments | variables + tfvars |
| Provider inside module | Lost flexibility | Provider only at root |
| Complex conditions with count | Resource recreation on index changes | Use for_each |
| Plaintext secrets | Security violation | SSM/Vault references |
© revfactory, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in en/26-infra-as-code/.claude/skills/terraform-module-patterns of revfactory/harness-100.
Open the folder on GitHubat commit 8e8d35c
Terraform Module Patterns 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Terraform Module Patterns this skillrevfactory/harness-100 | 1.3k | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Terraform and OpenTofu Guideagentscope-ai/QwenPaw | 35k | 6 repos | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Terraform Skillantonbabenko/terraform-skill | 2.4k | 1 repos | ~5.1k | Automated safety check: Pass | Apache-2.0 | |
| Senior DevOps Toolkitmaslennikov-ig/claude-code-orchestrator-kit | 259 | 6 repos | ~1.1k | Automated safety check: Notes | Custom licence | |
| Cloudflarehodgef/apiker | 127 | 7 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Terravision Cloud Diagramspatrickchugh/terravision | 1.6k | — | ~5.6k | Automated safety check: Notes | AGPL-3.0-only |
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.
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…
maslennikov-ig/claude-code-orchestrator-kit
Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup…
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…
patrickchugh/terravision
Draw cloud architecture diagrams for AWS, Azure or GCP with the official provider icon sets, using TerraVision.
dmmulroy/cloudflare-skill
Comprehensive Cloudflare platform skill covering Workers, Pages, storage (KV, D1, R2), AI (Workers AI, Vectorize, Agents SDK), networking (Tunnel, Spectrum), security (WAF, DDoS), and…
revfactory/harness-100
A skill for analyzing website anti-bot defense mechanisms and developing legitimate evasion strategies.
revfactory/harness-100
Reference for designing how an API reports failures: structured error codes, response shapes, client-friendly messages, an error catalog and retry or fallback advice.
revfactory/harness-100
Walks a backend-dev agent through OWASP API Top 10 checks, authentication and authorization patterns, and defense code during API design.
revfactory/harness-100
Methodology for systematically designing and generating CLI tool argument parser structures.
revfactory/harness-100
Audience segmentation skill used by the analyst and curator agents.
revfactory/harness-100
Audio storytelling skill used by the podcast scriptwriter and show note editor.
Works with
Categories
Detailed guide on Terraform module design patterns, directory structures, state management, and environment separation strategies. Terraform Module Patterns is an agent skill from revfactory/harness-100. Detailed guide on Terraform module design patterns, directory structures, state management, and environment separation strategies.
Terraform Module Patterns fits situations like: terraform modules; module structure; state management; environment separation.
Run `npx skills add revfactory/harness-100 --skill terraform-module-patterns -a claude-code`. Or copy the skill folder (en/26-infra-as-code/.claude/skills/terraform-module-patterns in revfactory/harness-100) into .claude/skills/terraform-module-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add revfactory/harness-100 --skill terraform-module-patterns -a codex`. Or copy the skill folder (en/26-infra-as-code/.claude/skills/terraform-module-patterns in revfactory/harness-100) into .agents/skills/terraform-module-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add revfactory/harness-100 --skill terraform-module-patterns -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-patterns, .gemini/skills/terraform-module-patterns, .github/skills/terraform-module-patterns and .opencode/skills/terraform-module-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Terraform Module Patterns is instructions for the agent only.
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.
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.
Terraform Module Patterns is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.4k 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.
Skills that share tags, products or a category with Terraform Module Patterns: Terraform and OpenTofu Guide (agentscope-ai/QwenPaw, 35k stars), Terraform Skill (antonbabenko/terraform-skill, 2.4k stars), Senior DevOps Toolkit (maslennikov-ig/claude-code-orchestrator-kit, 259 stars) and Cloudflare (hodgef/apiker, 127 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
revfactory (a GitHub user) maintains it in revfactory/harness-100, which has 1,290 GitHub stars. The repository holds 464 skills in this directory. The repository was last updated on March 22, 2026.
Source: revfactory/harness-100 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.