/tsh-platform-engineering:implementing-terraform-modulesfrom TSH Platform Engineering
Writes and reviews reusable Terraform modules for AWS, Azure, and GCP. Covers file layout, variable validation, outputs, provider pinning, remote state with locking, Terraform vs Terragrunt, and Terratest coverage. Use when authoring multi-caller modules or reviewing IaC PRs.
Ships in TSH Platform Engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A module is an interface before it is a set of resources. Get the variables, outputs and version constraints right and the resources follow; get them wrong and every consumer inherits the mistake.
Read ${CLAUDE_PLUGIN_ROOT}/shared/discovering-infrastructure-context.md first —
sections 2 and 3 identify the dialect and the pinned versions. When a *.plan.md
exists, its Technical Context is the primary source. The project's existing module
conventions outrank everything in this skill; a second convention introduced
alongside the first is a finding, not a delivery.
| Severity | Rule |
|---|---|
| MUST | Run terraform plan and read the output before proposing any change. A change proposed without a plan is a guess. |
| MUST | Configure remote state with locking before anything is applied. Local state in a shared project loses work and cannot be recovered. |
| MUST | Pin provider versions in versions.tf and commit the lock file. |
| MUST | Give every variable a description and a type, and a validation block wherever a wrong value fails late or expensively. |
| MUST | Include a cost estimate for new resources. If projected spend rises more than 10%, open with ⚠️ FINOPS ALERT: High Cost Impact. |
| MUST | Apply the project's mandatory tags to every taggable resource, merged so consumers can add their own. |
| NEVER | Run apply, destroy, or -auto-approve without explicit authorization for that specific action. Deliver apply instructions instead. |
| NEVER | Put a secret in a variable default, a committed .tfvars, or anything that reaches state as plaintext where it can be avoided. |
| NEVER | Make manual console changes or ad-hoc CLI mutations that the code does not capture. |
| Reference | Load when | Covers |
|---|---|---|
| Module structure | Creating a module, or reviewing one's shape | Standard file layout, a complete worked VPC module, interface conventions |
| Terragrunt | More than three environments, multi-region, multi-account, or terragrunt.hcl present | The Terraform-versus-Terragrunt decision and the Terragrunt directory pattern |
| Testing modules | Adding or reviewing module tests | Terratest structure, required options, plan-only fast tests, cost and safety rules |
Read module-structure.md before creating a new module — the file layout is what makes a module reviewable and reusable.
Cloud-specific resource patterns are not here. Each cloud has its own skill —
implementing-aws-terraform, implementing-gcp-terraform, implementing-azure-terraform
in tsh-stack-aws, tsh-stack-gcp and tsh-stack-azure — carrying that provider's
resource families, service defaults and anti-patterns. Use them where the repository's
cloud plugin is installed. What stays here is what holds whatever the provider is:
layout, interface, state, and testing.
locals for computed values, not repeated expressions.count or for_each for conditional and repeated resources, not duplicated
blocks.examples/complete/ that actually runs, doubling as the test fixture.Current provider constraints as a starting point, verified against the project's pins:
aws ~> 6.0, azurerm ~> 4.0, google ~> 5.0. Check with context7 before relying
on these — they move.
context7 for the pinned provider version.terraform fmt -check, terraform validate, then
terraform plan -out=tfplan. Run tflint, and tfsec or checkov where the
project has them.## Terraform Implementation Summary
### Current state
### Proposed configuration
- Provider, resources created or modified
### Variables
| Variable | Type | Required | Description |
### State backend
### Cost estimate
- Approximate monthly cost for new resources
### Apply instructions
1. `terraform init`
2. `terraform plan -out=tfplan`
3. Review the plan
4. `terraform apply tfplan`
### Files changed
| Don't | Do |
|---|---|
| Hardcode sizes and names in resources | Variables with defaults and validation |
| Local state | Remote backend with locking |
| Unpinned providers | Constraints in versions.tf, lock file committed |
| Undocumented variables | description and type on every one |
| One giant root module | Composable modules with clear interfaces |
| Copy a module to change one value | Parameterize it |
| Apply without a reviewed plan | Plan, review, then apply the saved plan |
What SKILL.md sets; muted values are Claude Code's defaults
Trigger on: writing or modifying a Terraform module or root configuration, designing a module that several services or environments each instantiate with their own inputs, `*.tf` or `terragrunt.hcl` changes, structuring an infrastructure repository, choosing between Terraform workspaces and Terragrunt, configuring a remote state backend and locking, pinning provider versions, adding variable validation, testing infrastructure code with Terratest, or reviewing infrastructure-as-code for structure and safety.
7 skills in this plugin
/deploying-to-kubernetesConfigures Kubernetes workloads to a production standard: choosing between Deployment, StatefulSet, DaemonSet and Job, resource requests and limits and the QoS class they produce, readiness/liveness/startup probes, PodDisruptionBudgets and anti-affinity, HPA/KEDA/VPA scaling, Helm chart and Kustomize overlay structure, ingress, and non-root security contexts. Use when deploying an application to a cluster, writing or reviewing manifests or charts, or adding scaling and resilience to an existing workload./designing-multi-cloud-architectureSelects cloud services and a multi-cloud topology using an explicit decision framework: which of the six multi-cloud patterns fits the actual driver, how AWS, Azure and GCP services map onto each other, where a cloud-agnostic abstraction pays for itself and where it costs more than lock-in, and how to phase a migration. Use when choosing cloud services for a workload, planning a cross-cloud or DR topology, or evaluating a move between providers./implementing-ci-cd-pipelinesDesigns and implements CI/CD pipelines on GitHub Actions, GitLab CI, Bitbucket Pipelines, Azure Pipelines or Jenkins: stage structure and caching, deployment strategy (rolling, blue-green, canary), OIDC federation for cloud credentials instead of stored keys, monorepo affected-only builds, and the plan-artifact and approval gates an infrastructure-as-code pipeline requires. Use when creating or changing a pipeline, wiring deployment or cloud authentication, or reviewing pipeline changes./implementing-observabilityImplements metrics, logs, traces and alerting to a standard that supports an on-call rotation: choosing a stack (Prometheus/Grafana, Loki, Tempo or Jaeger, CloudWatch, Datadog, OpenTelemetry), RED and USE metrics, SLOs with error budgets, alerts that fire on user-visible symptoms and link to runbooks, and structured logging with trace correlation. Use when adding monitoring to a service, defining SLOs, writing alert rules, or fixing an alerting setup that pages too often./managing-secretsChooses and implements a secrets management approach for cloud and Kubernetes workloads: cloud-native secret stores versus Vault versus Sealed Secrets or External Secrets, OIDC federation for CI/CD instead of long-lived keys, rotation policy, and audit logging. Use when storing credentials, wiring pipeline authentication to a cloud provider, or auditing how a project handles secrets./optimizing-cloud-costThe cloud-agnostic cost framework TSH provisions against: matching a workload to a pricing model (reserved, committed-use, spot, serverless), storage tiering with lifecycle policies, the mandatory cost-allocation tag set and how to enforce it, right-sizing method, and the cost-impact estimate every infrastructure proposal carries. Use when sizing new infrastructure, estimating the cost of a change, or setting up tagging and budget governance — not for auditing a specific account, which is the cloud-specific skill's job.npx claudepluginhub thesoftwarehouse/agentic-collections --plugin tsh-platform-engineeringOther plugins' skills for the same job