/polymath-iac:terraform-modulefrom polymath-iac
Author a reusable Terraform module — input variables with validation, typed outputs, sane defaults, versioning, provider constraints, and composition boundaries.
Ships in polymath-iac. 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 good module is a small, versioned contract: clear inputs, useful outputs, no hidden global state. Design the interface before the resources, the way you would an API.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
polymath-iac:terraform-module.Not this when: you are choosing the cloud architecture/primitives — that is polymath-cloud:design-stack-composition. For state/backends, polymath-iac:terraform-state; for reviewing a generated plan, polymath-cloud:plan-review.
validation blocks for constraints), and outputs that expose what consumers actually need (ids, ARNs, endpoints). Minimize the surface — fewer, well-chosen variables beat dozens.required_providers + version constraints but does not configure providers or backends — the root module does. A module that pins a backend isn't reusable.for_each over count for stable addressing, explicit depends_on only where needed.moved {} blocks so consumers upgrade without destroy+recreate.terraform validate + tflint in CI, and terraform test (or Terratest) against the example to prove the interface works.prevent_destroy, ignore_changes) where state churn would be dangerous.sensitive = true; never bake secrets into the module.The module skeleton and a one-paragraph design note, in this shape:
modules/sqs-queue/ (capability: a queue with its DLQ, alarms, and access policy)
versions.tf required_providers { aws = { source = "hashicorp/aws", version = ">= 5.40, < 6.0" } } — no provider/backend blocks
variables.tf name (string, validation: ^[a-z0-9-]{3,60}$) · visibility_timeout_seconds (number, default 30)
max_receive_count (number, default 5, validation 1–20) · tags (map(string), default {})
main.tf aws_sqs_queue.this + aws_sqs_queue.dlq (redrive) · aws_cloudwatch_metric_alarm.dlq_depth
outputs.tf queue_url, queue_arn, dlq_arn
examples/basic/main.tf module "refunds_queue" { source = "../.." name = "refunds" }
tests/basic.tftest.hcl asserts the redrive policy and the alarm threshold
Versioning: v1.0.0 tag; renames ship moved {} blocks; breaking input changes → v2.0.0 + UPGRADE.md
CI: terraform fmt -check · terraform validate · tflint · terraform test
for_each used for stable addressing.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-iac3 skills in this plugin
/policy-as-codeDesign policy-as-code guardrails (OPA/Rego, Sentinel, Checkov/Trivy) — enforce tagging, security, and cost rules in CI/plan with severity gates and exemptions./terraform-stateDesign Terraform state — remote backend, locking, state isolation/segmentation, drift detection, and safe import/move/rm operations without destroying live infra.Other plugins' skills for the same job