state-analyzer

Analyze Terraform state files for security, cost, and best practice issues.

4|3|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/thrashr888/hcptf-cli --skill state-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-analyzer
Source: https://github.com/thrashr888/hcptf-cli/tree/main/.skills/state-analyzer
Command: npx skills add https://github.com/thrashr888/hcptf-cli --skill state-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you identify potential issues in your Terraform state files, such as security vulnerabilities, cost inefficiencies, and deviations from best practices, enabling you to optimize your infrastructure.

Core Features & Use Cases

  • Security Audits: Detect exposed secrets, insecure configurations, and public access.
  • Cost Optimization: Identify over-provisioned or unused resources.
  • Best Practice Checks: Ensure consistent tagging, naming conventions, and use of modern resource types.
  • Use Case: Before a major deployment, use this Skill to scan your production Terraform state for any publicly exposed S3 buckets or unencrypted databases.

Quick Start

Use the state-analyzer skill to download the state from the 'my-org' organization's 'my-workspace' workspace and analyze it for security issues.

Frequently Asked Questions about state-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Terraform state files for security vulnerabilities?

Yes, you can identify cost optimization opportunities in your Terraform state by analyzing downloaded JSON state files to detect over-provisioned or unused resources, helping you reduce infrastructure waste and optimize deployments.

Can I analyze HCP Terraform workspace state for best practice violations?

You can analyze HCP Terraform workspace state for best practice violations by downloading the state files and parsing them to ensure consistent tagging, proper naming conventions, and the use of modern resource types across your infrastructure.

Do I need jq to parse Terraform state files for infrastructure analysis?

Yes, you need jq installed to parse Terraform state files for infrastructure analysis, as it is used to query and examine the detailed JSON configurations, attributes, and dependencies within the downloaded state files.

What is the best way to check Terraform state for exposed S3 buckets before deployment?

The best way to check Terraform state for exposed S3 buckets is to scan the downloaded state file to identify resources with public access permissions, enabling you to remediate security risks before a major production deployment.

How does Terraform state analysis detect unencrypted databases?

Terraform state analysis detects unencrypted databases by parsing the JSON state file to examine the encryption attributes and configurations of your database resources, flagging any instances that lack proper encryption settings.