$npx -y skills add thomast1906/github-copilot-agent-skills --skill terraform-module-creatorDesign and create Terraform modules from real infrastructure requirements. Use when asked to create a Terraform module, build a module from a requirement, turn repeated Terraform into a module, design module inputs and outputs, review whether a Terraform pattern should become a m
| 1 | # Terraform Module Creator |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | Use this skill to help design and create Terraform modules from real infrastructure requirements. |
| 6 | |
| 7 | This skill is intended to do more than generate Terraform files. It should help decide whether a module is justified in the first place, define a clear module responsibility, shape a clean interface, and avoid over-engineering. |
| 8 | |
| 9 | The goal is to produce Terraform modules that are understandable, maintainable, and genuinely useful in practice. |
| 10 | |
| 11 | ## Prerequisites |
| 12 | |
| 13 | The following tools must be installed locally before using this skill. The skill references them during generation and validation steps. |
| 14 | |
| 15 | | Tool | Purpose | Install | |
| 16 | |------|---------|---------| |
| 17 | | [Terraform](https://developer.hashicorp.com/terraform/install) | Core IaC tool — `init`, `validate`, `fmt` | `brew install hashicorp/tap/terraform` | |
| 18 | | [terraform-docs](https://terraform-docs.io/user-guide/installation/) | Generates README inputs/outputs from module source | `brew install terraform-docs` | |
| 19 | | [tflint](https://github.com/terraform-linters/tflint#installation) | Static analysis — catches deprecated args, provider-specific issues | `brew install tflint` | |
| 20 | | [tflint-ruleset-azurerm](https://github.com/terraform-linters/tflint-ruleset-azurerm) | Azure-specific tflint rules | configured via `.tflint.hcl` (see [VALIDATION.md](references/VALIDATION.md)) | |
| 21 | |
| 22 | **Minimum versions:** Terraform ≥ 1.2 (required for `lifecycle` preconditions/postconditions). terraform-docs ≥ 0.16. tflint ≥ 0.50. |
| 23 | |
| 24 | If any tool is missing, the skill will flag this and suggest the install command before running validation steps. |
| 25 | |
| 26 | ## Required MCP Tools |
| 27 | |
| 28 | This skill makes active use of the HashiCorp Terraform Registry MCP and the Azure MCP Server. Use the tools below at the indicated stages of the workflow. Full parameter reference and example call sequences are in [references/MCP-TOOLS.md](references/MCP-TOOLS.md). |
| 29 | |
| 30 | | Tool | Stage | Purpose | |
| 31 | |------|-------|---------| |
| 32 | | `azure-azureterraformbestpractices` | Step 1 — Understand the ask | Get Azure Terraform best practices before starting design | |
| 33 | | `azure-get_azure_bestpractices` | Step 1 — Understand the ask | Get platform-level best practices for the specific Azure service | |
| 34 | | `azure-documentation` | Step 1 — Understand the ask | Look up CAF naming standards, DNS zone names, service feature behaviour | |
| 35 | | `azure-wellarchitectedframework` | Step 1 / Step 6 | Get WAF pillar recommendations to inform secure, reliable defaults | |
| 36 | | `mcp_terraform_search_modules` | Step 2 — Decide module type | Check if an Azure Verified Module or registry module already exists | |
| 37 | | `mcp_terraform_get_module_details` | Step 2 — Decide module type | Review an existing module's inputs/outputs to assess fit | |
| 38 | | `mcp_terraform_get_provider_capabilities` | Step 3 — Define boundary | Discover what azurerm resources exist for the service area | |
| 39 | | `mcp_terraform_search_providers` | Step 4 — Design interface | Find provider resource documentation by service slug | |
| 40 | | `mcp_terraform_get_provider_details` | Step 4 — Design interface | Get full argument reference and attribute reference for a resource | |
| 41 | | `mcp_terraform_get_latest_provider_version` | Step 6 — Generate module | Get the current latest azurerm version for versions.tf | |
| 42 | |
| 43 | **Important:** Before invoking any Azure MCP tool, run a discovery call with `learn=true` or `tool_search_tool_regex` to confirm the exact tool name. Do not hardcode names that may change. |
| 44 | |
| 45 | ## When to Use |
| 46 | |
| 47 | - a user wants to create a new Terraform module from a requirement or scenario |
| 48 | - a repeated Terraform pattern may need to become a shared module |
| 49 | - a team wants help shaping module inputs, outputs, and scope |
| 50 | - a platform team wants to define a reusable Terraform pattern without unnecessary abstraction |
| 51 | - reviewing whether plain Terraform resources would be better than introducing a new module |
| 52 | - creating Azure-focused Terraform modules that need to align with platform standards and operational expectations |
| 53 | |
| 54 | ## Core principles |
| 55 | |
| 56 | Always optimise for the following: |
| 57 | |
| 58 | - **KISS** — Keep the module easy to understand, easy to consume, and easy to support. |
| 59 | - **DRY with judgement** — Reduce meaningful duplicat |