Subchapter 16.38
README.mdMarkdown2 KBView on GitHub
A family of focused agent skills for working with Terraform Policy — HCP Terraform’s native policy-as-code engine for and files.
.policy.hcl.policytest.hclPick the skill that matches the user’s journey:
| Journey | Reference |
|---|---|
| Write a new Terraform Policy from an English description | tfpolicy-author |
| Translate Sentinel (or adjacent OPA/Rego) to Terraform Policy | tfpolicy-author |
Write or debug a .policytest.hcl test, mock resources, reason about the runner | tfpolicy-test |
terraform-policy/
├── SKILL.md # Router — routes to references below
├── references/
│ ├── tfpolicy-author.md # Authoring + Sentinel conversion (v0.2.0)
│ ├── tfpolicy-test.md # Testing + full testing guide
│ └── verified-syntax.md # Shared source-of-truth syntax reference
├── examples/
│ └── conversion/ # Side-by-side .sentinel / .policy.hcl examples
└── evals/
├── eval.yaml
└── tasks/references/verified-syntax.md is the single source of truth for verified Terraform Policy syntax, function names, and runtime limitations. All reference files link to it rather than duplicating facts — when reference content disagrees with this file, the reference wins.
Authored .policy.hcl files must include a top-level policy { required_providers { ... } } block. tfpolicy validate uses these declarations for schema-aware validation, and validation fails if the block is omitted.
For version ranges, validation is best effort: provider schemas at the lower and upper bounds of the declared range are evaluated. Wildcard targets such as resource_policy "*" are not schema-validated because they may match multiple resource types.
See:
references/tfpolicy-author.md for authoring guidance and examplesreferences/verified-syntax.md for syntax and validation limitationsEach reference is versioned independently via its metadata.version field.
MPL-2.0. Copyright IBM Corp. 2026.