From terragrunt-skill
Guides Terragrunt infrastructure setup, management, and migration with OpenTofu, including stacks, units, remote state, and multi-account deployments.
How this skill is triggered — by the user, by Claude, or both
Slash command
/terragrunt-skill:terragrunt-skillThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides guidance for infrastructure using Terragrunt with OpenTofu, following a three-repository pattern:
assets/catalog-structure/modules/template/main.tfassets/catalog-structure/modules/template/outputs.tfassets/catalog-structure/modules/template/variables.tfassets/catalog-structure/stacks/template/terragrunt.stack.hclassets/catalog-structure/units/template/terragrunt.hclassets/images/terragrunt-catalog.pngassets/live-structure/non-prod/account.hclassets/live-structure/non-prod/us-east-1/region.hclassets/live-structure/non-prod/us-east-1/staging/env.hclassets/live-structure/prod/account.hclassets/live-structure/prod/us-east-1/region.hclassets/live-structure/root.hclreferences/catalog-scaffolding.mdreferences/catalog-structure.mdreferences/cicd-github.mdreferences/cicd-gitlab.mdreferences/cicd-pipelines.mdreferences/classic-live-structure.mdreferences/dependencies.mdreferences/discovery-commands.mdThis skill provides guidance for infrastructure using Terragrunt with OpenTofu, following a three-repository pattern:
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 |
|---|---|
| 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 |
| 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 |
| 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
}
Units resolve symbolic references like "../acm" to dependency outputs:
inputs = {
acm_certificate_arn = try(values.acm_certificate_arn, "") == "../acm" ?
dependency.acm.outputs.acm_certificate_arn :
values.acm_certificate_arn
}
Units reference modules via Git URL with version from values:
terraform {
source = "git::[email protected]:YOUR_ORG/modules/rds.git//app?ref=${values.version}"
}
units/<name>/terragrunt.hcl${values.version}values.xxx for inputs"../unit" patternsstacks/<name>/terragrunt.stack.hcllocals for computed valuesunit blocks referencing catalog unitsenv.hcl with state_bucket_suffixterragrunt run --all -- backend bootstrap to create state resourcesvalues.version"../unit" → dependency outputslength(keys(try(values.X, {}))) > 0try(values.X_path, "../default")state_bucket_suffix//path?ref=branch NOT ?ref=branch//pathcondition ? (\n<<-EOF\n...\nEOF\n) : ""ref=feature-branch)ref=v1.0.0-rc1)ref=v1.0.0)npx claudepluginhub jfr992/terragrunt-skill --plugin terragrunt-skillGenerates Terragrunt HCL files including root.hcl, terragrunt.hcl, stacks, child modules, multi-env layouts, and dependency wiring with 2025 features like feature flags and exclude blocks.
Structures Terraform repositories using multi-repo strategies, numbered layers for dependency ordering, state-per-layer-per-environment isolation, cross-layer remote state references, and evaluates blast radius of changes.
Guides Terraform/OpenTofu IaC operations: project layout, state management, module design, plan/apply safety, CI/CD pipelines, and secrets handling.