agentleFS
Microsoft AzureKnown publisherAzure/terraform-azurerm-avm-res-network-applicationgatewaywebapplicationfirewallpolicy/.github/skills/avm-tf-documentation/SKILL.md

avm-tf-documentation

Skill1 starsChanged 13 days agoMITView on GitHub

Use for AVM Terraform generated README content, _header.md, _footer.md, examples documentation, terraform-docs inputs, and Avm.Authoring documentation checks.

231 other projects use a version of this, 4 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 8 are common, 0 are distinctive, and 8 are very specific to this project.

  • 8

    Common

    Most of the 4 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Common:

    Put interface semantics in variable descriptions so generated input tables stay useful.

    line 26
  2. Very specific:

    Document every variable field, especially resource_types, retry, timeouts, and ignore_body_changes.

    line 27
  3. Very specific:

    Ensure provider snippets include Azure/azapi.

    line 29
  4. Common:

    Prefer working examples over duplicated implementation prose.

    line 33
  5. Common:

    Keep headings and links stable for Terraform Registry rendering.

    line 34
  6. Common:

    Do not explain internal review decisions or migration history in the README unless consumers need that information.

    line 35
  7. Very specific:

    Document the module class's pending public-spec addition TFNFR42 example coverage: resource modules require examples/defaults/ and …

    line 36
  8. Very specific:

    Do not use a submodule-only example tree or .e2eignore to replace parent example coverage.

    line 38
  9. Very specific:

    Do not imply semantic WAF compliance from the waf-aligned name alone.

    line 39
  10. Very specific:

    Use Avm.Authoring from PowerShell 7.4 or later:

    line 43
  11. Very specific:

    Do not run terraform-docs directly unless debugging the authoring implementation.

    line 62
  12. Common:

    Use heredocs for structured object documentation.

    line 81
  13. Common:

    If a generated README is stale:

    line 102
  14. Very specific:

    run avm docs or avm pre-commit.

    line 105
  15. Common:

    commit the source and generated output together.

    line 107
  16. Common:

    Do not patch the generated table to make a check pass.

    line 109

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

AVM Terraform Documentation

AVM Terraform README.md files are generated. Never edit them directly.

Documentation for every new resource-deploying module MUST describe an AzAPI-first implementation. Authored and generated snippets use AzAPI for all control-plane and ordinary supporting resources and MUST NOT present AzureRM as a convenience alternative.

Source files

For the root module, every submodule, and every documented example:

  • _header.md contains authored content before the generated Terraform tables.
  • Terraform sources provide requirements, providers, resources, modules, inputs, and outputs.
  • _footer.md contains authored content after the generated tables, including the required data-collection notice where applicable.
  • README.md is the generated result committed to Git.

Submodules are full AVM modules and need their own _header.md, _footer.md, and generated README.md.

Authoring rules

  • Explain purpose, important behavior, prerequisites, and supported scenarios in _header.md.
  • Put interface semantics in variable descriptions so generated input tables stay useful.
  • Document every variable field, especially resource_types, retry, timeouts, and ignore_body_changes.
  • For ignore_body_changes, state that paths are body-relative dot notation, ignored configuration is not sent to Azure, and changes take effect only after apply.
  • Ensure provider snippets include Azure/azapi. Include hashicorp/azurerm only for an exact permitted data-plane/non-ARM operation.
  • In examples, E2E instructions, Terraform tests, fixtures, and setup or teardown snippets, use AzAPI for direct Azure dependencies not supplied by the module under test.
  • For every permitted azurerm_* resource or data-source block, independently document the exact block, the specific unsupported data-plane/non-ARM operation, why no applicable AzAPI resource or action can implement it, the upstream AzAPI issue or pull request, and that the block must be replaced when support ships. One documented block does not authorize another.
  • Preserve legitimate published AVM module source addresses ending in /azurerm; that suffix is a legacy Registry namespace, not an AzureRM provider requirement.
  • Prefer working examples over duplicated implementation prose.
  • Keep headings and links stable for Terraform Registry rendering.
  • Do not explain internal review decisions or migration history in the README unless consumers need that information.
  • Document the module class's pending public-spec addition TFNFR42 example coverage: resource modules require examples/defaults/ and examples/waf-aligned/; pattern and utility modules require examples/defaults/ and may optionally provide waf-aligned.
  • Explain required and applicable conditional inputs in the defaults scenario, while relying on module defaults for optional inputs not needed by that scenario. Describe test-harness prerequisites, deployment scope, location/telemetry controls, and dependency setup separately from module feature overrides.
  • Do not use a submodule-only example tree or .e2eignore to replace parent example coverage. Exercise relevant submodule behavior in a parent example.
  • Do not imply semantic WAF compliance from the waf-aligned name alone. Explain the applicable SFR2 intent only when the scenario implements or arranges it.

Generate documentation

Use Avm.Authoring from PowerShell 7.4 or later:

Import-Module Avm.Authoring
avm docs

avm pre-commit also regenerates documentation:

avm pre-commit

Review and commit the generated README changes. After the worktree is clean, avm pr-check verifies documentation as part of the full PR gauntlet:

avm pr-check

Do not run terraform-docs directly unless debugging the authoring implementation. Do not use ./avm, avm.ps1, Make, Porch, or a container.

Descriptions

Descriptions must be precise enough for a consumer to use the input or output without reading the implementation:

variable "parent_id" {
  type        = string
  nullable    = false
  description = "The fully-qualified ARM resource ID of the existing parent scope into which the resource will be deployed."
}

output "resource_id" {
  value       = azapi_resource.this.id
  description = "The resource ID of the deployed resource."
}

Use heredocs for structured object documentation. Keep defaults and constraints synchronized with the actual type:

variable "ignore_body_changes" {
  type = object({
    example_widgets = optional(list(string), [])
  })
  default  = {}
  nullable = false
  description = <<DESCRIPTION
Body-relative paths to ignore for each AzAPI resource. Paths use dot notation
and changes take effect only after apply. Configuration for an ignored path is
not sent to Azure until the path is removed.

- `example_widgets` - Paths ignored on the widget resource.
DESCRIPTION
}

Failure handling

If a generated README is stale:

  1. change the Terraform source or authored header/footer that owns the content;
  2. run avm docs or avm pre-commit;
  3. inspect the generated diff; and
  4. commit the source and generated output together.

Do not patch the generated table to make a check pass.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.