Terragrunt Skillのロゴ

Terragrunt Skill

コミュニティ
jfr992
terragrunt-skill

Use for Terragrunt work (0.68 to 1.2; OpenTofu or Terraform): building an infrastructure catalog, explicit stacks (terragrunt.stack.hcl), units wrapping OpenTofu/Terraform modules, live repos with a root.hcl hierarchy, remote state and locking (S3 lockfile, DynamoDB, GCS, azurerm), multi-account/multi-env with role assumption, classic Gruntwork live repos (_envcommon), migrating a terralith, exploring repos (find, list, dag), wiring dependencies (autoinclude, values), expansion blocks (for_each/count), the Content Addressable Store (CAS), OCI and versioned module sources, upgrading to 1.2, and CI/CD pipelines (GitHub Actions, GitLab).

概要

公開者jfr992
リポジトリterragrunt-skill
スキル名terragrunt-skill
スター
29
フォーク
7
同梱ファイル
33
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 33個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    jfr992がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Terragrunt Skill」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/jfr992/terragrunt-skill/tree/main/skills/terragrunt-skill
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jfr992/terragrunt-skill.git /tmp/terragrunt-skill
mkdir -p .claude/skills
cp -r /tmp/terragrunt-skill/skills/terragrunt-skill .claude/skills/terragrunt-skill
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでTerragrunt Skillを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にTerragrunt Skillを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Terragrunt Skillは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Terragrunt Infrastructure Skill

Overview

This skill provides guidance for infrastructure using Terragrunt with OpenTofu, following a three-repository pattern:

  1. Infrastructure Catalog - Units and stacks that reference modules from separate repos
  2. Infrastructure Live - Environment-specific deployments consuming the catalog
  3. Module Repos - Separate repositories for each OpenTofu module (independent versioning)

Step 0: Detect Versions

Before giving commands, check terragrunt --version, .terragrunt-version, mise.toml/.tool-versions, terragrunt_version_constraint in root.hcl, and whether tofu or terraform is installed. This skill defaults to TG 1.2 + OpenTofu ≥ 1.10. For older Terragrunt (0.68+), Terraform, or classic layouts, follow version-compatibility.md: use run-all/--terragrunt-* on < 0.77.22, classic layouts on < 0.78, no autoinclude on < 1.1, no expansion on < 1.2, and no state encryption on Terraform.

Choosing an Architecture

Default recommendation: explicit stacks — the catalog + terragrunt.stack.hcl + values pattern this skill teaches. Units are generated from stack files; configuration flows through values; no per-unit boilerplate.

Supported alternative: classic implicit stacks — the original Gruntwork pattern: account/region/env/component directory hierarchy, per-level .hcl variable files, shared component config in _envcommon/ via include + expose. Any directory of units is an implicit stack. Use it when the repo already follows it, when the footprint is too small to justify a catalog, or when the team isn't ready for stacks. See classic-live-structure.md.

