terraform-skill
What it does
This skill guides work on infrastructure as code using Terraform or OpenTofu. It is for developers and DevOps engineers who manage cloud resources with code.
When to use it
- βWhen you are creating a new Terraform module or reorganizing an existing configuration.
- βWhen you need to set up tests or a CI/CD pipeline for infrastructure code.
- βWhen you are debugging Terraform state problems or reviewing configurations for security.
Skill link
https://github.com/agentscope-ai/QwenPaw/blob/main/plugins/bundle/cloudpaw/skills/terraform-skill/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βReview my Terraform project for security issues and suggest a module structure.β
5 new skills a week. 1 minute to read.
How it works
It explains how to choose a testing approach, structure modules, set up pipelines, and run scanning tools such as trivy and checkov. It applies these practices when reviewing or writing configurations.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Terraform Skill for Claude
Comprehensive Terraform and OpenTofu guidance covering testing, modules, CI/CD, and production patterns. Based on terraform-best-practices.com and enterprise experience.
When to Use This Skill
Activate this skill when:
- Creating new Terraform or OpenTofu configurations or modules
- Setting up testing infrastructure for IaC code
- Deciding between testing approaches (validate, plan, frameworks)
- Structuring multi-environment deployments
- Implementing CI/CD for infrastructure-as-code
- Reviewing or refactoring existing Terraform/OpenTofu projects
- Choosing between module patterns or state management approaches
Don't use this skill for:
- Basic Terraform/OpenTofu syntax questions (Claude knows this)
- Provider-specific API reference (link to docs instead)
- Cloud platform questions unrelated to Terraform/OpenTofu
Core Principles
1. Code Structure Philosophy
Module Hierarchy:
| Type | When to Use | Scope |
|---|---|---|
| Resource Module | Single logical group of connected resources | VPC + subnets, Security group + rules |
| Infrastructure Module | Collection of resource modules for a purpose | Multiple resource modules in one region/account |
| Composition | Complete infrastructure | Spans multiple regions/accounts |
Hierarchy: Resource β Resource Module β Infrastructure Module β Composition
Directory Structure:
environments/ # Environment-specific configurations
βββ prod/
βββ staging/
βββ dev/
modules/ # Reusable modules
βββ networking/
βββ compute/
βββ data/
examples/ # Module usage examples (also serve as tests)
βββ complete/
βββ minimal/
Key principle from terraform-best-practices.com:
- Separate environments (prod, staging) from modules (reusable components)
- Use examples/ as both documentation and integration test fixtures
- Keep modules small and focused (single responsibility)
For detailed module architecture, see: Code Patterns: Module Types & Hierarchy
2. Naming Conventions
Resources:
# Good: Descriptive, contextual
resource "aws_instance" "web_server" { }
resource "aws_s3_bucket" "application_logs" { }
# Good: "this" for singleton resources (only one of that type)
resource "aws_vpc" "this" { }
resource "aws_security_group" "this" { }
# Avoid: Generic names for non-singletons
resource "aws_instance" "main" { }
resource "aws_s3_bucket" "bucket" { }
Singleton Resources:
Use "this" when your module creates only one resource of that type:
β DO:
resource "aws_vpc" "this" {} # Module creates one VPC
resource "aws_security_group" "this" {} # Module creates one SG
β DON'T use "this" for multiple resources:
resource "aws_subnet" "this" {} # If creating multiple subnets
Use descriptive names when creating multiple resources of the same type.
Variables:
# Prefix with context when needed
var.vpc_cidr_block # Not just "cidr"
var.database_instance_class # Not just "instance_class"
Files:
main.tf- Primary resourcesvariables.tf- Input variablesoutputs.tf- Output valuesversions.tf- Provider versionsdata.tf- Data sources (optional)
Testing Strategy Framework
Decision Matrix: Which Testing Approach?
| Your Situation | Recommended Approach | Tools | Cost |
|---|---|---|---|
| Quick syntax check | Static analysis | terraform validate, fmt |
Free |
| Pre-commit validation | Static + lint | validate, tflint, trivy, checkov |
Free |
| Terraform 1.6+, simple logic | Native test framework | Built-in terraform test |
Free-Low |
| Pre-1.6, or Go expertise | Integration testing | Terratest | Low-Med |
| Security/compliance focus | Policy as code | OPA, Sentinel | Free |
| Cost-sensitive workflow | Mock providers (1.7+) | Native tests + mocking | Free |
| Multi-cloud, complex | Full integration | Terratest + real infra | Med-High |
Testing Pyramid for Infrastructure
/\
/ \ End-to-End Tests (Expensive)
/____\ - Full environment deployment
/ \ - Production-like setup
/________\
/ \ Integration Tests (Moderate)
/____________\ - Module testing in isolation
/ \ - Real resources in test account
/________________\ Static Analysis (C
FAQ
Does it teach basic Terraform syntax?
No. It focuses on testing, modules, CI/CD, and architecture decisions rather than basic syntax.
Does it work with OpenTofu?
Yes. The skill covers both Terraform and OpenTofu.
Which security tools does it mention?
It mentions trivy and checkov for scanning infrastructure code for security issues.
Details
Original description by the author
Use when working with Terraform or OpenTofu - creating modules, writing tests (native test framework, Terratest), setting up CI/CD pipelines, reviewing configurations, choosing between testing approaches, debugging state issues, implementing security scanning (trivy, checkov), or making infrastructure-as-code architecture decisions
repo: agentscope-ai/QwenPaw
Popularity
- GitHub stars
- 37k
- Ranking position
- #7569
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
computer_use
37kLets your agent operate a live Windows or macOS app by observing the screen, clicking, and checking each result, when no direct tool can do the job.
browser
37kLets your agent drive a live web browser through the QwenPaw Browser SDK, reading pages, acting on them, and checking results before claiming success.
channel_message
37kLets your agent send a one-way message to a specific chat channel or session, such as a task-finished alert, once it has found the right destination.
chat_with_agent
37kLets your agent consult another AI agent for a second opinion, a plan, or a review, and continue that conversation with its earlier context.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.