Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Terraform Modules?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-terraform-modules)
---
description: Design reusable Terraform modules with strict input/output contracts, version constraints, and native tests
profile: standard
tags: terraform, iac, infrastructure, modules
---
# Terraform modules
Use when authoring or refactoring reusable Terraform or OpenTofu modules.
## Interface design
- Pin `required_version` and `required_providers` with explicit minimum constraints inside every module without embedding `provider {}` blocks inside child modules.
- Document every `variable` and `output` with clear `description`, strict `type` constraints, `validation` rules, and `sensitive = true` for credentials.
- Avoid boolean explosion flags; model optional features clearly with nullable objects or explicit resource counts.
## Composition and compatibility
- Keep modules focused on one cohesive capability (for example a VPC or database tier), composing larger stacks at the root module.
- Use `moved {}` blocks when renaming resources or refactoring `count` to `for_each` so downstream callers do not suffer destructive replacement.
- Include a minimal `examples/` configuration and pin module source refs (`?ref=vX.Y.Z` or registry constraint) in callers.
## Verify
Run `terraform fmt -check`, `terraform validate`, and `terraform test` against mocked or ephemeral inputs.