home / skills / first-fluke / fullstack-starter / terraform-module-creator
This skill scaffolds new Terraform modules following library standards, creating structure, basic files, and README to accelerate module development.
npx playbooks add skill first-fluke/fullstack-starter --skill terraform-module-creatorReview the files below or copy the command above to add this skill to your agents.
---
name: terraform-module-creator
description: Helper for scaffolding new Terraform modules. Complements terraform-module-library by providing structure generation.
---
# Terraform Module Creator
This skill assists in scaffolding new Terraform modules following the standards defined in `terraform-module-library`.
## Quick Start
To create a new module, you should create the following directory structure:
```bash
mkdir -p modules/<module-name>
touch modules/<module-name>/{main,variables,outputs,versions}.tf
touch modules/<module-name>/README.md
```
## Template Files
### versions.tf
```hcl
terraform {
required_version = ">= 1.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0"
}
}
}
```
### variables.tf
```hcl
variable "project_id" {
description = "The project ID"
type = string
}
```
### outputs.tf
```hcl
output "id" {
description = "The ID of the created resource"
value = google_resource.main.id
}
```
## Relationship with terraform-module-library
- Use **terraform-module-creator** (this skill) for the initial file creation and setup.
- Use **terraform-module-library** for design patterns, best practices, and internal code logic.
This skill scaffolds new Terraform modules with a standardized directory and file layout that complements an existing module library. It generates the basic files (main, variables, outputs, versions) and a README to jumpstart consistent, production-ready modules. The goal is fast, repeatable module creation that aligns with established patterns and provider requirements.
The skill creates a modules/<module-name> folder and generates main.tf, variables.tf, outputs.tf, versions.tf, and README.md with sensible defaults. versions.tf pins Terraform and provider constraints, variables.tf defines common inputs like project_id, and outputs.tf exposes typical resource identifiers. Use this generator for the initial scaffolding, then refine logic and patterns using the module library.
Does the scaffold include provider-specific resources?
No. The scaffold creates the structure and common files; you add provider-specific resources in main.tf following library patterns.
Can I change the versions or providers after scaffolding?
Yes. versions.tf is a starting point; update required_version and required_providers to match your project needs.