Token导航 LogoToken导航

Agent Skill · 研究检索

terraform-validator(Terraform validator 搜索)

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

terraform-validator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 28,502。

总安装 3,213周安装 138GitHub Stars 197下载 1,126核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:terraform-validator(Terraform validator 搜索)
来源仓库:https://github.com/akin-ozer/cc-devops-skills
仓库路径:skills/terraform-validator
安装命令:
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terraform-validator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terraform-validator

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

对 Terraform 配置进行语法、语义和业务规则校验。适用于预发布检查、合规审计和自动化测试环节。通过 GitHub 安装后,在 Codex、Claude、Cursor、Gemini CLI 中调用命令扫描整个项目目录。验证规则需根据实际业务需求定制,避免过度限制灵活性。

terraform-validator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/terraform-validator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terraform-v…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

terraform-validator 怎么安装?

在终端执行 npx skills add https://github.com/akin-ozer/cc-devops-skills --skill terraform-validator。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

terraform-validator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

terraform-validator 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

terraform-validator 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

terraform-validator 用的人多吗?

公开数据是累计安装 3,213 次,近一周安装 138 次,下载 1,126 次,GitHub 197 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

terraform-validator 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
terraform-validator

Terraform validator 搜索 · 本页

3,213197调用外部服务未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Terraform Validator

Comprehensive toolkit for validating, linting, and testing Terraform configurations with automated workflows for syntax validation, security scanning, and intelligent documentation lookup.

⚠️ Critical Requirements Checklist

STOP: You MUST complete these steps in order. Do NOT skip any REQUIRED step.

StepActionRequired
1Run bash scripts/extract_tf_info_wrapper.sh <path>✅ REQUIRED
2Context7 lookup for ALL providers (explicit AND implicit); WebSearch fallback if not found✅ REQUIRED
3READ references/security_checklist.md✅ REQUIRED
4READ references/best_practices.md✅ REQUIRED
5Run terraform fmt✅ REQUIRED
6Run tflint (or note as skipped if unavailable)Recommended
7Run terraform init (if not initialized)✅ REQUIRED
8Run terraform validate✅ REQUIRED
9Run bash scripts/run_checkov.sh <path>✅ REQUIRED
10Cross-reference findings with security_checklist.md sections✅ REQUIRED
11Generate report citing reference files✅ REQUIRED
12Run regression tests (bash tests/test_regression.sh)✅ REQUIRED
13Run lightweight CI checks (bash -n, py_compile, smoke)✅ REQUIRED
IMPORTANT: Steps 3-4 (reading reference files) must be completed BEFORE running security scans. The reference files contain remediation patterns that MUST be cited in your report.
Context7 Fallback: If Context7 does not have a provider (common for: random, null, local, time, tls), use WebSearch: "terraform-provider-{name} hashicorp documentation"

When to Use This Skill

  • Working with Terraform files (.tf, .tfvars, .tfstate)
  • Validating Terraform configuration syntax and structure
  • Linting and formatting HCL code
  • Performing dry-run testing with terraform plan
  • Debugging Terraform errors or misconfigurations
  • Understanding custom Terraform providers or modules
  • Security validation of Terraform configurations

External Documentation

Validation Workflow

IMPORTANT: Follow this workflow in order. Each step is REQUIRED unless explicitly marked optional.

1. Identify Terraform files in scope
   ├─> Single file, directory, or multi-environment

2. Extract Provider/Module Info (REQUIRED)
   ├─> MUST run: bash scripts/extract_tf_info_wrapper.sh <path>
   ├─> Parse output for providers and modules
   └─> Use for Context7 documentation lookup

3. Lookup Provider Documentation (REQUIRED)
   ├─> For EACH provider detected:
   │   ├─> mcp__context7__resolve-library-id with "terraform-provider-{name}"
   │   ├─> mcp__context7__query-docs for version-specific guidance
   │   └─> If NOT found in Context7: WebSearch fallback (see below)
   └─> Note any custom/private providers for WebSearch

4. Read Reference Files (REQUIRED before validation)
   ├─> MUST READ: references/security_checklist.md (before security scan)
   ├─> MUST READ: references/best_practices.md (for structure validation)
   └─> Reference common_errors.md if errors occur

5. Format and Lint (REQUIRED)
   ├─> MUST run: terraform fmt -recursive (auto-fix formatting)
   ├─> MUST run: terraform fmt -check -recursive (verify no drift)
   ├─> RUN: tflint (or note as skipped if unavailable)
   └─> Report formatting issues

6. Syntax Validation (REQUIRED)
   ├─> MUST run: terraform init (if not initialized)
   ├─> MUST run: terraform validate
   └─> Report syntax errors (consult common_errors.md)

