terraform-policy
Installation
SKILL.md
terraform-policy
UTILITY SKILL — INVOKES: tfpolicy-author | tfpolicy-test
USE FOR:
- Writing a new
.policy.hclpolicy from a description or requirement - Converting a
.sentinelpolicy to Terraform Policy - Writing or debugging a
.policytest.hcltest file - Migrating a Sentinel policy library to Terraform Policy
Before giving authoring or testing instructions, check the installed tfpolicy CLI version and tailor guidance accordingly:
- If the CLI is
0.1.x, do not requirepolicy { required_providers { ... } }; generate policies compatible with tfpolicy 0.1.x syntax and behavior. - If the CLI is
0.2.0or newer, include a top-levelpolicy { required_providers { ... } }block when authoring.policy.hcl. It is mandatory fortfpolicy validate; version-range validation is best effort, and wildcard targets such asresource_policy "*"are not schema-validated. - If the CLI version is unknown, ask the user to check it first or provide guidance that clearly distinguishes the
0.1.xand0.2.0+paths.