analyze-state

Terraform state を分析・操作する。「state 確認」「state list」「state show」「リソース一覧」「state の移動」「state mv」「state rm」「terraform state」「state 操作」「リソースの状態」「state pull」などで起動。

16 stars

Best use case

analyze-state is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Terraform state を分析・操作する。「state 確認」「state list」「state show」「リソース一覧」「state の移動」「state mv」「state rm」「terraform state」「state 操作」「リソースの状態」「state pull」などで起動。

Teams using analyze-state should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/analyze-state/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/analyze-state/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/analyze-state/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How analyze-state Compares

Feature / Agentanalyze-stateStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Terraform state を分析・操作する。「state 確認」「state list」「state show」「リソース一覧」「state の移動」「state mv」「state rm」「terraform state」「state 操作」「リソースの状態」「state pull」などで起動。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# State Analyzer

Terraform state ファイルの分析と操作を支援します。

## 対応操作

| 操作 | トリガー例 | コマンド |
|------|-----------|----------|
| 一覧表示 | 「state list」「リソース一覧」 | `terraform state list` |
| 詳細表示 | 「state show」「リソース詳細」 | `terraform state show` |
| リモート取得 | 「state pull」「state 取得」 | `terraform state pull` |
| 移動 | 「state mv」「リソース移動」 | `terraform state mv` |
| 削除 | 「state rm」「state から削除」 | `terraform state rm` |

## 実行手順

### 1. 操作の判定

ユーザーの発話から操作を判定:

- **一覧系**: 「list」「一覧」「確認」→ `state list`
- **詳細系**: 「show」「詳細」「内容」→ `state show`
- **取得系**: 「pull」「取得」「ダウンロード」→ `state pull`
- **移動系**: 「mv」「移動」「rename」→ `state mv`
- **削除系**: 「rm」「削除」「remove」→ `state rm`

### 2. state list

```bash
terraform state list
```

出力例:

```
aws_instance.web
aws_security_group.web
aws_vpc.main
```

### 3. state show

```bash
terraform state show {resource_address}
```

出力例:

```
# aws_instance.web:
resource "aws_instance" "web" {
    ami                          = "ami-12345678"
    instance_type                = "t3.micro"
    ...
}
```

### 4. state pull

```bash
terraform state pull
```

リモートバックエンドから state をダウンロードして表示。

### 5. state mv(手動実行を案内)

**重要**: state mv はリソースのアドレスを変更する危険な操作のため、自動実行は禁止されています。

ユーザーに手動実行を案内:

```
## State 移動

以下のコマンドを手動で実行してください:

terraform state mv {source} {destination}

⚠️ 注意:
- この操作は state を変更します
- 実行前に terraform state list で現在の状態を確認してください
- 間違った移動は terraform state mv で戻せます
```

### 6. state rm(手動実行を案内)

**重要**: state rm はリソースを state から削除する危険な操作のため、自動実行は禁止されています。

ユーザーに手動実行を案内:

```
## State 削除

以下のコマンドを手動で実行してください:

terraform state rm {resource_address}

⚠️ 注意:
- 実際のインフラリソースは削除されません
- state から削除すると Terraform の管理外になります
- 再度管理するには import が必要です
```

### 7. 出力フォーマット

**state list**:

```
## State リソース一覧

| # | リソースアドレス |
|---|-----------------|
| 1 | aws_instance.web |
| 2 | aws_security_group.web |
| ... | ... |

合計: {N} リソース
```

**state show**:

```
## リソース詳細: {resource_address}

### 主要属性

| 属性 | 値 |
|------|-----|
| id | {id} |
| ... | ... |

### 全属性

{terraform state show の出力}
```

## よくある使い方

### リソースのリネーム

```bash
# 旧名から新名に移動
terraform state mv aws_instance.old_name aws_instance.new_name
```

### モジュール化

```bash
# ルートからモジュール内に移動
terraform state mv aws_instance.web module.web.aws_instance.main
```