Orthogonal choice: module organization — modules monorepo (modules/ + examples/, one tag versions all, //modules/x?ref= sourcing) vs module-per-repo (independent versioning). Either works with either architecture. See modules-monorepo.md.

Migrating classic → stacks: follow the official Terralith to Terragrunt guide.

Quick Navigation

TopicReference
Version compatibility (TG 0.68→1.2, OpenTofu vs Terraform)version-compatibility.md
Naming conventionsnaming.md
Catalog structurecatalog-structure.md
Live repo structurelive-structure.md
Classic live structure (implicit stacks)classic-live-structure.md
Modules monorepomodules-monorepo.md
Discovery commands (find/list/dag)discovery-commands.md
Root/account/env configsroot-config.md
Unit dependenciesdependencies.md
Expansion (for_each/count)expansion.md
Catalog scaffoldingcatalog-scaffolding.md
Stack commandsstack-commands.md
Patterns & best practicespatterns.md
State managementstate-management.md
Multi-account setupmulti-account.md
Performance optimizationperformance.md
Content Addressable Store (CAS)cas.md
CI/CD pipelines (shared + IAM/OIDC setup)cicd-pipelines.md
GitLab CI pipelinescicd-gitlab.md
GitHub Actions pipelinescicd-github.md

Core Concepts

Values Pattern

Units receive configuration through values.xxx:

hcl
inputs = {
  name        = values.name
  environment = values.environment
  instance_class = try(values.instance_class, "db.t3.medium")  # Optional with default
}

Dependency Wiring (autoinclude first)

Since Terragrunt 1.1, declare dependencies in the stack file with autoinclude so catalog units stay dependency-agnostic. See dependencies.md for the full pattern.

Reference Resolution (legacy)

Older catalogs resolve symbolic references like "../acm" to dependency outputs inside the unit:

hcl
inputs = {
  acm_certificate_arn = try(values.acm_certificate_arn, "") == "../acm" ?
    dependency.acm.outputs.acm_certificate_arn :
    values.acm_certificate_arn
}

Keep it when maintaining an existing catalog; prefer autoinclude for new work.

Module Sourcing

Units reference modules via Git URL with version from values:

hcl
terraform {
  source = "git::git@github.com:YOUR_ORG/modules/rds.git//app?ref=${values.version}"
}

For catalog-internal references (units/stacks/modules in the same repo), Terragrunt 1.1+ allows plain relative paths with update_source_with_cas = true — stack generate rewrites them to content-addressed references, so no URL pinning or version plumbing is needed. See cas.md.

Common Operations

Create New Unit

  1. Create units/<name>/terragrunt.hcl
  2. Reference module via Git URL with ${values.version}
  3. Use values.xxx for inputs
  4. Add dependencies with mock outputs
  5. Wire dependencies via autoinclude in the stack (legacy: "../unit" reference resolution)

Create New Stack

  1. Create stacks/<name>/terragrunt.stack.hcl
  2. Define locals for computed values
  3. Add unit blocks referencing catalog units
  4. Pass values including version and dependency paths

Deploy to New Environment

  1. Create environment directory structure
  2. Add env.hcl with state_bucket_suffix
  3. Add stack files referencing catalog and run terragrunt stack generate
  4. Run terragrunt backend bootstrap --all to create state resources (or pass --backend-bootstrap on the first run). Do not use run --all -- backend bootstrap: everything after -- goes to OpenTofu/Terraform.

Best Practices

  1. Pin module versions - Use Git tags in values.version
  2. Pin catalog versions - Use refs in unit source URLs
  3. Wire dependencies with autoinclude - legacy "../unit" resolution only in existing catalogs
  4. Provide mock outputs - Enable plan/validate without dependencies
  5. Auto-detect features - length(keys(try(values.X, {}))) > 0
  6. Override paths - try(values.X_path, "../default")
  7. Separate state per environment - Use state_bucket_suffix

Common Pitfalls

  1. Git refspec error - Use //path?ref=branch NOT ?ref=branch//path
  2. Heredoc in ternary - Wrap in parentheses: condition ? (\n<<-EOF\n...\nEOF\n) : ""
  3. Missing mock outputs - Always provide for plan/validate
  4. Hardcoded paths - Use local paths only for testing

Upgrading to 1.2

  1. base64gzip() output changed - may force resource replacement; base64gzip_compat exists as an experiment.
  2. Generated files are read-only - stored in CAS as links; set mutable = true on a generate block that must be edited (see cas.md).
  3. S3 bootstrap no longer adds a root-access bucket policy - set enable_bucket_root_access = true if you relied on it.
  4. Dependency outputs read from state by default - S3/GCS/azurerm; encrypted state and other backends fall back to output; opt out with --no-dependency-fetch-output-from-state (see performance.md).

Docs Lookup

Prefer the Terragrunt docs MCP server https://mcp.docs.terragrunt.com/mcp (public beta) when available; otherwise https://docs.terragrunt.com.

Version Management

  • Development: Branch refs (ref=feature-branch)
  • Testing: RC tags (ref=v1.0.0-rc1)
  • Production: Stable tags (ref=v1.0.0)

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Terragrunt Skill」では何ができますか?

Use for Terragrunt work (0.68 to 1.2; OpenTofu or Terraform): building an infrastructure catalog, explicit stacks (terragrunt.stack.hcl), units wrapping OpenTofu/Terraform modules, live repos with a root.hcl hierarchy, remote state and locking (S3 lockfile, DynamoDB, GCS, azurerm), multi-account/multi-env with role assumption, classic Gruntwork live repos (_envcommon), migrating a terralith, exploring repos (find, list, dag), wiring dependencies (autoinclude, values), expansion blocks (for_each/count), the Content Addressable Store (CAS), OCI and versioned module sources, upgrading to 1.2,...

TypingMindでTerragrunt Skillを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Terragrunt Skillはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにTerragrunt Skillをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/jfr992/terragrunt-skill/tree/main/skills/terragrunt-skillを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Terragrunt Skillを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Terragrunt Skillで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもTerragrunt Skillを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Terragrunt Skill」は無料ですか?

はい。jfr992がApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