7. Security Scanning (REQUIRED)
   ├─> MUST run: bash scripts/run_checkov.sh <path>
   ├─> Analyze policy violations against security_checklist.md
   └─> Suggest remediations from reference

8. Dry-Run Testing (if credentials available)
   ├─> terraform plan
   ├─> Analyze planned changes
   └─> Report potential issues

9. Regression and Wrapper Determinism Checks (REQUIRED)
   ├─> MUST run: bash tests/test_regression.sh
   ├─> Confirms parser error handling returns non-zero
   ├─> Confirms implicit provider detection for docs lookup
   ├─> Confirms wrapper argument handling is deterministic
   └─> Confirms checkov wrapper preserves scanner exit code

10. Lightweight CI Checks (REQUIRED)
   ├─> MUST run: bash -n scripts/*.sh
   ├─> MUST run: python3 -m py_compile scripts/*.py
   ├─> MUST run: smoke check for extract wrapper on sample fixture
   └─> Record command outputs and exit codes

11. Generate Comprehensive Report
   ├─> Include all findings with severity
   ├─> Reference best_practices.md for recommendations
   └─> Offer to fix issues if appropriate

Required Reference File Reading

You MUST read these reference files during validation:

WhenReference FileAction
Before security scanreferences/security_checklist.mdRead to understand security checks and remediation patterns
During validationreferences/best_practices.mdRead to validate project structure, naming, and patterns
If errors occurreferences/common_errors.mdRead to find solutions for specific error messages
If using Terraform 1.10+references/advanced_features.mdRead to understand ephemeral values, actions, list resources

Required Script Usage

You MUST use these wrapper scripts instead of calling tools directly:

TaskScriptCommand
Extract provider/module infoextract_tf_info_wrapper.shbash scripts/extract_tf_info_wrapper.sh <path>
Run security scanrun_checkov.shbash scripts/run_checkov.sh <path>
Install checkov (if missing)install_checkov.shbash scripts/install_checkov.sh install
Note: extract_tf_info_wrapper.sh automatically handles the python-hcl2 dependency. If system Python lacks python-hcl2, it creates/reuses a cached virtual environment under ~/.cache/terraform-validator/ by default.

Script Run Context (REQUIRED)

  • Default working directory: devops-skills-plugin/skills/terraform-validator
  • If running from elsewhere, use absolute script paths:

- bash /absolute/path/to/terraform-validator/scripts/extract_tf_info_wrapper.sh <path> - bash /absolute/path/to/terraform-validator/scripts/run_checkov.sh <path> - bash /absolute/path/to/terraform-validator/scripts/install_checkov.sh install

Context7 Provider Documentation Lookup (REQUIRED)

For EVERY provider detected, you MUST lookup documentation via Context7:

1. Run extract_tf_info_wrapper.sh to get provider list
2. For each provider (e.g., "aws", "google", "azurerm"):
   a. Call: mcp__context7__resolve-library-id with "terraform-provider-{name}"
   b. Call: mcp__context7__query-docs with the resolved ID
   c. Note version-specific features and constraints
3. Include relevant provider guidance in validation report

Example for AWS provider:

mcp__context7__resolve-library-id("terraform-provider-aws")
mcp__context7__query-docs(context7CompatibleLibraryID, "best practices")

Context7 Fallback to WebSearch (REQUIRED)

If Context7 does not find a provider, you MUST fall back to WebSearch:

1. If mcp__context7__resolve-library-id returns no results or provider not found:
   a. Use WebSearch with query: "terraform-provider-{name} hashicorp documentation"
   b. For specific version: "terraform-provider-{name} {version} documentation site:registry.terraform.io"
2. Common providers NOT in Context7 (use WebSearch directly):
   - random (hashicorp/random)
   - null (hashicorp/null)
   - local (hashicorp/local)
   - time (hashicorp/time)
   - tls (hashicorp/tls)
3. Document in report: "Provider docs via WebSearch (not in Context7)"

WebSearch Fallback Example:

# If Context7 fails for random provider:
WebSearch("terraform-provider-random hashicorp documentation site:registry.terraform.io")
Note: HashiCorp utility providers (random, null, local, time, tls, archive, external, http) may not be indexed in Context7. Always fall back to WebSearch for these.

Detecting Implicit Providers (REQUIRED)

IMPORTANT: Providers can be used without being declared in required_providers. You MUST detect ALL providers:

Detection Methods

  1. Explicit Providers: Listed in required_providers block (from extract_tf_info_wrapper.sh output)
  2. Implicit Providers: Inferred from resource type prefixes

Common Implicit Provider Patterns

Resource Type PrefixProvider NameContext7 Lookup
random_*randomterraform-provider-random
null_*nullterraform-provider-null
local_*localterraform-provider-local
tls_*tlsterraform-provider-tls
time_*timeterraform-provider-time
archive_*archiveterraform-provider-archive
http (data source)httpterraform-provider-http
external (data source)externalterraform-provider-external

Workflow for Complete Provider Detection

1. Parse extract_tf_info_wrapper.sh output
2. Get providers from "providers" array (explicit)
3. Get resources from "resources" array
4. For EACH resource type:
   a. Extract prefix (e.g., "random" from "random_id")
   b. Check if already in providers list
   c. If NOT in providers: add as implicit provider
5. Perform Context7 lookup for ALL providers (explicit + implicit)

Example

If extract_tf_info_wrapper.sh returns:

{
  "providers": [{"name": "aws", ...}],
  "resources": [
    {"type": "aws_instance", ...},
    {"type": "random_id", ...}
  ]
}

You MUST lookup BOTH:

  • terraform-provider-aws (explicit)
  • terraform-provider-random (implicit - detected from random_id resource)

Quick Reference Commands

Format and Lint

# Check formatting (dry-run)
terraform fmt -check -recursive .

# Apply formatting
terraform fmt -recursive .

# Run tflint (requires .tflint.hcl config)
tflint --init              # Install plugins
tflint --recursive         # Lint all modules
tflint --format compact    # Compact output
TFLint Configuration: See TFLint Ruleset documentation for plugin setup.

Validate Configuration

# Initialize (downloads providers and modules)
terraform init

# Validate syntax
terraform validate

# Validate with JSON output
terraform validate -json

Security Scanning

MUST use wrapper script:

# Use the wrapper script (REQUIRED)
bash scripts/run_checkov.sh ./terraform

# With specific options
bash scripts/run_checkov.sh -f json ./terraform
bash scripts/run_checkov.sh --compact ./terraform
Detailed Security Scanning: You MUST read references/security_checklist.md before running security scans to understand the checks and remediation patterns.

Security Finding Cross-Reference (REQUIRED)

When reporting security findings, you MUST cite specific sections from security_checklist.md:

Cross-Reference Mapping

Checkov Check Patternsecurity_checklist.md Section
CKV_AWS_24 (SSH open)"Overly Permissive Security Groups"
CKV_AWS_260 (HTTP open)"Overly Permissive Security Groups"
CKV_AWS_16 (RDS encryption)"Encryption at Rest"
CKV_AWS_17 (RDS public)"RDS Databases"
CKV_AWS_130 (public subnet)"Network Security"
CKV_AWS_53-56 (S3 public access)"Public S3 Buckets"
CKV_AWS_* (IAM)"IAM Security"
CKV_AWS_79 (IMDSv1)"ECS/EKS"
Hardcoded passwords"Hardcoded Credentials"
Sensitive outputs"Sensitive Output Exposure"

Report Template for Security Findings

### Security Issue: [Check ID]

**Finding:** [Description from checkov]
**Resource:** [Resource name and file:line]
**Severity:** [HIGH/MEDIUM/LOW]

**Reference:** security_checklist.md - "[Section Name]"

**Remediation Pattern:**
[Copy relevant code example from security_checklist.md]

**Recommended Fix:**
[Specific fix for this configuration]

Example Cross-Referenced Report

### Security Issue: CKV_AWS_24

**Finding:** Security group allows SSH from 0.0.0.0/0
**Resource:** aws_security_group.web (main.tf:47-79)
**Severity:** HIGH

**Reference:** security_checklist.md - "Overly Permissive Security Groups"

**Remediation Pattern (from reference):**

variable "admin_cidr" { description = "CIDR block for admin access" type = string }

resource "aws_security_group" "app" { ingress { description = "SSH from admin network only" from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = [var.admin_cidr] } }


**Recommended Fix:** Replace `cidr_blocks = ["0.0.0.0/0"]` with a variable or specific CIDR range.

Dry-Run Testing

# Generate execution plan
terraform plan

# Save plan to file
terraform plan -out=tfplan

# Plan with specific var file
terraform plan -var-file="production.tfvars"

# Plan with target resource
terraform plan -target=aws_instance.example

Plan Output Symbols:

  • + Resources to be created
  • - Resources to be destroyed
  • ~ Resources to be modified
  • -/+ Resources to be replaced

Handling Missing Tools

When validation tools are not installed, follow this recovery workflow:

Recovery Workflow (REQUIRED)

1. Detect missing tool
2. Inform user what is missing and why it's needed
3. Provide installation command
4. ASK user: "Would you like me to install [tool] and continue?"
5. If yes: Run installation and RERUN the validation step
6. If no: Note as skipped in report, continue with available tools

Tool-Specific Recovery

If checkov is missing:

1. Inform: "Checkov is not installed. It's required for security scanning."
2. Ask: "Would you like me to install it? I'll use: bash scripts/install_checkov.sh install"
3. If yes: Run install script, then rerun security scan

If tflint is missing:

1. Inform: "TFLint is not installed. It provides advanced linting beyond terraform validate."
2. Ask: "Would you like me to install it?"
3. Provide: brew install tflint (macOS) or installation script (Linux)

If python-hcl2 is missing:

The extract_tf_info_wrapper.sh script handles this automatically by creating
or reusing a cached venv. No user action required.

Required tools: terraform fmt, terraform init, terraform validate Required for full security validation: checkov Optional but recommended: tflint

Scripts

ScriptPurposeUsage
extract_tf_info_wrapper.shParse Terraform files for providers/modules (auto-handles dependencies)bash scripts/extract_tf_info_wrapper.sh <path>
extract_tf_info.pyCore parser (requires python-hcl2)Use wrapper instead
run_checkov.shWrapper for Checkov scans with enhanced outputbash scripts/run_checkov.sh <path>
install_checkov.shInstall Checkov in isolated venvbash scripts/install_checkov.sh install

Reference Documentation

MUST READ during validation workflow:

ReferenceWhen to ReadContent
references/security_checklist.mdBefore security scanSecurity validation, Checkov/Trivy usage, common policies, remediation patterns
references/best_practices.mdDuring validationProject structure, naming conventions, module design, state management
references/common_errors.mdWhen errors occurError database with causes and solutions
references/advanced_features.mdIf Terraform >= 1.10Ephemeral values (1.10+), Actions (1.14+), List Resources (1.14+)

Workflow Examples

Example 1: Validate Single File

1. MUST: bash scripts/extract_tf_info_wrapper.sh main.tf
2. MUST: Context7 lookup for each provider detected
3. MUST: Read references/security_checklist.md
4. MUST: Read references/best_practices.md
5. RUN: terraform fmt -check main.tf
6. RUN: terraform init (if needed) && terraform validate
7. MUST: bash scripts/run_checkov.sh -f json main.tf
8. Report issues with remediation from references
9. If custom providers: WebSearch for documentation

Example 2: Full Module Validation

1. Identify all .tf files in directory
2. MUST: bash scripts/extract_tf_info_wrapper.sh ./modules/vpc/
3. MUST: Context7 lookup for ALL providers
4. MUST: Read references/security_checklist.md
5. MUST: Read references/best_practices.md
6. RUN: terraform fmt -recursive
7. RUN: tflint --recursive (or note as skipped if unavailable)
8. RUN: terraform init && terraform validate
9. MUST: bash scripts/run_checkov.sh ./modules/vpc/
10. Analyze findings against security_checklist.md
11. Validate structure against best_practices.md
12. Provide comprehensive report with references

Example 3: Production Dry-Run

1. Verify terraform initialized
2. MUST: Read references/security_checklist.md (production focus)
3. RUN: terraform plan -var-file="production.tfvars"
4. Analyze for unexpected changes
5. Highlight create/modify/destroy operations
6. Flag security concerns (compare with security_checklist.md)
7. Recommend whether safe to apply

Advanced Features

Terraform 1.10+ introduces ephemeral values for secure secrets management. Terraform 1.14+ adds Actions for imperative operations and List Resources for querying infrastructure.

MUST READ: references/advanced_features.md when:

  • Terraform version >= 1.10 is detected
  • Configuration uses ephemeral blocks
  • Configuration uses action blocks
  • Configuration uses .tfquery.hcl files

Integration with Other Skills

  • k8s-yaml-validator - For Terraform Kubernetes provider validation
  • helm-validator - When Terraform manages Helm releases
  • k8s-debug - For debugging infrastructure provisioned by Terraform

Notes

  • Always run validation in order: extract info → lookup docs → read refs → format → lint → validate → security → plan
  • MUST use wrapper scripts for extract_tf_info and checkov
  • MUST run bash tests/test_regression.sh after script changes
  • MUST run lightweight CI checks: bash -n scripts/*.sh and python3 -m py_compile scripts/*.py
  • MUST read reference files before relevant validation steps
  • MUST lookup provider docs via Context7 for ALL providers
  • MUST offer recovery/rerun when tools are missing
  • Never commit without running terraform fmt
  • Always review plan output before applying
  • Use version constraints for all providers and modules
  • Use remote state for team collaboration
  • Enable state locking to prevent concurrent modifications

Done Criteria

  • Validation instructions are executable end-to-end with one deterministic command path.
  • Wrapper scripts behave predictably in both success and failure paths (including propagated non-zero exits).
  • Regression tests cover parser error handling, implicit provider detection, wrapper argument handling, and checkov exit-code behavior.
  • Lightweight CI checks (bash -n, py_compile, smoke checks) pass before final reporting.

平台分布

Codex

38.05%
按下载量换算428

Claude

32.26%
按下载量换算363

Cursor

17.55%
按下载量换算198

Gemini CLI

9.88%
按下载量换算111

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills