terraform-module-creator — Claude Code skill: how to install
Builds clean Terraform modules with separate resource files, strict variable validation, and outputs. Ideal for turning messy root configurations into shared infrastructure blocks.
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a claude-codeWhat terraform-module-creator does
The skill asks for the intended module name, cloud resources to include, and target callers before writing files. It sets up a dedicated directory with main.tf, variables.tf, outputs.tf, versions.tf, and documentation. Each resource type gets its own .tf file instead of living in one crowded template. The primary resource is named this.
Variables avoid hardcoded defaults for critical parameters. The skill enforces regex patterns on naming strings and packs related options into object types with optional() attributes. Sensitive outputs like database credentials get marked with sensitive = true. Security groups rely on name_prefix to allow clean updates before destruction.
Provider blocks are deliberately omitted from the generated code. The root project must configure providers itself, because hardcoding them inside reusable modules breaks downstream pipelines.
What it helps with
- convert scattered inline cloud resources into clean Terraform modules
- split resources into separate files using consistent
thisnaming - add regex validation to variables and hide secrets in module outputs
- generate version constraints and caller examples for the module
Example prompts for the agent
- Extract the database resources from
main.tfinto anrdsTerraform module - Scaffold a new ECS module with an isolated security group configuration
- Create an S3 module with input validation and pinned provider versions
How to install terraform-module-creator
1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a claude-code2Manually: put the files in place
~/.claude/skills/terraform-module-creator/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/terraform-module-creator/
1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a codex2Manually: put the files in place
.agents/skills/terraform-module-creator/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a cursor2Manually: put the files in place
.cursor/skills/terraform-module-creator/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install c0x12c/ai-toolkit terraform-module-creator2Manually: put the files in place
.github/skills/terraform-module-creator/SKILL.md1Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a gemini-cli2Platform CLI
gemini skills install https://github.com/c0x12c/ai-toolkit --path toolkit/skills/terraform-module-creatorManually: put the files in place
.devin/skills/terraform-module-creator/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about terraform-module-creator
How do I install terraform-module-creator in Claude Code?
Run npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a claude-code. This adds the skill definition to your Claude Code workspace.
Why does the skill put each resource type in a separate file?
Isolating resources into dedicated files keeps the module readable as infrastructure grows. The main resource lives in its own file under the identifier this, while auxiliary parts like security groups stay in separate files.
Why are provider blocks left out of the generated module?
Reusable Terraform modules must inherit providers from the root configuration. Declaring provider blocks directly in a child module causes errors when deploying across multiple regions or accounts.