crew-terraform

Configures terraform-docs and tflint to generate and lint Terraform module documentation.

2|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill crew-terraform-mbadali25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crew-terraform
Source: https://github.com/mbadali25/useful-claude-add-ons/tree/main/plugin/crew/skills/crew-terraform
Command: npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill crew-terraform-mbadali25

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Terraform module READMEs constantly drift out of sync with the actual code, and edits made inside the terraform-docs marker block are silently destroyed on the next generation run. This Skill sets up terraform-docs and tflint correctly so documentation is generated from source and staleness fails CI instead of being overwritten. ## Core Features & Use Cases - terraform-docs setup: Installs a .terraform-docs.yml template that injects generated content between BEGIN_TF_DOCS/END_TF_DOCS markers, pulls the header from a /** */ block in main.tf, and appends a footer.md support section. - tflint configuration: Provides a .tflint.hcl template enabling documented-variables, documented-outputs, naming-convention, unused-declarations, and deprecated-index rules, with terraform_comment_syntax deliberately disabled. - Gate integration: Wires terraform fmt, terraform validate, tflint, and terraform-docs --output-check into .crew/verify.json so undocumented variables fail the check instead of mutating the README mid-gate. - Use Case: A team adds a new variable to a Terraform module without a description; the verification gate fails on the stale README check, forcing the documentation to be regenerated before merge. ## Quick Start Set up terraform-docs and tflint for my Terraform module and wire the checks into the verification gate.

Frequently Asked Questions about crew-terraform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up terraform-docs for a Terraform module?

Copy the provided terraform-docs.yml template to .terraform-docs.yml, add a footer.md, and ensure the README contains the BEGIN_TF_DOCS and END_TF_DOCS marker pair. The header is pulled from a /** */ comment block at the top of main.tf, then run terraform-docs to inject the generated content.

Why does my Terraform README keep reverting my edits?

terraform-docs rewrites everything between the BEGIN_TF_DOCS and END_TF_DOCS markers on each run, destroying manual edits inside that block. To change generated content, edit its source: variable descriptions, the main.tf header block, footer.md, or the content section of .terraform-docs.yml.

Does terraform-docs work with older versions like 0.15?

No, this configuration requires terraform-docs >= 0.16.0 because footer-from and the .Module template variable in the content section do not exist in earlier releases. Older versions fail with a confusing template error rather than a clear version message.

Why should I use terraform-docs --output-check in CI instead of the writing form?

The writing form rewrites README.md during the gate, making it a changed file that trips unmapped-file failure rules in a loop. The --output-check form exits non-zero when the README is stale without writing anything, so run the writing form manually instead.

Can tflint replace a security scanner for Terraform?

No, tflint is a linter, not a security scanner. For IaC security findings, add trivy config or checkov and route results through a security review process, keeping slow scans in pull request checks rather than the fast local gate.

How do I document multiple Terraform modules in one repo?

Set recursive.enabled to true and recursive.path to modules in .terraform-docs.yml, and give each submodule its own README with the marker pair. Without this, the root run silently documents only the root module.