terraform — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited terraform (Agent Skill) and scored it 92/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 2 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 2 flagged
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation. Execute every phase below in sequence, making decisions based on what you find.
============================================================ PHASE 0 — INPUT ============================================================
$ARGUMENTS may contain:
aws, gcp, azureecs, ecs-fargate, gke, aks, cloud-run, lambda, app-enginerds, cloudsql, azure-sql, aurora, dynamodb--env <name> — generate for specific environment (default: generate dev/staging/prod)--modules — use Terraform modules for reusable components--state <backend> — state backend: s3, gcs, azurerm, terraform-cloud--minimal — generate only compute + database (skip CDN, DNS, monitoring)--import — generate import blocks for existing infrastructure.tf files, AWS credentials, gcloud config, az CLI============================================================ PHASE 1 — PROJECT ANALYSIS ============================================================
Analyze the application to determine infrastructure requirements:
Application type:
Detect from project files:
Dockerfile — containerized app, prefer ECS/GKE/Cloud Runnext.config.* — SSR app, consider Vercel or containerserverless.yml — Lambda/Cloud Functionsprisma/schema.prisma — read datasource provider for DB engineExisting Terraform:
.tf files to understand current stateterraform.tfstate or remote backend config============================================================ PHASE 2 — PROJECT STRUCTURE ============================================================
Generate modular Terraform structure:
terraform/
modules/
networking/
main.tf
variables.tf
outputs.tf
compute/
main.tf
variables.tf
outputs.tf
database/
main.tf
variables.tf
outputs.tf
cache/
main.tf
variables.tf
outputs.tf
cdn/
main.tf
variables.tf
outputs.tf
monitoring/
main.tf
variables.tf
outputs.tf
environments/
dev/
main.tf
variables.tf
terraform.tfvars
backend.tf
staging/
main.tf
variables.tf
terraform.tfvars
backend.tf
prod/
main.tf
variables.tf
terraform.tfvars
backend.tf
main.tf # Root module (for simple setups)
variables.tf
outputs.tf
providers.tf
versions.tfIf --modules is not set and project is simple, use flat structure:
terraform/
main.tf
variables.tf
outputs.tf
providers.tf
versions.tf
terraform.tfvars.example============================================================ PHASE 3 — PROVIDER AND STATE CONFIGURATION ============================================================
`versions.tf`:
terraform {
required_version = ">= 1.7.0"
required_providers {
aws = { # or google, azurerm
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}`providers.tf`:
provider "aws" {
region = var.aws_region
default_tags {
tags = {
Project = var.project_name
Environment = var.environment
ManagedBy = "terraform"
}
}
}`backend.tf` (per environment):
terraform {
backend "s3" {
bucket = "{project}-terraform-state"
key = "{env}/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "{project}-terraform-locks"
}
} terraform {
backend "gcs" {
bucket = "{project}-terraform-state"
prefix = "{env}"
}
} terraform {
backend "azurerm" {
resource_group_name = "{project}-terraform-rg"
storage_account_name = "{project}tfstate"
container_name = "tfstate"
key = "{env}.terraform.tfstate"
}
}============================================================ PHASE 4 — NETWORKING MODULE ============================================================
AWS VPC:
GCP:
Azure:
Always output: vpc_id, public_subnet_ids, private_subnet_ids
============================================================ PHASE 5 — COMPUTE MODULE ============================================================
AWS ECS Fargate (default for containerized apps):
resource "aws_ecs_cluster" "main" {
name = "${var.project_name}-${var.environment}"
setting {
name = "containerInsights"
value = "enabled"
}
}
resource "aws_ecs_task_definition" "app" {
family = "${var.project_name}-${var.environment}"
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
cpu = var.task_cpu
memory = var.task_memory
execution_role_arn = aws_iam_role.ecs_execution.arn
task_role_arn = aws_iam_role.ecs_task.arn
# container_definitions from template
}
resource "aws_ecs_service" "app" {
name = "${var.project_name}-${var.environment}"
cluster = aws_ecs_cluster.main.id
task_definition = aws_ecs_task_definition.app.arn
desired_count = var.desired_count
launch_type = "FARGATE"
network_configuration {
subnets = var.private_subnet_ids
security_groups = [aws_security_group.ecs.id]
}
load_balancer {
target_group_arn = aws_lb_target_group.app.arn
container_name = var.project_name
container_port = var.container_port
}
}GCP Cloud Run:
google_cloud_run_v2_service with auto-scalingAzure Container Apps / AKS:
Include environment-specific sizing:
============================================================ PHASE 6 — DATABASE MODULE ============================================================
AWS RDS:
resource "aws_db_instance" "main" {
identifier = "${var.project_name}-${var.environment}"
engine = var.db_engine # "postgres" or "mysql"
engine_version = var.db_engine_version
instance_class = var.db_instance_class
allocated_storage = var.db_storage
max_allocated_storage = var.db_max_storage # auto-scaling
db_name = var.db_name
username = var.db_username
password = var.db_password # from secrets manager
vpc_security_group_ids = [aws_security_group.db.id]
db_subnet_group_name = aws_db_subnet_group.main.name
multi_az = var.environment == "prod"
backup_retention_period = var.environment == "prod" ? 30 : 7
deletion_protection = var.environment == "prod"
skip_final_snapshot = var.environment != "prod"
storage_encrypted = true
performance_insights_enabled = var.environment == "prod"
}GCP Cloud SQL: equivalent with google_sql_database_instance Azure SQL: equivalent with azurerm_mssql_server
Environment sizing:
db.t4g.micro / smallest tier, single-AZdb.t4g.small, single-AZdb.r6g.large, multi-AZ, performance insights, 30-day backups============================================================ PHASE 7 — CACHE, CDN, DNS MODULES (if not --minimal) ============================================================
Cache (if Redis/cache detected):
CDN (if web application):
DNS (if domain configured):
============================================================ PHASE 8 — MONITORING MODULE ============================================================
============================================================ PHASE 9 — VARIABLES AND OUTPUTS ============================================================
`variables.tf` — define all inputs with descriptions, types, defaults, and validation:
variable "project_name" {
description = "Name of the project, used in resource naming"
type = string
validation {
condition = can(regex("^[a-z0-9-]+$", var.project_name))
error_message = "Project name must be lowercase alphanumeric with hyphens."
}
}
variable "environment" {
description = "Deployment environment"
type = string
validation {
condition = contains(["dev", "staging", "prod"], var.environment)
error_message = "Environment must be dev, staging, or prod."
}
}`outputs.tf` — expose key values:
output "app_url" {
description = "Application URL"
value = "https://${var.domain}"
}
output "database_endpoint" {
description = "Database connection endpoint"
value = aws_db_instance.main.endpoint
sensitive = true
}`terraform.tfvars.example` — example values for each variable (never real secrets):
project_name = "my-app"
environment = "dev"
aws_region = "us-east-1"
# db_password = "REPLACE_ME" # Use secrets manager============================================================ PHASE 10 — COST ANNOTATIONS ============================================================
Add cost estimate comments to each resource:
# Cost estimate (us-east-1):
# dev: ~$15/mo (t4g.micro, single-AZ, 20GB)
# staging: ~$35/mo (t4g.small, single-AZ, 50GB)
# prod: ~$200/mo (r6g.large, multi-AZ, 100GB, PIOPS)
resource "aws_db_instance" "main" { ... }============================================================ SELF-HEALING VALIDATION (max 2 iterations) ============================================================
After completing deployment/infrastructure changes, validate:
IF STILL FAILING after 2 iterations:
============================================================ OUTPUT ============================================================
## Terraform Configuration Generated
### Structure
{tree of generated files}
### Resources by Environment
| Resource | Dev | Staging | Prod |
|----------|-----|---------|------|
| Compute | {spec} | {spec} | {spec} |
| Database | {spec} | {spec} | {spec} |
| Cache | — | {spec} | {spec} |
### Estimated Monthly Cost
| Environment | Estimate |
|-------------|----------|
| Dev | ~${X}/mo |
| Staging | ~${X}/mo |
| Prod | ~${X}/mo |
### Commands
terraform init
terraform plan -var-file="environments/dev/terraform.tfvars"
terraform apply -var-file="environments/dev/terraform.tfvars"============================================================ NEXT STEPS ============================================================
terraform initterraform plan on PRs and terraform apply on merge============================================================ SELF-EVOLUTION TELEMETRY ============================================================
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
~/.claude/projects/skill-telemetry.md in that memory directoryEntry format:
### /terraform — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}Only log if the memory directory exists. Skip silently if not found. Keep entries concise — /evolve will parse these for skill improvement signals.
============================================================ DO NOT ============================================================
.tf or .tfvars filesterraform apply -auto-approve in documentation — always review plans* actions or resources)deletion_protection on production databaseslatest AMI IDs — pin to specific versions or use data sources~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.