### state から除外

```bash
# 管理対象外にする
terraform state rm aws_instance.legacy
```

## 注意事項

- ✅ `state list` / `state show` / `state pull` は読み取り専用で安全
- ⚠️ `state mv` / `state rm` は state を変更する操作
- ⚠️ `state rm` は実リソースを削除しない(Terraform 管理外になるだけ)
- ❌ 確認なしで `state mv` / `state rm` を実行しない

Related Skills

asciinema-analyzer

16
from diegosouzapw/awesome-omni-skill

Semantic analysis of asciinema recordings. TRIGGERS - analyze cast, keyword extraction, find patterns in recordings.

analyzing-financial-statements

16
from diegosouzapw/awesome-omni-skill

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

analyze-source-material

16
from diegosouzapw/awesome-omni-skill

Analyze mixed repositories (application code + infrastructure + policies + docs) to extract ALL components for ONE unified threat model. Use when analyzing codebases with multiple source types for threat modeling. Architecture modeling only - do NOT identify vulnerabilities.

analyze-malware

16
from diegosouzapw/awesome-omni-skill

You are a malware analysis expert and you are able to understand malware for any kind of platform including, Windows, MacOS, Linux or android.

analyze-high-unemployment-high-gdp-growth-fiscal-deficit-scenarios

16
from diegosouzapw/awesome-omni-skill

在「失業率走高/勞動市場轉弱」但「名目或實質 GDP 仍維持高位(或仍在成長)」的情境下,依據歷史關聯估算美國財政赤字占 GDP(Deficit/GDP)可能擴張的區間,並生成對長天期美債(長久期 UST)供給/利率風險的情境解讀。支援視覺化圖表輸出。

analyze-ci-failure-logs

16
from diegosouzapw/awesome-omni-skill

Parse and analyze CI failure logs to identify root causes and error patterns. Use when CI builds fail to understand what broke.

workflow-analyzer

16
from diegosouzapw/awesome-omni-skill

作業フローや手順を分析し、自動化可能な要素を特定する。ワークフロー分析時、自動化検討時、業務プロセス改善時、またはユーザーが作業フロー分析、自動化要素、業務手順、プロセス最適化に言及した際に使用する。

user-state-debugging

16
from diegosouzapw/awesome-omni-skill

Expert knowledge on debugging user account issues, diagnostic scripts (inspect-user-state.js), fix scripts (fix-user-billing-state.js, reset-user-onboarding.js), onboarding problems, billing sync issues, and Clerk vs database mismatches. Use this skill when user asks about "user stuck", "onboarding broken", "billing out of sync", "debug user", "reset user", or "user state".

springboot-architecture-analyzer

16
from diegosouzapw/awesome-omni-skill

系統化分析 Spring Boot 專案並生成完整的企業級架構文件,涵蓋系統概述、架構視圖、技術細節、部署策略等所有關鍵面向。

repository-analyzer

16
from diegosouzapw/awesome-omni-skill

Comprehensive repository analysis using Explore agents, web search, and Context7 to investigate codebase structure, technology stack, configuration, documentation quality, and provide actionable insights. Use this skill when asked to analyze, audit, investigate, or report on a repository or codebase. | Exploreエージェント、Web検索、Context7を用いた包括的なリポジトリ分析。コードベース構造、技術スタック、設定、ドキュメント品質を調査し、実用的な洞察を提供。リポジトリやコードベースの分析、監査、調査、レポート作成を依頼された場合に使用。

project-analyzer

16
from diegosouzapw/awesome-omni-skill

Automated brownfield codebase analysis. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile. Essential for Conductor integration and onboarding existing projects.

analyze-project

16
from diegosouzapw/awesome-omni-skill

Use when starting work on an unfamiliar project or needing to understand a codebase - performs comprehensive analysis discovering architecture, patterns, dependencies, testing coverage, and improvement opportunities. Do NOT use on projects you already know well or for targeted questions about specific files - use direct exploration instead for focused queries.