skills/.curated/terraform-project-generator/SKILL.md
Generate complete Terraform project structure with main.tf, variables.tf, outputs.tf, backend.tf, and terraform.tf following best practices
npx skillsauth add guicedee/ai-rules terraform-project-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a Terraform project scaffolding expert. When this skill is invoked, you help users generate complete, production-ready Terraform project structures following HashiCorp best practices.
When a user requests a new Terraform project:
Gather Requirements:
Generate Standard File Structure:
project-name/
├── main.tf # Resource definitions
├── variables.tf # Input variables
├── outputs.tf # Output values
├── terraform.tf # Terraform and provider config
├── backend.tf # Backend configuration
├── .gitignore # Git ignore file
└── README.md # Project documentation
Follow Best Practices:
terraform {
required_version = ">= 1.6"
required_providers {
{provider} = {
source = "hashicorp/{provider}"
version = "~> {major_version}"
}
}
}
provider "{provider}" {
# Provider-specific configuration
}
For Azure (azurerm):
terraform {
backend "azurerm" {
resource_group_name = "terraform-state-rg"
storage_account_name = "tfstate${random_suffix}"
container_name = "tfstate"
key = "terraform.tfstate"
}
}
For AWS (s3):
terraform {
backend "s3" {
bucket = "terraform-state-bucket"
key = "terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}
variable "environment" {
description = "Environment name (e.g., dev, staging, prod)"
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Environment must be dev, staging, or prod."
}
}
variable "location" {
description = "Azure region where resources will be created"
type = string
default = "eastus"
}
variable "tags" {
description = "Tags to apply to all resources"
type = map(string)
default = {}
}
output "resource_group_id" {
description = "ID of the resource group"
value = azurerm_resource_group.main.id
}
output "resource_group_name" {
description = "Name of the resource group"
value = azurerm_resource_group.main.name
}
# Resource Group
resource "azurerm_resource_group" "main" {
name = "rg-${var.environment}-${var.project_name}"
location = var.location
tags = var.tags
}
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files
*.tfvars
*.tfvars.json
# Ignore override files
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc
# Ignore plan files
*.tfplan
# {Project Name}
{Project Description}
## Prerequisites
- Terraform >= 1.6
- {Provider} CLI configured
- Appropriate access credentials
## Usage
1. Initialize Terraform:
```bash
terraform init
Review the plan:
terraform plan
Apply the configuration:
terraform apply
| Name | Description | Type | Default | Required | |------|-------------|------|---------|----------| | {var_name} | {description} | {type} | {default} | {yes/no} |
| Name | Description | |------|-------------| | {output_name} | {description} |
## Interactive Setup
Ask the user for:
1. **Project name**: What should this project be called?
2. **Provider**: Which cloud provider? (azurerm/aws/google)
3. **Backend**: Where to store state? (local/azurerm/s3/gcs)
4. **Resources**: What resources to include initially?
5. **Environment**: Development, staging, or production?
## Naming Conventions
Follow these patterns:
- **Resource Groups**: `rg-{environment}-{purpose}`
- **Storage Accounts**: `st{environment}{purpose}`
- **Virtual Networks**: `vnet-{environment}-{purpose}`
- **Subnets**: `snet-{environment}-{purpose}`
- **Virtual Machines**: `vm-{environment}-{purpose}`
## Script Integration
If `scripts/generate-project.js` exists, use it:
```bash
node scripts/generate-project.js \
--name myproject \
--provider azurerm \
--backend azurerm \
--output ./myproject
Example 1: Azure web application infrastructure
Example 2: AWS three-tier architecture
development
Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.
development
WebAwesome icon integration for JWebMP — modern, open-source icon library. Provides 1,500+ icons with solid/regular styles, sizing, rotation, animation, and CSS utilities. Drop-in FontAwesome alternative with fresh designs. Use when working with WebAwesome icons, modern icon designs, or as FontAwesome alternative in JWebMP applications.
development
WebAwesome Pro integration for JWebMP with premium icons and features. Extends jwebmp-webawesome with additional styles, premium icons, and advanced features. Use when working with WebAwesome Pro icons or premium WebAwesome features in JWebMP applications.