Terraform Module Scaffolder

VerifiedSafe

Scaffolds standardized Terraform modules with optimal file structure and best practices.

Sby Skills Guide Bot
DevOpsIntermediate
8/4/2026
Claude CodeCursorCodex
#terraform#infrastructure-as-code#module-scaffolding#aws#iac

Recommended for

Automated summary

This skill scaffolds the standard skeleton of a new Terraform module (main.tf, variables.tf, outputs.tf, versions.tf, README.md and a basic usage example) following Terraform conventions and best practices.

Strengths

  • Produces a consistent, standardized file layout for every new module
  • Enforces typed variables with descriptions, sensible defaults and validation rules
  • Writes Terraform and provider version constraints into versions.tf
  • Ships a final validation checklist covering formatting, tagging, docs and naming

Limitations

  • Resource bodies are generic templates and must be reviewed and completed for the actual provider
  • README Inputs/Outputs tables are not auto-generated (terraform-docs is only mentioned as a later step)
  • It does not run terraform fmt, validate or plan, and adds no Terratest coverage
When to use it

Use it when starting a brand-new Terraform module or when standardizing the structure of existing VPC, ECS, S3 or RDS modules.

When not to use it

Avoid it when you need to refactor a complex existing module or debug a Terraform plan, since it only scaffolds structure.

Security analysis

Safe
Quality score82/100

The skill only provides guidance for creating Terraform module files and templates. It does not declare or instruct use of any execution tools, network access, destructive commands, or data exfiltration. All actions are file scaffolding and best-practice documentation.

No concerns found

How this analysis is made

Examples

AWS VPC module
Create a new Terraform module named vpc-main for AWS that provisions a VPC with public and private subnets, and include the standard file structure plus a basic example.
S3 module scaffold
Scaffold a Terraform module for an AWS S3 bucket with variables for versioning, encryption and custom tags, and generate versions.tf and a README with a usage example.
Standardize module layout
Set up the standard Terraform module structure (main.tf, variables.tf, outputs.tf, versions.tf, README.md) for a new RDS module and add an examples/basic/main.tf.

name: terraform-module-scaffolder description: Scaffolds new Terraform modules with standardized structure including main.tf, variables.tf, outputs.tf, versions.tf, and README.md. This skill should be used when users want to create a new Terraform module, set up module structure, or need templates for common infrastructure patterns like VPC, ECS, S3, or RDS modules.

Terraform Module Scaffolder

This skill helps create well-structured Terraform modules following best practices and conventions.

When to Use

Use this skill when:

  • Creating a new Terraform module from scratch
  • Setting up standardized module structure
  • Need templates for common AWS/Azure/GCP resources
  • Want to ensure module follows Terraform conventions

Module Structure

Generate modules with this standard structure:

module-name/
├── main.tf           # Primary resource definitions
├── variables.tf      # Input variables
├── outputs.tf        # Output values
├── versions.tf       # Provider and Terraform version constraints
├── README.md         # Module documentation
└── examples/         # Usage examples (optional)
    └── basic/
        └── main.tf

Instructions

1. Gather Requirements

Ask the user:

  • What is the module name?
  • What cloud provider (AWS, Azure, GCP, multi-cloud)?
  • What resources should the module create?
  • Any specific requirements or constraints?

2. Create Core Files

main.tf - Include:

  • Resource definitions with clear naming
  • Local values for computed attributes
  • Data sources if needed

variables.tf - Include:

  • Required variables first, then optional
  • Clear descriptions for each variable
  • Sensible defaults where appropriate
  • Type constraints (string, number, bool, list, map, object)
  • Validation rules for critical inputs

outputs.tf - Include:

  • Resource IDs and ARNs
  • Connection information (endpoints, URLs)
  • Computed attributes that other modules might need
  • Clear descriptions for each output

versions.tf - Include:

  • Terraform version constraint (use ~> for minor version)
  • Provider version constraints
  • Required providers block

README.md - Include:

  • Module description and purpose
  • Usage example
  • Requirements section
  • Inputs table (can be auto-generated later)
  • Outputs table (can be auto-generated later)

3. Apply Best Practices

  • Use consistent naming: resource_type-purpose (e.g., s3-logs, vpc-main)
  • Add tags to all taggable resources with variables for custom tags
  • Use terraform fmt formatting
  • Include lifecycle blocks where appropriate
  • Add depends_on only when implicit dependencies don't work
  • Use count or for_each for conditional resources

4. Add Example Usage

Create examples/basic/main.tf showing minimal working example:

module "example" {
  source = "../.."
  
  # Required variables
  name = "example"
  
  # Optional variables with common values
  tags = {
    Environment = "dev"
    ManagedBy   = "terraform"
  }
}

Validation Checklist

Before completing, verify:

  • [ ] All files use consistent formatting (terraform fmt)
  • [ ] Variables have descriptions and appropriate types
  • [ ] Outputs have descriptions
  • [ ] Version constraints are specified
  • [ ] README includes usage example
  • [ ] Module follows naming conventions
  • [ ] Tags are configurable via variables

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/terraform-module-scaffolder-mse7io4h' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/terraform-module-scaffolder-mse7io4h/download' --output '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md.part' && mv '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md.part' '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md' && test -s '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/terraform-module-scaffolder' && cp -R '.skill-downloads/terraform-module-scaffolder-mse7io4h' '.claude/skills/terraform-module-scaffolder'

Cursor
test -f '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md' && test -s '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/terraform-module-scaffolder' && cp -R '.skill-downloads/terraform-module-scaffolder-mse7io4h' '.cursor/skills/terraform-module-scaffolder'

Codex
test -f '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md' && test -s '.skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/terraform-module-scaffolder' && cp -R '.skill-downloads/terraform-module-scaffolder-mse7io4h' '.agents/skills/terraform-module-scaffolder'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/terraform-module-scaffolder-mse7io4h'

openskills read 'terraform-module-scaffolder-mse7io4h'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/terraform-module-scaffolder-mse7io4h/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills