/terragrunt-skill:terragrunt-skillfrom terragrunt-skill
Guides Terragrunt infrastructure work (0.68 to 1.2) with OpenTofu or Terraform: building catalogs, explicit stacks, units, live repos, remote state, multi-account/env, and CI/CD pipelines.
Ships in terragrunt-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill provides guidance for infrastructure using Terragrunt with OpenTofu, following a three-repository pattern:
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.
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.
| Topic | Reference |
|---|---|
| Version compatibility (TG 0.68→1.2, OpenTofu vs Terraform) | version-compatibility.md |
| Naming conventions | naming.md |
| Catalog structure | catalog-structure.md |
| Live repo structure | live-structure.md |
| Classic live structure (implicit stacks) | classic-live-structure.md |
| Modules monorepo | modules-monorepo.md |
| Discovery commands (find/list/dag) | discovery-commands.md |
| Root/account/env configs | root-config.md |
| Unit dependencies | dependencies.md |
| Expansion (for_each/count) | expansion.md |
| Catalog scaffolding | catalog-scaffolding.md |
| Stack commands | stack-commands.md |
| Patterns & best practices | patterns.md |
| State management | state-management.md |
| Multi-account setup | multi-account.md |
| Performance optimization | performance.md |
| Content Addressable Store (CAS) | cas.md |
| CI/CD pipelines (shared + IAM/OIDC setup) | cicd-pipelines.md |
| GitLab CI pipelines | cicd-gitlab.md |
| GitHub Actions pipelines | cicd-github.md |
Units receive configuration through values.xxx:
inputs = {
name = values.name
environment = values.environment
instance_class = try(values.instance_class, "db.t3.medium") # Optional with default
}
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.
Older catalogs resolve symbolic references like "../acm" to dependency outputs inside the unit:
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.
Units reference modules via Git URL with version from values:
terraform {
source = "git::[email protected]: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.
units/<name>/terragrunt.hcl${values.version}values.xxx for inputsautoinclude in the stack (legacy: "../unit" reference resolution)stacks/<name>/terragrunt.stack.hcllocals for computed valuesunit blocks referencing catalog unitsenv.hcl with state_bucket_suffixterragrunt stack generateterragrunt 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.values.version"../unit" resolution only in existing catalogslength(keys(try(values.X, {}))) > 0try(values.X_path, "../default")state_bucket_suffix//path?ref=branch NOT ?ref=branch//pathcondition ? (\n<<-EOF\n...\nEOF\n) : ""base64gzip() output changed - may force resource replacement; base64gzip_compat exists as an experiment.mutable = true on a generate block that must be edited (see cas.md).enable_bucket_root_access = true if you relied on it.output; opt out with --no-dependency-fetch-output-from-state (see performance.md).Prefer the Terragrunt docs MCP server https://mcp.docs.terragrunt.com/mcp (public beta) when available; otherwise https://docs.terragrunt.com.
ref=feature-branch)ref=v1.0.0-rc1)ref=v1.0.0)agents/openai.yaml (opens in a new tab)assets/catalog-structure/modules/template/main.tf (opens in a new tab)assets/catalog-structure/modules/template/outputs.tf (opens in a new tab)assets/catalog-structure/modules/template/variables.tf (opens in a new tab)assets/catalog-structure/stacks/template/terragrunt.stack.hcl (opens in a new tab)assets/catalog-structure/units/template/terragrunt.hcl (opens in a new tab)assets/images/terragrunt-catalog.png (opens in a new tab)assets/live-structure/non-prod/account.hcl (opens in a new tab)assets/live-structure/non-prod/us-east-1/region.hcl (opens in a new tab)assets/live-structure/non-prod/us-east-1/staging/env.hcl (opens in a new tab)assets/live-structure/prod/account.hcl (opens in a new tab)assets/live-structure/prod/us-east-1/region.hcl (opens in a new tab)assets/live-structure/root.hcl (opens in a new tab)references/cas.md (opens in a new tab)references/catalog-scaffolding.md (opens in a new tab)references/catalog-structure.md (opens in a new tab)references/cicd-github.md (opens in a new tab)references/cicd-gitlab.md (opens in a new tab)references/cicd-pipelines.md (opens in a new tab)references/classic-live-structure.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
terragrunt, opentofu, terraform, infrastructure-catalog, iac, gruntwork
npx claudepluginhub jfr992/terragrunt-skill --plugin terragrunt-skillOther plugins' skills for the same job