terragrunt-specialist
Deep-dive Terragrunt hierarchy review, DRY pattern audits, and run-all orchestration analysis. Use for structured investigations of multi-environment Terragrunt layouts, dependency graphs, remote state config, and hook correctness. Triggers on: "Terragrunt audit", "run-all review", "dependency block", "DRY pattern review", "env hierarchy audit", "mock_outputs", "terragrunt hooks".
- License 许可
- MIT
- 最近更新
- 2026-10-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- id
- terragrunt-specialist
- name
- terragrunt-specialist
- task
- [ "debugging", "review" ]
- type
- skill
- model
- opus
- owner
- @kaiohenricunha
- tools
- Read, Grep, Glob, Bash
- domain
- [ "infra" ]
- effort
- max
- created
- 1735689600000
- updated
- 1776384000000
- version
- 1.0.0
- dotbabel
- { "compute": { "mode": "dynamic", "binding": "consumer", "rationale": "Evidence-based investigation or evaluation must hold several technical constraints at once.", "requirement": "deep" } }
- maturity
- validated
- platform
- [ "terraform", "terragrunt" ]
- description
- Deep-dive Terragrunt hierarchy review, DRY pattern audits, and run-all orchestration analysis. Use for structured investigations of multi-environment Terragrunt layouts, dependency graphs, remote state config, and hook correctness. Triggers on: "Terragrunt audit", "run-all review", "dependency block", "DRY pattern review", "env hierarchy audit", "mock_outputs", "terragrunt hooks".
- allowed-tools
- Read Grep Glob Bash
- argument-hint
- <repo root or terragrunt.hcl path>
02 资源文件 5
- 参考文档references/dependency-blocks.md2.4 KB
- 参考文档references/dry-patterns.md2.3 KB
- 参考文档references/env-hierarchy.md2.5 KB
- 参考文档references/hooks.md2.6 KB
- 参考文档references/run-all.md2.3 KB
03 SKILL.md 正文
Terragrunt Specialist
Structured investigation for Terragrunt-managed Terraform codebases. Five phases: gather context, diagnose, design, recommend, verify.
Arguments
$0— repo root, specificterragrunt.hclpath, or problem description. Required.
Phase 1: Context Gathering
- Map the full hierarchy:
find . -name "terragrunt.hcl" | sort - Identify the root
terragrunt.hcl(containsremote_state,terraform_version_constraint). - Check include chain:
grep -r "include" . --include="terragrunt.hcl" -l grep -r "find_in_parent_folders" . --include="terragrunt.hcl" -l - List all dependency blocks:
grep -r "dependency" . --include="terragrunt.hcl" -A5
Phase 2: Diagnosis
DRY pattern health:
# Check for duplicated locals or inputs across leaves
grep -r "locals" . --include="terragrunt.hcl" -l
grep -r "inputs\s*=" . --include="terragrunt.hcl" -l
Remote state config:
grep -r "remote_state" . --include="terragrunt.hcl" -A10
run-all safety:
terragrunt run-all plan --terragrunt-non-interactive 2>&1 | head -100
Hook correctness:
grep -r "before_hook\|after_hook\|error_hook" . --include="terragrunt.hcl" -A8
Phase 3: Design / Root-Cause Analysis
Map symptoms to causes:
| Symptom | Common Causes | Check |
|---|---|---|
run-all applies wrong order |
Missing dependency block |
Dependency graph via run-all plan |
mock_outputs plan fails |
Wrong type in mock (string vs list) | Compare mock type to real output type |
| DRY violation | Same inputs block in multiple leaves |
Extract to parent locals + read_terragrunt_config |
| State collision | Two leaves share the same backend key | Grep remote_state.config.key across leaves |
| Hook runs unexpectedly | Hook trigger is run_if on wrong command |
Check commands list in hook block |
Cite file:line for every finding.
Phase 4: Recommendations
Output findings in priority order:
[CRITICAL] <title>
File: <file:line>
Issue: <one sentence>
Evidence: <config snippet>
Fix: <specific change, with HCL diff>
Trade-off: <alternative and its downside, if meaningful>
Order: CRITICAL → WARNING → INFO.
Phase 5: Verification
After fixes are applied:
terragrunt validateon affected leaves.terragrunt run-all plan --terragrunt-non-interactive— confirm correct dependency order.- Verify no two leaves share the same remote state key.
- If
mock_outputschanged, confirmplan --terragrunt-non-interactivesucceeds on dependent modules. - Run hooks manually to confirm they execute in the expected phase.
Reference Docs
| File | When to use |
|---|---|
dry-patterns.md |
include, read_terragrunt_config, locals reuse |
run-all.md |
run-all orchestration, dependency graph, scoping |
env-hierarchy.md |
Account → region → env → module layout patterns |
hooks.md |
before_hook, after_hook, error_hook design |
dependency-blocks.md |
Explicit deps, mock_outputs, cross-stack references |
04 同仓库更多 Skills
yolo
Start temporary autonomy for the current task or an explicit scope with a required --for expiry. Codex permits scoped pushes, merges, deploys, and releases after strict testing and validation; Full access is a separate runtime setting. Claude Code uses a session permission hook with a protected-action denylist.
veracity-audit
Audit a data pipeline for Veracity and Value. Dispatches data-scientist, compliance-auditor, and data-engineer agents with project context injected at dispatch time. All source paths are supplied via flags — no defaults, no project assumptions. Subcommands: audit (full pipeline walk), score-check (scoring math only), gate-check (gate coverage only), source-trace <label> (single source end-to-end). Invoke when: "audit pipeline", "veracity check", "scoring math correct?", "check gates", "trace source", "verify quality gates", "formula correct?".
validate-spec
Audit an already-implemented spec against the codebase. Walks each constraint (ARCH-N, PERF-N, KD-N, etc.) and acceptance criterion, grounds findings in file:line evidence, runs the spec.json acceptance_commands, and writes a single audit doc to docs/audits/. Use whenever the user asks to "validate a spec", "audit a spec", "check if spec is implemented", "verify the spec is done", "is this spec really done", or otherwise wants closure on spec-driven work. Read-only against the spec — produces an audit, never modifies the spec itself.
terraform-specialist
Deep-dive Terraform architecture review, module design, state management, and migration. Use for structured investigations of Terraform workspaces, provider configuration, module coupling, import workflows, and test coverage. Triggers on: "Terraform audit", "module review", "state management", "Terraform import", "workspace design", "provider config review", "Terraform testing".
spec
Create structured engineering specs through interactive pairing. Use when the user wants to create a spec, design doc, technical specification, architecture document, RFC, or engineering plan. Triggers on "let's spec this out", "create a spec", "design doc", "write a technical plan", "plan the architecture". Works for greenfield and brownfield projects. Outputs to docs/specs/.
smoke-test
Run the smoke checks a repository declares for its deploy targets and report whether production actually answers after a release. Use after a deploy, during release verification, and when confirming a rollback landed. Triggers on: "smoke test", "run smoke checks", "is production healthy", "did the deploy work", "verify the release is live".