# terraform-module-creator

Builds clean Terraform modules with separate resource files, strict variable validation, and outputs. Ideal for turning messy root configurations into shared infrastructure blocks.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 109
- Author: c0x12c
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/c0x12c/ai-toolkit/tree/HEAD/toolkit/skills/terraform-module-creator/SKILL.md
- Updated: 2026-06-18
- HTML: https://affpapa.org/en/nevibecode/skills/terraform-module-creator

## What it 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.

## Requirements
- Works with: Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/terraform-module-creator/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/terraform-module-creator/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/terraform-module-creator/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/terraform-module-creator/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install c0x12c/ai-toolkit terraform-module-creator
```

2. **Manually: put the files in place**
- File: `.github/skills/terraform-module-creator/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/c0x12c/ai-toolkit --path toolkit/skills/terraform-module-creator
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/terraform-module-creator/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add c0x12c/ai-toolkit --skill terraform-module-creator -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/c0x12c/ai-toolkit/tree/HEAD/toolkit/skills/terraform-module-creator/SKILL.md

## When to use it
- convert scattered inline cloud resources into clean Terraform modules
- split resources into separate files using consistent `this` naming
- add regex validation to variables and hide secrets in module outputs
- generate version constraints and caller examples for the module

## Example prompts
- Extract the database resources from `main.tf` into an `rds` Terraform module
- Scaffold a new ECS module with an isolated security group configuration
- Create an S3 module with input validation and pinned provider versions

## Similar
- [wizard](https://affpapa.org/en/nevibecode/skills/wizard.md) — skill · 553369 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [setup-pre-commit](https://affpapa.org/en/nevibecode/skills/setup-pre-commit.md) — skill · 489289 installs
- [using-git-worktrees](https://affpapa.org/en/nevibecode/skills/using-git-worktrees.md) — skill · 217153 installs
- [finishing-a-development-branch](https://affpapa.org/en/nevibecode/skills/finishing-a-development-branch.md) — skill · 214439 installs
- [orca-cli](https://affpapa.org/en/nevibecode/skills/orca-cli.md) — skill · 354000 installs

From the same set: [c0x12c/ai-toolkit](https://affpapa.org/en/nevibecode/by/c0x12c/ai-toolkit.md) — 33 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
