Terragrunt Skill logo

Terragrunt Skill

Community
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).

Overview

Publisherjfr992
Repositoryterragrunt-skill
Skill nameterragrunt-skill
Stars
29
Forks
7
Bundled files
33
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 33 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jfr992 on GitHub. Read the source before you install it.

Installation

Install the Terragrunt Skill AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/jfr992/terragrunt-skill/tree/main/skills/terragrunt-skill
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Terragrunt Skill in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Terragrunt Skill on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Terragrunt Skill is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Terragrunt Skill AI skill do?

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,...

Why use Terragrunt Skill on TypingMind?

Because you install it once and use it with any model. Terragrunt Skill is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Terragrunt Skill in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jfr992/terragrunt-skill/tree/main/skills/terragrunt-skill. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Terragrunt Skill?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Terragrunt Skill?

As many as you like. As long as a model supports skills, you can use Terragrunt Skill with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Terragrunt Skill AI skill free?

Yes. It is published on GitHub by jfr992 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