ansible-generator
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
Create, generate, write, or scaffold Terraform .tf HCL — resources, modules, providers, variables, outputs.
$ npx -y skills add akin-ozer/cc-devops-skills --skill terraform-generator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/terraform-generatorContext preview
The summary Claude sees to decide when to auto-load this skill.
Create, generate, write, or scaffold Terraform .tf HCL — resources, modules, providers, variables, outputs.
name: terraform-generator description: Create, generate, write, or scaffold Terraform .tf HCL — resources, modules, providers, variables, outputs.
This skill enables the generation of production-ready Terraform configurations following best practices and current standards. Automatically integrates validation and documentation lookup for custom providers and modules.
**STOP: You MUST complete ALL steps in order. Do NOT skip any REQUIRED step.**
| Step | Action | Required | |------|--------|----------| | 1 | Understand requirements (providers, resources, modules) | ✅ REQUIRED | | 2 | Check for custom providers/modules and lookup documentation | ✅ REQUIRED | | 3 | Consult reference files before generation | ✅ REQUIRED | | 4 | Generate Terraform files with ALL best practices | ✅ REQUIRED | | 5 | Include data sources for dynamic values (region, account, AMIs) | ✅ REQUIRED | | 6 | Add lifecycle rules on critical resources (KMS, databases) | ✅ REQUIRED | | 7 | Invoke `Skill(devops-skills:terraform-validator)` | ✅ REQUIRED | | 8 | **FIX all validation/security failures and RE-VALIDATE** | ✅ REQUIRED | | 9 | Provide usage instructions (files, next steps, security) | ✅ REQUIRED |
> **IMPORTANT:** If validation fails (terraform validate OR security scan), you MUST fix the issues and re-run validation until ALL checks pass. Do NOT proceed to Step 9 with failing checks.
When generating Terraform configurations, follow this workflow:
Analyze the user's request to determine:
Before generating configurations, identify if custom or third-party providers/modules are involved:
**Standard providers** (no lookup needed):
**Custom/third-party providers/modules** (require documentation lookup):
**When custom providers/modules are detected:**
1. Use WebSearch to find version-specific documentation:
Search query format: "[provider/module name] terraform [version] documentation [specific resource]" Example: "datadog terraform provider v3.30 monitor resource documentation" Example: "terraform-aws-modules vpc version 5.0 documentation"
2. Focus searches on:
3. If Context7 MCP is available and the provider/module is supported, use it as an alternative:
mcp__context7__resolve-library-id → mcp__context7__query-docs
Before generating configuration, you MUST consult reference files using this matrix:
| Reference | Requirement | Read When | |-----------|-------------|-----------| | `terraform_best_practices.md` | REQUIRED | Always - contains baseline required patterns | | `provider_examples.md` | REQUIRED | Any AWS, Azure, GCP, or Kubernetes resource generation | | `common_patterns.md` | OPTIONAL by default, REQUIRED for complex requests | Multi-environment, workspace, composition, DR, or conditional patterns |
Open references by path:
devops-skills-plugin/skills/terraform-generator/references/terraform_best_practices.md devops-skills-plugin/skills/terraform-generator/references/provider_examples.md devops-skills-plugin/skills/terraform-generator/references/common_patterns.md
Generate HCL files following best practices:
**File Organization:**
terraform-project/ ├── main.tf # Primary resource definitions ├── variables.tf # Input variable declarations ├── outputs.tf # Output value declarations ├── versions.tf # Provider version constraints ├── terraform.tfvars # Variable values (optional, for examples) └── backend.tf # Backend configuration (optional)
**Best Practices to Follow:**
1. **Provider Configuration:**
terraform {
required_version = ">= 1.10, < 2.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0" # Major pin; verify exact current version when needed
}
}
}
provider "aws" {
region = var.aws_region
}2. **Resource Naming:**
resource "aws_instance" "web_server" {
# ...
}3. **Variable Declarations:**
variable "instance_type" {
description = "EC2 instance type for web servers"
type = string
default = "t3.micro"
validation {
condition = contains(["t3.micro", "t3.small", "t3.medium"], var.instance_type)
error_message = "Instance type must be t3.micro, t3.small, or t3.medium."
}
}4. **Output Values:**
output "instance_public_ip" {
description = "Public IP address of the web server"
value = aws_instance.web_server.public_ip
}5. **Use Data Sources for References:**
data "aws_ami" "ubuntu" {
most_recent = true
owners = ["099720109477"] # Canonical
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-serA practical skill pack for DevOps work in Claude Code and Codex desktop. This repository ships 31 skills: 16 generators for scaffolding production-ready configs 14 validators for linting, security checks, and dry-run validation 1 debugger (k8s-debug) for
Repo: akin-ozer/cc-devops-skills
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
Generate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates.
Validate, lint, audit, or review azure-pipelines.yml — syntax, security, best practices.
Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools.
Validate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.