terraform
Skill5 starsChanged 8 months agoMITView on GitHub
MUST USE when creating, reviewing, testing, or refactoring Terraform code. Covers modules, providers, resources, variables, CI/CD workflows, policy and validation patterns, and infrastructure-as-code design decisions. Do NOT use for imperative cloud CLI tasks or non-Terraform deployment tooling unless the task explicitly requires Terraform.
23 other projects use a version of this.
Adopted by
Most recently taken up by
- iliaal/ai-skillstheir own version, first seen Nov 7, 2026
- cloudfleetai/cloudfleet-plugin-claudetheir own version, first seen Nov 1, 2026
- maroffo/claude-forgetheir own version, first seen Oct 25, 2026
- iuliandita/skillstheir own version, first seen Oct 14, 2026
- DongDuong2001/pudo-code-systemtheir own version, first seen Oct 13, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use ansible, kubernetes and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
julweberSkillansible
Ansible automation reference for playbooks, roles, inventory, variables, and modules. Includes Proxmox VE and Docker integration via community.general and community.docker collections. Use when writing playbooks, troubleshooting Ansible runs, or designing automation workflows. Triggers: ansible, playbook, inventory, role, task, handler, vars, jinja2, galaxy, proxmox_kvm, proxmox_lxc, docker_container, docker_compose.
Also in 4 projects that use this
mjunaidcaSkillkubernetes
Production-grade Kubernetes manifests and debugging for containerized applications. This skill should be used when users ask to deploy to Kubernetes, create K8s manifests, containerize for K8s, set up Deployments/Services/Jobs/StatefulSets/CronJobs, create namespaces with resource quotas, set up multi-team isolation, configure ResourceQuota/ LimitRange, secure with RBAC (ServiceAccount, Role, RoleBinding), configure init containers (model download, db wait, migrations), set up sidecars (logging, metrics), or debug pods (CrashLoopBackOff, logs, exec, describe, events). Auto-detects from Dockerfile/code, generates hardened manifests with educational comments. CKAD-aligned.
Also in 5 projects that use this
thechandanbhagatSkillsql
Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.
Also in 3 projects that use this
MicrosoftSkillgithub-actions
Use when creating, editing, reviewing, or troubleshooting GitHub Actions workflows in Scope.
Also in 5 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 5 projects that use this
garri333Skillcodex-cli
OpenAI Codex CLI mastery skill for installation, authentication, terminal commands, code generation from natural language, file editing, project scaffolding, and IDE integrations. Covers GPT-5.2 Instant/Thinking tiers and shell/container execution modes.
Also in 3 projects that use this
Other versions23 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 23
- Mindrally/skills★ 275same name
- magnus919/agent-skills★ 172same name
- nitinjain999/platform-skills★ 71same name
- iliaal/ai-skills★ 45same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- georgekhananaev/claude-skills-vault★ 28same name
- greedychipmunk/agent-skills★ 24same name
- maroffo/claude-forge★ 17same name
- G1Joshi/Agent-Skills★ 15same name
- iuliandita/skills★ 11same name
13 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- charm-vhsSkill
- cloud-foundation-fabricSkill
- d2Skill
- duckdbSkill
- github-profile-architectSkill
- jqSkill
- opencode-devSkill
- playwright-cliSkill
- skill-crawlerSkill
- skill-registry-syncSkill
- tech-writerSkill
- terminal-ui-engineerSkill
- worktrunkSkill
- writingSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
Every Terraform root module must have:
- Distinctive: line 290
When to use factory vs traditional modules
- Distinctive: line 297
When NOT to use factory pattern
“Common” is measured: kept by at least 6 in 10 of the 21 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Terraform Skill
Comprehensive Terraform guidance covering modules, testing, CI/CD, and production patterns. Combines best practices from terraform-best-practices.com and Cloud Foundation Fabric.
The Seven Mantras
These principles guide all Terraform work:
- Always Have versions.tf — Every root module must define providers, versions, and configuration. Never leave provider config implicit.
- Always Have backend.tf — Even if empty initially, you'll need remote state (GCS for GCP).
- Always Have locals.tf — Centralize all local values, don't scatter them across files.
- Vertical Files by Domain — Organize by workload (webserver.tf, salesforce-etl.tf), not by resource type (iam.tf, compute.tf).
- Variables with Sane Defaults — Provide sensible defaults and example tfvars files.
- YAML Factories for Heavy Reuse — Enable non-Terraform users via YAML configs + factory patterns.
- Maximize Autonomy — App repos own their resources, foundations repos own shared infrastructure. Avoid cross-repo dependencies.
Core Principles
1. Required Files
Every Terraform root module must have:
| File | Purpose |
versions.tf | Provider versions and configuration |
backend.tf | Remote state (even if empty initially) |
locals.tf | Centralized local values |
variables.tf | Input variables (when needed) |
2. Vertical File Organization
Organize by domain/workload, not by resource type:
# GOOD - Files by domain:
├── networking.tf # VPC, subnets, routes, NAT
├── webserver.tf # MIG, template, LB, service account
├── salesforce-etl.tf # SA, secrets, Cloud Function, BigQuery
└── database.tf # Cloud SQL, IAM, backups
# BAD - Files by resource type:
├── iam.tf # All IAM mixed together
├── compute.tf # All compute mixed together
└── storage.tf # All storage mixed together3. Naming Conventions
| Type | Pattern | Example |
| Resources | Descriptive, contextual | web_server, application_logs |
| Singletons | Use this | google_compute_network.this |
| Variables | Context-specific | vpc_cidr_block, database_instance_class |
| Outputs | {name}_{type}_{attribute} | firewall_rule_id, subnet_ids |
4. Module Boundaries
| Type | Scope | Example |
| Resource Module | Single logical group | VPC + subnets |
| Infrastructure Module | Collection of resources | Complete networking stack |
| Composition | Environment-specific | Production environment |
| Repository | Owns its resources | App repo = app resources only |
Quick Decision Reference
Count vs For_Each
Do resources need meaningful identifiers?
│
├─ YES → for_each (with set or map)
│
└─ NO → Can items change position?
├─ YES → for_each (prevents cascade)
└─ NO → count (simpler)See code-patterns.md for migration patterns and detailed examples.
Testing Approach
What do you need to test?
│
├─ Syntax/format? → terraform validate + fmt
├─ Security? → trivy + checkov
├─ Simple logic (1.6+)? → Native tests
└─ Complex integration? → TerratestSee testing-frameworks.md for implementation details.
Authentication (GCP)
Always use OIDC. Never use service account keys.
| Method | Security | Use Case |
| OIDC | ✅ No long-lived credentials | CI/CD (GitHub Actions) |
| ADC | ✅ User credentials | Local development |
| Impersonation | ✅ Service account delegation | Automation |
| Keys | ❌ Long-lived risk | Never use |
See security-compliance.md for OIDC setup and security patterns.
Modern Features (Quick Reference)
| Feature | Version | When to Use |
try() | 0.13+ | Safe fallbacks (always use) |
optional() | 1.3+ | Optional object attributes |
moved blocks | 1.1+ | Refactor without recreation |
| Native tests | 1.6+ | Unit testing in HCL |
| Mock providers | 1.7+ | Cost-free testing |
| Write-only args | 1.11+ | Secrets (never in state) |
Essential Commands
# Static analysis (always free)
terraform fmt -recursive -check
terraform validate
tflint
trivy config .
checkov -d .
# Testing (1.6+)
terraform test
# Plan and apply
terraform plan -out=tfplan
terraform apply -auto-approve tfplan
# State management
terraform state list
terraform showSee quick-reference.md for full cheat sheet.
Security Checklist
- Authentication: Using OIDC (not keys)
- Secrets: In Secret Manager (not state/variables)
- Network: Custom VPC (not default)
- Firewall: Least privilege (not 0.0.0.0/0)
- State: Encrypted, versioned, restricted access
- Scanning: Trivy/Checkov in CI/CD
See security-compliance.md for detailed patterns.
Module Checklist
versions.tfwith provider constraintsbackend.tffor remote statevariables.tfwith descriptions and validationoutputs.tfwith descriptionsexamples/directory (simple and complete)- Tests (native 1.6+ or Terratest)
- Pre-commit hooks configured
- Documentation in README.md
See module-patterns.md for details.
CI/CD Essentials
Standard Pipeline
validate → plan → applyKey Decisions
| Decision | Recommendation |
| Authentication | OIDC (never keys) |
| Apply trigger | Push for dev/staging, approval for prod |
| Workspaces | Separate files per environment |
| Security scan | Trivy + Checkov in CI |
See ci-cd-workflows.md for templates.
Reference Documentation
code-patterns.md
When to use: Writing or refactoring Terraform code
Covers:
- Count vs for_each decision guide and migration patterns
- Block ordering rules (resources, variables)
- Modern features decision guide (try, optional, moved, write-only)
- Version constraints and update strategy
- Secrets management patterns
- Refactoring from legacy (0.12/0.13) to modern syntax
quick-reference.md
When to use: Need quick lookup or troubleshooting
Covers:
- Command cheat sheet (format, validate, test, plan)
- Decision flowcharts (testing, module workflow, refactoring)
- Version-specific guidance (1.0-1.5, 1.6+, 1.7+)
- Troubleshooting common issues
- Version constraint syntax reference
module-patterns.md
When to use: Creating or restructuring modules
Covers:
- Module type decision tree (Resource → Infrastructure → Composition)
- Architecture decisions (scope size, module connections)
- File organization standards
- Parameterization vs hardcoding
- Root module vs reusable module boundaries
- Naming decisions (variables, outputs)
- Anti-patterns to avoid (god modules, environment sprawl)
testing-frameworks.md
When to use: Setting up or choosing testing approach
Covers:
- Testing decision flowchart
- Native tests vs Terratest comparison
- Critical plan vs apply decision
- Working with set-type blocks
- Mocking decisions
- Terratest patterns and cost management
- Testing checklist
ci-cd-workflows.md
When to use: Setting up CI/CD pipelines
Covers:
- Standard validate → plan → apply pipeline
- OIDC authentication patterns
- Apply strategy options (push, approval, comment-triggered)
- Environment organization (separate vs reusable workflows)
- Essential security checks in CI
- Atlantis integration decision guide
security-compliance.md
When to use: Security review or compliance setup
Covers:
- OIDC vs service account key decision
- Secrets management (what's safe vs unsafe)
- Network architecture decisions
- Firewall rule best practices
- State security requirements
- Compliance testing tools (trivy, checkov, terraform-compliance, OPA)
factory-patterns.md
When to use: Building scalable, self-service infrastructure
Covers:
- When to use factory vs traditional modules
- Configuration format decisions (YAML vs JSON)
- Discovery methods (single file vs auto-discovery)
- Default strategy patterns
- Factory patterns by use case (Project, Subnet, Service Account)
- Conditional resource creation
- Lifecycle hooks
- When NOT to use factory pattern
Based on:
- Cloud Foundation Fabric by Google Cloud Platform
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

