# Terraform

> Terraform is an open-source agent skill for cloud and infrastructure. Gives the agent Terraform and HCL coding conventions for AWS infrastructure projects. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/sorah/config/tree/master/claude/marketplace/plugins/sorah-guides/skills/terraform
- **Repository:** https://github.com/sorah/config
- **GitHub stars:** 31
- **License:** MIT
- **Skill name:** terraform
- **Collection:** https://github.com/sorah/config
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill sets out house conventions for writing and reviewing Terraform code, with a focus on AWS. It covers how to prefer data sources over hardcoded values, how to name resources and variables, and how to lay out files within a Terraform directory, such as separating provider, backend, version constraints, IAM and outputs into their own files.

The AWS-specific guidance steers the agent toward aws_iam_policy_document data sources instead of jsonencode, reuse of AWS managed policies, default_tags at the provider level, and tighter IAM roles with specific resource ARNs. It also describes naming rules for IAM roles and instance profiles and how trust policies are structured.

The skill is guidance only: it contains no scripts and expects the agent to work on Terraform files in the current project. Project-specific conventions such as a CLAUDE.md or style guide are meant to override it.

## When your agent uses it

> This skill should be used when writing or reviewing Terraform code, or when the project uses "Terraform", "HCL", "tfvars", "aws_iam_role", "data sources", or infrastructure-as-code patterns. Provides Terraform coding conventions, patterns, and best practices. Project-specific conventions always take priority.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/terraform)
- [License: MIT](https://github.com/sorah/config/tree/HEAD/claude/marketplace/plugins/sorah-guides/skills/terraform)

## Features

- **Naming conventions:** Rules for snake_case, PascalCase IAM names and hyphenated resource identifiers, matching provider resource names.
- **Standard file layout:** Suggested split of a Terraform directory into provider, backend, version, resource and IAM files.
- **IAM policy patterns:** Guidance on policy documents, trust policies with a -trust suffix, managed policies and narrow resource ARNs.
- **Tagging with default_tags:** Provider-level tags for Project and Component, plus resource-specific tags where needed.
- **Variable and argument style:** Rules for typed variables, default empty maps, aligned equals signs and trailing commas.
- **Instance profile linkage:** Keeps instance profile names aligned with their associated IAM role names.

## Good for

- Review a Terraform module for naming and file layout consistency
- Write an IAM role and trust policy for an EC2 instance
- Refactor hardcoded account or region values to data sources
- Add provider-level default tags to an AWS Terraform project
- Convert a jsonencode IAM policy into an aws_iam_policy_document

## Install

### Claude Code

This skill ships in the `sorah-guides` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add sorah/config
/plugin install sorah-guides@sorah-marketplace
```

Or copy only this skill to `~/.claude/skills/terraform`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/terraform &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/terraform" ~/.claude/skills/terraform &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/terraform` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/terraform` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/terraform &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/terraform" ~/.agents/skills/terraform &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/terraform` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/terraform` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/terraform &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/terraform" ~/.cursor/skills/terraform &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/terraform` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/sorah/config.git --path claude/marketplace/plugins/sorah-guides/skills/terraform
```

Or copy the folder to `~/.gemini/skills/terraform` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/terraform`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/sorah/config.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/terraform &&
cp -R "$tmp/claude/marketplace/plugins/sorah-guides/skills/terraform" ~/.copilot/skills/terraform &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/terraform` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/sorah/config.git
```

Then copy `config/claude/marketplace/plugins/sorah-guides/skills/terraform` into your agent's skills folder as `terraform`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Terraform need to run?

It has no scripts and no tools are declared. It only supplies conventions that the agent follows while working on Terraform files.

### Does Terraform override my project's own rules?

No. The skill states that project-specific conventions such as CLAUDE.md or style guides always take priority over its guidance.

### When does Terraform load?

It is meant to load when the agent is writing or reviewing Terraform code, or when the project uses Terraform, HCL, tfvars, aws_iam_role, data sources or infrastructure-as-code patterns.

### How do I install Terraform in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/terraform to use it in all your projects, or to .claude/skills/terraform in one project. Or install the sorah-guides plugin, which includes it: /plugin marketplace add sorah/config, then /plugin install sorah-guides@sorah-marketplace.

### Does Terraform run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Terraform?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Terraform?

The closest alternatives to Terraform are Terravision cloud diagrams, Coding standards, Coding, Code and AWS well architected review.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Terravision cloud diagrams](https://ai-powered.com/skills/terravision-cloud-diagrams): Terravision cloud diagrams is an open-source agent skill for cloud and infrastructure.
- [Coding standards](https://ai-powered.com/skills/coding-standards-fmarzochi): Coding standards is an open-source agent skill for developer tools.
- [Coding](https://ai-powered.com/skills/coding): Coding is an open-source agent skill for developer tools.
- [Code](https://ai-powered.com/skills/code): Code is an open-source agent skill for developer tools.
- [AWS well architected review](https://ai-powered.com/skills/aws-well-architected-review): AWS well architected review is an open-source agent skill for cloud and infrastructure.
- [Context engineering](https://ai-powered.com/skills/context-engineering): Context engineering is an open-source agent skill for developer tools.
- [Conventions claude](https://ai-powered.com/skills/conventions-claude-xiaolai): Conventions claude is an open-source agent skill for ai models and llm tooling.
- [Sh kb misconfig](https://ai-powered.com/skills/sh-kb-misconfig): Sh kb misconfig is an open-source agent skill for cloud and infrastructure.

---
Source: https://ai-powered.com/skills/terraform-sorah
